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 |
|---|---|---|---|---|---|---|---|
Markdown | UTF-8 | 2,781 | 2.578125 | 3 | [] | no_license | 谈谈对dubbo的理解
网站架构有一个重要指标,可扩展性,而针对该指标目前最好的解决方案就是分布式系统服务:即将一整个大的系统服务按照业务需求逻辑与业务服务进行细分,将它们独立自成多个小的系统,降低系统整体的耦合度,提高系统整体的灵活性,使系统整体更容易扩展、维护、负载均衡;要想实现这些就必须要有通信技术实现多个业务与服务之间的调用、消息传递。
dubbo就是针对业务与服务之间调用的解决方案:基于接口的远程方法调用、服务的自动注册与发现、智能容错与负载均衡。它是以生产者与消费者模式去实现的:通过将service发布为war包,使用duboo将其注册到注册中心,并暴露自身的服务地址以提供消费;而controller则依赖s... |
JavaScript | UTF-8 | 1,818 | 3.265625 | 3 | [] | no_license | var _ = require('underscore')
var fs = require('fs')
writeTone = (PCM) => {
var min = 0 //_.min(PCM)
var max = 1000 //_.max(PCM)
// console.log(PCM)
var output = _.map(PCM, (value) => Math.round((value - min) / (max - min) * 255))
// console.log(output)
var header = fs.readFileSync("header.... |
C++ | UTF-8 | 561 | 3 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int i;
char ch;
do
{
cout<<"enter ur choice from 1-7 :-";
cin>>i;
switch(i)
{
case 1:
cout<<"sunday";
break;
case 2:
cout<<"monday";
break;
case 3:
cout<<"tuesday";
break;
case 4:
cout<<"wednesday";
... |
Java | UTF-8 | 2,570 | 2.328125 | 2 | [] | no_license | package br.com.controller;
import java.util.List;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bi... |
C# | UTF-8 | 2,613 | 2.875 | 3 | [
"Unlicense"
] | permissive | using System;
using System.Diagnostics;
using System.Drawing;
using System.Windows.Forms;
namespace GuidGenerator
{
class ProcessIcon : IDisposable
{
private readonly NotifyIcon _notifyIcon;
/// <summary>
/// Initializes a new instance of the <see cref="ProcessIcon"/> class.
/// </summary>
public Process... |
Python | UTF-8 | 565 | 3.359375 | 3 | [] | no_license | import itertools
def run(user_input="""A C G T
2"""):
params = user_input.splitlines()
list_nucleotide = str(params[0]).split()
formed_length = int(params[1])
list_nucleotide.extend(list_nucleotide * formed_length)
perms = itertools.permutations(list_nucleotide, formed_length)
list_perms = []... |
Java | UTF-8 | 386 | 3.15625 | 3 | [] | no_license | package com.szymonharabasz.exercises.ch01.ex02;
import java.util.Scanner;
public class Ex_01_02 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Give an integer angle: ");
String input = in.nextLine();
int num = Integer.parseInt(input);
System.out.printf(... |
Markdown | UTF-8 | 404 | 2.984375 | 3 | [
"Unlicense",
"LicenseRef-scancode-public-domain"
] | permissive | # `<AfterTimeout>`
Renders its children only after a specified timeout. Useful to
improving perceived performance by not blocking the main event loop.
## Usage
```jsx
import {AfterTimeout} from 'libreact/lib/AfterTimeout';
<AfterTimeout ms={100}>
Hello world!
</AfterTimeout>
```
## Props
- `ms` — option... |
Java | UTF-8 | 737 | 2 | 2 | [] | no_license | package com.varorest.varorest.user.model;
import lombok.Builder;
import lombok.Getter;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.per... |
Java | UTF-8 | 306 | 1.53125 | 2 | [] | no_license | package com.lnavarro.peopleconcept.app.di.component;
import com.lnavarro.peopleconcept.app.di.PresenterModule;
import dagger.Component;
/**
* Created by luis on 1/11/17.
*/
@Component(modules = PresenterModule.class, dependencies = {InteractorComponent.class})
public interface PresenterComponent {
}
|
Markdown | UTF-8 | 1,229 | 2.859375 | 3 | [] | no_license |
### **Dataset as raw:**
[link](https://raw.githubusercontent.com/AbeerAlghamdi1/Dataset/main/Employee_Turnover_Prediction.csv)
### **Dataset source:**
HR Analytics Dataset, [available on Kaggle](https://www.kaggle.com/lnvardanyan/hr-analytics)
### **Dataset Description:**
The dataset has 14,999 employees observation... |
Shell | UTF-8 | 629 | 3.71875 | 4 | [] | no_license | #!/bin/bash
DIR_TEMP="$1"
TIMEOUT="$2"
while read TEST; do
PATH_CODE=$( mktemp $DIR_TEMP/test_XXXXXXXX )
PATH_TEST=$( jq '.test' <<<"$TEST" )
cat >"$PATH_CODE" <<-TEST_CODE
#!/bin/bash
(
cd $( dirname $PATH_TEST )
[ -f setup ] && source setup
source $( ba... |
PHP | UTF-8 | 14,263 | 3.046875 | 3 | [] | no_license | <?php
/* incluimos primeramente el archivo que contiene la clase fpdf */
date_default_timezone_set('UTC');
require('../recursos/fpdf/fpdf.php');
include('../config/conexion.php');
header("Content-Type: text/html; charset='latin1'");
class PDF extends FPDF{
var $widths;
var $aligns;
// Cargar los datos
function... |
Java | UTF-8 | 1,335 | 2.203125 | 2 | [
"MIT"
] | permissive | /*
* PtTreatments.java
*
* Created on May 17, 2006, 9:25 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package coshms.util.emergency;
import java.io.Serializable;
/**
*
* @author Tahir
*/
public class PtTreatments implements Serializable
{
... |
C++ | UTF-8 | 454 | 3.25 | 3 | [] | no_license | #ifndef WEAPON_HPP
#define WEAPON_HPP
#include <string>
#include <iostream>
class AWeapon
{
protected:
std::string _name;
int _apcost;
int _damage;
AWeapon();
public:
AWeapon(std::string const &name, int apcost, int damage);
AWeapon(AWeapon const &cpy);
virtual ~AWeapon();
AWeapon &operator=(AWeapon const &op... |
Python | UTF-8 | 3,186 | 2.671875 | 3 | [] | no_license | import bcrypt
from sqlalchemy import (
Boolean,
Column,
Integer,
String
)
from colanderalchemy import SQLAlchemySchemaNode
from c2corg_api.models import Base, users_schema
import colander
class PasswordUtil():
"""
Utility class abstracting low-level password primitives.
"""
@st... |
Java | UTF-8 | 306 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | package mskubilov;
/**
* Shape. €нтерфейс любой формы.
* @author Maksim Skubilov skubilov89@yandex.ru
* @since 21.03.2017
* @version 1.0
*/
public interface Shape {
/**
* pic. Метод, выражающий форму.
* @return форму в строковой форме.
*/
String pic();
} |
Java | UTF-8 | 1,154 | 3.171875 | 3 | [] | no_license | import java.util.PriorityQueue;
public class ClassXMLVehicle implements Comparable<ClassXMLVehicle>{
private String id;
private int t;
private String strRoute;
public ClassXMLVehicle(String id, int t, String strRoute) {
this.id = id;
this.t = t;
this.strRoute = strRoute;
}
@Override
public i... |
Markdown | UTF-8 | 9,630 | 2.8125 | 3 | [] | no_license | > * 原文地址:[Best Static Site Generators for Vue.js](https://blog.bitsrc.io/best-static-site-generators-for-vue-js-e273d52ea208)
> * 原文作者:[Chameera Dulanga](https://medium.com/@chameeradulanga)
> * 译文出自:[掘金翻译计划](https://github.com/xitu/gold-miner)
> * 本文永久链接:[https://github.com/xitu/gold-miner/blob/master/article/2020/bes... |
C | UTF-8 | 809 | 4.09375 | 4 | [
"MIT"
] | permissive | // source code to find logarithm
#include <stdio.h>
#include <math.h>
double logarithm(double x, int n);//function to finf logarithm
int main(){
int n;
double x;
printf("Enter the value of x: ");
scanf("%lf", &x);
printf("Enter the numbers of terms n: ");
scanf("%d", &n);
if(x>0 && ... |
Python | UTF-8 | 4,503 | 2.828125 | 3 | [] | no_license | import sys
from functools import reduce
import random
import hyperx
# returns the distance between src and all the dest
def dijkstra(adjacency_list, src):
nnodes = len(adjacency_list.keys())
visited = [False] * nnodes
distance = [sys.maxint] * nnodes
visited[src] = True
distance[src] = 0
stack = [src]
while len(... |
Rust | UTF-8 | 2,542 | 3.515625 | 4 | [] | no_license | // https://leetcode.com/problems/count-nodes-equal-to-average-of-subtree/
// Definition for a binary tree node.
#[derive(Debug, PartialEq, Eq)]
pub struct TreeNode {
pub val: i32,
pub left: Option<Rc<RefCell<TreeNode>>>,
pub right: Option<Rc<RefCell<TreeNode>>>,
}
impl TreeNode {
#[inline]
pub fn ... |
Go | UTF-8 | 3,358 | 3.265625 | 3 | [] | no_license | package sessions
import (
"encoding/json"
"net/http"
"time"
"github.com/dgrijalva/jwt-go"
)
var jwtKey = []byte("my_secret_key")
var users = map[string]string{
"user1": "password1",
"user2": "password2",
}
// Credentials Create a struct that models the structure of a user, both in the request body, and in th... |
JavaScript | UTF-8 | 3,473 | 2.859375 | 3 | [] | no_license | const inputField = document.getElementById("song");
const btn1 = document.getElementById("btn1");
const Display = document.getElementById("Display")
btn1.addEventListener("click", makeRequest);
const BaseUrl = "http://api.musixmatch.com/ws/1.1"
const API_KEY = "bf6d392134c538ae614d97356ace8283";
const CORS = "h... |
Python | UTF-8 | 3,219 | 3.234375 | 3 | [] | no_license | #
# Methods to control a Weiss Gallenkamp environmental chamber
# controlled by SimPac controller
#
# David Cussans, Jeson Jacob, Bristol Sept 2011
# Nick Ryder Oxford, Feb 2016
import optparse
import socket
import time
class EnvChamber(object):
def __init__(self, address = "172.16.30.50" , port=2049 ):
... |
C++ | UTF-8 | 807 | 3.078125 | 3 | [] | no_license |
#include "common.h"
#include "Thread.h"
static void* threadFunc(void*);
Thread::Thread()
:mTID(0)
,mStatus(S_Unknown)
{
}
Thread::~Thread() {
}
void Thread::start() {
if (mStatus != S_Running) {
if (0 == pthread_create(&mTID, NULL, threadFunc, this)) {
_setStatus(S_Running);
}
}
}
void Thread::stop()... |
PHP | UTF-8 | 2,887 | 2.71875 | 3 | [] | no_license | <?php
require_once 'EntidadBase.php';
class User extends EntidadBase{
private $modelo;
private $version;
private $nombre;
private $apellido;
private $tipo_doc;
private $razon;
private $num_doc;
private $cell;
private $email;
private $tienda;
private $perfil;
private $p... |
TypeScript | UTF-8 | 1,478 | 2.515625 | 3 | [
"MIT"
] | permissive | import createDebugger from 'debug'
import { HRTime, FunctionReport, GeneratorReport, FlowFunctionsResultList } from '../reporter/reporter.types'
import { calculateHRTimeDifference, compactFunctionReport } from '../reporter/reporter'
const debug = createDebugger('flowie:runtime:result')
const flowieResult: CreateFlowi... |
Java | UTF-8 | 472 | 1.757813 | 2 | [] | no_license | package uz.pdp.appclickup.dto;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.UUID;
@Data
public class SpaceDTO {
@NotNull
private String name;
@NotNull
private String color;
private UUID iconId;
private UUID avatarId;
@NotNull
private String ac... |
Markdown | UTF-8 | 2,996 | 3.1875 | 3 | [
"MIT"
] | permissive | # Twitter Kafka crawler
----
Simple demo project using [Twitter's streaming API](https://developer.twitter.com/en/docs/tweets/filter-realtime/guides/connecting) to send messages to [Kafka](https://kafka.apache.org/) and then process them out to [Elasticsearch](https://www.elastic.co/products/elasticsearch) and Postgre... |
Java | UTF-8 | 8,319 | 2.015625 | 2 | [] | no_license | package com.funnyplayer.service;
import java.util.ArrayList;
import java.util.List;
import com.funnyplayer.HomeActivity;
import com.funnyplayer.R;
import com.funnyplayer.util.MusicUtil.FilterAction;
import android.app.Notification;
import android.app.PendingIntent;
import android.app.Service;
import android.content.... |
Java | UTF-8 | 1,719 | 2.1875 | 2 | [] | no_license | package com.derekhome.pdfgenerator.model;
public class Bill {
private String vm_name;
private String operating_system;
private float price;
private String service_level;
private int commision;
private float month_costs_vm;
private String billing_period_date;
private float month_days;... |
JavaScript | UTF-8 | 1,025 | 2.53125 | 3 | [
"MIT"
] | permissive | "use strict";
var emailValidation = require('..').mongoModels.emailValidation;
module.exports = {
create : create,
findByVerifId : findByVerifId,
remove : remove
}
/**
* Save a email validation on mongo.
*
* @params
* {
* id : value,
* email : value
* }
*
* @callback
* callback ... |
C# | UTF-8 | 1,924 | 3.828125 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
namespace t7_II
{
class Program
{
static void Main(string[] args)
{
int rows = int.Parse(Console.ReadLine());
List<List<int>> first = new List<List<int>>();
List<List<int>> second = new List<... |
Markdown | UTF-8 | 5,290 | 2.5625 | 3 | [] | no_license | ## nnnn姓名(资料)
适合所有人的历史读物。每天了解一个历史人物、积累一点历史知识。三观端正,绝不戏说,欢迎留言。
### 成就特点
-
-
### 生平
143年前的今天,定义什么人是汉奸的著名爱国华侨陈嘉庚出生

【南洋的生意人】
1874年10月21日,陈嘉庚出生,今厦门市集美区人。父亲早年下南洋谋生,在新加坡经营米店。17岁,陈嘉庚帮父亲经营米店,20岁回福建完婚。
1905年(31岁),米店歇业,陈嘉庚开始自立门户,走上了创业的道路。他首先开设了生产菠萝罐头的“新利川黄梨厂”、“日新公司”,获利丰厚,当年夏天又开设了“谦益号”米店,不久决定经营橡... |
C++ | UTF-8 | 776 | 2.9375 | 3 | [] | no_license | // anagram
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using std::cin;
using std::cout;
using std::string;
using std::vector;
int main() {
int T;
cin >> T;
while(T--){
string s;
cin >> s;
if(s.size()%2 != 0){
cout << -1 <<... |
PHP | UTF-8 | 3,564 | 2.546875 | 3 | [] | no_license | <?php
class Model_Menusetting extends \Orm\Model
{
protected static $_primary_key = array(
'sscode',
'menu_code',
);
protected static $_properties = array(
'sscode',
'menu_code',
'created_at',
'updated_at',
);
protected static $_observers = array(
'Orm\Observer_CreatedAt' => array(
'events' ... |
JavaScript | UTF-8 | 354 | 3.203125 | 3 | [] | no_license | function angle(time) {
// your code here
let [hr, min] = [time.split(':')[0], time.split(':')[1]];
if(hr >= 12) {
hr = hr-12;
}
let degreeHr = Math.floor(hr*30 + min/2);
let degreeMin = min*6;
let angle = Math.abs(degreeHr - degreeMin)
return angle >180 ? angle - 180: angle;
... |
PHP | UTF-8 | 10,782 | 3.078125 | 3 | [
"MIT"
] | permissive | <?php namespace Arcanedev\Stripe\Http\Curl;
use Arcanedev\Stripe\Contracts\Http\Curl\HttpClient as HttpClientContract;
use Arcanedev\Stripe\Exceptions\ApiConnectionException;
/**
* Class HttpClient
*
* @package Arcanedev\Stripe\Http\Curl
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
*/
class HttpClient ... |
JavaScript | UTF-8 | 1,179 | 2.90625 | 3 | [] | no_license | loadXMLDoc()
setInterval(loadXMLDoc, 1000);
function loadXMLDoc() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
parseXML(this);
}
};
xhttp.open("GET", "nodes.xml", false);
xhttp.send();
}
f... |
Markdown | UTF-8 | 5,781 | 3.203125 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: "William Clinger:符号程序设计语言解释器的优化"
subtitle: "William Clinger - Compiler Optimization for Symbolic Languages"
formatted_title: "William Clinger: <br />符号程序设计语言解释器的优化"
modified: 2014-12-01 22:43:21 +0800
tags: [Scheme, Lisp, Functional, Programming, Symbolic, Optimization, 优化, 符号化计算, 编译器]
image:
... |
PHP | UTF-8 | 2,168 | 2.625 | 3 | [] | no_license | <?php
$mysqli = mysqli_connect('localhost', 'root', 'root', 'bab');
$sql = "select * from author";
$res = mysqli_query($mysqli, $sql);
if($res === false){
echo mysqli_error($mysqli);
}
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
</head>
<body>
<h2><a href='main.php'>main page</a></... |
Markdown | UTF-8 | 1,965 | 3.75 | 4 | [
"MIT"
] | permissive | ##127. [Word Ladder](https://leetcode.com/problems/word-ladder/)
> Medium
Given two words (*beginWord* and *endWord*), and a dictionary's word list, find the length of shortest transformation sequence from *beginWord* to *endWord*, such that:
1. Only one letter can be changed at a time.
2. Each transformed word mus... |
Markdown | UTF-8 | 1,069 | 2.65625 | 3 | [
"Zlib",
"LicenseRef-scancode-protobuf",
"Apache-2.0",
"BSD-2-Clause",
"LicenseRef-scancode-unknown"
] | permissive | ---
id: io-netty
title: Netty Tcp or Udp Connector
sidebar_label: Netty Tcp or Udp Connector
---
## Source
The Netty Source connector opens a port that accept incoming data via the configured network protocol and publish it to a user-defined Pulsar topic.
Also, this connector is suggested to be used in a containerize... |
Java | UTF-8 | 1,592 | 2.25 | 2 | [] | no_license | /**
*
*/
package AnyQuantProject.data.jsonDATA;
import java.util.Calendar;
import AnyQuantProject.util.exception.NetFailedException;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import AnyQuantProject.data.util.DataType;
import AnyQuantProject.data.util.JsonHelper;
import AnyQuantProject.dataServic... |
JavaScript | UTF-8 | 703 | 3.296875 | 3 | [] | no_license | // const fs = require('fs');
// class DotPath {
// constructor() {
// this.nomeDoArquivo = 'src/simpsons.json';
// this.id = '';
// }
// lerArquivo() {
// try {
// const data = fs.readFileSync(nomeDoArquivo, 'utf-8');
// return data;
// } catch(e) {
// console.error(`Erro ao ... |
Python | UTF-8 | 908 | 2.71875 | 3 | [] | no_license | from build_dataset import readDataFromCsv
import tensorflow as tf
data_filename = "data/processed_data/data_set_2018-11-10 15_21_47"
x_train, y_train, x_test, y_test = readDataFromCsv(data_filename)
x_train = x_train.transpose()
y_train = y_train.transpose()
x_test = x_test.transpose()
y_test = y_test.transpose()
mo... |
C++ | UTF-8 | 1,769 | 3.359375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
class Spinwheel
{
public:
int giftCount;
vector<int> gifts;
vector<float> prob;
int val=0;
static bool comparison(const pair<int,float> &a,const pair<int,float> &b){
return a.second<b.second;
}
int randomGenerator() {
time_t... |
Markdown | UTF-8 | 18,710 | 2.84375 | 3 | [
"MIT"
] | permissive | ---
name: Colour
menu: Design Tokens
route: /design-tokens/colour
---
# Colour
---
import Colors from "../../src/components/Colors";
import ColorBox from "../../src/components/ColorBox";
import Example from "../../src/components/Example";
## HDS colours
Helsinki Design System uses the colours from the City of Hels... |
Python | UTF-8 | 1,276 | 3.0625 | 3 | [] | no_license | import sys
'''
dfs로 좌, 우, 아래만 향하면 ㅗㅜㅓㅏ 모양 빼고 모든 조합이 나올 수 있다.
모든 좌표에서 좌 우 아래에 대해서 dfs 탐색 후 ㅗㅜㅓㅏ 모양에 대해서 탐색하면 된다.
'''
def dfs(i, j, s, dep=0):
if dep == 3:
global r
r = max(r, s)
return
for dx, dy in d:
tx, ty = i + dx, j + dy
if 0 <= tx < M and 0 <= ty < N and not vl[ty][... |
C# | UTF-8 | 1,399 | 3.34375 | 3 | [
"Apache-2.0"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
namespace Custom_Control
{
public sealed class String_Replace : CodeActivity
{
// Define an activity input argument of type string
public InArgument<string> Text { get; set; }
... |
PHP | UTF-8 | 30,906 | 3 | 3 | [] | no_license | <?php
use Fisdap\Api\Users\CurrentUser\CurrentUser;
/**
* Class Fisdap_Reports_Report
* This is the base class for Fisdap 2.0 Reports
* Includes methods for quickly generating forms and standard data display options
* Create a new Fisdap Report by extending this class.
*/
class Fisdap_Reports_Report
{
public... |
C# | UTF-8 | 578 | 3.640625 | 4 | [] | no_license | using System;
using System.Collections.Generic;
namespace ComparePoints
{
class Program
{
static void Main()
{
var points = new List<Point>
{
new Point(3, 3),
new Point(1, 2)
};
if(points[0].CompareTo(points[1]) > 0)
{
var tempPoint = points[0];
points[0] = points[1];
points[... |
C# | UTF-8 | 2,584 | 2.859375 | 3 | [
"MIT"
] | permissive | //-----------------------------------------------------------------------
// <copyright file="Player.cs" company="Baloons-Pop-Three">
// Copyright Baloons-Pop-Three. All rights reserved
// </copyright>
// <summary>This is the Player class.</summary>
//----------------------------------------------------------------... |
Java | UTF-8 | 776 | 2.359375 | 2 | [] | no_license | package com.mationate.prueba3.adapters;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.mationate.prueba3.views.tabs.CardFragment;
import com.mationate.prueba3.views.tabs.FavoriteFragment;
public class SectionsPager... |
PHP | UTF-8 | 2,490 | 2.671875 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use App\Entities\Building;
use http\Exception\InvalidArgumentException;
use Illuminate\Http\Request;
class BuildingController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(... |
Go | UTF-8 | 1,025 | 3.75 | 4 | [] | no_license | package main
import (
"fmt"
"os"
)
func Combinations(s string) []string {
if len(s) == 0 {
return []string{}
}
letters := [8]string{
"abc", "def", "ghi", "jkl",
"mno", "pqrs", "tuv", "wxyz",
}
total := 1
for _, r := range s {
total *= len(letters[r-'2'])
}
combs := make([]string, total)
div := 1
f... |
Java | UTF-8 | 8,498 | 4.125 | 4 | [] | no_license | package JUC;
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.Semaphore;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.In... |
JavaScript | UTF-8 | 1,145 | 2.703125 | 3 | [] | no_license |
/*
* GET home page.
*/
redis = require("redis");
function cc(coin,price,volume) {
return {name:coin,price:price,volume:volume};
}
var coins=[];
function iterate_cache(r,data,index,func_end) {
if(index>=data.length) {
func_end();
r.quit();
return;
}
r.get(data[index],function(err,response) {
if(!err... |
PHP | UTF-8 | 1,479 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace AviationCode\EcsLogging\Tracing;
use Closure;
use Ramsey\Uuid\Uuid;
class Correlate
{
private const DEFAULT_HEADER = 'X-Correlation-Id';
private static ?string $id;
private static ?Closure $generator;
private static ?string $headerName;
/**
* Ret... |
PHP | UTF-8 | 1,919 | 2.625 | 3 | [] | no_license | <?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of HomeController
*
* @author augusto
*/
namespace Site\Controller;
use Zend\Mail;
use System\Controller\Controller;
use Zend\View\Model\ViewModel;
use Zend\Form\Annotation\AnnotationBuilde... |
Java | UTF-8 | 1,032 | 1.84375 | 2 | [] | no_license | package pages;
import base.Base;
import org.jboss.arquillian.graphene.Graphene;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
public class VPNLoginPage extends Base {
@FindBy(xpath="//a[contains(text(),'Login')]")
WebElement ... |
C# | UTF-8 | 591 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | using System;
using System.IO;
namespace Forge.Serialization.Serializers
{
public class ByteArraySerializer : ITypeSerializer
{
public object Deserialize(BMSByte buffer)
{
int length = buffer.GetBasicType<int>();
return buffer.GetByteRange(length);
}
public void Serialize(object val, BMSByte buffer)
... |
Java | UTF-8 | 37,045 | 1.882813 | 2 | [] | no_license | package com.cw.wizbank.scorm.adapter;
import java.applet.Applet;
import java.awt.Color;
import java.net.MalformedURLException;
import java.net.URL;
import com.cw.wizbank.scorm.util.APIErrorCodes;
import com.cw.wizbank.scorm.util.APIErrorManager;
import com.cw.wizbank.scorm.adapter.ISCORM2004API;
import com.cw.wizbank... |
C | UTF-8 | 2,071 | 3.375 | 3 | [] | no_license | #include "queue.h"
static void init_queue_case(queue *q, int i, int j)
{
q->t[i].is_leaf = q->t[j].is_leaf;
q->t[i].weight = q->t[j].weight;
q->t[i].r = q->t[j].r;
q->t[i].l = q->t[j].l;
q->t[i].code = NULL;
q->t[i].let = q->t[j].let;
}
static void queue_add(queue *trees, tree *t)
{
queue *q = trees;
... |
Markdown | UTF-8 | 2,011 | 3.265625 | 3 | [] | no_license | # Assignment Title
## Description
In this assignment you will be looking at some starter code and explore reading input from the user.
### Relevant Standards
- ATP.VDR.9-12.F.a Identify types of variables and data and utilize them to create a computer program that stores data in appropriate ways.
- ATP.M.9-12.F.b C... |
Java | UTF-8 | 5,949 | 1.609375 | 2 | [] | no_license | package com.matm.matmsdk.aepsmodule.ministatement;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class StatementResponse {
@SerializedName("agentName")
@Expose
private String agentName;
@SerializedName("agentId")
@Expose
private Object age... |
Java | UTF-8 | 1,157 | 3.484375 | 3 | [] | no_license | package org.sheamus.learn.l23.base.link;
/**
* 删除倒数第N个节点
* <a href="https://leetcode.cn/problems/remove-nth-node-from-end-of-list/">...</a>
*/
public class RemoveNthFromEnd {
public ListNode removeNthFromEnd(ListNode head, int n) {
ListNode dummy = new ListNode(-1);
dummy.next = head;
L... |
PHP | UTF-8 | 1,336 | 2.53125 | 3 | [] | no_license | <?php
if (isset($_SERVER['HTTP_REFERER']) && parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST) == $_SERVER['SERVER_NAME'] && !empty($_GET['id'])) {
$ch = curl_init('https://api-piped.mha.fi/streams/'.$_GET['id']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_se... |
Java | UTF-8 | 1,619 | 2.25 | 2 | [] | no_license | package ru.ftc.android.shifttemple.features.recipes.data;
import java.util.List;
import ru.ftc.android.shifttemple.features.products.domain.model.Success;
import ru.ftc.android.shifttemple.features.recipe_interactions.model.MemberIngredients;
import ru.ftc.android.shifttemple.features.recipes.domain.model.Recipe;
imp... |
C# | UTF-8 | 1,395 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | using System;
using System.Collections.Concurrent;
using System.Linq;
using System.Reflection;
namespace SqlD.Extensions.Discovery
{
internal static class PropertyDiscovery
{
private static readonly ConcurrentDictionary<string, PropertyInfo> Properties =
new ConcurrentDictionary<string, PropertyInfo>();
priv... |
Java | UTF-8 | 876 | 2.15625 | 2 | [] | no_license | package it.moondroid.navigationdrawer;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
public class PlanetFragment extends Fragment {
public static final String ARG_PLANET... |
Python | UTF-8 | 240 | 3.84375 | 4 | [] | no_license | #Print Pw length
username = input('Enter the Username: \n')
password = input('Enter the Password: \n')
pw_length = len(password)
pw_masked = '*' * pw_length
print(f'Hey {username}, your password {pw_masked} is {pw_length} letters long')
|
JavaScript | UTF-8 | 1,192 | 4.21875 | 4 | [] | no_license | /**
* Define function that accepts list of numbers
* Figure out how many digits the largest number has
* Loop from k=0 up to this largest number of digits
* For each iteration of the loop
* - create buckets for each digit( 0 - 9)
* - Place each number in the corresponding bucket based on its kth digit
*
* Repl... |
C++ | UTF-8 | 7,026 | 2.703125 | 3 | [] | no_license | #include <iomanip>
#include <cstdlib>
#include <cctype>
using namespace std;
#include "IOMgmt.h"
using namespace iomgmt;
namespace iomgmt {
const string IOError::IOERROR = "IOError{}";
const string TokenError::TOKENERROR = "TokenError{}";
const string Tokenizer::DELIMS = " \t\n"; //Blank,Tab,Newline
/... |
Ruby | UTF-8 | 3,280 | 2.984375 | 3 | [
"MIT"
] | permissive | # encoding: utf-8
require 'csv'
module BusinessCatalyst
module CSV
class NoSuchColumnError < StandardError; end
# Shared logic for building a row for a CSV export for Business Catalust.
# Instead of sublcassing Row directly in your project, subclass CatalogRow
# or ProductRow, which have column def... |
TypeScript | UTF-8 | 3,420 | 3.328125 | 3 | [
"MIT"
] | permissive | import type { InferredOptionType, Options, PositionalOptions } from "yargs";
import type { ArgumentOptions } from "./argument.js";
import type { OptionOptions } from "./option.js";
export interface BaseArgOptions {
prompt?: true | string;
requires?: string | string[];
excludes?: string | string[];
}
// prettier... |
JavaScript | UTF-8 | 2,831 | 3.953125 | 4 | [] | no_license | // console.log("I'm working, I'm JS. ImBeautiful. I'm worth it");
// let a = 221;
// let b = a - 5;
// a = 4;
// console.log(b, a);
/* Data Type */
// String
// const what = "Jayson";
// console.log(what);
// Boolean
// const what = true;
// Number
// const what = 222;
//f Float
// const what = 55.2;
// console.log... |
Markdown | UTF-8 | 830 | 2.71875 | 3 | [] | no_license | ---
layout: post
title: I know why the external wont boot.
---
Ok I figured out why the external USB wouldnt boot. I was playing around with Disk Utility and in order to get the external to boot there is a special partitioning format thats needed. So I plugged in the usb and formatted it in the needed from for it to b... |
C | UTF-8 | 3,464 | 3.046875 | 3 | [
"Apache-2.0"
] | permissive | #include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "envios.h"
#include "validaciones.h"
#include "funciones.h"
Envios* envios_new()
{
return (Envios*) malloc(sizeof(Envios));
}
Envios* envios_newParametros(char* id,char* nombre,char* kilometros,char* tipoDeEntrega)
{
Envios* retorno=NULL;
... |
JavaScript | UTF-8 | 1,387 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | /**
* Track List View
* ------------------------------------------
* Features:
* - Browse Tracks
* - Select/Play/Pause Current Track
* - Search Tracks
*
* ------------------------------------------
* by Zachary Fisher :: zfisher@zfidesign.com
*
*/
MS.Views.TrackList = function() {
var me = this;
var ... |
Java | UTF-8 | 9,278 | 2.046875 | 2 | [] | no_license | package com.trainex.fragment.inmain;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
im... |
Java | UTF-8 | 999 | 3.109375 | 3 | [] | no_license | package Baekjoon.Lev_9;
import java.io.*;
import java.util.StringTokenizer;
public class Solution_1712 {
public static void main(String[] args) throws IOException {
BufferedReader BUF_IN = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter BUF_OUT = new BufferedWriter(new Outpu... |
Swift | UTF-8 | 2,636 | 3.359375 | 3 | [] | no_license | //
// FilterSelectionViewController.swift
// Snapcat
//
// Created by Luke Brody on 3/13/17.
//
import Foundation
import UIKit
/**
This class's job is to maintain a UITableView of face selections that mirrors CatFace.faces
It's part of the 'Controller' layer of our app.
*/
class FilterSelectionViewController... |
PHP | UTF-8 | 780 | 2.53125 | 3 | [] | no_license | <?php
/**
* File: InstructorFactory.php
* Author: Roman Dots <ram.d.kreiz@gmail.com>
* Date: 2019-07-17
* Copyright (c) 2019
*/
declare(strict_types=1);
/* @var \Illuminate\Database\Eloquent\Factory $factory */
use Faker\Generator as Faker;
$factory->define(\App\Models\Instructor::class, static function (Fake... |
Java | UTF-8 | 2,587 | 3.046875 | 3 | [] | no_license | /*
CHECK FOR SUFFICIENT FUNDS DURING TRANSFER. DISPLAY APPROPRIATE EXCEPTIONS.
*/
package com.cg.pp.services;
import java.util.ArrayList;
import java.util.Iterator;
import com.cg.pp.beans.Transaction;
import com.cg.pp.dao.AccountDaoImpl;
import com.cg.pp.exceptions.AccountException;
public class Accou... |
Markdown | UTF-8 | 2,448 | 3.015625 | 3 | [] | no_license | # COMP122 Overview
This repository provides you with all the material that the professor will be providing to you.
During the course of the semester, you will need to do perform a PULL operation to obtain the most up-to-date information.
## Contents of this repo include (but not limited to)
1. The syllabus in .doc... |
Java | UTF-8 | 565 | 2.578125 | 3 | [
"MIT"
] | permissive | package semanaFile;
import java.io.*;
/**
* @author burca
*/
public class TestaArquivoOtimizado {
public static void main(String[] args) throws IOException {
String pathString = "C:/Users/Aluno/Desktop/utfpr-desktop/projeto/escrita/log.txt";
boolean append = false;
String str = "Oieee";... |
C++ | UTF-8 | 685 | 2.96875 | 3 | [] | no_license | #include "wNs.h"
#include <iostream>
#include <string>
weapon::weapon(int weight, int self_price, int damage, std::string obj_name):object(weight, self_price), damage(damage), obj_name(obj_name){
this->weight = weight;
this->self_price = self_price;
}
int weapon::getd(){
return damage;
}
int weapon::getsp... |
C | UTF-8 | 247 | 2.84375 | 3 | [] | no_license | /*
This test should not have *any* array parameters. This is to guard
against accidentally treating struct field references as array
accesses (they look similar in the IR).
*/
struct S {
int x;
};
int f(struct S * s) {
return s->x;
}
|
Java | UTF-8 | 3,455 | 2.5 | 2 | [] | no_license | package hh.swd20.expenseinvoice.webcontroller;
import java.util.List;
import java.util.Optional;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.... |
C++ | GB18030 | 732 | 2.640625 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <vector>
#include <string>
class Residence
{
public:
Residence(int residenceNo, const std::string& name);
~Residence() {};
void DisPlay(); //ӡϢ
int AddMember(int age); //ӳԱش
int DelMember(int memberNo); //ɾԱش
int ChangeMember(in... |
Markdown | UTF-8 | 1,127 | 3.0625 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | <!--[metadata]>
+++
title = "network connect"
description = "The network connect command description and usage"
keywords = ["network, connect"]
[menu.main]
parent = "smn_cli"
+++
<![end-metadata]-->
# network connect
Usage: docker network connect [OPTIONS] NETWORK CONTAINER
Connects a container to a network... |
JavaScript | UTF-8 | 789 | 3.90625 | 4 | [] | no_license | "use strict";
function createPigLatinWord(word) {
word = word.toLowerCase();
word = word.split("");
if (word[0] == "a" || word[0] == "e" || word[0] == "i" || word[0] == "o" || word[0] == "u") {
return (word.join("") + "yay ");
}
for (let i = 0; i < word.length; i++) {
if (word[0] == "a" || word[0] == "e"... |
C++ | UTF-8 | 972 | 2.640625 | 3 | [] | no_license | #ifndef EMPLOYE_H
#define EMPLOYE_H
#include <QString>
#include <QSqlQuery>
#include <QSqlQueryModel>
class EMPLOYE
{
QString nom,pren,datee;
int id,salaire,tel;
public:
//const
EMPLOYE(){}
EMPLOYE(int,QString,QString,int,QString,int);
//getter
QString getnom(){return nom;}
... |
Java | UTF-8 | 22,977 | 1.546875 | 2 | [] | no_license | package com.zzteck.msafe.activity;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Locale;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.Pr... |
Java | UTF-8 | 1,941 | 2.03125 | 2 | [] | no_license | /*
* Copyright © Litmusblox 2019. All rights reserved.
*/
package io.litmusblox.server;
import com.opentable.db.postgres.embedded.EmbeddedPostgres;
import lombok.extern.log4j.Log4j2;
import org.apache.ibatis.jdbc.ScriptRunner;
import org.springframework.context.annotation.*;
import javax.sql.DataSource;
import jav... |
Java | UTF-8 | 674 | 1.75 | 2 | [
"MIT",
"EPL-1.0",
"BSD-3-Clause",
"Apache-2.0"
] | permissive | package com.voxeet.uxkit.youtube.activities;
import android.os.Bundle;
import com.voxeet.uxkit.common.activity.VoxeetCommonAppCompatActivity;
import com.voxeet.uxkit.common.service.AbstractSDKService;
import com.voxeet.uxkit.common.service.SDKBinder;
@Deprecated
public class VoxeetYoutubeAppCompatActivity<T extends ... |
PHP | UTF-8 | 1,769 | 3.3125 | 3 | [] | no_license | <?php
/**
* LibSystem - A library of functions for working with system tasks.
* @author James Clayton <james.r.clayton@gmail.com>
* @version 0.0.1
* @copyright (c) 2013, James Clayton
* @package LibSystem
* @license http://opensource.org/licenses/ISC ISC License (ISC)
*/
class System {
/**
* The Kill() w... |
Java | UTF-8 | 1,102 | 1.960938 | 2 | [] | no_license | package com.vigneet.macgray_v010;
import android.app.AlarmManager;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.support.v7.app.NotificationCompat;
import java.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.