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 | 2,198 | 3.53125 | 4 | [
"BSD-3-Clause"
] | permissive | # $begin two_levels.py$$ $newlinech #$$
#
# $section Using Two Levels of AD: Example and Test$$
#
# $index a2float$$
# $index two, AD levels$$
# $index levels, two AD$$
# $index AD, two levels$$
#
# $head Purpose$$
# This example is intended to demonstrate how
# $code a_float$$ and $code a2float$$
# can be used toget... |
PHP | UTF-8 | 206 | 3.625 | 4 | [] | no_license | <html>
<head>
<title> Example 4-13.The equality and identity operators</title>
</head>
<body>
<?php
$a = "1000";
$b = "+1000";
if ($a == $b) echo "1";
if ($a === $b) echo "2";
?>
</body>
</html> |
Java | ISO-8859-1 | 1,353 | 2.4375 | 2 | [] | no_license | package fr.sywoo.customsettings.listener.server;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import com.wasteofplastic.askyblock.ASkyBlockAPI;
import fr.sywoo.customsettings.player.IslandsSetting... |
C# | UTF-8 | 1,906 | 3.375 | 3 | [] | no_license | using System;
namespace Lab12_Roshambo_Game
{
class RoshamboApp
{
static void Main(string[] args)
{
Player randomPlayer = new RandomRoshamboPlayer("Rando");
Player rockPlayer = new RockPlayer("Brick");
int userScore = 0;
Console.WriteLine("Pleas... |
C# | UTF-8 | 1,120 | 2.875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common.Models;
using Data.Context;
namespace Data.Repository
{
class SportRepository:IRepository<Sport>
{
private ToteContext db;
public SportRepository(ToteContext contex... |
C++ | UTF-8 | 843 | 2.78125 | 3 | [] | no_license | #include <iostream>
#include "../library/lib.hpp"
class BPingvinPoloIMatrica
{
public:
void solve(std::istream& in, std::ostream& out)
{
ll n = read_ll();
ll m = read_ll();
ll d = read_ll();
vll vec = read_vll(m * n);
sort(all(vec));
ll first = vec[0];
forn(i, n * m)
{
vec[i] -= first;
... |
C++ | UTF-8 | 584 | 2.84375 | 3 | [] | no_license | #ifndef __COMPLEXOBJECT_H__
#define __COMPLEXOBJECT_H__
#include "simpleObject.h"
/**
* A complexObject is a simpleObject with mass & density...
*/
class complexObject : public simpleObject {
public:
complexObject(int x, int y, int z, int width, int height,
int mass, float density);
~complexObject();
... |
Java | UTF-8 | 573 | 2.125 | 2 | [
"Apache-2.0"
] | permissive | package io.quarkus.runtime.annotations;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation... |
C++ | UTF-8 | 15,315 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <tuple>
#include <unordered_map>
#include <numeric>
#include <algorithm>
#include <cassert>
template<class BiIter> bool next_combination_idx(int n, BiIter comb_first, BiIter comb_last)
{
int k = std::distance(comb_first, com... |
Swift | UTF-8 | 1,223 | 2.828125 | 3 | [] | no_license | //
// VideoPlayerContainerView.swift
// SwiftUIVideo
//
// Created by Gray Campbell on 5/3/20.
// Copyright © 2020 Gray Campbell. All rights reserved.
//
import AVKit
import SwiftUI
struct VideoPlayerContainerView: View {
@ObservedObject var viewModel: VideoViewModel
var body: some View {
ZSt... |
Java | UTF-8 | 1,047 | 2.421875 | 2 | [] | no_license | package org.usfirst.frc.team5010.auto.modes;
import org.usfirst.frc.team5010.auto.steps.AutonDriveForwardForTime;
import org.usfirst.frc.team5010.auto.steps.MoveArm;
import org.usfirst.frc.team5010.boulder.BoulderHandler;
import org.usfirst.frc.team5010.drivetrain.DriveTrainManager;
import edu.wpi.first.wpilib... |
PHP | UTF-8 | 9,072 | 3.046875 | 3 | [] | no_license | <?php
/*
Created by : Rhalf Wendel D Caacbay
Created on : 20170430
Modified by : #
Modified on : #
functions : Defines the class area and supplies the requests such as select, insert, update & delete.
*/
class Area implements IQuery {
public $id;
public $name;
public $desc;
public $coordinates... |
C++ | UTF-8 | 2,216 | 2.546875 | 3 | [] | no_license | // Copyright (C) 2010 Alessandro Bruni
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is di... |
Java | UTF-8 | 5,960 | 1.929688 | 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 TransferManagement;
import DepositEntity.Session.TransferSessionBeanLocal;
import Exception.TransferException;
import Exceptio... |
Python | UTF-8 | 3,826 | 3.296875 | 3 | [] | no_license | import copy
class Board:
BLACK = 0
WHITE = 1
TURN = 1
def __init__(self):
self.board = [
[None, None, None, None, None, None, None, None],
[None, None, None, None, None, None, None, None],
[None, None, None, None, None, None, None, None],
[None, None, None, None,... |
Java | UTF-8 | 1,613 | 2.578125 | 3 | [] | no_license | package com.orendel.transfer.dialogs;
import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.SWT;
import com.orendel.transfer.composites.AddBarcodeComposite;
import com.orendel.transfer.contr... |
Go | UTF-8 | 353 | 2.921875 | 3 | [] | no_license | package main
import (
"testing"
)
func TestWorldPopulationSet(t *testing.T){
// create a world
world,err := NewWorld(nil)
if err != nil{
t.Fatal("Failed to create World")
}
// set the population
world.SetPopulation(5)
// get the population
if world.Population() != 5{
t.Fatal("population getter didn't ret... |
Markdown | UTF-8 | 4,296 | 2.765625 | 3 | [] | no_license | # 投资中,大部分人一辈子都无法走出的思维误区! - 知乎
#

霜降之时,桂花遍地,有人喊,春天不远了。
不过,今天要不是金融、地产的护盘,大盘又会很难看。因为每只股票的权重不一样,上证指数经常是失真的,并不能代表市场所有股票的涨跌水平。
比如2015年6月12日,当时市场上总共27... |
Python | UTF-8 | 1,034 | 4.03125 | 4 | [] | no_license | #
# Copyright (c) 2006-2019, RT-Thread Development Team
#
# SPDX-License-Identifier: MIT License
#
# Change Logs:
# Date Author Notes
# 2019-07-27 SummerGift first version
#
# 集合(set)是由一个或数个形态各异的大小整体组成的,构成集合的事物或对象称作元素或是成员
# 基本功能是进行成员关系测试和删除重复元素
# 可以使用大括号 { } 或者 set() 函数创建集合,注意:创建一个空集合必须用 set() 而不... |
Java | UTF-8 | 1,739 | 2.390625 | 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 hibernate.builder;
import core.entities.Article;
import core.entities.Match;
import core.entities.User;
import cor... |
C++ | UTF-8 | 278 | 3.171875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int num, first = -1, sec = 1, count = 0, sum = 0;
cout << "Enter number: "; cin >> num;
while (count<=num)
{
sum = first + sec;
first = sec;
sec = sum;
count++;
}
cout << sum << endl;
return 0;
} |
C# | UTF-8 | 2,404 | 2.53125 | 3 | [] | no_license | using BazaPodataka;
using Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Servis
{
public class KvarServis : IKvarServis
{
IBaza _baza;
public KvarServis(IBaza baza)
{
this._baza = baza;
... |
Java | UTF-8 | 848 | 2.15625 | 2 | [] | no_license | package cn.com.crowdsourcedtesting.modelhelper;
import java.util.List;
import cn.com.crowdsourcedtesting.bean.Tester;
import cn.com.crowdsourcedtesting.struts.form.LoginForm;
import cn.com.crowdsourcedtesting.subinterface.RoleIdentify;
import cn.com.crowdtest.factory.*;
public class CheckAuthority implements RoleId... |
JavaScript | UTF-8 | 1,677 | 2.625 | 3 | [] | no_license | import React, { Component } from 'react';
import axios from "axios";
import PizzaUpdate from './pizzeriaupdate';
class PizzaDetail extends Component{
constructor(props) {
super(props);
this.state = {
showComponent: false,
};
this.updatePizzeriaDetails = this.updatePizzeria... |
Markdown | UTF-8 | 1,092 | 2.796875 | 3 | [] | no_license | File Downloader from Multiple Sources
============
This product has the function of downloading the files from multiple hosts, like HTTP, FTP or SFTP. Even this product can be enhanced in future to handle other type of protocols too.
Development
------
### Requirements
* JDK 8
* [Lombok](https://projectlombok.org/... |
Java | UTF-8 | 167 | 1.976563 | 2 | [] | no_license | package jeu;
public interface BoostStat {
public int renforceDefence();
public int renforceAttaque();
public void placerBaseEquipement(BoostStat be);
}
|
Shell | UTF-8 | 344 | 3.96875 | 4 | [] | no_license | #!/bin/bash
if [ "$#" -lt 1 ]; then
echo "USAGE: $0 TIME" >&2
echo "Exits at TIME." >&2
exit 255
fi
target=$(date -d "$1" +%s)
duration=$((target - $(date +%s)))
if [ "$duration" -lt 0 ]; then
echo "Time $(date -d "@$target") is in the past" >&2
exit 1
fi
echo "Waiting until $(date -d "@$target") ($duration seco... |
PHP | UTF-8 | 7,108 | 2.8125 | 3 | [] | no_license | <?php
namespace AppBundle\Entity\Calendar;
use DateTime;
use DateInterval;
use DateTimeZone;
use Doctrine\ORM\Mapping as ORM;
/**
* Class Event
* @package AppBundle\Entity\Calendar
*
* @ORM\Table(name="events")
* @ORM\Entity(repositoryClass="AppBundle\Repository\Calendar\EventRepository")
*/
class Event
{
... |
Java | UTF-8 | 4,015 | 1.726563 | 2 | [] | no_license | package com.jagex;
import com.jagex.Class149;
import com.jagex.Class21;
import com.jagex.Class243;
import com.jagex.InterfaceDef;
import com.jagex.Class357;
import com.jagex.Class429;
import com.jagex.Class51;
import com.jagex.RSByteBuffer;
import com.jagex.Class566;
import com.jagex.Class615;
import com.jagex.Class61... |
C | UTF-8 | 762 | 3.515625 | 4 | [] | no_license | #include "queue.h"
void queue_init(Queue *queue) {
queue->enqueue = enqueue;
queue->dequeue = dequeue;
queue->head = NULL;
queue->tail = NULL;
}
int enqueue(Queue *queue, void *item) {
int status = UNDEFINED;
if (queue) {
Node *node = (Node *) malloc(sizeof(Node));
node->item =... |
C++ | UTF-8 | 995 | 3.75 | 4 | [] | no_license | #include <iostream>
using namespace std;
int binary_search(int [], int, int);
int main()
{
int a[100], i, n, x;
cout<<"How many numbers do you want to enter : ";
cin>>n;
cout<<"\nPlease enter the elements : ";
for(i=0; i<n; ++i)
{
cout<<"\nElement "<<(i+1)<<" : ";
cin>>a[i];
}
cout<<"\nEnt... |
C++ | UTF-8 | 3,197 | 3.140625 | 3 | [] | no_license | #include "util.h"
#include "PacketBuffer.h"
PacketBuffer::PacketBuffer()
: readPos(0)
, writePos(0)
{
buffer.assign(0);
}
PacketBuffer::~PacketBuffer()
{
}
bool PacketBuffer::AppendBuffer(const char* pBuffer, uint16 size)
{
if (!pBuffer)
return false;
if (size == 0)
return false;... |
Python | UTF-8 | 672 | 3.828125 | 4 | [] | no_license |
def validate_string(input_string):
tmp_stack = []
for s in input_string:
if s == '{' or s == '[' or s == '(':
tmp_stack.append(s)
elif s == '}':
if len(tmp_stack) == 0 or tmp_stack.pop() != '{':
return False
elif s == ']':
if len(tmp_... |
JavaScript | UTF-8 | 2,578 | 3.5 | 4 | [] | no_license |
function average(sum, number) {
var av = sum / number;
av = av.toFixed(1);
av = av.replace('.', ',');
return av;
}
function numsort(a,b) {
return a - b;
}
function median(values) {
values.sort(numsort);
if (values.length % 2 == 1) {
return values[(values.length - 1)/2];
}
else {
var tmp = values[values... |
C | UTF-8 | 3,368 | 4.03125 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
struct Stack{
int size;
int top;
char* arr;
};
int isEmpty(struct Stack *ptr){
if(ptr->top == -1){
return 1;
}
return 0;
}
int isFull(struct Stack *ptr){
if(ptr->top == (ptr->size -1)){
return 1;
}
return 0;
}
int push(struct ... |
C++ | UTF-8 | 289 | 2.75 | 3 | [] | no_license | #include "Random.h"
#include <cstdlib>
#include <ctime>
void Random::SetRand()
{
SetRand((int)time(NULL));
}
void Random::SetRand(int seed)
{
srand(seed);
}
float Random::GetNumber()
{
return rand() / (int)RAND_MAX;
}
int Random::GetNumber(
int max
)
{
return 0 + rand() % max;
} |
Markdown | UTF-8 | 1,758 | 3.109375 | 3 | [
"MIT"
] | permissive | name: inverse
layout: true
class: center, middle, inverse
---
### STAT 430: Lecture 15
## Multiple Random Variables
### Functions of Jointly Distributed Random Variables 2
.footnote[Course page: [imouzon.github.io/stat430](https://imouzon.github.io/stat430)]
---
layout: true
class: center, middle, inverse
---
# A Quic... |
Markdown | UTF-8 | 1,467 | 3.09375 | 3 | [] | no_license | # LETTers Solution Report
- Date: 12 April 2018
- Author: JackieZhai
- Problem ID: [POJ3104](http://poj.org/problem?id=3468)
## Description modeling
- 有一些衣服,每件衣服有一定水量,有一个烘干机,每次可以烘一件衣服,每分钟可以烘掉M滴水
- 每件衣服没分钟可以自动蒸发掉一滴水,用烘干机烘衣服时不蒸发
- 问最少需要多少时间能烘干所有的衣服
## Points in solving
- 用二分法求解
- 题意是烘干机烘干的时候不会自然掉水
- 转化为烘干机每分钟掉M-1水,这... |
Swift | UTF-8 | 876 | 2.65625 | 3 | [] | no_license | //
// Navigator.swift
// TestSwift
//
// Created by jianqiang on 17/4/18.
// Copyright © 2017年 jianqiang. All rights reserved.
//
import Foundation
import UIKit
class Navigator {
static var myNavigator: Navigator? = nil;
private init() {
}
static func getInstance() -> Navigator ... |
Java | UTF-8 | 2,198 | 2.640625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* Copyright 2016 Jonathan Beaudoin
*
* 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 appl... |
C# | UTF-8 | 216 | 2.8125 | 3 | [] | no_license | using System;
namespace AdvancedWorld
{
public abstract class FemaleHuman : Human
{
public FemaleHuman(String name, int age)
: base(name, age, Sex.Female)
{
}
}
}
|
JavaScript | UTF-8 | 362 | 2.59375 | 3 | [] | no_license | function init() {
var canvas = document.getElementById("game_canvas");
var context = canvas.getContext('2d');
var spriteSheet = new Image();
spriteSheet.onload = function(){
context.drawImage(spriteSheet, 324, 0, 462, 140, 0, 0, 462, 140);
context.drawImage(spriteSheet, 83, 23, 15, 15, 35, 33, 15, 15);
};
spr... |
PHP | UTF-8 | 1,512 | 2.984375 | 3 | [] | no_license | <?php
class errorController extends Controller
{
//Inicializa las variables de la aplicación
public function __construct() {
parent::__construct();
}
//Crea la vista de error
public function index()
{
$this->_view->assign('titulo', 'Error');
$this->_view->assign('mensaje... |
Java | UTF-8 | 1,412 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | package com.jalat.logging;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.function.Supplier;
/**
* Logger over {@code SLF4J}
*
* @author Andrey Paslavsky
* @since 0.1
*/
final class Slf4jLogger implements Logger {
private final org.slf4j.Logger logger;
Slf4jLogger(Cl... |
Java | UTF-8 | 2,871 | 2.625 | 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 Business;
import java.sql.Date;
import java.util.ArrayList;
/**
*
* @author Eric
*/
public class CourseOffering {
... |
Java | UTF-8 | 602 | 3.53125 | 4 | [] | no_license | // Dawid Paluszak
// Pracownia PO, czwartek, s. 108
// L5, z1, Por�wnywalna hierarchia klas
// Figury
// Kolo.java
// 2018-03-29
// klasa przechowuj�ca ko�a
public class Kolo extends Figury
{
double promien;
public Kolo(double r)
{
promien = r;
}
@Override
public double pole()
{
return promi... |
C | UTF-8 | 612 | 3.4375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#define SSIZE_MAX 1048576 // 1MiB
int main(int argc, char **argv) {
int i;
int fd;
char buffer[SSIZE_MAX];
if (argc < 2) {
printf("Missing argument, aborting\n");
return EXIT_FAILURE;
}
for (i = ... |
C# | UTF-8 | 1,103 | 3.734375 | 4 | [
"MIT"
] | permissive | // Justification: Checking for null isn't discussed yet.
#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter04.Listing04_21;
public class TicTacToe // Declares the TicTacToe class
{
public static void Main()... |
Shell | UTF-8 | 1,023 | 2.65625 | 3 | [] | no_license | # vim: set noexpandtab ts=4 ft=sh:
# Gentoo Zope Instance configure tool config file.
#
# Originally written by Jason Shoemaker <kutsuya@gentoo.org>
# Portions by Jodok Batlogg <batlogg@gentoo.org> (Logging and some cleanups)
# Portions by Robin Johnson <robbat2@gentoo.org> (Documentation and further cleanup)
#
# Copyr... |
Java | UTF-8 | 1,016 | 3.296875 | 3 | [] | no_license |
import java.util.Scanner;
public class imcCalcul {
static Scanner read = new Scanner(System.in);
public static void main(String[] args) {
System.out.println("cc");
double taille = 1;
double poids = 1;
String restart;
do {
boolean error = true;
while (error) {
try {
System.out.println("Entr... |
Java | UTF-8 | 3,264 | 3.03125 | 3 | [] | no_license | // based on https://github.com/beryx/streamplify/blob/master/streamplify-examples/src/main/java/org/beryx/streamplify/example/Arrangements.java
// answer to https://github.com/beryx/streamplify/issues/7
package permutations;
import org.beryx.streamplify.combination.Combinations;
import org.beryx.streamplify.permutatio... |
Java | UTF-8 | 1,326 | 3.328125 | 3 | [] | no_license | import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
/*
1,创建DatagramSocket 对象 ,绑定端口号 要和发送端一致
2,创建字符数组接收数据
3,创建DatagramPacket 对象接收数据 空参即可
4,调用DatagramSpcket 类的receive方法
5,拆包
发送的IP地址
DatagramPacket getAd... |
Markdown | UTF-8 | 5,265 | 2.5625 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: 'Procedura: Creare una tabella a livello di codice'
ms.date: 03/30/2017
dev_langs:
- csharp
- vb
helpviewer_keywords:
- tables [WPF], creating programmatically
ms.assetid: e3ca88f3-6e94-4b61-82fc-42104c10b761
ms.openlocfilehash: 9c9061d3c4d6b3de5e1ab42a6b98c20813835ba8
ms.sourcegitcommit: 68653db98c5ea7744fd... |
Markdown | UTF-8 | 2,753 | 3 | 3 | [] | no_license | # StetsonHomeAutomation
Home automation (lights, audio, etc) for the Stetson household.
:warning: Abandonware! :warning:
* [Statement to Potential Employers](#statement-to-potential-employers)
This repo contains the half-finished abandonware attempt at creating a touch-sensitive panel for interacting with var... |
C | UTF-8 | 12,601 | 2.59375 | 3 | [] | no_license | /*
*------------------------------------------------------------------------------
* schedular.c
*
/*
*------------------------------------------------------------------------------
* Include Files
*------------------------------------------------------------------------------
*/
#include "board.h"
#include "config.... |
C# | UTF-8 | 274 | 3.765625 | 4 | [] | no_license | public static T CheckNull<T>(Func<T> canBeNull) where T : class
{
try
{
return canBeNull();
}
catch (NullReferenceException)
{
return default(T);
}
}
|
Python | UTF-8 | 852 | 2.984375 | 3 | [] | no_license | #feito no python 3.6.2
import struct
import sys
if len(sys.argv) != 2:
print ('USO %s [CEP]' % sys.argv[0])
quit()
registroCEP = struct.Struct("72s72s72s72s2s8s2s")
cepColumn = 5
print ("Tamanho da Estrutura: %d" % registroCEP.size)
f = open("cep_ordenado.dat","r")
line = f.read(registroCEP.size)
while line != "":
... |
JavaScript | UTF-8 | 435 | 3.609375 | 4 | [] | no_license | // Asked by Google
// Given a string input 'ABIJYAB'm return first recurrent letter - A.
// O(n)
const find = (str) => {
let cache = {};
for (let i = 0; i < str.length; i++) {
if (cache[str[i]]) {
return str[i];
}
cache[str[i]] = true;
}
}
let start = new Date().getTime();
let res = find('AKJ... |
Java | UTF-8 | 18,728 | 1.625 | 2 | [] | no_license | package binos.yarn;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.InetSocketAddress;
import java.net.URI;
import java.security.PrivilegedAction;
import ja... |
C | UTF-8 | 1,873 | 2.578125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include "msg.h"
#include "mem.h"
int memid, sem_salida, sem_hilos;
Msg *ptr_msg;
main()
{
fprintf(stderr, "Obteniendo segmento d... |
Java | UTF-8 | 938 | 2.21875 | 2 | [] | no_license | package com.eco.challengeuserservice.converter;
import com.eco.challengeuserservice.domain.ChallengePlayer;
import com.eco.challengeuserservice.dto.ChallengePlayerDto;
import javax.inject.Named;
import org.springframework.core.convert.converter.Converter;
import static com.eco.challengeuserservice.dto.builder.Challen... |
Markdown | UTF-8 | 507 | 2.53125 | 3 | [] | no_license | # Article 696-6
Sous réserve des exceptions prévues à l'article 696-34, l'extradition n'est accordée qu'à la condition que la personne
extradée ne sera ni poursuivie, ni condamnée pour une infraction autre que celle ayant motivé l'extradition et antérieure à
la remise.
**Liens relatifs à cet article**
_Codifié par_:... |
Python | UTF-8 | 6,087 | 2.859375 | 3 | [] | no_license | import open3d as o3d
import numpy as np
import utils
def edge_hash(p1, p2):
mid = (p1+p2)/2
return "%f %f %f" % (mid[0], mid[1], mid[2])
def edge_hash2(p1, p2):
if p1 < p2:
return "%d %d" % (p1, p2)
else:
return "%d %d" % (p2, p1)
def loop_subdivision(vertices, triangles, save_name... |
C++ | UTF-8 | 506 | 3.1875 | 3 | [] | no_license | #include<iostream>
#include<string>
#include<cmath>
using namespace std;
double Factorial(int i){
double ans = 1;
for (int i = i;i >=1;i--){
ans *= i;
}
return ans;
}
double func(double x,double n){
if (n == 1){
return x;
}
else{
double ans = pow(doubl... |
Markdown | UTF-8 | 2,134 | 2.890625 | 3 | [
"MIT"
] | permissive | # Available Beer Visualizer
ABV is a very simple POS system for beverages with no capacity for handling payment methods. Free as in beer! Its also free as in speech under the MIT license, so feel free to use it as a baseline for your own projects!
## Configuration
ABV expects a file named config.toml to exist in the... |
Markdown | UTF-8 | 590 | 3.3125 | 3 | [
"Apache-2.0"
] | permissive | # CouldBeSequence
Long chains of collection operations will have a performance penalty due to a new list being created for each call. Consider using sequences instead. Read more about this in the [documentation](https://kotlinlang.org/docs/sequences.html)
## Noncompliant Code
```kotlin
listOf(1, 2, 3, 4).map { it*2 ... |
Java | WINDOWS-1252 | 4,137 | 2.78125 | 3 | [] | no_license | package uebung11;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTextField;
import javax.swing.JLabel;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.text.DecimalF... |
Java | UTF-8 | 1,649 | 2.234375 | 2 | [] | no_license | package com.hzyw.basic.vo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
import java.io.Serializable;
import java.util.List;
/**
* @author haoyuan
* @date 201... |
C# | UTF-8 | 1,482 | 3.71875 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Algorithms.Sorting
{
class QuickSort : ISort
{
public int[] Sort(int[] arr)
{
QuickSortRecursive(ref arr, 0, arr.Length - 1);
return arr;
... |
C# | UTF-8 | 953 | 2.625 | 3 | [] | no_license | using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using UITests.Models;
namespace APITests
{
class ForecastContext
{
private string Url = "https://www.metaweather.com/api/";
public async Task<WeatherF... |
C | UTF-8 | 2,092 | 3.875 | 4 | [] | no_license | #include "CException.h"
#include "OutStream.h"
#include "ErrorCode.h"
#include <stdio.h>
#include <malloc.h>
/*To open a file with write method for writing
*
*Input: *fileName -> the file name.
* *openMethod -> open method ("w" for write, "r" for read)
*
*Output:outStream -> pointer to OutStream struct
*
... |
Java | UTF-8 | 9,346 | 1.976563 | 2 | [] | no_license | package br.eletrosom.portalcolaborador.controller;
import java.io.IOException;
import java.security.Principal;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;
... |
Python | UTF-8 | 821 | 2.984375 | 3 | [] | no_license | from __future__ import print_function
import argparse
import cv2
# path = ./trex.png
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required = True, help = "Path to the image") # argument is path to image on disk
args = vars(ap.parse_args()) # parse arguments and store in dictionary
image = cv2.imr... |
JavaScript | UTF-8 | 3,289 | 2.65625 | 3 | [
"MIT"
] | permissive | APPNAME = 'WeatherApp';
angular
.module(APPNAME, ['ui.router', 'ngAnimate'])
.run(['$rootScope', '$state', '$stateParams', function ($rootScope, $state, $stateParams)
{
// It's very handy to add references to $state and $stateParams to the $rootScope
// so that you can access them from any scope within you... |
C++ | UTF-8 | 1,085 | 3.234375 | 3 | [] | no_license | const int tempPin = A0;
int incomingByte;// incoming data
void setup() {
Serial.begin(9600); // initialization
pinMode(LED_BUILTIN, OUTPUT);
Serial.println("Press 1 to LED ON or 0 to LED OFF...");
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); ... |
PHP | UTF-8 | 1,046 | 2.609375 | 3 | [
"BSD-3-Clause"
] | permissive | <?php defined('SYSPATH') or die('No direct script access.');
class Controller_Register extends Controller
{
public function action_index()
{
$post = $this->request->post();
$ret = '';
if(isset($post['submit']))
{
$firstname = $post['firstname'];
$lastname = $post['las... |
Java | UTF-8 | 919 | 1.867188 | 2 | [] | no_license | package com.hiekn.metacloud.feign;
import cn.hiboot.mcn.core.model.result.RestResp;
import com.hiekn.metacloud.feign.bean.UserBean;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.s... |
Java | UTF-8 | 320 | 1.71875 | 2 | [] | no_license | package com.hxy.nzxy.stexam.center.region.service;
import com.hxy.nzxy.stexam.center.region.domain.StudentRegionQueryDO;
import com.hxy.nzxy.stexam.common.utils.Query;
import java.util.List;
public interface StudentRegionQueryService {
List<StudentRegionQueryDO> list(Query query);
int count(Query query);
}
|
Markdown | UTF-8 | 3,154 | 2.890625 | 3 | [
"MIT"
] | permissive | # flydrive-google-drive
This is GoogleDrive access driver for [node-flydrive](https://github.com/Slynova-Org/node-flydrive) library
## Dependencies
This package depends on google-auth-library, you can get it by running
`npm i --save google-auth-library`
The ``google-auth-library`` permits using OAuth for google dri... |
C | UTF-8 | 514 | 4.03125 | 4 | [] | no_license | /*
Program: pattern.c
Author: Van Nguyen
Date Created: 9/25/2018
Description: This program prints letters from F to A in a pattern
*/
#include <stdio.h>
#define ROWS 6
void pattern(void);
int main(void)
{
pattern();
getchar();
getchar();
return 0;
}
void pattern(void)
{
char ch;
int ro... |
JavaScript | UTF-8 | 2,652 | 2.546875 | 3 | [] | no_license | //All database request that are made from server side
import { db } from "./firebase-admin";
import { compareDesc, parseISO } from "date-fns";
export async function getAllBakers() {
const snapshot = await db.collection("users").get();
const sites = [];
snapshot.forEach((doc) => {
sites.push({ id: doc.id, ...... |
JavaScript | UTF-8 | 2,031 | 2.53125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | (function(module) {
"use strict";
var requestify = require('requestify');
var BugzillaAPIMethod = {
BUG_GET: 'Bug.get',
BUG_SEARCH: 'Bug.search',
BUG_COMMENT: 'Bug.comments'
};
var BugzillaClient = function (options) {
options = options || {};
this.username = options.username;
this... |
Python | UTF-8 | 989 | 2.53125 | 3 | [] | no_license | import RPi.GPIO as gp
import pyrebase
from credentials import firebaseConfig
from time import sleep
import sys
gp.setmode(gp.BOARD)
inp = 7
#out = 11
if __name__ == '__main__':
gp.setup(11,gp.OUT)
gp.setup(inp,gp.IN)
#gp.setup(out,gp.OUT)
firebase = pyrebase.initialize_app(firebaseConfig)
db = firebase.database()... |
Java | UTF-8 | 2,265 | 1.914063 | 2 | [] | no_license | /**
*
*/
package com.vn.ael.persistence.manager;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.vn.ael.constants.AELConst;
im... |
Java | UTF-8 | 11,276 | 2.453125 | 2 | [
"MIT"
] | permissive | package co.edu.udea.optimizacion;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import org.apache.commons.math3.geometry.euclidean.threed.Line;
import org.apache.commons.... |
Java | UTF-8 | 476 | 2.765625 | 3 | [] | no_license | package znetwork;
import java.io.Serializable;
public class Packet implements Serializable {
private static final long serialVersionUID = 1L;
public enum Type {
}
private Type type;
private Object data;
public Packet(Type type, Object data) {
this.type = type;
... |
Markdown | UTF-8 | 4,239 | 2.546875 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: TLSGetServerCertificate function
description: Returns the certificate of the Remote Desktop license server.
ms.assetid: 7a31e7f9-f6d6-4030-b7db-43be118bb158
ms.tgt_platform: multiple
keywords:
- TLSGetServerCertificate function Remote Desktop Services
topic_type:
- apiref
api_name:
- TLSGetServerCertificate
... |
Python | UTF-8 | 2,062 | 2.53125 | 3 | [] | no_license | #coding=utf-8
import sys
import numpy as np
reload(sys)
sys.setdefaultencoding('utf-8')
thre = int(sys.argv[1])
fr = open('../data/corpus_train.txt','r')
class_types = {}
class_types_num = 0
all_text = []
while True:
line = fr.readline()
if not line:
break
content = line.strip().split()
all_text.append(content)... |
PHP | UTF-8 | 825 | 2.859375 | 3 | [
"MIT"
] | permissive | <?php namespace App\Http;
use Illuminate\Http\Request as BaseRequest;
class Request extends BaseRequest
{
protected $foo;
public function __construct()
{
parent::__construct();
// Do your set up here, for example:
$this->yourAttribute = 'foo';
}
/**
* Get a unique f... |
Python | UTF-8 | 3,752 | 3.046875 | 3 | [] | no_license | from Tkinter import *
import random
import sys
import sha
import math
class App:
def __init__(self, master):
frame = Frame(master)
frame.pack(padx=10, pady=10)
self.useNumbers = BooleanVar(master, True, None)
self.useSymbols = BooleanVar(master, True, None)
... |
Python | UTF-8 | 875 | 3.234375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
class Solution(object):
def findShortestSubArray(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
res = dict()
for index, num in enumerate(nums):
if num in res:
res[num].append(index)
else:
... |
Markdown | UTF-8 | 2,424 | 2.84375 | 3 | [] | no_license | # Data_Science_Manutencao
# Departamento de Manutenção
- **IA e ML estão transformando a indústria, principalmente os departamentos de produção e manutenção**
- **De acordo com o relatório do World Economic Forum, essas tecncologias terão grande impacto na indústria 4.0.**
- Departamento de manutenção
... |
C++ | UTF-8 | 7,899 | 2.984375 | 3 | [] | no_license | /* Client.h -- Card Game Client
Desktop Application
Lucas Weisensee
January 2015
Stores info for current Client
allows for:
-connection info to be stored and monitored
-packages to be sent
-name
-device
************************TO DO**********************
--Implement connection closed error instead of... |
Java | UTF-8 | 1,266 | 2.359375 | 2 | [] | no_license | package com.example.post;
import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@Entity
@Table(name = "POST")
public class Post implements Serializable {
private static final long serialVersionUID = 7548395543L;
@Id
@GeneratedValue(strategy = Generat... |
PHP | UTF-8 | 197 | 2.6875 | 3 | [] | no_license | <?php
$myfile = fopen("files/newfile.txt","w");
$data = "New Data Inserted";
$filecreated=fwrite($myfile,$data);
if($filecreated){
echo "Inserted Data Successfully";
}
fclose($myfile);
?> |
Java | UTF-8 | 2,698 | 2.375 | 2 | [] | no_license | package com.egfds.vinshop.controllers;
import com.egfds.vinshop.models.Attribute;
import com.egfds.vinshop.models.AttributeList;
import com.egfds.vinshop.models.ProductType;
import com.egfds.vinshop.services.ProductService.*;
import org.springframework.core.style.StylerUtils;
import org.springframework.stereotype.Cont... |
PHP | UTF-8 | 2,456 | 3.40625 | 3 | [] | no_license | <?php
namespace App;
use App\Exceptions\InvaliidParametersException;
class RandomCodesGenerator
{
/**
* default possible characters
*
* @var string
*/
private $possibleCharacters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
/**
* method to generate code
... |
Python | UTF-8 | 877 | 3.40625 | 3 | [] | no_license | import sys
def handle_case(line):
cakes = line.strip()
def check(cakes):
return cakes == '+'*len(cakes)
def swap(cakes):
new=[]
for cake in cakes:
if cake == '+':
new.append('-')
else:
new.append('+')
return new
... |
Markdown | UTF-8 | 3,019 | 3.3125 | 3 | [] | no_license | # Diversity, Inclusion and Belonging
https://www.linkedin.com/learning/diversity-inclusion-and-belonging
Summary: this is a really upbeat and short course explaining the benefits of
nurturing diversity, inclusion and belonging in an organisation.
People want to feel like they belong to a community, that they have
ps... |
Markdown | UTF-8 | 2,181 | 3.75 | 4 | [
"MIT"
] | permissive | ---
metaTitle: "PHP - Object Serialization"
description: "Serialize / Unserialize, The Serializable interface"
---
# Object Serialization
## Serialize / Unserialize
`serialize()` returns a string containing a byte-stream representation of any value that can be stored in PHP. `unserialize()` can use this string to... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.