code
stringlengths
4
1.01M
language
stringclasses
2 values
class Blog < ActiveRecord::Base has_many :posts has_many :comments, :through => :posts attr_accessible :name, :subdomain searchable :include => { :posts => :author } do string :subdomain text :name end # Make sure that includes are added to with multiple searchable calls searchable(:include => ...
Java
<!doctype html> <html> <title>shrinkwrap</title> <meta http-equiv="content-type" value="text/html;utf-8"> <link rel="stylesheet" type="text/css" href="../static/style.css"> <body> <div id="wrapper"> <h1><a href="../doc/shrinkwrap.html">shrinkwrap</a></h1> <p>Lock down dependency versions</p> <h2 id="SYNOP...
Java
from __future__ import unicode_literals __all__ = ( 'Key', 'Keys', ) class Key(object): def __init__(self, name): #: Descriptive way of writing keys in configuration files. e.g. <C-A> #: for ``Control-A``. self.name = name def __repr__(self): return '%s(%r)' % (self....
Java
/* * Copyright (c) 2004-2022, University of Oslo * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this * list of cond...
Java
#!/usr/bin/env python """ ================ sMRI: FreeSurfer ================ This script, smri_freesurfer.py, demonstrates the ability to call reconall on a set of subjects and then make an average subject. python smri_freesurfer.py Import necessary modules from nipype. """ import os import nipype.pipeline.eng...
Java
{% extends "email/_notification.html" %} {% set replied_comment = notification.comment.parent_comment %} {% set replied_content = notification.comment.parent_comment.reply_content %} {% block headline %} <span><strong>Your thread</strong> received a <strong>reply</strong> from {% endblock %} {% block email_type %}t...
Java
/*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty o...
Java
// Copyright 2021 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/image_editor/screenshot_flow.h" #include <memory> #include "base/logging.h" #include "build/build_config.h" #include "content/p...
Java
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_COMMON_CHROME_CONTENT_CLIENT_H_ #define CHROME_COMMON_CHROME_CONTENT_CLIENT_H_ #pragma once #include "base/compiler_specific.h" #inclu...
Java
/* * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this lis...
Java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE457_Use_of_Uninitialized_Variable__char_pointer_64b.c Label Definition File: CWE457_Use_of_Uninitialized_Variable.c.label.xml Template File: sources-sinks-64b.tmpl.c */ /* * @description * CWE: 457 Use of Uninitialized Variable * BadSource: no_init Don't initi...
Java
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "content/common/child_histogram_message_filter.h" #include <ctype.h> #include "base/bind.h" #include "base/message_loop.h" #include "base/m...
Java
/* * Copyright (C) 2013 Soumith Chintala * */ #include <jni.h> #include <stdio.h> #include <stdlib.h> #include "torchandroid.h" #include <assert.h> extern "C" { JNIEXPORT jstring JNICALL Java_com_torch_Torch_jni_1call( JNIEnv* env, jobject thiz, ...
Java
<?php use yii\helpers\Html; ?> <?php foreach ($_model as $photo): ?> <div class="thumb" style="float:left;padding: 2px" data-name="<?= $photo->name ?>" onclick="ShowFullImage('<?= $photo->name ?>')" > <div> <?= Html::img('/upload/m...
Java
package io.flutter.embedding.engine.mutatorsstack; import static junit.framework.TestCase.*; import static org.mockito.Mockito.*; import android.graphics.Matrix; import android.view.MotionEvent; import io.flutter.embedding.android.AndroidTouchProcessor; import org.junit.Test; import org.junit.runner.RunWith; import o...
Java
package org.hisp.dhis.dxf2.adx; /* * Copyright (c) 2015, UiO * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, th...
Java
<?php /** * Created by PhpStorm. * User: qhuy * Date: 18/12/2014 * Time: 21:59 */ namespace backend\models; use common\helpers\CommonUtils; use common\helpers\CVietnameseTools; use common\helpers\MediaToolBoxHelper; use common\helpers\MyCurl; use common\models\Content; use common\models\News; use garyjl\simpleh...
Java
Ext.define('Ozone.data.Dashboard', { extend: 'Ext.data.Model', idProperty: 'guid', fields:[ 'alteredByAdmin', 'guid', {name:'id', mapping: 'guid'}, { name: 'isdefault', type: 'boolean', defaultValue: false }, { name: 'dashboardPosition', type: 'int' }, ...
Java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE36_Absolute_Path_Traversal__wchar_t_file_fopen_45.cpp Label Definition File: CWE36_Absolute_Path_Traversal.label.xml Template File: sources-sink-45.tmpl.cpp */ /* * @description * CWE: 36 Absolute Path Traversal * BadSource: file Read input from a file * Goo...
Java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE401_Memory_Leak__new_twoIntsStruct_52b.cpp Label Definition File: CWE401_Memory_Leak__new.label.xml Template File: sources-sinks-52b.tmpl.cpp */ /* * @description * CWE: 401 Memory Leak * BadSource: Allocate data using new * GoodSource: Allocate data on the...
Java
/*********************************************************************** * Copyright (c) 2009, Secure Endpoints Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistributions...
Java
/* * Copyright (c) 2007-2009 The LIBLINEAR Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this ...
Java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_memcpy_22a.c Label Definition File: CWE122_Heap_Based_Buffer_Overflow__c_CWE805.label.xml Template File: sources-sink-22a.tmpl.c */ /* * @description * CWE: 122 Heap Based Buffer Overflow * BadSource: Allocate u...
Java
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h" #include <cstddef> #include <set> #include "ash/multi_profile_uma.h" #include ...
Java
/* * pointcloud_publisher_node.cpp * * Created on: Aug 19, 2021 * Author: Edo Jelavic * Institute: ETH Zurich, Robotic Systems Lab */ #include <pcl_conversions/pcl_conversions.h> #include <ros/ros.h> #include <sensor_msgs/PointCloud2.h> #include "grid_map_pcl/helpers.hpp" namespace gm = ::grid_map::g...
Java
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_METRICS_CHROMEOS_METRICS_PROVIDER_H_ #define CHROME_BROWSER_METRICS_CHROMEOS_METRICS_PROVIDER_H_ #include "base/memory/weak_ptr.h"...
Java
// Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef MEDIA_GPU_VAAPI_VAAPI_JPEG_DECODER_H_ #define MEDIA_GPU_VAAPI_VAAPI_JPEG_DECODER_H_ #include <stdint.h> #include <memory> #include "base/macros...
Java
using System; using Inbox2.Framework; namespace Inbox2.Core.Configuration { public static class CloudApi { public static string ApiBaseUrl { get { return String.Format("http://api{0}.inbox2.com/", String.IsNullOrEmpty(CommandLine.Current.Environment) ? String.Empty : "." + CommandLi...
Java
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "content/browser/payments/payment_app_info_fetcher.h" #include <limits> #include <utility> #include "base/base64.h" #include "base/bind.h" #inc...
Java
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_THIRD_PARTY_QUIC_TEST_TOOLS_QUIC_STREAM_SEQUENCER_BUFFER_PEER_H_ #define NET_THIRD_PARTY_QUIC_TEST_TOOLS_QUIC_STREAM_SEQUENCER_BUFFER_PEER_H_ ...
Java
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** * @fileoverview A command is an abstraction of an action a user can do in the * UI. * * When the focus changes in the document for each comman...
Java
/** ****************************************************************************** * api-scanner - Scan for API imports from a packaged 360 game * ****************************************************************************** * Copyright 2015 x1nixmzeng. All rights reserved. ...
Java
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_ERROR_PAGE_COMMON_LOCALIZED_ERROR_H_ #define COMPONENTS_ERROR_PAGE_COMMON_LOCALIZED_ERROR_H_ #include <memory> #include <string> ...
Java
using System.Linq.Expressions; using NHibernate.Metadata; namespace NHibernate.Linq.Expressions { public class EntityExpression : NHibernateExpression { private readonly string _alias; private readonly string _associationPath; private readonly IClassMetadata _metaData; private readonly Expression _expression...
Java
/* * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) * Copyright (C) 2009 Google Inc. All rights reserved. * Copyright (C) 2011 Apple Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are ...
Java
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package x509 import ( "strings" "time" "unicode/utf8" ) type InvalidReason int const ( // NotAuthorizedToSign results when a certificate is signed by ano...
Java
/* * Implements dynamic task queues to provide load balancing * Sanjeev Kumar --- December, 2004 */ #ifndef __TASKQ_INTERNAL_H__ #define __TASKQ_INTERNAL_H__ #include <stdio.h> #include <stdlib.h> #include <string.h> #ifdef MAXFLOW #include <taskQMaxflow.h> #else #include "../include/taskQ.h" #endif #if...
Java
/* * * Copyright 2015, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of condi...
Java
import shutil from nose.tools import * from holland.lib.lvm import LogicalVolume from holland.lib.lvm.snapshot import * from tests.constants import * class TestSnapshot(object): def setup(self): self.tmpdir = tempfile.mkdtemp() def teardown(self): shutil.rmtree(self.tmpdir) def test_snap...
Java
/* * This file is part of Pebble. * * Copyright (c) 2014 by Mitchell Bösecke * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ package com.mitchellbosecke.pebble.extension; import com.mitchellbosecke.pebble.attributes.AttributeResol...
Java
<!DOCTYPE html> <!-- Copyright (c) 2013 The Chromium Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> <link rel="import" href="/core/analysis/analysis_sub_view.html"> <link rel="import" href="/core/analysis/util.html"> <link rel="import...
Java
//***************************************************************************** // // fontcmss46b.c - Font definition for the 46 point Cmss bold font. // // Copyright (c) 2008-2010 Texas Instruments Incorporated. All rights reserved. // Software License Agreement // // Texas Instruments (TI) is supplying this softwar...
Java
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this fi...
Java
.editable:hover { background-color: #FDFDFF; box-shadow: 0 0 20px #D5E3ED; -webkit-background-clip: padding-box; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } #wysihtml5-toolbar { box-shadow: 0 0 5px #999; position: fixed; top: 10px; left: 10px; width: 50px; -webki...
Java
/** * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ package net.sourceforge.pmd.rules.design; import net.sourceforge.pmd.AbstractRule; import net.sourceforge.pmd.ast.ASTAssignmentOperator; import net.sourceforge.pmd.ast.ASTConditionalExpression; import net.sourceforge.pmd.ast.ASTEqu...
Java
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ 'use str...
Java
<?php namespace Sabre\DAVACL\PrincipalBackend; /** * Abstract Principal Backend * * Currently this class has no function. It's here for consistency and so we * have a non-bc-breaking way to add a default generic implementation to * functions we may add in the future. * * @copyright Copyright (C) 2007-2014 fruu...
Java
#include <omp.h> #include <math.h> #define ceild(n,d) ceil(((double)(n))/((double)(d))) #define floord(n,d) floor(((double)(n))/((double)(d))) #define max(x,y) ((x) > (y)? (x) : (y)) #define min(x,y) ((x) < (y)? (x) : (y)) /* * Order-1, 3D 7 point stencil * Adapted from PLUTO and Pochoir test bench * * Tare...
Java
/* * Copyright © 2018-2019, VideoLAN and dav1d authors * Copyright © 2018-2019, Two Orioles, LLC * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must ...
Java
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <limits.h> #include <stddef.h> #include <stdint.h> #include "base/files/file_path.h" #include "base/files/memory_mapped_file.h" #include "base/l...
Java
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/renderer_host/chrome_url_request_user_data.h" namespace { const char* const kKeyName = "chrome_url_request_user_data"; } ...
Java
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ #pragma once #include <set>...
Java
package org.scalameter import org.scalameter.examples.BoxingCountBench import org.scalameter.examples.MethodInvocationCountBench class BoxingCountBenchTest extends InvocationCountMeasurerTest { test("BoxingCountTest.all should be deterministic") { checkInvocationCountMeasurerTest(new BoxingCountBench) } }...
Java
define(["require"], function (require) { function boot(ev) { ev.target.removeEventListener("click", boot); require(["demos/water/water"]); } const start = document.querySelector(".code-demo.water [data-trigger='water.start']"); start.addEventListener("click", boot); start.disabled ...
Java
#locale-settings { margin-top: 30px; } #preferred-locale { margin-top: 10px; } #locale-settings .label { color: #aaa; display: inline-block; font-size: 16px; font-weight: 300; margin: 6px 10px 0 0; text-align: right; width: 280px; vertical-align: top; } #locale-settings .locale-selector { displ...
Java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE23_Relative_Path_Traversal__char_connect_socket_w32CreateFile_66a.cpp Label Definition File: CWE23_Relative_Path_Traversal.label.xml Template File: sources-sink-66a.tmpl.cpp */ /* * @description * CWE: 23 Relative Path Traversal * BadSource: connect_socket Rea...
Java
/* * Copyright (c) 2014 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall * not be construed as granting a license to any other intellectual * property including but not limited to intellectual property relating * to a hardware implementation of the funct...
Java
/* $NetBSD: ecoff_machdep.h,v 1.1 2002/03/13 05:03:18 simonb Exp $ */ #include <mips/ecoff_machdep.h>
Java
\documentclass{jarticle} \usepackage{plext} \usepackage{calc} \begin{document} %% cf. latex.ltx macros (from ltboxes) あいうえお\makebox[60pt]{かきく}さしすせそ\par あいうえお\makebox[-30pt]{かきく}さしすせそ\par % calc extension check あいうえお\makebox[60pt+10pt]{かきく}さしすせそ\par あいうえお\makebox[-30pt/2*3]{かきく}さしすせそ\par % robustness \section{あいうえお\m...
Java
<?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a co...
Java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE762_Mismatched_Memory_Management_Routines__new_free_long_84_goodB2G.cpp Label Definition File: CWE762_Mismatched_Memory_Management_Routines__new_free.label.xml Template File: sources-sinks-84_goodB2G.tmpl.cpp */ /* * @description * CWE: 762 Mismatched Memory Man...
Java
'use strict'; angular.module("ngLocale", [], ["$provide", function ($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; ...
Java
/* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free ** Software License B, Version 1.1 (the "License"), the contents of this ** file are subject only to the provisions of the License. You may not use ** this file except in co...
Java
#ifndef fl_gl_cyclic_color_wheel_h #define fl_gl_cyclic_color_wheel_h #include <FL/gl.h> /* GLfloat GLubyte GLuint GLenum */ #include <FL/Fl.H> #include <FL/Fl_Gl_Window.H> #include <FL/Fl_Value_Input.H> #include <FL/Fl_Check_Button.H> class fl_gl_cyclic_color_wheel : public Fl_Gl_Window { public: fl_gl_cyclic_colo...
Java
from django.apps import AppConfig class ContentStoreAppConfig(AppConfig): name = "contentstore" def ready(self): import contentstore.signals contentstore.signals
Java
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/prefs/json_pref_store.h" #include <algorithm> #include "base/bind.h" #include "base/callback.h" #include "base/file_util.h" #include ...
Java
<?php /** * Zym Framework * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE.txt. * * @category Zym * @package Zym_View * @subpackage Helper * @copyright Copyright (c) 2008 Zym. (http://www.zym-project.com/) * @license http://www.zym-p...
Java
<?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a co...
Java
<?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a co...
Java
# -*- coding: utf-8 -*- """Git tools.""" from shlex import split from plumbum import ProcessExecutionError from plumbum.cmd import git DEVELOPMENT_BRANCH = "develop" def run_git(*args, dry_run=False, quiet=False): """Run a git command, print it before executing and capture the output.""" command = git[split...
Java
package testclasses; import de.unifreiburg.cs.proglang.jgs.support.DynamicLabel; import util.printer.SecurePrinter; public class PrintMediumSuccess { public static void main(String[] args) { String med = "This is medium information"; med = DynamicLabel.makeMedium(med); SecurePrinter.printMedium(med); Stri...
Java
define(["pat-autoscale", "jquery"], function(pattern, jQuery) { describe("pat-autoscale", function() { beforeEach(function() { $("<div/>", {id: "lab"}).appendTo(document.body); $(window).off(".autoscale"); }); afterEach(function() { $("#lab").remove(); ...
Java
require 'spec_helper' RSpec.describe Spree::CheckoutController, type: :controller do # copied from original checkout controller spec let(:token) { 'some_token' } let(:user) { FactoryGirl.create(:user) } let(:order) { OrderWalkthrough.up_to(:delivery) } before do allow_any_instance_of(ActionDispatch::Req...
Java
/* * Copyright 2014 MongoDB, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
Java
#include "pri.h" #include "calcu_erase_dot_noise.h" #include "iip_erase_dot_noise.h" void iip_erase_dot_noise::_exec_uchar( long l_width, long l_height, long l_area_xpos, long l_area_ypos, long l_area_xsize, long l_area_ysize, long l_channels, unsigned char *ucharp_in, unsigned char *ucharp_out ) { long l_start, l_sc...
Java
// Copyright (c) 2013-2015 The btcsuite developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. package wire_test import ( "bytes" "io" ) // fixedWriter implements the io.Writer interface and intentially allows // testing of error paths by forcing short writes....
Java
java_import 'org.apollo.game.action.DistancedAction' # A distanced action which opens a door. class OpenDoorAction < DistancedAction include DoorConstants attr_reader :door def initialize(mob, door) super(0, true, mob, door.position, DOOR_SIZE) @door = door end def executeAction mob.turn_to(@...
Java
import * as React from 'react'; import { BsPrefixComponent } from './helpers'; interface NavbarToggleProps { label?: string; } declare class NavbarToggle< As extends React.ReactType = 'button' > extends BsPrefixComponent<As, NavbarToggleProps> {} export default NavbarToggle;
Java
using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; namespace DotSpatial.Symbology.Forms { public partial class LineSymbolDialog { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.ICo...
Java
function* f() { var x; try { x = yield 1; } catch (ex) { yield ex; } return 2; } var g = f(); expect(g.next()).toEqual({value: 1, done: false}); expect(g.next()).toEqual({value: 2, done: true}); g = f(); expect(g.next()).toEqual({value: 1, done: false}); expect(g.throw(3)).toEqual({value: 3, done: f...
Java
package events import ( "errors" "github.com/miketheprogrammer/go-thrust/lib/commands" "github.com/miketheprogrammer/go-thrust/lib/dispatcher" ) /* Create a new EventHandler for a give event. */ func NewHandler(event string, fn interface{}) (ThrustEventHandler, error) { h := ThrustEventHandler{} h.Event = event...
Java
package edu.pacificu.cs493f15_1.paperorplasticapp; import org.junit.Test; import static org.junit.Assert.*; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2);...
Java
from __future__ import unicode_literals from .atomicparsley import AtomicParsleyPP from .ffmpeg import ( FFmpegPostProcessor, FFmpegAudioFixPP, FFmpegEmbedSubtitlePP, FFmpegExtractAudioPP, FFmpegFixupStretchedPP, FFmpegMergerPP, FFmpegMetadataPP, FFmpegVideoConvertorPP, ) from .xattrpp ...
Java
package com.hearthsim.test.minion; import com.hearthsim.card.Card; import com.hearthsim.card.CharacterIndex; import com.hearthsim.card.basic.minion.BoulderfistOgre; import com.hearthsim.card.basic.minion.RaidLeader; import com.hearthsim.card.classic.minion.common.ScarletCrusader; import com.hearthsim.card.classic.mini...
Java
// Type definitions for yargs 17.0 // Project: https://github.com/chevex/yargs, https://yargs.js.org // Definitions by: Martin Poelstra <https://github.com/poelstra> // Mizunashi Mana <https://github.com/mizunashi-mana> // Jeffery Grajkowski <https://github.com/pushplay> // ...
Java
using Mono.Cecil; namespace Cake.Web.Docs.Reflection.Model { /// <summary> /// Represents reflected method information. /// </summary> public interface IMethodInfo { /// <summary> /// Gets the method identity. /// </summary> /// <value>The method identity.</value> ...
Java
package im.actor.server.api.rpc.service import im.actor.api.rpc.Implicits._ import im.actor.api.rpc._ import im.actor.api.rpc.counters.UpdateCountersChanged import im.actor.api.rpc.groups.{ UpdateGroupInvite, UpdateGroupUserInvited } import im.actor.api.rpc.messaging._ import im.actor.api.rpc.misc.ResponseVoid import ...
Java
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [asse...
Java
<?php /** * This file is part of the Zephir. * * (c) Phalcon Team <team@zephir-lang.com> * * For the full copyright and license information, please view * the LICENSE file that was distributed with this source code. */ namespace Zephir\Detectors; /** * ForValueUseDetector. * * Detects whether the traversed...
Java
<?php namespace Platformsh\Cli\Command\Integration; use Platformsh\Cli\Command\PlatformCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class IntegrationDeleteCommand extends PlatformCommand { /** ...
Java
# Wind River Workbench generated Makefile. # Do not edit!!! # # The file ".wrmakefile" is the template used by the Wind River Workbench to # generate the makefiles of this project. Add user-specific build targets and # make rules only(!) in this project's ".wrmakefile" file. These will then be # automatically dumped in...
Java
__author__ = 'Nishanth' from juliabox.cloud import JBPluginCloud from juliabox.jbox_util import JBoxCfg, retry_on_errors from googleapiclient.discovery import build from oauth2client.client import GoogleCredentials import threading class JBoxGCD(JBPluginCloud): provides = [JBPluginCloud.JBP_DNS, JBPluginCloud.JB...
Java
require 'rails' module StripeI18n class Railtie < ::Rails::Railtie initializer 'stripe-i18n' do |app| StripeI18n::Railtie.instance_eval do pattern = pattern_from app.config.i18n.available_locales add("rails/locale/#{pattern}.yml") end end protected def self.add(pattern)...
Java
/* * The MIT License * * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without l...
Java
class PersonalFileUploader < FileUploader def self.dynamic_path_segment(model) File.join(CarrierWave.root, model_path(model)) end def self.base_dir File.join(root_dir, '-', 'system') end private def secure_url File.join(self.class.model_path(model), secret, file.filename) end def self.mo...
Java
<?php /** * @copyright 2006-2013, Miles Johnson - http://milesj.me * @license http://opensource.org/licenses/mit-license.php * @link http://milesj.me/code/php/transit */ namespace Transit\Transformer\Image; use Transit\File; use \InvalidArgumentException; /** * Crops a photo, but resizes and keeps ...
Java
--- title: Putain de code ! url: http://putaindecode.io/ source: https://github.com/putaindecode/putaindecode.io showcaseTags: - open-source - community - learning - multi-languages ---
Java
teleirc ======= Telegram <-> IRC gateway. * Uses the [node-telegram-bot](https://github.com/orzFly/node-telegram-bot) library for Telegram communication * IRC communication via martynsmith's [node-irc](https://github.com/martynsmith/node-irc) module * All Telegram messages are sent to IRC channel * IRC messages sent ...
Java
require 'spec_helper' describe "php::5_5_4" do let(:facts) { default_test_facts } it do should contain_php__version("5.5.4") end end
Java
<?php /* * $Id: MssqlPlatform.php 3752 2007-04-11 09:11:18Z fabien $ * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE AR...
Java