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 | 917 | 2.515625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace DayData.admin.core.controls
{
/// <summary>
/// Summary description for File
/// </summary>
public class File : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
... |
Java | UTF-8 | 2,248 | 2.0625 | 2 | [] | no_license | package com.huamengtong.wms.main.mapper.service.impl;
import com.huamengtong.wms.dto.TWmsCargoOwnerDTO;
import com.huamengtong.wms.main.mapper.common.SpringTxTestCase;
import com.huamengtong.wms.main.service.ICargoOwnerService;
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
import org.s... |
PHP | UTF-8 | 467 | 2.90625 | 3 | [] | no_license | <?php
namespace Src\request\formvalidation\formRule;
use FormRule;
class RuleRequired extends FormRule{
private $data = '';
function __construct($data){
parent::__construct($data);
$this->data = $data;
}
public function run($perameter = ''){
$value = preg_replace('/^[\pZ\pC]+|[\pZ\pC]+$/u', '', $this->... |
Markdown | UTF-8 | 3,288 | 2.796875 | 3 | [
"MIT"
] | permissive | ---
title: "Ubuntu 13.04 Bandwidth Shaping and Traffic Control using HTB"
tagline: "keepin' things fair"
category: linux
tags: [linux, ubuntu, qos]
---
Problem
-------
I don't want to allow a client on my network to consume all the available upload network bandwidth when doing something like online backups. Instead ... |
Python | UTF-8 | 1,501 | 3.03125 | 3 | [] | no_license | import numpy as np
import warnings
from collections import Counter
import pandas as pd
import random
def KNearestNeighbors(data,predict,k = 3):
if len(data) >= k:
warnings.warn('Hey you have choosen k value less then the length of the data dumbass')
distances = []
for group in data:
for features in data[group]:... |
Java | UTF-8 | 3,624 | 2.109375 | 2 | [] | no_license | package com.tqmall.legend.facade.discount.configuration.handler.init;
import com.tqmall.common.exception.BizException;
import com.tqmall.legend.biz.account.AccountInfoService;
import com.tqmall.legend.biz.customer.CustomerService;
import com.tqmall.legend.entity.account.AccountInfo;
import com.tqmall.legend.entity.cus... |
Java | UTF-8 | 1,691 | 2.421875 | 2 | [] | no_license | package com.courses.service.impl;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.courses.dao.CoursesDao;
import com.courses.mod... |
Java | UTF-8 | 12,968 | 2.578125 | 3 | [] | no_license |
package com.limegroup.gnutella.metadata;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.io.UnsupportedEncodingException;
import java.util.Iterator;
import java.util.Vector;
import com.limegroup.gnutella.ByteOrder;
import de.vdheide.mp3.ID3v2;
import de.vdheide.mp3.ID3v2... |
Shell | UTF-8 | 1,562 | 4.28125 | 4 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | #! /bin/bash
function split()
{
if [ -n "$4" ]; then
if [[ $4 == *","* ]]; then
inner_counter=1
for i in ${4//,/ }
do
pdftk "$1" cat "$i" output "$2"/$(printf "%02d" $counter)_"$3$inner_counter.pdf"
((inner_counter+=1))
((counter+=1))
done
else
pdftk "$1" cat "$4" output "$2"/$(printf ... |
PHP | UTF-8 | 2,615 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Http\Requests\ResetPasswordRequest;
use App\User;
use Exception;
use Illuminate\Auth\Events\PasswordReset;
use Illuminate\Contracts\Auth\PasswordBroker;
use Illuminate\Contracts\Auth\StatefulGuard;
use Illuminate\Http\JsonResponse... |
Shell | UTF-8 | 1,468 | 3.171875 | 3 | [] | no_license | #!/bin/bash
OHDirectory="/cygdrive/e/temp/ONCOhabitats_GBM_analysis_modified_pipeline"
OHANTsDirectory="/cygdrive/f/OneDrive/work/OUS/distortion_correction/ONCOhabitats_scripts/ANTs"
inputFilePath="native/Segmentation.nii.gz"
referencePath="native/Flair.nii.gz"
transformations="transforms/transform_Flair_to_T1c_0Gener... |
Java | UTF-8 | 394 | 1.6875 | 2 | [] | no_license | package com.zimokaka.uc.uac.role.repository;
import com.zimokaka.uc.uac.role.po.UcRole;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
* Created by Nicky on 2017/7/30.
*/
public interface UcRolePageRepository extends PagingAndSortingRepository<UcRole, Integer> {
// @Query("from Role ... |
Markdown | UTF-8 | 734 | 2.53125 | 3 | [] | no_license | ---
title: 'Ce que disent les grands'
date: '2016-09-05'
lang: fr
type: post
categories:
- papa
---
Ce soir, le grand a débarassé la table à la demande de sa mère, en ne se trompant pas. Il a d'abord empilé les couverts, puis les assiettes en mettant l'assiette remplie de couverts sur le dessus, comme cela se fait... |
Java | UTF-8 | 487 | 2.046875 | 2 | [] | no_license | package com.in28minutes.springboot.rest.example.gamestore.repository;
import java.util.List;
import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.in28minutes.springboot.rest.example.gamestore.entity.Bank;
@Repository
pu... |
Python | UTF-8 | 725 | 3.359375 | 3 | [] | no_license | # Uses python3
def edit_distance(word1, word2):
word1 = '-' + word1
word2 = '-' + word2
n1 = len(word1)
n2 = len(word2)
d = [[0 for _ in range(n2)] for _ in range(n1)]
for i in range(n1):
d[i][0] = i
for i in range(n2):
d[0][i] = i
for x in range(1, n1):
for... |
Markdown | UTF-8 | 4,440 | 2.796875 | 3 | [
"MIT"
] | permissive | # Command-line executables
| file suffix | details | notes |
|--------------------|-------------------------------------------------------------------------------------------|----------------|
| [linux-amd64].elf | ELF 64-bit LSB executable: x86-64: version 1 (SYSV): statically linked: not stripped |
| [linux-386].el... |
Python | UTF-8 | 403 | 2.5625 | 3 | [
"MIT"
] | permissive |
#calss header
class _DOCK():
def __init__(self,):
self.name = "DOCK"
self.definitions = [u'to remove part of something: ', u'If a ship docks, it arrives at a dock and if someone docks a ship, they bring it into a dock: ']
self.parents = []
self.childen = []
self.properties = []
self.jsondata = {}
s... |
Markdown | UTF-8 | 5,474 | 3.21875 | 3 | [
"MIT"
] | permissive | ---
title: "Key to Unlocking Creativity: Sleep"
date: "2018-05-07"
tags: ["Cognitive science", "Sleep", "Psychology"]
---
#### What you should know about sleep to boost your creativity
A couple of weeks ago Luova Aalto organized an event about the interplay of sleep and creativity, lead by the wonderful Anu-Katriina ... |
C++ | UTF-8 | 6,491 | 3.21875 | 3 | [
"LicenseRef-scancode-nysl-0.9982",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | #pragma once
//---------------------------------------------------------------------------//
//
// optional.hpp
// 「値を持たないかもしれない」状態を表現するオブジェクト (in C++14)
// Copyright (C) 2015-2016 tapetums
// 2015.11.03 created by tapetums
//
//---------------------------------------------------------------------------//
#incl... |
Python | UTF-8 | 16,812 | 2.828125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Copyright (c) 2015 Code for Karlsruhe (http://codefor.de/karlsruhe)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restrict... |
Java | UTF-8 | 68 | 2.0625 | 2 | [] | no_license | package util;
public interface ISorter {
int[] sort(int[] arr);
}
|
Go | UTF-8 | 867 | 3.046875 | 3 | [
"MIT"
] | permissive | package db
import (
"reflect"
"testing"
)
func TestNewManagerFromEngine(t *testing.T) {
type args struct {
name string
connStr string
}
tests := []struct {
name string
args args
want DatabaseManager
wantErr bool
}{
{"PostgresEngine", args{"postgres", "pg://postgres@localhost/apricot?ss... |
Java | UTF-8 | 3,239 | 2.4375 | 2 | [] | no_license | package com.capgemini.springmvc.controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.... |
SQL | UTF-8 | 582 | 2.96875 | 3 | [] | no_license | create database apiDesafio;
create table usuarios(
id int auto_increment primary key,
nome varchar(50),
email varchar(150) unique,
senha varchar(50),
nascimento date,
telefone varchar(20),
cpf varchar(14),
genero char(1)
);
create table dadosProfissional(
id int auto_increment primary key,
... |
Java | UTF-8 | 211 | 1.585938 | 2 | [] | no_license | package se.web.store.dao;
import org.springframework.data.jpa.repository.JpaRepository;
import se.web.store.entity.Product;
public interface ProductDAO extends JpaRepository<Product, Integer> {
//CRUD
}
|
Java | UTF-8 | 694 | 3.296875 | 3 | [] | no_license |
package chainairport;
/**
*
* @author Jack
*/
/**
* This interface will create the methods that will be used in the chain design
* pattern. The chainNumber method will be used when an object is passed into the chain
* and it will determine which class will handle the object message. The setNextElement
* meth... |
JavaScript | UTF-8 | 159 | 3.59375 | 4 | [] | no_license |
const fn = () => {
let sum = 0;
for (let i = 1; i <= 155; i++ ) {
sum = (i * (i+2)) * (i+3)
}
return sum;
}
console.log(fn()); |
Java | UTF-8 | 344 | 2.546875 | 3 | [] | no_license | class Solution {
public int countNegatives(int[][] grid) {
int total = grid.length * grid[0].length;
for (int i = 0; i < grid.length; i++) {
for (int j = 0; j < grid[0].length; j++) {
if (grid[i][j] >= 0) total--;
else break;
}
}
... |
SQL | UTF-8 | 17,018 | 2.921875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 21, 2021 at 06:31 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
Java | UTF-8 | 1,917 | 2.828125 | 3 | [
"MIT"
] | permissive | package graphics.bar;
import biuoop.DrawSurface;
import geometry.invisible.Point;
import geometry.visible.DrawableRectangle;
import handlers.gameTrackers.Counter;
import handlers.graphic.Sprite;
import settings.GameStandarts;
import java.awt.Color;
/**
* Bar.
*/
public class Bar implements Sprite {
private Dra... |
C++ | UTF-8 | 724 | 2.640625 | 3 | [] | no_license | ///
///
///
#ifndef ___STRING_TABLE_SET_H_
#define ___STRING_TABLE_SET_H_
#include <string>
#include <map>
namespace stable
{
class string_table;
class string_table_set
{
public:
typedef unsigned long id_type;
struct config
{
string_table *st;
typedef std::map<id_type, std::string> ... |
Java | UTF-8 | 2,126 | 2.96875 | 3 | [] | 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 metodaszablonowa;
/**
*
* @author lenovo
*/
public class Kremówka extends Przepis{
@Override
protect... |
Markdown | UTF-8 | 16,701 | 3.828125 | 4 | [
"Apache-2.0",
"MIT"
] | permissive | # Quickstart tutorial
If you are familiar with Python Numpy, do check out this [For Numpy User Doc](https://docs.rs/ndarray/0.13.0/ndarray/doc/ndarray_for_numpy_users/index.html)
after you go through this tutorial.
You can use [play.integer32.com](https://play.integer32.com/) to immediately try out the examples.
##... |
C | UTF-8 | 10,018 | 2.65625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <time.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include "reduce.h"
enum CLICOMMAND
{
MAP, REDUCE, EXIT, MARK, WRITE, WAIT, OTHER
};
void splitFile(char* inpu... |
Python | UTF-8 | 4,846 | 2.65625 | 3 | [] | no_license | import assembler
import ksb_compiler
class Compiler:
def __init__(self, canvas, input, input_ksb):
self.input = input
self.input_ksb = input_ksb
self.canvas = canvas
self.commands = ["<ue1>", "<ue2>","<a>", "<titel>", "<ul>", "<gl>", "<tabelle>"]
def scan(self):
#sepe... |
Python | UTF-8 | 1,111 | 4.125 | 4 | [] | no_license | #when a variable is declared above a function , it become global variable. these variable are available to all the function which are written after it. the scope of global variable is the entire program body written below it.
a=50
def show():
x=10
print(x)
print(a)
show()
print("global variable:",a)
... |
C# | UTF-8 | 1,137 | 2.671875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using Meow.Core.Entity;
using MeowWorld.Core.DomainService;
using Microsoft.EntityFrameworkCore;
namespace MeowWorld.Infrastructure.data.Repositories
{
public class TodoItemRepo :IRepository<TodoItem>
{
private readonly MEOWcontext db;... |
C++ | UTF-8 | 2,644 | 3.25 | 3 | [] | no_license | #include <SDL/SDL.h>
#include "boat.hpp"
using namespace std;
bool Boat::check_collision(pair<int,int> singleWall)
{
//The sides of the rectangles
int leftA, leftB,rightA, rightB,topA, topB,bottomA, bottomB;
//Calculate the sides of rect A
printf("box(%d,%d)\n", box.x,box.y);
leftA = box.x;
rightA = box.x... |
Java | UTF-8 | 601 | 1.960938 | 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 ejb.sessions;
import ejb.entities.SoTinTon;
import java.util.List;
import javax.ejb.Local;
/**
*
* @author Winson Mac
*/
@... |
Java | UTF-8 | 457 | 2.328125 | 2 | [] | no_license | package com.tir38.android.blastermind.core;
import java.util.List;
import lombok.Data;
import lombok.experimental.Accessors;
@Data
@Accessors(prefix = "m")
public class Guess {
private final List<Logic.TYPE> mTypes;
public Guess(List<Logic.TYPE> types) {
if (types.size() != Logic.guessWidth) {
... |
Java | UTF-8 | 4,374 | 1.859375 | 2 | [
"Apache-2.0"
] | permissive | package com.zeroq6.blog.operate.web.controller;
import com.zeroq6.blog.common.base.BaseController;
import com.zeroq6.blog.common.base.BaseResponse;
import com.zeroq6.blog.common.domain.CommentDomain;
import com.zeroq6.blog.common.domain.PostDomain;
import com.zeroq6.blog.common.domain.enums.field.EmPostPostType;
impor... |
Java | UTF-8 | 1,070 | 3.8125 | 4 | [] | no_license | package q6;
import java.util.InputMismatchException;
import java.util.Scanner;
class InputException extends RuntimeException{
public InputException(int max) {
super("Number can't be greater than " + max);
}
}
public class CustomInputException {
public static void main(String[] args) {
try (Scanner... |
Java | UTF-8 | 2,541 | 2.96875 | 3 | [] | no_license | package cecs327.events;
import cecs327.CustomFile;
import cecs327.utils.DataReader;
import cecs327.utils.DataWriter;
import java.io.File;
import java.io.IOException;
public class RemoveFileEvent implements Event{
private int type;
private String filePath;
private String removedFileName;
public byte[... |
SQL | UTF-8 | 4,524 | 2.625 | 3 | [] | no_license | insert into temperatures (geom, start_date, end_date, temperature)
with dates as (
select min(i) as start_date, max(i) as end_date
from generate_series('2018-01-01'::timestamp, '2018-02-01'::timestamp, '1 day'::interval) as i
where i < '2018-02-01'::timestamp
)
select geom, start_date, end_date, elev from d... |
SQL | UTF-8 | 716 | 3.59375 | 4 | [] | no_license | -- users table
CREATE TABLE users (
users_id SERIAL PRIMARY KEY,
name character varying(100),
bio character varying(500),
auth_id text,
home_town character varying(100),
img text,
email character varying(200)
);
-- events table
CREATE TABLE events (
events_id SERIAL PRIMARY KEY,
t... |
Java | UTF-8 | 5,148 | 2.71875 | 3 | [] | no_license | package DroneAutopilot.GUI;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JComboBox;
import javax.swing.JFrame;
impo... |
Markdown | UTF-8 | 8,891 | 2.71875 | 3 | [
"MIT"
] | permissive | ---
title: IoT enabled Jack-O-Lantern Flamethrower
permalink: halloween-fire-pumpkin/
date: 2018-11-03
author: Markus
description: A flame-throwing Jack-O-Lantern is a real Halloween highlight and definitely something to impress the trick-or-treaters and your neighbors. An internet controlled IoT flame throwing Jack-O-... |
Java | UTF-8 | 51,467 | 1.710938 | 2 | [] | no_license | package com.rc.buyermarket.activity;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.EditText;
import android.w... |
Python | UTF-8 | 3,157 | 2.953125 | 3 | [] | no_license | #!/usr/bin/env python
#Setup import files from the manifest file
PKG = "see_n_tell"
import roslib; roslib.load_manifest(PKG)
import rospy
#Import support libraries for buffer formatting and other generic functions
import basic_header
import numpy as np
import cv2
#Import the necessary message formats needed
from see... |
Go | UTF-8 | 2,644 | 2.5625 | 3 | [] | no_license | package postgres
import (
"context"
"encoding/json"
"github.com/cep21/circuit/v3"
"github.com/jmoiron/sqlx"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
app "github.com/rislah/fakes/internal"
"github.com/rislah/fakes/internal/errors"
"github.com/r... |
Markdown | UTF-8 | 1,888 | 3.109375 | 3 | [] | no_license | ### Задача 21-1 — Монетка в git
Создайте git–репозиторий с программой-монеткой `coin.rb.`
### Задача 21-2 — Коммит и отмена
Практикуемся с git.
В вашем репозитории `coin` поправьте программу так, чтобы монетка вставала на ребро немного чаще: 1 раз в 5 бросков.
Сделайте коммит с этим изменением, а потом отмените... |
Markdown | UTF-8 | 8,297 | 2.6875 | 3 | [] | no_license | ---
author: nwatson
data:
categories:
- content: Cfengine
domain: category
nicename: cfengine
- content: EFL
domain: category
nicename: efl
post_type: post
wp_menu_order: 0
wp_post_id: 723
wp_post_name: bulding-cfengine-classes-using-efl
wp_post_parent: 0
wp_post_path: http... |
PHP | UTF-8 | 1,968 | 2.53125 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Blog;
use App\Category;
class BlogController extends Controller
{
public function __construct()
{
$this->middleware('auth');
}
public function Index(){
$blogs = Blog::orderBy('created_at', 'desc')->paginate... |
Ruby | UTF-8 | 2,864 | 3.265625 | 3 | [] | no_license | # encoding: utf-8
#
# Подключим встроенный в руби класс Date для работы с датами
require 'date'
# Класс «Задача», разновидность базового класса «Запись»
class Task < Post
# Конструктор у класса «Задача» свой, но использует конструктор родителя.
def initialize
# Вызываем конструктор родителя
super
# Со... |
Python | UTF-8 | 1,996 | 2.609375 | 3 | [] | no_license | import numpy as np
import glob
import cv2
import os
import json
import sys
class Annotator():
def __init__(self,folder,user_input,pics):
self.folder = folder #'./windows/'
self.user_input = user_input #{'d': 'discard', 'g': 'good'}
self.files = glob.glob(self.folder + '/*.jpg')
self... |
Python | UTF-8 | 2,012 | 2.59375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including witho... |
Java | UTF-8 | 1,631 | 3.375 | 3 | [] | no_license | package com.practice.google;
import java.util.*;
/*
https://leetcode.com/problems/3sum/
Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
Note:
The solution set must not contain duplicate triplets.
Examp... |
JavaScript | UTF-8 | 2,098 | 2.6875 | 3 | [] | no_license | //Should be run locally for system related features
var http = require("http");
var fs = require("fs");
var path = require("path");
var glob = require("glob");
var async = require("async");
var open = require('open');
var express = require('express');
var bodyParser = require('body-parser');
var stepsPattern = "w:/w... |
JavaScript | UTF-8 | 6,729 | 2.75 | 3 | [] | no_license | /**
* Created by thanatv on 11/3/17.
*/
const Utils = require('./utils')
class Antenna {
constructor (antennaObject) {
for (var field in antennaObject) {
this[field] = antennaObject[field]
}
}
// Calculate antenna gain from normal formula from given diameter (m) and frequenc... |
Java | UTF-8 | 565 | 2.671875 | 3 | [] | no_license | package com.globbypotato.rockhounding_surface.enums;
public enum EnumBogLogs implements BaseEnum {
OAK,
SPRUCE,
KAURI,
MOPHANE;
//---------CUSTOM----------------
public static int size(){
return values().length;
}
public static String name(int index) {
return values()[index].getName();
}
//---------E... |
Python | UTF-8 | 10,582 | 2.671875 | 3 | [] | no_license | import os
import ast
import time
import datetime
from time import gmtime, strftime
import twitter
import csv
import pandas as pd
def fetched_tweets_by_hashtags(_search_string, _count, _loc, _loc_range):
try:
_gecode = "%f,%f,%dkm" % (_loc[0], _loc[1], _loc_range)
tweets_fetched = api.GetSearch(_se... |
Java | UTF-8 | 3,409 | 3.3125 | 3 | [] | no_license | import java.awt.Graphics;
import java.awt.event.KeyListener;
import java.awt.event.KeyEvent;
import java.io.IOException;
import java.awt.event.MouseListener;
import java.awt.event.MouseEvent;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.Timer;
import javax.swing.SwingUtil... |
Java | UTF-8 | 402 | 1.859375 | 2 | [] | no_license | package com.oversea.task.mapper;
import com.oversea.task.domain.OrderCreditCard;
/**
* @author: yangyan
@Package: com.oversea.task.mapper
@Description:
* @time 2016年8月15日 下午6:16:38
*/
public interface OrderCreditCardDAO {
public OrderCreditCard getOrderCreditCardById(long creditId);
publ... |
Python | UTF-8 | 2,433 | 3.59375 | 4 | [] | no_license | import json
import nltk
from nltk.corpus import stopwords
import emoji
# A class that stores a word, and its frequency within the set of tweets
class word:
def __init__(self, word):
self.word = word
self.count = 1
# Get the index of a word within a list of words
def getItem(list, word):
... |
PHP | UTF-8 | 673 | 3.015625 | 3 | [] | no_license | <?php
namespace Tdd\Cache;
class MemcacheCacheStorage implements ICacheStorage
{
/** @var \Memcache */
private $memcache;
/**
* @param \Memcache $memcache
*/
public function __construct(\Memcache $memcache)
{
$this->memcache = $memcache;
}
/**
* @param string $key
* @param mixed $value
* @param ... |
Python | UTF-8 | 182 | 4.09375 | 4 | [] | no_license | def somatorio(x):
if x==1:
return 1
else:
return x + somatorio(x-1)
while True:
x = int(input("Somatorio de 1 até: "))
print("Soma: ",somatorio(x) ) |
C# | UTF-8 | 526 | 2.984375 | 3 | [] | no_license | using System;
public class Client : Personne
{
private string photo;
//Constructeur d'un client en appelant le constructeur de le classe mere
public Client(string nom, string prenom, DateTime dateNaissance, string adresse, string telephone, string adresseMail, string photo) : base(nom, prenom, dateNaiss... |
Java | UTF-8 | 475 | 2.078125 | 2 | [] | no_license | package internet_store.core.domain;
import lombok.Data;
import javax.persistence.*;
@Entity
@Data
@Table(name = "client", schema = "store")
public class Client {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "name")
private String name;
@Column(name =... |
TypeScript | UTF-8 | 869 | 2.703125 | 3 | [
"BSD-3-Clause"
] | permissive | import { Router } from './router';
import lightTheme from '!!raw-loader!@jupyterlab/theme-light-extension/style/index.css';
const LIGHT_THEME = lightTheme as string;
/**
* A class to handle requests to /api/themes
*/
export class Themes {
/**
* Construct a new Themes.
*/
constructor() {
this._router.... |
TypeScript | UTF-8 | 1,806 | 2.625 | 3 | [] | no_license | import {ModelCtor, Sequelize} from "sequelize";
import userCreator,{UserInstance} from "./user";
import taskCreator,{TaskInstance} from "./task";
export interface SequelizeManagerProps {
sequelize: Sequelize;
User: ModelCtor<UserInstance>;
Task: ModelCtor<TaskInstance>;
}
export class SequelizeManager im... |
JavaScript | UTF-8 | 2,078 | 2.625 | 3 | [] | no_license | import * as actions from '../actions/ActionNames';
const initialState = {
settings: {
income: [],
expense: []
}
}
export default function settings(state = initialState, action) {
switch (action.type) {
case actions.CATEGORY_ITEMS:
return {...state, settings: action.payl... |
JavaScript | UTF-8 | 830 | 3.28125 | 3 | [] | no_license | /**
* @param {string} s
* @return {number}
*/
var minOperations = function(s) {
let zeroOne = "";
let oneZero = "";
for (let i = 0; i < s.length; i++) {
if (i % 2 === 0) {
zeroOne += '0';
oneZero += '1';
} else {
zeroOne += '1';
... |
Shell | UTF-8 | 624 | 3.34375 | 3 | [] | no_license | #! /bin/sh
domain=$1
if [[ $domain != *"ip4"* && $domain != *"ip6"* ]]
then
spf="$(nslookup -type=txt $domain | grep v=spf)"
OIFS=$IFS
IFS=' ' read -r -a array <<< "$spf"
for x in "${!array[@]}"
do
if [[ ${array[x]} == *"redirect"* ]]
then
looper="$(echo "${array[x]}" | cut -c10-)"
echo "${looper::-1}"
... |
PHP | UTF-8 | 4,305 | 2.515625 | 3 | [] | no_license | <?php
App::import('Controller', 'Jqgrid');
/**
* 帐号管理
* @author jiangjun
* @version 1.0
*/
class AccountsController extends JqgridController {
public function beforeFilter() {
parent::beforeFilter();
parent::requireManager();
}
/**
* 院系主表
*/
public function department... |
Markdown | UTF-8 | 3,965 | 3.59375 | 4 | [] | no_license | ---
title: this和super关键字
date: 2018-09-24 18:41:35
tags:
- ES6
- JavaScript
categories: ES6
cover_img: https://tva1.sinaimg.cn/large/006y8mN6ly1g77houkndbj30u0190qv6.jpg
feature_img: https://tva1.sinaimg.cn/large/006y8mN6ly1g77hp1ssv2j30u01907wp.jpg
---
# this 关键字
this 的指向:
## 作为普通对象的方法调用
作为普通对象的方法调用时,this 指向这个... |
Java | UTF-8 | 2,167 | 3.6875 | 4 | [] | no_license | package minggu8;
import java.util.Scanner;
public class QueueMain {
static void menu(){
System.out.println("Pilih operasi yang ingin dilakukan: ");
System.out.println("1. Enqueue");
System.out.println("2. Dequeue");
System.out.println("3. Print");
System.out.println("4... |
PHP | UTF-8 | 734 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
namespace DTL\Freelancer\Model\Helper;
class ClientHelper
{
const CLIENTS_DIR = 'clients';
private $baseDir;
public function __construct($baseDir)
{
$this->baseDir = $baseDir;
}
public function getClientPath($code)
{
if (strlen($code) !== 6) {
throw new... |
Python | UTF-8 | 360 | 3.59375 | 4 | [] | no_license | #-----------------------------------
# try except 语句
# 添加大量的if else语句会降低代码可读性
#
#-----------------------------------
a = 12
b = 23
c = a + b
try :
d = '123'
d / 3
except ZeroDivisionError :
print('不能除以0')
except TypeError :
print('类型不正确')
finally:
del c
print('清理一些变量') |
TypeScript | UTF-8 | 1,799 | 2.859375 | 3 | [] | no_license | import { Injectable } from '@angular/core';
import {
HttpRequest,
HttpHandler,
HttpEvent,
HttpInterceptor,
HttpResponse
} from '@angular/common/http';
import { Observable } from 'rxjs';
import { map, tap } from 'rxjs/operators';
@Injectable()
export class CacheInterceptor implements HttpInterceptor {
cons... |
Python | UTF-8 | 1,102 | 3 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-proprietary-license"
] | permissive | # -*- coding: utf-8 -*-
from SciDataTool.Functions import NormError
def convert(self, values, axes_list, unit, is_norm):
"""Returns the values of the field transformed or converted.
Parameters
----------
self: Data
a Data object
values: ndarray
array of the field
axes_list: list... |
Java | UTF-8 | 2,110 | 2.140625 | 2 | [] | no_license | package uz.bat.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import uz.bat.model.entity.Address;
import uz.bat.model.entity.Person;
impo... |
Java | UTF-8 | 1,681 | 2.4375 | 2 | [] | no_license | package com.xzr.controller;
import javax.servlet.http.HttpSession;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframew... |
PHP | UTF-8 | 543 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Category extends Model
{
protected $fillable = ['name', 'is_active'];
// Begin Subcategory Relationship
public function subcategories()
{
return $this->hasMany('App\Subcategory');
}
// End Subcategory Relationship... |
Swift | UTF-8 | 472 | 2.828125 | 3 | [] | no_license | //
// dogImage.swift
// dogPictures
//
// Created by Justin Knight on 3/19/19.
// Copyright © 2019 JustinKnight. All rights reserved.
//
import Foundation
// THis is to represent the data recieved from dog APIs which just contain a status message and an image URL
// We need to specify that DogIMage conforms to th... |
Python | UTF-8 | 59 | 2.75 | 3 | [] | no_license | scorelist = [64,100,78,80,72]
for i in scorelist:
print(i) |
SQL | UTF-8 | 1,152 | 2.96875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | INSERT INTO series (title, author_id, subgenre_id) VALUES
("A Series of Unfortunate Events", 1, 1),
("Ender Saga", 2, 2);
INSERT INTO authors (name) VALUES
("Lemony Snicket"),
("Orson Scott Card");
INSERT INTO subgenres (name) VALUES
("Bleak Children's Fiction"),
("Science Fiction");
INSERT INTO books (title, year,... |
Java | GB18030 | 5,933 | 1.945313 | 2 | [] | no_license | package com.android.mydiary.org;
import java.util.ArrayList;
import java.util.List;
import com.android.mydiary.org.MainActivity.ListClickListener;
import com.android.mydiary.org.MainActivity.ListLongPressListener;
import com.android.mydiary.org.adapter.MyDiaryInfoAdapter;
import com.android.mydiary.org.db.DataBaseOpe... |
PHP | UTF-8 | 11,734 | 2.859375 | 3 | [
"MIT"
] | permissive | <?php
namespace Application\Core;
use Application\Objects\Router\Route;
/**
* The Router handles the routes
*/
class Router {
/** @var xTend\Objects\Route Default route */
private static $_default;
/** @var xTend\Objects\Route Home route */
private static $_home;... |
JavaScript | UTF-8 | 457 | 3.03125 | 3 | [
"MIT"
] | permissive | /**
*
*/
var rIndexjL, tableJL = document.getElementById("janjiLuaran");
function addRow() {
var newRow = tableJL.insertRow(tableJL.length);
var cell = newRow.insertCell(0);
cell.innerHTML = "Test";
selectedRow();
}
function selectedRow() {
for(var i = 0; i <tableJL.rows.length; i++) {
tableJL.rows[i].onclic... |
C++ | UTF-8 | 1,308 | 2.515625 | 3 | [] | no_license | #pragma once
#include "Cube.h"
#include "Engine.h"
#include "RandomGenerator.h"
#include <stdint.h>
class CGameBoardData {
RandomGenerator generator;
uint8_t boardBuffer[17][6];
double fpBuffer[17][6];
int bottomID;
uint32_t seed;
void genOneLine(int y);
void genLine(int y);
void genB... |
Markdown | UTF-8 | 1,298 | 2.5625 | 3 | [] | no_license | ---
layout: post
title: "2016 年终总结"
date: 2017-02-10 10:30:20 +0800
categories: summary
tags: summary
---
## 闲聊
我想东西的时候总是喜欢拽头发,这几天头发备受摧残啊。
这两天有段代码的逻辑不知道怎么写,就想找个人说说话,打开 QQ,关闭 QQ,打开微信,关闭微信,纠结了好长时间,大家都在忙吧...
说说 16 年总结和 17 年规划吧
## 2016 年完成情况
1、上次也说过了学了很多东西可以感觉什么都不深入哈,完成一般
2、游戏也写完了,可以我感觉并不好,所以并没有上架哈,完成一般
3、小说... |
SQL | UTF-8 | 10,542 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.3
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:8889
-- Tiempo de generación: 16-05-2018 a las 22:21:43
-- Versión del servidor: 5.6.35-log
-- Versión de PHP: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Base de datos: `mydb`
--
-- ---... |
C# | UTF-8 | 942 | 3.0625 | 3 | [] | no_license | SqlCommand command = new SqlConnection("[The connection String goes here]").CreateCommand();
try
{
command.Parameters.Add(new SqlParameter() { ParameterName = "ParameterA", Direction = ParameterDirection.Input, Value = "Some value" });
command.Parameters.Add(new SqlParameter() { Paramete... |
C | UTF-8 | 245 | 2.546875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
int receivedNumber;
read(5, &receivedNumber, sizeof(int));
int nKup = receivedNumber * receivedNumber * receivedNumber;
write(6, &nKup, sizeof(int));
return 0;
}
|
Ruby | UTF-8 | 491 | 2.90625 | 3 | [] | no_license | require 'open-uri'
require 'nokogiri'
# Let's scrape recipes from http://www.epicurious.com
puts "What recipes are you looking for?"
print ">"
user_input = gets.chomp
url = "https://www.bbcgoodfood.com/search/recipes?q=#{user_input}"
html_file = URI.open(url).read
html_doc = Nokogiri::HTML(html_file)
html_doc.se... |
Markdown | UTF-8 | 1,198 | 2.796875 | 3 | [
"MIT"
] | permissive | # leetcodeJS
Personal solution for leetcode problem using Javascript.
## Why?
This is personal attempt for leetcode problems. Over period of time with web development, I felt I was more into that part of CS that involves understanding contracts(RFCs, HTML5, ES, etc) and specifications(WCAG, REST, etc) that revolves ... |
Swift | UTF-8 | 2,042 | 3.046875 | 3 | [] | no_license | //
// GameLogic.swift
// ParticleBlaster
//
// Created by Bohan Huang on 29/3/17.
// Copyright © 2017 ParticleBlaster. All rights reserved.
//
/**
* The `GameLogic` protocol defines the basic methods and properties of
* To define the logic of a new game play
* - Create a class conforming to this protocol... |
Java | UTF-8 | 302 | 1.820313 | 2 | [
"Apache-2.0",
"GPL-1.0-or-later"
] | permissive | package com.github.netty.core.util;
/**
* @author wangzihao
* 2018/8/25/025
*/
public class LoggerFactoryX {
public static LoggerX getLogger(Class clazz) {
return new LoggerX(clazz);
}
public static LoggerX getLogger(String clazz) {
return new LoggerX(clazz);
}
}
|
Java | UTF-8 | 352 | 2.40625 | 2 | [] | no_license | package backEnd;
import lombok.Builder;
import lombok.RequiredArgsConstructor;
/**
* Collects money for the current player
*/
@RequiredArgsConstructor
@Builder
public class CollectMoney implements Action {
private final int amount;
@Override
public void resolve() {
GameManager.getCurrentPl... |
Java | UTF-8 | 3,452 | 2.03125 | 2 | [
"Apache-2.0"
] | permissive | package com.amazon.dataprepper.plugins.source.oteltrace;
import com.amazon.dataprepper.model.configuration.PluginSetting;
public class OTelTraceSourceConfig {
private static final String REQUEST_TIMEOUT = "request_timeout";
private static final String PORT = "port";
private static final String SSL = "ssl"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.