language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 1,382 | 2.078125 | 2 | [
"BSD-3-Clause"
] | permissive | //
// $Id$
package com.threerings.msoy.aggregators;
import java.io.IOException;
import java.util.Calendar;
import java.util.Collections;
import com.threerings.panopticon.aggregator.hadoop.Aggregator;
import com.threerings.panopticon.aggregator.writable.Keys.LongKey;
import com.threerings.panopticon.common.event.Even... |
Markdown | UTF-8 | 4,991 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | **This is not an officially supported Google product.**
# Java Function Coverage
The project aims to collect production Java function-level coverage with low overhead.
## Source Code Headers
Every file containing source code must include copyright and license
information. This includes any JS/CSS files that you mig... |
Markdown | UTF-8 | 1,035 | 3.484375 | 3 | [
"MIT"
] | permissive | # Fried Quinoa
- **Prep Time:** 15 minutes
- **Cook Time:** 25 minutes
## Tools
- 2 stovetop burners
- 1 medium pot
- 1 large frying pan
- 1 small frying pan
- 1 spatula
- 1 knife
## Ingredients
- 1 cup quinoa
- half an onion
- 1.5 teaspoons minced garlic
- 1 pepper (any color)
- 1 chicken breast
- handful cilantr... |
Python | UTF-8 | 1,098 | 4.09375 | 4 | [] | no_license | import random
'''
Try the same thing, but have the program choose a random word from the dic-
tionary, and then ask the user to guess the word. (You might want to limit your-
self to words containing two to five letters, to avoid making it too horribly
difficult.) Instead of telling the user that they should guess a s... |
Python | UTF-8 | 338 | 3.375 | 3 | [
"BSD-3-Clause"
] | permissive | def fill(a, N, i, v, x):
if i < 0 or i >= N: return
elif a[i] != v: return
elif a[i] == x: return
else:
a[i] = x
fill(a, N, i - 1, v, x)
fill(a, N, i + 1, v, x)
N, i, x = map(int, input().strip().split())
a = list(map(int, input().strip().split()))
fill(a, N, i, a[i... |
Python | UTF-8 | 1,654 | 3.5625 | 4 | [] | no_license | '''
링크 : https://programmers.co.kr/learn/courses/30/lessons/67256
문제 : 키패드 누르기
'''
def solution(numbers, hand):
answer = ''
left = 10 # 키패드 *:10, 0:11, #:12로 지정
right = 12
distance = { # value : 키패드 숫자 차이, key : 거리
1 : [1,3],
2 : [2,4,6],
3 : [5,7,9],
4 : [8,10]
... |
Shell | UTF-8 | 3,253 | 3.609375 | 4 | [] | no_license | #!/bin/bash
# Copyright 2020 Datawhere Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
# “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish... |
Java | UTF-8 | 1,721 | 2.21875 | 2 | [] | no_license | package com.framework.admin.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.Mode... |
C | UTF-8 | 492 | 3.5625 | 4 | [] | no_license | #include <stdio.h>
int main(void)
{
int x[10],y[10],z[10],i;
for(i=0;i<10;i++)
{
printf("DIGITE O %dº NUMERO PARA O VETOR X: ",i+1);
scanf("%d",&x[i]);
}
printf("\n");
for(i=0;i<10;i++)
{
printf("DIGITE O %dº NUMERO PARA O VETOR Y: ",i+1);
scanf("%d",&y[i]);
}... |
Java | UTF-8 | 2,829 | 2.09375 | 2 | [
"Apache-2.0"
] | permissive | package it.prisma.domain.dsl.cloudify.response;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Generated;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToString... |
Markdown | UTF-8 | 552 | 2.59375 | 3 | [
"MIT"
] | permissive | # Solution
```
# LCS different format
class Solution:
def maxUncrossedLines(self, A: List[int], B: List[int]) -> int:
if not A or not B:
return 0
N1,N2 = len(A),len(B)
dp = [[0 for _ in range(N2+1)] for _ in range(N1+1)]
for i in range(N1):
for j in r... |
Java | UTF-8 | 9,639 | 2.296875 | 2 | [] | no_license | package com.tuniu.abt.intf.entity;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@Table(name = "abt_refund_item")
public class AbtRefundItem implements Serializable {
public static final int STATUS_INIT = 0;
public static final int STATUS_OK = 1;
public static final int S... |
Swift | UTF-8 | 1,653 | 2.640625 | 3 | [] | no_license | //
// ListActionSheet.swift
// TheMovieDB
//
// Created by Artsiom Grintsevich on 11/6/15.
// Copyright © 2015 Artsiom Grintsevich. All rights reserved.
//
import UIKit
class ListActionSheet: UIAlertController {
init() {
super.init()
}
init(shareUrl: String){
self.init()
... |
C# | UTF-8 | 3,302 | 2.984375 | 3 | [
"MIT"
] | permissive | using System;
using System.Text;
using System.Linq;
using System.Numerics;
using System.Globalization;
using System.Collections.Generic;
// For readablity, breaking the ICalculonTypes files based on roles.
// These are Rounding operators
namespace Calculon.Types
{
public class Round : IFunctionCog
... |
JavaScript | UTF-8 | 4,339 | 2.609375 | 3 | [] | no_license | import React, { useState } from 'react';
import { digitToChar } from '../../Tasks/utilities';
import _ from 'lodash';
export default function ConvertDecimalTable({
floatConvert,
params: [convertible, radix],
... |
SQL | UTF-8 | 2,698 | 2.765625 | 3 | [] | no_license | -- Created by Vertabelo (http://vertabelo.com)
-- Last modification date: 2019-05-18 11:04:35.482
-- foreign keys
ALTER TABLE BankDict DROP CONSTRAINT BankDict_Adres;
ALTER TABLE Email DROP CONSTRAINT Email_Klient;
ALTER TABLE IdentyfikatorKonta DROP CONSTRAINT IdentyfikatorKonta_Adres;
ALTER TABLE IdentyfikatorKon... |
Shell | UTF-8 | 450 | 2.90625 | 3 | [
"MIT"
] | permissive | #!/bin/bash
#bdereims@vmware.com
# Args: <Cluster_Namespace> <Cluster_Name>
. ../env
export KUBECTL_VSPHERE_PASSWORD=${PASSWORD}
[ "$1" == "" -o "$2" == "" ] && printf "\nIt needs to provide <Cluster_Namespace> and <Cluster_Name>.\n\n" && exit 1
echo ${TANZU_PASSWORD}
kubectl vsphere login --insecure-skip-tls-veri... |
JavaScript | UTF-8 | 1,898 | 2.90625 | 3 | [] | no_license | import React, { Component } from 'react';
import TechItem from './TechItem';
class TechList extends Component{
//exemplo de utilização de propTypes e defaultProps para class components
// static propTypes = {};
// static defaultProps = {};
//state é necessario que tenha esse nome
state = {
newTech: '',... |
C++ | UTF-8 | 15,274 | 2.921875 | 3 | [] | no_license | #ifndef _HR_PIXELFORMAT_H_
#define _HR_PIXELFORMAT_H_
namespace Hr
{
enum EnumPixelFormat
{
/// Unknown pixel format.
PF_UNKNOWN = 0,
/// 8-bit pixel format, all bits luminance.
PF_L8 = 1,
PF_BYTE_L = PF_L8,
/// 16-bit pixel format, all bits luminance.
PF_L16 = 2,
PF_SHORT_L = PF_L16,
/// 8-bit pix... |
Java | UTF-8 | 4,833 | 2.1875 | 2 | [] | no_license | /*
Copyright (c) 2010, NHIN Direct Project
All rights reserved.
Authors:
Greg Meyer gm2552@cerner.com
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright... |
Java | UTF-8 | 1,294 | 3.296875 | 3 | [] | no_license | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Subset_1182 {
static int[] nums;
static int s;
static int cnt = 0;
public static void main(String[] args) throws IOException {
BufferedReader br = new Buf... |
Markdown | UTF-8 | 848 | 2.78125 | 3 | [
"MIT"
] | permissive | # Dressy End
When working in a team, define some patterns could be a great idea if contributors want to keep things organized and, consequently, easy and fast to mantain. Dressy End is a compilation of the best pratices and advices I have learned since I have started work as a front end developer.
### Contents
The con... |
C++ | UTF-8 | 720 | 2.578125 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | typedef long long llint;
class Solution {
public:
int numberOfArithmeticSlices(vector<int>& A) {
const int n = A.size();
if (n < 3) {
return 0;
}
llint diff = A[0] - A[1];
int p = 0;
int q = 1;
int ans = 0;
while (q + 1 < n) {
... |
Python | UTF-8 | 3,408 | 2.921875 | 3 | [] | no_license |
#Dependencies
from bs4 import BeautifulSoup as bs
import requests
from splinter import Browser
from selenium import webdriver
import pandas as pd
import time
def init_browser():
# @NOTE: Replace the path with your actual path to the chromedriver
executable_path = {"executable_path": "/usr/local/bin/chromedri... |
Java | UTF-8 | 1,670 | 2.015625 | 2 | [] | no_license | package com.android.veggieprotection.ui;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ListView;
import com.android.veggieprotection.R;
import com.android.veggieprotection.adapter.HamaAdapter;
import com.android.veggieprotectio... |
TypeScript | UTF-8 | 848 | 2.84375 | 3 | [] | no_license | import { Injectable } from '@nestjs/common';
import IPopulation from './interfaces/population.interface';
import Population from './models/population.model';
import State from './models/state.model';
@Injectable()
export default class AppService {
private populations: Population[] = [
new Population(new State('S... |
C++ | UTF-8 | 2,953 | 2.875 | 3 | [] | no_license | /*
Building Blocks Engine
Ultimate Game Engine Design and Architecture (2006)
Created by Allen Sherrod
*/
#ifndef _BB_VERTEX_DESCRIPTOR_H_
#define _BB_VERTEX_DESCRIPTOR_H_
#include<NameSpace.h>
#include<Defines.h>
#include<vector>
DECLARE_ENGINE_NAMESPACE
class VertexElement
{
public:
VertexEle... |
C++ | UTF-8 | 1,771 | 2.65625 | 3 | [] | no_license | #pragma once
#include "GameObj.h"
class Player
{
public:
Player(void);
~Player(void);
// some high level objects
std::string playerName;
std::string scriptName;
Logger* logger;
GameObj* game;
double playerMin;
double playerMax;
// some high level methods
void setGame(GameObj* game);
void setPlayerName... |
JavaScript | UTF-8 | 6,844 | 2.5625 | 3 | [] | no_license | import User from '../helpers/UserHelper';
import bcrypthash from '../helpers/hashPassword';
import jwtToken from '../helpers/jwtToken';
class UserController {
/* @param {object} req
@param {object} res
@returns {object} user object
*/
static async register(req, res) {
const {
... |
JavaScript | UTF-8 | 1,071 | 3 | 3 | [
"MIT"
] | permissive | /*global define */
// Perform a focus operation (focus) on the element specified by query value.
define("focus", ["triggerEvent", "result"], function(trigger, result) {
"use strict";
var regex = /^focus\s*\(\s*(?:")([^"]+)(?:")\s*\)$/i;
// Perform a focus operation.
function focus (jq, query, context) {
r... |
Java | UTF-8 | 270 | 2.671875 | 3 | [] | no_license | import java.util.Scanner;
public class a044 {
public static void main(String [] argv) {
Scanner cin = new Scanner(System.in);
while (cin.hasNext()) {
int n = cin.nextInt();
System.out.println(n*(n*n+5)/6+1);
}
}
}
|
Java | UTF-8 | 1,231 | 2.375 | 2 | [] | no_license | package pages;
import wrappers.LinkedInWrappers;
public class LinkedInAdvancedSearchPage extends LinkedInWrappers
{
public LinkedInAdvancedSearchPage enterKeywords(String data) {
enterById(prop.getProperty("Advanced.KeyWord.Id"), data);
return this;
}
public LinkedInAdvancedSearchPage clickSubmit() {
clickByClass... |
Markdown | UTF-8 | 3,677 | 3.265625 | 3 | [] | no_license | ---
layout: post
title: Using HttpClient To Post JSON In C# & .NET
date: 2022-08-01 12:11:42 +0300
categories:
- C#
- .NET
---
For a long time if you wanted to post JSON using a [HttpClient](https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient?view=net-6.0), you would do it like this:
```csha... |
Java | UTF-8 | 1,757 | 4.375 | 4 | [] | no_license |
/* Date : 2020.05.08
Author : eunji
Description : Java_변수
Version : 1.0
*/
package java0508;
public class ex02_변수 {
public static void main(String[] args) {
// 변수 : 프로그램 실행에 필요한 데이터를 저장하기
// 위해 메모리 공간을 할당하고, 이름을 부여한것
// var num = 0;
// [변수타입] [변수명] = [변수값];
int age ... |
C++ | UTF-8 | 1,290 | 2.984375 | 3 | [] | no_license | #include "Sample.h"
#include <iostream>
Sample::Sample(void)
{
}
Sample::~Sample(void)
{
}
int Sample::load(string path)
{
if (! (sf_infile = sf_open (path.c_str(), SFM_READ, &sf_info)))
{
// failed to load
cout << "Failed to load audio" << endl;
cout << sf_strerror(NULL) << endl;
return 1;
}
else
{
... |
C++ | UTF-8 | 2,633 | 3.34375 | 3 | [] | no_license | /*
* @lc app=leetcode.cn id=547 lang=cpp
*
* [547] 朋友圈
*/
// @lc code=start
class UnionFind
{
public:
int length;
vector<int> parent;
vector<int> size;
UnionFind(const int num)
{
length = num;
for(int i = 0;i < num;++i)
... |
Markdown | UTF-8 | 1,417 | 3.0625 | 3 | [] | no_license | # FM-Synthesis-Project
This repository contains MATLAB files used to simulate the instrument
diagrams shown in "The Synthesis of Complex Audio Spectra
by Means of Frequency Modulation*
JOHN M. CHOWNING "
This was created and tested as part of the Project component of
EC5.203 Communication Theory, Spring 2021, IIIT H... |
Markdown | UTF-8 | 777 | 3.203125 | 3 | [] | no_license | # 基础知识
- 父组件监听子组件的生命周期
1. 使用 𝑜𝑛 和 emit : 子组件 𝑒𝑚𝑖𝑡 触发一个事件,父组件 on 监听相应事件
```js
// Parent.vue
<Child @mounted="doSomething"/>
// Child.vue
mounted() {
this.$emit("mounted");
}
```
2. hook 钩子函数
```js
// Parent.vue
<Child @hook:mounted="doSomething" ... |
Markdown | UTF-8 | 4,887 | 2.59375 | 3 | [
"MIT"
] | permissive | [![MIT License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]
<p align="center">
<h3 align="center">Human Pose Detection - Machine Model Training</h3>
<h5 align="center">(This repo consists the source code of a machine model training tool.)</h5>
<p align="center">
<a href="https:... |
Java | UTF-8 | 920 | 1.921875 | 2 | [] | no_license | package com.bpm.lj.mes.base.server.mapper.base;
import com.bpm.lj.mes.base.server.domain.BaseShift;
import com.bpm.lj.mes.base.server.domain.BaseShiftExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface BaseShiftMapper {
long countByExample(BaseShiftExample example);
i... |
JavaScript | UTF-8 | 4,269 | 2.625 | 3 | [] | no_license | // change everytime
// =====================
var driveTableNames = [
{
long: "National Regional Profile, Population, ASGS, 2007-2011",
short: "1NZqM7xmjpXLlyBoryjnrOuiKw56FxuJ3tc_zGAVD",
time: "At 30 June - Labels",
geo: "Regional Code - Codes"
},
... |
Markdown | UTF-8 | 1,946 | 3.1875 | 3 | [
"MIT"
] | permissive | ### MicroWorkers is a class that easily manages a pool of threads to optimise simultaneous jobs and jobs endings, for MicroPython (used on ESP32 and [Pycom](http://www.pycom.io) modules)

Very easy to integrate and very light with one file only :
- `"microWorkers.py"`
Simple but effective :
- Us... |
C++ | UTF-8 | 269 | 3.1875 | 3 | [] | no_license | #include <iostream>
#include <typeinfo>
int main() {
int n1{10};
auto n2 = n1;
const std::type_info& t1 = typeid(n2);
std::cout << t1.name() << std::endl;
typeid(3 + 4.2); //이런것도 가능
/**typeid는 type_info를 리턴하는 연산자이다.*/
}
|
C# | UTF-8 | 1,530 | 2.8125 | 3 | [
"CC-BY-4.0",
"MIT",
"LicenseRef-scancode-generic-cla"
] | permissive | // <copyright file="VegaOperationDataStream.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
namespace Microsoft.Vega
{
using System;
using System.Collections.Generic;
using System.Fabric;
using System.Linq;
using System.Text;
us... |
Markdown | UTF-8 | 988 | 2.78125 | 3 | [] | no_license | # Wheelchair pressure mat
ESP3903 project @ NUS
Authors:
* Jasdip Chauhan
* Keith Daigle
* Sam Yuyitung
Code to support a capacitor based pressure sensor matrix
## Arduino Code
[file](muxCode/muxCode.ino)
This code cycles through and outputs the 16 capacitance values in picoFarads
This code is based off the
[Cap... |
Java | UTF-8 | 2,992 | 3.59375 | 4 | [] | no_license | package org.eve.framework.other;
/**
* 颠倒二进制位
* 颠倒给定的 32 位无符号整数的二进制位。
* https://leetcode-cn.com/explore/interview/card/top-interview-questions-easy/26/others/66/
* <p>
* 请注意,在某些语言(如 Java)中,没有无符号整数类型。在这种情况下,输入和输出都将被指定为有符号整数类型,并且不应影响您的实现,因为无论整数是有符号的还是无符号的,其内部的二进制表示形式都是相同的。
* 在 Java 中,编译器使用二进制补码记法来表示有符号整数。因此,在上面的 示... |
C++ | UTF-8 | 1,514 | 3.265625 | 3 | [] | no_license | /*
* File.cpp
*
* Created on: Jun 5, 2017
* Author: user
*/
#include "File.h"
namespace networkingLab {
File::File(const std::string& path)
{
this->path = path;
}
File::~File()
{
}
void File::close()
{
::close(fd);
}
int File::read(char* buffer, size_t length)
{
size_t offset = 0;
size_t byt... |
Java | UTF-8 | 975 | 2.15625 | 2 | [] | no_license | package com.curso.resources;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind... |
Shell | UTF-8 | 2,143 | 3.328125 | 3 | [] | no_license | #!/bin/bash
echo $0 | logger
echo `pwd` | logger
JMARECEIPT_ENV="/etc/jma-receipt/jma-receipt.env"
if [ ! -f ${JMARECEIPT_ENV} ]; then
echo "${JMARECEIPT_ENV} does not found."
exit 1
fi
. $JMARECEIPT_ENV
PATH=.:${PATH}
# compile COBOL programs
COBMEM=`module CBL`
for f in ${COBMEM}; do
if test "x`echo -n ... |
Java | UTF-8 | 1,204 | 2.34375 | 2 | [
"Apache-2.0"
] | permissive | package com.provectus.fds.flink.schemas;
import com.provectus.fds.models.bcns.WalkinClick;
import com.provectus.fds.models.utils.JsonUtils;
import org.apache.flink.api.common.serialization.DeserializationSchema;
import org.apache.flink.api.common.serialization.SerializationSchema;
import org.apache.flink.api.common.ty... |
Python | UTF-8 | 15,404 | 2.671875 | 3 | [
"BSD-3-Clause"
] | permissive | from discord.ext import commands
import discord.utils
from .utils import config, formats
import json, re
from collections import Counter
class DefaultProfileType:
def __str__(self):
return 'me'
MyOwnProfile = DefaultProfileType()
class MemberParser:
"""
Lazily fetches an argument and then when as... |
C# | UTF-8 | 7,702 | 2.96875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Threading;
using System.Linq;
using System.Threading.Tasks;
using System.IO;
using GroBuf;
using GroBuf.DataMembersExtracters;
namespace PriberamRestApp.Classification
{
public class Classifier
{
private static Classifier instance = new Clas... |
Python | UTF-8 | 203 | 2.71875 | 3 | [] | no_license | #keerthi
n=int(input())
lst=list(map(int,input().split()))
m1=[]
a1=1
for i in range(n-1):
if lst[i]<lst[i+1]:
a1+=1
else:
m1.append(a1)
a1=1
m1.append(a1)
print(max(m1))
|
Java | UTF-8 | 3,575 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2017-2023 O2 Czech Republic, a.s.
*
* 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 l... |
C++ | UTF-8 | 25,257 | 2.578125 | 3 | [] | no_license | #include "Container/Vector.h"
#include "Container/HashMap.h"
#include "Math/Vector4.h"
#include "JSONValue.h"
#include "Stream.h"
#include <cstdio>
#include <cstdlib>
namespace Auto3D
{
const FJSONValue FJSONValue::EMPTY;
const JSONArray FJSONValue::emptyJSONArray;
const JSONObject FJSONValue::emptyJSONObject;
FJS... |
C# | UTF-8 | 564 | 2.703125 | 3 | [] | no_license | XElement root = XElement.Parse(xml); // XDocument.Load(xmlFile).Root
var specsDivs = root.Descendants()
.Where(e => e.Name == "div"
&& e.Attributes.Any(a => a.Name == "id")
&& e.Attributes.First(a => a.Name == "id").Value == ... |
Markdown | UTF-8 | 3,981 | 3.359375 | 3 | [
"MIT"
] | permissive | # Operative
**Before reading this please ensure you fully understand [the concept of Web Workers](https://developer.mozilla.org/en-US/docs/Web/Guide/Performance/Using_web_workers)**.
Operative is a small JS utility (1k *gzipped*) for seamlessly creating Web Worker scripts. Its features include:
* Seamless API Autho... |
C++ | UTF-8 | 10,327 | 2.640625 | 3 | [] | no_license | //#include <SoftwareSerial.h>
#include<SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
//Variable declarations
#define bin1 5
#define bin2 6
int servo_pos_1 = 0;
int servo_pos_1_1 = 0;
int servo_pos_2_2 = 0;
int servo_pos_2 = 0;
//String textmessage ;
int distance1=0;
int distance2 = 0;
RF24 radio(7,8); // (CE,CSN... |
Java | UTF-8 | 2,224 | 2.328125 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2019 mscalabre.
*
* 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 agreed to ... |
Python | UTF-8 | 226 | 3.734375 | 4 | [] | no_license | q = 4
for b in range(0, q):
for c in range(0, b + 1):
print('* ' , end='')
print('')
r = 4
for b in range(0, r):
for c in range(0, r - 1):
print('* ' , end='')
r -= 1
print('')
|
C# | UTF-8 | 668 | 3.203125 | 3 | [
"MIT"
] | permissive | namespace Task02RefactorStatements
{
public class Matrix
{
public void CheckCellBeforeVisit(bool[,] visitedCells, int row, int col)
{
int rows = visitedCells.GetLength(0);
int cols = visitedCells.GetLength(1);
var rowIsInMatrix = row < 0 && row < rows;
... |
Python | UTF-8 | 822 | 3.84375 | 4 | [
"Apache-2.0"
] | permissive | """
A simple set of nodes connected A->B->C->D, with one function at each, calculating
inputs/outputs
"""
import math
# A - Linear
A_slope = 2.1
A_intercept = 2.2
# B - Logistic
B_gain = 1.0
B_bias = 0.0
B_offset = 0.0
# C - Exponential
C_scale = 1.0
C_rate = 1.0
C_bias = 0.0
C_offset = 0.0
# D - Sine
D_scal... |
C# | UTF-8 | 1,085 | 2.890625 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace FlowDesign.UI.ViewModels
{
/// <summary>
/// Basis für alle ViewModels, die in dieser Anwendung verwendet werden.
... |
C++ | UTF-8 | 1,287 | 4.09375 | 4 | [] | no_license | /*
Problem Statement:
https://www.geeksforgeeks.org/positive-elements-at-even-and-negative-at-odd-positions-relative-order-not-maintained
*/
// C++ program to rearrange positive and negative
// numbers
#include <bits/stdc++.h>
using namespace std;
void rearrange(int a[], int size)
{
int positive = 0, negative = 1;... |
C++ | UTF-8 | 1,967 | 2.65625 | 3 | [] | no_license | struct Level3Solid {
Cell operator()(Eigen::Vector3f v) const {
using namespace Eigen;
Cell result;
v /= 3.;
result.density = -20*(cos(v[0]) + cos(v[1]) + cos(v[2])) + sphere(v, (M_PI*M_PI));
result.friction = 1.0/4.0;
return result;
}
};
struct Level3Attr {
Vertex operator()(Eigen::Vector3f const... |
Java | UTF-8 | 2,757 | 1.867188 | 2 | [
"MIT"
] | permissive | package org.gobiiproject.gobiiclient.dtorequests.dbops.crud;
import org.gobiiproject.gobiiapimodel.hateos.LinkCollection;
import org.gobiiproject.gobiiapimodel.payload.PayloadEnvelope;
import org.gobiiproject.gobiiapimodel.restresources.RestUri;
import org.gobiiproject.gobiiapimodel.types.ServiceRequestId;
import org.... |
C++ | UTF-8 | 1,597 | 3.125 | 3 | [
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-public-domain"
] | permissive | #ifndef _WFC_RANGES_H_
#define _WFC_RANGES_H_
#include <wfc/arrays.h>
// Had to add because offset can be negative
struct Offset2D
{
int x;
int y;
};
//! \brief Defines a square range. The bottomLeft and upperRight
//! are included in the range.
struct SquareRange
{
Offset2D bottomLeft;
Offset2D upperRight;... |
Python | UTF-8 | 160 | 3.921875 | 4 | [] | no_license | # Finger exercise - total floats in a string
s = '1.23, 2.4, 3.123'
total = 0.0
new_s = s.split(", ")
for x in new_s:
total = total + float(x)
print(total) |
C++ | UTF-8 | 2,455 | 2.578125 | 3 | [] | no_license | #pragma once
#include "skills.h"
namespace MyStrategy
{
void defender(BeliefState *state, int botID)
{
//print("Defender\n");
//It follows the ball
Vec2D dpoint;
dpoint.x = -HALF_FIELD_MAXX / 2;
dpoint.y = state->ballPos.y;
Vec2D goal;
goal.x = HALF_FIELD_MAXX ;
goal.y = (OPP_GOAL_MAXY... |
C++ | UTF-8 | 997 | 3.53125 | 4 | [] | no_license | /*
插入排序的思想:
1.定位插入排序---直接插入法
2.定位插入位置---二分插入法
3.缩小增量多遍插入排序---希尔排序法
首先看直接插入排序:使用的是顺序查找的方法
int arr[]是一组待排序的数字,elem为需要插入的元素 n为该数组中全部的数据的长度,
具体实现思想是:将需要插入的数elem插入前面一个有序的数组中,比如当前的位置为i,
这时候需要将目前的位置的数取出来,暂存在temp临时变量中,即temp=arr[i],然后在循环内部采用的是循环,
令int j=i-1;
for()
*/
//直接插入法 请查看drawable 中的directinsertimg.png 看执行过程
v... |
Java | UTF-8 | 1,385 | 3.953125 | 4 | [] | no_license | import java.util.*;
/*
89 Gray Code 32.8% Medium
Problem: Gray Code
Difficulty: Easy
Source: https://oj.leetcode.com/problems/gray-code/
Notes:
The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits... |
Markdown | UTF-8 | 4,360 | 4.15625 | 4 | [] | no_license | #Reverse Words in a String
For example,
Given s = "the sky is blue",
return "blue is sky the".
1. 非 in-place 的版本: 切分,组合
开始的时候直接用 Python秒写了一个, 最主要得益于 Python的split函数,貌似C++没有这个函数?
class Solution:
# @param s, a string
# @return a string
def reverseWords(self, s):
s = s.strip()
w... |
C# | UTF-8 | 612 | 2.625 | 3 | [
"MIT"
] | permissive | using Sitecore.Data.Fields;
namespace Constellation.Foundation.ModelMapping.FieldMappers
{
/// <summary>
/// An object for mapping a Sitecore Item Field's Value to a Property on a given Model.
/// </summary>
public interface IFieldMapper
{
/// <summary>
/// Maps the supplied Field value to the supp... |
Java | UTF-8 | 292 | 1.984375 | 2 | [] | no_license | package com.example.studyprovider.service;
import java.io.FileNotFoundException;
import java.io.IOException;
public interface FileService {
//读取文件
boolean readFileAndSave(String prefix,String path);
// 读取所有txt
void readFile(String path) throws IOException;
}
|
Python | UTF-8 | 528 | 2.515625 | 3 | [] | no_license | from address.models import Address, Locality, State, Country
def generate_country_data_for_testing():
country = Country.objects.create(name="Kenya", code="KE")
state = State.objects.create(name="Nairobi", country=country)
locality = Locality.objects.create(name="USIU", state=state)
address = Address.o... |
JavaScript | UTF-8 | 400 | 2.640625 | 3 | [] | no_license | // Requires: importación de librerias
var express = require( 'express' ); // libreria del servidor express
// Inicializar variables
var app = express(); // inicializar servidor express
app.get( '/', ( request, response ) => {
// enviar respuesta
response.status( '200' ).json( { // status 200: OK
ok: true,
m... |
Java | UTF-8 | 3,519 | 2.765625 | 3 | [] | no_license | package org.apache.tomcat.dbcp.pool2.impl;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import org.apache.tomcat.dbcp.pool2.PooledObjectFactory;
/**
* 特定用法实现.
*/
class PoolImplUtils {
/**
* 标识对象工厂创建的具体对象类型.
*
* @param factory ... |
C# | UTF-8 | 3,035 | 2.890625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace StudentApp
{ [XmlRoot(ElementName ="Student")]
public class Student
{
[XmlAttribute(DataType ="string")]
public string FirstName { get... |
Python | UTF-8 | 4,946 | 2.953125 | 3 | [] | no_license | import sys
import time
import serial
PRINTER_PORT = 'COM4'
PRINTER_BAUDRATE = 38400
PRINTER_PARITY = 'N'
def openSerialPort(port, baudrate, parity = 'N', timeout = 10):
ser = serial.Serial()
ser.port = port
ser.baudrate = baudrate
ser.parity = parity
ser.xonxoff = False
ser.rtscts ... |
Python | UTF-8 | 29,032 | 2.875 | 3 | [] | no_license | #!/home/operador/anaconda3/envs/auxdechycom/bin/python
# -*- coding: utf-8 -*-
# -*- coding: iso-8859-1 -*-
# =====================================================================>
# Script que gera as figuras do modelo ADCIRC.
# Resolucao: 1/24 graus.
#
# Autora: 1T(T) LIANA
#
# Data corrente: python ftp_adcirc.py var... |
Markdown | UTF-8 | 485 | 2.53125 | 3 | [] | no_license | # What is Enumeration?
Enumeration is the process of extracting user names, machine names, network resources, shares, and services from a system, and its conducted in an intranet environment.
In this phase, the attacker creates an active connection to the system and performs directed queries to gain more information a... |
Java | UTF-8 | 375 | 2.53125 | 3 | [] | no_license | package sys;
/**
* @author chenwf:
* @date 创建时间:2017年7月15日 上午9:12:10
* @version 1.0
* @parameter
* @return
*/
public class TestMethod {
public static void main(String[] args) {
String string = "";
for (int i = 0; i < 2; i++) {
string += "def"+i +" - ";
}
System.out.println(string.subs... |
Markdown | UTF-8 | 3,005 | 3.515625 | 4 | [] | no_license | # 寻找峰值 - guoziqing506的博客 - CSDN博客
2016年04月07日 15:37:55[guoziqing506](https://me.csdn.net/guoziqing506)阅读数:1042标签:[二分查找](https://so.csdn.net/so/search/s.do?q=二分查找&t=blog)
个人分类:[lintcode](https://blog.csdn.net/guoziqing506/article/category/6289140)
所属专栏:[LintCode-Python题解](https://blog.csdn.net/column/details/guozi... |
TypeScript | UTF-8 | 775 | 2.5625 | 3 | [
"MIT"
] | permissive | import { Command } from "../base/Command";
import Discord from "discord.js";
import Client from "../base/Client";
const ShuffleCommand = new Command({
name: "shuffle",
alias: [],
usage: "",
description: "Shuffle the queue",
onlyDev: false,
permission: "MANAGE_MESSAGES",
cooldown: 2,
cat... |
C# | UTF-8 | 2,675 | 2.578125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DSharpPlus;
using DSharpPlus.CommandsNext;
using DSharpPlus.Net;
using DSharpPlus.Interactivity;
using DSharpPlus.Net.WebSocket;
using DSharpPlus.VoiceNext;
using System.IO;
namespace BearBotKuma... |
JavaScript | UTF-8 | 432 | 3.3125 | 3 | [] | no_license | function solve(matrix) {
let biggestElement = Number.MIN_SAFE_INTEGER;
for (let row = 0; row < matrix.length; row++) {
let currentRow = matrix[row];
let currentBiggestElement = Math.max(...currentRow);
if (currentBiggestElement > biggestElement){
biggestElement = currentBig... |
JavaScript | UTF-8 | 1,576 | 3.59375 | 4 | [] | no_license | // userChat is the function that waits for the user to send a message.
function userChat() {
// Find where the user is inputing text.
compose_area = document.getElementById('composer');
// Set the user as the sender of the next message.
nextMessage.sender = "user";
// Get the user's input in the compose_... |
TypeScript | UTF-8 | 2,718 | 3.0625 | 3 | [] | no_license | import {Consola} from 'consola';
import {Day} from '../utils/day';
export default function (logger: Consola) {
return new Day4(logger);
}
const tokens = ['byr', 'iyr', 'eyr', 'hgt', 'hcl', 'ecl', 'pid'];
class Day4 extends Day {
part1(input: string[]): Promise<string> {
let currentTokens: string[] = [];
... |
PHP | UTF-8 | 1,540 | 2.984375 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
require __DIR__ . '/../autoload.php';
if (isset($_POST['name'], $_POST['email'], $_POST['password'], $_POST['password-confirm'])) {
if ($_POST['password'] === $_POST['password-confirm']) {
$email = filter_var($_POST['email'], FILTER_SANITIZE_EMAIL);
$name = filter_v... |
C# | UTF-8 | 3,886 | 2.609375 | 3 | [] | no_license | using Identity.Api.Dtos;
using Identity.Api.Services;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
namespace Identity.Api.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class StudentsControlle... |
Markdown | UTF-8 | 1,045 | 2.59375 | 3 | [] | no_license | # Article 3
Sont autorisés à concourir les candidats qui, à la date du début du stage de formation, réunissent les conditions fixées par l'article 4 du décret n° 2008-931 du 12 septembre 2008 susvisé et satisfont aux conditions d'aptitude définies par l'annexe I du présent arrêté.
Les niveaux de pratique professionne... |
Java | UTF-8 | 1,799 | 3.140625 | 3 | [
"MIT"
] | permissive | package seedu.equipment.logic.commands;
import static java.util.Objects.requireNonNull;
import java.util.Comparator;
import seedu.equipment.logic.CommandHistory;
import seedu.equipment.model.Model;
import seedu.equipment.model.equipment.Equipment;
/**
* Lists all equipment in the equipment manager to the user.
*... |
Java | UTF-8 | 457 | 1.835938 | 2 | [] | no_license | package com.zynger.daggeracrossmodules.di;
import com.zynger.collaborators.di.EngineModule;
import com.zynger.daggeracrossmodules.FleetApp;
import com.zynger.daggeracrossmodules.MainActivity;
import dagger.Component;
@Component(modules = {
ApplicationModule.class,
RacingModule.class,
EngineMo... |
Python | UTF-8 | 401 | 3.515625 | 4 | [] | no_license | import time
import pygame
# initializes pygame variables
pygame.init()
# define the screen size to 640x480
screen = pygame.display.set_mode([640, 480])
# writes the Hello World at the screen title
pygame.display.set_caption('Hello World')
# fills the screen with black color
screen.fill([0, 0, 0])
# updates the sc... |
Java | UTF-8 | 2,936 | 2.125 | 2 | [] | no_license | package com.speedrun_mobile_unofficial.homepage;
import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.support.v4.widget.CircularProgressDrawable;
import android.view.LayoutInflater;
import android.view.Vi... |
SQL | UTF-8 | 809 | 3.125 | 3 | [] | no_license | DROP TABLE if EXISTS interview_service_table;
CREATE TABLE interview_service_table(
id INT PRIMARY KEY NOT NULL AUTO_INCREMENT COMMENT 'ID',
worker_id INT NOT NULL comment '客户经理ID',
internal_code VARCHAR(100) NOT NULL COMMENT '客户内码',
interview_time TIMESTAMP DEFAULT current_timestamp COMMENT '面签时间',
intervi... |
JavaScript | UTF-8 | 621 | 2.796875 | 3 | [] | no_license | const pwd = require('./pwd');
const ls = require('./ls');
const cat = require('./cat');
const curl = require('./curl');
const done = (output) => {
process.stdout.write(output);
process.stdout.write('\nprompt >');
}
process.stdout.write('prompt > ');
process.stdin.on('data', (data) => {
const cmd = data.toString... |
Markdown | UTF-8 | 1,267 | 2.875 | 3 | [] | no_license | Update Dec 15, 2015: Fixed.
## HELP PLEASE!
I am trying to create a floating view (using WindowManager) that uses EditText Component. But here's the issue.
If I create the floating view using the `FLAG_NOT_FOCUSABLE`, the keyboard doesn't open up when I focus on the Edittext Component by touching on it.
I tried rem... |
SQL | UTF-8 | 10,385 | 2.90625 | 3 | [] | no_license | CREATE TABLE JOUEUR(
id_joueur NUMBER(5) AUTO_INCREMENT PRIMARY KEY,
nom_joueur VARCHAR2(64),
prenom_joueur VARCHAR2(64),
qualification ENUM('Qualification' ,'Quart de finale' ,'Demi-finale','Finale'),
nationalite VARCHAR2(64)
sexe VARCHAR2(5)
); /*FAIT*/
INSERT INTO JOUEUR VALUES (1,'Nadal', 'Raphaël', 'Qualifi... |
Python | UTF-8 | 2,350 | 2.578125 | 3 | [] | no_license | #!/usr/bin/env python
# encoding: utf-8
from __future__ import absolute_import
import gevent
from gevent import monkey; monkey.patch_all()
from gevent import queue
from .job import Job
class GeventWorker():
@classmethod
def create(cls, wqueue, rqueue, greenlet_num = 8):
gw = cls(wqueue, rqueue)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.