code
stringlengths
4
1.01M
language
stringclasses
2 values
<?php use Stringizer\Stringizer; /** * Date Unit Tests */ class DateTest extends PHPUnit_Framework_TestCase { public function testValidDate() { date_default_timezone_set('America/Vancouver'); $s = new Stringizer("January 1st"); $this->assertEquals(true, $s->isDate()); $s = ...
Java
""" Django settings for ross project. Generated by 'django-admin startproject' using Django 1.10.6. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os #...
Java
//////////////////////////////////////////////////////////////////////////////// //worldgenerator.cs //Created on: 2015-8-21, 18:18 // //Project VoxelEngine //Copyright C bajsko 2015. All rights Reserved. //////////////////////////////////////////////////////////////////////////////// using Microsoft.Xna.Framework; u...
Java
"use strict" var express = require('express'); var app = express(); var elasticsearch = require('elasticsearch'); var client = new elasticsearch.Client({ host: 'localhost:9200', log: 'trace' }); var router = express.Router(); router.get('/accidents', function(req, res) { var query = { index: 'wildmap', type: ...
Java
var generatetask = require('../source/ajgenesis/tasks/generate'), createtask = require('../create'), path = require('path'), fs = require('fs'), ajgenesis = require('ajgenesis'); exports['generate'] = function (test) { test.async(); var cwd = process.cwd(); process.ch...
Java
#include <math.h> #include <stdio.h> #include <pthread.h> #include <stdlib.h> #define THREAD_COUNT 4 typedef struct { int start; int end; } range_t; void *calculate_range(void* range) { range_t* curr_range = (range_t*)range; void* result = (void*)1; for (int i = curr_range->start; i < curr_range...
Java
package com.virtualfactory.screen.layer.components; import de.lessvoid.nifty.Nifty; import de.lessvoid.nifty.NiftyEventSubscriber; import de.lessvoid.nifty.controls.ButtonClickedEvent; import de.lessvoid.nifty.controls.Controller; import de.lessvoid.nifty.controls.window.WindowControl; import de.lessvoid.nifty.element...
Java
const S$ = require('S$'); function loadSrc(obj, src) { throw src; } const cookies = S$.symbol('Cookie', ''); const world = {}; if (cookies) { if (/iPhone/.exec(cookies)) { loadSrc(world, '/resources/' + cookies); } loadSrc(world, '/resources/unknown'); } else { loadSrc(world, '/resources...
Java
--- layout: post title: "Problem 2_0" modified: categories: /AcceleratedC++/ch2 excerpt: tags: [] image: feature: date: 2015-09-25T00:37:18-07:00 --- [Github Source](https://github.com/patricknyu/AcceleratedCPlusPlus/tree/master/ch2/Question2_0) ###Q: Compile and run the program presented in this chapter. ###A: `...
Java
module.exports = function (seneca, util) { //var Joi = util.Joi }
Java
package Digivolver; public class Digivolution{ private Digimon digimon; private int minDp = 0; private int maxDp = 0; public boolean isWithinDp(int minDp, int maxDp){ return this.minDp<=maxDp && this.maxDp>=minDp; } public Digivolution(Digimon digimon, int minDp, int maxDp) { this.digimon = digimon; thi...
Java
import re import hashlib FNAME_MATCH = re.compile(r'/([^/]+)$') # From the last slash to the end of the string PREFIX = re.compile(r'([^:]+://)(/)?(.+)') # Check for a prefix like data:// def getParentAndBase(path): match = PREFIX.match(path) if match is None: if path.endswith('/'): st...
Java
#ifndef VECTOR4_H #define VECTOR4_H #include "gamemath_internal.h" GAMEMATH_NAMESPACE_BEGIN GAMEMATH_ALIGNEDTYPE_PRE class GAMEMATH_ALIGNEDTYPE_MID Vector4 : public AlignedAllocation { friend class Matrix4; friend GAMEMATH_INLINE Vector4 operator +(const Vector4 &a, const Vector4 &b); friend GAMEMATH_INLINE Vector4 ...
Java
/** * @file query.cc * * @section LICENSE * * The MIT License * * @copyright Copyright (c) 2017-2021 TileDB, 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 restri...
Java
class CreateProductMaterials < ActiveRecord::Migration[5.0] def change create_table :product_materials do |t| t.belongs_to :product, index: true t.string :name t.string :material t.string :description t.timestamps end end end
Java
'use strict' var test = require('tap').test var strip = require('./') test('stripFalsy', function(t) { t.plan(5) t.deepEqual(strip(null), {}) t.deepEqual(strip('test'), {}) t.deepEqual(strip(13), {}) t.deepEqual(strip(), {}) var input = { a: false , b: 0 , c: null , d: undefined , e: '' , f...
Java
<?php /** * [WeEngine System] Copyright (c) 2014 WE7.CC * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details. */ defined('IN_IA') or exit('Access Denied'); load()->func('file'); load()->model('article'); load()->model('account'); $dos = array('display', 'post', ...
Java
<?php namespace Kr\OAuthClient\Credentials; class Client extends AbstractCredentials { protected $clientId, $clientSecret, $redirectUri; /** * Client constructor. * @param string $clientId * @param string $clientSecret * @param string $redirectUri */ public function __construct($c...
Java
$(function () { $('.imageUploadMultiple').each(function (index, item) { var $item = $(item); var $group = $item.closest('.form-group'); var $innerGroup = $item.find('.form-group'); var $errors = $item.find('.errors'); var $input = $item.find('.imageValue'); var flow =...
Java
vk_wiki_manager ===============
Java
#!/bin/bash f="$1" d="$2" CURRENT_DIR=$( pushd $(dirname $0) >/dev/null; pwd; popd >/dev/null ) if [ ! -d $d ]; then echo "$d is not found" exit 2 fi F="$d/$f" if [ -f "$F" ]; then s1=`wc -c "$f" | cut -d ' ' -f 1` s2=`wc -c "$F" | cut -d ' ' -f 1` if [ $s1 -eq $s2 ]; then cksum1=`md5sum -b "$f" | cut...
Java
module Schema include Virtus.module(:constructor => false, :mass_assignment => false) def initialize set_default_attributes end def attributes attribute_set.get(self) end def to_h attributes end end
Java
#!/bin/sh # CYBERWATCH SAS - 2017 # # Security fix for DSA-3663-1 # # Security announcement date: 2016-09-09 00:00:00 UTC # Script generation date: 2017-01-01 21:08:13 UTC # # Operating System: Debian 8 (Jessie) # Architecture: i386 # # Vulnerable packages fix on version: # - xen:4.4.1-9+deb8u7 # - libxen-4.4:4...
Java
/** * k-d Tree JavaScript - V 1.01 * * https://github.com/ubilabs/kd-tree-javascript * * @author Mircea Pricop <pricop@ubilabs.net>, 2012 * @author Martin Kleppe <kleppe@ubilabs.net>, 2012 * @author Ubilabs http://ubilabs.net, 2012 * @license MIT License <http://www.opensource.org/licenses/mit-license.p...
Java
// function that finds the sum of two parameters function findSum(firstnr, secondnr){ return firstnr + secondnr; } //function that finds the product of two parameters function findProduct(firstnr, secondnr){ return firstnr * secondnr; } /* threeOperation calls the operation parameter as a function so it's able to r...
Java
// // LJRouterPath.h // LJControllerRouterExample // // Created by Jinxing Liao on 12/14/15. // Copyright © 2015 Jinxing Liao. All rights reserved. // #import <Foundation/Foundation.h> @interface LJRouterPath : NSObject @property (nonatomic, strong) NSString *schema; @property (nonatomic, strong) NSArray *compo...
Java
using UnityEngine; using System.Collections; using System.Collections.Generic; namespace Everyplay.XCodeEditor { public class XCConfigurationList : PBXObject { public XCConfigurationList(string guid, PBXDictionary dictionary) : base(guid, dictionary) { internalNewlines = true; } } }
Java
// GPG4Browsers - An OpenPGP implementation in javascript // Copyright (C) 2011 Recurity Labs GmbH // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the Lice...
Java
""" train supervised classifier with what's cooking recipe data objective - determine recipe type categorical value from 20 """ import time from features_bow import * from features_word2vec import * from sklearn.preprocessing import StandardScaler from sklearn.ensemble import RandomForestClassifier, ExtraTreesClassifie...
Java
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Configuration options for Invenio-Search. The documentation for the configuration...
Java
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; /** * Class SettingController * * @author The scaffold-interface created at 2016-08-25 01:07:35am * @link https://github.com/amranidev/scaffold-interface */ class Setting extends Model { use So...
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content=""> <meta name="author" content=""> <title>DSJCL</title> <!-- Bootstrap core CSS --> <link href="...
Java
package net.robobalasko.dfa.gui; import net.robobalasko.dfa.core.Automaton; import net.robobalasko.dfa.core.exceptions.NodeConnectionMissingException; import net.robobalasko.dfa.core.exceptions.StartNodeMissingException; import javax.swing.*; import javax.swing.border.EmptyBorder; import javax.swing.event.DocumentEve...
Java
--- types: - utility id: d5ee1b1e-0ffa-45cd-b3aa-bfecb9a93325 --- Converts all tabs in a string to a given number of spaces, `4` by default. This is a boring modifier to output examples of. Here's just a few examples on how the syntax looks. ``` {{ string | to_spaces }} {{ string | to_spaces:2 }} ```
Java
from __future__ import unicode_literals from django.apps import AppConfig class RfhistoryConfig(AppConfig): name = 'RFHistory'
Java
// Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "main.h" #include "db.h" #include "init.h" #include "bitcoinrpc.h" using name...
Java
<!DOCTYPE html> <html lang="de"> <head> <meta charset="utf-8"> <title>Interlude</title> </head> <link href="css/interlude.css" media="screen" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.1.min.js"></script> <script src="http://ajax.googleapis.com/ajax/l...
Java
#ifndef _PARSER_HPP #define _PARSER_HPP #include <cassert> #include <iostream> #include <vector> #include <string> #include <cstdlib> #include "toyobj.hpp" #include "lexer.hpp" #include "toy.hpp" #include "ast.hpp" class ParserContext { public: explicit ParserContext(LexerContext &lexer) : lexer_(lexer)...
Java
require 'aws-sdk' require 'awspec/resource_reader' require 'awspec/helper/finder' module Awspec::Type class Base include Awspec::Helper::Finder include Awspec::BlackListForwardable attr_accessor :account def resource_via_client raise 'this method must be override!' end def to_s ...
Java
## Next * Improved Spotlight support for favorites. - alloy ## 2.3.0 (2015.09.18) * Add support for Universal Links on iOS 9. - alloy * Add support for Web-to-Native Handoff. - alloy * Make CircleCI work again by adding the `build` action to the `test` task to ensure the simulator is running. - alloy * Remove `?foo=...
Java
// // EPTTimer.h // PodcastTimer // // Created by Eric Jones on 6/7/14. // Copyright (c) 2014 Effective Programming. All rights reserved. // #import <Foundation/Foundation.h> @protocol EPTTimerDelegate <NSObject> - (void)timerFired; @end @interface EPTTimer : NSObject @property (nonatomic) id<EPTTimerDelegat...
Java
--- layout: page title: Floyd Aerospace Seminar date: 2016-05-24 author: Jonathan Jarvis tags: weekly links, java status: published summary: Etiam dictum facilisis massa, iaculis varius. banner: images/banner/wedding.jpg booking: startDate: 09/21/2019 endDate: 09/24/2019 ctyhocn: BTVMVHX groupCode: FAS publishe...
Java
package core import ( . "github.com/smartystreets/goconvey/convey" "strings" "testing" ) func TestValidateSymbol(t *testing.T) { Convey("Given a node name validation function", t, func() { cases := []struct { title string name string success bool }{ {"an empty string", "", false}, {"one al...
Java
require './lib/graph' require './lib/path_measurer' require './lib/path_searcher' require './lib/path_explorer' require './lib/exact_path_length_checker' require './lib/max_path_distance_checker' require './lib/max_path_length_checker' edges = [] $stdin.each_line do | line | line.strip! edges.concat line.split(/\s|...
Java
export default { FETCH_TAGS_PENDING: Symbol("FETCH_TAGS_PENDING"), FETCH_TAGS_SUCCESS: Symbol("FETCH_TAGS_SUCCESS"), FETCH_TAGS_FAILURE: Symbol("FETCH_TAGS_FAILURE"), FILTER_TAGS: Symbol("FILTER_TAGS"), ORDER_TAGS: Symbol("ORDER_TAGS") };
Java
<?php /** * summary */ class Product extends MY_Controller { public function __construct() { parent::__construct(); $this->load->model('product_model'); } function index(){ $total = $this->product_model->get_total(); $this->data['total'] = $total; //load t...
Java
import { Injectable } from '@angular/core'; import { Subject } from 'rxjs/Subject'; import { Observable } from 'rxjs/Observable'; import { AngularFireDatabase, FirebaseListObservable } from 'angularfire2/database'; import { AngularFireAuth } from 'angularfire2/auth'; import * as firebase from 'firebase/app'; import {Ht...
Java
/** * * @function * @param {Array|arraylike} value * @param {Function} cmd * @param {any} context * @returns {?} */ export default function eachValue(value, cmd, context, keepReverse) { if (value === undefined || value === null) return undefined; const size = (0 | value.length) - 1; for (let index = size; ind...
Java
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** @author John Miller * @version 1.2 * @date Sat Jan 31 20:59:02 EST 2015 * @see LICENSE (MIT style license file). */ package scalation.analytics import scalation.linalgebra.{MatriD, MatrixD, VectorD} //::::::::::::::::...
Java
const should = require('should'), sinon = require('sinon'), _ = require('lodash'), settingsCache = require('../../../../server/services/settings/cache'), common = require('../../../../server/lib/common'), controllers = require('../../../../server/services/routing/controllers'), TaxonomyRouter = ...
Java
<?php use Snscripts\HtmlHelper\Html; use Snscripts\HtmlHelper\Services; use Snscripts\HtmlHelper\Helpers; class HtmlTest extends \PHPUnit_Framework_TestCase { public function testCanCreateInstance() { $this->assertInstanceOf( 'Snscripts\HtmlHelper\Html', new Html( ...
Java
<?php /*============================================================================== * (C) Copyright 2016,2020 John J Kauflin, All rights reserved. *---------------------------------------------------------------------------- * DESCRIPTION: Functions to validate Admin operations (i.e. check permissions * par...
Java
<h1>Access Denied</h1> <p>You have logged in correctly, but you have tried to access a page without a high enough level of security clearance.</p>
Java
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.11"/> <link rel="stylesheet" type="text/css" href="se...
Java
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" con...
Java
<!-- Copyright 2005-2008 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://stlab.adobe.com/licenses.html) Some files are held under additional license. Please see "http://stlab.adobe.com/licenses.html" for more information. -->...
Java
require_relative '../user' RSpec.describe 'Tapjoy::LDAP::API::User' do include_context 'user' describe '#create' do let(:ldap_attr) {{ uid: "test.user", cn: "Test User", objectclass: %w( top posixAccount shadowAccount inetOrgPerson organizationalPerson...
Java
import React from 'react'; import $ from 'jquery'; import _ from 'lodash'; import Block from './Block'; export default class BlockGrid extends React.Component { constructor() { super(); this.setDefaults(); this.setContainerWidth = this.setContainerWidth.bind(this); this.handleWindowResize = this.handleWind...
Java
<?php namespace Eni\MainBundle\DataFixtures\ORM; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; use Doctrine\Common\Persistence\ObjectManager; use Eni\MainBundle\Entity\Question; use Eni\MainBundle\Entity\ReponseProposee; class LoadReponseProposeeData exte...
Java
{% extends "layout.html" %} {% block page_title %} Add medication {% endblock %} {% block head %} {% include "includes/head.html" %} {% include "includes/scripts.html" %} {% endblock %} {% block after_header %} {{ banner.input() }} {% endblock %} {% block content %} <main id="content" role="main...
Java
package com.exasol.adapter.dialects.bigquery; import java.sql.Connection; import java.sql.Types; import com.exasol.adapter.AdapterProperties; import com.exasol.adapter.dialects.IdentifierConverter; import com.exasol.adapter.jdbc.BaseColumnMetadataReader; import com.exasol.adapter.jdbc.JdbcTypeDescription; import com....
Java
const chalk = require('chalk'); const Sequelize = require('sequelize'); // db server constant(s) const dbName = 'relationshipVisualizer'; // +(process.env.NODE_ENV === 'testing' ? '_test' : ''); const url = process.env.DATABASE_URL || `postgres://localhost:5432/${dbName}`; // notify the user we're about to do it cons...
Java
#!/usr/bin/env bash mkdir -p target/sandboxjava9jlink; /usr/lib/jvm/java-9-oracle/bin/javac \ --module-path ./../java9module/target/sandboxjava9module \ -d target/sandboxjava9jlink \ $(find ./src/main/java -name "*.java")
Java
using System; using Windows.Devices.Enumeration; using Windows.Devices.Spi; using Windows.Foundation.Metadata; namespace ABElectronics_Win10IOT_Libraries { /// <summary> /// Class for accessing the ADCDAC Pi from AB Electronics UK. /// </summary> public class ADCDACPi : IDisposable { p...
Java
FROM stilliard/pure-ftpd ENV FTP_USER=ftpuser \ FTP_PASSWORD=ftpuser \ FTP_HOME_DIRECTORY=/share/ftp \ PASV_PORT_MIN=30000 \ PASV_PORT_MAX=30009 \ CONTAINER_USER_UID=ftpuser \ MAX_CLIENTS_NUMBER=50 \ MAX_CLIENTS_PER_IP=10 \ DOWNLOAD_LIMIT_KB=0 \ UPLOAD_LIMIT_KB=0 \ MAX_SIMULTANE...
Java
var system = require('system'); var args = system.args; var url = "http://"+args[1], filename = args[2]+".png", timeout = args[3], savePath = args[4], page = require('webpage').create(); //setTimeout(function(){phantom.exit();}, timeout) page.viewportSize = { width: 1200, height: 700 }; page.clipRect = { top: 0, le...
Java
class SiteController < ApplicationController skip_before_filter :verify_authenticity_token no_login_required cattr_writer :cache_timeout def self.cache_timeout @@cache_timeout ||= 5.minutes end def show_page url = params[:url] if Array === url url = url.join('/') else url = u...
Java
namespace Vulcan.Core.DataAccess.Migrations.MigrationProviders { public enum ExecutionType { Insert, InsertWithIdentity, Update, Delete } }
Java
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Mit...
Java
<!-- Jumbotron Header --> <header class="jumbotron hero-spacer" style="padding: 2em; text-align: center;"> <img style="max-width:100%; max-height:100%;" src="<?=base_url()?>assets/img/slogan.png"> <!-- <h1>Read and let read!</h1> <p> Welcome to Discipulus, your humb...
Java
# vimconfig stuff from my vimrc breaks into pieces for keeping organised things more organised ### Install On Unix execute: ```sh #backup current vimrc file if existed mv ~/.vimrc{,_backup} #clone project into special folder git clone https://github.com/iiey/vimconfig ~/.vim/bundle/vimconfig \ && ln -sfn ~/.vim/bundle...
Java
/* globals describe, before, beforeEach, after, afterEach, it */ 'use strict'; const chai = require('chai'); const assert = chai.assert; const expect = chai.expect; chai.should(); chai.use(require('chai-things')); //http://chaijs.com/plugins/chai-things chai.use(require('chai-arrays')); describe('<%= pkgName %>', f...
Java
// // PgpMimeTests.cs // // Author: Jeffrey Stedfast <jestedfa@microsoft.com> // // Copyright (c) 2013-2022 .NET Foundation and Contributors // // 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 Soft...
Java
<?xml version="1.0" ?><!DOCTYPE TS><TS language="el_GR" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Number7</source> <translation>Σχετικά με το Number7</translation>...
Java
.home-layout { padding-top: 50px; padding-bottom: 50px; text-align: center; background: url('https://scontent-ord1-1.xx.fbcdn.net/hphotos-xta1/t31.0-8/10991609_10104851058880999_4908278955780656545_o.jpg') no-repeat center center fixed; background-size: cover; height: 855px; } .home-row { position: relat...
Java
var _ = require("underscore"), Events = require("./Events"), querystring = require("querystring"), httpClient = require("./httpClient"), utils = require("./utils"), logger = require("config-logger"); var environments = { sandbox: { restHost: "api-sandbox.oanda.com", streamHost: ...
Java
require "mscorlib" require "System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" require "System.Collections.Generic, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" require "System.Linq, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" require "System.Text, V...
Java
package com.semmle.jcorn; import com.semmle.js.ast.Position; public class SyntaxError extends RuntimeException { private static final long serialVersionUID = -4883173648492364902L; private final Position position; public SyntaxError(String msg, Position loc, int raisedAt) { super(msg); this.position =...
Java
## Sentence No. 124 - annat var det 1976 när after dark tog sina första steg som dragshowgrupp , och 1980 när de **flyttade** **in** på hamburger börs . ### Existing MWEs: 1- **flyttade in** (VPC)Tokens : flyttade in ### Identified MWEs: 1- **tog sina** Tokens : tog sina 0- SHIFT&nbsp;&nbsp;&nbsp;>&nbsp;&n...
Java
<!DOCTYPE html> <html lang="es"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content="Spincommerce Guía de Estilos"> <meta name="keywords" content=""> <meta na...
Java
var nums = []; for (var i = 0; i < 100; ++i) { nums[i] = Math.floor(Math.random() * 101); } insertionsort(nums); dispArr(nums); print(); putstr("Enter a value to count: "); var val = parseInt(readline()); var retVal = count(nums, val); print("Found " + retVal + " occurrences of " + val + ".");
Java
/** * This package provides the necessary classes to slice and compose a file. * * @author Sergio Merino */ package assembler;
Java
import imageContainer from '../server/api/helpers/imageContainer'; const entries = [ { html: '<img src="/img/60x30.png" alt="60x30" class="zoom" data-zoom-src="/img/60x30-original.png">', }, { html: `<div> <img src="/img/20x50.jpg"> </div> <img src="/img/40x10.svg" alt="40x10">`, }, { html: '<d...
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `Unsigned` trait in crate `num`."> <meta name="keywords" co...
Java
import unittest from polycircles import polycircles from nose.tools import assert_equal, assert_almost_equal class TestDifferentOutputs(unittest.TestCase): """Tests the various output methods: KML style, WKT, lat-lon and lon-lat.""" def setUp(self): self.latitude = 32.074322 self.longitude = ...
Java
@CHARSET "UTF-8"; /******* GENERAL RESET *******/ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label,...
Java
package betterwithaddons.crafting.recipes; import betterwithaddons.crafting.ICraftingResult; import betterwithaddons.util.ItemUtil; import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.Ingredient; import java.util.ArrayList; import java.util.Iterator; i...
Java
<?php namespace Frontend42; return [ 'migration' => [ 'directory' => [ __NAMESPACE__ => __DIR__ . '/../../data/migrations' ], ], ];
Java
#pragma once #include "platform.h" #include "value.h" #include "vm.h" #include "result.h" #include <memory> #include <vector> namespace imq { class IMQ_API ScriptFunction : public QFunction { public: ScriptFunction(const String& funcName, Context* outerCtx, const std::shared_ptr<VBlock> block, const std::vector...
Java
#include "cf_internal.h" #define CACHE_SIZE 1024 #define INDEX(i) ((i) % CACHE_SIZE) static frame_cache_t* open_real_video_cache(cf_session_t* s) { frame_cache_t* cache = calloc(1, sizeof(frame_cache_t)); cache->wait_timer = s->proc->rtt + 2 * s->proc->rtt_val; cache->state = buffer_waiting; cache->frame_timer ...
Java
{{ Form::label('title', __('validation.attributes.title'), ['class' => 'label']) }} <div class="mb-4"> {{ Form::text('title', old('title', $category->title), ['class' => 'input' . ($errors->has('title') ? ' has-error' : ''), 'required' => true]) }} @if ($errors->has('title')) <div class="invalid-feedb...
Java
// Karma configuration // http://karma-runner.github.io/0.10/config/configuration-file.html module.exports = function(config) { config.set({ // base path, that will be used to resolve files and exclude basePath: '', // testing framework to use (jasmine/mocha/qunit/...) frameworks: ['mocha', 'chai', ...
Java
using System.ComponentModel; namespace LinqAn.Google.Dimensions { /// <summary> /// DCM creative type name of the DCM click matching the Google Analytics session (premium only). /// </summary> [Description("DCM creative type name of the DCM click matching the Google Analytics session (premium only).")] public cl...
Java
#include <QDebug> #include <QFileDialog> #include <QListWidgetItem> #include <QMessageBox> #include <QProcess> #include <QWidget> #include "app.h" #include "import.h" #include "ui_import.h" Import::Import(App* app) : app(app), platform(-1) { this->ui.setupUi(this); connect(this->ui.toolFilepath, SIGNAL(clicked(...
Java
import {Component} from '@angular/core'; @Component({ selector: "recomendaciones", templateUrl: "app/components/htmls/recomendacionesysugerencias/recomendaciones.html", styleUrls: ["app/components/htmls/htmlStyles.css"] }) export class RecomendacionesComponent {};
Java
Please take a read at this article so we can help you better, we are always happy to support you at our [chat](https://gitter.im/beto-rodriguez/Live-Charts), normally we respond you really fast. ### Features We are open to add new features to this library, but before suggesting one, ensure it is not implemented yet, ...
Java
/** * Copyright (c) André Bargull * Alle Rechte vorbehalten / All Rights Reserved. Use is subject to license terms. * * <https://github.com/anba/es6draft> */ package com.github.anba.es6draft.runtime.types.builtins; import java.lang.invoke.MethodHandle; import java.lang.reflect.Method; import com.github.anba.es6...
Java
<?php /* * This file is part of the Sonata Project package. * * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sonata\AdminBundle\DependencyInjection; use Symfony\C...
Java
// // AAAreaspline.h // AAChartKit // // Created by An An on 17/3/15. // Copyright © 2017年 An An. All rights reserved. //*************** ...... SOURCE CODE ...... *************** //***...................................................*** //*** https://github.com/AAChartModel/AAChartKit *** //*** https://git...
Java
/* * Reading a variable. */ if (typeof print !== 'function') { print = console.log; } function test() { function outer() { var o = 123; return function inner() { var i; var t; for (i = 0; i < 1e6; i++) { t = o; t = o; t = o; t = o; t = o; t ...
Java