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 |
|---|---|---|---|---|---|---|---|
C# | UTF-8 | 5,082 | 2.53125 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using RaptorDB;
namespace SampleViews
{
#region [ class definitions ]
//public enum State
//{
// Open,
// Closed,
// Approved
//}
public class LineItem
{
public decimal QTY { get; set; }
public string Prod... |
Shell | UTF-8 | 7,224 | 3.84375 | 4 | [
"MIT"
] | permissive | #!/bin/bash
# create global ENVS associated array
source $HOME/.IPS
echo "cfgenv $cfgenv"
echo "ipscmd $ipscmd"
echo "ipsenv $ipsenv"
echo "runenv $runenv"
echo
echo
echo "$ipscmd creation"
echo
if [ -z $1 ] ; then
etcdctl ls --sort $cfgenv
exit 1
fi
etcdctl ls $cfgenv/${1} 2>/dev/null
if [ $? -ne 0 ] ; then... |
JavaScript | UTF-8 | 862 | 3.484375 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* function TreeNode(val, left, right) {
* this.val = (val===undefined ? 0 : val)
* this.left = (left===undefined ? null : left)
* this.right = (right===undefined ? null : right)
* }
*/
/**
* @param {TreeNode} root
* @return {TreeNode}
*/
//Runtime: 72ms, M... |
PHP | UTF-8 | 1,481 | 2.953125 | 3 | [
"MIT"
] | permissive | <?php
namespace lib\Media\Filtering;
class Pixelate
extends \lib\Media\Filtering\AbstractImageFilter
implements \lib\Interfaces\InterfaceImageFilter
{
/**
* Pixelate::__construct()
*
* @param mixed $args (0=Pixelgröße (default=5)... |
Markdown | UTF-8 | 1,510 | 2.921875 | 3 | [] | no_license | 从emploee表中查询出num,name,age,sex,homeaddr等5个字段的所有记录
```
mysql> SELECT num,name,age,sex,homeaddr FROM emploee;
+------+--------+------+------+----------+
| num | name | age | sex | homeaddr |
+------+--------+------+------+----------+
| 1 | 张三 | 26 | 男 | 北京 |
| 2 | 李思 | 24 | 女 | 北京 |
| ... |
Markdown | UTF-8 | 3,072 | 3.53125 | 4 | [] | no_license | # STRINGS
* Strings are a series of characters between " or '
* String interpolation doesn't work with '' and neither do backslash
* characters like newline
```
puts "Add Them #{4+5} \n\n"
puts 'Add Them #{4+5} \n\n'
Add Them 9
Add Them #{4+5} \n\n
```
### A here-doc is normally used when you want a multiline str... |
C++ | UTF-8 | 4,543 | 3.6875 | 4 | [] | no_license | // HashTable.h -- class template for a hash table using chaining
#include "Queue.h"
#include "Array.h"
// client must provide a hash function with the following characteristics:
// 1 input parameter of DataType (see below), passed by const reference
// returns an integer between 0 and size - 1, inclusive, where ... |
Python | UTF-8 | 150 | 2.859375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
# Stdlib imports
import re
def split_uppercase(word):
word = re.findall('[A-Z][^A-Z]*', word)
return ' '.join(word)
|
Java | UTF-8 | 859 | 3.625 | 4 | [] | no_license | import java.util.Scanner;
class jervee1
{
public static void main(String[] args)
{
Scanner jerv = new Scanner(System.in);
String name, gender;
boolean status;
String singlemarried;
System.out.println("Enter name: ");
name = jerv.nextLine();
System.out.println("Enter gender: ");
gender = jerv.nextLine();
... |
Markdown | UTF-8 | 898 | 3.015625 | 3 | [] | no_license | # remoteControl
there are two pieces of software in this project:
1. an arduino program to do the following:
* Generate signal pulses out of 8 pins in pairs arranged as 4 channels
* Rotate a servo to a specific position indicated as 0 to 100
* Accept infrared remote control signals
* Accept USB remote control ... |
Markdown | UTF-8 | 541 | 2.59375 | 3 | [] | no_license | # Laravel Source Code Study
研讀 Laravel 程式碼的心得紀錄
# 目錄
* [前言](/preface.md)
* 準備工作
* [安裝](/install.md)
* 程式基本邏輯
* [開始](/start.md)
* [路由](/routes.md)
* [回傳](/response.md)
* MVC 架構
* [模型](/models.md)
* [視圖](/views.md)
* [控制器](/controllers.md)
* 輔助方法
* [輔助方法概觀](/helpers/index.md)
* [陣列](/helpers/array.md... |
Java | UTF-8 | 2,764 | 2.90625 | 3 | [] | no_license | package sun;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
import jpcap.JpcapCaptor;
import jpcap.NetworkInterface;
import jpcap.NetworkInterfaceAddress;
import jpcap.packet.Packet;
public class SnifferDemo {
public static void ... |
JavaScript | UTF-8 | 595 | 3.75 | 4 | [] | no_license | var removeDuplicates = function (nums) {
let slow = 0;
for (let fast = 1; fast < nums.length; fast++) {
if (nums[fast] !== nums[slow]) {
slow++;
nums[slow] = nums[fast];
}
}
console.log(nums);
console.log(slow + 1);
return slow + 1;
}
// var removeDuplicates = function (nums) {
// le... |
Shell | UTF-8 | 7,287 | 4.09375 | 4 | [] | no_license | #!/bin/bash
#
# SPDX-License-Identifier: Apache-2.0
#
# Name:
# Create image utility
#
# Authors:
# 2017 Zack YL Shih <ZackYL.Shih@moxa.com>
# 2018 Fero JD Zhou <FeroJD.Zhou@moxa.com>
# 2019 Ken CJ Chou <KenCJ.Chou@moxa.com>
#
set -e
VERSION=1.3.0
usage() {
echo -e "Usage:"
echo -e " # ${0} <image_file> <partiti... |
JavaScript | UTF-8 | 1,675 | 2.703125 | 3 | [] | no_license | import React from 'react';
const CheckBox = ({ name, label, onChange, selectedOptions, options }) => {
// potential improvement may be change this component to a class so we don't recreate this function in all rendering?
const onChangeLocal = (event) => {
let newSelectionArray = [];
document.getElementsBy... |
Java | UTF-8 | 979 | 2.09375 | 2 | [] | no_license | package net.bible.service.format.osistohtml.tei;
import net.bible.service.format.osistohtml.HtmlTextWriter;
import net.bible.service.format.osistohtml.NoteHandler;
import net.bible.service.format.osistohtml.OsisToHtmlParameters;
import net.bible.service.format.osistohtml.ReferenceHandler;
import org.xml.sax.At... |
Java | UTF-8 | 2,038 | 2.21875 | 2 | [
"Unlicense"
] | permissive | package certyficate.sheetHandlers.insert;
import java.util.List;
import org.jopendocument.dom.spreadsheet.Sheet;
import certyficate.datalogger.Logger;
import certyficate.datalogger.PointData;
import certyficate.property.CalibrationData;
import certyficate.property.SheetData;
import certyficate.sheetHandlers.Calibrat... |
Python | UTF-8 | 445 | 2.671875 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | from collections.abc import Iterable
from typing import Any, overload
from typing_extensions import TypeGuard
class LazyFixture:
name: str
def __init__(self, name: str) -> None: ...
def __eq__(self, other: object) -> bool: ...
@overload
def lazy_fixture(names: str) -> LazyFixture: ...
@overload
def lazy_f... |
C# | UTF-8 | 1,971 | 2.640625 | 3 | [] | no_license | using FunChat.GrainIntefaces;
using FunChat.UnitTest.Tools;
using Orleans.TestingHost;
using System;
using System.Threading.Tasks;
using Xunit;
namespace FunChat.UnitTest
{
[Collection(ClusterCollection.Name)]
public class LoginTest
{
private readonly TestCluster _cluster;
public LoginTe... |
Markdown | UTF-8 | 16,412 | 3.125 | 3 | [] | no_license | # 译|Using Go Modules
## Introduction
Go 1.11 和 1.12 初步包含了 [对模块的支持](https://golang.org/doc/go1.11#modules),Go 的 [新依赖管理系统](https://learnku.com/docs/go-blog/versioning-proposal) 使依赖版本信息明确且易于管理。本文介绍了开始使用模块所需要的基本操作。
模块是 [Go packages](https://golang.org/ref/spec#Packages) 的集合,以 `go.mod` 文件的形式存储在文件树的根目录。`go.mod` 定义了模块的 *模... |
Java | UTF-8 | 29,920 | 1.726563 | 2 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | /*
* ArchE
* Copyright (c) 2012 Carnegie Mellon University.
* All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
*... |
C | UTF-8 | 799 | 3.25 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
#include<stdlib.h>
int main()
{
int *a,n,i,key,c=0,low,high,mid;
//clrscr();
printf("Enter numbers you want to add in array");
scanf("%d",&n);
a=(int *)malloc(sizeof(int) * n);
printf("\n enter %d elements in array",n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
printf("\n E... |
C | UTF-8 | 1,818 | 3.09375 | 3 | [] | no_license | /*
* hw2harness.h
*
* I WILL OVERWRITE YOUR COPY OF THIS FILE WITH MY OWN. ANY CHANGES YOU MAKE WILL NOT BE VISIBLE DURING GRADING.
*/
#ifndef HW2HARNESS_H
#define HW2HARNESS_H
/*
PROBLEM NOTES:
The problem that these functions generate/verify is a linear gradient with 0 on the left side and 1 on the right side... |
Java | UTF-8 | 1,212 | 2.65625 | 3 | [] | no_license | package com.common.bean;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/*
* 定义全局BaseController类使用推荐的 SLF4j 作日志处理
* 其他 Controller 并继承实现*/
public class BaseController {
protected final Logger loger = LoggerFactory.getLogger(getClass());
//trace級別日志
protected void... |
C++ | UTF-8 | 3,505 | 3.078125 | 3 | [] | no_license | #include "BinQueue.h"
Readers::BinaryQueue::BinaryQueue ()
{
}
void Readers::BinaryQueue::pushBuffer (ByteBuffer& data)
{
locker.lock ();
container.insert (container.end (), data.begin (), data.end ());
//for (ByteBuffer::iterator ref = data.begin (); ref != data.end (); ++ ref)
// container.... |
Python | UTF-8 | 532 | 3.0625 | 3 | [] | no_license | from .column import Column
class Table:
def __init__(self, path='/tmp'):
self.columnlist = {}
# self.row_keys = set()
self.path = path
def put(self, col, key, value):
if col not in self.columnlist:
newcol = Column(col, self.path)
self.columnlist[col] = ... |
Python | UTF-8 | 2,384 | 3.359375 | 3 | [] | no_license | import matplotlib.pyplot as pyplot
products = {4: [], 7: [], 29: []}
alphas = [1, 1.5, 2, 5]
def get_file_name(ALPHA, attack_type="", attack_length=0):
fn = "output/"
if attack_length > 0:
fn += attack_type + "_" + str(attack_length) + "_"
return fn +"Alpha_" + str(ALPHA) + "_Products.txt"
def get_product_data(... |
C++ | UTF-8 | 3,322 | 2.65625 | 3 | [
"MIT"
] | permissive | #include "saveMatlabMat.h"
/* template <typename T>
bool SaveMatlabMat(T *src, string savePath, string matrixName, int cols, int rows)
{
// tanspose befoee being saved
int datasize = cols * rows;
double *Final = new double[datasize]; //convert to double precision
memset(Final, 0, datasize * sizeof(doub... |
Shell | UTF-8 | 502 | 2.828125 | 3 | [
"MIT"
] | permissive | #!/bin/bash
#
# Description : Install and optimize database instance
# Author : Jose Cerrejon Gonzalez (ulysess@gmail_dot._com)
# Version : 0.3 (14/May/14)
#
#
clear
# MySQL
echo -e "Installing MySQL+PHP5 conn..."
sudo apt-get install -y mysql-server php5-mysql mysql-client
echo -e "Optimizing..."
sudo mv /et... |
Ruby | UTF-8 | 1,661 | 2.921875 | 3 | [] | no_license | require 'net/ldap'
module Auth
# The DN class is responsible for constructing a DN given a key piece of
# information, i.e. an email address or a login alias. Conversely, when
# given a valid DN, it should parse and make available useful information
# from the DN.
class DN
def dn() raise NotImplement... |
C | UTF-8 | 947 | 2.96875 | 3 | [
"MIT"
] | permissive | #ifndef __LIST__
#define __LIST__
#include "heap.c"
#define typedef_TypedList(Type) \
typedef struct { \
Heap *heap; \
Type *items; \
ULong count; \
} Type##List; \
\
Boolean addTo##Type##List(Type##List *list, Type value) { \
if (!growList(list->heap, (Any**)&list->items, &list->count, sizeof... |
Python | UTF-8 | 2,151 | 2.765625 | 3 | [] | no_license | import os
import re
import random
def strQ2B(ustring):
ss = []
for s in ustring:
rstring = ""
for uchar in s:
inside_code = ord(uchar)
if inside_code == 12288:
inside_code = 32
elif (inside_code >= 65281 and inside_code <= 65374)... |
Markdown | UTF-8 | 4,270 | 3.0625 | 3 | [
"MIT"
] | permissive | # Assignment 2 (Group)
Explore 2 dataset that given then finding descriptive statistics and summary result in form of sentences/paragraph at least 5 topics.
### Answer
1.) หาค่าเฉลี่ย,min,max ของอายุใน survey table
```{R}
library(MASS)
min(survey$Age)
max(survey$Age)
mean(survey$Age)
```
Descriptive statistics State... |
Markdown | UTF-8 | 595 | 2.625 | 3 | [
"MIT"
] | permissive | # get-port-cli
> Get an available port
## Install
```sh
npm install --global get-port-cli
```
## Usage
```
$ get-port --help
Usage
$ get-port <preferred-ports>…
Options
--host, -h The host on which port resolution should be performed. Can be either an IPv4 or IPv6 address.
Examples
$ get-port... |
Java | UTF-8 | 1,106 | 1.65625 | 2 | [] | no_license | package com.aoscia.base.api;
import com.aoscia.base.dto.FireLedgerDto;
import com.aosica.common.bean.RequestResult;
import com.aosica.common.bean.RequestResultPage;
import com.github.pagehelper.Page;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMappi... |
Java | UTF-8 | 1,477 | 3.140625 | 3 | [] | no_license | package pl.sda.collection.service;
import pl.sda.collection.model.Book;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
public class BookService {
private List<Book> collections;
public BookService() {
this.collections = new ArrayList<>()... |
C++ | UTF-8 | 2,107 | 3.640625 | 4 | [] | no_license | //#include "stdafx.h"
#include <iostream>
#include <iomanip>
using namespace std;
double AverageScore(double Total, int NumScores);
void selectionSort(double array[], int size);
void showArray(double array[], int size);
int main()
{
double *scores, // To dynamically allocate an array of scores
total = 0.0;... |
Python | UTF-8 | 4,591 | 3.171875 | 3 | [
"MIT"
] | permissive | import numpy as np
class Perceptron(object):
'''
Implements a simple Perceptron network using sequential training
'''
def __init__(self, input_size, class_size, eta):
'''
Args:
eta (int): learning rate
input_size (int): length of input, assumes shape = (input_si... |
Markdown | UTF-8 | 680 | 2.59375 | 3 | [] | no_license | # Java-Org-Managers
[](https://travis-ci.org/HauptJ/Java-Org-Managers)
A simple Java program that calculates a fictitious departments allocation based on the number of managers, developers and qa staff.
This was written to meet the requ... |
Java | UTF-8 | 1,289 | 2.140625 | 2 | [] | no_license | package com.wxq.developtools;
import com.wxq.commonlibrary.base.BaseView;
import com.wxq.commonlibrary.base.RxPresenter;
/**
* Created by wxq on 2018/6/28.
*
* //p成拿到view成數據
*/
public class MvpMainPresent extends RxPresenter<MvpMainContract.View> implements MvpMainContract.Presenter {
public MvpMainPresent... |
C++ | UTF-8 | 1,284 | 3.671875 | 4 | [] | no_license |
/*
LeetCode: longest valid parentheses
https://leetcode.com/problems/longest-valid-parentheses/
*/
// WA: wrong understanding
// a well-formed parenthese pair doesn't mean we must
// have continous '(' and ')'
// meaning they are not interruptted
class Solution {
public:
int longestValidParentheses(string s) {
... |
Java | UTF-8 | 2,051 | 3.71875 | 4 | [] | no_license | import java.util.*;
class findMax{
public static class Node{
int data = 0;
Node left = null;
Node right = null;
Node(int data){
this.data = data;
}
}
public static Node constructBST(ArrayList<Integer> arr,int si,int ei){
if(si>ei) return null;
... |
Java | UTF-8 | 288 | 2.484375 | 2 | [] | no_license | package com.cheny.algs4.wk4_priority_queue;
/**
* <p>MaxPQ</p>
*
* @author of1610 chenyong
* @version 1.0
* @since 1.0
*/
public interface MaxPQ<Key extends Comparable<Key>> {
void insert(Key key);
Key delMax();
boolean isEmpty();
Key max();
int size();
}
|
Markdown | UTF-8 | 2,548 | 2.8125 | 3 | [] | no_license | [[File:Electrochemical_element_with_salt_bridge.png|thumb]]。]]
'''鹽橋''' (Salt bridge) 在[[化學|化學]]上是指一種[[實驗|實驗]]裝置,用以連接[[伽凡尼電池|賈凡尼電池]](伏打電池,一種[[電化電池|電化電池]])的[[氧化|氧化]]半電池和[[還原|還原]]半電池。鹽橋通常分為兩類:玻璃管型和[[濾紙|濾紙]]型。
==玻璃管型鹽橋==
此型鹽橋由U型管和填滿管內的相對[[惰性|惰性]][[電解質|電解質]]組成。電解質通常使用饱和[[氯化鉀|氯化鉀]](KCl)或硝酸铵(NH<sub>4</sub>NO<sub>3</sub>)。瓊脂... |
Java | UTF-8 | 569 | 2.375 | 2 | [] | no_license | import java.io.*;
import java.net.*;
public class ServerSSTachTen {
public final static int defaultPort = 2017;
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
System.out.println("server start ...");
ServerSocket ss = new ServerSocket(defaultPort);
while(true){
S... |
Python | UTF-8 | 4,186 | 2.5625 | 3 | [] | no_license | import numpy as np
from itertools import combinations, permutations
from group_actions.group_utiliies import permutation_parity
class WedgeMaker:
def __init__(self, power):
self.power = power
get_wedge_matrix_mapping = {
2: self._get_wedge_matrix_dim_2,
3: self._get_wedge_... |
Java | UTF-8 | 1,379 | 2.671875 | 3 | [] | no_license | package com.jfbian.utils;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import org.apache.commons.io.FileUtils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
/**
* @ClassName: JsonFileUtil
* @Description:解析.json文件工具类
* @author: bianjianfeng
* @da... |
C# | UTF-8 | 408 | 2.71875 | 3 | [
"MIT"
] | permissive | using System;
namespace Al500CSharp {
/*prog imp3
imprima 11Aprendendo Algoritmo!!!";
imprima "\nCom Anita e Guto";
fimprog */
public class Algoritmo13 {
private void Logic () {
string[] imprima = { "Aprendendo Algoritmo!!!", "\nCom Anita Lopes e Guto Garcia." };
Console.WriteLine (... |
PHP | UTF-8 | 331 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace FFMpeg\Tests\Coordinate;
use FFMpeg\Tests\TestCase;
use FFMpeg\Coordinate\Point;
class PointTest extends TestCase
{
public function testGetters()
{
$point = new Point(4, 25);
$this->assertEquals(4, $point->getX());
$this->assertEquals(25, $point->getY());
... |
C++ | UTF-8 | 2,296 | 2.6875 | 3 | [] | no_license | class Solution {
public:
int numberOfPatterns(int m, int n) {
int ans = 0;
vector<bool> visited(9, false);
for (int i=0; i<3; ++i) {
for (int j=0; j<3; ++j) {
dfs(i, j, 0, m, n, visited, ans);
}
}
return ans;
}
void dfs(int i, i... |
Go | UTF-8 | 2,659 | 3.09375 | 3 | [] | no_license | //批量发送http请求
package multiHttp
import (
"strings"
"io"
"bufio"
"os"
"net/http"
"io/ioutil"
"net/url"
)
/* GET 请求
* uri http地址
*/
func Get(uri string) string{
rep,err := http.Get(uri)
if err != nil{
return "404"
}
defer rep.Body.Close()
body,err := iout... |
C++ | UTF-8 | 1,254 | 2.71875 | 3 | [
"BSL-1.0"
] | permissive | //-----------------------------------------------------------------------------
// constant expression table library
//-----------------------------------------------------------------------------
//
// Copyright (c) 2013
// Joshua Napoli <jnapoli@alum.mit.edu>
//
// Distributed under the Boost Software License, Versio... |
Java | UTF-8 | 1,440 | 3.140625 | 3 | [] | no_license | package com.easystudy.error;
public class ReturnValue<T> {
private Integer error; // 错误
private String description; // 错误描述
private T value; // 返回值【当error为ERROR_NO_SUCCESS才有可能返回值-判断值是否为空】
// 成功不带返回值
public ReturnValue(){
this.error = ErrorCode.ERROR_SUCCESS.getError();
this.description... |
C# | UTF-8 | 1,010 | 2.625 | 3 | [] | no_license | using DentalOffice.BLL.Interfaces;
using DentalOffice.DAL.Interfaces;
using DentalOffice.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DentalOffice.BLL
{
public class PatientsLogic : IPatientsLogic
{
private read... |
PHP | UTF-8 | 1,223 | 3.21875 | 3 | [
"MIT"
] | permissive | <?php
namespace Essential\Http;
class Request
{
private static $request;
private $method;
private $uri;
/**
* Request constructor.
*/
public function __construct()
{
$this->method = $_SERVER['REQUEST_METHOD'];
$this->uri = $_SERVER['REQUEST_URI'];
$this->setR... |
Java | UTF-8 | 4,052 | 3.109375 | 3 | [] | no_license | package com.example.project4;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.view.inputmethod... |
Rust | UTF-8 | 1,204 | 3 | 3 | [] | no_license | use std::collections::VecDeque;
use proconio::input;
fn main() {
input! {
n: usize,
}
let mut roads = vec![vec![]; n + 1];
for _ in 0..n - 1 {
input! {
a:usize,
b:usize,
}
roads[a].push(b);
roads[b].push(a);
}
let (last, _) = sear... |
Java | UTF-8 | 791 | 3 | 3 | [] | no_license | import java.io.PrintWriter;
import java.util.Scanner;
public class problem_165 {
public static void main(String[] args) {
Scanner e = new Scanner(System.in);
PrintWriter pw = new PrintWriter(System.out,false);
int num;
do
{
Boolean ban = true;
String S... |
JavaScript | UTF-8 | 2,596 | 4.75 | 5 | [] | no_license | const args = process.argv.slice(2);
const word = args[0].toLowerCase(); // ensures we start with a word that is lowercase
let result = '';
for (let i = 0; i < word.length; i++) {
if (i % 2 === 0) {
// if it is an even letter (even from the code perspective,
// remember js/computers start counting at 0 not 1)
/... |
PHP | UTF-8 | 532 | 3.625 | 4 | [] | no_license | <?php
/**
* author:lhj
* email:416703504@qq.com
* create: 2020/3/20 9:36
**/
class Solution
{
/**
* @param Integer[] $arr
* @param Integer $k
* @return Integer[]
*/
function getLeastNumbers($arr, $k)
{
$minArr = [];
while (count($minArr) < $k) {
$min = m... |
Markdown | UTF-8 | 413 | 2.625 | 3 | [] | no_license | # hello-world
Git Hub's Hello World project
Hello World!
My name is Christopher Stevens. I live in Tempe, AZ.
I am a software developer looking to expand my experience and skill set.
I am primarily a python programmer, but also have coded in java, javascript, html, css, xml and for my last job, I made Magic.
Looking ... |
Java | UTF-8 | 384 | 2.203125 | 2 | [] | no_license | package com.niit.demoDAO;
import java.util.List;
import com.niit.demomodel.product;
public interface productDAO {
public void persist(product p);
public product getId (int productid);
public boolean update(product p);
public product findById(int productid);
public List<product> getAllprod... |
SQL | UTF-8 | 9,639 | 2.796875 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : cars
Source Server Type : MySQL
Source Server Version : 80011
Source Host : localhost:3306
Source Schema : cars
Target Server Type : MySQL
Target Server Version : 80011
File Encoding : 65001
Date: 19/07/20... |
Java | UTF-8 | 7,799 | 2.109375 | 2 | [] | no_license | package com.mahdi.sandogh.model.installmentloan.service;
import com.mahdi.sandogh.model.account.Account;
import com.mahdi.sandogh.model.account.service.AccountService;
import com.mahdi.sandogh.model.installmentloan.InstallmentLoan;
import com.mahdi.sandogh.model.installmentloan.dto.InstallmentLoanDto;
import com.mahdi... |
C | UTF-8 | 8,393 | 2.875 | 3 | [] | no_license | /************************************************************************************
***
*** Copyright 2017 Dell(18588220928@163.com), All Rights Reserved.
***
*** File Author: Dell, Sat Jun 17 11:18:51 CST 2017
***
************************************************************************************/
#include "seam.... |
Java | ISO-8859-1 | 1,827 | 3.25 | 3 | [] | no_license | package ar.edu.ort.tp1.parcial1.clases;
public abstract class Mascota implements Animal {
private static final String MSG_COM_FELIZ = "He comido demasiado";
private static final String MSG_COM_HAMBRIENTO = "Muchas gracias tena hambre";
private static final String MSG_COM_ENFERMO = "No tena mucha hambre, pero... |
Markdown | UTF-8 | 1,086 | 2.84375 | 3 | [] | no_license | # Conception
## Cahier de charge
**Un étudiant peut passer zéro au plusieurs examens.**<br/>
**Un examen peut être passé par zéro ou plusieurs étudiants et en indiquant la date d’examen et la note obtenue initialiser à zéro.**<br/>
**Un examen est composé d’un ou plusieurs questionnaires.** <br/>
**Un examen contien... |
C++ | UTF-8 | 1,623 | 3.0625 | 3 | [
"MIT"
] | permissive | /* Class for generating cubic splines for smooth interpolation of int values in any 3D colorspace that I have implemented so far.
Uses the Newton algorithm and then horner evaluation for efficient computation */
#ifndef Interpolator_H
#define Interpolator_H
class Interpolator {
private:
// coefficients of the sp... |
C++ | GB18030 | 3,166 | 2.546875 | 3 | [] | no_license | #include "gl_gameserver_pch.h"
#include "game_contact_listener.h"
#include "debug_render.h"
#include "gl_gameserver.h"
GameContactListener::GameContactListener(GlGameServer* gs) :
m_GameServer(gs)
{
m_pointCount = 0;
}
void GameContactListener::BeginContact(b2Contact* contact)
{
B2_NOT_USED(contact);
}
voi... |
C# | UTF-8 | 2,876 | 2.640625 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
namespace IDevman.SAPConnector.Data.Model
{
/// <summary>
/// Purchase request model
/// </summary>
public class OPRQ
{
/// <summary>
/// Gets document entry
/// </summary>
public int DocEntry { get; set; }
/// <summary>
/// Gets d... |
Java | UTF-8 | 1,979 | 2.328125 | 2 | [] | no_license | package cz.skywall.circularnumberpicker.test;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import cz.skywall.circularnumberpicker.CircularNumberPickerView;
import cz.skywall.circularnumberpicker.OnNumberSelectedListener;
publ... |
Swift | UTF-8 | 10,002 | 3.03125 | 3 | [] | no_license | //
// Menu.swift
// Resume
//
// Created by Ian MacCallum on 8/4/15.
// Copyright © 2015 Ian MacCallum. All rights reserved.
//
import UIKit
import Foundation
//MARK: Typealiases
typealias Block = () -> ()
typealias SuccessBlock = Bool -> ()
//MARK: Menu Node
class MenuNode: NSObject {
let title: String
... |
TypeScript | UTF-8 | 3,286 | 2.640625 | 3 | [] | no_license | import { Request } from "express"
import asyncHandler from "express-async-handler"
import Question, { QuestionSchema } from "../models/questionModel"
import { UserSchema } from "../models/userModel"
interface UserRequest extends Request {
user: UserSchema
}
// SECTION: Get all questions
// @route: GET /api/questio... |
Python | UTF-8 | 903 | 3.125 | 3 | [] | no_license | from turntablecontrol import TurnTableControl # to control motor
from time import sleep, perf_counter # for waiting and time measure
import numpy as np # for array math
import matplotlib.pyplot as plt # for plotting
motor = TurnTableControl('/dev/tty.usbserial', tableGearRatio=1) # test motor only
data = np.zeros((10... |
Java | UTF-8 | 1,664 | 3.109375 | 3 | [] | no_license | package Kiszel.Daniel.Game;
import Kiszel.Daniel.Shapes.ListCubes;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
public class Window implements MouseListener {
private JFrame frame;
private Canvas canvas;
private String title;
privat... |
Ruby | UTF-8 | 2,210 | 2.640625 | 3 | [
"MIT"
] | permissive | class ATSPI::Accessible
# Wraps libatspi's AtspiSelection[https://developer.gnome.org/libatspi/stable/libatspi-atspi-selection.html]
# together with parts of {Children} and {Children::Selected}
module Selectable
# @!group Attributes & States
# Checks if it can be selected. Accessibles which parent's native
... |
TypeScript | UTF-8 | 2,668 | 2.90625 | 3 | [
"MIT"
] | permissive | import * as doms from "../../shared/utils/dom";
interface Point {
x: number;
y: number;
}
const hintPosition = (element: Element): Point => {
const { left, top, right, bottom } = doms.viewportRect(element);
if (element.tagName !== "AREA") {
return { x: left, y: top };
}
return {
x: (left + right... |
Java | UTF-8 | 444 | 1.8125 | 2 | [] | no_license | package net.siekiera.mgc.dao;
import net.siekiera.mgc.model.CenyWalut;
import net.siekiera.mgc.model.Currency;
import org.springframework.data.repository.CrudRepository;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* Created by eric on 16.05.2016.
*/
@Transactional
pu... |
Java | UTF-8 | 10,461 | 2.640625 | 3 | [] | no_license | package de.toboxos.abi;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.GridLayout;
import javax.swing.JList;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.File;
import ja... |
C++ | UTF-8 | 1,020 | 2.78125 | 3 | [] | no_license | #ifndef DCMAET_H
#define DCMAET_H
#include <iostream>
#include <string.h>
#include <settings/MPSSystemSettings.h>
using namespace std;
class DcmAET
{
private:
string m_aet;
string m_hostname;
int m_port;
public:
DcmAET(const string& aet, const string& hostname, int port);
DcmAET(cons... |
Markdown | UTF-8 | 3,141 | 2.59375 | 3 | [
"Apache-2.0",
"CC-BY-3.0"
] | permissive | ---
layout: post
title: Usa Lighthouse para los presupuestos de rendimiento
authors:
- katiehempenius
description: |2-
Lighthouse ahora admite presupuestos de rendimiento. Esta función, LightWallet, se puede instalar en menos de cinco minutos y proporciona información sobre el tamaño y la cantidad de recursos de l... |
Java | UTF-8 | 10,354 | 2.25 | 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 AppDisplay;
import BiologicalPark.ClientDAOJson;
import BiologicalPark.GestorPercurso;
import BiologicalPark.Interest... |
Java | UTF-8 | 1,059 | 2.96875 | 3 | [] | no_license | package com.company;
public class Dyr {
int antalBen = 7;
double kropsTemperatur = 3.4;
boolean levende = false;
String navn = "søren";
public Dyr() {
}
public Dyr(int a) {
this.antalBen = a;
}
public Dyr(int a, double kropsTemperatur, boolean x, String navn) {
th... |
Python | UTF-8 | 2,872 | 2.65625 | 3 | [] | no_license | #coding: utf-8;
from __future__ import division, print_function, unicode_literals
from future_builtins import *
from BaseEvaluator import *
from Status import *
class SquatEvaluator(BaseEvaluator):
IDEAL_PACE = 1
def __init__(self, segment_id, training):
super(SquatEvaluator, self).__init__(segment_id... |
JavaScript | UTF-8 | 7,096 | 2.515625 | 3 | [] | no_license | Ext.define('ContactsApp.view.contacts.ContactsController', {
extend: 'Ext.app.ViewController',
alias: 'controller.contacts',
requires: [
'ContactsApp.model.Contact'
],
onAddClick: function(button, e, options){
this.createDialog();
},
onEditClick: function(button, e, option... |
Java | UTF-8 | 2,116 | 2.453125 | 2 | [] | no_license | package argo.batch;
/* Extends the metric data information by adding the extra group field
*
*/
public class MonData {
private String group;
private String service;
private String hostname;
private String metric;
private String status;
private String timestamp;
private String monHost;
private String summa... |
Swift | UTF-8 | 4,534 | 2.578125 | 3 | [
"MIT"
] | permissive | //
// SwiftPlaygroundsHelper.swift
// FilterPlayground
//
// Created by Leo Thomas on 11.09.17.
// Copyright © 2017 Leo Thomas. All rights reserved.
//
import Foundation
extension KernelArgumentValue {
fileprivate func swiftPlaygroundValue(with attributeName: String) -> String {
switch self {
... |
Java | UTF-8 | 1,371 | 2.125 | 2 | [] | no_license | package com.brunoeleodoro.org.recyclerviewtest;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widge... |
Java | UTF-8 | 1,341 | 2.234375 | 2 | [] | no_license | package fr.wcs.simplelist.Models;
/**
* Created by apprenti on 22/01/18.
*/
public class CoinListModel {
private String shortNameCoin;
private String longNameCoin;
private String actualValueCoin;
private String photoURLCoin;
public CoinListModel(String shortNameCoin, String longNameCoin, Strin... |
Java | UTF-8 | 3,623 | 2.140625 | 2 | [] | no_license | package com.ricky.f.util;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
/**
* 资源helper
* @author Administrator... |
Python | UTF-8 | 625 | 4.4375 | 4 | [] | no_license | """
7. Write a Python program to print all unique values in a dictionary.
Sample Data : [{"V":"S001"}, {"V": "S002"}, {"VI": "S001"}, {"VI": "S005"},
{"VII":"S005"}, {"V":"S009"},{"VIII":"S007"}]
Expected Output : Unique Values: {'S005', 'S002', 'S007', 'S001', 'S009'}
"""
def print_unique_value(given_dict): # funti... |
TypeScript | UTF-8 | 1,114 | 2.984375 | 3 | [] | no_license | import { parse } from "date-fns";
import { isActive, isTitleValid, isValid } from "../Task";
it("isActive returns true for active at the moment task", () => {
const task = {
id: "test",
title: "test",
created: parse("2019-01-01"),
schedule: { 1: { 22: true } },
};
expect(isActive(task, parse("20... |
Python | UTF-8 | 825 | 3.046875 | 3 | [] | no_license | # 36_7
import sys
from itertools import product
out = open("output.txt",'w')
Input = open(sys.argv[1])
Input = Input.read().split("\n")
K = int(Input[0].split(" ")[0])
d = int(Input[0].split(" ")[1])
Seqs = filter(lambda s: s!='', Input[1:])
def diff(seq1,seq2,d):
'''
seq1 and seq2 must be same length
True if... |
Java | UTF-8 | 1,999 | 2.21875 | 2 | [] | no_license | package com.interview.request.integrationTest.controller;
import com.interview.request.controller.MatchController;
import com.interview.request.domain.CommonResult;
import lombok.extern.slf4j.Slf4j;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factor... |
C++ | UTF-8 | 7,042 | 2.671875 | 3 | [
"Unlicense"
] | permissive |
#include "Shaders.hpp"
using namespace Engine;
CShader::CShader(void) : Type(0), GLShader(0)
{
}
CShader::~CShader(void)
{
Destroy();
}
bool CShader::Create(std::string Filename)
{
int Status;
Filename.insert(0, RootDir + ResourceDir + "shaders\\");
this->Filename = Filename;
... |
Ruby | UTF-8 | 173 | 3 | 3 | [] | no_license | input = File.open(ARGV[0]).readlines
input.each do |nums|
numbers = nums.split
output = []
numbers.each do |i|
output << i.to_f
end
puts output.sort.join(' ')
end
|
C# | UTF-8 | 1,036 | 3.359375 | 3 | [] | no_license | using System;
namespace OOP1
{
class Program
{
static void Main(string[] args)
{
Product product1 = new Product();
product1.Id = 1;
product1.CategoryId = 2;//Mobilya olsun
product1.ProductName = "Masa";
product1.UnitPrice = 500;
... |
Markdown | UTF-8 | 308 | 2.734375 | 3 | [] | no_license | ---
title: "Give all permission to the owner, read execute to the group and nothing to others"
date: 2020-12-22T14:58:42-08:00
draft: true
---
```
# Create a file
touch file1
# Set permission using either of the method
chmod 750 file1
chmod u=rwx,g=rx,o= file1
# List the file permission
ls -lh file1
```
|
C++ | UTF-8 | 252 | 2.984375 | 3 | [] | no_license | #include <stdio.h> // header file
#include <iostream> // header file
using namespace std; // namespace for cout
int main()
{
printf("Hello World!\n");
cout << "hello from cout" << endl;
cout << "Another line";
return 0;
}
|
Python | UTF-8 | 1,841 | 2.609375 | 3 | [] | no_license | '''
Created on Jun 4, 2011
@author: gr00vy
'''
from logging import debug
import os
from subprocess import PIPE, Popen
import shlex
class InvalidPintoolPathException(Exception):
pass
class AbstractPintool(object):
def __init__(self, pin_dir, tool_path, tool_name):
# pin will take a different name in ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.