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 | 454 | 3.234375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
int main()
{
int i,ram[5]={1,2,3,4,5},sum=0;
int temp;
printf("Name\t Value\t Address\n");
for(i=0;i<5;i++)
{
int *ptr= ram[i];
printf("ram[%d]\t %d\t%p\n",i,ram[i],ptr);
}
printf("Another method\n");
for(i=0;i<5;i++... |
Python | UTF-8 | 1,876 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | """A material template."""
from gemd.entity.template.base_template import BaseTemplate
from gemd.entity.template.has_property_templates import HasPropertyTemplates
class MaterialTemplate(BaseTemplate, HasPropertyTemplates):
"""
A material template.
Material templates are collections of property templates... |
Java | UTF-8 | 29,191 | 1.53125 | 2 | [] | no_license | package com.hlnwl.auction.ui.goods;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.view.View;
import android.webkit.WebView;
import android.widget.ImageView;
import android.w... |
Markdown | UTF-8 | 1,128 | 2.515625 | 3 | [] | no_license | # SpeedPack
(toàn bộ ý tưởng và hình ảnh đều của lumosity-speedpack game)
Yêu cầu màn hình FullHD (do window co size 1000x1000)
Gõ "./make" trong cửa sổ Shell hoặc cmd để compile code
Gõ "./make run" trong cửa sổ Shell hoặc cmd để chơi
Giới thiệu về game SpeedPack:
Thời gian 1 lượt chơi: 2 phút
Mục tiêu: Tối đa số ... |
Markdown | UTF-8 | 862 | 2.578125 | 3 | [] | no_license | # MyReads Project
This is my 6th project with Udacity for the Front End Development Nanodegree.A static example of the CSS and HTML markup was provided and was used to write React code that was needed to complete the project. Progressively, added interactivity to the app by refactoring the static code.
Getting Sta... |
Markdown | UTF-8 | 1,921 | 2.546875 | 3 | [] | no_license | ---
title: "CBioPortal and cgdsr: An Introduction"
header:
teaser: "post_teasers/cbioportal_900x450.jpg"
image: "post_teasers/cbioportal_1600x450.jpg"
categories:
- r
author: Augustin Luna
---
The [cBio Cancer Genomics Portal](http://cbioportal.org/) is an open-access resource for interactive exploration of mu... |
Java | UTF-8 | 498 | 2.4375 | 2 | [] | no_license | package state.freundin.v2;
public abstract class AbstrakteZustand implements Zustand{
protected Freundin freundin;
public AbstrakteZustand(Freundin freundin){
this.freundin = freundin;
}
@Override
public void unterhalten() {
throw new IllegalStateException();
}
@Override... |
Python | UTF-8 | 3,725 | 2.671875 | 3 | [] | no_license | import pandas as pd
import models
from models import Input, PolarityOutput
# test each aspect:
def load_polarity_data(path, aspectId):
"""
:param path:
:return:
:rtype: list of models.Input
"""
inputs = []
outputs = []
df = pd.read_csv(path)
for _, r in df.iterrows():
if ... |
Markdown | UTF-8 | 1,487 | 3.234375 | 3 | [] | no_license | # 자바의 메모리 구조 및 구성

## Data
- global, static variables가 저장되는 영역이다.
- 프로그램의 시작과 함께 할당되며, 프로그램이 종료되면 소멸한다.
## Stack
- 프로그램의 실행 과정에서 임시로 할당되는 변수(local variables)가 저장된다.
- variable이 primitive type(int, char, boolean ...)라면 실제 값이 저장된다.
- 객체라면 reference value가 저장되며, 실제 데이터는 he... |
C# | UTF-8 | 476 | 2.875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CompositionOverInheritance
{
public class Toyota : IManufacturer
{
private static IManufacturer instance;
private Toyota() { }
public string Name { get { retu... |
C# | UTF-8 | 1,850 | 2.828125 | 3 | [] | no_license | class Program
{
public delegate bool WindowEnumDelegate(IntPtr hwnd,
int lParam);
[DllImport("user32.dll")]
public static extern int EnumChildWindows(IntPtr hwnd,
... |
TypeScript | UTF-8 | 2,581 | 2.90625 | 3 | [
"MIT"
] | permissive | import { describe, expect, it } from 'vitest';
import { EventID, PublicKey } from '@/utils/Hex/Hex.ts';
describe('PublicKey', () => {
it('should convert npub bech32 to hex', () => {
const bech32 = 'npub1g53mukxnjkcmr94fhryzkqutdz2ukq4ks0gvy5af25rgmwsl4ngq43drvk';
const hex = '4523be58d395b1b196a9b8c82b038b6... |
Python | UTF-8 | 383 | 3.171875 | 3 | [] | no_license | a = 100
b = 'Male'
c = ['a','b','c']
d = (10, 20, 30, 40)
e = { 2020, 2021, 2022, 2023 }
std = {
"name" : "Somkiat Jaidee",
"age" : 25,
"major" : "Computer",
"gpa" : 2.56
}
print(a); print(type(a))
print(b); print(type(b))
print(c); print(type(c))
print(d); pr... |
Python | UTF-8 | 1,675 | 2.71875 | 3 | [] | no_license | import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
np.random.seed(101)
tf.set_random_seed(101)
learning_rate=0.02
epochs=1000
n_samples=200
train_x=np.linspace(0,50,n_samples*2).reshape(n_samples,2)
train_y=np.linspace(0,50,n_samples)
train_x... |
Python | UTF-8 | 330 | 3.671875 | 4 | [
"MIT"
] | permissive | def calculate(command, num_a, num_b):
if command == "multiply":
return num_a * num_b
elif command == "divide":
return num_a // num_b
elif command == "add":
return num_a + num_b
elif command == "subtract":
return num_a - num_b
print(calculate(input(), int(input()), int(i... |
Python | UTF-8 | 4,203 | 2.90625 | 3 | [] | no_license | import urllib2
import sqlite3
from BeautifulSoup import *
from urlparse import urljoin
from sqlite3 import dbapi2 as sqlite
# Create a list of words to ignore
ignorewords={'the':1,'of':1,'to':1,'and':1,'a':1,'in':1,'is':1,'it':1}
class crawler:
# Initialize the crawler with the name of database
def __init__(self... |
Java | UTF-8 | 359 | 1.882813 | 2 | [
"Apache-2.0"
] | permissive | package org.eno.bot.scene;
import org.treblereel.gwt.xml.mapper.api.annotation.XMLMapper;
@XMLMapper
public class Style {
private String backgroundColor;
public String getBackgroundColor() {
return backgroundColor;
}
public void setBackgroundColor(String backgroundColor) {
this.back... |
Python | UTF-8 | 1,447 | 3.3125 | 3 | [
"MIT"
] | permissive | from lxml import etree as ET
from subprocess import call
def process_news():
root = ET.parse("results/news.xml")
print("Count of images for pages:")
for page in ET.XPath("//data/page")(root):
print("(", ET.XPath("@url")(page)[0], ") : ",
int(ET.XPath("count(fragment[@type=\"image\"])... |
Java | UTF-8 | 7,212 | 2.328125 | 2 | [] | no_license | package com.test720.grasshoppercollege.module.peiYin.bean;
import java.util.List;
/**
* 佛祖保佑 永无BUG
* 佛曰:
* 程序园里程序天,程序天里程序员;
* 程序猿人写程序,又拿程序换肉钱。
* 肉饱继续桌前坐,饱暖还是桌前眠;
* 半迷半醒日复日,码上码下年复年。
* 但愿叱咤互联世,不愿搬砖码当前;
* 诸葛周瑜算世事,我算需求得加钱。
* 别人笑我忒直男,我说自己是程猿;
* 但见成都府国内,处处地地程序员。
* 作者:水东流 编于 2018/8/29
*/
public class PeiY... |
C++ | UTF-8 | 3,325 | 2.5625 | 3 | [] | no_license | #include "StdAfx.h"
#include "RunCodeProcess.h"
namespace BrainthreadIDE
{
bool RunCodeProcess::Launch()
{
if(worker->IsBusy)
return false;
this->OnStart(this, EventArgs::Empty);
processWorkContext->outputLister->AddOutputWithTimestamp(String::Format("Running {0} with args: {1}", Path::GetFileName(startI... |
Java | UTF-8 | 2,407 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | package wang.yeting.wtp.core.enums;
import lombok.Getter;
import wang.yeting.wtp.core.concurrent.ResizableCapacityLinkedBlockingDeque;
import wang.yeting.wtp.core.concurrent.ResizableCapacityLinkedBlockingQueue;
import java.util.*;
import java.util.concurrent.*;
/**
* @author : weipeng
* @date : 2020-07-25 10:35
... |
PHP | UTF-8 | 314 | 2.546875 | 3 | [] | no_license | <?php
namespace Application\Form;
class GradeForm extends HorizontalForm
{
public function __construct()
{
parent::__construct();
$this->addText('code', 'Code')
->addText('description', 'Description')
->addButton('submit', 'Add', 'btn-primary');
}
} |
Java | UTF-8 | 47 | 2.046875 | 2 | [] | no_license |
public enum ItemType {
damage,healing;
}
|
Java | UTF-8 | 331 | 2.09375 | 2 | [] | no_license | package com.herscher.cribbage.scoring;
import android.support.annotation.Nullable;
import com.herscher.cribbage.Card;
import java.util.List;
/**
* TODO add comments
*
* Implement this for all scoring types, then add to PlayScoreProcessor
*
*/
public interface PlayScorer
{
@Nullable
ScoreUnit score(List<Card>... |
Markdown | UTF-8 | 3,796 | 2.6875 | 3 | [] | no_license | 十五
爱丽丝有点畏怯地缩回紧抱著他腰背的手,动作缓慢,予人难舍难离的深切感受。
凌渡宇眼中脑际填满她诱人的神态,一对有力的手条件反射般把她反楼向自己,肉体的磨擦和紧挤,把怀中的美女弄得“嗯”的一声,全身软靠著他。
爱丽丝抬起飞红的俏面,一对美目抵受不住凌渡宇深注的眼神,眯成两线。
凌渡宇忘记了两人外的一切,重重吻上她的樱唇。
爱丽丝软弱地一声樱咛,沉醉在两性相触的世界内,像梦湖的湖水,溶流合运,内里却有激冲的暗涌。
天地在那一刻停顿下来。
车辆驶近的声音从左方的路上传来。
凌渡宇首先惊醒。
爱丽丝轻轻推开他,转过了身,高耸的胸口强烈起伏。
车辆... |
PHP | UTF-8 | 1,037 | 2.765625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace App\Repository;
use App\Entity\GuessAttempt;
use Doctrine\DBAL\Connection;
class PDOGuessAttemptRepository implements GuessAttemptRepository
{
/**
* @var Connection
*/
private $connection;
/**
* @param Connection $connection
*/
public fun... |
Java | UTF-8 | 1,191 | 2.5625 | 3 | [] | no_license | import java.util.*;
public class SensitiveDataVariable {
public String scope;
public String name;
public String shortMessage;
public String message;
public boolean memoryLocked;
public boolean valueSet;
public boolean valueCleared;
public boolean isSecure;
public boolean[] stepsApplied = new boolean... |
Python | UTF-8 | 160 | 3.625 | 4 | [] | no_license | #номер наибольшего числа из 2
x1 = int(input())
x2 = int(input())
if x2 < x1:
print(1)
elif x2 > x1:
print(2)
else:
print(0)
|
C | UTF-8 | 1,229 | 3.421875 | 3 | [] | no_license | /*
** display.c for display in /home/tran_-/Documents/rendu/PSU_2015_navy
**
** Made by Guillaume TRAN
** Login <tran_-@epitech.net>
**
** Started on Thu Dec 10 20:32:53 2015 Guillaume TRAN
** Last update Fri Dec 18 23:30:32 2015 Guillaume TRAN
*/
#include <unistd.h>
#include <stdlib.h>
#include "navy.h"
#include "... |
Python | UTF-8 | 1,152 | 4.25 | 4 | [] | no_license | # Faça um programa que receba dois inteiros x e n, com x, n > 0 e x < n, e conte
# o número de múltplos de x menores do que n.
# DICA 1: Os múltiplos de um número são obtidos multiplicando-se esse número pelos
# números naturais (1, 2, 3, 4, 5, ...)
# DICA 2: No primeiro exemplo, os múltiplos de são: 7*1, 7*2, 7*3,... |
JavaScript | UTF-8 | 1,621 | 3.109375 | 3 | [] | no_license | var mainApp = angular.module("mainApp", []);
mainApp.controller('gameController',function() {
var vm = this;
var emptyCell = '-';
vm.board = [
[{value: '-'}, {value: '-'}, {value: '-'}],
[{value: '-'}, {value: '-'}, {value: '-'}],
[{value: '-'}, {value: '-'}, {value: '-'}]
];
vm.reset = function() {
vm.c... |
C++ | UTF-8 | 310 | 2.578125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int dp_xor(int n,int start,int k){
if(k==0){
return 0;
}
if(start==n){
return start;
}
return min(start^dp_xor(n,start+1,k-1),dp_xor(n,start,k));
}
int main(){
int n,k;
cin>>n>>k;
cout<<dp_xor(n,1,k);
return 0;
} |
PHP | UTF-8 | 1,976 | 2.734375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\User;
use Illuminate\Support\Facades\Hash;
class UserController extends Controller
{
public function login(Request $request)
{
$user = User::where('username',$request->username)->first();
if ($user) {
... |
PHP | UTF-8 | 1,378 | 3.59375 | 4 | [] | no_license | <?php
//Tạo ngẫu nhiên một số nguyên a có giá trị trong khoảng [1,5] và một số nguyên btrong khoảng [10,100].
$a = rand(1,5);
$b = rand(10,100);
echo 'a = '.$a.' <br>';
echo 'b = '.$b.' <br>';
//Khai báo hằng cho số pi
define('soPI', 3.14);
switch ($a) {
case 1:
//Nếu số a là 1: Tính chu vi và diện tích của hình v... |
C# | UTF-8 | 2,520 | 3.03125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Entidades
{
public abstract class Producto
{
protected int _codigoDeBarra;
protected EMarcaProducto _marca;
protected float _precio;
publ... |
JavaScript | UTF-8 | 567 | 3.140625 | 3 | [] | no_license | /**
* @description Check url is valid
* @param {string} inputUrl - url to analyze
*/
function checkUrl(inputUrl) {
console.log('::: Running checkUrl :::', inputUrl);
const expression =
/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s... |
C | UTF-8 | 5,055 | 2.84375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /* -----------------------------------------------------------------------------
* denseSift3d.c
* -----------------------------------------------------------------------------
* Copyright (c) 2015-2016 Blaine Rister et al., see LICENSE for details.
* ---------------------------------------------------------------... |
TypeScript | UTF-8 | 2,531 | 3.390625 | 3 | [
"MIT"
] | permissive | /**
* index.ts
* Copyright (C) 2020 Editora Sanar
*
* Distributed under terms of the MIT license.
* @author Edgard Leal <edgard.leal@sanar.com>
* @module index.ts
*/
/**
* isArray
* Check if a given parameter is an valid array
*
* @author edgardleal@gmail.com
* @since 07.01.21
*/
export function isArray(p... |
Java | UTF-8 | 1,650 | 3.453125 | 3 | [] | no_license | package Commands;
import java.io.File;
import java.util.ArrayList;
import java.util.Objects;
public class CommandParser {
private final ArrayList<Command> commands; // list of commands possible
/**
* constructs CommandParser
*/
public CommandParser() {
commands = getCommands();
}
... |
Java | UTF-8 | 1,522 | 2.0625 | 2 | [] | no_license | package com.huilong.zhang.mobilesafe117.Receiver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.media.MediaPlayer;
import android.telephony.SmsMessage;
import android.util.Log;
import com.huilong.zhang.mobilesafe117.R;
import com.huilong.zhang.... |
Java | UTF-8 | 100 | 1.703125 | 2 | [] | no_license | package sk.ehr.learning.course.domain.entity;
public enum DwellingType {
//
Commute,
Boarding
} |
C++ | UTF-8 | 503 | 2.6875 | 3 | [] | no_license |
#include "Increment.hpp"
Increment::Increment()
{
}
Increment::Increment(Increment &)
{
}
Increment::~Increment()
{
}
Increment &Increment::operator=(Increment &)
{
return *this;
}
void Increment::execute(ExecutionHandler &exec)
{
unsigned char **data_ptr;
unsigned char *data_start;
data_ptr = exec.getEnvi... |
Swift | UTF-8 | 416 | 2.890625 | 3 | [] | no_license | //
// ReceiverData.swift
// Transfer
//
// Created by Rizky Saputra on 29/05/21.
//
import Foundation
public struct ReceiverData {
public var id: Int
public var name: String
public var phone: String
public var image: String
init(id: Int, name: String, phone: String, image: String) {
... |
C# | UTF-8 | 3,285 | 3.5625 | 4 | [] | no_license | using System;
using System.Collections.Generic;
public class Program
{
static void Main(string[] args)
{
var input = Console.ReadLine();
Animal type = null;
var countInputLines = 0;
var animals = new List<Animal>();
while (input != "End")
{
var c... |
Java | UTF-8 | 1,665 | 1.882813 | 2 | [] | no_license | package com.wallet.crypto.trustapp.ui.transfer.factory;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider.Factory;
import com.wallet.crypto.trustapp.interact.HandleTransactionInteract;
import com.wallet.crypto.trustapp.repository.assets.AssetsController;
import com.wallet.crypto.trustapp... |
TypeScript | UTF-8 | 1,313 | 2.53125 | 3 | [] | no_license | import { Injectable } from '@angular/core';
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@angular/router';
import { Observable } from 'rxjs';
import { AngularFireAuth } from "@angular/fire/auth";
import { Router } from "@angular/router";
import { map } from 'rxjs/operators'
import... |
Java | UTF-8 | 12,264 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2018-2021, ranke (213539@qq.com).
*
* 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 applicable... |
Markdown | UTF-8 | 3,845 | 3.703125 | 4 | [] | no_license | 目录
[TOC]
# 写在前面
日常开发中,我们经常会遇到判断数据类型的需求,简单的有判断数字还是字符串,进阶一点的有判断数组还是对象等等。
JS 用来检测数据类型的方式有:
- typeof
- instanceof
- constructor
- Object.prototype.toString.call()
# typeof
>- 语法:typeof [value]
>- 返回值:使用 typeof 检测出来的结果是一个`字符串`,比如:"number"/"string"/"boolean"/"undefined"/"object"/"function",`小写`
typeof 的 BUG:
```js
le... |
C | UTF-8 | 2,331 | 3.15625 | 3 | [
"Apache-2.0"
] | permissive | #include<stdio.h>
#include<string.h>
#include<malloc.h>
#define NULL 0
#define len sizeof(struct stu)
char s[10];
struct stu{
char name[31];
struct stu *next;
};
struct stu *ins(struct stu *head,int num,struct stu *head1){
struct stu *p1;
if(head==NULL){
head=head1;
head1->next=NULL;
... |
Python | UTF-8 | 1,209 | 3.890625 | 4 | [] | no_license | # coding=utf-8
"""
Given a singly linked list containing n nodes. Modify the value of first half nodes such that 1st node’s new value is
equal to the last node’s value minus first node’s current value, 2nd node’s new value is equal to the second last node’s
value minus 2nd node’s current value, likewise for first half ... |
Ruby | UTF-8 | 1,644 | 3.1875 | 3 | [] | no_license | #1
def pet_shop_name(pet_shop)
return pet_shop[:name]
end
#2
def total_cash(pet_shop)
return pet_shop[:admin][:total_cash]
end
#3
def add_or_remove_cash(pet_shop, sum)
pet_shop[:admin][:total_cash] += sum
end
#4
def remove_cash(pet_shop, sum)
pet_shop[:admin][:total_cash] -= sum
end
#5
def pets_sold(pet... |
JavaScript | UTF-8 | 3,395 | 2.859375 | 3 | [] | no_license | /**
* 默认xmlhttprequest请求
*/
import EventEmitter from 'events'
import { noop } from './utils'
export default class Transport extends EventEmitter {
constructor () {
super();
this.xhr = new XMLHttpRequest();
this._data = null;
this._reqHeaders = null;
}
_ajax (form) {
let headers = this._req... |
JavaScript | UTF-8 | 914 | 2.921875 | 3 | [] | no_license | const d=document;
d.addEventListener("DOMContentLoaded",e=>
{
const seleccionarDeCargo=()=>{
const $cargo=d.getElementById("id_cargo");
let xhr=new XMLHttpRequest();
const $fragment=d.createDocumentFragment();
xhr.open('GET','../php/procesar.php?numero=cargo');
xhr.onload=function(){
... |
Markdown | UTF-8 | 7,341 | 2.921875 | 3 | [] | no_license | ---
layout: post
title: 这一年:2017
category: 随想
---
忘记自己之存在而存在的人会越来越心不在焉 —— 克尔凯郭尔
这是略微纠结的一年,这是反复折叠的一年,这是貌似幸福的一年。
一切似乎都是刚刚好,无论是幸福快乐,还是悲伤痛苦。一切似乎都还不够,比如说幸福快乐,或者悲伤痛苦。我常常是一个很矛盾的人:希望能保持专注,但同时又兴趣广泛,分身乏术;希望能重情重义,但有时又难抵诱惑,心猿意马;希望能心存善良,但偶尔也会自大刻薄,心生厌恶。
这一年,工作已经进入完全的舒适区,不再有初入职场的新奇感、兴奋感和挑战感,也渐渐地对自我的成长和价值开始产生了质疑。同时面对团队成员功利性的离职、新人招募... |
JavaScript | UTF-8 | 5,507 | 3.703125 | 4 | [] | no_license | class Board {
constructor(len) {
this.len = len;
this.cells = '-'.repeat(len * len).split('');
}
canMakeMove(row, col) {
return !this.boardIsFull() && this.getCell(row, col) === '-';
}
boardIsFull() {
return !this.cells.includes('-');
}
getWinner() {
var results = [];
// Check ... |
JavaScript | UTF-8 | 139 | 2.515625 | 3 | [
"MIT"
] | permissive |
function LoopItem(){
this.isRunning;
this.update = function(elapsedTime){
}
this.stop = function(){
this.isRunning=false;
}
}
|
JavaScript | UTF-8 | 524 | 3.265625 | 3 | [] | no_license | /**
* 管道
*
* 类似组合函数,接收多个函数作为参数并返回一个新函数的方式,
*
* 新函数按照传入的参数顺序,从左往右依次执行,前一个函数的返回值是后一个函数的输入值
*
* @summary pipe :: ((x -> y), ..., (a -> b)) -> ((x, ..., a) -> b)
* @since 0.1.0
* @inner
* @function
* @param {...function} fns need pipe's function
* @return {*} pipe's result
*/
const pipe = (...fns) =>... |
Python | UTF-8 | 324 | 3.375 | 3 | [] | no_license | def is_prime(n):
if n == 1:
return False
for i in range(2,int(n**0.5)+1):
if n % i == 0:
return False
return True
def main():
X = int(input())
for i in range(X, 10**12):
if is_prime(i):
print(i)
exit()
if __name__ == "__main__":
ma... |
Java | UTF-8 | 2,726 | 2.09375 | 2 | [] | no_license | package com.youlove.service.userimpl;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;
imp... |
Java | UTF-8 | 459 | 2.03125 | 2 | [] | no_license | package com.exp.griddemo.bean;
/**
* 作者: gmh by Administrator on 2019/5/29.
* 邮箱:gmh.com@qq.com
*/
public class TitleOneData extends DataModel {
private String detailsTitle;
public TitleOneData(String detailsTitle) {
this.detailsTitle = detailsTitle;
}
public String getDetailsTitle() {
... |
Markdown | UTF-8 | 1,153 | 3.109375 | 3 | [] | no_license | # Compiladores
# Português
Este repositório contém o projeto de um complador para a linguagem de programação K.night. O compilador foi inicialmente desenvolvido em Python, posteriormente será desenvolvido também em C/C++. Até o momento apenas o lexer (escrito em Python) está pronto.
O projeto se encontra na pasta Co... |
Ruby | UTF-8 | 766 | 2.84375 | 3 | [] | no_license | # The graphql-client is a really good library to consume Graphql APIs in Ruby.
# https://github.com/github/graphql-client
# You can execute a mutation the same way as if it was a regular query passing the variables you want to use:
# cerner_2^5_2018
require 'graphql/client'
require 'graphql/client/http'
module Api
... |
C | UTF-8 | 5,950 | 3.484375 | 3 | [] | no_license | //
// List.h
// List
//
// Created by Nicolas Nascimento on 5/16/16.
// Copyright © 2016 LastLeaf. All rights reserved.
//
#ifndef List_h
#define List_h
#include <stdio.h>
#include <stdlib.h>
/// The function that tells wheter and object is equal to another
typedef int(*comparatorFunction)(const void*,const void... |
Python | UTF-8 | 2,982 | 2.625 | 3 | [] | no_license | import sqlite3, pygal, json
from functools import wraps
from flask import Flask, flash, redirect, render_template, request, session, url_for, g
from forms import AddCompanyForm
app = Flask(__name__)
app.config.from_object('_config')
def connect_db():
return sqlite3.connect(app.config['DATABASE_PATH'])
def __init... |
PHP | UTF-8 | 37,081 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
spl_autoload_register(function ($classname) {require ( $classname . ".php");});
/**
* A class for core example reSlim project
*
* @package Core reSlim
* @author M ABD AZIZ ALFIAN <github.com/aalfiann>
* @copyright Copyright (c) 2016 M ABD AZIZ ALFIAN
* @license ht... |
Python | UTF-8 | 4,754 | 3.125 | 3 | [] | no_license | import BT
Confirmed_type = {"notConfirmed" : 1,"ConfirmedEmpty" : 2,"ConfirmedBlocked" : 3}
class CSP():
#Initialize grid knowledge and Constraint solver
def __init__(self, grid):
self.grid = grid
self.all_constraint_equations = []
self.empty_node_variables = []
self.... |
Java | UTF-8 | 385 | 3.125 | 3 | [] | no_license |
public class Palindrome {
public static void main(String[] args) {
int sum,n,d1,d2,d3;
n=876;
d1=n%100%10*100;
d2=n%100/10*10;
d3=n/100*1;
sum=d1+d2+d3;
if(sum==n)
System.out.println("Given no. is Palindrome");
else
... |
Markdown | UTF-8 | 1,851 | 2.5625 | 3 | [
"MIT"
] | permissive | # docker-machine-zsh-completion
A more functional and up-to-date zsh completion for docker-machine
This has been merged in [docker-machine](https://github.com/docker/machine), but clone this repo to your completion path maybe a good way to easily keep it up-to-date.
## Installing Command Completion
### Manual instal... |
Python | UTF-8 | 393 | 3.875 | 4 | [] | no_license | text = "aabBcde"
def duplicate_count(text):
new_list = []
counter = 0
already_counted = []
for char in text:
if char.lower() not in new_list:
new_list.append(char)
else:
if char.lower() not in already_counted:
counter += 1
already... |
Markdown | UTF-8 | 980 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | # weex-vue-navigator
weex-vue-navigator makes weex able to use SPA at web side, and use multi-page jumping at native side
## Install
```
npm i weex-vue-navigator --save-dev
# or
yarn add weex-vue-navigator --dev
```
## Configuration
```js
import Vue from 'vue'
import Router from 'vue-router'
import weexNavigator f... |
JavaScript | UTF-8 | 528 | 3.46875 | 3 | [] | no_license | // https://leetcode-cn.com/problems/linked-list-cycle/
/**
* 环形列表
* 1. 暴力:遍历链表 hash/set
* 2. 双指针:快慢指针
*/
// 类似龟兔赛跑,一个快指针 一个慢指针 如果链表中有环的话 就会出现套圈的情况
function hasCycle(head) {
if (head == null || head.next == null) return false
let slow = head,
fast = head.next
while(slow != fast){
if(fast == null |... |
Java | UTF-8 | 1,875 | 3.375 | 3 | [] | no_license | package array;
import java.util.*;
/**
* Created by home on 10/28/2020.
*/
public class TestSolution1 {
public static void main(String args[]){
String input = "abcdzedcba"; //-> abcdzdcba aabbccdd "abbacacdaad"
String result = amethod(input);
System.out.println(... |
Java | UTF-8 | 900 | 2.328125 | 2 | [] | no_license | /**
* @nopublish
* User: 贺扬
* Date: 2005-5-24
* Time: 16:08:25
* ${NAME}类的说明
*/
package awin.dao.persistence.type;
import java.io.InputStream;
import java.io.Reader;
abstract public class SQLTypeFactory {
public static SQLParamType getNullType(int type) {
return new NullParamType(type);
}
publ... |
Java | UTF-8 | 1,970 | 1.9375 | 2 | [] | no_license | package com.br.collection.entity.vo;
import java.util.Date;
import com.br.collection.entity.CaseInfo;
public class CaseInfoExtendCollectionVO extends CaseInfo {
private static final long serialVersionUID = 1L;
private Integer companyId;
private String companyName;
private Integer caseId;
private String debt... |
Python | UTF-8 | 653 | 3.015625 | 3 | [] | no_license | #!/usr/bin/python3
def result2steps(r, graph, good):
if r in graph:
good.add(graph[r][0])
for nr in graph[r][1]:
result2steps(nr, graph, good)
def filter_tasks(tasks, result):
graph = {}
for task in tasks:
for o in task[2]:
graph[o] = (task[0], task[1])
good = set()
for r in result:
result2steps... |
JavaScript | UTF-8 | 2,430 | 2.625 | 3 | [] | no_license | const botconfig = require('./botconfig.json');
const Discord = require('discord.js');
const bot = new Discord.Client({ disableEveryone: true })
bot.on('ready', async () => {
console.log(`${bot.user.username} is online!`);
while (true) {
bot.user.setActivity('Chris buy a gun...', { type: 3 })
... |
C++ | UTF-8 | 339 | 3.046875 | 3 | [] | no_license | #ifndef SPIN_LOCK_H
#define SPIN_LOCK_H
#include<atomic>
namespace PUF{
class SpinLock{
private:
std::atomic_flag flag = ATOMIC_FLAG_INIT;
public:
void lock(){
while(flag.test_and_set(std::memory_order_acquire)){}
}
void unLock(){
flag.clear(std::memory_order_release);
}
};
}//n... |
JavaScript | UTF-8 | 1,229 | 2.5625 | 3 | [] | no_license | import React from 'react';
import {Button} from 'react-bootstrap';
class AddReviews extends React.Component {
constructor(props) {
super(props);
this.state = {
title: '',
reviews: ''
}
this.add=this.add.bind(this);
this.updateTitle=this.updateTitle.bind(this);
this.updateReviews=this.updateR... |
Python | UTF-8 | 959 | 4.84375 | 5 | [] | no_license | # Experiment with scopes in Python.
# Good reading: https://www.programiz.com/python-programming/global-local-nonlocal-variables
# When you use a variable in a function, it's local in scope to the function.
x = 12
def change_x():
# In order to use a global variable inside a function,
# you've got to "import"... |
Python | UTF-8 | 3,377 | 3.328125 | 3 | [] | no_license | import requests
import time
import base64
import ecdsa
def wallet():
response = None
while response not in ["1","2","3","4"]:
response = input(""" What do you want to do?
1) Generate Waller
2) Send Coins to another Wallet
3) Check transactions
4) Quit\n""")
if response == "1":
print(""... |
Markdown | UTF-8 | 4,679 | 3.140625 | 3 | [] | no_license | # **Scripting (weight: 30%)**
## **What version control systems have you used? Why use version control?**
I have used CVS back in the day,and currently use both SVN and Git in my current job. We use version control so that we can conduct many different types and levels of devleopment activities, including:
- Track... |
JavaScript | UTF-8 | 267 | 3.734375 | 4 | [] | no_license | // string
let name = " phoenix";
console.log("my name is "+ name);
// object literals
let stmarks = {
phoenix : 99,
Rohan : 79,
harry: 80,
}
console.log(typeof stmarks);
console.log(stmarks);
// funcions
function names(){
}
console.log(typeof names);
|
Python | UTF-8 | 1,613 | 3.90625 | 4 | [] | no_license | class Node:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
class BST:
def __init__(self):
self.root = None
def insert(self, current, value):
if self.root is None:
self.root = Node(value)
else:
if cur... |
Python | UTF-8 | 775 | 3.453125 | 3 | [] | no_license | # 763. Partition Labels
# greedy sol - time complexity - O(n)
# space complexity O(n)=O(1) because input only consist of a to z, only extra space for mapping 26 letters
#e.g. "ababcbacadefegdehijhklij" ->"ababcbaca", "defegde", "hijhklij" ->Output: [9,7,8]
# watch where a is. idx where a last occurs is m['a']=9. the la... |
C | UTF-8 | 514 | 3.078125 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#define NAME_LEN 64
struct student {
char name[NAME_LEN];
int height;
float weight;
long schols;
};
int main(void)
{
struct student sanaka;
strcyp(sanaka.name, "Sanaka");
sanaka.height = 175;
sanaka.weight = 62.5;
sanaka.schols = 73000... |
Java | UTF-8 | 3,940 | 1.820313 | 2 | [
"BSD-3-Clause"
] | permissive | /*******************************************************************************
* Copyright (c) 2016 AT&T Intellectual Property. All rights reserved.
*******************************************************************************/
package com.att.dao.aaf.cass;
import java.io.ByteArrayOutputStream;
import java... |
JavaScript | UTF-8 | 168,020 | 2.515625 | 3 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | /*
This file is part of Cytoscape Web.
Copyright (c) 2009, The Cytoscape Consortium (www.cytoscape.org)
The Cytoscape Consortium is:
- Agilent Technologies
- Institut Pasteur
- Institute for Systems Biology
- Memorial Sloan-Kettering Cancer Center
- National Center for Integrative Biomedical ... |
PHP | UTF-8 | 1,794 | 2.703125 | 3 | [] | no_license | <?php
session_start();
function envoyerValeur(){
try{
$serveur = $_SESSION['serveur'];
$loginBDD = $_SESSION['loginBDD'];
$password = $_SESSION['password'];
$database = $_SESSION['database'];
$connexion = new PDO("mysql:host=$serveur;dbname=$database",$loginBDD,$password);
$connexion -> se... |
Markdown | UTF-8 | 2,405 | 2.875 | 3 | [
"BSD-3-Clause",
"CC-BY-SA-4.0",
"LicenseRef-scancode-free-unknown",
"CC-BY-4.0",
"MIT"
] | permissive | ---
id: 587d7fb3367417b2b2512bfb
title: 'How to Use package.json, the Core of Any Node.js Project or npm Package'
localeTitle: 'Cómo usar package.json, el núcleo de cualquier proyecto Node.js o paquete npm'
challengeType: 2
---
## Description
<section id='description'>
El archivo package.json es el centro de cualquie... |
C | UTF-8 | 1,263 | 3.65625 | 4 | [] | no_license | #include <studio.h>
int main(void)
{
float num1,
num2;
char oper;
do{
printf("\t\tCalculadora da Ale\n\n");
printf("Operacoes disponiveis\n");
printf("'+' : soma\n");
printf("'-' : subtracao\n");
printf("'*' : multiplicacao\n");
printf("'/' : divisao\n");
printf("'%%' : resto da divisao... |
Python | UTF-8 | 347 | 3.578125 | 4 | [] | no_license | # https://www.acmicpc.net/problem/2417
# 올림 함수인 ceil을 쓰기 위해 import 합니다.
from math import ceil
# 첫째 줄에 정수 n을 입력합니다.
# 0 <= n < 2^63
n = int(input())
# q^2 >= n인 가장 작은 음이 아닌 정수 q를 저장하는 변수를 선언합니다.
q = ceil(n ** 0.5)
# q를 출력합니다.
print(q) |
Python | UTF-8 | 917 | 2.53125 | 3 | [] | no_license | import numpy as np
import sys
import freenect
import cv2
import os
import signal
import time
def handler(signum, frame):
print "Timed Out"
exit(2)
raise Exception("timeout")
print "Initialisation"
# time.sleep(5)
signal.signal(signal.SIGALRM, handler)
i = 0
while True:
signal.alarm(2)
try :
... |
Markdown | UTF-8 | 1,284 | 3 | 3 | [] | no_license | # EoDP Assignment 2 Data Server
A basic server to fetch and store data
## Usage
```python
import requests
import json
import pandas as pd
id = 'exampleid'
server = '0.0.0.0'
# get original data with dataset id, replace server to our server ip
res = requests.get(f"http://{server}:5000/datasets/original/{id})
data = re... |
PHP | UTF-8 | 1,735 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace spec\Fitbug\SymfonySerializer\YamlEncoderDecoder;
use PhpSpec\ObjectBehavior;
class YamlEncodeSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType('Fitbug\SymfonySerializer\YamlEncoderDecoder\YamlEncode');
}
function it_is_a_encoder()
{
... |
TypeScript | UTF-8 | 3,291 | 2.75 | 3 | [] | no_license | import { isEmpty } from "../utils/objectUtils";
import { Status } from "../utils/declarations";
const Joi = require("joi");
const { Author } = require("../models/Author");
const authorSchema = Joi.object({
author_id: Joi.number().integer(),
first_name: Joi.string().min(1).max(50).required(),
last_name: Joi.stri... |
Python | UTF-8 | 3,091 | 2.671875 | 3 | [] | no_license | from bs4 import BeautifulSoup
from tqdm import tqdm
import pandas as pd
from html import unescape
from exploration import get_citances_for_file
if __name__ == "__main__":
valid = ["C00-2123", "C04-1089", "I05-5011", "J96-3004", "N06-2049", "P05-1004", "P05-1053", "P98-1046"]
folder = "./data/Training-Set-2019... |
Java | UTF-8 | 4,449 | 2.15625 | 2 | [
"Apache-2.0"
] | permissive | /**
* Copyright (C) 2017 Red Hat, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or... |
Python | UTF-8 | 728 | 3.234375 | 3 | [] | no_license | # GAP algorithm
import math
def merge(a,n,b,m):
total = m + n
gap = math.ceil(total / 2)
while gap>0:
i = 0
j = i+gap
while j<(m+n):
if i<n and j<n:
if a[j]<a[i]:
a[i], a[j] = a[j], a[i]
elif i>=n and j>=n:
... |
Markdown | UTF-8 | 2,262 | 3.265625 | 3 | [] | no_license | ---
layout: post
title: Weighing the Pros and Cons of Working Remotely
date: 2023-06-16 10:00:00
tags:
- Transaction Management
hidden: false
excerpt: What you need to know before transitioning to a work-from-home setup.
enclosure:
pullquote: >-
Whether or not you're a good fit for working from home depends on your... |
JavaScript | UTF-8 | 515 | 2.546875 | 3 | [] | no_license | const jwt = require('jsonwebtoken');
const config = require('config');
module.exports = function(req, res, next) {
//Conseguir el OTken dle Header
const token = req.header('x-auth-token');
//Checar si no es el token
if (!token) {
return res.status(401).json({ msg: 'No estas autorizado perro' });
}
try... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.