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 |
|---|---|---|---|---|---|---|---|
TypeScript | UTF-8 | 486 | 2.9375 | 3 | [
"MIT"
] | permissive | import { IterableX } from '../../iterable/iterablex';
import { except } from '../../iterable/except';
/**
* @ignore
*/
export function exceptProto<TSource>(
this: IterableX<TSource>,
second: Iterable<TSource>,
comparer?: (x: TSource, y: TSource) => boolean
): IterableX<TSource> {
return except(this, second, ... |
Java | UTF-8 | 2,034 | 2.046875 | 2 | [] | no_license | package torclms.controller;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework... |
Rust | UTF-8 | 777 | 2.84375 | 3 | [
"MIT"
] | permissive | /**
* 5622. 다이얼
*
* 작성자: xCrypt0r
* 언어: Rust 2018
* 사용 메모리: 13,024 KB
* 소요 시간: 0 ms
* 해결 날짜: 2020년 10월 12일
*/
macro_rules! get_line {
( $( $t: ty ),+ ) => {
{
let mut line = String::new();
std::io::stdin().read_line(&mut line).unwrap();
let mut iter = line.spl... |
JavaScript | UTF-8 | 1,036 | 2.71875 | 3 | [] | no_license | const fs = require('fs')
const yaml = require('js-yaml')
const api = require('./api')
try {
let flights = yaml.safeLoad(fs.readFileSync('src/data/flights.yml', 'utf8'))
// obtain all airport codes
const airports = [
...new Set([...flights.map((a) => a.from), ...flights.map((a) => a.to)]),
]
let coordina... |
C# | UTF-8 | 6,179 | 2.796875 | 3 | [
"MIT"
] | permissive | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Runtime.Versioning;
namespace System.IO
{
public sealed class FileStreamOptions
{
private FileMode _mode = FileMode.Open;
private FileAccess _ac... |
Python | UTF-8 | 2,834 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | from random import randint
from hashlib import md5
from datetime import datetime
from dateutil.parser import parse as dateparse
import sqlite3
import contextlib
DEFAULT_TOKEN_STORE_DB = './token_store.db'
class TokenStore:
def __init__(self, store_db_location=DEFAULT_TOKEN_STORE_DB):
self._store_db = sto... |
TypeScript | UTF-8 | 596 | 2.8125 | 3 | [] | no_license | import { Persona } from "../persona/persona";
export class Usuario extends Persona{
/**
* El id único del usuario.
*/
public id: number;
/**
* El correo único del usuario.
*/
public correo: string;
/**
* La contraseña del usuario.
*/
public contrasena: string;
/**
... |
C++ | UTF-8 | 1,424 | 2.765625 | 3 | [] | no_license | #include "datastructure.h"
#include <iostream>
#include <sstream>
#include <fstream>
#include <OpenEXRConfig.h>
#include <ImfRgbaFile.h>
#include <ImfArray.h>
#include <ImfNamespace.h>
#include <half.h>
int ReadEXRtoTextureData(string path, TextureDataFloat& out, float scale) {
Imf::Array2D<Imf::Rgba> exrImage;
int... |
JavaScript | UTF-8 | 724 | 2.875 | 3 | [] | no_license | const db = require('./lib/db');
const con = db.connect();
let sql ='';
sql ='SELECT * FROM users';
con.query(sql,(err,results) => {
results.forEach((user) => {
console.log(user.id);
console.log(user.email);
})
});
sql = 'SELECT * FROM users WHERE ?';
let params = {}
params= { id: 3 }
con.qu... |
Java | UTF-8 | 6,310 | 1.84375 | 2 | [] | no_license | package com.api.ows.common.soap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.util.Date;
import java.util.List;
//import javax.xml.soap.*;
import jakarta.xml.soap.*;
import javax.xml.transform.*;
import javax.xml.transform.d... |
C++ | UTF-8 | 1,135 | 3.328125 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
private:
TreeNode* buildTree(vector<int>& inorder, vector<int>& postorder, int inBegin, int inEnd, int ... |
PHP | UTF-8 | 2,870 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace App\Book\Domain\Model\Review\Event;
use App\Book\Domain\Model\Book\BookId;
use App\Book\Domain\Model\Review\Author;
use App\Book\Domain\Model\Review\Body;
use App\Book\Domain\Model\Review\Rating;
use App\Book\Domain\Model\Review\ReviewId;
use App\Core\Domain\DomainEvent;
use ... |
Shell | UTF-8 | 1,468 | 3.484375 | 3 | [
"CC-BY-4.0"
] | permissive | # audit_inetd_logging
#
# The inetd process starts Internet standard services and the "tracing" feature
# can be used to log information about the source of any network connections
# seen by the daemon.
# Rather than enabling inetd tracing for all services with "inetadm -M ...",
# the administrator has the option of en... |
Java | UTF-8 | 117 | 1.84375 | 2 | [] | no_license | package fun.box.test.task.mapper;
public interface Mapper<E, F> {
E fromForm(F form);
F toForm(E entity);
}
|
Markdown | UTF-8 | 22,041 | 2.9375 | 3 | [
"MIT"
] | permissive | ---
title: Create a REST client using .NET Core
description: This tutorial teaches you a number of features in .NET Core and the C# language.
date: "2017-02-14"
ms.assetid: 51033ce2-7a53-4cdd-966d-9da15c8204d2
tags: ["animals", "Chicago", "zoos"]
---
# REST client
## Introduction
This tutorial teaches you a number of... |
Markdown | UTF-8 | 693 | 2.8125 | 3 | [
"MIT"
] | permissive | Audio Switcher
==============
Audio Switcher is a simple app that runs in the notification area (system tray) that lets you easily switch the default input and output audio devices.
Tired of having to perform a song and dance through the Windows Sound dialogs just to switch from your speakers to your headphones? Then... |
C++ | UTF-8 | 2,265 | 3.359375 | 3 | [] | no_license | #include "pch.h"
#include <iostream>
#include <string>
#include <assert.h>
#include <vector>
using namespace std;
//class Solution {
//public:
// int list[58] = { 0 };
//
// string minWindow(string s, string t) {
// if (s.size() == 0)
// return "";
// int min = 999;
// int res_l = 0;
// int res_r = 0;
// int... |
Swift | UTF-8 | 3,235 | 3.03125 | 3 | [] | no_license | //
// NameOnboardingViewController.swift
// Contact
//
// Created by Andrew O'Brien on 12/12/19.
// Copyright © 2019 Andrew O'Brien. All rights reserved.
//
import UIKit
class NameOnboardingViewController: OnboardingViewController {
let firstNameTextField = OnboardingTextField(placeholder: "first name", keybo... |
TypeScript | UTF-8 | 1,057 | 2.84375 | 3 | [
"MIT"
] | permissive | import Switch from './Args/Switch'
import ArgCollection from './ArgCollection'
abstract class Parser {
static parse(args: string[]): ArgCollection {
const argCollection = new ArgCollection()
let index = 0
let currentArg = args[index]
while (currentArg && !Switch.isSwitch(currentArg)) {
argColle... |
Python | UTF-8 | 1,606 | 3.03125 | 3 | [] | no_license | #Serhii Maltsev sm5zj
import urllib.request
stream = urllib.request.urlopen("http://cs1110.cs.virginia.edu/files/words.txt")
text = stream.readlines()
arrayOfWords = []
for line in text:
arrayOfWords.append(line.decode("UTF-8").strip(".?!,()\"'\n").split("|"))
#
for i in arrayOfWords:
i[0] = i[0].lower()
#
... |
JavaScript | UTF-8 | 1,901 | 3.75 | 4 | [] | no_license | /* new Number(value) */
/* properties */
console.log("MAX_VALUE: ", Number.MAX_VALUE);
console.log("MIN_VALUE: ", Number.MIN_VALUE);
console.log("NAN -> ", Number.NaN);
console.log("NEGATIVE_INFINITY ->", Number.NEGATIVE_INFINITY);
console.log("POSITIVE_INFINITY ->", Number.POSITIVE_INFINITY);
var num = new Number(4... |
Markdown | UTF-8 | 11,358 | 3.109375 | 3 | [] | no_license | ---
title: Quotes 2015
date: 2015-12-22
tags: quotes
slug: quotes2015
---
> The thing about keeping notebooks is that you have to revisit them in order to make the most out of them.
— Austin Kleon in Show Your Work!
#### On Business
> Frogs get better and better at catching flies, while flies get better and better... |
Java | UTF-8 | 3,995 | 2.3125 | 2 | [] | no_license | package com.partspot.entities;
public class CreditCardDetails {
String cardType;
String cardNumber;
String nameOnCard;
String month;
String year;
String cvv;
String address;
String validEmailId;
String validPassword;
String partNumber;
String legacyPartNumber;
String poNumber;
String gues... |
Java | UTF-8 | 3,420 | 2.140625 | 2 | [] | no_license | package com.beimin.eveapi.corporation.sheet;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import com.beimin.eveapi.core.AbstractContentHandler;
public class CorpSheetHandler extends AbstractContentHandler {
private CorpSheetResponse response;
private ApiCorpLogo logo;
private boolean divisions;... |
Java | UTF-8 | 3,059 | 2.390625 | 2 | [] | no_license | package com.dongci.sun.gpuimglibrary.player;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.util.Log;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
... |
PHP | UTF-8 | 4,214 | 2.90625 | 3 | [] | no_license | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once(APPPATH . 'models/Authenticated_user.php');
class Sys_user_model extends EB_Model implements Authenticated_user {
protected $_session_name = '_USER';
protected $_table_name = 'sys_users';
/**
* This will verify the user l... |
Java | UTF-8 | 2,366 | 2.1875 | 2 | [] | no_license | package edu.udec.controller;
import java.util.List;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.spring... |
PHP | UTF-8 | 1,395 | 3.578125 | 4 | [] | no_license | <?php
namespace App\Model;
// Note: This would work better if it made use of a proper set (data structure) class.
final class Strip implements \Serializable, \JsonSerializable
{
private $colours = [];
public function addColour(Colour $colour): self
{
$name = $colour->getName();
if (isset... |
C | UTF-8 | 436 | 3.09375 | 3 | [] | no_license | //
// testing.c
// ENGGEN 131 C Project
//
// Created by Pradyun Setti on 5/10/21.
//
#include <stdio.h>
#include "functions.h"
#include "constants.h"
int main(void) {
int floor[NUM_ROWS][NUM_COLS];
InitialiseFloorAlt(floor, 'T', 2);
AddContainerAlt(floor, 9, 3, 0);
AddContainerAlt(floor, 13, 5, 1);... |
Python | UTF-8 | 328 | 2.921875 | 3 | [] | no_license | import numpy as np
vec1 = np.array([0., 1., 2., 3., 4.])
vec2 = np.arange(0, 5, 1, dtype=float)
vec3 = np.linspace(0, 4, 5)
vec4 = np.zeros(5)
for i in range(5):
vec4[i] = i
vec5 = np.loadtxt("data.txt")
print("vec1:", vec1)
print("vec2:", vec2)
print("vec3:", vec3)
print("vec4:", vec4)
print("vec5:",... |
Ruby | UTF-8 | 2,825 | 2.734375 | 3 | [] | no_license | require 'cora'
require 'siri_objects'
require 'pp'
require 'xbmc-lib'
#######
# Plugin for controlling XBMC via SiriProxy
#
# This is a VERY early version and isn't really useful yet.
######
class SiriProxy::Plugin::XBMC < SiriProxy::Plugin
def initialize(config)
xbmc_uri = config["xbmc_uri"]
xbmc_username... |
JavaScript | UTF-8 | 1,221 | 3.921875 | 4 | [] | no_license | /*
pattern that allow us to create communication between objects with different type
also gives centralized abstraction that allows objects group interact through each other
Example: users and chat
*/
class User {
constructor(name) {
this.name = name;
this.room = null;
}
send... |
Shell | UTF-8 | 4,610 | 3.15625 | 3 | [] | no_license | #!/bin/bash
# Setup Development Project
if [ "$#" -ne 1 ]; then
echo "Usage:"
echo " $0 GUID"
exit 1
fi
GUID=$1
echo "Setting up Parks Development Environment in project ${GUID}-parks-dev"
# Code to set up the parks development project.
# To be Implemented by Student
oc policy add-role-to-user edit syst... |
Shell | UTF-8 | 867 | 3.453125 | 3 | [] | no_license | #!/bin/sh
indent() {
sed -u 's/^/ /'
}
echo "-----> Install pdf2json"
BUILD_DIR=$1
VENDOR_DIR="vendor/pdf2json"
PDF2JSON_VERSION=0.71
DOWNLOAD_URL="https://github.com/flexpaper/pdf2json/releases/download/$PDF2JSON_VERSION/pdf2json-$PDF2JSON_VERSION.tar.gz"
echo "Downloading sources" | indent
cd $BUILD_DIR
mk... |
C++ | UTF-8 | 568 | 2.6875 | 3 | [] | no_license | /*
* file: linkedlist.h
* class: linkedlist
*
* description:
*
*
* copyright:
*/
#ifndef LINKEDLIST_H
#define LINKEDLIST_H
#include <element.h>
using namespace std;
class linkedlist
{
public:
linkedlist();
~linkedlist();
int push(char(*ptr));
char *pop();
int setHead(element *set)... |
Markdown | UTF-8 | 18,609 | 3.125 | 3 | [] | no_license | ---
title: Guava RateLimiter分析
date: 2018/07/30 10:28:00
---
Guava的RateLimiter提供的令牌桶算法可以用于平滑突发限流(`SmoothBursty`)和平滑预热限流(`SmoothWarmingUp`)实现
<!-- more -->
# SmoothBursty
平滑突发限流(`SmoothBursty`)顾名思义,就是允许突发的流量进入,后面再慢慢地平稳限流。
`SmoothBursty`的demo:
```java
RateLimiter rateLimiter = RateLimiter.create(1.0);
Arrays.asList(6... |
JavaScript | UTF-8 | 10,576 | 2.765625 | 3 | [
"MIT"
] | permissive | import { intersection } from 'underscore';
import request from 'request-promise';
import compromise from 'nlp_compromise';
import { sentences as seperateSentences } from 'sbd';
// Uses spacy to deconstruct text into a dependancy parse tree
function parse(text) {
return request.post('http://localhost:5000/parse', {
... |
C++ | UTF-8 | 967 | 3.203125 | 3 | [] | no_license | // Program for Multilevel inheritance
#include<iostream.h>
#include<conio.h>
class student
{
protected:
int rno;
char name[20];
public:
void getdata()
{
cout<<"\n Roll Number:";
cin>>rno;
cout<<"\n Name:";
cin>>name;
}
void putdata()
{
cout<<"\nRoll No \t Name\n\n";
cout<<rno<<"\... |
Markdown | UTF-8 | 816 | 2.921875 | 3 | [] | no_license | # Do-Not-Play-Twice Maker
A script that merges two ogg files into one to make a "DO NOT PLAY THIS AUDIO FILE TWICE" discord thing.
This was made possible thanks to this video: https://www.youtube.com/watch?v=5F_fIlNYfPQ
### Usage
Replace `1.ogg` and `2.ogg` with the audio files of your choice and run `dnpt_mak... |
Java | UTF-8 | 6,088 | 1.695313 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... |
C++ | UTF-8 | 1,024 | 3.40625 | 3 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
std::vector<int> to_v... |
PHP | UTF-8 | 1,250 | 2.765625 | 3 | [] | no_license | <?php
namespace App\Helper;
use App\Dto\NodeDto;
use Fpdf\Fpdf;
class PDF extends FPDF
{
function generateTable($header, $data)
{
// Colors, line width and bold font
$this->SetFillColor(255,0,0);
$this->SetTextColor(255);
$this->SetDrawColor(128,0,0);
$this->SetLineWi... |
TypeScript | UTF-8 | 313 | 2.671875 | 3 | [] | no_license | export class ColorGenerator {
constructor() {}
static generateColor(): string {
console.log("genrating color");
return "rgba("
+ Math.floor(Math.random() * 255)+ ","
+ Math.floor(Math.random() * 255)+ ","
+ Math.floor(Math.random() * 255)+ ","
+ "1)";
}
} |
Markdown | UTF-8 | 18,102 | 2.75 | 3 | [
"CC0-1.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | The conceptual knowledge architecture for the CPG describes how the concepts from a guideline and its recommendations described in the preceding sections are realized as computable knowledge assets. The CPG knowledge architecture provides the framework through which the knowledge engineering team realizes the guideline... |
PHP | UTF-8 | 4,281 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
if (!isset($_SERVER['argv'][1])) {
die('usage: php '. $_SERVER['argv'][0] .' posta.xls' . PHP_EOL);
exit;
}
require('vendor/autoload.php');
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
use PhpOffice\PhpSpreadsheet\IOFactory;
$outputDir = 'data';
$spreadsheet = \... |
Java | UTF-8 | 515 | 1.984375 | 2 | [
"MIT"
] | permissive | package io.github.chme.dbdocgenerator.model;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.Builder;
import lombok.Data;
@Data
@Builder
public class Table {
String catalog;
String schema;
String name;
String type;
String remarks;
String sq... |
Markdown | UTF-8 | 8,315 | 3.84375 | 4 | [] | no_license | ---
title: Grammatical Case
layout: default
---
# Grammatical case
If you're already familiar with German, Russian, Hungarian, Latin, or any number of Medieval languages, you're already familiar with noun cases and how they function. If this is your first time learning about them, understanding the grammatical cases ... |
PHP | UTF-8 | 222 | 2.953125 | 3 | [] | no_license | <?php
$a=array(1,2,3,4,5,6,7,8,9,10);
$search=40;
$valid=0;
for($i=0;$i<count($a);$i++){
if($search==$a[$i]){
echo $search." founded.";
$valid=1;
break;
}
}
if(!$valid)
echo $search." not founded!";
?> |
Java | UTF-8 | 156 | 1.679688 | 2 | [] | no_license | package sebaszczen.services;
import sebaszczen.model.cityModel.City;
import java.util.List;
public interface CityService {
List<City> findAll();
}
|
Python | UTF-8 | 1,852 | 2.890625 | 3 | [] | no_license | # CSC 370 - Spring 2018 - Starter code for Assignment 4
#
# The code below generates a mockup of the output of report_transcript.py
# as specified in the assignment. You can copy and paste the functions in this
# program into your solution to ensure the correct formatting.
#
# B. Bird - 02/26/2018
#
# Nikola Rados
# V0... |
Ruby | UTF-8 | 2,417 | 2.921875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | class VentureCapitalist
@@all = []
attr_accessor :name, :total_worth
def initialize(options)
@name = options[:name]
@total_worth = options[:total_worth]
@@all.push(self)
end
def self.all
@@all
end
def self.tr... |
Java | UTF-8 | 1,504 | 2.125 | 2 | [] | no_license | package beans.pagination.service;
import beans.pagination.model.PageableDto;
import beans.pagination.model.SortDto;
import beans.pagination.repository.PageableEntityRepository;
import beans.pagination.repository.entity.PageableEntity;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
... |
Java | UTF-8 | 2,966 | 2.75 | 3 | [] | no_license | package pk.tune.saad.studentregistration.view;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.... |
Markdown | UTF-8 | 2,320 | 2.703125 | 3 | [] | no_license | <!--
**newneeew/newneeew** is a ✨ _special_ ✨ repository because its `README.md` (this file) appears on your GitHub profile.
Here are some ideas to get you started:
- 🔭 I’m currently working on ...
- 🌱 I’m currently learning ...
- 👯 I’m looking to collaborate on ...
- 🤔 I’m looking for help with ...
- 💬 Ask me a... |
Python | UTF-8 | 8,775 | 2.75 | 3 | [] | no_license | #!/usr/bin/env python3
#
from p_import import *
#print(sys.path)
#
# Aim of this code:
# (1) Read paper data file, which is the output of "arxiv_astroph_data_downloader.py"
# (2) Convert paper titles and abstracts into word vectors
# (3) Use Machine Learning to sort papers into pre-defined scientific categories
# ... |
Python | UTF-8 | 1,263 | 4.3125 | 4 | [] | no_license | # In the example there is an abstract class Payment that has an abstract method payment().
# There are two child classes CreditCardPayment and MobileWalletPayment derived from Payment
# that implement the abstract method payment() as per their functionality.
# As a user we are abstracted from that implementation whe... |
Python | UTF-8 | 1,115 | 2.59375 | 3 | [
"MIT"
] | permissive | import os, argparse, json
from models.bee_simple import Bee_simple
from models.bee import Bee_vgg
dir = os.path.dirname(os.path.realpath(__file__))
print('Loading datasets')
with open(dir + '/dataset/data.json') as data_file:
data = json.load(data_file)
train_data = data['train_data']
dev_data = data... |
TypeScript | UTF-8 | 1,167 | 3 | 3 | [] | no_license | /// <reference path="2-interfaces.ts" />
namespace multiFiles.classes{
export class JsonAbleString implements multiFiles.interfaces.IJson{
private str: string;
constructor(str: string){
this.str = str;
}
toJSON(): string{
return JSON.stringify(this.s... |
C++ | UTF-8 | 1,481 | 2.59375 | 3 | [] | no_license | /*
This file is part of DriveLatencytest (DLT).
DLT is released via an MIT License.
Author(s): Charles Machalow
This is the implementation for config keeping things
*/
#include "Config.h"
std::string _CONFIG::toString() const
{
std::string retStr = "";
retStr += " Duration (Seconds) : " + ... |
Python | UTF-8 | 1,397 | 2.8125 | 3 | [] | no_license | #!/usr/bin/env mmd
from matmodlab import *
"""Simulations to show uniaxial stress
In the first simulation, the full stress tensor is prescribed
In the second, the axial strain is prescribed and the lateral stresses held at
0
"""
models = {}
# Material parameters
parameters = {"K": 9.980040E+09, "G": 3.750938E+09}... |
Java | UTF-8 | 1,416 | 2.296875 | 2 | [] | no_license | package uq.deco2800.duxcom.interfaces.gameinterface.graphicshandler;
import javafx.stage.Stage;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
import o... |
Python | UTF-8 | 543 | 3.28125 | 3 | [] | no_license | import unittest
import numpy as np
from running_percentile import RunningPercentile
class TestHeap(unittest.TestCase):
def test_heap(self):
n = 500
arr = np.random.randint(0, high=100, size=n + 1)
arr[0] = -1
for i in range(1, 100):
p = RunningPercentile(float(i)/100.0)... |
C# | UTF-8 | 737 | 3.890625 | 4 | [
"MIT"
] | permissive | using System;
namespace _03_Recursive_Fibonacci
{
class Program
{
static void Main(string[] args)
{
int nFibonacci = int.Parse(Console.ReadLine());
if (nFibonacci <= 1)
{
Console.WriteLine(1);
}
else
{
... |
Java | UTF-8 | 2,161 | 2.171875 | 2 | [] | no_license | /*
* ApproveAPISwagger
* The simple API to request a user's approval on anything via email + sms.
*
* OpenAPI spec version: 1.0.1
* Contact: dev@approveapi.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class ... |
Markdown | UTF-8 | 4,767 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | #Usage
Requires [sbt](http://simple-build-tool.googlecode.com/) and the
[Android SDK](http://developer.android.com/sdk/index.html)
(`brew install sbt android-sdk` when using [homebrew](http://github.com/mxcl/homebrew) on OSX).
For those who are familiar with the 0.7.x plugin, there is a
[migration guide](https://g... |
Python | UTF-8 | 3,203 | 2.734375 | 3 | [
"MIT"
] | permissive | from einops import rearrange
from torch import Tensor, nn
from tsl.nn.blocks.decoders.gcn_decoder import GCNDecoder
from tsl.nn.blocks.encoders import RNN, ConditionalBlock
from tsl.nn.models import BaseModel
class RNNEncGCNDecModel(BaseModel):
"""
Simple time-then-space model.
Input time series are enc... |
Python | UTF-8 | 109 | 3.484375 | 3 | [] | no_license | for x in range(2000,3200):
if((x%7==0) and (x%5!=0)):
print(x)
else:
pass
|
Markdown | UTF-8 | 1,927 | 3.375 | 3 | [] | no_license | **Weapon Damage Scaler **is a plugin that allows you to scale a player's damage per weapon, and/or ammo type.
The plugin itself is pretty simple, here's how to scale damages:
Example of console command usage: **weapon.setscale "Assault Rifle" "0.923"**. This will scale the damage of the Assault Rifle to 0.923.
Cha... |
Java | UTF-8 | 1,415 | 2.046875 | 2 | [] | no_license | package es.indra.sicc.entidades.car;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Column;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import java.io.Serializable;
@Entity
@Table(name="CAR_PARAM_NR")
public class... |
Markdown | UTF-8 | 3,802 | 2.8125 | 3 | [] | no_license | <div id="hypercomments_widget" class="js-hypercomments-widget invisible"></div>
# Безсполучникове складне речення
<table>
<tr>
<td width="10%" align="center"><b>№ <br>п\п</br></b></td>
<td width="5%" align="center"><b>Кількість годин</b></td>
<td width="40%" align="center"><b>Зміст навчального матеріа... |
Markdown | UTF-8 | 4,541 | 3.21875 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: Hackers and Body Builders
comments: True
desc: My experience with programming in college
image: http://i.imgur.com/n51oOAJ.jpg
permalink: hackers-and-body-builders
keywords: "programming, computers, software engineering, open source, competitive programming, codechef, topcoder, github, hackers"
... |
Java | UTF-8 | 250 | 2.890625 | 3 | [] | no_license | package counter;
public class IncrementCounterCommand implements ICommand {
private Counter counter;
public IncrementCounterCommand(Counter counter) {
this.counter = counter;
}
@Override
public void execute() {
counter.increment();
}
}
|
JavaScript | UTF-8 | 11,406 | 3.046875 | 3 | [] | no_license | var _ = require("underscore");
var THREE = require("three");
// alternatively, we could add it to the THREE.Geometry.prototype but then
// would need to ensure only customized THREE Geo are passed to
// fromThreeGeometry expression
var addContainsPoint = require("./addcontainspoint");
exports.Expression = function(op... |
C# | UTF-8 | 286 | 2.5625 | 3 | [] | no_license | public class WithStabilizer : RifleDecorator
{
private float mStabilizerAccuracy = 10.0f;
//constructor
public WithStabilizer(IRifle rifle) : base(rifle) { }
public override float GetAccuracy()
{
return base.GetAccuracy() + mStabilizerAccuracy;
}
}
|
Ruby | UTF-8 | 170 | 3.375 | 3 | [] | no_license | number = ARGV[0].to_i
while number != 1
if number % 2 == 0
number = number / 2
else
number = (number * 3) + 1
end
puts number
end
puts "Congraturation!" |
JavaScript | UTF-8 | 1,089 | 3.5625 | 4 | [] | no_license | /*
11. Uma pessoa que trabalha de carteira assinada no Brasil tem descontados de seu salário bruto o INSS e o IR.
Faça um programa que, dado um salário bruto, calcule o líquido a ser recebido.
*/
let salary = 3000;
let aliquotaINSS;
let aliquotaIR;
let portion;
if (salary <= 1556.94) {
aliquotaINSS = 8/100;
} ... |
PHP | UTF-8 | 1,433 | 2.546875 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace xpbl4\grid;
use yii\helpers\Html;
use yii\helpers\ArrayHelper;
/**
* RadioButtonColumn displays a column of radio buttons in a grid view.
*
* To add a R... |
C++ | UTF-8 | 3,369 | 3.21875 | 3 | [] | no_license |
String inputString = ""; // a string to hold incoming data
boolean stringComplete = false; // whether the string is complete
const int R1 = 7;
const int R2 = 6;
const int R3 = 5;
const int R4 = 4;
const int D1 = 2;
const int D2 = 3;
void setup() {
// initialize serial:
Serial.begin(115200);
Serial.wri... |
C# | UTF-8 | 2,494 | 3.296875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
namespace MathQuiz.Common
{
public class Serializer
{
/// <summary>
/// Serializes an object.
/// </summary>
/// <typeparam name="T"></typeparam... |
Java | GB18030 | 7,126 | 2.03125 | 2 | [] | no_license | package com.kan.hro.dao.mybatis.impl.biz.payment;
import java.util.List;
import org.apache.ibatis.session.RowBounds;
import com.kan.base.core.Context;
import com.kan.base.util.Cryptogram;
import com.kan.base.util.KANException;
import com.kan.base.util.KANUtil;
import com.kan.hro.dao.inf.biz.payment.Payment... |
Java | UTF-8 | 39 | 1.59375 | 2 | [] | no_license | public enum AccountType {
CC, CA
}
|
Java | UTF-8 | 404 | 1.9375 | 2 | [] | no_license | package cn.tomleung.dao;
import java.util.ArrayList;
import cn.tomleung.entity.Cart;
import cn.tomleung.entity.OrderHead;
public interface OrderDAO {
public void insert(ArrayList<Cart> carts) throws Exception;
public void delete(int oid) throws Exception;
public ArrayList<OrderHead> queryByUID(int uid) ... |
Python | UTF-8 | 406 | 2.578125 | 3 | [] | no_license | #!/usr/bin/python
import fileinput
prv_line = ""
def process(line):
global prv_line
l = prv_line + line
i = l.find("</")
if i >= 0:
j = l[i:].find(">") + i + 1
prv_line = l[j:].rstrip()
return l[:j]
elif l.find("<") >= 0 and l.find("<body") == -1:
prv_line = l.rstrip()
return ""
else:
... |
Java | UTF-8 | 2,388 | 3.46875 | 3 | [] | no_license | package Signals;
import IntroCS_Princeton.StdAudio;
import IntroCS_Princeton.StdDraw;
import java.awt.*;
/*visualise the waves and play the sounds
using Karplus-Strong algorithm (iterative attenuation): y[n] = x[n] +a*y[n-1]
partly based on https://introcs.cs.princeton.edu/java/15inout/PlayThatTune.java.html
and Dig... |
Java | UTF-8 | 973 | 2.015625 | 2 | [] | no_license | package mainSystem.controller.main;
import mainSystem.dao.TaskUnitRepos.groupRepository.GroupRepository;
import mainSystem.service.taskUnitService.tableService.TableService;
import mainSystem.service.userService.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ster... |
Java | UTF-8 | 1,256 | 2.421875 | 2 | [
"MIT"
] | permissive | package ninja.egg82.plugin.utils;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.InetAddress;
import java.net.URL;
public class IPUtil {
// vars
private static String[] sites = new String[] { "http://checkip.amazonaws.com", "https://icanhazip.com/", "http://www.trackip.net/ip... |
Markdown | UTF-8 | 2,600 | 3 | 3 | [] | no_license | # Bad request error message
An error message indicating that the subscription message was invalid.
<table>
<thead>
<tr>
<th>Entry</th>
<th>Type</th>
<th>Possible values</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Message Type</td>
<td>Integer</td>
<td>400</td>
<td>Identi... |
JavaScript | UTF-8 | 3,175 | 2.65625 | 3 | [] | no_license | /*** SlideshowView ***/
define(function(require, exports, module) {
var View = require('famous/core/View');
var Surface = require('famous/core/Surface');
var Transform = require('famous/core/Transform');
var StateModifier = require('famous/modifiers/StateModifier');
var Lightbox = require('famous/views/Ligh... |
Markdown | UTF-8 | 2,106 | 2.578125 | 3 | [] | no_license | # Schema
This first schema idea can be done if we just calculate these raw samples on the client-side and then we have have the server-side worry about calculating the mean, standard deviation, and deltas for the samples. We could potentially include the mean, standard deviation, and deltas in this payload but that wou... |
C++ | UTF-8 | 678 | 2.640625 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<string>
#include<fstream>
#include<cstdlib>
#include<algorithm>
#include"test.h"
using namespace std;
void farmer::inPut(){
int originData;
ifstream inFile("file.in",ios::in);
if(!inFile){
cout<<"File could not be opened"<<endl;
exit(1);
}
inFile>>farmer::tem;
farm... |
PHP | UTF-8 | 249 | 2.6875 | 3 | [] | no_license | <?php
namespace models\auth;
use models\entities\User as UserEntity;
/**
* Class User
* @package models\auth
*/
class User
{
private ?UserEntity $user;
public function auth(UserEntity $user)
{
$this->user = $user;
}
}
|
Python | UTF-8 | 714 | 2.671875 | 3 | [] | no_license | import torch.optim as optim
class Optimizer:
def __init__(self, model_parameters, opt):
pass
def __new__(self, model_parameters, opt, lr):
self.model_parameters = model_parameters
self.lr = lr
self.optimizer_name = opt
if self.optimizer_name == 'Adam':
ret... |
JavaScript | UTF-8 | 2,427 | 2.6875 | 3 | [] | no_license | const { OAuth2Client } = require('google-auth-library');
const mongoose = require('mongoose');
const { generateJWT } = require('../utils/token');
const User = mongoose.model("users")
const oAuth2Client = new OAuth2Client(
process.env.GOOGLE_CLIENT_ID,
process.env.GOOGLE_CLIENT_SECRET,
process.env.R... |
Java | UTF-8 | 776 | 2.3125 | 2 | [] | no_license | package raig.org.domain.model;
import junit.framework.Assert;
import org.junit.Test;
import raig.org.domain.AgendaRepository;
import raig.org.domain.model.Agenda;
import raig.org.domain.model.Contact;
import raig.org.infraestructure.AgendaRepositoryImpl;
public class AgendaTest {
@Test
public void createAgendaS... |
C# | UTF-8 | 3,873 | 2.703125 | 3 | [] | no_license | using System;
using NKingime.Utility;
using NKingime.Utility.General;
namespace NKingime.Validate
{
/// <summary>
/// 类型验证基类。
/// </summary>
public abstract class TypeValidBase : ITypeValid
{
/// <summary>
/// 属性名称。
/// </summary>
public const string PropertyName = ... |
Java | UTF-8 | 10,838 | 1.773438 | 2 | [] | no_license | package com.lvmama.comm.pet.po.client;
import java.io.Serializable;
import java.util.List;
import com.lvmama.comm.pet.po.pub.ComPicture;
import com.lvmama.comm.utils.PriceUtil;
import com.lvmama.comm.utils.StringUtil;
import com.lvmama.comm.vo.Constant;
public class ClientProduct implements Serializable{... |
Shell | UTF-8 | 90 | 2.671875 | 3 | [] | no_license | #!/bin/bash
for i in 0 1 2 3
do
tmp=$[$i**2 + 10]
echo $[2*$i*$tmp/3 + $tmp]
done
|
C# | UTF-8 | 6,061 | 2.671875 | 3 | [] | no_license | using DAL;
using Models;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Types;
namespace SQL
{
public class StudentDB
{
public bool StudentAdd(Student s)
{
int count = DataAccess.ExecuteNo... |
Markdown | UTF-8 | 6,006 | 2.828125 | 3 | [] | no_license | # Article L961-2
Les personnels de l'enseignement agricole privé relèvent des dispositions de l'article L. 813-7 du code rural et de la pêche
maritime, reproduites à l'article L. 442-21 du présent code, et des dispositions des articles L. 813-8 et L. 813-9 du code
rural et de la pêche maritime, ci-après reproduites :
... |
C++ | UHC | 690 | 3.703125 | 4 | [] | no_license | #pragma once
#include "BaseArray.h"
class MyStack :public BaseArray { //BaseArray Ŭ , ĻŬ
private:
int top; // ֱ( )
public:
MyStack(int capacity) : BaseArray(capacity) { top = 0; } // ʱ top=0
void push(int n) {
put(top, n); //ÿ Ǫ
top++; //top 1
}
int capacity() { return getCapacity(); } //BaseArray getCap... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.