language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Python | UTF-8 | 1,887 | 2.75 | 3 | [] | no_license | import pandas as pd
from py_config import ConfigFactory
from py_logging import LoggerFactory
from py_pandas import Parser
class JDYParser(Parser):
def getJDYDF(self, filename: str, sheet_name: str):
# 读取数据
dict = {'sheet_name': sheet_name, 'header': None, }
jdyDF = pd.read_excel(io=filen... |
Python | UTF-8 | 1,514 | 2.640625 | 3 | [
"MIT"
] | permissive | import scrapy
from tobber.items import Torrent
from tobber.spiders.indexer import Indexer
class Eztv(Indexer):
name = "EZTV"
def start_requests(self):
print 'EZTV is scrapying...'
self.site = "https://eztv.ag"
urls = []
search = self.site + "/search/"
for title in sel... |
Python | UTF-8 | 1,970 | 3.125 | 3 | [] | no_license | # Push-Relabel Algorithm for Maximum Flow
#
# Complexity: O(n**2 * m) | n = number of nodes; m = number of edges;
#
# Room for improvement:
#
# Highest Label Node Selection: O(n**2 * sqrt(m)) Dinic's Algo w/Link-Cut
# Trees: O(n * log(n) * m) | Only preferable in select circumstances
#
# Why this Algo:
#
# * Simp... |
Markdown | UTF-8 | 7,456 | 3.078125 | 3 | [] | no_license | #Introduction
This file describes the data, the variables, and the work that has been performed to clean up the data.
#Data Set Description
The experiments have been carried out with a group of 30 volunteers within an age bracket of 19-48 years. Each person performed six activities (WALKING, WALKING_UPSTAIRS, WALKING... |
Shell | UTF-8 | 1,822 | 3.953125 | 4 | [] | no_license | #!/usr/bin/bash
# Set the git directories to pull down code
SSH_OR_HTTPS="SSH"
if [[ "$SSH_OR_HTTPS" == "HTTPS" ]]; then
echo "Cloning repositories using the $SSH_OR_HTTPS method."
SVP="https://github.com/jayatsandia/svp.git"
# Alternative: "https://github.com/sunspec/svp.git"
declare -a WORKING_DIRE... |
Python | UTF-8 | 646 | 3.1875 | 3 | [] | no_license | import sys
sys.stdin = open("5097.txt", "r")
class Queue:
def __init__(self, n):
self.queue = []
self.front = -1
self.rear = -1
def enQueue(self, item):
if self.rear == -1:
self.rear + 1
self.queue.append(item)
def deQueue(self):
self.front +... |
Java | UTF-8 | 729 | 2.078125 | 2 | [] | no_license | package blueprint.com.sage.shared.interfaces;
import android.content.SharedPreferences;
import com.google.android.gms.common.api.GoogleApiClient;
import blueprint.com.sage.models.School;
import blueprint.com.sage.models.Semester;
import blueprint.com.sage.models.User;
import blueprint.com.sage.utility.network.Networ... |
JavaScript | UTF-8 | 1,983 | 2.703125 | 3 | [] | no_license | 'use strict';
/**
* アカウント情報を取得する
*
* returns User
**/
exports.get_account_info = function() {
return new Promise(function(resolve, reject) {
var examples = {};
examples['application/json'] = {
"rss_url" : "rss_url",
"id" : 0,
"ical_url" : "ical_url",
"username" : "username"
};
if (Object.key... |
C | UTF-8 | 1,191 | 2.578125 | 3 | [
"MIT"
] | permissive | #include <brutal/alloc.h>
#include <brutal/host/io.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
HostIoOpenFileResult host_io_file_open(Str path)
{
char *cstr = alloc_malloc(alloc_global(), path.len + 1);
mem_cpy(cstr, path.buffer, path.len);
cstr[path.len] = '\0';... |
Markdown | UTF-8 | 1,217 | 2.859375 | 3 | [] | no_license | # Predicting Credit Card Approval
##### Courtesy of DataCamp
Commercial banks receive <em>a lot</em> of applications for credit cards. Many of them get rejected for many reasons, like high loan balances, low income levels, or too many inquiries on an individual's credit report, for example. Manually analyzing these ap... |
C | UTF-8 | 448 | 3.3125 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include "ExpressionTree.h"
#include "ExpressionTree.c"
int main(void)
{
char exp[] = "12+7*";
BTreeNode * eTree = MakeExpTree(exp);
printf("전위 표기법의 수식: ");
ShowPrefixTypeExp(eTree); printf("\n");
printf("중위 표기법의 수식: ");
ShowInfixTypeExp(eTree); printf("\n");
printf("후... |
C# | UTF-8 | 890 | 2.796875 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | // <snippet3>
using System;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.IO;
namespace WpfApplication1
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
... |
Python | UTF-8 | 6,866 | 3.109375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause",
"MIT"
] | permissive | """
Contribution - Griatch 2011
> Note - with the advent of MULTISESSION_MODE=2, this is not really as
necessary anymore - the ooclook and @charcreate commands in that mode
replaces this module with better functionality. This remains here for
inspiration.
This is a simple character creation commandset for the Accoun... |
C++ | UTF-8 | 5,940 | 2.515625 | 3 | [] | no_license | #include "Game/MapGenStep_CellularAutomata.hpp"
#include "Game/GameCommon.hpp"
#include "Game/Map.hpp"
#include "Game/MapDefinition.hpp"
#include "Game/Tile.hpp"
#include "Game/TileDefinition.hpp"
#include "Game/TileMetaData.hpp"
#include "Engine/Math/RandomNumberGenerator.hpp"
#include "Engine/Math/IntVec2.hpp"
//--... |
Java | UTF-8 | 1,065 | 3.71875 | 4 | [] | no_license | package lab13;
/**
* Создать массив, заполнить его случайными элементами
* ,
* распечатать, перевернуть, и снова распечатать (при
* переворачивании
* нежелательно создавать еще один массив).
*/
import java.util.Scanner;
import java.util.Arrays;
public class TurnArray {
public static void mai... |
Python | UTF-8 | 971 | 2.53125 | 3 | [] | no_license | import numpy as np
import pandas as pd
def rename_dups(filename):
tb = pd.read_table(filename, delim_whitespace = True, header = None, low_memory=False) #low_memory deprecated, just get rid of the error emssage
tb = tb.rename(columns={tb.columns[1]:"id"})
#tb['id'] = tb['id'].where((~tb['id'].duplicated(... |
C# | UTF-8 | 7,249 | 2.53125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http.Controllers;
using System.Web.Http.Filters;
namespace GGZY.YDPB.Api.Common
{
public class OperateTrackAttribute: Acti... |
Markdown | UTF-8 | 11,491 | 2.546875 | 3 | [] | no_license | ## 输入流stdin、输出流stdout、错误流stderr
1. >重定向到哪里
2. 1标准输出,2标准错误 2>&1 & 标准错误也输出到标准输出中 [0,1,2,&]>/dev/null 输出到空设备,即不输出;最后一个&表示后台执行
3. cmd >file> 2>&1 标准输出被重定向到了file,将标准错误拷贝到了标准输出即同样被重定向到了file
4. cmd 2>&1 > file 标准错误拷贝了标准输出的行为,但此时标准输出还是输出到终端;> file时标准输出才被重定向到了file,但标准错误还是输出到终端
5. cmd <<EOF 将END作为最后输入 <<-EOF 删除前导制表符
6. eof
## ... |
Java | UTF-8 | 3,135 | 2.296875 | 2 | [] | no_license | package com.zenghm.spring.cloud.extend.web.handler;
import cn.hutool.json.JSONUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.MethodParameter;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.support.WebDataBinderFactory;
im... |
Java | UTF-8 | 628 | 2.03125 | 2 | [] | no_license | package com.tweetapp.main.repository;
import java.util.List;
import java.util.Optional;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;
import com.tweetapp.main.entity.User;
@Repository
public interface UserRepository extends MongoRepository<User... |
C++ | UTF-8 | 336 | 2.765625 | 3 | [] | no_license | #include "employee.h"
employee::employee() {
}
employee::employee(const string &name, int &age, int &telephone) {
this->name = name;
this->age = age;
this->telephone = telephone;
}
void employee::setInfo(const string &name, int &age, int &telephone) {
}
void employee::calSalary() {
}
void employee::... |
Markdown | UTF-8 | 2,213 | 2.8125 | 3 | [] | no_license | ---
title: Lean Startup Melbourne Jan 2014
publishDate: 2014-01-29T07:30:47.000Z
---
This was a great session with a myriad of conflicting opinions and points of few, that always sparks a good debate :)</div> </div>First up a great set of introductory resources for startup founders from Scott Handsaker, with a lot... |
C++ | UTF-8 | 5,105 | 2.65625 | 3 | [] | no_license | #pragma once
#include "glm/glm.hpp"
#include <string>
#include <map>
#include <vector>
#include "agk.h"
#define ANIMATION_DELTA_TIME 0.01f
float bounceEaseOut(float t, float b, float c, float d);
float bounceEaseIn(float t, float b, float c, float d);
float bouncEaseInOut(float t, float b, float c, float d);
enum cl... |
SQL | UTF-8 | 1,372 | 3.703125 | 4 | [] | no_license | CREATE DATABASE db_generation_game_online;
USE db_generation_game_online;
CREATE TABLE tb_classe(
id bigint auto_increment,
classe varchar (20),
arma varchar (20),
elemento varchar (20),
primary key(id) );
CREATE TABLE tb_personagem(
id bigint auto_increment,
nome varchar (25),
idade int,
raca varchar (25),
ataque i... |
Python | UTF-8 | 812 | 3.515625 | 4 | [] | no_license | class Solution(object):
def searchRange(self, nums, target):
l = 0; r = len(nums)-1; m = round( (l+r)/2 )
while( (m!=l) and (m!=r) ):
if (nums[m]==target):
break
if (nums[m]>target):
r = m
else:
l = m
m ... |
Markdown | UTF-8 | 3,502 | 3.15625 | 3 | [
"CC-BY-4.0"
] | permissive | Gun to the Head
===============
Nonsense
--------
I used to laugh at a scene in the hollywood movie "Swordfish" where an 'ace hacker' was put at gunpoint to 'hack the pentagon' with a gun to his head while being distractedly serviced by a young lady and given 60 seconds before the trigger was pulled to blow his brai... |
Java | UTF-8 | 6,264 | 1.859375 | 2 | [] | no_license | package com.example.leftie.Essapp.Fragments;
import android.app.DatePickerDialog;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.Menu;
imp... |
Markdown | UTF-8 | 3,477 | 2.671875 | 3 | [
"Unlicense"
] | permissive |
# У Львові умертвили кобилу, яка через феєрверк зламала собі обидві ноги
Published at: **2019-11-03T15:55:00+00:00**
Author: ****
Original: [ZIK.UA](https://zik.ua/news/2019/11/03/u_lvovi_umertvyly_kobylu_yaka_cherez_feyierverk_zlamala_sobi_obydvi_nogy_1682643)
Кобилу Фауну, яка 2 листопада, злякавшись са... |
Java | UTF-8 | 4,542 | 2.3125 | 2 | [
"CC-BY-4.0",
"Apache-2.0"
] | permissive | /* SPDX-License-Identifier: Apache-2.0 */
/* Copyright Contributors to the ODPi Egeria project. */
package org.odpi.openmetadata.accessservices.digitalservice.properties;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.a... |
Java | UTF-8 | 1,480 | 2.296875 | 2 | [] | no_license | /**
*
*/
package ca.uwinnipeg.proximity.desktop.features;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTreeViewer;
import org.eclipse.jface.viewers.ICheckStateListener;
import ca.uwinnipeg.proximity.desktop.ProximityController;
import ca.uwinnipeg.proximity.desk... |
PHP | UTF-8 | 1,396 | 2.640625 | 3 | [] | no_license | <?php
?>
<?php
include_once('../DataBase/ConnectionDB.php');
session_start();
$mat= $_SESSION['mat'];
$con = DBConnection::open();
$sql = "SELECT * FROM orientando where matori='$mat'";
$query = $con->query($sql);
?>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
... |
JavaScript | UTF-8 | 5,305 | 2.78125 | 3 | [] | no_license | var express = require("express")
, mongoose = require('mongoose')
, http = require("http")
, app = express()
, port = parseInt(process.env.PORT, 10) || 8080;
app.configure(function(){
app.use(express.static(__dirname + '/app'));
app.use(express.logger('dev')); // lo... |
Python | UTF-8 | 602 | 4.34375 | 4 | [] | no_license | def fib(number_for_fibonacci):
# Add code here
a, b = 0, 1
for i in range (1, number_for_fibonacci):
a, b = b, a + b
return b
def is_prime(number_to_check):
a = True
for i in range(int(number_to_check ** (0.5)) + 1):
if number_to_check % i == 0:
return False
return True
def rev... |
Go | UTF-8 | 953 | 3.453125 | 3 | [] | no_license | package main
import (
"fmt"
"math/rand"
"time"
)
func main() {
//生成一个50以内的随机数
var isChoice bool = true
for isChoice {
rand.Seed(time.Now().UnixNano())
var tmp int
var target int
tmp = rand.Int()
target = tmp % 51
println(target)
//用户输入一个数字
var num int
//判断大小
for i := 4; i >= 0; i-- {
p... |
Python | UTF-8 | 89 | 3.15625 | 3 | [] | no_license | my_list = ['hello','world','!']
print(my_list)
my_list = ' '.join(my_list)
print(my_list) |
Java | UTF-8 | 14,050 | 1.625 | 2 | [] | no_license | package net.boogaeye.darkvlight;
import net.minecraftforge.fml.network.PacketDistributor;
import net.minecraftforge.fml.network.NetworkEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.eventbus.api.Subs... |
C++ | UTF-8 | 605 | 2.59375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main() {
int t,n,i,sum,ans,arr[100],p=1;
while(1) {
cin >> n;
if(n == 0) {
return 0;
}
sum = 0;
for(i=0;i<n;i++) {
cin >> arr[i];
sum = sum + arr[i];
}
sum = sum/n;
... |
C++ | UTF-8 | 1,863 | 3.375 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <algorithm>
#include <iterator>
#include <vector>
using namespace std;
bool is_triangle(vector<string> tokens) {
vector<int> iv;
iv.reserve(tokens.size());
for (const auto &t : tokens) {
iv.push_back(stoi(t));
... |
Java | UTF-8 | 500 | 2.3125 | 2 | [] | no_license | package com.member.bean;
public class Base {
private int rows;
private int page;
private int start;
public int getRows() {
return rows;
}
public void setRows(int rows) {
this.rows = rows;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this... |
Java | UTF-8 | 601 | 3.4375 | 3 | [] | no_license | package com.test.array.rotation;
import java.util.Arrays;
public class RearrangePosAndNeg {
public static void main(String[] args) {
int arr[] = {-1, 2, -3, 4, 5, 6, -7, 8, 9};
arrange(arr);
}
public static void arrange(int[] a)
{
int i=-1;
int pos=0;
for(int j=0;j<a.length;j++)
{
if(a[j]<0)
{
... |
Python | UTF-8 | 2,387 | 3.453125 | 3 | [] | no_license | import codecs
import re
def text_to_wordlist(sentence):
regexp = "[^а-яА-Яё]"
sentence = re.sub(regexp, " ", sentence)
result = sentence.lower().split()
return result
def get_words():
text_file = open('text.txt', 'r', encoding="utf8")
lines = text_file.readlines()
words = []
for line i... |
Java | UTF-8 | 2,174 | 2.109375 | 2 | [] | no_license | package com.chethan.balancesheet.database;
/**
* Created by 3164 on 12-12-2016.
*/
public class DBConstants {
public static final String DATABASE_NAME = "balanaceSheet.db";
public static final int DATABASE_VERSION = 1;
//Tables
public final static String TABLE_NAME_BALANCESHEET = "balance_sheet_ta... |
Java | UTF-8 | 812 | 3.203125 | 3 | [] | no_license |
import java.awt.Graphics;
import java.awt.Color;
import java.awt.Rectangle;
public class Bullet extends GameObject
{
enum Source {PLAYER, ENEMY} // Enumeration of sources for bullet (allows for enemy bullets to pass by other enemies)
private Color color = new Color(252, 252, 252); // Almost pure white (as used in... |
SQL | UTF-8 | 23,985 | 3.546875 | 4 | [] | no_license | drop table if exists reviews;
drop table if exists toread;
drop table if exists haveread;
drop table if exists books;
drop table if exists genres;
drop table if exists authors;
create table authors
(
id serial primary key,
userid varchar(25) not null,
firstname varchar(25),
lastname varchar(25),
avgrating float n... |
Java | UTF-8 | 738 | 2.671875 | 3 | [] | no_license | package com.testyantra.assignment.collection;
public class StudentBean2 {
private int regno;
private String name;
private int marks;
private char grade;
public int getRegno() {
return regno;
}
public void setRegno(int regno) {
this.regno = regno;
}
public String getName() {
return name;
}
public ... |
PHP | UTF-8 | 1,054 | 2.84375 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: wmj
* Date: 2016/9/8
* Time: 11:15
*/
class A{
public static function getClassName(){
return self::class;
}
public static function say($word){
echo $word;
}
}
require_once('../Util/function.php');
require_once('../Service/redis.php');
... |
Markdown | UTF-8 | 2,168 | 2.671875 | 3 | [] | no_license | ---
title: 微信小程序开发之——婚礼邀请函-项目展示(4.1)
categories:
- 开发
- F-跨平台
- 微信小程序
tags:
- 微信小程序
abbrlink: fede05be
date: 2020-12-22 17:28:27
---
## 一 概述
* 项目页面组成
* 项目中使用到的API及组件
<!--more-->
## 二 项目页面组成
### 2.1 项目整体预览
![][1]
### 2.2 项目页面组成
本项目共有5个页面组成,分别是`邀请函`、`照片`、`美好时光`、`婚礼地点`、`宾客信息`
#### 邀请函
邀请函页面:新郎和新娘的电话、婚礼地点、婚礼时间... |
Python | UTF-8 | 4,736 | 3.328125 | 3 | [] | no_license | import numpy as np
import scipy.stats as stato
import scr.StatisticalClasses as Stat
class Game:
def __init__(self,id):
self.id=id
self.rnd=np.random
self.rnd.seed(self.id)
self.rarray = np.random.random(size=20)
self.game_list = list(self.rarray)
def simulation(self):
... |
Java | UTF-8 | 5,497 | 1.96875 | 2 | [
"Apache-2.0"
] | permissive | /**
* Copyright 2009-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... |
Python | UTF-8 | 549 | 2.65625 | 3 | [] | no_license | import os
from argparse import ArgumentParser
def update(firmware_path, version):
firmware = open(firmware_path + os.sep + version + '.txt', 'w+')
firmware.write(version)
def getVersion(firmware_path, version):
firmware = open(firmware_path + os.sep + version + '.txt', 'r')
files = firmware.name
... |
PHP | UTF-8 | 4,104 | 2.890625 | 3 | [] | no_license | <?php
namespace Att\Api\Speech;
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 */
/**
* Speech API Library
*
* PHP version 5.4+
*
* LICENSE: Licensed by AT&T under the 'Software Development Kit Tools
* Agreement.' 2013.
* TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTIONS:
* http://... |
Markdown | UTF-8 | 5,250 | 2.6875 | 3 | [] | no_license | Ensayo Prueba 1
En el texto “Mulata” de Nicolás Guillén, el cual fue escrito en 1930, se
puede ver como se ocupa el lenguaje y el estilo para transmitir un sentimiento o
mensaje, en este caso se ven raíces Afrocubanas en las expresiones que ocupa el
hablante lírico como podrían ser “nudo de cobbata”, este tipo de leng... |
Python | UTF-8 | 100 | 3.5625 | 4 | [] | no_license | #if-else program
x=30
if (x>50):
print("you scored above average")
else:
print("you have failed")
|
Java | UTF-8 | 496 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | package io.agrest.converter.valuestring;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
public class LocalDateConverter extends AbstractConverter<LocalDate> {
private static final LocalDateConverter instance = new LocalDateConverter();
public static LocalDateConverter converter() {
retur... |
Java | UTF-8 | 929 | 2.515625 | 3 | [] | no_license | package kr.co.mashup.mapc.entity;
import lombok.*;
import javax.persistence.*;
/**
* 정류장 시간표
* TODO: 2018. 8. 31. time table 데이터보고 필드 추가 필요
* <p>
* Created by ethan.kim on 2018. 8. 31..
*/
@Entity
@Table(name = "station_time_table")
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter
@ToString
@EqualsAnd... |
Java | UTF-8 | 5,911 | 2.28125 | 2 | [] | no_license | package oneiros.muj.oneiros.Activities;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
im... |
Swift | UTF-8 | 514 | 2.703125 | 3 | [
"MIT"
] | permissive | //
// ColorSlider.swift
// StickyNotes
//
// Created by Hiroki Kumamoto on 9/13/16.
// Copyright © 2016 kumabook. All rights reserved.
//
import UIKit
class ColorSlider: UISlider {
let thumbWidth = 40 as CGFloat
let thumbHeight = 40 as CGFloat
override func thumbRect(forBounds bounds: CGRect, trackRec... |
Markdown | UTF-8 | 910 | 2.921875 | 3 | [
"MIT"
] | permissive | # TrackingVisualizer
Store tracking data in REST backend and show a map view for each listed tracking
<img src="http://i.imgur.com/ESdYTW8.jpg" alt="Screenshot" width="600">
## Installation
You will need
- gulp
- node/ npm
CD into the repository directory and run the following to install:
```bash
npm install
``... |
Swift | UTF-8 | 2,423 | 2.6875 | 3 | [
"MIT"
] | permissive | //
// NowPlayingImageViewUpdater.swift
// PlayolaCore
//
// Created by Brian D Keane on 9/27/17.
// Copyright © 2017 Brian D Keane. All rights reserved.
//
import Foundation
import Kingfisher
class NowPlayingImageViewUpdater:NSObject
{
weak var imageView:NowPlayingImageView?
// dependency injections
... |
Markdown | UTF-8 | 1,329 | 2.78125 | 3 | [] | no_license | ---
title: "zsh 终端快捷键"
date: 2018-08-22T22:56:22+08:00
draft: false
slug: "zsh-terminal-shortcut"
---
* ⌃ + u:清空当前行
* ⌃ + a:移动到行首
* ⌃ + e:移动到行尾
* ⌃ + f:向前移动
* ⌃ + b:向后移动
* ⌃ + p:上一条命令
* ⌃ + n:下一条命令
* ⌃ + r:搜索历史命令
* ⌃ + y:召回最近用命令删除的文字
* ⌃ + h:删除光标之前的字符
* ⌃ + d:删除光标所指的字符
* ⌃ + w:删除光标之前的单词
* ⌃ + k:删除从光标到行尾的内容
* ⌃ + t:交换光... |
Java | UTF-8 | 2,091 | 1.976563 | 2 | [] | no_license | package com.qjxs.biz;
import com.google.common.collect.Lists;
import com.qjxs.common.jpapage.PageSpringHelp;
import com.qjxs.domain.QRole;
import com.qjxs.domain.Role;
import com.qjxs.domain.qry.RoleQry;
import com.qjxs.repository.RoleRepository;
import com.qjxs.service.RoleService;
import com.querydsl.core.B... |
Markdown | UTF-8 | 4,993 | 2.625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"GPL-2.0-only",
"Apache-2.0",
"MIT",
"GCC-exception-2.0",
"BSD-3-Clause",
"LGPL-2.0-or-later",
"Zlib",
"OpenSSL",
"curl",
"LGPL-2.1-only",
"BSD-2-Clause",
"LicenseRef-scancode-ssleay-windows",
"Unlicense"
] | permissive | # Cargo Benchmarking
This directory contains some benchmarks for cargo itself. This uses
[Criterion] for running benchmarks. It is recommended to read the Criterion
book to get familiar with how to use it. A basic usage would be:
```sh
cd benches/benchsuite
cargo bench
```
The tests involve downloading the index and... |
Java | UTF-8 | 506 | 2.53125 | 3 | [] | no_license | package com.egen.challenge.UserManagement;
import java.util.*;
public class UserService {
public List<User> getAllUsers() {
UserDAO dao = UserDAO.getInstance();
return dao.getAllUsers();
}
public User createUser(User user) {
UserDAO dao = UserDAO.getInstance();
User toRet = dao.createUser(user);
retur... |
Java | UTF-8 | 4,400 | 2.328125 | 2 | [] | no_license | package rs.ac.uns.ftn.informatika.osa.ElementBookRepository.server.controller;
import java.io.IOException;
import java.io.PrintWriter;
import javax.ejb.EJB;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServlet... |
Markdown | UTF-8 | 782 | 3.296875 | 3 | [
"MIT"
] | permissive | ### Lec 1.4 - Running Computations in Parallel
```scala
// 并行计算,但不便于通用化
val (sum1, sum2) = parallel(sumSegment(a, p, 0, m),
sumSegment(a, p, m, a.length))
// 递归调用实现通用化
def pNormRec(a: Array[Int], p: Double): Int =
power(segmentRec(a, p, 0, a.length), 1/p)
// 归并方式实现
def segmentRec(a: Ar... |
C# | UTF-8 | 2,829 | 2.546875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DataAccess.Model;
using DataAccess.Param;
using DataAccess.Context;
namespace Common.Interface.Master
{
public class LessonRepository : ILessonRepository
{
bool status = false;
... |
JavaScript | UTF-8 | 2,988 | 3.078125 | 3 | [] | no_license | import { contains, flatten, random, sortBy } from 'lodash'
import ChangeEmitter from './change-emitter'
import Point from './point'
import Dot from './dot'
const CLEAR_DOT_EVENT = 'CLEAR_DOT'
export default class Board extends ChangeEmitter {
constructor({ size, colors }) {
super()
this.size = size
this... |
PHP | UTF-8 | 373 | 3.015625 | 3 | [] | no_license | <?php
// call: 17 a
// write the address of the next instruction to the stack and jump to <a>
class Synacor_call implements SynacorOP {
function args() { return 1; }
function run($vm, $data) {
list($a) = $data;
$vm->decode($a);
$vm->push($vm->getLocation());
$vm->jump($a);
}
function code() { ... |
Java | UTF-8 | 9,035 | 3.515625 | 4 | [] | no_license | /* Matt Franchi | CPSC 2150 | Spring 2020
* Project 3 : ConnectX
* File Description: GameBoard interface code
*/
package cpsc2150.connectX;
/**
GameBoard represents a 2 dimensional board with size (number of rows) * (number of columns)
Indexing starts at 0
Initialization ensures:
GameBoard is initialized to a... |
PHP | UTF-8 | 5,703 | 2.5625 | 3 | [] | no_license | <?php
class Crm {
private $wsoap;
const W_WEBURL = 'http://119.255.54.188:8059?wsdl';
public function __construct() {
try {
libxml_disable_entity_loader ( false );
$this->wsoap = new SoapClient ( self::W_WEBURL );
} catch ( Exception $e ) {
printf ( "Message = %s/n", $e->__toString () );
}
}
//... |
JavaScript | UTF-8 | 1,637 | 3.15625 | 3 | [] | no_license |
// S'execute au chargement de la page
window.addEventListener('load', function () {
// Injecte les données de l'API furniture
load_furnitures();
});
const params = new URLSearchParams(window.location.search)
const id = params.get("id")
console.log(id)
// Rempli la div meubles avec les données de l'API furnit... |
Python | UTF-8 | 1,067 | 3.03125 | 3 | [] | no_license | # encoding = utf-8
# /usr/bin/python3
import time
global mat
# -*- coding:utf-8 -*-
class Solution:
def movingCount(self, k, r, c):
# write code here
self.cnt = 0
if r == 0 or c == 0: return 0
def p_sum(x, y):
res = 0
while x:
res += x%10
... |
Ruby | UTF-8 | 2,685 | 3.421875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | class MusicLibraryController
extend Concerns::Findable
include Concerns::Findable
attr_accessor :path
def initialize(path ='./db/mp3s')
@path = path
MusicImporter.new(path).import
end
def call
exit_flag = false
while !exit_flag
puts "Welcome to your music library!"
... |
Java | UTF-8 | 588 | 3.390625 | 3 | [] | no_license | package com.company;
import java.util.ArrayList;
/**
* Created by yanxia on 2/18/16.
*/
public class Chapter_2_Stacks {
}
/*A Stack has these functions:
* Push()
* Pop()
* Size()
*/
class StackDemo<E> {
ArrayList<E> arrayList = new ArrayList<E>();
void push(E e){
arrayList.add(e);
}
... |
Ruby | UTF-8 | 517 | 3.796875 | 4 | [] | no_license | # Given a sorted integer array without duplicates, return the summary of its
# ranges.
# For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"].
# @param {Integer[]} nums
# @return {String[]}
def summary_ranges(nums)
results = []
i = 0
j = 0
while i < nums.length do
if i + 1 < nums.length && nums[i... |
C | UTF-8 | 1,164 | 2.625 | 3 | [] | no_license | // LED control
typedef unsigned long color_t;
#define RGB(r, g, b) (r + (g << 8) + (b << 16))
// Predefined colors
#define COLOR_NONE RGB(0x00, 0x00, 0x00)
#define COLOR_RED RGB(0xff, 0x00, 0x00)
#define COLOR_GREEN RGB(0x00, 0xff, 0x00)
#define COLOR_BLUE RGB(0x00, 0x00, 0xff)
#define COLOR_ORANGE ... |
Java | UTF-8 | 1,111 | 3.375 | 3 | [] | no_license | /**
* MazeGameWithFactoryMethod
*/
public class MazeGameWithFactoryMethod extends MazeGame {
@Override
public Maze createMaze() {
Maze maze = makeMaze();
Room r1 = makeRoom(1);
Room r2 = makeRoom(2);
Door d = makeDoor(r1, r2);
maze.addRoom(r1);
maze.addRoom(r2);
r1.setSide(Direction... |
Markdown | UTF-8 | 1,071 | 2.984375 | 3 | [] | no_license | ---
title: Excelのマクロで範囲を参照する
date: 2016-10-03T21:00:04+09:00
tags:
- Excel
- Microsoft Office
- VBA
- Windows
---
Excelのマクロで範囲を参照する際の指定をいつも調べてしまうので書いておきます。
<!--more-->
## 動的に参照する
動的に参照する場合はこちらですね。
数字やアルファベットの行や列の値を変数にして使います。
* 1つのセルを参照する
* `Cells(行, 列)`
* `Cells(1, 1)`
* `Cells(1, "A")`
* 範囲を参照する
*... |
Java | UTF-8 | 1,503 | 2.1875 | 2 | [] | no_license | package com.emdata.messagewarningscore.data.http.config;/**
* Created by zhangshaohu on 2021/1/19.
*/
import com.emdata.messagewarningscore.data.radar.service.RadarService;
import com.emdata.messagewarningscore.data.http.porxy.HttpPorxy;
import com.emdata.messagewarningscore.data.http.porxy.RestTemplateProxy... |
Python | UTF-8 | 1,908 | 2.546875 | 3 | [] | no_license | #! /usr/bin/env python
import sys
import re
arguments = sys.argv
#print (arguments)
InFileName = sys.argv [1]
InFile = open ( InFileName, 'r' )
print 'Results of blast search: ' + InFileName
#InFileName = 'resultstest.fa'
#InFile = open ( InFileName, 'r' )
InFileName3 = sys.argv [2]
InFile3 = open ( InFileName3, 'r'... |
C++ | UTF-8 | 2,517 | 2.59375 | 3 | [] | no_license | #ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "memorypartition.h"
#include "memorywindow.h"
#include <QMainWindow>
#include <QMessageBox>
#include <QStandardItemModel>
#include <vector>
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE
class MainWindow : public QMainWindow {... |
Ruby | UTF-8 | 2,893 | 3.109375 | 3 | [] | no_license | require_relative 'component'
module Physic
class BaseCollider < Component
attr_accessor :scale
attr_reader :vertices
def intialize(scale)
super()
@scale = scale
@vertices = []
end
def set_vertices
raise "Not Implemented"
end
def space_vertices
return... |
C++ | UTF-8 | 5,734 | 3.046875 | 3 | [] | no_license | #include <cassert>
#include <stdexcept>
#include <iostream>
#include <unistd.h>
#include <string>
#include "xmlrpc-c/base.hpp"
#include "xmlrpc-c/registry.hpp"
#include "xmlrpc-c/server_abyss.hpp"
#include "xmlrpc-c/client_simple.hpp"
using namespace std;
string const catalogUrl = "http://localhost:8082/RPC2";
strin... |
JavaScript | UTF-8 | 1,845 | 2.75 | 3 | [] | no_license | var isIE = document.all?true:false;
if (!isIE) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = update;
//the event listener
//this could better be a listener on the div element
//but i wanted to allways show the mouse coordinates in the debug div
//Event.observe(document, 'mousemove', getcordsInDiv);
... |
Markdown | UTF-8 | 1,502 | 3.015625 | 3 | [] | no_license | # carapp
Car application
This project is a simple example of MVVM pattern using ViewModel, Livedata, Retrofit, RxJava.
The example uses Free API for fetching data.
This example contains different screens like -Login, Registration, Main Page that contains user location and car locations, Profile page for fetching pr... |
Java | UTF-8 | 834 | 2.296875 | 2 | [
"MIT"
] | permissive | package com.youai.sdk.android;
public class YouaiError {
private static final long serialVersionUID = 1L;
private int mErrorCode;
/**
* @param mErrorCode the mErrorCode to set
*/
public void setmErrorCode(int mErrorCode) {
this.mErrorCode = mErrorCode;
}
/**
* @param mErrorMessage the mErrorMessage to... |
Python | UTF-8 | 293 | 3.234375 | 3 | [] | no_license | from key_indexed_counting import KeyIndexedCounting
if __name__ == "__main__":
letters = ['d', 'a', 'c', 'f', 'f', 'b', 'd', 'b', 'f', 'b', 'd', 'e', 'a']
print "ORIGINAL: ",
print letters
indexer = KeyIndexedCounting()
print " SORTED: ",
print indexer.sort(letters) |
Python | UTF-8 | 502 | 3.609375 | 4 | [] | no_license | from pylab import *
def sum(a,b):
return a+b
#returning 2 values
def some():
return 2,3
#default par (first parameter cant be a default par)
def wc(greet,name="world"):
print(greet,name)
#function calling
wc("hi",name="rik")
hi rik
wc(name="rik",greet="gm")
gm rik
w... |
TypeScript | UTF-8 | 5,915 | 2.515625 | 3 | [
"Unlicense"
] | permissive | import { Injectable, Injector } from '@angular/core';
import { AppBasePage } from 'src/shared/app-base-page';
import {
HttpInterceptor,
HttpRequest,
HttpHandler,
HttpEvent,
HttpErrorResponse
} from '@angular/common/http';
import {
catchError,
retry,
mergeMap,
retryWhen,
tap,
... |
C | UTF-8 | 600 | 3.625 | 4 | [] | no_license | #include<stdio.h>
#include<math.h>
void main(){
float a,b,c,f,r1,r2;
printf("Enter the values of a,b and c:");
scanf("%f %f %f",&a,&b,&c);
f=b*b-4*a*c;
if(f==0){
printf("Roots are Equal.\n");
r1=-b/(2*a);
printf("Roots are:%f %f",r1,r1);
}
else if(f>0){
printf... |
Java | UTF-8 | 1,936 | 2.53125 | 3 | [] | no_license | package com.example.lixiang.lab3;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import java.util.List;
public class CartAdapter extends BaseAdapter {
private Context c... |
C++ | UTF-8 | 2,442 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | #include "SkShaper.h"
#include "FontRunIterator.hh"
#include "src/utils/SkUTF.h"
#include "unicode/uchar.h"
// Adapted from SkShaper.cpp
/** Replaces invalid utf-8 sequences with REPLACEMENT CHARACTER U+FFFD. */
static inline SkUnichar utf8_next(const char** ptr, const char* end) {
SkUnichar val = SkUTF::NextUTF8... |
Java | UTF-8 | 2,245 | 3.34375 | 3 | [] | no_license | package StudentClassList;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Random;
import java.util.Scanner;
public class ClassList {
private String fileName;
private int numberOfStudents;
p... |
Python | UTF-8 | 195 | 3.6875 | 4 | [] | no_license | # 2 kasus
n = int(input ())
if (n>0):
print("Positif")
else:
print("Negatif")
# 3 kasus
n = int(input())
if(n>0):
print("Positif")
elif(n<0):
print("Negatif")
else:
print("Nol")
|
C | GB18030 | 899 | 3.921875 | 4 | [] | no_license | /*2.ĵƽ㣺ȵõĵȻ
ƽֵȡĵʹ#defineָһꡰִ
и㡣дһijԸúꡣ*/
#include <stdio.h>
#include <stdlib.h>
#define HARMONIC_AVERAGE1(X,Y) 1/( (1/(X)+1/(Y))/2 )
#define HARMONIC_AVERAGE2(X,Y) (2*(X)*(Y))/((X)+(Y))
int main()
{
double x,y;
puts("(ĸ뿪)");
while( scanf("%lf%lf",&x,&y) ==2)
{
while(getchar() != '\n') co... |
C | UTF-8 | 5,875 | 2.671875 | 3 | [] | no_license | #include "fvm.h"
#include "kse.h"
state *create_state(int bx, int by)
{
int i;
state *st = (state*) malloc(sizeof(state));
st->bx = bx;
st->by = by;
st->rho = (double**) malloc(sizeof(double*) * (bx + 2));
st->rhoU = (double**) malloc(sizeof(double*) * (bx + 2));
st->rhoV = (double**) malloc(sizeof(double*... |
Java | UTF-8 | 5,033 | 2.390625 | 2 | [] | no_license | package cz.muni.fi.pb138.backend;
import cz.muni.fi.pb138.exceptions.DocumentNotSavedException;
import cz.muni.fi.pb138.exceptions.DocumentNotValidException;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBu... |
Python | UTF-8 | 522 | 3.140625 | 3 | [] | no_license | import pandas as pd
import numpy as np
import seaborn as sns
iris_data = pd.read_csv('assets/iris.csv')
iris_data.columns = ['sepal_length', 'sepal_width' , 'petal_length', 'petal_width', 'species']
#you can specific the number to show here
iris_data.head(10)
iris_data.shape
iris_data['species'].unique()
print(i... |
Java | UTF-8 | 818 | 3.4375 | 3 | [] | no_license | import java.util.ArrayList;
import java.util.List;
public class MainApplication {
private static List<Product> productList = new ArrayList<>();
public static void main(String[] args) {
Product apple = new Product(1.50, "red", "small", "apple");
Product banana = new Product(0.50, "yellow", "sm... |
C | UTF-8 | 1,964 | 3.015625 | 3 | [] | no_license | #include "functions.h"
int main(int argc, char **argv) {
char key = '1';
char session_status = NOT_SIGNED_IN;
char username[LOGIN_INFO_LEN];
account root = load_file();
while (key > '0' && key < '9') {
print_menu();
scanf("%c", &key);
clear_buffer();
switch (key) {
case '1':
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.