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 |
|---|---|---|---|---|---|---|---|
SQL | UTF-8 | 5,480 | 2.609375 | 3 | [] | no_license | -- dml/532.sql
-- script changes from change pond
-- Making Existing Entries false; let me know if you wish this to be deleted.
update reportassessmentprogram set activeflag=false;
-- Insert scripts for given combinations.
Select * from reportassessmentprogram_fn('KAP','GEN_ST','ELA','VIEW_GENERAL_STUDENT_REPORT');
S... |
C++ | UTF-8 | 1,444 | 3.265625 | 3 | [] | no_license | #include <util/string.h>
#include <catch/catch.hpp>
TEST_CASE("split", "[string]") {
SECTION("zero") {
CHECK(util::split("", ',') == std::vector<std::string>{ "" });
CHECK(util::split(" ", ',') == std::vector<std::string>{ " " });
CHECK(util::split("a", ',') == std::vector<std::string>{ "a... |
Java | UTF-8 | 351 | 2.1875 | 2 | [] | no_license | package bean;
import org.jgrapht.graph.DefaultWeightedEdge;
import javax.xml.bind.annotation.XmlElement;
public class Edge extends DefaultWeightedEdge{
private Flight flight;
@XmlElement
public Flight getFlight()
{
return flight;
}
public void setFlight(Flight flight)
{
... |
Java | UTF-8 | 1,943 | 2.0625 | 2 | [] | no_license | package com.cess.clinica.model;
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.JoinColumn;
import javax.persistence.ManyToOne;
import ... |
Python | UTF-8 | 3,131 | 3.359375 | 3 | [] | no_license | # defender.py
# mg 2013
#
# look - think - behave
import rg
class Brain:
# Empty actions dict
actions = {}
# Constructor
# initialize the actions dict
# set the instance variables
# copy down the game and the robot's parameters
def __init__(self, r, g):
self.actions = {'move': True,
'guard'... |
Java | UTF-8 | 927 | 3.578125 | 4 | [] | no_license | package com.omisoft.basic_java.Threads.practice;
public class Bank {
public void doTransaction(Transaction transaction)
{
int balance;
switch(transaction.getType())
{
case CREDIT:
synchronized(transaction.getAccount())
{
balance = transaction.getAccount().getBalance();
}
try
{
Thread.... |
JavaScript | UTF-8 | 4,189 | 2.734375 | 3 | [] | no_license | import React, {Component} from "react";
import { BrowserRouter as Router, Route } from "react-router-dom";
import Home from './components/Home';
import UserProfile from './components/UserProfile';
import LogIn from './components/LogIn';
import Debit from './components/Debit';
import Credit from './components/Credit';
i... |
Python | UTF-8 | 810 | 2.65625 | 3 | [] | no_license | import requests
from urllib.parse import urlparse
keyword = '광운대학교'
url = "https://openapi.naver.com/v1/search/blog?query="+keyword
result = requests.get(urlparse(url).geturl(),
headers={"X-Naver-Client-Id":"Q92Fl0iqHMCMyN2hekCT",
"X-Naver-Client-Secret":"3vcCxHfNO4"})
# print(result... |
Java | UTF-8 | 621 | 3.53125 | 4 | [] | no_license | package com.dsr.sortParatice;
public class InsertSort {
public static void main(String[] args) {
int[] arr=new int[]{5,7,4,6,1,3,8,5,6};
insertSort(arr);
for(int i=0;i<arr.length;i++){
System.out.println(arr[i]);
}
}
public static void insertSort(int[] arr){
... |
SQL | UTF-8 | 50,936 | 2.65625 | 3 | [] | no_license |
drop table if exists `media172`;
drop table if exists `media152`;
drop table if exists `media153`;
drop table if exists `media154`;
drop table if exists `media155`;
drop table if exists `media156`;
drop table if exists `media157`;
drop table if exists `media158`;
drop table if exists `media159`;
drop table if exists `... |
C++ | UTF-8 | 9,722 | 3.09375 | 3 | [
"MIT",
"BSD-2-Clause"
] | permissive | /**
* Interfaces for SDC/MLSDC/PFASST algorithms.
*
* @file pfasst/interfaces.hpp
* @since v0.1.0
*/
#ifndef _PFASST_INTERFACES_HPP_
#define _PFASST_INTERFACES_HPP_
#include <memory>
#include <stdexcept>
#include <string>
using namespace std;
namespace pfasst
{
using time_precision = double;
/**
* Not ... |
Java | UTF-8 | 357 | 2.796875 | 3 | [] | no_license | package whiz.filtering;
import java.util.stream.IntStream;
/**
* Created by yevgeniya.zuyeva on 15.02.2017.
*/
public class Tester2 {
public static void main(String[] args) {
IntStream ints = IntStream.range(1, 3);
ints.forEach(System.out::print);
ints.forEach(i ->System.out.p... |
JavaScript | UTF-8 | 7,574 | 3.375 | 3 | [] | no_license | /*
Free Code Camp - Build a Pomodoro Clock
Created by Patrick Burns
TODO: Create Countdown Clock
DONE: Set
DONE: Start
DONE: Tick
DONE: Reset
TODO: Basic UI
DONE: Current time display
DONE: Work/Rest Time Set Value Inputs/buttons
DONE: Set/Start/Reset button
TODO: Build Pomodoro Clock (2... |
PHP | UTF-8 | 1,013 | 3.625 | 4 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: hovsep
* Date: 16.01.19
* Time: 14:05
*/
namespace ArraysAndStrings;
/**
* Question 1.3
*
* URLify: Write a method to replace all spaces in a string with '%20'. You may assume that the string
* has sufficient space at the end to hold the additional characters, and tha... |
SQL | UHC | 426 | 3.453125 | 3 | [] | no_license | create table student03(
num number primary key,
name varchar2(9),
age number(2) check (age between 1 and 80)
);
create sequence stu03_seq start with 21001;
--num,name,age
create table grade03(
num number primary key,
kor number(3) default 0, -- Է ϸ ڵ 0
eng number(3) default 0,
math number(3) default 0,... |
JavaScript | UTF-8 | 1,483 | 2.984375 | 3 | [] | no_license | import _ from 'underscore'
import utils from './utils/index'
import Glass from './components/glass'
const cacehCanvas = utils.getCacheCanvas(500, 500);
const cacheContext = utils.getContext(cacehCanvas);
const context = utils.getContext('#canvas');
let range = 0.01;
const gap = 20;
const glasses=getGlasses(gap,500);
... |
C | UTF-8 | 2,493 | 2.6875 | 3 | [] | no_license | #include "dfs_mem_allocator.h"
#include "dfs_shmem_allocator.h"
#include "dfs_mempool_allocator.h"
dfs_mem_allocator_t *dfs_mem_allocator_new(int allocator_type)
{
dfs_mem_allocator_t *allocator = NULL;
allocator = (dfs_mem_allocator_t *)malloc(sizeof(dfs_mem_allocator_t));
if (!allocator)
{
re... |
Python | UTF-8 | 4,344 | 2.609375 | 3 | [] | no_license | from socket import *
server = "127.0.0.1"
serverPort = 25
#cria socket
socketClient = socket(AF_INET, SOCK_DGRAM)
usuarios = input("Digite o arquivo de usuarios a ser lido: ")
socketClient.sendto(usuarios.encode(), (server, serverPort))
msgUsers, addr = socketClient.recvfrom(2048)
msgUser = msgUsers.decode("UTF-8")
... |
Java | UTF-8 | 1,059 | 2.15625 | 2 | [] | no_license | package controller;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import entity.UserEn... |
Shell | UTF-8 | 4,673 | 3.734375 | 4 | [
"Apache-2.0"
] | permissive | #!/bin/bash
# Apache License 2.0
# Copyright 2016 Random Archer
# This file is part of https://github.com/random-archer/nspawn.sh
# import source once
___="source_${BASH_SOURCE//[![:alnum:]]/_}" ; [[ ${!___-} ]] && return 0 || eval "declare -gr $___=@" ;
#!
#
# systemd unit.nspawn and unit.service file generator
#
#... |
Swift | UTF-8 | 351 | 2.578125 | 3 | [] | no_license | //
// Dragable.swift
// Htlaeh
//
// Created by Cody Weaver on 7/2/16.
// Copyright © 2016 Htlaeh. All rights reserved.
//
import Foundation
import UIKit
/**
Anything that can swipe or be dragged
Replacement for UIPanGesture
*/
protocol Draggable {
var dragAction: (Int) -> () { get }
var dragF... |
Python | UTF-8 | 945 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | import requests
from bs4 import BeautifulSoup
import os
import pprint
import sys
inp = str(sys.argv[1])
f = open(inp)
soup = BeautifulSoup(f.read(),"lxml")
table = soup.find_all("div",{"id":"\\\"issue_types\\\""})
table = BeautifulSoup(str(table),"lxml")
data = table.find_all("table")
categories = []
catFile = ope... |
JavaScript | UTF-8 | 2,299 | 2.875 | 3 | [
"BSD-2-Clause"
] | permissive | const hospital = location.href.substring(8, location.href.indexOf('.'));
const patientId = sessionStorage.getItem('patient_id');
const dataToSend = {};
dataToSend.patient_id = patientId;
dataToSend.hospital = hospital;
init();
async function init() {
const patientInfo = await executeAction('get_patient');
for (l... |
Java | UTF-8 | 1,228 | 2.15625 | 2 | [] | no_license | /* Generated By:JJTree: Do not edit this line. ASTTerm.java Version 6.0 */
/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
public
class ASTTerm extends SimpleNode {
private String op = "+";
private... |
Markdown | UTF-8 | 4,774 | 2.671875 | 3 | [] | no_license |
* [首頁](README.md)
<!-- 了解babel -->
- 了解 Babel
- [Babel 定義和作用](babel/README)
- [ES 版本列表](es6/es-version)
<!-- ES6常用語法 -->
- ES6 常用語法
- [let 和 const 用法](es6/let-const)
- [模組化(module)](es6/es-module)
- [解構賦值](es6/object-array)
- [對象拓展](es6/object)
- [模板字串](es6/string)
- [拓展運算符](es6/Spread-opera... |
Java | UTF-8 | 1,002 | 2.171875 | 2 | [] | no_license | package com.una.app.placefinder506;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
import java.util.List;
/**
* Created by
* Angélica
* Bryhan
* Marco
* Massiel Mora Rodríguez cedula: 604190071
*/
public class Leg {
@SerializedName(... |
C++ | UTF-8 | 540 | 3.046875 | 3 | [] | no_license | class Solution {
private:
int square(int n)
{
int res=0;
while(n!=0)
{
res=res+(n%10)*(n%10);
n=n/10;
}
return res;
}
public:
bool isHappy(int n) {
if(n==1)
return true;
unordered_set<int> myset;
while(n!... |
Markdown | UTF-8 | 8,551 | 2.5625 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | > *The following text is extracted and transformed from the ucpress.edu privacy policy that was archived on 2019-10-23. Please check the [original snapshot on the Wayback Machine](https://web.archive.org/web/20191023161752id_/https%3A//www.ucpress.edu/about/privacy-policy) for the most accurate reproduction.*
# Privac... |
Shell | UTF-8 | 1,809 | 3.5625 | 4 | [] | no_license | #! /bin/sh
set -eux
function commitChangedPoms() {
POMS=$(find . -name pom.xml -not -path '*/target/*')
if [ $(git status -s $POMS|grep -vc '^??') -gt 0 ]; then
git commit -m "$1" $POMS
git push
fi
}
if [ $(git branch | grep '^*' | cut -c 2-) = 'master' ]; then
echo 'Performing mainlin... |
Markdown | UTF-8 | 3,706 | 4 | 4 | [
"Apache-2.0"
] | permissive | ## 判断一棵二叉树是否是平衡二叉树
【**平衡二叉树概念**】当二叉树的任意一棵子树的左子树的高度和右子树的高度相差不超过 1 时,该二叉树为平衡二叉树。
【**解答方案**】根据定义可知,要确认一个二叉树是否是平衡二叉树势必要遍历所有结点。
即将问题分解为:只要保证以每个结点为根节点的树是否平衡;而遍历到每个结点时,要想知道以该结点为根结点的子树是否是平衡二叉树,首先判断该结点的左子树是否平衡,然后判断该结点的右子树是否平衡,如果两个子树都平衡,分别计算左子树和右子树的高度。因此我们要收集两个信息:
- 该结点的左子树、右子树是否是平衡二叉树
- 左右子树的高度分别是多少,相差是否超过 1
那么我们来到某个结点时(子... |
Ruby | UTF-8 | 316 | 2.6875 | 3 | [
"MIT"
] | permissive | class Url
attr_accessor :key_request
def initialize(key_request = 'developer+remote')
@key_request = key_request
end
def requested_url
"https://www.indeed.com/jobs?q=#{key_word_filter(@key_request)}&l="
end
private
def key_word_filter(key)
key.downcase!
key.sub(' ', '+')
end
end
|
Markdown | UTF-8 | 2,311 | 3.703125 | 4 | [] | no_license | # Вывести односвязный список
[importance 5]
[Односвязный список](http://ru.wikipedia.org/wiki/Связный_список) -- это структура данных, которая состоит из *элементов*, каждый из которых хранит ссылку на следующий. Последний элемент может не иметь ссылки, либо она равна `null`.
Например, объект ниже задаёт односвязный... |
Java | UTF-8 | 589 | 2.578125 | 3 | [
"MIT"
] | permissive | package com.example.communityhero;
public class Message {
private String text;
private MemberData memberData;
private boolean belongsToCurrentUser;
public Message(String text, MemberData data, boolean belongsToCurrentUser) {
this.text = text;
this.memberData = data;
this.belong... |
JavaScript | UTF-8 | 4,864 | 3.75 | 4 | [] | no_license | /*
* TP 1 - IFT1015
* Auteurs:
* Mael Le Petit (matricule),
* Fannie Filion Bienvenue (20104125)
*
* Ce programme permet de modifier une image selon differents paramètres :
* la mettre en noir et blanc, augmenté ou réduire la clarté, appliquer un
* filtre "flou" et détecter les contours
*/
let canvas = document.... |
Markdown | UTF-8 | 908 | 3.359375 | 3 | [
"BSD-2-Clause"
] | permissive | ### Envato Tuts+ Course: Optimize Your Website Without AMP
#### Instructor: [Kezz Bracey](https://tutsplus.com/authors/kezz-bracey)
AMP is Google’s collection of plug-and-play code that helps optimize sites to load and run faster. It works, however its use is controversial and there are many good reasons you might con... |
Java | UTF-8 | 908 | 3.84375 | 4 | [] | no_license | package BitProblems;
import java.util.BitSet;
/**
* Class to identify the duplicates in an int[] and in a string
* @author pramothinidk
*
*/
public class BitsetExample {
BitSet bs = new BitSet(10);
BitSet bsChar = new BitSet(52);
public void findDuplicate(int[] a){
for(int i=0; i<a.length ; i++)
if(!bs.g... |
C++ | UTF-8 | 2,248 | 2.953125 | 3 | [] | no_license | /*
Problem : APAC 2016 University Test : Round C : Problem B : gFiles
Link : http://code.google.com/codejam/contest/4284487/dashboard#s=p1
Author : Utsav Chokshi
Date : 01/09/2016
*/
/***********************************************************************
Logic :
Let P = percentage
K = number of files
... |
JavaScript | UTF-8 | 1,652 | 2.53125 | 3 | [] | no_license | const Discord = require("discord.js");
module.exports.run = async (client, message, args) => {
const moddingJSON = require("../storage/modding.json");
if (!args[0]) {
message.channel.send(
`Learning to Mod? Check out the Modding Guide and FAQ! \nOur Modding Guide is at https://modding.melodicalbuild.me \n... |
Python | UTF-8 | 1,174 | 2.8125 | 3 | [] | no_license | from servicios import *
import json, pprint
# 1 es inicio de sesion
# 2 es nueva orden
# 3 es nueva promocion
def cola(sdata):
data_cruda = json.loads(sdata)
tipo_transaccion = data_cruda['tipo']
data_real = data_cruda['data']
if tipo_transaccion == 1:
# es inicio de sesion
respue... |
C++ | UTF-8 | 1,555 | 3.234375 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#define MAX 20
typedef enum { FALSE, TRUE } BOOL;
char board[MAX][MAX]; // 알파벳 저장 보드
int check[26]; // 방문한 알파벳 체크 배열
int dx[] = { 0, 0, 1, -1 };
int dy[] = { 1, -1, 0, 0 };
int row, col;
int dfs(int x, int y); // 문자의 개수를 세기 위한 깊이우선탐색(DFS) 하는 재귀함수
int main() {
int i, j;
int tc, ti;
freopen(... |
PHP | UTF-8 | 176 | 2.8125 | 3 | [
"MIT"
] | permissive | <?php
//define ('Test','This is a test!');
//echo TEST . PHP_EOL;
//echo Test . PHP_EOL;
$fruit= array("grapes","apple","cherry");
//var_dump($fruit);
echo $fruit[2][3]; |
JavaScript | UTF-8 | 668 | 3.5625 | 4 | [] | no_license | // http://www.codewars.com/kata/5376343a003bf6e034000c56/train/javascript
var checkDistance = function(point1, point2){
return Math.sqrt(Math.pow((point1[0] - point2[0]), 2) + Math.pow((point1[1] - point2[1]), 2));
}
// Calculate a pair of closest points
function closestPair( points ){
var currClose;
for (var i... |
Java | UTF-8 | 917 | 2.1875 | 2 | [] | no_license | package com.myspringproject.university.controller;
import com.myspringproject.university.domain.model.StudentDto;
import com.myspringproject.university.service.StudentService;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mock... |
PHP | UTF-8 | 444 | 2.59375 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: Snxt
* Date: 2018/5/8
* Time: 15:24
*/
include_once "MyDB.php";
$db = new MyDB();
$sql = "select * from pages";
$result = $db->query($sql);
$response = array();
while (($row = $result->fetch_assoc()) !== null) {
$page = array(
"id"=>$row["id"],
"path"... |
JavaScript | UTF-8 | 1,274 | 2.953125 | 3 | [
"MIT"
] | permissive | // ----------------------------------------------------------------------
// LearnWords 2
//
// File:
// LWcsvString2JSON.js
//
// Purpose:
// Converts a CSV string
// to an array of objects
//
// Date:
// 1st February 2017
//
// ----------------------------------------------------------------------
var Pa... |
C++ | UTF-8 | 1,387 | 2.609375 | 3 | [] | no_license | #pragma once
#include "DynamicObject.h"
class spr_Player;
class Player : public DynamicObject
{
public:
Player();
~Player();
void Init(float x, float y);
void UpdateBegin();
void Update();
void UpdateEnd();
void Draw();
void Kill();
void Destroy();
void Collided(GameObject *other);
float GetGravity() ... |
Python | UTF-8 | 774 | 3.90625 | 4 | [] | no_license | '''
Функции
'''
def dictUpdate(a):
a.update([("x",5)])
print("dict in function: ",a)
return
def dictNoUpdate(a):
a = a.copy()
a.update([("y",3)])
print("dict in function: ",a)
return
def returnFunc(a):
def f1(a):
print("returned f1(a): ",a)
return f1
d= {"v":7}
dictUpdate(d)
... |
PHP | UTF-8 | 476 | 3.46875 | 3 | [] | no_license | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Sort an Array</title>
</head>
<body>
<?php
$num... |
JavaScript | UTF-8 | 1,787 | 2.78125 | 3 | [] | no_license | const service = require("../models/consultasMensajes")
class Producto {
constructor() {
this.productos = [];
}
getId() {
return this.productos.length + 1;
}
async guardar(producto) {
let id = await service.guardar(producto);
return await service.listarIndividual(id[0])
}
async listar... |
C | UTF-8 | 485 | 3.140625 | 3 | [
"Apache-2.0"
] | permissive | #include <stdio.h>
#include <stdlib.h> // atoi
#define A 1103515256
#define B 12345
#define C 65536
#define D 32768
unsigned long int next = 1;
int myrand() {
next = A * next + B;
return (unsigned int)(next / C) % D;
}
void mysrand(unsigned int seed) {
next = seed;
return;
}
int main(int argc, char** args) {... |
Markdown | UTF-8 | 6,739 | 2.84375 | 3 | [] | no_license | # 《TCP/IP详解卷一:协议》学习笔记一
### 一、分层
1、网络协议通常分不同层次进行开发,每一层分别负责不同的通信功能。
2、TCP/IP通常被认为是一个四层协议系统:

1)、链路层,有时候也被称作数据链路层或... |
Shell | UTF-8 | 483 | 3.015625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env bats
readonly ARTIFACT_DIR="openponk"
@test "master build has been deployed" {
mkdir -p $ARTIFACT_DIR
echo "image" > $ARTIFACT_DIR/openponk.image
echo "changes" > $ARTIFACT_DIR/openponk.changes
export CI_JOB_ID=0
export CI_COMMIT_REF_NAME=master
export ARTIFACT_DIR
run ../deploy.sh
echo $output... |
PHP | UTF-8 | 3,941 | 2.8125 | 3 | [
"MIT"
] | permissive | <?php
/**
* Author: Amir Hossein Jahani | iAmir.net
* Last modified: 1/8/21, 9:58 AM
* Copyright (c) 2021. Powered by iamir.net
*/
function _getDistanceGeo($c1, $c2, $opt_radius = 6371008.8)
{
$radius = $opt_radius;
$lat1 = deg2rad($c1[1]);
$lat2 = deg2rad($c2[1]);
$deltaLatBy2 = ($lat2 - $lat1) ... |
Markdown | UTF-8 | 222 | 2.921875 | 3 | [] | no_license | ### MISC-C (To-be-organized)
- Cannot change variable's type unless cast it to a new variable whose type is desired.
``` c
int *yp, *xp;
*(char *)yp = *((char *)xp + 1);
//*yp is still a integer pointer, so is *xp
```
|
Shell | UTF-8 | 1,430 | 3.625 | 4 | [] | no_license | #!/bin/bash
DIR="$(dirname "$(readlink -f "$0")")"
source $DIR/../conf/cluster-admin-env.sh
if [ "$#" != "1" ];then
echo "Usage: $0 <username>"
exit 1
fi
echo "Password:"
read -s password
echo "Repeat the password:"
read -s password2
if [ "$password" != "$password2" ];then
echo "Passwords don't match."
exit 1
fi... |
Java | UTF-8 | 859 | 2.046875 | 2 | [] | no_license | package com.bazi.ttmk.web;
import com.bazi.ttmk.model.Sudija;
import com.bazi.ttmk.service.SudiiService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping(path = "/sudii")
@CrossOrigin(origins = "h... |
Java | UTF-8 | 995 | 1.609375 | 2 | [] | no_license | package com.tencent.beacon.upload;
import android.content.Context;
import com.tencent.beacon.a.f;
public final class c
extends a
{
public c(Context paramContext, int paramInt1, int paramInt2)
{
super(paramContext, 0, 100);
}
public final com.tencent.beacon.c.a.b a()
{
Object localObject = f.m()... |
C++ | WINDOWS-1251 | 4,796 | 2.96875 | 3 | [] | no_license | #include "prototype.h"
void sort(int,int);///
void swap(int);/// swap file
char directory[] = "ClientFile\\";///
struct _finddata_t* m_data = new _finddata_t[256];
/*
1.
2.
3.
4.
*/
int SortFile(int a)
{
setlocale(LC_ALL, "Russian");
struct _finddata_t c_file;
... |
Markdown | UTF-8 | 9,661 | 3.015625 | 3 | [] | no_license | # 面试题目
##属性相关
- 让页面里的字体变清晰,变细用CSS怎么做?
- -webkit-font-smoothing: antialiased;
- font-style属性可以让它赋值为“oblique” oblique是什么意思?
- 让没有斜体属性的文字倾斜
- line-height比例单位和百分比单位的计算方法
- 父元素的行高为150%时,会根据父元素的字体大小先计算出行高值然后再让子元素继承。所以当line-height:150%时,子元素的行高等于父元素字体大小 * 150% :
- 父元素行高为1.5时,会根据子元素的字体大小动态计算出行高值让子元素继承。所以,当line-height:1.5... |
Java | UTF-8 | 545 | 1.773438 | 2 | [] | no_license | package org.irri.iric.chado.so;
// Generated 05 26, 14 1:32:25 PM by Hibernate Tools 3.4.0.CR1
/**
* FiveHydroxymethylcytidine generated by hbm2java
*/
public class FiveHydroxymethylcytidine implements java.io.Serializable {
private FiveHydroxymethylcytidineId id;
public FiveHydroxymethylcytidine() {
}
publi... |
PHP | UTF-8 | 3,022 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace console\controllers;
use yii\console\controllers\MigrateController;
/**
* @inheritdoc
*/
class MigrateAllController extends MigrateController
{
/**
* @var array path for find migrations as alias => level
*/
protected static $paths = [
'@app' => 0,
'@vendor' => 2,
... |
Java | UTF-8 | 5,846 | 2.46875 | 2 | [] | no_license | package com.example.maks.filesstatisticapp;
import android.app.Service;
import android.content.Intent;
import android.os.Environment;
import android.os.IBinder;
import android.util.Log;
import java.io.File;
import java.util.ArrayList;
import java.util.TreeMap;
import java.util.concurrent.ExecutorService;
import java.... |
Markdown | UTF-8 | 1,521 | 2.578125 | 3 | [] | no_license | 
[View 👀](https://github.com/claflamme/toa-guide-printouts/blob/master/guides.pdf) or
[Download ⬇️](https://github.com/claflamme/toa-guide-printouts/raw/master/guides.pdf)
# Tomb of Annihilation Guide Printouts
I thought it was kind of shitty that the wilde... |
Markdown | UTF-8 | 1,003 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | # Narwhal!
[](https://pkg.go.dev/github.com/yourbase/narwhal?tab=doc)
Narwhal is a simplistic wrapper around the Docker Go API.
## Examples
For full examples and usage see [pkg.go.dev][examples].
```go
// Create a client
client := narwhal.... |
C# | UTF-8 | 1,189 | 2.59375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BussinessLayer;
namespace PresentationLayer.WebForms
{
public partial class SignUpForm : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArg... |
C++ | UTF-8 | 869 | 2.96875 | 3 | [] | no_license | #ifndef MATRIX_H
#define MATRIX_H
//macros to define header
class Matrix{
// class constructor, destructor and prototypes
private:
int **mat;
long unsigned row;
long unsigned col;
public:
Matrix();
Matrix(long unsigned x, long unsigned y);
~Matrix();
//prints
void printMatrix();
//allocates
void allMat();
//makes ... |
Python | UTF-8 | 1,294 | 2.8125 | 3 | [] | no_license | import csv
import json
def deduck(v):
if type(v) is not str:
return v
if v.lower()=='y':
return True
if v.lower()=='n':
return False
# range specific
if v.lower()=='touch':
return 5
if v.lower()=='self':
return 0
if v.lower().startswith('self ('):
v=v[6:-1].strip()
if v.lower().sta... |
Markdown | UTF-8 | 20,988 | 3.140625 | 3 | [] | no_license | # Software Architecture & Technology Rationale
### Technologies Used:
### Frameworks, Language and Libraries to be used in this project:
- Python for implementing functionality throughout the project.
- SpeechRecognition for implementing STT engines into the system.
- YAML for importing, reading and configurin... |
C++ | UTF-8 | 200 | 2.640625 | 3 | [] | no_license | #include <iostream>
#include <set>
using namespace std;
int main(){
set<int> si;
for(int i = 0; i < 100000; ++i){
si.insert(i);
}
cout << si.size() << endl;
return 0;
}
|
Java | UTF-8 | 1,047 | 3.4375 | 3 | [] | no_license | // 11 ms
class Solution {
public int minDeletionSize(String[] A) {
int count = 0;
for (int i = 0; i < A[0].length(); i++) {
for (int j = 1; j < A.length; j++) {
if (A[j-1].charAt(i) > A[j].charAt(i)) {
count++;
break;
... |
TypeScript | UTF-8 | 319 | 2.546875 | 3 | [] | no_license | import { Pipe, PipeTransform } from "@angular/core";
@Pipe({
name: "market"
})
export class MarketPipe implements PipeTransform {
public transform(value: number, x: string): string {
let z = status[value]
return z;
}
}
const status = {
2: 'Binance',
3: 'Huobi',
4: 'Bitfinex'
}
|
Java | UTF-8 | 6,496 | 1.898438 | 2 | [] | no_license | package com.microsoft.azure.iot.hackathon.accompany.common;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.support.v4.app.NotificationCompat;
import android.support.v4.conten... |
Shell | UTF-8 | 2,077 | 3.59375 | 4 | [
"MIT"
] | permissive | #!/bin/sh
set -e
FRAMEWORKS_PATH="${BUILD_DIR}/Frameworks"
[[ "${TARGET_NAME}" =~ (iOS|watchOS) ]] && FRAMEWORK_NAME="PubNub (${BASH_REMATCH[1]})"
PRODUCTS_PATH="${SRCROOT}/Products"
# Clean up from previous builds
if [[ -d "${FRAMEWORKS_PATH}" ]]; then
rm -R "${FRAMEWORKS_PATH}"
fi
if [[ -d "${PRODUCTS_PATH}" ]... |
Python | UTF-8 | 1,150 | 3.734375 | 4 | [] | no_license | with open('input.txt') as f:
players = f.read().split('\n\n')
p1 = [int(i) for i in players[0].split()[2:]]
p2 = [int(i) for i in players[1].split()[2:]]
def round():
global p1
global p2
#print("Player 1's deck:", p1)
#print("Player 2's deck:", p2)
m1 = p1.pop(0)
m2 = p2.pop(0)
... |
C++ | UTF-8 | 1,611 | 4.25 | 4 | [] | no_license | //Alternative solution for the fourth problem of Project Euler
//Instead of vectors I use strings
//It is slower but it's a new way to do it, for funsies
#include "stdafx.h"
#include <iostream>
#include <sstream> //for converting ints to strings
#include <algorithm> //for reversing strings
using namespace std;
bool Ch... |
Java | UTF-8 | 235 | 2.09375 | 2 | [] | no_license | package annotations;
import java.lang.annotation.*;
@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface SmartPhone
{
String os() default "Android";
String version() default "1.0.0";
}
|
Swift | UTF-8 | 6,704 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | import Component
import ComposableArchitecture
import Model
public enum MediaState: Equatable {
case needToInitialize
case initialized(MediaListState)
public init() {
self = .needToInitialize
}
}
public struct MediaListState: Equatable {
enum Next: Equatable {
case searchText(St... |
PHP | UTF-8 | 759 | 2.609375 | 3 | [] | no_license | <?php
$conn = mysqli_connect('localhost', 'root', '', 'logistics');
if(!$conn) {
die("Failed to connect" . mysqli_connect_error());
}
date_default_timezone_set('Asia/Bangkok');
$_SESSION['now'] = date("Y-m-d H:i:s");
function query($query) {
global $conn;
retu... |
Markdown | UTF-8 | 4,978 | 2.53125 | 3 | [
"CC-BY-3.0",
"LicenseRef-scancode-generic-cla"
] | permissive | <properties
pageTitle="Azure SQL Database 資源限制"
description="此頁面描述一些 Azure SQL Database 常見的資源限制。"
services="sql-database"
documentationCenter="na"
authors="rothja"
manager="jeffreyg"
editor="monicar" />
<tags
ms.service="sql-database"
ms.devlang="na"
ms.topic="article"
ms.tgt_pltfrm="na"
ms.workload="data... |
Shell | UTF-8 | 816 | 3.609375 | 4 | [] | no_license | #!/bin/bash
source "$(pwd)/env"
docker stack ps "wp-${CONTAINER_NAME}" > /dev/null 2>&1
if [ $? -eq 0 ];then
echo "stack running - executing command"
else
echo "could not find stack wp-${CONTAINER_NAME}! Make sure it's running."
exit
fi
CLI_IMAGE="wordpress:cli-php7.1"
DATA=$(docker service inspect --pre... |
Python | UTF-8 | 954 | 3.125 | 3 | [] | no_license | import math
from networkx import Graph
class Bruteforce:
min_cost = math.inf
solution = []
count = 0
def solve(self, graph: Graph, first_node):
self.min_cost = math.inf
self.solution = []
self._solve(graph, first_node, first_node, [], 0)
print('cost={}, solution={}'.... |
JavaScript | UTF-8 | 4,590 | 2.546875 | 3 | [] | no_license | var express= require('express');
var app= express();
var jwt = require('jsonwebtoken');
///Connect to DataBasae
var mongoose = require('mongoose');
var config= require('../DBconfig');
mongoose.connect(config.database);
// Get Mongoose to use the global promise library
mongoose.Promise = global.Promise;
//Get the d... |
Java | UTF-8 | 1,664 | 2.015625 | 2 | [
"MIT"
] | permissive | package edu.ucdavis.dss.ipa.api.components.registrarReconciliationReport.views;
import org.javers.core.metamodel.annotation.DiffIgnore;
import javax.persistence.Id;
public class ActivityDiffDto {
@DiffIgnore
private long id;
@Id
private String uniqueKey;
private char typeCode;
private String bannerLocation... |
Markdown | UTF-8 | 9,211 | 3.125 | 3 | [] | no_license | # ORM 테스트
* shell열기
```bash
$ python manage.py shell_plus
```
DB 있는 지 확인하기
<img src="images/image-20200625092354086.png" alt="image-20200625092354086" style="zoom:80%;" />
# 1:N 관계
**게시글 생성 ORM**
```shell
article1 = Article.objects.create(title ='title',content='content', user=user1)
```
```shell
Article... |
Shell | UTF-8 | 3,711 | 2.8125 | 3 | [
"BSD-3-Clause"
] | permissive | #!/usr/bin/env bash
# Copyright (c) 2018, University of Kaiserslautern
# 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 noti... |
Java | UTF-8 | 358 | 1.898438 | 2 | [] | no_license | package org.rta.core.dao.license;
import java.util.List;
import org.rta.core.dao.base.GenericDAO;
import org.rta.core.entity.licence.LicenseVehicleClassMasterEntity;
public interface LicenceVehicleClassMasterDAO extends GenericDAO<LicenseVehicleClassMasterEntity>{
public List<LicenseVehicleClassMasterEntity> getVe... |
Java | UTF-8 | 1,164 | 2.84375 | 3 | [
"MIT"
] | permissive | package com.BobScript.BobCode;
/**
* Created by zinov on 20.02.2016.
*/
public enum Type {
NULL, INT, FLOAT, STRING, ARRAY, SET, MAP, BOOLEAN, FUNCTION, FILE, RANGE, ITERATOR,USERS;
@Override
public String toString() {
switch (this) {
case INT:
return "integer";
... |
JavaScript | UTF-8 | 2,564 | 2.9375 | 3 | [] | no_license | 'use strict'
var _ = require('lodash');
module.exports = {
informationGain: function(attribute, examples, target) {
// need to know the entropy of the target
var targetEntropy = this.entropy(target, examples);
return targetEntropy - this.remainder(attribute, examples, target);
},
entropy: function... |
Java | UTF-8 | 2,017 | 2.03125 | 2 | [] | no_license | package io.reactivex.internal.operators.flowable;
import io.reactivex.ai;
import io.reactivex.al;
import io.reactivex.b.c;
import io.reactivex.internal.b.b;
import io.reactivex.internal.subscriptions.SubscriptionHelper;
import io.reactivex.j;
import io.reactivex.o;
import org.b.d;
public final class ae<T> extends ai<... |
PHP | UTF-8 | 1,052 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
Namespace Task;
class AllTimesheetController extends Controller
{
protected $footer = "View/Template/footer.php";
protected $template = "timesheetViewAll";
public function invoke()
{
$taskLoader = new TaskLoader();
$taskLoader->setDatabase($this->database);
if(! isset($_SESSION['account'])){
e... |
C++ | UHC | 906 | 3.625 | 4 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
#define N 10000 // 迭 ũ
bool arr[N]; // selfNumber ƴ
// Լ
int unSelfNum(int n) {
int sum = n; // ڱ ڽ
while (1) {
if (n == 0) break; // 0 Ǹ break
sum += n % 10; // 1 ڸ ϰ
n /= 10; // ڸ
}
return sum;
}
int main() {
ios_base::sync_with_stdio(fa... |
JavaScript | UTF-8 | 372 | 2.546875 | 3 | [] | no_license | $(function () {
var path = window.location.pathname;
$('a').each(function () {
var href = $(this).attr('href');
if(href == path){
$(this).parent().parent().parent('li').toggleClass("open");
$(this).parent('li').addClass('active');
$(this).parent().parent('.sub... |
PHP | UTF-8 | 812 | 3.171875 | 3 | [] | no_license | <?php
function substrwords($text, $maxchar, $end='...') {
if (strlen($text) > $maxchar || $text == '') {
$words = preg_split('/\s/', $text);
$output = '';
$i = 0;
while (1) {
$length = strlen($output)+strlen($words[$i]);
if ($length > $maxchar) {
... |
Python | UTF-8 | 3,913 | 2.578125 | 3 | [
"MIT"
] | permissive | from __future__ import print_function
from IPython.core.magic import Magics, magics_class, line_magic
from IPython.utils.io import capture_output
from .. import SimpleOlogClient
from .utils import save_pyplot_figure, get_screenshot, get_text_from_editor
olog_client = SimpleOlogClient()
def olog(msg=None, edit=Fals... |
C# | UTF-8 | 1,886 | 3.125 | 3 | [] | no_license | using System.IO;
using System.Net.Mail;
namespace MailLibrary
{
/// <summary>
/// Container for use with sending email messages which gets contents of a file
/// from a varbinary column. The Attachment property permits using for sending email
/// messages.
/// </summary>
public class Attachmen... |
PHP | UTF-8 | 1,547 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Traits;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Log;
use Throwable;
trait Requests
{
/**
* Função que define o formato do resultado das requests
*
* @param string $message
* @param int $status
* @param Throwable|null $exception
* @return ... |
Markdown | UTF-8 | 2,346 | 3.46875 | 3 | [] | no_license |
# What is a Function?
#### let you group a series of statements together to perform a specific task. you can reuse the function (rather than repeating the same set of st atements).
__some example, the message is held in an HTML element whose id attribute has a value of message.__
*The message is going to be changed ... |
C++ | UTF-8 | 1,653 | 3.484375 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
//https://leetcode.com/problems/merge-intervals/
/**
* Definition for an interval.
* struct Interval {
* int start;
* int end;
* Interval() : start(0), end(0) {}
* Interval(int s, int e) : start(s), end(e) {}
* };
*/
struct Interval {
... |
Python | UTF-8 | 1,445 | 2.765625 | 3 | [] | no_license | from models.event import Event, EventSchema
from datetime import datetime
event_schema = EventSchema()
def create_event(data, new_client): #Called from event_controller.py
print(f'Entering create_event()')
print(f'data:{data}')
print(f'new_client:{new_client}')
new_event = Event(
title=data[... |
C# | UTF-8 | 31,090 | 2.703125 | 3 | [
"MIT"
] | permissive | namespace CustomCode.Core.DesignByContract
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
/// <summary>
/// Preconditions for <see cref="Nullable{Int64}"/> types.
/// </summary>
/// <remarks>
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.