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 |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 2,925 | 2.109375 | 2 | [] | no_license | package com.myproject.helloandroid;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import android.app.*;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;
import android.content.Intent;
import android.net.Uri;
p... |
C# | UTF-8 | 1,930 | 3.421875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
namespace ReportRepair
{
class Program
{
private static int TargetSum = 2020;
static void Main(string[] args)
{
var exeFolder = Path.GetDirectoryName(Assembly.GetEx... |
Python | UTF-8 | 228 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | import pickle
class Dataset(list):
def __init__(self, file):
super().__init__()
if file is not None:
file = open(file, 'rb')
data = pickle.load(file)
self.extend(data)
|
TypeScript | UTF-8 | 1,809 | 2.765625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | /*
* Copyright (C) 2021 by Fonoster Inc (https://fonoster.com)
* http://github.com/fonoster/rox
*
* This file is part of Rox
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* https://opensourc... |
Java | UTF-8 | 2,016 | 2 | 2 | [] | no_license | package com.tulingxueyuan.order.service.impl;
import com.tulingxueyuan.order.api.StockService;
import com.tulingxueyuan.order.mapper.OrderMapper;
import com.tulingxueyuan.order.pojo.Order;
import com.tulingxueyuan.order.service.OrderService;
import io.seata.spring.annotation.GlobalLock;
import io.seata.spring.annotati... |
PHP | UTF-8 | 3,673 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace MaciejSz\Nbp\Test\Fixtures;
use MaciejSz\Nbp\CurrencyTradingRates\Domain\CurrencyTradingRate;
use MaciejSz\Nbp\CurrencyTradingRates\Domain\CurrencyTradingTable;
class FixturesRepository
{
public static function create(): self
{
return new self();
}
p... |
Java | UTF-8 | 4,888 | 2.359375 | 2 | [] | no_license | package com.zwq.blog.conf;
import com.zwq.blog.model.Menu;
import com.zwq.blog.model.RoleMenu;
import com.zwq.blog.model.User;
import com.zwq.blog.model.UserRole;
import com.zwq.blog.service.UserService;
import com.zwq.blog.vo.MenuVo;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.*;
import org.a... |
C++ | UTF-8 | 3,186 | 2.75 | 3 | [] | no_license | #include "Memory.h"
#include "types.h"
#include "Optable.h"
#include <iterator>
namespace KNVM {
size_t OFFSET_CODE = 0x1000;
size_t OFFSET_DATA = 0x4000;
size_t OFFSET_STACK = 0x8000;
size_t MAX_MEMORY_SIZE = 0xc000;
void * _Public Memory::get() { return address; }
DWORD _Public Memory::getAlign() const { ret... |
Java | UTF-8 | 419 | 1.71875 | 2 | [] | no_license | package com.sjw.wjs.module_login_mvp.module;
/**
* =========================================
* Author : yinshengpan
* Email : yinshp0423@163.com
* Created date : 2018/3/15 14:59
* Describe :
* ==========================================
*/
public interface ILoginModule {
//检查用户名是否为空
boolean checkNullUse... |
PHP | UTF-8 | 3,117 | 2.515625 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | <?php
namespace MauticPlugin\MauticGSBundle\Google\google_api_php_client\src\Google\Service;
/*
* Copyright 2010 Google Inc.
*
* 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
*
... |
Java | UTF-8 | 2,630 | 2.375 | 2 | [
"Apache-2.0"
] | permissive | package com.study.study1.job;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
import org.springframework.batch.c... |
C# | UTF-8 | 14,640 | 2.9375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Abstractions.Enums;
using CS_Project;
namespace CS_Project.AditionalMethods
{
public static class CreatePPObj
{
#region CreatePlane
public static KeyValuePair<int, Plane> C... |
JavaScript | UTF-8 | 155 | 3.171875 | 3 | [] | no_license | //P4-Coin flip
const HEAD=1;
let coinFlip=Math.floor(Math.random()*10)%2;
if(coinFlip==HEAD)
{
console.log("Head");
}
else
{
console.log("Tail");
} |
Python | UTF-8 | 1,166 | 2.703125 | 3 | [] | no_license | #!/bin/python3
from os import sys
from os import sys
import calcul
def intConvertisser(intStr):
try:
result = int(intStr)
except:
quit (84)
return result
def parser():
if (len(sys.argv) != 5):
quit (84)
nb = intConvertisser(sys.argv[1])
arithmMean = intConvertisse... |
Java | UTF-8 | 4,525 | 2.265625 | 2 | [] | no_license | package org.pepo.record.service.record;
import lombok.AllArgsConstructor;
import org.pepo.record.SwaggerCodgen.model.RecordPagedResponseOpenApi;
import org.pepo.record.SwaggerCodgen.model.RecordResponseOpenApi;
import org.pepo.record.entity.Record;
import org.pepo.record.entity.Record_;
import org.pepo.record.mapper.R... |
Java | UTF-8 | 4,085 | 2.453125 | 2 | [] | no_license | import java.io.*;
import java.util.Date;
import java.util.List;
import data.Activity;
import org.apache.batik.svggen.SVGGraphics2D;
import org.apache.batik.svggen.SVGGraphics2DIOException;
import org.apache.batik.transcoder.image.JPEGTranscoder;
import org.apache.batik.transcoder.TranscoderInput;
import org.apache.bat... |
Python | UTF-8 | 1,888 | 3.140625 | 3 | [] | no_license | # Write a Python Script that captures images from your webcam vide stream
# Extract all faces from the image frame(using harcascade)
# Store the information into numpy arrays
# 1. Read and show video stream, capture images
# 2. Detect Faces and show bounding box
# 3. Flatten the largest face image and save in numpy ar... |
PHP | UTF-8 | 7,548 | 2.859375 | 3 | [
"GPL-2.0-or-later",
"GPL-1.0-or-later",
"GPL-2.0-only",
"MIT",
"LicenseRef-scancode-generic-exception",
"LGPL-2.1-or-later",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-other-copyleft",
"LicenseRef-scancode-proprietary-license"
] | permissive | <?php
/**
* Progress bars widget
*
* @package vogue.
* @since 1.0.0
*/
// File Security Check
if ( ! defined( 'ABSPATH' ) ) { exit; }
/* Load the widget */
add_action( 'widgets_init', array( 'Presscore_Inc_Widgets_ProgressBars', 'presscore_register_widget' ) );
class Presscore_Inc_Widgets_ProgressBars extends W... |
PHP | UTF-8 | 976 | 2.65625 | 3 | [] | no_license | <?php
namespace Varspool\JobAdder\V2\Model;
class SubmitEmploymentModel
{
/**
* @var SubmitCurrentEmploymentModel
*/
protected $current;
/**
* @var SubmitIdealEmploymentModel
*/
protected $ideal;
/**
* @return SubmitCurrentEmploymentModel
*/
public function getCu... |
Python | UTF-8 | 4,159 | 2.59375 | 3 | [] | no_license | import csv
import itertools
import random
import numpy as np
import os
import json
from source.util import get_label
def generate_DB(newDataPath=None, rawDataPath=None, sample_for_line=20, hole_value=-1):
if rawDataPath is None:
rawDataPath = '../../data/16col_original_25000line_trainset.csv'
if newDat... |
JavaScript | UTF-8 | 7,731 | 2.90625 | 3 | [] | no_license | /*eslint-env browser */
/*eslint no-var: "error"*/
/*eslint prefer-const: "error"*/
/*eslint-env es6*/
function displayScreen(currentDisplay) {
if (document.body.offsetWidth <= 600)
toggleSideBar();
const offreader = document.querySelector(".offreader");
offreader.style.display = "none... |
Markdown | UTF-8 | 905 | 2.546875 | 3 | [] | no_license | -- 겉 Layout 설계 --
네비를 그린다.
제목을 잡는다.
세부 네비를 잡는다.
갤러리 컨텐츠를 넣는다.
-- 당장 할 일 --
일정 scrollTop 이상이면, css position: fixed 이고,
일정 scrollTop 이하이면, css position: static
-- 문제점 --
-- 아이디어 --
scrollTop 실험하기
input의 checked는 html5에서 자동으로 형성되어 주는 듯하다.
:before 선택자 전에 content 를 삽입하는 것.
-- 필터 네비게이터 모듈 설계 --
필터 네비... |
Python | UTF-8 | 1,178 | 2.890625 | 3 | [] | no_license | #####packages#####
from pymongo import MongoClient
#####end-packages#####
#credentials
host = "localhost"
port = 27017
db = "customer"
def connect(): #this method can be used to establish a connection with database
try:
mongo_connection = MongoClient(host + ":" + str(port))
mongo_database = mong... |
C++ | UHC | 1,278 | 2.765625 | 3 | [] | no_license | #include "stdafx.h"
#include "cTimeManager.h"
cTimeManager::cTimeManager()
:m_fWorldTime(0.0f)
, m_fElapsedTime(0.0f)
{
m_dwLastUpdateTime = GetTickCount();
}
cTimeManager::~cTimeManager()
{
}
void cTimeManager::Update()
{
DWORD dwCurrentTime = GetTickCount();
// 1 ð = (ð -Ҷ ð)/1000.0
m_fElapsedTime = ... |
Python | UTF-8 | 1,013 | 4.34375 | 4 | [] | no_license | '''
Given a binary tree, check whether it’s a binary search tree or not.
Approach A:
Iterate through the entire tree looking for contradictions
- False if Left Child > Right Child
Approach B:
Iterate
'''
import pytest
class Node:
def __init__(self, value, left=None, right=None):
self.value = value
... |
Java | UTF-8 | 276 | 1.664063 | 2 | [] | no_license | package liusheng.url.pipeline;
import liusheng.url.HandlerContext;
/**
* 年: 2020 月: 04 日: 04 小时: 14 分钟: 43
* 用户名: LiuSheng
*/
public interface Handler {
void handle(HandlerContext handlerContext, HandlerChain handlerChain) throws Exception;
}
|
PHP | UTF-8 | 1,697 | 3.125 | 3 | [] | no_license | <?php
namespace MartynBiz\Mongo\Traits;
/**
* Can be re-used for anything that requires singleton pattern
*/
trait Singleton
{
/**
* @var Singleton The reference to *Singleton* instance of this class
*/
private static $instances = array();
/**
* Returns the *Singleton* instance of this c... |
C# | UTF-8 | 1,135 | 2.546875 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public interface IFadeable
{
//private Material[] materials;
void fadeToMaterial(List<Transform> fadeObjects);
//get all the current materials in a list
//if any of the materials are the same dont add the duplicates
//... |
Java | UTF-8 | 2,393 | 2.359375 | 2 | [] | no_license | package Dao.impl;
import Dao.IAccountDao;
import entity.Account;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.Row... |
JavaScript | UTF-8 | 604 | 2.890625 | 3 | [
"MIT"
] | permissive | describe("Plane", function() {
var plane;
beforeEach(function() {
plane = new Plane();
});
describe("isAirbourne", function() {
it("Starts as not airbourne", function() {
expect(plane.isAirbourne()).toBe(true);
});
});
describe("land", function() {
it("Change plane to landed", func... |
Markdown | UTF-8 | 2,763 | 3.375 | 3 | [
"MIT"
] | permissive | # MSA_trimmer: Straightforward & minimalistic removal of poorly aligned regions in **M**ultiple **S**equence **A**lignments
This is a program to remove (trim) or mask columns of multiple sequence alignments in fasta format.
Columns are removed if they exceed a user-specified "gappyness" treshold, i.e. a threshold o... |
Java | UTF-8 | 3,521 | 3 | 3 | [] | no_license | package test3;
import java.util.Scanner;
public class Shujunihe {
int n = 9;// 9条数据
int m = 2;// x的维数
int cnt = 0;
double a[][] = new double[m + 1][m + 1];
double b[] = new double[m + 1];
int x1[] = new int[a.length];
int y1[] = new int[a.length];
int x2[] = { 1, 2, 3 };// 用来存放交换后变量x的位置
boolean ... |
PHP | UTF-8 | 1,607 | 2.59375 | 3 | [] | no_license | <?php namespace Jenssegers\Mongodb;
use Jenssegers\Mongodb\Model;
use Jenssegers\Mongodb\DatabaseManager;
use Illuminate\Support\ServiceProvider;
use Illuminate\Validation\DatabasePresenceVerifier;
class MongodbServiceProvider extends ServiceProvider {
/**
* Bootstrap the application events.
... |
Java | UTF-8 | 1,416 | 2.234375 | 2 | [] | no_license | package org.star.uml.designer.command;
import java.util.Collection;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.AbstractCommand;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.impl.EReferenceImpl;
import org.eclipse.gmf.runtime.emf.commands... |
Python | UTF-8 | 1,803 | 2.796875 | 3 | [] | no_license | import pygame
from constantes import *
class Game(object):
"""docstring for game."""
def __init__(self, item, windows, perso):
super(Game, self).__init__()
self.item = item
self.gameover = 0
self.win = 0
self.game = 1
self.over_loop = 0
self.main_loop =... |
Python | UTF-8 | 1,575 | 3.015625 | 3 | [] | no_license | from unittest import TestCase
from unittest.mock import patch
import dnd
class Test(TestCase):
def test_roll_one_sided_die_once(self):
expected = 1
actual = dnd.roll_die(1, 1)
self.assertEqual(expected, actual)
def test_roll_six_sided_die_once(self):
actual = dnd.roll_die(1, 6... |
Java | UTF-8 | 594 | 1.84375 | 2 | [] | no_license | package com.ksquarej.edunomics.NavigationDrawer;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import com.ksquarej.edunomics.R;
public class Opportunitesfragment extend... |
C# | UTF-8 | 1,043 | 2.796875 | 3 | [] | no_license | using GameShopDemo.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GameShopDemo.Managers
{
class CampaignManager : Services.ICampaignService
{
public int LastId=0;
public void AddCampaign(List<Camp... |
Java | UTF-8 | 5,363 | 2.109375 | 2 | [] | no_license | package com.feit.feep.dbms.dao.impl;
import com.feit.feep.core.Global;
import com.feit.feep.dbms.build.BasicSqlBuild;
import com.feit.feep.dbms.build.FeepEntityRowMapper;
import com.feit.feep.dbms.build.GeneratorSqlBuild;
import com.feit.feep.dbms.dao.IFeepDictionaryDao;
import com.feit.feep.dbms.entity.dictionary.Dic... |
Python | UTF-8 | 1,671 | 2.875 | 3 | [] | no_license | import pandas as pd
from lxml import etree
import re
import os
import requests
def get_html(url):
headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36'}
html=requests.get(url,headers=headers)
print(html.status_cod... |
C++ | UTF-8 | 10,562 | 2.90625 | 3 | [] | no_license | #include <chrono>
#include <thread>
#include <list>
#include "Punto.cpp"
#include "Rgb.cpp"
#include "Esfera.cpp"
#include "Plano.cpp"
#include "Camara.cpp"
#include "Luz.cpp"
#include "Matrix4.cpp"
#include "Listas.cpp"
#include "Interseccion.cpp"
#include "Imagen.cpp"
using namespace std::chrono;
... |
Go | UTF-8 | 3,585 | 3.09375 | 3 | [
"MIT"
] | permissive | package xorshift128plus
import (
"bytes"
"encoding/binary"
"fmt"
"strings"
"time"
"github.com/shivakar/random/prng"
"github.com/shivakar/random/prng/splitmix64"
)
var (
xorshift128plus *Xorshift128Plus
_ prng.Engine = xorshift128plus
)
// Xorshift128Plus implements a Xorshift PRNG with 128 bi... |
C++ | UTF-8 | 788 | 3.328125 | 3 | [] | no_license | #include <iostream>
using namespace std;
class Base {
public :
int a;
Base () {}
~Base () {}
virtual void fun() = 0;
private:
};
class Derived : public Base {
public:
int b;
Derived () {}
~Derived () {}
void fun ();
private:
};
class simplePattern {
public:
static simplePattern ... |
JavaScript | UTF-8 | 416 | 2.734375 | 3 | [] | no_license | //Use this class to send message along with status code to global error handler
module.exports= class CustomError extends Error {
constructor(message, statusCode)
{
super(message); //Send message sent through new Instance of Custom error to error
this.statusCode= statusCode;
Error.c... |
C# | UTF-8 | 777 | 2.625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenQA.Selenium;
namespace selenium_training._11_PageObjects_and_other_design_patterns
{
public class LoginPage
{
public IWebDriver driver;
public string BaseUrl = "https:/... |
C# | UTF-8 | 7,739 | 3.0625 | 3 | [] | no_license | using System;
using TinyRadius.Net.Dictionaries;
using TinyRadius.Net.Util;
namespace TinyRadius.Net.Attributes
{
/// <summary>
/// This class represents a generic Radius attribute. Subclasses implement
/// methods to access the fields of special attributes.
/// </summary>
public class ... |
Markdown | UTF-8 | 1,904 | 3.46875 | 3 | [] | no_license | #User manual
This php script was written to retrieve GitHub issues automatically on a repository.
To use it you only need the Curl library, and, of course, an access to a GitHub repository that contains issues.
You'll need to know how many hundreds of issues there are in this repo, because the GitHub API only allows... |
Markdown | UTF-8 | 8,847 | 2.921875 | 3 | [] | no_license | ## Peripherals
### Mouse Sensor Lens
#### Q: Should you clean your mouse sensor lens regularly, at what frequency and what cleaning methods are recommended?
#### A: Yes, you should try to clear any debris not only from the lens but the tracking surface itself regularly to reduce the likelihood of such particles affecti... |
Markdown | UTF-8 | 6,245 | 3.046875 | 3 | [] | no_license | ## 这什么?
这是 FEX 团队对外首页的源码,将文章提交到这里后就会在 <http://fex.baidu.com> 上展现。
## 环境搭建
这个系统是基于 [jekyll](http://jekyllrb.com/) 搭建的,为了方便本地编辑和看效果,需要将本项目 clone 至本地环境,并在本机安装 jekyll 环境。
### docker 版本
由于 ruby 编译经常出问题,所以制作了个 docker 镜像,安装好 docker 后,首先运行如下命令
docker run -it -v `pwd`:/build fexpublic/jekyll:latest bash
其中 pwd 是指当前目录... |
Java | UTF-8 | 1,571 | 2.078125 | 2 | [] | no_license | package com.project.digital_store.func.security.manager;
import com.project.digital_store.base.Result;
import com.project.digital_store.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation... |
C | UTF-8 | 1,296 | 3 | 3 | [] | no_license | //
// math_3d.h
// lesson02
//
// Created by green on 16/5/4.
// Copyright © 2016年 xyz.chenchangqing. All rights reserved.
//
#ifndef math_3d_h
#define math_3d_h
struct Vector3f
{
float x;
float y;
float z;
Vector3f() {}
Vector3f(float _x, float _y, float _z)
{
x = _x;
... |
Python | UTF-8 | 57 | 2.59375 | 3 | [] | no_license | import sys
words=eval(sys.stdin.readlines())
print(words) |
C++ | UTF-8 | 2,666 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
using namespace std;
const int mod = 2;
struct matrix
{
vector< vector<int> > v;
int r, c;
matrix(){}
matrix(int a, int b):r(a), c(b)
{
v.resize(r);
for(int i = 0;i < r;i... |
PHP | UTF-8 | 2,333 | 2.78125 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace BasicTests;
use CommonTestClass;
use kalanis\kw_cache\CacheException;
use kalanis\kw_cache\Format;
use kalanis\kw_cache\Simple\Variable;
class FormatsTest extends CommonTestClass
{
/**
* @throws CacheException
*/
public function testInit(): void
{
$factory = new Format... |
TypeScript | UTF-8 | 1,002 | 2.75 | 3 | [
"MIT"
] | permissive | import {Injectable} from '@nestjs/common';
import {InjectRepository} from '@nestjs/typeorm';
import {Repository} from 'typeorm';
import {Task} from '../entities/task.entity';
@Injectable()
export class TasksService {
constructor( @InjectRepository(Task) private tasksRepo: Repository<Task>
) {}
findAll()... |
Java | UTF-8 | 4,992 | 2.5 | 2 | [] | no_license | package com.base.library.view.timingView;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import android.view.View;
import com.base.library.R;
import com.bas... |
Java | UTF-8 | 5,721 | 2.078125 | 2 | [] | no_license | package com.denizenscript.depenizen.bungee;
import com.denizenscript.depenizen.common.socket.server.ClientConnection;
import com.denizenscript.depenizen.common.socket.server.SocketServer;
import com.denizenscript.depenizen.common.socket.server.packet.ServerPacketOutEvent;
import net.md_5.bungee.api.ServerPing;
import ... |
JavaScript | UTF-8 | 1,920 | 3.078125 | 3 | [] | no_license | function disable(el) {
el.disabled = true;
}
function enable(el) {
el.disabled = false;
}
function focus(el) {
el.focus();
}
export function $(el) {
return document.querySelector(el);
}
export function $$(el) {
return document.querySelectorAll(el);
}
export function text(el, text) {
el.textContent = te... |
PHP | UTF-8 | 1,267 | 3.015625 | 3 | [] | no_license | <?php
class EnqueteManager
{
private $db;
public function __construct($db)
{
$this->db = $db;
}
public function addEnquete($enquete)
{
$requete = $this->db->prepare(
'INSERT INTO enquetes (en_nom, oi_num, organisateur, proto_num, date_deb, date_fin)
... |
Shell | UTF-8 | 779 | 3.03125 | 3 | [] | no_license | #!/bin/bash
[ -z "$1" ] && exit 1
NAME=$1
shift
if [ "${NAME}" -ge 0 2>/dev/null ]
then
ENTRY=$( \
ldapsearch -x -LLL -h ldap.corp.redhat.com \
-b ou=users,dc=redhat,dc=com \
"(|(employeeNumber=${NAME})(rhatOraclePersonID=${NAME}))" $@ \
)
elif echo "${NAME}" | grep -q @
then
ENTRY=$( \
ldap... |
Java | UTF-8 | 14,369 | 2.28125 | 2 | [] | no_license | package f1app.gui;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.... |
PHP | UTF-8 | 2,404 | 2.828125 | 3 | [] | no_license | <?php
namespace Shepherd\Bundle\ProcessPoolBundle;
use Shepherd\Bundle\ProcessPoolBundle\Exception\ProcessExecutionError;
use Psr\Log\LoggerInterface;
use Symfony\Component\Process\Process;
class ProcessPool
{
/** @var LoggerInterface */
private $logger;
/** @var array */
private $pool = [];
/*... |
JavaScript | UTF-8 | 3,219 | 2.53125 | 3 | [] | no_license | import React, { Component } from "react";
import PropTypes from "prop-types";
import "./carousel.scss";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faChevronLeft, faChevronRight } from "@fortawesome/free-solid-svg-icons";
import Image from "../media/image";
import Container from "./conta... |
C | UTF-8 | 12,126 | 2.71875 | 3 | [] | no_license | #ifndef _DIFF_H_
#define _DIFF_H_
enum TeXPos
{
TeX_start = 1,
TeX_print = 2,
TeX_finish = 3
};
enum DiffStatus
{
diff = 1,
nodiff = 2,
enddiff = 3,
bread = 4,
bread2 = 5,
bread3 = 6
};
enum TeXPhrase
{
StartDiff = 1,
FinishDiff = 2,
ShortDiff = 3,
PresentDiff = 4,
InDiff = 5
};
enum Nod... |
Markdown | UTF-8 | 2,515 | 2.984375 | 3 | [] | no_license | ---
title: "Please, allow me to rant a moment"
author: "Glen Campbell"
date: "2014-05-28T17:00:00-07:00"
category: essays
tags: [code, jekyll, assumptions]
comments: true
---
We're using [jekyll](http://jekyllrb.com) on some projects at work, so I thought that I would try it out on my laptop. I found the Jekyll [Quick... |
Java | UTF-8 | 754 | 1.960938 | 2 | [] | no_license | package com.ctl.security.ips.maestro.jms;
import com.ctl.security.ips.common.jms.bean.EventBean;
import com.ctl.security.ips.maestro.service.EventNotifyService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner... |
SQL | UTF-8 | 560 | 2.78125 | 3 | [] | no_license | delete from user_has_interest;
delete from participants;
delete from messages;
delete from chat;
delete from user_wishes;
delete from tbl_friends;
delete from user_info;
delete from users;
insert into users (id, confirmed, email, password, username) values
(1, true, 'a', 'a', 'a'),
(2, true, 'b', 'b', 'b');
insert in... |
Markdown | UTF-8 | 8,363 | 2.65625 | 3 | [] | no_license | # `@makkii/app-eth`
Ethereum application client.
This library uses some third-party service:
- Web3 JsonRPC - you can pass in jsonrpc in [EthApiClient](#ethapiclient) Constructor
- Explorer Api - To get transaction history, token history, we have two solutions:
- `http://api.ethplorer.io`
- `http://a... |
JavaScript | UTF-8 | 1,477 | 4.09375 | 4 | [] | no_license | // 2019/6/28
// part1
console.log(a);
var a = 1;
console.log(a);
// 上边代码等价如下 解析器眼中的代码
var a;
console.log(a);//undefined
a = 1;
console.log(a);//1
// 思考如下代码输出什么 值类型
console.log(a,b);//undefined undefined
var b = 23;
console.log(a,b);//undefined 23
var a = b;
console.log(a,b);//23 23
// 思考如下代码输出什么 引用类型
console.log(o... |
Java | UTF-8 | 1,244 | 2.75 | 3 | [
"MIT"
] | permissive | package com.oaksoft.utils.utils.xmljson;
import java.io.IOException;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.faste... |
C++ | UTF-8 | 758 | 2.890625 | 3 | [] | no_license | #pragma once
#include "UE4DevelopmentLibrary/Stream.hpp"
struct FVector : public SerializeInterface
{
public:
FVector(const FVector& rhs) {
FVector::operator=(rhs);
}
void operator=(const FVector& rhs) {
x = rhs.x;
y = rhs.y;
z = rhs.z;
}
FVector(float _x, float _y, ... |
Python | UTF-8 | 327 | 3.953125 | 4 | [] | no_license | print("enter the no. of elements:")
n = int(input())
print("enter the elements one after other separated by space:")
a = list(map(int,input().split()))
for i in range(1,n):
key = a[i]
j = i-1
while j>=0 and a[j]>key:
a[j+1] = a[j]
j = j-1
a[j+1] = key
print("Sorted Array i... |
Java | UTF-8 | 572 | 2.0625 | 2 | [] | no_license | package com.company.common.model.factory;
import com.company.common.model.browser.AbstractWebBrowserInterface;
public interface AbstractWebBrowserFactoryInterface {
public AbstractWebBrowserInterface createIeWebBrowser() throws Exception;
public AbstractWebBrowserInterface createFirefoxWebBrowser() throws Exc... |
Markdown | UTF-8 | 3,312 | 2.546875 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: "Ruby Meetup December 20, 2015"
date: 2015-12-23 18:37
comments: true
categories: [activities, meetup]
author: josisusan
---
After months of hurdles and fuel crisis, we’re finally continuing our monthly Ruby Meetup. Around 30 ruby enthusiasts showed up for the december meetup held on 20th Decemb... |
Java | UTF-8 | 400 | 2.9375 | 3 | [] | no_license | package SelfStudy;
class Data1{
int value;
}
class Data2{
int value;
Data2(int x) { // 매개변수가 있는 생성자
value = x;
}
}
public class ch6_23_ConstructorTest {
public static void main(String[] args) {
Data1 d1 = new Data1();
// Data2 d2 = new Data2(); // complie error 발생
// Data2 d2 = new Data2(x); 와 같이 정의된 생성... |
TypeScript | UTF-8 | 2,702 | 3.1875 | 3 | [
"MIT"
] | permissive | const STATE_PLAINTEXT = Symbol('plaintext');
const STATE_HTML = Symbol('html');
const STATE_COMMENT = Symbol('comment');
// eslint-disable-next-line @typescript-eslint/ban-types
function striptags(html: string | String = '') {
// if not string, then safely return an empty string
if (typeof html !== 'string' && !(h... |
Java | UTF-8 | 595 | 1.882813 | 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 mx.com.pixup.portal.dao.interfaces;
import java.util.List;
import mx.com.pixup.portal.model.Municipio;
/**
*
* @author mflo... |
C++ | UTF-8 | 4,795 | 2.875 | 3 | [] | no_license | #include "cComMoveTo.h"
#include <iostream>
#include <GLFW/glfw3.h>
void cComMoveTo::setMyID( int myID )
{
this->m_uniqueID = myID;
return;
}
cComMoveTo::cComMoveTo()
{
this->initPosition = glm::vec3( 0.0f, 0.0f, 0.0f );
this->finalPosition = glm::vec3( 0.0f, 0.0f, 0.0f );
this->direction = glm::vec3( 0.0f, 0.0... |
PHP | UTF-8 | 3,974 | 2.75 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | <?php
/**
* Translation file for Portuguese language.
*
* @author Felippe Roberto Bayestorff Duarte <felippeduarte@gmail.com>
* @link https://github.com/rlanvin/php-rrule
*/
return array(
'yearly' => array(
'1' => 'anual',
'else' => 'cada %{interval} anos' // cada 8 anos
),
'monthly' => array(
'1' => 'm... |
C# | UTF-8 | 1,221 | 2.859375 | 3 | [] | no_license | using Dapper;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Data.SqlClient;
namespace BlazorDapperCRUD.Data
{
public class VideoService : IVideoService
{
private readonly SqlConnectionConfiguration _configuration;
... |
JavaScript | UTF-8 | 781 | 2.796875 | 3 | [] | no_license | /**
* Created by NiiTTrox on 26.03.2017.
*/
var data = [
{"title": "PushUps", "dur": 45},
{"title": "Kniebeuge", "dur": 60},
{"title": "Baumstamm rechts", "dur": 30},
{"title": "Baumstamm links", "dur": 30},
{"title": "SitUps", "dur": 45}
];
window.addEventListener("load", function () {
... |
Markdown | UTF-8 | 574 | 2.984375 | 3 | [] | no_license | Part 2-
Pass 17 through the function, hard code it in main.
Part 3-
I would have tested it by print statements since it does not
return anything.
Part 4-
From part 2 and part 3, part 2 is a void function, meaning it
has no return type. In part 3, we are returning the data in a
string array. We did that because ... |
Markdown | UTF-8 | 900 | 3.375 | 3 | [] | no_license | ## colgroup 中 col 标签指定 width 不生效
有时候,使用 table 开发页面的时候,会存在表格合并和拆分的需求。
列合并在 td 上使用 colspan,行合并在 td 上使用 rowspan 即可。那如何去固定每列的宽度呢?
可以通过使用 colgroup 和 col 标签,给 col 标签配置 width 属性,就可以实现。然而,width 属性在 html5 中已经被废弃了,那怎么使用才能固定列宽呢?
可以给 col 标签加类名,类中指定 width,就能完美实现了。
注意:表格列的宽度会根据内容的宽度自动调整,所以即使你指定了 td 的宽度,内容过宽时,整个表格的布局还是会发生改变,需要给 t... |
JavaScript | UTF-8 | 1,614 | 3.0625 | 3 | [] | no_license | // in this file create an express application - use the middle-ware built into express
// to serve up static files from the public directory (index.html and client.js - you
// can also serve up css files from the public directory this way if you want)
// you need to support a '/trucks' endpoint, and a dynamic route... |
C | UTF-8 | 303 | 3.359375 | 3 | [] | no_license | #include<stdio.h>
#include<string.h>
size_t strlenA(const char *str)
{
const char *newStr;
newStr=str;
size_t a=0;
while (*newStr!='\0')
{
newStr++;
a++;
}
return a;
}
void main()
{
const char *s1="Amit Kumar Upadhyay";
printf("Number of characters in string = %d",strlenA(s1));
} |
Python | UTF-8 | 1,749 | 3.03125 | 3 | [] | no_license | import nltk
from nltk.sentiment.vader import SentimentIntensityAnalyzer
import praw
reddit = praw.Reddit(client_id='x_IAA3B1ypV01Q',
client_secret='vt_BW5GESY4n0yGCuUoaxkoKWug',
user_agent='champagnefruit'
)
nltk.download('vader_lexicon')
sid = Sentiment... |
Python | UTF-8 | 2,497 | 3.125 | 3 | [] | no_license | """
This is a unittest test suite for the function files_finder in the module similar_files_finder.
"""
import unittest
import os
from supertool.similar_files_finder import files_finder
PATH = os.path.abspath(os.path.dirname(__file__))
class PositiveTests(unittest.TestCase):
"""
This test case contains the... |
Java | UTF-8 | 1,930 | 2.234375 | 2 | [] | no_license | package josep.com.firebaseenintents;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.... |
Python | UTF-8 | 4,148 | 3.046875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/python
'''
Learning Machines
Taught by Patrick Hebron at NYU ITP
Multilayer Perceptron (MLP) implementation.
'''
import numpy as np
import Activation
from MnistReporter import *
class Mlp:
class Layer:
def __init__(self,input_size,output_size):
wlimit = np.sqrt( 6.0 / float( input_size + output_si... |
Shell | UTF-8 | 1,353 | 3.46875 | 3 | [] | no_license | #! /bin/bash
if [ -z $music_folder ]; then
music_folder="/home/${USER}/"
fi
if [ ! -z $1 ]; then
music_folder=$1
fi
if [ -z "$(pidof spotify)" ]; then
echo "spotify not running... exit..."
exit 1
fi
pulse_sink=$(
pactl list sink-inputs \
| fgrep --regexp='Sink' --regexp='media.name = "Spotify"' \
| head -n2... |
JavaScript | UTF-8 | 832 | 3.25 | 3 | [] | no_license | function add (answer1,answer2,answer3) {
return (answer1 + answer2 + answer3);
}
$(document).ready(function() {
$("form#intro").submit(function(event) {
event.preventDefault();
$(".intro").hide();
$(".quiz").show();
});
$("form#quiz").submit(function(event) {
event.preventDefault();
let a... |
Python | UTF-8 | 1,060 | 3.375 | 3 | [] | no_license | # # 6/6/2020
# Another way to visualize your XGBoost models is to examine the importance of each feature column in the original dataset within the model.
# One simple way of doing this involves counting the number of times each feature is split on across all boosting rounds (trees) in the model, and then visualizing t... |
Python | UTF-8 | 1,309 | 2.75 | 3 | [] | no_license | import configuration
class GCodeContext:
def __init__(self):
self.drawing = False
self.start_codes = configuration.start_codes
self.stop_codes = configuration.stop_codes
# delay between startup and start of extrusion
self.startup_lag = 0.0
self.stop_lag = 0.0
... |
SQL | UTF-8 | 8,012 | 4.5625 | 5 | [] | no_license | -- Create these queries to develop greater fluency in SQL, an important database language.
USE sakila;
-- 1a. Display the first and last names of all actors from the table actor.
SELECT first_name, last_name
FROM actor;
-- 1b. Display the first and last name of each actor in a single column in upper case letters. Na... |
C++ | UTF-8 | 830 | 2.53125 | 3 | [] | no_license | #pragma once
namespace Stormancer
{
class Document
{
public:
std::string id;
std::string type;
long long version;
//Stored document
std::string content;
MSGPACK_DEFINE(id, type, version, content)
};
class PutResult
{
public:
//true if the server could store/update the record, false in case of up... |
Python | UTF-8 | 560 | 2.609375 | 3 | [] | no_license | # importar el archivo de la conexión a la BD
from configdb import get_connection
def add_user(email, name, passwd ):
cnn = get_connection()
with cnn.cursor() as cursor:
cursor.execute("INSERT INTO user (email, name, passwd) VALUES (%s,%s,%s)",(email, name, passwd))
cnn.commit()
cnn.close()
... |
Python | UTF-8 | 2,484 | 2.65625 | 3 | [] | no_license | import click
import json
from api import make_api_request
from commands.config import value_or_config
@click.group('spaces', help='List, view, update, and delete spaces')
def spaces():
pass
@click.command('list', help='List all spaces you have access to')
@click.option('-t',
'--team-id',
... |
JavaScript | UTF-8 | 1,282 | 3.03125 | 3 | [
"Apache-2.0"
] | permissive | // @flow
import type {Point} from './utils'
const GESTURE_INTERVAL = 3000 // milis
const STROKES_TO_SHAKE = 5
const MIN_STROKE_LENGTH = 20 // px
let shakes = 0
let lastX = null
let lastY = null
let firstXInDir = 0
let lastDir = null
let gestureTimeout = null
export const resetGesture = () => {
gestureTimeout && cl... |
Java | UTF-8 | 13,437 | 2.078125 | 2 | [] | no_license | package paneles;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List;
import java.u... |
Markdown | UTF-8 | 9,394 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | # 金史
## 简介
《金史》撰成于元代,全书一百三十五卷,其中本纪十九卷,志三十九卷,表四卷,列传七十三卷,记载了上起金太祖完颜阿骨打出生(1068年),下至金哀宗天兴三年(1234年)蒙古灭金,共一百二十年的历史。是反映女真族所建金朝的兴衰始末的重要史籍。历代对《金史》的评价很高,认为它不仅超过了《宋史》、《辽史》,也比《元史》高出一筹。
[卷一本纪第一___](卷一本纪第一.md)
[卷二本纪第二___](卷二本纪第二.md)
[卷三本纪第三___](卷三本纪第三.md)
[卷四本纪第四___](卷四本纪第四.md)
[卷五本纪第五___](卷五本纪第五.md)
[卷六本纪第六___](卷六本纪第六.m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.