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 |
|---|---|---|---|---|---|---|---|
PHP | UTF-8 | 8,546 | 2.515625 | 3 | [] | no_license | <?php
class RActiDepaPFunAFXls
{
private $columnas=array();
private $fila;
private $objParam;
public $url_archivo;
var $total;
var $datos_entidad;
var $datos_periodo;
var $ult_codigo_partida;
var $ult_concepto;
function __construct(CTParametro $objPa... |
Java | UTF-8 | 1,370 | 2.5625 | 3 | [] | no_license | package com.oompow.homeboi;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.PowerManager;
/**
* Created by scottvanderlind on 7/16/15.
*/
public class OnScreenOffReceiver extends BroadcastReceiver {
... |
Markdown | UTF-8 | 1,341 | 3.015625 | 3 | [] | no_license | # GraphGitRepo
Creates a map of a git repository. To achieve this there are two scripts available:
* shell script `get_data_fom_git.sh`
* python script `draw_graph.py`
The first one prepares the necessary data with the help of `git` commands. The python script then visualizes the data previously collected with the h... |
PHP | UTF-8 | 4,066 | 2.796875 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace MAD\ExperienceBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Question
*/
class Question
{
/**
* @var integer
*/
private $id;
/**
* @var string
*/
private $title;
/**
* @var string
*/
private $wording;
/**
* @var \DateTime
... |
TypeScript | UTF-8 | 4,088 | 2.734375 | 3 | [] | no_license | import { IGCPubnubConfig } from '../types/IGCPubnubConfig';
import { Unwatch } from '../utils';
// pubnub doesn't work in web worker by default,
// so we use slightly modified web worker compatible version
import PubNub from './misc/pubnub';
export class GCPubNub {
private _callbacks: Map<string, any[]> = new Map<st... |
Python | UTF-8 | 5,659 | 2.890625 | 3 | [
"MIT"
] | permissive | #!/usr/sbin/env python3
import argparse
import os
import sys
import shutil
import logging
import uuid
import re
import threading
import requests
import rarfile
logger = logging.getLogger('rapiddl.main')
def clean_name(link):
'''Cleans a file name, stripping it it's base url.
Args:
link (str): a ... |
C++ | UTF-8 | 7,142 | 2.828125 | 3 | [] | no_license | #include "pch.h"
#include "corona.h"
string corona::getmeta()
{
return meta_file_path;
}
void corona::openfile(vector <string>& file_names, ifstream& in)
{
//for loop runs till the number of images mentioned at the start of the meta file
string file_path;
in >> file_path;
//file names are read and... |
TypeScript | UTF-8 | 226 | 2.625 | 3 | [] | no_license | import { PrimaryColumn, Column, Entity } from 'typeorm';
@Entity()
export class KeyValuePair {
@PrimaryColumn()
key?: string;
@Column({
type: 'varchar',
length: 90,
nullable: false,
})
value: string;
}
|
PHP | UTF-8 | 906 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace Database\Factories;
use App\Models\Equipe;
use Illuminate\Database\Eloquent\Factories\Factory;
class EquipeFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Equipe::class;
/**
* Define the model's... |
Java | UTF-8 | 868 | 2.65625 | 3 | [] | no_license | import java.util.Objects;
public class answerkey extends exam {
public static int mark;
String qstno;
public answerkey(String qstno, String answer, int mark) {
this.qstno = qstno;
this.answer = answer;
this.mark = mark;
}
void answer(){
int mark1;
... |
C# | UTF-8 | 1,126 | 3.390625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFX2SaveEditor
{
public static class Utils
{
public static double RadianToDegree(double angle)
{
return angle * (180.0 / Math.PI);
... |
Markdown | UTF-8 | 2,008 | 2.703125 | 3 | [] | no_license | 自2020年12月1日起,专线网关提供自然月内各实例的出方向用量明细详情,帮助您精准量化资源消耗,轻松核算项目成本。本文将介绍如何下载并查看专线网关用量明细。
>?目前流控功能仅支持 VPC 型的专线网关。
>
## 操作步骤
1. 登录 [专线接入控制台](https://console.cloud.tencent.com/dc/dc) ,并在右上角菜单栏选择**费用** > **费用账单**。
2. 在费用中心控制台左侧导航栏选择**费用账单**> **用量明细下载**。
3. 在“用量明细下载”页面上方选择账单月份。
>? 用量明细是按扣费时间生成的月度账单。例如在1月31日23:00~23:59使用的按小时结算的按量计费资... |
TypeScript | UTF-8 | 667 | 3.125 | 3 | [] | no_license | import {
parseDate,
parseDateTime,
dayOfYear,
currentDayOfYear,
} from "https://deno.land/std/datetime/mod.ts";
console.log(parseDate("20-01-2019", "dd-mm-yyyy")); // output : new Date(2019, 0, 20)
console.log(parseDate("2019-01-20", "yyyy-mm-dd")); // output : new Date(2019, 0, 20)
console.log(parseDateTime(... |
Swift | UTF-8 | 7,046 | 2.640625 | 3 | [] | no_license | //
// SmartHomeTests.swift
// SmartHomeTests
//
// Created by Goga Barabadze on 12.10.20.
// Copyright © 2020 Goga Barabadze. All rights reserved.
//
import XCTest
@testable import Smart_Home
class ModelTests: XCTestCase {
override func setUpWithError() throws {
}
override func tearDownWith... |
Python | UTF-8 | 3,711 | 3.078125 | 3 | [] | no_license | """
Host Scanning
=============
"""
import random
from ipaddress import IPv4Address, IPv4Network
from mininet.node import Controller
from container.kali import Kali
from scenarios import Scenario
from utils import subnet
class Import(Scenario):
"""This scenario asks the user to find out informati... |
Java | UTF-8 | 1,901 | 2.609375 | 3 | [] | no_license | package cz.vutbr.fit.gja.gjaddr.gui;
import com.community.xanadu.components.table.BeanReaderJTable;
import cz.vutbr.fit.gja.gjaddr.persistancelayer.*;
import java.util.List;
import javax.swing.*;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.TableRowSorter;
/**
* Panel with conta... |
Java | UTF-8 | 138 | 1.546875 | 2 | [
"Apache-2.0"
] | permissive | package com.hyq.hm.videosdk.impl;
public interface OnAuthStateListener {
void onSucess();
void onFail();
void onError();
}
|
Python | UTF-8 | 6,838 | 2.59375 | 3 | [] | no_license | import os
import math
import pandas as pd
import numpy as np
from joblib import load
#default_path = r'C:\Users\Cyndi\Documents\Git Repository\Stat 404 Private\Project_Final'
#os.chdir(default_path)
# Load model
model = load('app_installations.joblib')
# User input data
def input_data():
INPUT = pd.DataFrame()
... |
Go | UTF-8 | 485 | 3.546875 | 4 | [] | no_license | package leetcode
import "fmt"
func jump(nums []int) int {
// 记录可达最远距离
max := 0
// 记录步数
step := 0
// 寻找范围内最远距离的过程中最远距离可能会更新,所以用一个 end 变量来记录。
end := 0
for i := 0; i < len(nums)-1; i++ {
max = getMax(max, nums[i]+i)
if i == end {
step++
end = max
}
fmt.Println(end)
}
fmt.Println(step)
return s... |
Java | UTF-8 | 1,434 | 2.34375 | 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 br.com.onesystem.domain.builder;
import br.com.onesystem.domain.Item;
import br.com.onesystem.domain.ItemDePedido;
im... |
Go | UTF-8 | 1,818 | 2.59375 | 3 | [] | no_license | package mongodb
import (
"context"
"fmt"
config "golang-project/config/db"
"golang-project/config/dbiface"
"golang-project/models"
"log"
"github.com/segmentio/ksuid"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
)
type SessionsCollection struct {
Ca *mongo.Collection
}
func GetSes... |
PHP | UTF-8 | 1,324 | 3.53125 | 4 | [] | no_license | <?php
class PasswordGenerator {
public function __construct(){
}
private function generatePasswordString(){
// Generer tekststreng
// ASCII tal
for($i = 48; $i <= 57; $i++){
$allChars .= chr($i);
}
// ASCII store bogstaver
for($i = 65; $i <= 90; $i++){
... |
C# | UTF-8 | 6,532 | 2.5625 | 3 | [] | no_license | using Managing_Car_Program.DB;
using MaterialSkin.Controls;
using MySql.Data.MySqlClient;
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;
namespace Mana... |
Java | UTF-8 | 5,502 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | package org.adligo.fabricate.common.files;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.StandardCopyOption;
import java.util.List;
import java.util.zip.ZipFile;
/**
* T... |
Markdown | UTF-8 | 6,045 | 2.515625 | 3 | [] | no_license | ---
layout: post
title: Trackguru, l'application des alumni Thomas Chrétien et Olivier Brunet dédiée au son techno
author: cedric
labels:
- alumni
- startup
pushed: true
thumbnail: thomas-chretien-trackguru.jpg
description: "Parmi les alumni du Wagon se cachent certains individus aux initiatives sonores sympathique... |
Shell | UTF-8 | 828 | 3.265625 | 3 | [] | no_license | #!/bin/bash
TARGET_HOST="$MPD_MUSIC_HOST"
CONTROL_SOCKET=/tmp/player-control-socket
EXITING=
if [[ "$TARGET_HOST" = "" ]] ; then
echo "Your environment variable for MPD_MUSIC_HOST is not set."
exit 1
fi
function stop-tunnel {
if [ -e "$CONTROL_SOCKET" ] ; then
echo ":: closing tunnels..."
... |
Java | UTF-8 | 2,875 | 2.125 | 2 | [
"GPL-2.0-only",
"Apache-2.0",
"BSD-3-Clause",
"MIT",
"GPL-1.0-or-later",
"LicenseRef-scancode-unknown",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause"
] | permissive | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not u... |
Java | UTF-8 | 2,019 | 1.921875 | 2 | [
"Apache-2.0"
] | permissive | package cu.uci.solr;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.params.CommonParams;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
public class MaxParamsSearchComponentTest ex... |
SQL | UTF-8 | 2,839 | 3.09375 | 3 | [
"MIT"
] | permissive |
ALTER view [dw].[v_st_toimitilat] as
--amk
select
Tilastovuosi = vuosi
--,Ammattikorkeakoulu = d7.amk_nimi_fi
,Yliopisto = d1.yo_nimi_fi
,Ammattikorkeakoulu = NULL
,Toimipiste = NULL
,Toimipaikka = NULL
--mittarit
,harjoittelukoulujen_tilat
,muut_vuokratilat
,yliopistokiinteistoyhtion_toimitilat_aalto_yliopistoki... |
Java | UTF-8 | 958 | 2.09375 | 2 | [] | no_license | package com.apr7.sponge.model;
import com.apr7.sponge.constants.PollutantTypeEnum;
public class Pollutant {
private Long id;
private String name;
private PollutantTypeEnum type;
private Boolean show;
private Integer order;
private PollutantMapping mapping;
public Long getId() {
return id;
}
public void ... |
Java | UTF-8 | 6,076 | 2.359375 | 2 | [
"MIT"
] | permissive | package com.eaglesakura.andriders.media;
import com.eaglesakura.andriders.AcesEnvironment;
import com.eaglesakura.andriders.central.CentralDataReceiver;
import com.eaglesakura.andriders.serialize.AcesProtocol;
import com.eaglesakura.andriders.serialize.GeoProtocol;
import com.eaglesakura.andriders.serialize.MediaMetaP... |
Swift | UTF-8 | 1,463 | 2.59375 | 3 | [
"MIT"
] | permissive | //
// Copyright © 2020 Tasuku Tozawa. All rights reserved.
//
import Domain
protocol ClipCollectionMenuBuildable {
func build(for clip: Clip, source: ClipCollection.Source) -> [ClipCollection.MenuElement]
}
struct ClipCollectionMenuBuilder {
// MARK: - Properties
private let storage: UserSettingsStorag... |
Python | UTF-8 | 909 | 3.765625 | 4 | [
"MIT"
] | permissive | from Data_Structures.linked_list.linked_list import LinkedList
def zipLists(list_one,list_two):
#Edge cases when one of the lists is empty
if not list_one:
return list_two
elif not list_two:
return list_one
zip_list = LinkedList()
current_one=list_one
current_one=current_one.hea... |
Python | UTF-8 | 686 | 2.59375 | 3 | [] | no_license | w = 25
h = 6
image = input()
layers = [image[i:i+w*h] for i in range(0, len(image), w*h)]
# min0, minLay = min((sum(1 for p in l if p == "0"), l) for l in layers)
# print(sum(1 for p in minLay if p == "1") * sum(1 for p in minLay if p == "2"))
finalImg = [p for p in layers[-1]]
for l in reversed(layers):
... |
Python | UTF-8 | 703 | 4.53125 | 5 | [] | no_license | def is_anagram(first, second):
if len(first) != len(second):
return False
first, second = sorted(first.lower()), sorted(second.lower())
if first != second:
return False
return True
# I want you to write a function that accepts two strings and returns True if the two strings are anagrams... |
Java | UTF-8 | 1,398 | 2.359375 | 2 | [] | no_license | package com.example.catapp.fragments;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.exa... |
Java | UTF-8 | 2,648 | 2.3125 | 2 | [] | no_license | package studyFire.schedule.domain;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.Rollback;
import org.springframework.trans... |
JavaScript | UTF-8 | 2,127 | 3.203125 | 3 | [] | no_license | var ANGLE = -3;
var X_NUMBER = 100;
var Y_NUMBER = 10;
var body = document.getElementsByTagName('body')[0];
function move() {
ANGLE = (event.pageX - window.innerWidth/2)/100;
var top;
var divList = body.getElementsByTagName('div');
for (var i=0; i<X_NUMBER; i++) {
top = 0;
for (var j=0;... |
Java | UTF-8 | 3,818 | 2.734375 | 3 | [] | no_license | /*
* TunerMIDlet.java
*
*/
package net.sharedmemory.tuner;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
/**
* An instrument tuner MIDlet. It detects the pitch of the note played
* and displays whether it is sharp, flat or in tune.
*
* @author David Keen
*/
public class TunerMIDlet ... |
JavaScript | UTF-8 | 272 | 2.96875 | 3 | [] | no_license | Game.extend = function extend(src, dest) {
// Create a copy of the source.
const result = {};
for (const key in src) {
result[key] = src[key];
}
// Copy over all keys from dest
for (const key in dest) {
result[key] = dest[key];
}
return result;
};
|
Java | UTF-8 | 14,071 | 2.21875 | 2 | [] | no_license | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package edu.facilities.services;
import edu.facilities.dao.FacilitiesInfoDao;
import edu.facilities.dao.ReserveRecordDao;
import edu.facilities.dao.UserDao;
import edu.facilities.dao.VacationDao;
import edu.facilities.m... |
Java | UTF-8 | 8,769 | 3.578125 | 4 | [] | no_license | package com.alejandroaraya.ds.chicagoanalysis;
import com.alejandroaraya.ds.chicagoanalysis.models.Worker;
public class Facts {
private Worker[] workers;
public Facts(Worker[] workers) {
this.workers = workers;
// this.getHigherPaidWorker();
this.getHigherPaidHalfTimePosition();
// ... |
TypeScript | UTF-8 | 322 | 2.796875 | 3 | [] | no_license | import { BasicTreeNode } from './basic-node';
export type NRangeNode = RangeNode | null;
export class RangeNode extends BasicTreeNode {
public min: number;
public max: number;
constructor(key: number, min: number = -Infinity, max: number = Infinity) {
super(key);
this.min = min;
this.max = max;
}... |
Java | UTF-8 | 3,736 | 2.46875 | 2 | [] | no_license | package com.zcq;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInterceptor;
import com.zcq.dao.StudentDao;
import com.zcq.domain.MyStudent;
import com.zcq.domain.Student;
import com.zcq.utils.MybatisUtil;
import org.apache.ibatis.session.SqlSession;
import... |
C++ | UTF-8 | 406 | 2.96875 | 3 | [] | no_license | #include "../Socket.hpp"
#include <string.h>
using namespace std;
int main(){
char chunk[100];
try{
Socket::TCP server;
server.listen_on_port(10000);
Socket::TCP client = server.accept_client();
cout << "receiving ... " << endl;
client.receive<char>(chunk, 100);
cout << chunk << endl;
cout << "d... |
Python | UTF-8 | 947 | 2.734375 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# In[70]:
import pandas as pd
import seaborn as sns
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.naive_bayes import MultinomialNB
from sklearn import svm
import pickle
# In[2]:
df = p... |
C# | UTF-8 | 1,998 | 3.421875 | 3 | [
"MIT"
] | permissive | using System;
using System.Linq;
using System.Reflection;
namespace BassUtils
{
/// <summary>
/// Copies properties from one object to another.
/// </summary>
public static class PropertyCopier
{
/// <summary>
/// Copies all possible property values from <paramref name=... |
C# | UTF-8 | 4,023 | 2.671875 | 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.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;... |
Python | UTF-8 | 774 | 4.28125 | 4 | [] | no_license | "8. Escreva um programa que pergunte a quantidade de km percorridos por um carro alugado pelo usuário, assim como a quantidade de dias pelos quais o carro foi alugado. Calcule o preço a pagar, sabendo que o carro custa R$ 60,00 por dia e R$ 0,15 por km rodado."
from typing import Tuple
km_carro = float (input("Info... |
PHP | UTF-8 | 2,083 | 2.734375 | 3 | [
"MIT"
] | permissive | <?php
/*
* Copyright (c) 2017 Salah Alkhwlani <yemenifree@yandex.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Yemenifree\Validation;
class TranslateLoader
{
protected $path;
protected $defaultPath;
pr... |
Swift | UTF-8 | 371 | 2.6875 | 3 | [] | no_license | //
// NSLayoutConstraint+setContraint.swift
// Common
//
// Created by Breno Aquino on 18/12/21.
//
import UIKit
public extension NSLayoutConstraint {
func set(id: String? = nil, priority: UILayoutPriority? = nil, isActive: Bool = true) {
identifier = id
if let priority = priority { self.priori... |
PHP | UTF-8 | 3,145 | 3.09375 | 3 | [
"MIT"
] | permissive | <?php
class Log {
private $id;
private $ip;
private $userAgent;
private $api;
private $status;
private $user;
private $timestamp;
/* Constructor */
private function __construct($id, $ip, $userAgent, $api, $status, $user, $timestamp) {
$this->id = $id;
$this->ip = $ip... |
C | UTF-8 | 3,149 | 3.484375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include "../1.PublicDefine/publicDefine.c"
#define LIST_INIT_SIZE 100 //线性表最大初始空间
#define LISTINCREMENT 10 //线性表分配空间增量
typedef struct {
ElemType *elem;//指针等于说是数组
int length;
int listSize;
} SqList;
//初始化函数
Status initSqList(SqList *list) {
list->elem = (ElemType... |
Markdown | UTF-8 | 1,879 | 3.03125 | 3 | [] | no_license | 负责人:王硕
## Scroller
跨平台相同操作体验的滚动组件。
> **[info] 新增**
> 使用v-model可以绑定判断是否在顶部的Boolean值
>
### 基本用法
``` html
<scroller style="flex-grow: 1" ref="scroller" @pullRefresh="refresh" canPullRefresh>
<div>content</div>
</scroller>
```
```js
import Scroller from '@/components/Scroller'
export default {
components: {
Scr... |
Markdown | UTF-8 | 1,184 | 3.34375 | 3 | [
"Apache-2.0"
] | permissive | # GPIO 通用输入输出
GPIO 口用于读写开关量信号, 即可以用于控制类似 LED 灯之类的简单设备, 也可以用于读取按钮或类似设备的开关状态
通过 `require('device/gpio')` 调用。
## gpio
gpio(pin)
## gpio:close
gpio:close(callback)
所其他所有方法之后调用, 用来关闭打开或导出的 GPIO 文件 (不会影响 GPIO 口的状态)
## gpio:open
gpio:open(callback)
必须在其他方法前调用
- callback {function} 打开完成后被调用
## gpio:di... |
JavaScript | UTF-8 | 368 | 3.0625 | 3 | [] | no_license | //url的关键字提取函数
function urlTool(urlStr) {
//1. 把url以?分割
var arr = urlStr.split("?").pop().split("&");
console.log(arr); //["proName=1", "page=1"]
var query = [];
arr.forEach(function(v) {
var param = v.split("=");
// query[param[0]] = param[1];
query.push(param[1]);
})... |
Markdown | UTF-8 | 4,569 | 2.515625 | 3 | [] | no_license | .NET WHOIS Lookup and Parser
============================
[](https://github.com/flipbit/whois/stargazers) [](https://github.com/flipbit/whois/issues) [ -> int:
def stairs(i):
if i <= 2:
return i
return stairs(i - 1) + stairs(i - 2)
return stairs(n)
def climbStairs2(self, n: int) -> int:
if n <= 2:
return n
dp = [0 for _ in range(... |
Markdown | UTF-8 | 2,417 | 3.859375 | 4 | [] | no_license | ## Implementation of listeners and event handlers
### Python
Python does not have listeners or event handlers by default. It is up to the programmer to implement for themselves (using, for example, Observer patterns), or to import a library that will add the functionality.
### C#
C# has one of the richest event system... |
PHP | UTF-8 | 759 | 2.625 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
*
* PHP version 5.6, 7
*
* @package Zeravcic\PhpUnit_De\Tests\chapter09
* @author Nikola Zeravcic <niks986@gmail.com>
* @license <http://opensource.org/licenses/gpl-license.php GPL
* @link http://nikolazeravcic.iz.rs Personal site
*/
namespace Zeravcic\PhpUnit_De\Tests\cha... |
Python | UTF-8 | 2,263 | 4.5 | 4 | [] | no_license | """
Given an array of integers, return `True` or `False` if array has two numbers
that add up to a specific target.
Assumption:
- Each input has only one solution so the algorithm will return on the first result
APPROACHES:
There are three solution provided to this problem as different... |
Python | UTF-8 | 291 | 3.09375 | 3 | [] | no_license | s=input()
c=1
g=""
for i in range(0,len(s)):
if i<len(s)-1:
if s[i]==s[i+1]:
c+=1
elif s[i]!=s[i+1]:
g=g+s[i]+str(c)
c=1
else:
if s[i]==s[i-1]:
g=g+s[i]+str(c)
else:
g=g+s[i]+str(1)
print(g)
|
C++ | UTF-8 | 1,015 | 3.03125 | 3 | [] | no_license | #ifndef __NETSERVER_COUNTDOWNLATCH_H__
#define __NETSERVER_COUNTDOWNLATCH_H__
#include"noncopyable.h"
#include<mutex>
#include<condition_variable>
/**
* 倒计时(CountDownLatch)同步手段, 主要用途
*
* 一. 主线程发起多个子线程,等这些子线程各自都完成一定的任务之后,主线程才继续执行。
* 通常用于主线程等待多个子线程完成初始化。
*
* 二.... |
Python | UTF-8 | 4,939 | 3.546875 | 4 | [] | no_license | class DoublyLinkedList:
class _Node:
def __init__(self,_value):
self._value = _value
self._previous_node = None
self._next_node = None
def __init__(self):
self._head = None
self._queue = None
self._size = 0
def __str__(self):
_ar... |
PHP | UTF-8 | 2,985 | 2.6875 | 3 | [] | no_license | <?php
if (strpos($_SERVER["HTTP_ACCEPT"], "application/rss+xml") !== FALSE)
header("Content-Type: application/rss+xml");
else
header("Content-Type: application/xml");
$user = $_GET["user"];
$notesContent = file_get_contents("https://api.openstreetmap.org/api/0.6/notes/search?display_name=".urlencode($user)."&... |
Java | UTF-8 | 2,049 | 2.59375 | 3 | [] | no_license | package com.pepario.run.Levels;
public class Level
{
private String leaderboardKey;
private String tmxLevelName;
private String musicNameWithPath;
private int nextLevelId;
private float playerMaxRunningSpeed;
private float deltaTimeRunningSpeedUpdateWeight;
private float playerMovementSpeed... |
JavaScript | UTF-8 | 3,131 | 4.125 | 4 | [] | no_license | /* we need the button and that container div */
const get_meal_btn = document.getElementById(
"get_meal"
); /* we're making a GET request to that endpoint, it sends back a JSON response, which we can parse in order to retrieve the data we want.*/
const meal_container = document.getElementById("meal");
get_me... |
Shell | UTF-8 | 719 | 3.484375 | 3 | [
"Apache-2.0"
] | permissive | #!/bin/bash
config=/mattermost/config/config.json
echo -ne "Configure database connection..."
if [ ! -f $config ]
then
cp /config.template.json $config
sed -Ei "s/MYSQL_USER/$MYSQL_USER/" $config
sed -Ei "s/MYSQL_PASSWORD/$MYSQL_PASSWORD/" $config
sed -Ei "s/MYSQL_DATABASE/$MYSQL_DATABASE/" $config
... |
Shell | UTF-8 | 1,203 | 3.828125 | 4 | [] | no_license | #!/bin/bash
#check for sudo
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
if [ $# -eq 0 ]
then
echo "You should specify java file as argument"
exit 1
elif [ $# -gt 1 ]
then
echo "Specify only the java installation tar file"
exit 1
else
echo "Installation starts now"
fi ... |
C | UTF-8 | 1,356 | 3.15625 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#define NO_PACKETS 10
int rand1(int a){
int rn = (random() % 10) % a;
return rn = 0 ? 1 : rn;
}
int main(){
int packets[NO_PACKETS],i,clk,bsize,oprate,rem=0,op,prize,ptime;
for(i=0;i<NO_PACKETS;i++){
packets[i] = rand1(6) * 10;
printf("%d\n",packets[i]);
... |
TypeScript | UTF-8 | 6,372 | 2.859375 | 3 | [
"MIT"
] | permissive | import { IconCollection } from "../IconCollection";
import { Icon, IconAttributes } from "../Icon";
const iconTest = (name: string): IconAttributes => ({
name,
texture: `assets/${name}`
});
describe("IconCollection", () => {
describe("constructor", () => {
const iconCollection = new IconCollection([
n... |
Java | UTF-8 | 890 | 2.296875 | 2 | [] | no_license | package com.mobilevanity.backend;
import com.mobilevanity.backend.common.Result;
import com.mobilevanity.backend.common.Utility;
import com.mobilevanity.backend.data.Brand;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.se... |
PHP | UTF-8 | 23,338 | 3.015625 | 3 | [] | no_license | <?php
namespace sergeynezbritskiy\ZendPdfTable\Table;
use sergeynezbritskiy\ZendPdfTable\AbstractElement;
use sergeynezbritskiy\ZendPdfTable\Table;
use Zend_Exception;
use Zend_Pdf_Image;
use Zend_Pdf_Page;
use Zend_Pdf_Style;
/**
* Class Cell
*
* @package sergeynezbritskiy\ZendPdfTable\Table
*/
class Cell exten... |
C# | UTF-8 | 2,544 | 3.6875 | 4 | [] | no_license | namespace DefiningClasses
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class School
{
private List<Trainer> trainers;
public List<Trainer> Trainers
{
get { return this.trainers; }
}
public S... |
Rust | UTF-8 | 2,587 | 2.9375 | 3 | [
"MIT"
] | permissive | extern crate indextree;
#[cfg(feature = "par_iter")]
extern crate rayon;
use indextree::Arena;
#[cfg(feature = "par_iter")]
use rayon::prelude::*;
#[test]
fn arenatree_success_create() {
let mut new_counter = 0;
let arena = &mut Arena::new();
macro_rules! new {
() => {{
new_counter += ... |
Java | UTF-8 | 523 | 3.234375 | 3 | [] | no_license | package task10_3;
import java.util.ArrayList;
import java.util.Date;
public class Statistics {
public ParkedCar[] parkedCars;
public ParkedCar[] getCars(Date start, Date end) {
ArrayList<ParkedCar> list = new ArrayList<ParkedCar>();
for(ParkedCar c : parkedCars) {
if(c.in.compareTo(start) >= 0 && c.out... |
Markdown | UTF-8 | 1,541 | 3.4375 | 3 | [] | no_license | ## DatePicker
Using NgbModule you need to convert initial value
```javascript
/**
* fixInitialDateValue
* @param datePipe datePipe service, must be declare before use
* in components module, then initilized in components constructor
* @param dateValue
* @returns formatted dat... |
Markdown | UTF-8 | 962 | 2.8125 | 3 | [] | no_license | # 网络应用开发课程实践项目
## 想法
+ 后端使用MySQL + JDBC
+ Web框架实用SpringBoot框架
+ 前断html + css +thymeleaf + js
## 相关技术
+ MySQL + JDBC之前接触过,不介绍了
+ SpringBoot是一个纯Java的Web框架
+ 前端主要介绍一下thymeleaf,这是一个从html模板生成动态页面的技术,也是SpringBoot官方推荐的动态页面技术,大该就是在html中写一些变量,然后在Web框架中设置这些变量,然后返回这个设置好的页面。可以参见article.html和articles.html中的动态显示文章的部分。
## 进度
#### 目前... |
Markdown | UTF-8 | 3,634 | 2.65625 | 3 | [] | no_license | ---
categories: !!python/unicode 'WebNotes'
channel_desc: 请不要被「小道消息」这个名字误导.在这里,我只想努力为读者呈现一幅中国互联网的清明上河图.
channel_ercode: !!python/unicode 'img/WebNotes.ercode.png'
channel_id: !!python/unicode 'WebNotes'
channel_name: 小道消息
channel_photo: !!python/unicode 'img/WebNotes.photo.png'
createtime: 2016-03-31 07:37:45+00:00
des... |
Java | UTF-8 | 13,185 | 1.632813 | 2 | [
"Apache-2.0",
"GPL-1.0-or-later"
] | permissive | // This file is part of CPAchecker,
// a tool for configurable software verification:
// https://cpachecker.sosy-lab.org
//
// SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
//
// SPDX-License-Identifier: Apache-2.0
package org.sosy_lab.cpachecker.cpa.composite;
import static com.google.commo... |
Python | UTF-8 | 505 | 2.8125 | 3 | [] | no_license | class Solution:
def minSetSize(self, arr: List[int]) -> int:
L = len(arr) / 2
m = {}
for a in arr:
if a not in m:
m[a] = 0
m[a] += 1
n = list(map(lambda i: (-i[1], i[0]), m.items()))
heapq.heapify(n)
... |
PHP | UTF-8 | 1,025 | 2.625 | 3 | [] | no_license | <?php
class CambioContraMdl {
private $bd;
function __construct() {
require_once( "BaseDeDatos.php" );
$this -> bd = BaseDeDatos::obtenerInstancia();
}
function esAlumno( $pass, $nuevo_pass ) {
$consulta = "UPDATE alumno SET password = \"$nuevo_pass\" WHERE password = \"$pass\"";
$result = $this -> bd ->... |
C# | UTF-8 | 496 | 2.59375 | 3 | [] | no_license | using System;
using BankDemo.ServiceIntefaces;
namespace BankDemo.Services
{
public class ConsoleLogService : ILogService
{
public void Info(string message)
{
Console.WriteLine("INFO: {0}", message);
}
public void Warning(string message)
{
Conso... |
C++ | UTF-8 | 4,474 | 2.625 | 3 | [
"BSD-2-Clause"
] | permissive | /*
@@@@@@@@ @@ @@@@@@ @@@@@@@@ @@
/@@///// /@@ @@////@@ @@////// /@@
/@@ /@@ @@@@@ @@ // /@@ /@@
/@@@@@@@ /@@ @@///@@/@@ /@@@@@@@@@/@@
/@@//// /@@/@@@@@@@/@@ ////////@@/@@
/@@ /@@/@@//// //@@ @@ /@@/@@
/@@ @@@//@@@@@@ //@@... |
Java | UTF-8 | 1,980 | 2.921875 | 3 | [
"Apache-2.0"
] | permissive | package com.seven.util;
import com.seven.core.GlobalException;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
/**
* @author 最爱吃小鱼
*/
public class Assert {
/**
* 判断对象是否为空
* @param bean
* @param message
*/
public static void isNull(String message... |
JavaScript | UTF-8 | 3,182 | 2.546875 | 3 | [
"MIT"
] | permissive | import {
all,
compose,
contains,
equals,
filter,
find,
flatten,
keys,
not,
partial,
pick,
propEq,
reduce,
values,
zip
} from "ramda"
import { Chess } from "chess.js"
import { sample } from "~/share/util"
import { PAWN } from "~/share/chess"
import {
UNIVERSE,
LOGIN,
GAME,
PLAY,
... |
Java | UTF-8 | 267 | 1.648438 | 2 | [] | no_license | package typehier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class AppCtx4Type {
@Bean
public ConsolePrinter printer() {
return new ConsolePrinter();
}
}
|
Markdown | UTF-8 | 3,243 | 3.390625 | 3 | [] | no_license | # AJAX : TP de l'après midi !
Dans cet exercice, nous allons nous connecter à une source de données externe en AJAX afin de récupérer des auteurs et leurs articles !
# Structure HTML :
Votre page devra contenir :
1) Un header qui contiendra un h1 avec le titre "_Bienvenue sur le blog WF3 !_"
2) Une balise main qui va ... |
C++ | UTF-8 | 2,123 | 3.671875 | 4 | [] | no_license | #include <iostream.h>
class Element
{
public:
int key;
int other;
int link;
Element(){other = 0; link = 0;};
};
int ListMerge(Element *list, const int start1, const int start2)
// The sorted linked lists whose first elements are indexed by @start@1 and @start@2,
// respectively, are merged to obtain the... |
Java | UTF-8 | 795 | 2.796875 | 3 | [] | no_license | package ru.lember.leetcode.string;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
class BasicCalculatorTest {
@Test
void calculateTest() {
BasicCalculator service = new BasicCalculator();
//Assertions.assertEquals(82, service.calculate("82"));
Assertions... |
Ruby | UTF-8 | 5,188 | 2.515625 | 3 | [] | no_license | require 'gtk3'
Dir[File.dirname(__FILE__) + '/*.rb'].each {|file| require file }
Dir[File.dirname(__FILE__) + '/../api/*.rb'].each {|file| require file }
class SousGrille < Gtk::Table # contenant elle même une grille
attr_reader :colorCandidat
def new(grille)
initialize(grille)
end
def initialize (grille)
su... |
JavaScript | UTF-8 | 7,298 | 3.5 | 4 | [] | no_license | (function(){
//generate random number from m to n not include n
function generateRandomNumber(m, n){
return Math.floor(Math.random() * (n - m)) + m
}
//generate random boolean
function generateRandomBoolean(){
return Math.random() < 0.5
}
//1. 生成20道10以内的加减法
//2. 倒计时5分... |
Java | UTF-8 | 11,488 | 2.109375 | 2 | [
"CC-PDDC",
"BSD-3-Clause",
"CC0-1.0",
"LGPL-2.1-only",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"MIT"
] | permissive | /*
* Copyright (c) 2018 Oracle and/or its affiliates. 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-2.0
*
* Unle... |
JavaScript | UTF-8 | 2,691 | 3.296875 | 3 | [
"MIT"
] | permissive | /* Draw tree */
var canvas = document.getElementById('myTree');
var ctx = canvas.getContext('2d');
var eduPoints;
var fitPoints;
var healthPoints;
/* Education leaves */
var eduLeaves = new Image();
eduLeaves.src = '../img/eduleaves.png'
/* Fitness Leaves */
var fitLeaves = new Image();
fitLeaves.src = '../img/fitnes... |
Shell | UTF-8 | 4,505 | 4.1875 | 4 | [
"MIT"
] | permissive | #!/bin/bash
set -eu
set -o pipefail
help() {
cat <<EOF
${1:-}
NAME
xmloscopy - wtf is my docbook broken?
SYNOPSIS
xmloscopy <--docbook5> <root-document.xml> <combined-document.xml>
DESCRIPTION
Tries to tell you why your docbook is broken.
LIMITATIONS
- Must run it it the parent directory of al... |
C# | UTF-8 | 1,219 | 2.765625 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using Wilcommerce.Catalog.Events.CustomAttribute;
using Xunit;
namespace Wilcommerce.Catalog.Test.Events.CustomAttribute
{
public class CustomAttributeUpdatedEventTest
{
[Fact]
public void CustomAttributeUpdatedEvent_Ctor_Should_Set_Arguments_Cor... |
Java | ISO-8859-1 | 243 | 2.953125 | 3 | [] | no_license | package es.Studium;
public class Ejercicio2
{
public static boolean esParOImpar(int n)
{
if(n%2 == 0) {
System.out.println("El nmero es par.");
return true;
} else {
System.out.println("El nmero es impar.");
return false;
}
}
} |
C# | UTF-8 | 1,456 | 2.984375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Infomation.Core.Extensions
{
public static class EducationExtensions
{
public static string DisplayName(this Education edu)
{
string displayName = string.Empty;
s... |
PHP | UTF-8 | 1,109 | 3.234375 | 3 | [] | no_license | <?php
namespace App;
use GraphicsLib\CanvasInterface;
use ModernGraphicsLib\ModernGraphicsRenderer;
use ModernGraphicsLib\Point;
class ModernGraphicsRendererAdapter extends ModernGraphicsRenderer implements CanvasInterface
{
/** @var ModernGraphicsRenderer */
private $renderer;
/** @var Point */
priv... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.