language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Python | UTF-8 | 81 | 3.140625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
A = int(input('请输入十进制数字:'))
print(hex(A)) |
Python | UTF-8 | 2,249 | 4.28125 | 4 | [] | no_license | def menu():
print("---------\nMAIN MENU\n---------\n"
"1. Isi List\n"
"2. Lihat List\n"
"3. Sort List Ascending\n"
"4. Sort List Descending\n"
"5. Nilai Tertinggi dan Terendah\n"
"6. Jumlah Ganjil dan Genap\n"
"7. Ulang\n"
"8. Keluar\n")
#
#
#
storage = []
def isi... |
PHP | UTF-8 | 823 | 2.546875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: p2
* Date: 6/10/14
* Time: 1:46 AM
*/
namespace Main\Entity\View;
/**
* @Entity
* @Table(name="q_dru")
*/
class QDru extends BaseEntity {
/**
* @Id
* @Column(type="integer")
*/
protected $vn_id;
/**
* @Column(type="string")
*/
p... |
Python | UTF-8 | 1,362 | 2.625 | 3 | [] | no_license | #!/usr/bin/env python
#
# Print the label volumes from all labels a folder
#
# label_vols <dir> [<dir> ...]
#
import sys
import os
import os.path
import glob
import subprocess
import StringIO
def execute(command, input = "", dry_run = False, stdout = 2):
"""Spins off a subprocess to run the cgiven command"""
... |
Markdown | UTF-8 | 1,068 | 2.96875 | 3 | [
"MIT"
] | permissive | ---
title: Mushroom (picture) hunting in loblolly forest in Gainesville.
description: perfect weather.
date: 2020-11-17
tags:
- mushroom hunting
layout: layouts/post.njk
---
This was my first real walk in the woods since taking the auto train down to Florida.
I don't know exactly what I was expecting--but despite ... |
Markdown | UTF-8 | 2,740 | 3.109375 | 3 | [] | no_license | # Channel your inner Jason Bay: How to be productive on a new Team #
## by Ashish Dixit ##
### Abstract ###
You've landed a great opportunity to work with some of the smartest people in the industry. You can barely contain the enthusiasm to learn and contribute to the team. You may not have all the required technica... |
Java | UTF-8 | 3,271 | 2.4375 | 2 | [] | no_license | package domain;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persiste... |
Java | UTF-8 | 2,936 | 2.015625 | 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 com.parentabc.service.impl;
import com.parentabc.dto.BasePageQueryReq;
import com.parentabc.dto.BasePaginationResult;
... |
Markdown | UTF-8 | 5,870 | 2.65625 | 3 | [] | no_license | # Alokai
## Summary:
* A young apprentice engineer discovers an artifact that grants him magical abilities and journeys to the center of the Empire to deliver a warning about impending magical armageddon.
## Motivation:
* wants to find his place within greater whole
* admires well-constructed things (buildings, cr... |
Java | UTF-8 | 5,367 | 2.015625 | 2 | [] | no_license | package com.wk.platform.batch;
import com.wk.bean.Batch;
import com.wk.bean.BatchItem;
import com.wk.common.constant.Const;
import com.wk.common.util.TimeUtil;
import com.wk.common.vo.PageList;
import com.wk.common.vo.Result;
import com.wk.commonservice.service.CommonService;
import com.wk.commonservice.service.SeqSer... |
TypeScript | UTF-8 | 1,590 | 2.8125 | 3 | [] | no_license | import { Option, WeightedValue } from "./index";
import { getGroups } from "./utils";
import path from "path";
interface TableEntry {
w: number,
options: Option[]
}
interface Tables {
[name: string]: TableEntry
}
const tables = {} as Tables;
function importAll(r: any) {
r.keys().forEach((key: string) => {
... |
Java | UTF-8 | 1,312 | 2.078125 | 2 | [] | no_license | package com.cabletech.troublemanage.beans;
import com.cabletech.commons.base.*;
public class AccidentDetailBean extends BaseBean{
private String id;
private String accidentid;
private String corecode;
private String tempfixedtime;
private String fixedtime;
private String diachronic;
public... |
C++ | UTF-8 | 946 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <math.h>
#define MAXN 30
using namespace std;
int n;
int rs[MAXN];
int arr[MAXN];
bool vis[MAXN];
bool is_ss(int x) {
if(0==x || 1==x) return false;
int t = sqrt(x);
for(int i=2; i<=t; i++) {
if(x%i == 0) return false;
}
return true;
}
void dfs(int x) {
if(... |
C# | UTF-8 | 1,227 | 2.71875 | 3 | [
"MIT"
] | permissive | #region Usings
using System;
using System.Globalization;
using NUnit.Framework;
#endregion
namespace Extend.Testing
{
[TestFixture]
public partial class DateTimeExTest
{
[Test]
public void ToLongDateStringTest()
{
var dateTime = DateTime.Now;
var expected ... |
Ruby | UTF-8 | 554 | 3.390625 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | # My Code here....
def map_to_negativize(source_array)
source_array.map {|s| s * -1 }
end
def map_to_no_change(source_array)
source_array
end
def map_to_double(source_array)
source_array.map {|s| s * 2}
end
def map_to_square(source_array)
source_array.map {|s| s * s}
end
def reduce_to_total(s... |
Java | UTF-8 | 4,151 | 2.359375 | 2 | [] | no_license | package repository;
import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;
import model.UserViewModel;
import org.hibernate.Session;
import org.hibernate.Transaction;
import utils.Hibernate;
import javax.persistence.TypedQuery;
import javax.persistence.criteria.CriteriaBuilder;
import javax.p... |
Java | UTF-8 | 1,635 | 2.25 | 2 | [] | no_license | package com.rocket.sivico.Adapters;
import android.graphics.Color;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.rocket.sivico.Data.Report;
import ... |
Shell | UTF-8 | 317 | 2.578125 | 3 | [] | no_license | #!/bin/bash
source functions.sh
build_project
start_server $1 $2
wait_till_started $1
simulate_network_partition $2
sleep 10s
printf "\nInvoking /health endpoint after N/W partition...\n"
curl http://localhost:$1/actuator/health
kill -9 $pid_java >> $log_file
fix_simulated_network_partition
printf "\nDONE!\n"
|
Python | UTF-8 | 506 | 3.125 | 3 | [] | no_license | import random
quantity = int(input('Сколько сгенерировать файлов: '))
for i in range(quantity):
width = random.randint(1, 15)
height = random.randint(1, 15)
_list = []
for h in range(height):
output_string = ''
for w in range(width):
output_string += str(random.randint(0,... |
C# | UTF-8 | 952 | 2.6875 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController:MonoBehaviour
{
[SerializeField]
private GameObject uno;
[SerializeField]
private GameObject dos;
[SerializeField]
private GameObject tres;
[SerializeField]
private GameObj... |
Python | UTF-8 | 1,217 | 2.78125 | 3 | [] | no_license | import turtle as tu
door = [
['set', (20,0)],
['rt', -90],
['fd', 40],
['rt', 90],
['fd', 40],
['rt', 90],
['fd', 40],
]
wall = [
['set', (20,0)],
['sh', 180],
['fd', 20],
['rt', 90],
['fd', 80],
['rt', 90],
['fd', 80],
['rt', 90],
['fd', 80],
['rt',... |
Markdown | UTF-8 | 1,762 | 3.109375 | 3 | [] | no_license | Q:
.JPG)
나의 솔루션:
```python
class Solution:
def numIslands(self, grid: List[List[str]]) -> int:
def is_valid(x, y):
if 0 <= x < len(grid) and 0 <= y < len(grid[i]):
return True
else:
return False
... |
Python | UTF-8 | 1,823 | 2.6875 | 3 | [
"MIT"
] | permissive | import numpy as np
node_name_to_index = dict()
node_index_to_att = dict()
node_index_to_class = dict()
label_to_class = dict()
index = 0
class_label = 0
content_file = open('./citeseer.content', "r").readlines()
for line in content_file:
vector = [x for x in line.strip('\n').split('\t')]
if not label_to_class.... |
C++ | UTF-8 | 1,523 | 3.1875 | 3 | [] | no_license | #include <iostream>
#include <stdint.h>
#include <vector>
#include <deque>
#include <sstream>
#include <cstdlib>
#include <string>
#include <math.h>
std::string PrimeCalculate(uint64_t input);
uint64_t StrToUint64_t(std::string input);
int main(){
std::string a = "90090";
std::string b = "56473";
s... |
C++ | UTF-8 | 1,232 | 2.84375 | 3 | [] | no_license | /*
* ADC.cpp
*
* Created on: 17 Aug 2019
* Author: Connor
*/
#include "ADC.h";
void ADC_Init() {
//Set all analogue ports to inputs
DDRC = 0x00;
//ADC Enable
ADCSRA |= (1 << ADEN);
//ADC Frequency
ADCSRA |= (1 << ADPS0);
ADCSRA |= (1 << ADPS1);
ADCSRA |= (1 << ADPS2);
// AREF... |
C++ | UTF-8 | 9,680 | 3.140625 | 3 | [] | no_license | /*! Chris Miller (cmiller@fsdev.net), CS116
*! Copyright (C) 2009 FSDEV. Aw richts pitten by.
*! Academic endorsement. This code is not licensed for commercial use.
*! 20091003, Ch. 10 Asgn
*/
#include <iostream>
#include <fstream>
#include <vector>
#include <exception>
#include <stdexcept>
#include <string>
#in... |
Python | UTF-8 | 6,222 | 3.234375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Fri May 18 11:50:26 2018
@author: Chloe
"""
def getPoints(bboxes):
""" Gets the points of the bounding boxes for detected instances
Parameters
----------
bboxes : numpy array
array containing points corresponding to bounding box
... |
Markdown | UTF-8 | 1,777 | 2.796875 | 3 | [
"MIT"
] | permissive | # Digitial_Adders
This repository contains the project done on Parameterized Carry Look-ahead/Ripple Adders as a part of the CAD for VLSI Systems(CS6230) course at IIT Madras. This Repo contains code to Generate CLA & CRA in verilog from HLL
# How to run the code?
* run the follow command to generate the N-bit CLA... |
Ruby | UTF-8 | 224 | 3 | 3 | [] | no_license | old_syntax_hash = {:name => "Bob"}
new_hash = {name: "Bob"}
person = {height: "6 ft.", weight: "165 lbs."}
person = {hair: "Brown"}
person = {age: 62}
person.delete(:age)
person [:weight]
person.merge!(new_hash)
|
Python | UTF-8 | 362 | 3.640625 | 4 | [] | no_license | from itertools import repeat
from operator import index
def task_3(str_, list_index):
return list(map(get_char, repeat(str_), list_index)) # to do operator index and list comprehension
def get_char(str_, index):
return str_[index]
if __name__ == '__main__':
string_ = "Всем привет"
list_ = [1, 3, 5]... |
Java | UTF-8 | 712 | 3.984375 | 4 | [] | no_license | import java.util.Scanner;
public class SwitchEx {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
System.out.println("Please enter a number between 1 and 7: ");
int userNum = scnr.nextInt();
switch (userNum) {
case 1:
System.out.println("You entered 1.");
break;
c... |
TypeScript | UTF-8 | 1,314 | 2.890625 | 3 | [] | no_license | import { FieldLabel } from "./FieldLabel";
import { FieldType } from "./EFieldType";
import { Field } from "./IField";
export class EmailField implements Field {
name: string;
label: FieldLabel;
type: FieldType.inputEmail;
value: string;
id: number = new Date().getTime();
constructor(name: stri... |
TypeScript | UTF-8 | 2,161 | 3.265625 | 3 | [
"MIT"
] | permissive | import { NamedParameterizedQuery } from "./NamedParameterizedQuery";
import { SQLParam } from "./SQLParam";
/**
* Parse a prepared statement to a query that is supported by node/mysql.
*/
export class BakedQuery {
private _sql: string;
private _dictionary: Map<number, string> = new Map<number, string>();
... |
Java | UTF-8 | 1,677 | 2.28125 | 2 | [] | no_license | package janjagruti.learning.com.janjagruti.entity;
import com.google.gson.annotations.SerializedName;
import java.util.Date;
public class UserPackage {
private int id;
private User user;
@SerializedName("package")
private Package aPackage;
private Date validityStart;
private Date validityEn... |
Java | UTF-8 | 376 | 1.703125 | 2 | [] | no_license | package antlr.debug;
import java.util.EventListener;
public abstract interface ListenerBase extends EventListener
{
public abstract void doneParsing(TraceEvent paramTraceEvent);
public abstract void refresh();
}
/* Location: C:\Users\ESa10969\Desktop\PDFComparer\
* Qualified Name: ant... |
Java | UTF-8 | 884 | 2.25 | 2 | [] | no_license | package com.techburg.autospring.service.abstr;
import java.util.List;
import com.techburg.autospring.model.business.Workspace;
import com.techburg.autospring.model.query.WorkspacePersistenceQuery;
public interface IWorkspacePersistenceService {
/**
* Store the workspace
*
* @param workspace
* @param isSync... |
Markdown | UTF-8 | 2,615 | 2.546875 | 3 | [] | no_license | # linux 网络相关
### 命令总览
- 网络配置: ifconfig、 ip
- 连通性探测: ping、 traceroute、 telnet、 mtr
- 网络连接: netstat、 ss、 nc、 lsof
- 流量统计: ifstat、 sar、 iftop
- 交换与路由: arp、 arping、 vconfig、 route
- 防火墙: iptables、 ipset
- 域名: host、 nslookup、 dig、 whois
- 抓包: tcpdump
- 虚拟设备: tunctl、 brctl、 ovs
#### ifconfig
```bash
ifconfig eth0 # 查看网卡信... |
C++ | UTF-8 | 2,104 | 3.21875 | 3 | [] | no_license | #include <cmath>
#include "space_object.h"
SpaceObject::SpaceObject(Vector2 pos, Vector2 vel, float scale, float rot)
: m_pos(pos), m_vel(vel), m_scale(scale), m_rot(rot) {}
void SpaceObject::drawObject(Display &display) {
int width = display.getWidth();
int height = display.getHeight();
int half_width =... |
Python | UTF-8 | 2,169 | 2.765625 | 3 | [] | no_license | """
============================
Author:小白31
Time:2020/8/12 23:10
E-mail:1359239107@qq.com
============================
"""
# 2、选做题:尝试(请求头使用X-Lemonban-Media-Type":"lemonban.v2),
# 去请求需要鉴权的充值接口(提示:要先登录,提取token,按接口文档要求加上token才能通过鉴权)
import requests
from jsonpath import jsonpath
class test_api2():
# 域名
url = 'h... |
Java | UTF-8 | 1,665 | 2.203125 | 2 | [] | no_license | package com.liangchen.myutil;
import com.liangchen.POJO.Notify;
import com.liangchen.POJO.NotifyList;
import com.liangchen.Service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.concurrent.CopyOnWri... |
Python | UTF-8 | 2,889 | 2.890625 | 3 | [] | no_license | '''
Two methods to determine some exoplanet properties using radial velocity measurements.
'''
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
# number of steps
n_fit = 10000
t = np.array([3791.7441, 3793.6623, 3793.7635, 3794.7132, 3794.8735, 3853.5400, 3853.5753, 3854.4... |
Markdown | UTF-8 | 3,191 | 2.5625 | 3 | [
"MIT"
] | permissive | # Energy Budget Constraints on the Time History of Aerosol Forcing and Climate Sensitivity
This code demonstrates how we can use constraints of observed surface warming from 1850-2019 and ocean heat update from 1971-2018 to constrain historical aerosol forcing, equilibrium climate sensitivity and transient climate resp... |
Java | UTF-8 | 1,435 | 3.3125 | 3 | [] | no_license | package j2eebp.security;
import java.security.*;
/**
* Principals represent Subject identities. They implement the
* java.security.Principal interface (which predates JAAS) and
* java.io.Serializable. A Subject's most important method is getName(), which
* returns an identity's string name. Since a Subject instan... |
C | UTF-8 | 1,145 | 3.609375 | 4 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
void linear(int[],int,int);
void binary(int a[],int k,int n);
void sort(int a[],int n);
void main()
{
int a[30],n,k,c;
printf("enter the limit:");
scanf("%d",&n);
printf("enter the elements");
for(int i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
printf("enter the element to be searched:");
s... |
Swift | UTF-8 | 1,358 | 2.765625 | 3 | [] | no_license | //
// AppointmentCategory.swift
// appointment
//
// Created by Raluca Mesterca on 19/03/2020.
// Copyright © 2020 DTT. All rights reserved.
//
import Foundation
import UIKit
enum AppointmentCategory: String, Codable {
case business
case standard
case group
case memo = "MEMO"
case unknown
... |
C++ | UTF-8 | 1,275 | 2.625 | 3 | [] | no_license | #ifndef ACTIONJUDGETTSANDVIEWPARALLEL_H
#define ACTIONJUDGETTSANDVIEWPARALLEL_H
#include <thread>
#include "Action.h"
class ActionJudgeTTSAndViewParallel : public Action
{
public:
ActionJudgeTTSAndViewParallel(std::string audioType
, std::string audioFilePath, int audioTimeout
, std::strin... |
Markdown | UTF-8 | 3,413 | 3.453125 | 3 | [
"MIT"
] | permissive | # Docker Images
- Each docker image is made of multiple layers and each layer is just another docker image.
- The very first layer is called the *base layer*.
- The layers in an image can be viewed using ```docker history imagename:tag``` command.
- When we create a container from an image we create a new *writable... |
C# | UTF-8 | 695 | 2.640625 | 3 | [] | no_license | using System;
using UnityEngine;
namespace AreaOfAres.UI.DataTypes
{
[Serializable]
public class UIBool
{
[SerializeField] private string _text;
[SerializeField] private bool _flag;
public string Text { get { return _text; } private set { _text = value; } }
public bool Flag... |
Java | UTF-8 | 271 | 2.234375 | 2 | [
"MIT"
] | permissive | package com.hz.design.facade;
/**
* 内存
*
* Created by hezhao on 2018-08-09 15:32
*/
public class Memory {
public void start() {
System.out.println("启动内存");
}
public void stop() {
System.out.println("关闭内存");
}
}
|
Swift | UTF-8 | 2,192 | 2.859375 | 3 | [] | no_license | //
// SignUPViewController.swift
// LetsWork
//
// Created by Isaac Kim on 27/10/2018.
// Copyright © 2018 Isaac Kim. All rights reserved.
//
import UIKit
struct UserInfo {
var id: String
var pw: String
var email: String
let firstName : String
let lastName: String
}
class SignUPViewContr... |
Go | UTF-8 | 10,189 | 3.125 | 3 | [
"MIT"
] | permissive | package gorefactor
import (
"fmt"
"github.com/dave/dst"
"github.com/stretchr/testify/assert"
"go/token"
"testing"
)
func TestHasStmtInsideFuncBody(t *testing.T) {
t.Run("basic", func(t *testing.T) {
var src = `
package main
import "fmt"
func B() {
c := 1
}
func main() {
a := 1
b := 1
... |
Markdown | UTF-8 | 6,996 | 2.59375 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: Speech by Senior Minister of State for Trade & Industry and Education S Iswaran at the 6th LNGA 2011 Conference, 1 March 2011
subtitle: 1 Mar 2011
permalink: /media/speeches/speech-by-senior-minister-of-state-for-trade-industry-and-education-s-iswaran-at-the-6th-lnga-2011-conference-1-march-2011... |
PHP | UTF-8 | 1,444 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace Task;
/*
* This file is part of sample Task command package.
*
* (c) Piotr Plenik <piotr.plenik@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Configuration class
*
* @author Piotr Plenik <... |
Java | UTF-8 | 257 | 1.851563 | 2 | [] | no_license | package com.example.filip.gpstracker.ui.login.view;
/**
* Created by Filip on 08/03/2016.
*/
public interface LoginView {
void onSuccessfulLogin(String username);
void onFailedLogin();
void showProgressBar();
void hideProgressBar();
}
|
TypeScript | UTF-8 | 1,072 | 2.53125 | 3 | [] | no_license | import { Component, OnInit } from '@angular/core';
import { RegisterModel } from '../models/register.model';
import { AuthenticationService } from '../auth.service';
@Component({
selector: 'app-register-form',
templateUrl: './register-form.component.html',
styleUrls: ['./register-form.component.css']
})
export c... |
C++ | UTF-8 | 4,129 | 2.59375 | 3 | [] | no_license | /*
Copyright (c) 2016-2020, Elias Aebi
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the followin... |
Markdown | UTF-8 | 3,727 | 3.1875 | 3 | [] | no_license | ---
layout: post
title: "The spiral of refinement"
date: 2023-08-26 12:00:00 -0400
description: "Like a spiral, drawing closer but never reaching the center, creative work involves iteration and refinement."
tags: [Craft]
maturity: scribble
reading_time: 2 min
---
<p class="dropCap">I repeat myself a lot. For insta... |
C# | UTF-8 | 1,145 | 2.53125 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "New Inventory", menuName = "Inventory System/Inventory")]
public class InventoryObject : ScriptableObject
{
public List<InventorySlot> inventorySlots = new List<InventorySlot>();
public void A... |
Markdown | UTF-8 | 1,593 | 3.203125 | 3 | [] | no_license | ## git配置
### git配置文件位置
1. ```/etc/gitconfig```文件. 包含系统上每一个用户及他们仓库的通用配置. 如果在执行 git config 时带上 ```--system``` 选项,那么它就会读写该文件中的配置变量
2. ```~/.gitconfig``` 或 ```~/.config/git/config``` 文件. 只针对当前用户。 你可以传递 ```--global``` 选项让 Git 读写此文件,这会对你系统上 所有 的仓库生效
3. 当前使用仓库的 Git 目录中的 config 文件(即 .git/config). 针对该仓库。 你可以传递 --local 选项让 Git ... |
C++ | UTF-8 | 2,217 | 2.75 | 3 | [] | no_license |
#ifndef LIBDL_HELPER_H
#define LIBDL_HELPER_H
#include <iostream>
#include "../src/Tensor.h"
using namespace Catch::literals;
template<std::int64_t N>
auto makeTensor(const std::int64_t (&dimensions)[N], bool requiresGrad = true) {
std::array<std::int64_t, N> d;
std::copy_n(std::begin(dimensions), N, std::b... |
C | UTF-8 | 2,244 | 3.703125 | 4 | [] | no_license | /*Yugraj Singh
*Shuffle.c
*Main program that performs the permutations
*/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include "List.h"
#define MAX_LEN 300
/*shuffle
*Pre: takes to ListRef
*Pos: shuffles the list L by the permutations listed in List P
*/
void shuffle(ListRef L, ListRef P){
int ind... |
Python | UTF-8 | 2,382 | 3.484375 | 3 | [] | no_license | from typing import List
from collections import deque
# 투포인터 문제
class Solution:
def trap(self, height: List[int]) -> int:
if not height:
return 0
volume = 0
left, right = 0, len(height) - 1
left_max, right_max = height[left], height[right]
while left < right:
... |
Java | UTF-8 | 6,906 | 2.875 | 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 com.sg.dvdlibrary.ui;
import com.sg.dvdlibrary.dto.DVD;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author ... |
Python | UTF-8 | 2,817 | 2.734375 | 3 | [] | no_license | from django import template # 导入包
# 创建注册器 变量名必须为register
register = template.Library()
@register.inclusion_tag('page.html')
def page(total_num, current_num, url_prefix, page_max_num=9):
'''
total_num 总页数
current_num 当前页数
url_prefix 链接前缀
page_max_num 展示页数(默认展示9页)
'''
# ... |
PHP | UTF-8 | 846 | 2.890625 | 3 | [] | no_license | <?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace MagentoDevBox\Library;
/**
* Class for communication with database
*/
class Db
{
/**
* @var \PDO[]
*/
private static $connections;
/**
* Get connection to database
*
... |
Java | UTF-8 | 1,652 | 2.359375 | 2 | [] | no_license | package com.anmis.anmis.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import com.anmis.anmis.activity.ClickEnentManager;
import com.anmis.anmis.util.Utils;
/**
* Created by niushuowen on ... |
Markdown | UTF-8 | 3,503 | 2.984375 | 3 | [
"CC-BY-4.0",
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | [^1]: Patent text contain patent, [**NPL**](./vocabulary#non-patent-literature-npl), software, database, product, etc citations and NPL citations contain bibliographical references, office actions, search reports, patents, webpages, norms & standards, product documentations, databases and litigations.
[^2]: Bibliograph... |
Python | UTF-8 | 169 | 2.53125 | 3 | [
"MIT"
] | permissive |
class ConditionalFormatting(object):
def __init__(self):
self.ranges = {}
self.priority = 0
def add(self, range_string, rule):
pass
|
Go | UTF-8 | 1,514 | 2.546875 | 3 | [] | no_license | package callbacks
import (
"strings"
f "../functions"
utils "../utils"
"github.com/bwmarrin/discordgo"
)
var (
commChan = make(chan string)
recording = false
)
// OnMessage will be executed every time the discord session will receive a message
func OnMessage(s *discordgo.Session, m *discordgo.MessageCreate) ... |
Markdown | UTF-8 | 922 | 2.8125 | 3 | [] | no_license | # PrepHoops Backend Challenge
## Overview
This exercise will have the candidate build a simple API which will generate JSON data used to populate the nav of the PrepHoops Frontend Challenge.
## Deliverables
- A forked version of this repo with an attached MySQL database file with the database structure and conten... |
Python | UTF-8 | 1,009 | 2.6875 | 3 | [] | no_license | #!/usr/bin/python
import os.path
import re
import argparse
from subprocess import Popen, PIPE, STDOUT
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="")
parser.add_argument('-f', '--file', help="File to parse")
args = parser.parse_args()
if (args.file != None):
first... |
Python | UTF-8 | 1,774 | 2.578125 | 3 | [
"MIT"
] | permissive | from gensim.models.doc2vec import Doc2Vec, TaggedDocument
import pandas as pd
from nltk.tokenize import word_tokenize
import random
random.seed(42)
true_dataset = pd.read_csv("../dataset/preprocessed_true.csv")
true_dataset.dropna(axis=0, how='any', inplace=True)
fake_dataset = pd.read_csv("../dataset/prep... |
Java | UTF-8 | 926 | 2.515625 | 3 | [] | no_license | package SeleniumAssignments;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import io.github.bonigarcia.wdm.WebDriverManager;
public class LinkTextAssi {
public static void main(Stri... |
Java | UTF-8 | 346 | 1.65625 | 2 | [] | no_license | package cl.bennu.plcbus.core.persistence.iface;
import cl.bennu.plcbus.common.domain.MovementActionDetail;
/**
* Created with IntelliJ IDEA.
* User: _Camilo
* Date: 08-07-13
* Time: 08:49 AM
*/
public interface IMovementActionDetailDAO extends IBaseDAO<MovementActionDetail> {
void deleteByMovementActionId(L... |
C++ | UTF-8 | 607 | 2.703125 | 3 | [] | no_license | #pragma once
class Moon : public Renderer
{
public:
Moon(Shader* shader);
~Moon();
void Update();
void Render(float theta);
Texture* GetMoonTexture(){ return moon; }
Texture* GetMoonGlowTexture() { return moonGlow; }
float& GetDistance() { return distance; }
float& GetGlowDistance () { return glowDistance; ... |
Java | UTF-8 | 2,947 | 2.15625 | 2 | [] | no_license | package com.sbsa.benchmark.solaceclient;
import java.util.concurrent.ConcurrentHashMap;
import com.sbsa.benchmark.Consumer;
import com.sbsa.benchmark.DeliveryMode;
import com.sbsa.benchmark.EndPointType;
import com.sbsa.benchmark.Endpoint;
import com.sbsa.benchmark.Factory;
import com.sbsa.benchmark.Monitor;... |
C++ | UTF-8 | 2,162 | 2.59375 | 3 | [] | no_license | #include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <Windows.h>
#include<io.h>
#include<iostream>
#include<vector>
#include <fstream>
#include <sstream>
#include <iterator>
#include <string>
#include "EnumFiles.h"
#include <cassert>
using namespace std;
#define MAX_PATH 1024
vector<stri... |
Java | UTF-8 | 1,876 | 3.140625 | 3 | [] | no_license | package com.tanmay.calculator;
import java.util.HashSet;
import java.util.Set;
public class CalculatorContext {
private String text;
private boolean isCustom = false;
private String effectiveString;
private String delimiter;
public CalculatorContext(String text) {
this.text = text;
... |
Java | UTF-8 | 20,161 | 2.703125 | 3 | [] | no_license | package gapp.ulg.game.util;
import gapp.ulg.game.GameFactory;
import gapp.ulg.game.PlayerFactory;
import gapp.ulg.game.board.GameRuler;
import gapp.ulg.game.board.Move;
import gapp.ulg.game.board.Player;
import gapp.ulg.games.GameFactories;
import gapp.ulg.play.PlayerFactories;
import static gapp.ulg.game.util.Player... |
Ruby | UTF-8 | 2,585 | 2.8125 | 3 | [
"MIT"
] | permissive | require "money"
require File.expand_path(File.join(File.dirname(__FILE__), 'has_money', 'validators'))
# Helper methods for ActiveRecord models which can be used to easily define money and
# currency attributes using +money+ library.
#
#---
# TODO DRY it up
#+++
module HasMoney
def has_currency(attr, options = {})
... |
C# | UTF-8 | 1,724 | 2.71875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DRMFSS.BLL.Services
{
public class HubService : IHubService
{
private readonly IUnitOfWork _unitOfWork;
public HubService(IUnitOfWork unitOfWork)
{
this._unitOfWork = unitOfWo... |
C# | UTF-8 | 1,226 | 3.125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using Fsd.Kamil.Cs.Ex2.Animals;
using Fsd.Kamil.Cs.Ex2.Views;
namespace Fsd.Kamil.Cs.Ex2
{
public class AnimalsProvider
{
private IAnimalReader _reader;
public AnimalsProvider(IAnimalReader reader)
{
_reader = reader;
... |
Java | UTF-8 | 1,153 | 2.4375 | 2 | [] | no_license | package com.salavizadeh.notepad.data;
import android.provider.BaseColumns;
import static com.salavizadeh.notepad.data.NotesContract.NoteTable.CREATED_AT;
import static com.salavizadeh.notepad.data.NotesContract.NoteTable._TABLE_NAME;
public final class NotesContract {
private NotesContract() {}
public stati... |
C# | UTF-8 | 632 | 2.515625 | 3 | [
"MIT"
] | permissive | using UnityEngine;
using System.Collections;
namespace SimpleSceneDescription
{
public class SSDDomeLight : SSDLight
{
private Texture2D texture;
public SSDDomeLight(Light light)
: base(light)
{
LightAdapter adapter = light.GetComponent<LightAdapter>();
... |
SQL | UTF-8 | 270 | 2.734375 | 3 | [] | no_license | -- Create the database burgers_db and specified it for use.
CREATE DATABASE burgers_db;
USE burgers_db;
-- Create the table plans.
CREATE TABLE burgers
(
id int NOT NULL AUTO_INCREMENT,
burger_name varchar(200) NOT NULL,
devoured BOOL DEFAULT false,
PRIMARY KEY (id)
); |
Python | UTF-8 | 5,456 | 3.046875 | 3 | [] | no_license | #Python 2.7
#psutil is an external package, install it before running the program
import copy as cp
import time
import os
import psutil
import sys
'''
Uncomment if want the script to install psutil package
try:
import psutil # for computing memory usage
except ImportError: # try to install requests module if no... |
Markdown | UTF-8 | 3,357 | 2.515625 | 3 | [] | no_license | +++
title = "[방구석 영화제]캐쉬백 Cashback"
date = "2007-09-30T14:04:00+0900"
categories = ["일상사"]
tags = ["캐쉬백","cashback"]
description = ""
+++
<span class="copyright_entry" style="display:block;" title="[방구석 영화제]캐쉬백 Cashback@@**@@http://shed.egloos.com/1636062"></span>영국영화 Cashback 입니다.
<br>
<br>네. 'OK 캐시백'이 떠오르네요.
<br>
<br... |
C# | UTF-8 | 5,306 | 2.765625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using IxMilia.Dxf;
using IxMilia.Dxf.Entities;
namespace DxfLib
{
public class DxfToJsonConverter
{
private DxfFile _dxfFile;
public NumberFormatInfo Format { get; } = new NumberFormatInfo {NumberDe... |
Markdown | UTF-8 | 3,395 | 2.625 | 3 | [] | no_license | I'm very happy to announce a new release of the [Yesod Web Framework](http://hackage.haskell.org/package/yesod). This release is accompanied by version bumps in [Persistent](http://hackage.haskell.org/package/persistent) and [yesod-auth](http://hackage.haskell.org/package/yesod-auth), as well as a massive reorganizatio... |
Java | UTF-8 | 1,117 | 1.625 | 2 | [] | no_license |
package com.cn.smart.baselib.share.core.error;
public class CarSmartShareStatusCode {
public static final int ST_CODE_SUCCESSED = 200;
public static final int ST_CODE_ERROR_CANCEL = 201;
public static final int ST_CODE_ERROR = 202;
public static final int ST_CODE_SHARE_ERROR_NOT_CONFIG = -233;//没有配置... |
Java | UTF-8 | 951 | 2.90625 | 3 | [] | no_license | package BSTfromPreIn;
public class BSTfromPreIn {
public TreeNode buildTree(int[] preorder, int[] inorder) {
int preStart=0;
int preEnd=preorder.length-1;
int inStart=0;
int inEnd=inorder.length-1;
return buildTree(preorder,preStart,preEnd,inorder,inStart,inEnd);
}
publ... |
JavaScript | UTF-8 | 14,572 | 3 | 3 | [
"MIT"
] | permissive | console.log("hi");
const connect4 = {
// |--> connect4.row7[0].pos
// | |--> connect4.row7[0].piece
row7: [{pos:'7a', piece: null}, {pos:'7b', piece: null}, {pos:'7c', piece: null}, {pos:'7d', piece: null}, {pos:'7e', piece: null}, {pos:'7f', piece: null}],
row6: [{pos:'6a', piece:... |
PHP | UTF-8 | 8,285 | 2.59375 | 3 | [] | no_license | <?php
//valido a sessão do usuário
include_once '../estrutura/controle/validarSessao.php';
include_once '../funcaoPHP/function_letraMaiscula.php';
include_once '../funcaoPHP/funcaoData.php';
//verifico se a página está sendo chamada pelo méthod POST
// Se sim executa escript
// Senao dispara Erro
if ($_SERVE... |
Java | UTF-8 | 237 | 1.585938 | 2 | [] | no_license | package com.test720.grasshoppercollege.module.userData.geRenZiLiao;
/**
* Created by 水东流 on 2018/4/9.
*/
public class HeaderFragment extends BaseHeaderFragment {
@Override
public int type() {
return 1;
}
}
|
Java | UTF-8 | 1,284 | 1.96875 | 2 | [] | no_license | package powercraft.core.item;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiCrafting;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import powercraft.ap... |
Markdown | UTF-8 | 733 | 3.34375 | 3 | [
"Apache-2.0"
] | permissive | # backlog.txt
_backlog.txt_ is a format (and an associated command-line tool) to store a project backlog in a text file.
* It's **simple**: you can mantain a _backlog.txt_ with a tool, but you can also use a plain old text editor.
* It's **powerful**: _backlog.txt_ is a [Markdown](http://daringfireball.net/projects/m... |
Java | UTF-8 | 489 | 2.765625 | 3 | [] | no_license | import java.util.Set;
public class word_break {
public boolean wordBreak(String s, Set<String> dict) {
int len = s.length();
boolean[] arrays = new boolean[len+1];
arrays[0] = true;
for(int i=1;i<=len;i++){
for(int j=0;j<i;j++){
if(arrays[j] && dict.cont... |
Java | UTF-8 | 2,824 | 2.765625 | 3 | [] | no_license | import java.io.IOException;
import java.util.Iterator;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.map... |
Java | ISO-8859-2 | 5,334 | 2.6875 | 3 | [] | no_license | /**
*
*/
package Server;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.nio.ByteBuffer;
import javax.imageio.ImageIO;
/**
* @author Sebas... |
JavaScript | UTF-8 | 2,079 | 2.734375 | 3 | [
"MIT"
] | permissive |
function showLoginForm(){
$('#loginModal .registerBox').fadeOut('fast',function(){
$('.loginBox').fadeIn('fast');
$('.register-footer').fadeOut('fast',function(){
$('.login-footer').fadeIn('fast');
});
$('.modal-title').html('Login with');
});
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.