text:
#import <WebKit/WebKit.h>
#import <JavaScriptCore/JavaScriptCore.h>
#include <objc/message.h>

#import "CDVBridge.h"
#import "CDVViewController.h"

@implementation CDVBridge

- (void) registerJavaScriptHelpers {
    NSString* cordovaBridgeUtil = @"var CordovaBridgeUtil = {};";
    NSString* dictionaryKeys = [NSString stringWithFormat:@"CordovaBridgeUtil.getDictionaryKeys = function(obj) { return Object.keys(obj);};"];

    id win = [self.webView windowScriptObject];
    [win evaluateWebScript:cordovaBridgeUtil];
    [win evaluateWebScript:dictionaryKeys];
}

- (id) initWithWebView:(WebView*) webView andViewController:(CDVViewController*) viewController {
    if ((self = [super init]) != nil) {
        self.webView = webView;
        self.viewController = viewController;
        [self registerJavaScriptHelpers];
    }

    return self;
}

- (void) exec:(NSString*) callbackId withService:(NSString*) service andAction:(NSString*) action andArguments:(WebScriptObject*) webScriptObject {
    // We are going with the iOS method of passing in a callbackId.
    // Note that we can use the JavaScriptCore C API to pass in the JavaScript function references
    // and context and call them directly, but this is done this way for possible plugin sharing
    // between iOS and OS X. Also we are going async as well.

    // we're just going to assume the webScriptObject passed in is an NSArray
    NSArray* arguments = [[webScriptObject JSValue] toArray];

    CDVInvokedUrlCommand* command = [[CDVInvokedUrlCommand alloc] initWithArguments:arguments callbackId:callbackId className:service methodName:action];

    if ((command.cmdClassName == nil) || (command.methodName == nil)) {
        NSLog(@"ERROR: Classname and/or methodName not found for command.");
        return;
    }

    // Fetch an instance of this class
    CDVPlugin* obj = [_viewController.commandDelegate getCommandInstance:command.cmdClassName];

    if (!([obj isKindOfClass:[CDVPlugin class]])) {
        NSLog(@"ERROR: Plugin '%@' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.", command.cmdClassName);
        return;
    }

    // Find the proper selector to call.
    NSString* methodName = [NSString stringWithFormat:@"%@:", command.methodName];
    SEL normalSelector = NSSelectorFromString(methodName);
    if ([obj respondsToSelector:normalSelector]) {
        // [obj performSelector:normalSelector withObject:command];
        void* (*msgSend)(id, SEL, CDVInvokedUrlCommand*) = (typeof(msgSend)) &objc_msgSend;
        msgSend(obj, normalSelector, command);
    } else {
        // There's no method to call, so throw an error.
        NSLog(@"ERROR: Method '%@' not defined in Plugin '%@'", methodName, command.cmdClassName);
    }
}

#pragma mark WebScripting Protocol

/* checks whether a selector is acceptable to be called from JavaScript */
+ (BOOL) isSelectorExcludedFromWebScript:(SEL) sel {
    return sel != @selector(exec:withService:andAction:andArguments:);
}

/* helper function so we don't have to have underscores and stuff in js to refer to the right method */
+ (NSString*) webScriptNameForSelector:(SEL) aSelector {
    if (aSelector == @selector(exec:withService:andAction:andArguments:)) {
        return @"exec";
    } else {
        return nil;
    }
}

// right now exclude all properties (eg keys)
+ (BOOL) isKeyExcludedFromWebScript:(const char*) name {
    return YES;
}

@end


text:
<?php
/**
 * Created by PhpStorm.
 * User: lin11
 * Date: 2017/4/8
 * Time: 18:23
 */

$aid=$_REQUEST['aid'];
$star=$_REQUEST['star'];
$uid=$_REQUEST['uid'];
include('../../model/Activity.php');
$account=new Activity("sqlite:../../mydatabase.sqlite");
$account->addStar($aid,$uid,$star);

redpajama_set_name: RedPajamaGithub


text:
@interface UILabel (ASFont)

@property (nonatomic, strong, setter=as_setFontName:) NSString *as_fontName;
@property (nonatomic, assign, setter=as_setFontSize:) CGFloat as_fontSize;

@end


text:
const proxy = require('http-proxy-middleware');

module.exports = function(app) {
  app.use(proxy('/auth/google', { target: 'http://localhost:5000/' }));
  app.use(proxy('/api/*', { target: 'http://localhost:5000/' }));
};


text:
The article base block defines a standard article document class for use.

### Constructor

The constructor takes a mandatory filename.

```php
new Article($filename)
```

### Params

```
    'lhead'          => '', // Top left header
    'chead'          => '', // Top center header
    'rhead'          => '', // Top right header
    'headheight'     => '12pt',

    'lfoot'          => $dateTime->format('d-m-Y h:m'), // Bottom left footer
    'cfoot'          => '', // Bottom center footer
    'rfoot'          => 'Page\ \thepage\ of\ \pageref{LastPage}', // Bottom right footer
    'footskip'       => '20pt',

    'topmargin'      => '-0.45in', // Some document margins
    'evensidemargin' => '0in',
    'oddsidemargin'  => '0in',
    'textwidth'      => '6.5in',
    'textheight'     => '9.0in',
    'headsep'        => '0.25in',

    'linespread'     => '1.1', // Line spacing

    'headrulewidth'  => '0.4pt', // Header size
    'footrulewidth'  => '0.4pt', // Footer size

    'parindent'      => '0pt', // Remove parindentation

    'secnumdepth'    => '0', // Remove section numbers

    'tocdepth'       => '2', // TOC depth

    'extra_commands' => array(), // Define extra commands if needed
    'packages'       => array(), // Define extra packages to use
```

### Add package

This class also has an `addPackage($package, $options = '')` method. Use this if you need to include extra packages.

As convenience, multiple packages can be added with a single invocation of `addPackages($packages)`. However, this is without package options.

### Add dependency

This class also has an `addDependency($dependency)` method. Use this if you need to copy files from a certain dir to the compilation dir.

As convenience, multiple dependencies can be added with a single invocation of `addDependencies($dependencies)`.

### Template

See [here](https://github.com/bobvandevijver/latex-bundle/blob/master/src/Resources/views/Base/article.tex.twig).


text:
/**
 * Interpolators for interpolating in one and two dimensions.
 * <p>
 * Curve interpolators are used during curve calibration. The built in set of interpolators are
 * defined as an extended enum in {@link com.opengamma.strata.market.curve.interpolator.CurveInterpolators}.
 * This allows them to be referenced statically like a constant but also allows them to be redefined and new
 * instances added.
 */
package com.opengamma.strata.market.curve.interpolator;


text:
package com.amazonaws.services.sagemaker.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.sagemaker.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * GetLineageGroupPolicyRequestMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class GetLineageGroupPolicyRequestMarshaller {

    private static final MarshallingInfo<String> LINEAGEGROUPNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("LineageGroupName").build();

    private static final GetLineageGroupPolicyRequestMarshaller instance = new GetLineageGroupPolicyRequestMarshaller();

    public static GetLineageGroupPolicyRequestMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(GetLineageGroupPolicyRequest getLineageGroupPolicyRequest, ProtocolMarshaller protocolMarshaller) {

        if (getLineageGroupPolicyRequest == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(getLineageGroupPolicyRequest.getLineageGroupName(), LINEAGEGROUPNAME_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
import os,sys
import time
import pprint

from   pyfirmata import ArduinoMega, util
import pyfirmata
from   pyfirmata.boards import BOARDS

#http://python-gtk-3-tutorial.readthedocs.org/en/latest/objects.html

#import pygtk
#pygtk.require("2.0")
#import gtk
#import gtk.glade
#import gobject
#import commands

from gi.repository import Gtk, GObject

glade_file = "mega.glade"
tty        = '/dev/ttyACM0'
updateRate = 3000 #ms

IOBLOCKED  = None
IOINPUT    = 'I'
IOOUTPUT   = 'O'
MEBLOCKED  = None
MEDIGITAL  = 'D'
MEANALOG   = 'A'
MEPWM      = 'P'
DON        = True
DOF        = False
ioid       = [IOINPUT, IOOUTPUT]
meid       = [MEANALOG, MEDIGITAL, MEPWM]

#portSettings = {}
portSettings = {
	MEDIGITAL   : 	{
						'13': [IOOUTPUT, DON]
					},
	MEPWM       : {},
	MEANALOG    : {},
	MEBLOCKED   : {} # Rx, Tx, Crystal
}

#	arduino_mega' : {
#        'digital' : tuple(x for x in range(54)),
#        'analog' : tuple(x for x in range(16)),
#        'pwm' : tuple(x for x in range(2,14)),
#        'use_ports' : True,
#        'disabled' : (0, 1) # Rx, Tx, Crystal
#    }

def doYourStuff(args):
	#print "doing my stuff on",mach
	mach = args[0]
	mach.update()
	return True

class AppUI(object):
	def __init__(self, board):
		self.builder = Gtk.Builder()
		self.builder.add_from_file(glade_file)
		self.builder.connect_signals(self)

		#objs = self.buider.get_objects()
		#print "OBJS",objs
		#io = self.buider.get_object("IO13")
		#print io.set_active_id("1")

		self.board = board
		self.mach  = machine(self, board, predef=portSettings)
		#pprint.pprint(mach)

		GObject.timeout_add(updateRate, doYourStuff, [self.mach])

		try:
			window = self.builder.get_object("window1")
			window.show_all()
			self.mach.update()
		except KeyboardInterrupt:
			print "crtl+c"
			Gtk.main_quit()
			sys.exit(0)

	def on_window_destroy(window, self):
		Gtk.main_quit()

	def onScChange(self, widget):
		name  = Gtk.Buildable.get_name(widget)
		value = int(widget.get_value())
		#print "WIDGET",widget,
		#print "NAME"  ,name,
		#print "ENUM"  ,enum,
		#print "VALUE" ,value,"\n"
		#scale13
		scChange(self, name, value)

	def onIoChange(self, widget):
		name  = Gtk.Buildable.get_name(widget)
		value = widget.get_active_text()
		#print "NAME", name,
		#print "VALUE",value,"\n"
		#IO13
		ioChange(self, name, value)

	def onMEChange(self, widget):
		name  = Gtk.Buildable.get_name(widget)
		value = widget.get_active_text()
		#print "NAME", name,
		#print "VALUE",value,"\n"
		#ME13
		meChange(self, name, value)

	def onBtnClick(self, widget):
		name  = Gtk.Buildable.get_name(widget)
		#value = widget.get_active_text()
		#print "NAME", name,
		#print "VALUE",value,"\n"
		#ME13
		btnChange(self, name)

def scChange(gtk, name, value):
	portNum    = int(name[-2:])
	portNumStr = "%02d" % portNum
	machine    = gtk.mach
	io         = gtk.builder.get_object("IO" + portNumStr)
	me         = gtk.builder.get_object("ME" + portNumStr)
	ioVal      = io.get_active_text()
	meVal      = me.get_active_text()
	print "SC CHANGE %s V %s ID %s IO %s ME %s" % (name, value, portNumStr, ioVal, meVal)

def ioChange(gtk, name, value):
	portNum    = int(name[-2:])
	portNumStr = "%02d" % portNum
	io         = gtk.builder.get_object("IO" + portNumStr)
	me         = gtk.builder.get_object("ME" + portNumStr)
	ioVal      = io.get_active_text()
	meVal      = me.get_active_text()
	print "IO  CHANGE %s V %s ID %s IO %s ME %s" % (name, value, portNumStr, ioVal, meVal)

def meChange(gtk, name, value):
	portNum    = int(name[-2:])
	portNumStr = "%02d" % portNum
	io         = gtk.builder.get_object("IO" + portNumStr)
	me         = gtk.builder.get_object("ME" + portNumStr)
	ioVal      = io.get_active_text()
	meVal      = me.get_active_text()
	print "ME  CHANGE %s V %s ID %s IO %s ME %s" % (name, value, portNumStr, ioVal, meVal)

def btnChange(gtk, name):
	portNum    = int(name[-2:])
	portNumStr = "%02d" % portNum
	io         = gtk.builder.get_object("IO" + portNumStr)
	me         = gtk.builder.get_object("ME" + portNumStr)
	ioVal      = io.get_active_text()
	meVal      = me.get_active_text()
	print "BTN CHANGE %s ID %s IO %s ME %s" % (name, portNum, ioVal, meVal)

class port(object):
	def __init__(self, portNum, portIO, portMethod, portDisplay, portValue=None):
		self.num     = portNum
		self.io      = portIO
		self.method  = portMethod
		self.display = portDisplay

		if portValue is not None:
			self.value = portValue
		else:
			self.value = 0
		self.updateDisplay()
		self.updatePort()

	def updateDisplay(self):
		self.display.update()

	def updatePort(self):
		pass

	def __repr__(self):
		return "<PORT OBJECT NUM '%d' IO '%s' METHOD '%s' VALUE '%d' DISPLAY '%s'>" % (self.num, self.io, self.method, self.value, self.display)

class display(object):
	def __init__(self, app, portNum, io, me, value, valid):
		self.valid  = False
		self.app    = None
		self.num    = None
		self.numStr = None

		self.sf     = None
		self.io     = None
		self.me     = None
		self.sc     = None
		self.le     = None
		self.sp     = None
		self.on     = None
		self.of     = None

		self.app    = app
		self.num    = portNum
		self.numStr = "%02d" % portNum

		if valid:
			self.sf = app.builder.get_object( "scaffold" + self.numStr ) # scaffold gtk layout
			self.io = app.builder.get_object( "IO"       + self.numStr ) # io combo box
			self.me = app.builder.get_object( "ME"       + self.numStr ) # me combo box
			self.sc = app.builder.get_object( "SC"       + self.numStr ) # value scale
			self.le = app.builder.get_object( "lbl"      + self.numStr ) # label
			self.sp = app.builder.get_object( "SP"       + self.numStr ) # value spin button
			self.on = app.builder.get_object( "ON"       + self.numStr ) # on  light button
			self.of = app.builder.get_object( "OF"       + self.numStr ) # off light button

			if 	self.sf is not None and \
				self.io is not None and \
				self.me is not None and \
				self.sc is not None and \
				self.le is not None and \
				self.sp is not None and \
				self.on is not None and \
				self.of is not None:
				self.valid = True

				self.stateIo  = io
				self.stateMe  = me
				self.stateVal = value
				self.update(portIO=io, portMethod=me, value=value)

		else:
			self.hide()

	def hide(self):
		self.sf = self.app.builder.get_object( "scaffold" + self.numStr ) # scaffold gtk layout
		if self.sf is not None:
			self.sf.set_visibility(False)

	def isValid(self):
		return self.valid

	def update(self, portIO=None, portMethod=None, value=None):
		if self.valid:
			print "UPDATING PORT %s METHOD %s VALUE %s" % (portIO, portMethod, str(value))
			iostate = self.io.get_active_text()
			mestate = self.me.get_active_text()
			scvalue = int(self.sc.get_value())

			ioCmp = self.stateIo
			if portIO is not None:
				ioCmp        = portIO
				self.stateIo = portIO

			if iostate != ioCmp:
				ioIndex = ioid.index(ioCmp)
				print "  UPDATING IO FROM %s TO %s INDEX %d" % (iostate, ioCmp, ioIndex)
				self.io.set_active(ioIndex)

			meCmp = self.stateMe
			if portMethod is not None:
				meCmp        = portMethod
				self.stateMe = portMethod

			if mestate != meCmp:
				meIndex = meid.index(meCmp)
				print "  UPDATING ME FROM %s TO %s INDEX %d" % (mestate, meCmp, meIndex)
				self.me.set_active(meIndex)

			if  meCmp is not None:
				if   meCmp == MEDIGITAL:
					self.showLed()
					self.hideScroll()
					print "  SET DIGITAL VALUE %s" % (str(value))
					if portIO == IOOUTPUT:
						self.setLed(value)

				elif meCmp == MEANALOG:
					self.showScroll()
					self.hideLed()
					self.setLed('NONE')
					print "  SET ANALOG VALUE %s" % (str(value))
					if portIO == IOOUTPUT:
						self.sc.set_value(value)

				elif meCmp == MEPWM:
					self.showScroll()
					self.hideLed()
					self.setLed('NONE')
					print "  SET PWM VALUE %s" % (str(value))
					if portIO == IOOUTPUT:
						self.sc.set_value(value)

	def setLed(self, state):
		print "    SETTING LED %s" % str(state)
		#print "\n".join(dir(self.on))
		if   state == DON:
			self.on.set_image(self.app.builder.get_object("ONON"))
			self.of.set_image(self.app.builder.get_object("OFOF"))

		elif state == DOF:
			self.on.set_image(self.app.builder.get_object("ONOF"))
			self.of.set_image(self.app.builder.get_object("OFON"))

		#elif state == 'NONE':
		#	self.on.set_from_file("ONOF")
		#	self.of.set_from_file("OFOF")

	def hideScroll(self):
		print "    HIDDING SCROLL"
		#print "\n".join(dir(self.sc))
		self.sc.set_visible(False)
		self.sp.set_visible(False)

	def showScroll(self):
		print "    SHOWING SCROLL"
		self.sc.set_visible(True)
		self.sp.set_visible(True)

	def hideLed(self):
		print "    HIDDING LED"
		self.on.hide()
		self.of.hide()

	def showLed(self):
		print "    SHOWING LED"
		self.on.show()
		self.of.show()

	def __repr__(self):
		return "<DISPLAY OBJECT SF '%s' IO '%s' ME '%s' SC '%s' LE '%s' SP '%s' ON '%s' OF '%s'>" % \
		(self.sf, self.io, self.me, self.sc, self.le, self.sp, self.on, self.of)

class machine(object):
	def __init__(self, app, board, predef=None):
		self.ports        = {
								MEDIGITAL: [],
								MEANALOG : [],
								MEPWM    : []
							}
		self.app = app

		digitals = board.layout['digital' ]
		analogs  = board.layout['analog'  ]
		pwms     = board.layout['pwm'     ]
		disabled = board.layout['disabled']

		for pair in [[digitals, MEDIGITAL],[analogs, MEANALOG],[pwms, MEPWM]]:
			lib    = pair[0]
			portMe = pair[1]

			for portNum in lib:
				valid = True
				if portNum in disabled:
					valid = False

				while len(self.ports[portMe]) <= portNum:
					self.ports[portMe].append(None)

				if predef is not None and predef.has_key(portMe) and predef[portMe].has_key(str(portNum)):
					io, val = predef[portMe][str(portNum)]
					portDisplay = display(app, portNum, io,      portMe, val, valid)
					self.ports[portMe][portNum] = port(portNum, io,      portMe, portDisplay, portValue=val)
				else:
					portDisplay = display(app, portNum, IOINPUT, portMe, 0,   valid)
					self.ports[portMe][portNum] = port(portNum, IOINPUT, portMe, portDisplay)

	def update(self):
		print "UPDATING MACHINE STATE"
		for portMe in self.ports.keys():
			for portObj in self.ports[portMe]:
				#portObj = self.ports[portMe][portNum]
				if portObj is not None:
					portObj.updateDisplay()

	def updatePort(self):
		pass

	def __repr__(self):
		return pprint.pformat(self.ports)

def main():
	print "opening"
	#board = BOARDS['arduino_mega']

	if os.path.exists(tty):
		board = ArduinoMega(tty, baudrate=57600)#, target=0)
		#time.sleep(3)

		#print "VERSION",board.get_firmata_version()
		## Prints some details to STDOUT
		#print "pyFirmata version:  %s"      % str(pyfirmata.__version__ )
		#print "Hardware:           %s"      % str(board                 )
		#print "Firmata version:    %s"      % str(board.firmata_version )
		#print "Firmware:           %s"      % str(board.firmware        )
		#print "Firmware version:   %s"      % str(board.firmware_version)
		#time.sleep(3)
		board.string_write("1234567890123567890")#from python. please echo")
		#board.string_write("abcdefghijklmn")#from python. please echo")
		#print "Firmata firmware name:  %s" % board.get_firmware()
		#print "Firmata firmware:\t%i.%i"   % (board.get_firmata_version()[0], board.get_firmata_version()[1])
		#time.sleep(10)

		try:
			while True:
				while board.sp.inWaiting() > 0:
					board.iterate()
				#print "sleeping"
				time.sleep(.5)
		except KeyboardInterrupt:
			sys.exit(0)
		except:
			sys.exit(1)

		#print "out"
		#	print "on"
		#	board.digital[13].write(1)
		#	time.sleep(1)
		#	print "off"
		#	board.digital[13].write(0)
		#	time.sleep(2)

		#try:
		#	app  = AppUI(board)
		#	Gtk.main()
		#
		#except KeyboardInterrupt:
		#	print "crtl+c"
		#	Gtk.main_quit()
		#	sys.exit(0)

if __name__ == '__main__': main()

#tries = [
#			value.get_accessible, value.get_active, value.get_active_id, value.get_active_iter, value.get_active_text, value.get_add_tearoffs, value.get_allocated_height, value.get_allocated_width, value.get_allocation,
#			##value.get_ancestor,
#			value.get_app_paintable, value.get_area, value.get_border_width, value.get_button_sensitivity, value.get_can_default,
#			value.get_can_focus, value.get_cells, value.get_child, value.get_child_requisition, value.get_child_visible,value.get_children,
#			##value.get_clipboard,
#			value.get_column_span_column, value.get_composite_name,
#			##value.get_data,
#			value.get_default_direction, value.get_default_style,
#			##value.get_device_enabled,
#			##value.get_device_events,
#			value.get_direction, value.get_display, value.get_double_buffered, value.get_entry_text_column, value.get_events,
#			value.get_focus_chain, value.get_focus_child, value.get_focus_hadjustment, value.get_focus_on_click,
#			value.get_focus_vadjustment, value.get_halign, value.get_has_entry, value.get_has_tooltip, value.get_has_window,
#			value.get_hexpand, value.get_hexpand_set, value.get_id_column,
#			##value.get_internal_child,
#			value.get_mapped,
#			value.get_margin_bottom, value.get_margin_left, value.get_margin_right, value.get_margin_top, value.get_model,
#			##value.get_modifier_mask,
#			value.get_modifier_style, value.get_name, value.get_no_show_all, value.get_pango_context,
#			value.get_parent, value.get_parent_window, value.get_path,
#			##value.get_path_for_child,
#			value.get_pointer,
#			value.get_popup_accessible, value.get_popup_fixed_width, value.get_preferred_height,
#			##value.get_preferred_height_for_width,
#			value.get_preferred_size, value.get_preferred_width,
#			##value.get_preferred_width_for_height,
#			##value.get_properties,
#			##value.get_property,
#			value.get_realized, value.get_receives_default, value.get_request_mode, value.get_requisition,
#			value.get_resize_mode, value.get_root_window, value.get_row_span_column, value.get_screen, value.get_sensitive,
#			##value.get_settings,
#			value.get_size_request, value.get_state, value.get_state_flags, value.get_style, value.get_style_context,
#			value.get_support_multidevice, value.get_title, value.get_tooltip_markup, value.get_tooltip_text, value.get_tooltip_window,
#			value.get_toplevel, value.get_valign, value.get_vexpand, value.get_vexpand_set, value.get_visible, value.get_visual,
#			value.get_window, value.get_wrap_width
#		]
#for tri in tries:
#	print tri()

#print "ACTIVE"         ,value.get_active()
#print "ACTIVE ID"      ,value.get_active_id()
#print "COMPOSITE NAME" ,value.get_composite_name()
##print "DATA"           ,value.get_data()
#print "ID COLUMN"      ,value.get_id_column()
#print "NAME"           ,value.get_name()
##print "PROPERTIES"     ,value.get_properties()
#print "TITLE"          ,value.get_title()
#modify_text
#set_active
#set_active_id


text:
cask 'navicat-for-sqlite' do
  version '11.2.6'
  sha256 '0e28fc07c862413576ad55b97cbafee25109ae62a0ee5cf233794ad5fb5f148a'

  url "http://download.navicat.com/download/navicat#{version.major_minor.no_dots}_sqlite_en.dmg"
  name 'Navicat for SQLite'
  homepage 'http://www.navicat.com/products/navicat-for-sqlite'
  license :commercial

  app 'Navicat for SQLite.app'
end


text:
package org.netbeans.cubeon.trac.query;

import org.netbeans.cubeon.tasks.spi.Notifier;
import org.netbeans.cubeon.tasks.spi.query.TaskQuery;
import org.netbeans.cubeon.tasks.spi.query.TaskQueryEventAdapter;
import org.netbeans.cubeon.tasks.spi.repository.TaskRepository;
import org.netbeans.cubeon.trac.repository.TracTaskRepository;

/**
 *
 * @author Anuradha G
 */
public abstract class AbstractTracQuery implements TaskQuery {

    private final TracTaskRepository repository;
    private final String id;
    protected final QueryExtension extension;

    public enum Type {

        FILTER,UTIL
    }

    public AbstractTracQuery(TracTaskRepository repository, String id) {
        this.repository = repository;
        this.id = id;
        extension = new QueryExtension(this);
    }

    public String getId() {
        return id;
    }

    public TaskRepository getTaskRepository() {
        return repository;
    }

    public TracTaskRepository getRepository() {
        return repository;
    }

    public Notifier<TaskQueryEventAdapter> getNotifier() {
        return extension;
    }

    public QueryExtension getTracExtension() {
        return extension;
    }

    public abstract Type getType();
}


text:
<!DOCTYPE html>

    <title>Grocery List App</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.css" />
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="style/css/style.css" />

    <md-content>
      <md-toolbar class="md-hue-2">

          <md-button class="md-icon-button" aria-label="Settings" ng-disabled="true">
            <md-icon></md-icon>
          </md-button>

Grocery List App

          <md-button class="md-icon-button" aria-label="Show delete buttons" ng-click="toggleDeleteButtons()">
            <md-icon></md-icon>
          </md-button>

          <md-button class="md-icon-button" aria-label="More">
            <md-icon></md-icon>
          </md-button>

      </md-toolbar>

{{total}}

{{partialTotal}}

        <md-list flex ng-repeat="item in groceryList">
            <md-list-item class="md-1-line" layout="row" flex>

                  {{item.text}}

                <md-button id="check-{{item.id}}" class="md-fab md-mini md-primary" layout-align="end" ng-click="strike(item.id)" aria-label="Strike through">

                </md-button>
                <md-button id="uncheck-{{item.id}}" style="display: none" class="md-fab md-mini md-primary" layout-align="end" ng-click="unstrike(item.id)" aria-label="Unstrike through">

                </md-button>
                <md-button id="delete-{{item.id}}" style="display: none" name="deleteBtn" class="md-fab md-mini" layout-align="end" ng-click="delete(item.text)" aria-label="Delete">

                </md-button>
            </md-list-item>
            <md-divider></md-divider>
        </md-list>

        <md-input-container class="md-block">
              Add an item
              <input type="text" id="inputItems" ng-model="newItem" ng-keypress="addItems()">
        </md-input-container>

    </md-content>


text:
var db = require('./models');

var userList = [];
userList.push({
    userName: 'Archy',
    lastName: 'Posada',
    bio: 'GA student working on the railway.',
    profilePic: 'null'
});
userList.push({
    userName: 'Shaya',
    lastName: 'Nelson',
    bio: 'GA student working on the planes.',
    profilePic: 'null'
});
userList.push({
    userName: 'Gabriella',
    lastName: 'Choy',
    bio: 'GA student working on the boatsway.',
    profilePic: 'null'
});
console.log("users have been added");

var entryList = [];
entryList.push({
    userName: "Archy",
    dishName: "Enchiladas",
    foodOrigin: "Mexico",
    calories: 270,
    foodDescription: "Vegan cheese, gluten free, organic usda avocado"
});
entryList.push({
    userName: "Archy",
    dishName: "Quiche",
    foodOrigin: "France?",
    calories: 350,
    foodDescription: "Powered by organic french people!"
});
entryList.push({
    userName: "Archy",
    dishName: "Fruit Bowl",
    foodOrigin: "World",
    calories: 350,
    foodDescription: "Powered by organic Greek people!"
});

db.User.remove({}, function(err, user) {

    db.User.create(userList, function(err, users) {
        if (err) {
            return console.log('ERROR', err);
        }
        console.log("all users:", users);
        console.log("created", user.length, "users");

        // TODO: This ensures everything will be removed and created BEFORE process exit.
        db.Entry.remove({}, function(err, entry) {

          db.Entry.create(entryList, function(err, entries) {
            if (err) {
              return console.log('ERROR', err);
            }
            console.log("all entries:", entries);
            console.log("created", entryList.length, "entries");
            process.exit();
          });
        });

    });
});


text:
[_MusicMount.org_](http://musicmount.org) provides an API and tools to access
your music from your mobile devices. The _MusicMount_ tool is used to build a
static _MusicMount_ site, ready to be deployed to a web server.

The _MusicMount_ tool scans your music folder for MP3 and M4A (Apple) audio files,
extracts metadata like track names, album titles, artists, genres, cover art, etc.
It then computes an album-centric model and generates a static _MusicMount_ site
(also known as _mount_) consisting of JSON and image files.

![_MusicMount_ Tool](http://musicmount.org/images/musicmount-tool-build.png)

A _MusicMount_ site can be hosted on a NAS, Raspberry Pi or even on a wireless drive.
Once your site is built and deployed, you can access your site from your mobile device.

There's also a "live" command to quickly launch a server without generating a static
site. This is the easiest way to get things going, to temporarily mount music from
iTunes, stored on a thumb drive, etc.

The _MusicMount_ client app for iOS is available on the App Store.

![_MusicMount_ for iOS](http://musicmount.org/images/musicmount-ios.jpg)

## Features

- Easy to use graphical user interface
- High performance ID3/MP4 tag parsers
- Embedded test server to get you started quickly
- Remote file system support via CIFS (SMB) or WebDAV
- Incremental builds -- only parses newly added and modified tracks

## Documentation

Documentation is available [here](http://musicmount.org/tool/).

## Change History

#### Version 1.6.3 (2014/12/05)

- set log level for `"javax.jmdns"` to `SEVERE`
- fix NPE if `AssetParser.extractArtwork(...)` gives null
- [UI] fixed: fields not updated from model when switching tab (Java 8u5 and later)
- [UI] Mac application (with internal JRE), disk image (DMG) and installer package (PKG)

#### Version 1.6.2 (2014/07/14)

- separated audio info/tag extraction code into new project
  ([Ithaka Audio Info](https://github.com/beckchr/ithaka-audioinfo/))
- [UI] catch runtime exceptions when starting/stopping bonjour service

#### Version 1.6.1 (2014/07/01)

- use jmDNS host name in Bonjour site URL
- added auto-update for "live" sites
- [UI] Bonjour user preference

#### Version 1.6 (2014/06/20)

- added Bonjour support ("live" and "test" commands)
- use AWT toolkit to read images (instead of ImageIO) for better performance
- StAXON JSR 353 (javax.json) streaming backend for better JSON performance
- fixed: M4AInfo fails to get year if '@day' contains full date
- new "live" command to mount folder without generating a static site
- [UI] new "Live" tab, lots of minor improvements

#### Version 1.5.1 (2014/06/04)

- fixed m4a issue with parsing year with length != 4
- generate scripts via "Application Assembler" (maven plugin)
- make Jetty the default server (was: tomcat)
- [UI] update loggers with ConsoleHandler after redirecting stdout/stderr
- [UI] cancel running service before closing stage
- [UI] don't make "Full Parse/Build" option a user preference
- minor improvements/fixes

#### Version 1.5 (2014/05/02)

- generate track index
- added JavaFX user interface
- minor improvements/fixes

#### Version 1.4.1 (2014/04/04)

- upgrade dependencies to StAXON 1.3, Sardine 5.1
- increased ID3 text buffer size for comments/lyrics
- improved progress monitoring

#### Version 1.4 (2014/01/24)

- test server: root context is now `/musicmount`, support `--music ../music` (one level up only)
- improved image task building
- expect <mountFolder> to exist (do not create)
- ask for password for URLs like `http://user@host/path`
- `--music <path>` defaults to relative path from `<mountFolder>` to `<musicFolder>`
- remote file systems support (smb + webdav)
- do not use directory index by default; `--directoryIndex` replaces `--noDirectoryIndex`
- support absolute `--music <path>`, e.g. `/music`
- refactored audio/tag parsing stuff into "audio" package
- added "link" command
- use lexicographically increasing `yyyy-MM-dd'T'HH:mm:ss` date pattern for updateToken
- implemented new ID3/MP3 tag parser, dropped _mp3agic_
- redesigned asset store (update & sync)

#### Version 1.3 (2013/12/12)

- fixed merging of album from VA into album artist
- replaced _imgscalr_ with _thumbnailator_ library
- simplified image scaling
- log exception if asset store loading failed
- use maximum track year as album year
- fixed: unknown artist not shown in artist index
- asset store format change: `apiVersion` --> `version`

#### Version 1.2 (2013/12/08)

- mark modified tracks as "changed"
- support album track grouping
- support `updateToken` API
- added `--verbose`option
- changed title of album tracks without disc to "Tracks"

#### Version 1.1.6 (2013/11/26)

- preserve album id for modified tracks
- delete image if write failed

#### Version 1.1.5 (2013/11/25)

- do not mark VA album collection as "Compilations"

#### Version 1.1.4 (2013/11/22)

- trim track/album/artist title etc
- update to _mp3agic_ 0.8.2
- sort compilations with album artist by year (and title)

#### Version 1.1.3 (2013/09/07)

- if (track) artist is missing, use album artist as default
- consult ID3v1 tag if ID3v2 info is incomplete
- use oldest available album cover as artist image

#### Version 1.1.2 (2013/06/11)

- fixed: `AssetStore` not updating timestamp

#### Version 1.1.1 (2013/06/06)

- generate images using multiple threads

#### Version 1.1 (2013/05/24)

- implemented new mp4 tag parser, dropped _jaudiotagger_
- use _mp3agic_ to parse MP3 tags

#### Version 1.0 (2013/04/26)

- Initial release

## License

Available under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).

_(c) 2013, 2014 Odysseus Software_


text:
    namespace workaround
    {
        inline void define_allocators()
        {
            std::allocator<int> a0;
            std::allocator<double> a1;
        }
    }
#endif

namespace py = pybind11;
using proteus::Richards_base;

PYBIND11_MODULE(cRichards, m)
{
    xt::import_numpy();

    py::class_<Richards_base>(m, "cRichards_base")
        .def(py::init(&proteus::newRichards))
        .def("calculateResidual", &Richards_base::calculateResidual)
        .def("calculateJacobian", &Richards_base::calculateJacobian);
}


text:
package hr.ngs.benchmark.model;

import org.revenj.patterns.AggregateRoot;

import java.time.LocalDate;
import java.util.UUID;

public class Post implements AggregateRoot {
	private UUID id;
	private String title;
	private LocalDate created;
	private String URI;

	public Post() {
		this.id = UUID.randomUUID();
		this.title = "";
		this.created = LocalDate.now();
	}

	public Post(UUID id, String title, LocalDate created) {
		this.id = id;
		this.title = title;
		this.created = created;
	}

	public UUID getId() { return id; }
	public void setId(UUID value) { id = value; }

	public String getTitle() { return title; }
	public void setTitle(String value) { title = value; }

	public LocalDate getCreated() { return created; }
	public void setCreated(LocalDate value) { created = value; }

	@Override
	public String getURI() {
		if (URI == null) {
			URI = id.toString();
		}
		return URI;
	}

	@Override
	public int hashCode() {
		return id.hashCode();
	}

	@Override
	public boolean equals(Object other) {
		if (other == null || !(other instanceof Post)) {
			return false;
		}
		Post value = (Post)other;
		return value.id.equals(this.id)
				&& value.title.equals(this.title)
				&& value.created.equals(this.created);
	}
}


text:
package org.springframework.remoting.support;

import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;

/**
 * Encapsulates a remote invocation result, holding a result value or an exception.
 * Used for HTTP-based serialization invokers.
 *
 *
This is an SPI class, typically not used directly by applications.
 * Can be subclassed for additional invocation parameters.
 *
 * @author Juergen Hoeller
 * @since 1.1
 * @see RemoteInvocation
 */
public class RemoteInvocationResult implements Serializable {

	/** Use serialVersionUID from Spring 1.1 for interoperability */
	private static final long serialVersionUID = 2138555143707773549L;

	private Object value;

	private Throwable exception;

	/**
	 * Create a new RemoteInvocationResult for the given result value.
	 * @param value the result value returned by a successful invocation
	 * of the target method
	 */
	public RemoteInvocationResult(Object value) {
		this.value = value;
	}

	/**
	 * Create a new RemoteInvocationResult for the given exception.
	 * @param exception the exception thrown by an unsuccessful invocation
	 * of the target method
	 */
	public RemoteInvocationResult(Throwable exception) {
		this.exception = exception;
	}

	/**
	 * Return the result value returned by a successful invocation
	 * of the target method, if any.
	 * @see #hasException
	 */
	public Object getValue() {
		return this.value;
	}

	/**
	 * Return the exception thrown by an unsuccessful invocation
	 * of the target method, if any.
	 * @see #hasException
	 */
	public Throwable getException() {
		return this.exception;
	}

	/**
	 * Return whether this invocation result holds an exception.
	 * If this returns false, the result value applies
	 * (even if null).
	 * @see #getValue
	 * @see #getException
	 */
	public boolean hasException() {
		return (this.exception != null);
	}

	/**
	 * Return whether this invocation result holds an InvocationTargetException,
	 * thrown by an invocation of the target method itself.
	 * @see #hasException()
	 */
	public boolean hasInvocationTargetException() {
		return (this.exception instanceof InvocationTargetException);
	}

	/**
	 * Recreate the invocation result, either returning the result value
	 * in case of a successful invocation of the target method, or
	 * rethrowing the exception thrown by the target method.
	 * @return the result value, if any
	 * @throws Throwable the exception, if any
	 */
	public Object recreate() throws Throwable {
		if (this.exception != null) {
			Throwable exToThrow = this.exception;
			if (this.exception instanceof InvocationTargetException) {
				exToThrow = ((InvocationTargetException) this.exception).getTargetException();
			}
			RemoteInvocationUtils.fillInClientStackTraceIfPossible(exToThrow);
			throw exToThrow;
		}
		else {
			return this.value;
		}
	}

}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<title>HasThread xref</title>
<link type="text/css" rel="stylesheet" href="../../../../../stylesheet.css" />

View Javadoc

1
18  package org.apache.hadoop.hbase.util;
19
20  import java.lang.Thread.UncaughtExceptionHandler;
21
22  /**
23   * Abstract class which contains a Thread and delegates the common Thread
24   * methods to that instance.
25   *
26   * The purpose of this class is to workaround Sun JVM bug #6915621, in which
27   * something internal to the JDK uses Thread.currentThread() as a monitor
28   * lock. This can produce deadlocks like HBASE-4367, HBASE-4101, etc.
29   */
30  public abstract class HasThread implements Runnable {
31    private final Thread thread;
32
33    public HasThread() {
34      this.thread = new Thread(this);
35    }
36
37    public HasThread(String name) {
38      this.thread = new Thread(this, name);
39    }
40
41    public Thread getThread() {
42      return thread;
43    }
44
45    public abstract void run();
46
47    //// Begin delegation to Thread
48
49    public final String getName() {
50      return thread.getName();
51    }
52
53    public void interrupt() {
54      thread.interrupt();
55    }
56
57    public final boolean isAlive() {
58      return thread.isAlive();
59    }
60
61    public boolean isInterrupted() {
62      return thread.isInterrupted();
63    }
64
65    public final void setDaemon(boolean on) {
66      thread.setDaemon(on);
67    }
68
69    public final void setName(String name) {
70      thread.setName(name);
71    }
72
73    public final void setPriority(int newPriority) {
74      thread.setPriority(newPriority);
75    }
76
77    public void setUncaughtExceptionHandler(UncaughtExceptionHandler eh) {
78      thread.setUncaughtExceptionHandler(eh);
79    }
80
81    public void start() {
82      thread.start();
83    }
84
85    public final void join() throws InterruptedException {
86      thread.join();
87    }
88
89    public final void join(long millis, int nanos) throws InterruptedException {
90      thread.join(millis, nanos);
91    }
92
93    public final void join(long millis) throws InterruptedException {
94      thread.join(millis);
95    }
96    //// End delegation to Thread
97  }

This page was automatically generated by Maven


text:
ctest_test
----------

Perform the :ref:`CTest Test Step` as a :ref:`Dashboard Client`.

::

  ctest_test([BUILD <build-dir>] [APPEND]
             [START <start-number>]
             [END <end-number>]
             [STRIDE <stride-number>]
             [EXCLUDE <exclude-regex>]
             [INCLUDE <include-regex>]
             [EXCLUDE_LABEL <label-exclude-regex>]
             [INCLUDE_LABEL <label-include-regex>]
             [EXCLUDE_FIXTURE <regex>]
             [EXCLUDE_FIXTURE_SETUP <regex>]
             [EXCLUDE_FIXTURE_CLEANUP <regex>]
             [PARALLEL_LEVEL <level>]
             [TEST_LOAD <threshold>]
             [SCHEDULE_RANDOM <ON|OFF>]
             [STOP_TIME <time-of-day>]
             [RETURN_VALUE <result-var>]
             [CAPTURE_CMAKE_ERROR <result-var>]
             [QUIET]
             )

Run tests in the project build tree and store results in
``Test.xml`` for submission with the :command:`ctest_submit` command.

The options are:

``BUILD <build-dir>``
  Specify the top-level build directory.  If not given, the
  :variable:`CTEST_BINARY_DIRECTORY` variable is used.

``APPEND``
  Mark ``Test.xml`` for append to results previously submitted to a
  dashboard server since the last :command:`ctest_start` call.
  Append semantics are defined by the dashboard server in use.
  This does *not* cause results to be appended to a ``.xml`` file
  produced by a previous call to this command.

``START <start-number>``
  Specify the beginning of a range of test numbers.

``END <end-number>``
  Specify the end of a range of test numbers.

``STRIDE <stride-number>``
  Specify the stride by which to step across a range of test numbers.

``EXCLUDE <exclude-regex>``
  Specify a regular expression matching test names to exclude.

``INCLUDE <include-regex>``
  Specify a regular expression matching test names to include.
  Tests not matching this expression are excluded.

``EXCLUDE_LABEL <label-exclude-regex>``
  Specify a regular expression matching test labels to exclude.

``INCLUDE_LABEL <label-include-regex>``
  Specify a regular expression matching test labels to include.
  Tests not matching this expression are excluded.

``EXCLUDE_FIXTURE <regex>``
  If a test in the set of tests to be executed requires a particular fixture,
  that fixture's setup and cleanup tests would normally be added to the test
  set automatically. This option prevents adding setup or cleanup tests for
  fixtures matching the ``<regex>``. Note that all other fixture behavior is
  retained, including test dependencies and skipping tests that have fixture
  setup tests that fail.

``EXCLUDE_FIXTURE_SETUP <regex>``
  Same as ``EXCLUDE_FIXTURE`` except only matching setup tests are excluded.

``EXCLUDE_FIXTURE_CLEANUP <regex>``
  Same as ``EXCLUDE_FIXTURE`` except only matching cleanup tests are excluded.

``PARALLEL_LEVEL <level>``
  Specify a positive number representing the number of tests to
  be run in parallel.

``TEST_LOAD <threshold>``
  While running tests in parallel, try not to start tests when they
  may cause the CPU load to pass above a given threshold.  If not
  specified the :variable:`CTEST_TEST_LOAD` variable will be checked,
  and then the ``--test-load`` command-line argument to :manual:`ctest(1)`.
  See also the ``TestLoad`` setting in the :ref:`CTest Test Step`.

``SCHEDULE_RANDOM <ON|OFF>``
  Launch tests in a random order.  This may be useful for detecting
  implicit test dependencies.

``STOP_TIME <time-of-day>``
  Specify a time of day at which the tests should all stop running.

``RETURN_VALUE <result-var>``
  Store in the ``<result-var>`` variable ``0`` if all tests passed.
  Store non-zero if anything went wrong.

``CAPTURE_CMAKE_ERROR <result-var>``
  Store in the ``<result-var>`` variable -1 if there are any errors running
  the command and prevent ctest from returning non-zero if an error occurs.

``QUIET``
  Suppress any CTest-specific non-error messages that would have otherwise
  been printed to the console.  Output from the underlying test command is not
  affected.  Summary info detailing the percentage of passing tests is also
  unaffected by the ``QUIET`` option.

See also the :variable:`CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE`
and :variable:`CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE` variables.


text:
<?php

namespace JbNahan\PhpUpdate\Command;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Helper\Table;

class ShowConfigCommand extends Command
{
    protected function configure()
    {
        $this
            ->setName('config:show')
            ->setDescription('Display the configuration')
        ;
    }

    protected function initialize(InputInterface $input, OutputInterface $output)
    {
        if (!$this->getApplication()->isConfigured()) {
            throw new \Exception('Cannot run update if app is not configured', 1);
        }
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $config = $this->getApplication()->getConfig()['install'];

        foreach ($config as $install_name => $conf) {
            $output->writeln('Config for install : <info>'.$install_name.'</info>');
            $config2 = [];
            foreach ($conf as $key => $value) {
                $config2[] = [$key, $value];
            }

            $table = new Table($output);
            $table
                ->setHeaders(array('Key', 'Value'))
                ->setRows($config2);

            $table->render();
        }
    }
}


text:
namespace raksha::ir {

class BlockBuilder {
 public:
  BlockBuilder() : block_(std::make_unique<Block>()) {}

  BlockBuilder& AddInput(absl::string_view name, types::Type type) {
    CHECK(!IsBuilt())
        << "Attempt to use a `BlockBuilder` that has already been built.";
    block_->inputs_.AddDecl(name, std::move(type));
    return *this;
  }

  BlockBuilder& AddOutput(absl::string_view name, types::Type type) {
    CHECK(!IsBuilt())
        << "Attempt to use a `BlockBuilder` that has already been built.";
    block_->outputs_.AddDecl(name, std::move(type));
    return *this;
  }

  BlockBuilder& AddResult(absl::string_view name, Value output) {
    CHECK(!IsBuilt())
        << "Attempt to use a `BlockBuilder` that has already been built.";
    CHECK(block_->outputs_.FindDecl(name) != nullptr)
        << "Output '" << name << "' is not declared in the block.";
    block_->results_.insert({std::string(name), output});
    return *this;
  }

  // Constructs and adds an operation to the block and returns the operation.
  const Operation& AddOperation(const Operator& op,
                                NamedAttributeMap attributes, ValueList inputs,
                                std::unique_ptr<Module> impl_module = nullptr) {
    return AddOperation(std::make_unique<Operation>(
        op, std::move(attributes), std::move(inputs), std::move(impl_module)));
  }

  // Sets parent of operation and adds an operation to the block and returns
  // the operation.
  const Operation& AddOperation(std::unique_ptr<Operation> op) {
    CHECK(!IsBuilt())
        << "Attempt to use a `BlockBuilder` that has already been built.";
    CHECK(op != nullptr) << "`AddOperation` received a nullptr.";
    CHECK(op->parent() == nullptr)
        << "`AddOperation` received an operation with its Parent pointer "
           "already defined. Cannot set parent again!";
    op->set_parent(block_.get());
    block_->operations_.push_back(std::move(op));
    return *block_->operations_.back();
  }

  // Allows an operation to be added to the block using a `T::Create` method as
  // long as the following hold:
  //   - `T` is a derived class of `Operation`.
  //   - `T::create` takes a pointer to parent block as a first argument.
  // This method also checks that T::Create does not return a nullptr and
  // sets the parent block correctly.
  template <typename T, typename... Args,
            std::enable_if_t<std::is_base_of<Operation, T>::value, bool> = true>
  const Operation& AddOperation(Args&&... a) {
    CHECK(!IsBuilt())
        << "Attempt to use a `BlockBuilder` that has already been built.";
    std::unique_ptr<Operation> result =
        T::Create(block_.get(), std::forward<Args>(a)...);
    CHECK(result != nullptr)
        << "`T::Create` returned a nullptr when adding an operation.";
    CHECK(result->parent() == block_.get())
        << "`T::Create` did not set the correct parent block.";
    block_->operations_.push_back(std::move(result));
    return *block_->operations_.back();
  }

  // Provides the ability to make multiple changes to the block through a
  // lambda. Here is an example:
  //
  //   BlockBuilder()
  //     .AddImplementation([](BlockBuilder& builder, Block& block) {
  //        auto op = builder.AddOperation(...);
  //        builder.AddResult(Value(OperationResult(op, "x")));
  //     })
  //     .build();
  //
  BlockBuilder& AddImplementation(
      std::function<void(BlockBuilder&, Block&)> builder) {
    CHECK(!IsBuilt())
        << "Attempt to use a `BlockBuilder` that has already been built.";
    builder(*this, *block_);
    return *this;
  }

  std::unique_ptr<Block> build() {
    // After we call `build` on a `BlockBuilder`, the `block_` field is moved
    // from. This causes the pointer within the `block_` field to be stolen
    // by `std::unique_ptr`'s move constructor, leaving a `nullptr` in its
    // place. The following check makes sure that we don't attempt to call
    // `build` twice on the same `BlockBuilder` by checking that `block_` is
    // not `nullptr`.
    CHECK(block_) << "Attempt to build a `BlockBuilder` that has already been"
                     " built.";
    return std::move(block_);
  }

  // A way to get non-owning access to the block (for reference by operations)
  // while the block is still under construction.
  Block* GetBlockPtr() {
    // The following check makes sure that we don't attempt to call
    // `unsafe_get_block_ptr` on an empty `BlockBuilder` by checking that
    // `block_` is not `nullptr`.
    CHECK(block_) << "Attempt to get block pointer from a `BlockBuilder` that "
                     "has already been"
                     " built.";
    return block_.get();
  }

  bool IsBuilt() const { return block_.get() == nullptr; }

 private:
  std::unique_ptr<Block> block_;
};

}  // namespace raksha::ir

#endif  // SRC_IR_BLOCK_BUILDER_H_


text:
<?php

/**
 * Example backend class for a custom address book
 *
 * This one just holds a static list of address records
 *
 * @author Thomas Bruederli
 */
class example_addressbook_backend extends rcube_addressbook
{
  public $primary_key = 'ID';
  public $readonly = true;
  public $groups = true;

  private $filter;
  private $result;
  private $name;

  public function __construct($name)
  {
    $this->ready = true;
    $this->name = $name;
  }

  public function get_name()
  {
    return $this->name;
  }

  public function set_search_set($filter)
  {
    $this->filter = $filter;
  }

  public function get_search_set()
  {
    return $this->filter;
  }

  public function reset()
  {
    $this->result = null;
    $this->filter = null;
  }

  function list_groups($search = null, $mode = 0)
  {
    return array(
      array('ID' => 'testgroup1', 'name' => "Testgroup"),
      array('ID' => 'testgroup2', 'name' => "Sample Group"),
    );
  }

  public function list_records($cols=null, $subset=0)
  {
    $this->result = $this->count();
    $this->result->add(array('ID' => '111', 'name' => "Example Contact", 'firstname' => "Example", 'surname' => "Contact", 'email' => "example@roundcube.net"));

    return $this->result;
  }

  public function search($fields, $value, $strict=false, $select=true, $nocount=false, $required=array())
  {
    // no search implemented, just list all records
    return $this->list_records();
  }

  public function count()
  {
    return new rcube_result_set(1, ($this->list_page-1) * $this->page_size);
  }

  public function get_result()
  {
    return $this->result;
  }

  public function get_record($id, $assoc=false)
  {
    $this->list_records();
    $first = $this->result->first();
    $sql_arr = $first['ID'] == $id ? $first : null;

    return $assoc && $sql_arr ? $sql_arr : $this->result;
  }

  function create_group($name)
  {
    $result = false;

    return $result;
  }

  function delete_group($gid)
  {
    return false;
  }

  function rename_group($gid, $newname, &$newid)
  {
    return $newname;
  }

  function add_to_group($group_id, $ids)
  {
    return false;
  }

  function remove_from_group($group_id, $ids)
  {
     return false;
  }

}


text:
require_relative 'test_helper'

class TestBotrusDocker < Minitest::Test
  def setup
    @botrus = Botrus::Docker.new(containers: 3)

    @botrus.setup
  end

  def teardown
    @botrus.teardown
  end

  def test_can_create_instances
    assert_equal(3, @botrus.list.length)
  end

  def test_can_run_script_from_file
    containers = @botrus.list

    containers.each do |container|
      output = container.run('test/hello_world.sh')
      assert_match(/Hello world!/, output)
    end
  end

  def test_can_run_command
    containers = @botrus.list

    containers.each do |container|
      output = container.run('echo Hello world!')
      assert_match(/Hello world!/, output)
    end
  end
end


text:
#ifndef NETDEV_H
#define NETDEV_H 1

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "openvswitch/types.h"
#include "packets.h"

#ifdef  __cplusplus
extern "C" {
#endif

/* Generic interface to network devices ("netdev"s).
 *
 * Every port on a switch must have a corresponding netdev that must minimally
 * support a few operations, such as the ability to read the netdev's MTU.
 * The PORTING file at the top of the source tree has more information in the
 * "Writing a netdev Provider" section.
 *
 * Thread-safety
 * =============
 *
 * Most of the netdev functions are fully thread-safe: they may be called from
 * any number of threads on the same or different netdev objects.  The
 * exceptions are:
 *
 *    netdev_rxq_recv()
 *    netdev_rxq_wait()
 *    netdev_rxq_drain()
 *
 *      These functions are conditionally thread-safe: they may be called from
 *      different threads only on different netdev_rxq objects.  (The client may
 *      create multiple netdev_rxq objects for a single netdev and access each
 *      of those from a different thread.)
 *
 *    NETDEV_FOR_EACH_QUEUE
 *    netdev_queue_dump_next()
 *    netdev_queue_dump_done()
 *
 *      These functions are conditionally thread-safe: they may be called from
 *      different threads only on different netdev_queue_dump objects.  (The
 *      client may create multiple netdev_queue_dump objects for a single
 *      netdev and access each of those from a different thread.)
 */

struct dpif_packet;
struct netdev;
struct netdev_class;
struct netdev_rxq;
struct netdev_saved_flags;
struct ofpbuf;
struct in_addr;
struct in6_addr;
struct smap;
struct sset;
struct ovs_action_push_tnl;

/* Network device statistics.
 *
 * Values of unsupported statistics are set to all-1-bits (UINT64_MAX). */
struct netdev_stats {
    uint64_t rx_packets;        /* Total packets received. */
    uint64_t tx_packets;        /* Total packets transmitted. */
    uint64_t rx_bytes;          /* Total bytes received. */
    uint64_t tx_bytes;          /* Total bytes transmitted. */
    uint64_t rx_errors;         /* Bad packets received. */
    uint64_t tx_errors;         /* Packet transmit problems. */
    uint64_t rx_dropped;        /* No buffer space. */
    uint64_t tx_dropped;        /* No buffer space. */
    uint64_t multicast;         /* Multicast packets received. */
    uint64_t collisions;

    /* Detailed receive errors. */
    uint64_t rx_length_errors;
    uint64_t rx_over_errors;    /* Receiver ring buff overflow. */
    uint64_t rx_crc_errors;     /* Recved pkt with crc error. */
    uint64_t rx_frame_errors;   /* Recv'd frame alignment error. */
    uint64_t rx_fifo_errors;    /* Recv'r fifo overrun . */
    uint64_t rx_missed_errors;  /* Receiver missed packet. */

    /* Detailed transmit errors. */
    uint64_t tx_aborted_errors;
    uint64_t tx_carrier_errors;
    uint64_t tx_fifo_errors;
    uint64_t tx_heartbeat_errors;
    uint64_t tx_window_errors;
};

/* Configuration specific to tunnels. */
struct netdev_tunnel_config {
    bool in_key_present;
    bool in_key_flow;
    ovs_be64 in_key;

    bool out_key_present;
    bool out_key_flow;
    ovs_be64 out_key;

    ovs_be16 dst_port;

    bool ip_src_flow;
    bool ip_dst_flow;
    ovs_be32 ip_src;
    ovs_be32 ip_dst;

    uint8_t ttl;
    bool ttl_inherit;

    uint8_t tos;
    bool tos_inherit;

    bool csum;
    bool ipsec;
    bool dont_fragment;
};

void netdev_run(void);
void netdev_wait(void);

void netdev_enumerate_types(struct sset *types);
bool netdev_is_reserved_name(const char *name);

int netdev_n_txq(const struct netdev *netdev);
int netdev_n_rxq(const struct netdev *netdev);
bool netdev_is_pmd(const struct netdev *netdev);

/* Open and close. */
int netdev_open(const char *name, const char *type, struct netdev **netdevp);

struct netdev *netdev_ref(const struct netdev *);
void netdev_remove(struct netdev *);
void netdev_close(struct netdev *);

void netdev_parse_name(const char *netdev_name, char **name, char **type);

/* Options. */
int netdev_set_config(struct netdev *, const struct smap *args, char **errp);
int netdev_get_config(const struct netdev *, struct smap *);
const struct netdev_tunnel_config *
    netdev_get_tunnel_config(const struct netdev *);
int netdev_get_numa_id(const struct netdev *);

/* Basic properties. */
const char *netdev_get_name(const struct netdev *);
const char *netdev_get_type(const struct netdev *);
const char *netdev_get_type_from_name(const char *);
int netdev_get_mtu(const struct netdev *, int *mtup);
int netdev_set_mtu(const struct netdev *, int mtu);
int netdev_get_ifindex(const struct netdev *);
int netdev_set_multiq(struct netdev *, unsigned int n_txq, unsigned int n_rxq);

/* Packet reception. */
int netdev_rxq_open(struct netdev *, struct netdev_rxq **, int id);
void netdev_rxq_close(struct netdev_rxq *);

const char *netdev_rxq_get_name(const struct netdev_rxq *);

int netdev_rxq_recv(struct netdev_rxq *rx, struct dpif_packet **buffers,
                    int *cnt);
void netdev_rxq_wait(struct netdev_rxq *);
int netdev_rxq_drain(struct netdev_rxq *);

/* Packet transmission. */
int netdev_send(struct netdev *, int qid, struct dpif_packet **, int cnt,
                bool may_steal);
void netdev_send_wait(struct netdev *, int qid);

int netdev_build_header(const struct netdev *, struct ovs_action_push_tnl *data);
int netdev_push_header(const struct netdev *netdev,
                       struct dpif_packet **buffers, int cnt,
                       const struct ovs_action_push_tnl *data);
int netdev_pop_header(struct netdev *netdev, struct dpif_packet **buffers,
                      int cnt);

/* Hardware address. */
int netdev_set_etheraddr(struct netdev *, const uint8_t mac[ETH_ADDR_LEN]);
int netdev_get_etheraddr(const struct netdev *, uint8_t mac[ETH_ADDR_LEN]);

/* PHY interface. */
bool netdev_get_carrier(const struct netdev *);
long long int netdev_get_carrier_resets(const struct netdev *);
int netdev_set_miimon_interval(struct netdev *, long long int interval);

/* Features. */
enum netdev_features {
    NETDEV_F_10MB_HD =    1 << 0,  /* 10 Mb half-duplex rate support. */
    NETDEV_F_10MB_FD =    1 << 1,  /* 10 Mb full-duplex rate support. */
    NETDEV_F_100MB_HD =   1 << 2,  /* 100 Mb half-duplex rate support. */
    NETDEV_F_100MB_FD =   1 << 3,  /* 100 Mb full-duplex rate support. */
    NETDEV_F_1GB_HD =     1 << 4,  /* 1 Gb half-duplex rate support. */
    NETDEV_F_1GB_FD =     1 << 5,  /* 1 Gb full-duplex rate support. */
    NETDEV_F_10GB_FD =    1 << 6,  /* 10 Gb full-duplex rate support. */
    NETDEV_F_40GB_FD =    1 << 7,  /* 40 Gb full-duplex rate support. */
    NETDEV_F_100GB_FD =   1 << 8,  /* 100 Gb full-duplex rate support. */
    NETDEV_F_1TB_FD =     1 << 9,  /* 1 Tb full-duplex rate support. */
    NETDEV_F_OTHER =      1 << 10, /* Other rate, not in the list. */
    NETDEV_F_COPPER =     1 << 11, /* Copper medium. */
    NETDEV_F_FIBER =      1 << 12, /* Fiber medium. */
    NETDEV_F_AUTONEG =    1 << 13, /* Auto-negotiation. */
    NETDEV_F_PAUSE =      1 << 14, /* Pause. */
    NETDEV_F_PAUSE_ASYM = 1 << 15, /* Asymmetric pause. */
};

int netdev_get_features(const struct netdev *,
                        enum netdev_features *current,
                        enum netdev_features *advertised,
                        enum netdev_features *supported,
                        enum netdev_features *peer);
uint64_t netdev_features_to_bps(enum netdev_features features,
                                uint64_t default_bps);
bool netdev_features_is_full_duplex(enum netdev_features features);
int netdev_set_advertisements(struct netdev *, enum netdev_features advertise);

/* Flags. */
enum netdev_flags {
    NETDEV_UP = 0x0001,         /* Device enabled? */
    NETDEV_PROMISC = 0x0002,    /* Promiscuous mode? */
    NETDEV_LOOPBACK = 0x0004    /* This is a loopback device. */
};

int netdev_get_flags(const struct netdev *, enum netdev_flags *);
int netdev_set_flags(struct netdev *, enum netdev_flags,
                     struct netdev_saved_flags **);
int netdev_turn_flags_on(struct netdev *, enum netdev_flags,
                         struct netdev_saved_flags **);
int netdev_turn_flags_off(struct netdev *, enum netdev_flags,
                          struct netdev_saved_flags **);

void netdev_restore_flags(struct netdev_saved_flags *);

/* TCP/IP stack interface. */
int netdev_get_in4(const struct netdev *, struct in_addr *address,
                   struct in_addr *netmask);
int netdev_set_in4(struct netdev *, struct in_addr addr, struct in_addr mask);
int netdev_get_in4_by_name(const char *device_name, struct in_addr *in4);
int netdev_get_in6(const struct netdev *, struct in6_addr *);
int netdev_add_router(struct netdev *, struct in_addr router);
int netdev_get_next_hop(const struct netdev *, const struct in_addr *host,
                        struct in_addr *next_hop, char **);
int netdev_get_status(const struct netdev *, struct smap *);
int netdev_arp_lookup(const struct netdev *, ovs_be32 ip,
                      uint8_t mac[ETH_ADDR_LEN]);

struct netdev *netdev_find_dev_by_in4(const struct in_addr *);

/* Statistics. */
int netdev_get_stats(const struct netdev *, struct netdev_stats *);

/* Quality of service. */
struct netdev_qos_capabilities {
    unsigned int n_queues;
};

struct netdev_queue_stats {
    /* Values of unsupported statistics are set to all-1-bits (UINT64_MAX). */
    uint64_t tx_bytes;
    uint64_t tx_packets;
    uint64_t tx_errors;

    /* Time at which the queue was created, in msecs, LLONG_MIN if unknown. */
    long long int created;
};

int netdev_set_policing(struct netdev *, uint32_t kbits_rate,
                        uint32_t kbits_burst);

int netdev_get_qos_types(const struct netdev *, struct sset *types);
int netdev_get_qos_capabilities(const struct netdev *,
                                const char *type,
                                struct netdev_qos_capabilities *);
int netdev_get_n_queues(const struct netdev *,
                        const char *type, unsigned int *n_queuesp);

int netdev_get_qos(const struct netdev *,
                   const char **typep, struct smap *details);
int netdev_set_qos(struct netdev *,
                   const char *type, const struct smap *details);

int netdev_get_queue(const struct netdev *,
                     unsigned int queue_id, struct smap *details);
int netdev_set_queue(struct netdev *,
                     unsigned int queue_id, const struct smap *details);
int netdev_delete_queue(struct netdev *, unsigned int queue_id);
int netdev_get_queue_stats(const struct netdev *, unsigned int queue_id,
                           struct netdev_queue_stats *);
uint64_t netdev_get_change_seq(const struct netdev *);

struct netdev_queue_dump {
    struct netdev *netdev;
    int error;
    void *state;
};
void netdev_queue_dump_start(struct netdev_queue_dump *,
                             const struct netdev *);
bool netdev_queue_dump_next(struct netdev_queue_dump *,
                            unsigned int *queue_id, struct smap *details);
int netdev_queue_dump_done(struct netdev_queue_dump *);

/* Iterates through each queue in NETDEV, using DUMP as state.  Fills QUEUE_ID
 * and DETAILS with information about queues.  The client must initialize and
 * destroy DETAILS.
 *
 * Arguments all have pointer type.
 *
 * If you break out of the loop, then you need to free the dump structure by
 * hand using netdev_queue_dump_done(). */
#define NETDEV_QUEUE_FOR_EACH(QUEUE_ID, DETAILS, DUMP, NETDEV)  \
    for (netdev_queue_dump_start(DUMP, NETDEV);                 \
         (netdev_queue_dump_next(DUMP, QUEUE_ID, DETAILS)       \
          ? true                                                \
          : (netdev_queue_dump_done(DUMP), false));             \
        )

typedef void netdev_dump_queue_stats_cb(unsigned int queue_id,
                                        struct netdev_queue_stats *,
                                        void *aux);
int netdev_dump_queue_stats(const struct netdev *,
                            netdev_dump_queue_stats_cb *, void *aux);

enum { NETDEV_MAX_RX_BATCH = 256 };     /* Maximum number packets in rx_recv() batch. */
extern struct seq *tnl_conf_seq;

#ifdef  __cplusplus
}
#endif

#endif /* netdev.h */


text:
package c06interview

type Employee struct {
	Position string
	Person
}

func (e Employee) BeInterviewed() string {
	return "Hello, my name is " + e.name + " and I'm a " + e.Position
}


text:
extern zend_class_entry *zendframework_authentication_exception_runtimeexception_ce;

ZEPHIR_INIT_CLASS(ZendFramework_Authentication_Exception_RuntimeException);


text:
import logging

from django import template
from django.utils.translation import ugettext_lazy as _

from horizon import tables

from openstack_dashboard.api import sahara as saharaclient

LOG = logging.getLogger(__name__)

class EditTagsAction(tables.LinkAction):
    name = "edit_tags"
    verbose_name = _("Edit Tags")
    url = "horizon:project:data_processing.data_image_registry:edit_tags"
    classes = ("ajax-modal",)

def tags_to_string(image):
    template_name = (
        'project/data_processing.data_image_registry/_list_tags.html')
    context = {"image": image}
    return template.loader.render_to_string(template_name, context)

class RegisterImage(tables.LinkAction):
    name = "register"
    verbose_name = _("Register Image")
    url = "horizon:project:data_processing.data_image_registry:register"
    classes = ("ajax-modal",)
    icon = "plus"

class UnregisterImages(tables.BatchAction):
    name = "Unregister"
    action_present = _("Unregister")
    action_past = _("Unregistered")
    data_type_singular = _("Image")
    data_type_plural = _("Images")
    classes = ('btn-danger', 'btn-terminate')

    def action(self, request, obj_id):
        saharaclient.image_unregister(request, obj_id)

class ImageRegistryTable(tables.DataTable):
    name = tables.Column("name",
                         verbose_name=_("Image"),
                         link=("horizon:project:"
                               "images:images:detail"))
    tags = tables.Column(tags_to_string,
                         verbose_name=_("Tags"))

    class Meta:
        name = "image_registry"
        verbose_name = _("Image Registry")
        table_actions = (RegisterImage, UnregisterImages,)
        row_actions = (EditTagsAction, UnregisterImages,)


text:
layout:     post
title:      Tweets
date:       2018-04-28
summary:    These are the tweets for April 28, 2018.
categories:
---


text:
import React from 'react'
import {useDispatch} from 'react-redux'
import {STATUSES, POSITIONS, notify, dismissNotifications} from 'src'
import {Position, Status} from 'src'

const getRandomBoolean = () => Math.random() >= 0.5
const getRandomElem = (items: any[]) => items[Math.floor(Math.random() * items.length)]
const getRandomWord = () => getRandomElem(['Tempor', 'Orci', 'Neque', 'Enim', 'Quis', 'Arcu'])

const NotificationButtons = () => {
    const dispatch = useDispatch()
    const updatedNotification = () => {
        const notif = dispatch(
            notify({
                id: 'updated-notification',
                title: 'Repository transfer',
                message: 'Your repository is being transfered...',
                position: POSITIONS.topRight,
                status: STATUSES.loading,
                dismissible: false,
                dismissAfter: 0,
            })
        ).payload

        setTimeout(() => {
            notif.status = STATUSES.success
            notif.message = 'Your repository have been transfered.'
            notif.buttons = [{name: 'OK', primary: true}, {name: 'Details'}]
            dispatch(notify(notif))
        }, 3000)
    }

    const randomNotification = () => {
        const buttons = []
        const showDismissButton = getRandomBoolean()
        if (!showDismissButton && getRandomBoolean()) {
            for (let i = 0; i < getRandomElem([1, 2]); i++) {
                buttons.push({
                    name: getRandomWord(),
                    primary: getRandomBoolean(),
                })
            }
        }
        dispatch(
            notify({
                title: getRandomBoolean() ? `Lorem ipsum dolor sit amet` : '',
                message: 'Laboris nisi ut aliquip ex ea commodo consequat. ',
                position: getRandomElem(Object.values(POSITIONS)) as Position,
                status: getRandomElem(Object.values(STATUSES)) as Status,
                dismissible: getRandomBoolean(),
                dismissAfter: 5000,
                showDismissButton,
                allowHTML: getRandomBoolean(),
                buttons: buttons,
            })
        )
    }

    return (
        <div className="mt-4">
            <button className="btn btn-primary fw-bold m-1" onClick={randomNotification}>
                Random notification
            </button>
            <button className="btn btn-primary fw-bold m-1" onClick={updatedNotification}>
                Updated notification
            </button>
            <button className="btn btn-primary fw-bold m-1" onClick={() => dispatch(dismissNotifications())}>
                Clear notifications
            </button>
        </div>
    )
}
export default NotificationButtons


text:
const ENV = process.env.ENV || 'local';

const path = require('path');
const gulp = require('gulp');
const sync = require('gulp-sync')(gulp).sync;
const ga = require('./utils/ga');
const Config = require('./config')(ENV);
let recipe = (name, config) => require('./recipes/' + name)(config);

console.log('Building with config: ', Config);

gulp.task('env', recipe('env', {
  NODE_PATH: 'source/js:node_modules'
}));

gulp.task('clean', recipe('clean', {
  input: './dist'
}));

gulp.task('css', Config.CSS_BUNDLES.map(title => {
  gulp.task(`css:${title}`, recipe('stylus', {
    input: `./source/css/${title}.bundle.${Config.EXT.CSS}`,
    output: './dist/css',
    name: `${title}.css`
  }));

  return `css:${title}`;
}));

gulp.task('js:node_modules', recipe('browserify', {
  input: '',
  require: Config.NODE_MODULES,
  output: './dist/vendor',
  name: 'node_modules.js'
}));

gulp.task('static', recipe('copy', {
  input: './source/static/**/*',
  output: './dist'
}));

gulp.task('static:node_modules', recipe('copy', {
  input: [
    './node_modules/react/umd/react.development.js',
    './node_modules/react-dom/umd/react-dom.development.js',
  ],
  output: './dist/vendor'
}));

gulp.task('inject', recipe('html', {
  cwd: path.resolve(process.cwd(), 'dist'),
  input: './source/html/**/*.html',
  sources: [[
    '!vendor/node_modules.js',
    '!vendor/react.development.js',
    '!vendor/react-dom.development.js',
    'vendor/**/*'
  ], [
    '!js/bundle.js',
    'css/**/*',
    'js/**/*',
  ]],
  output: './dist',
  replacements: [
    ['@{SENTRY}', Config.SENTRY],
    ['@{GA}', ga(Config.GA)],
    ['@{VERSION}', Config.VERSION],
    ['@{ENV}', Config.ENV],
  ],
}));

gulp.task('server', recipe('server', {
  input: './dist',
  port: 3000,
}));

gulp.task('watch', () => {
  gulp.watch([
    './source/html/**/*.html',
    './dist/**/*.js',
    './dist/**/*.css',
    './dist/vendor/**/*',
  ], ['inject']);
  gulp.watch('./source/css/**/*.styl', ['css']);
  gulp.watch('./source/static/**/*', ['static']);
});

var compileAsync = ['js:node_modules', 'static:node_modules', 'static', 'css'];
gulp.task('compile', sync(['env', 'clean', compileAsync, 'inject']));
gulp.task('default', ['compile', 'watch', ENV === 'local' ? 'server' : '']);


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">

    <display-name>AppFuse Light</display-name>

    <!-- [INSERT FRAGMENT HERE] -->
    <!-- Define the basename for a resource bundle for I18N -->
    <context-param>
        <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
        <param-value>messages</param-value>
    </context-param>

    <filter>
        <filter-name>exportFilter</filter-name>
        <filter-class>org.displaytag.filter.ResponseOverrideFilter</filter-class>
    </filter>

    <filter>
        <filter-name>encodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
        <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>

    <filter>
        <filter-name>messageFilter</filter-name>
        <filter-class>org.appfuse.web.MessageFilter</filter-class>
    </filter>

    <filter>
        <filter-name>lazyLoadingFilter</filter-name>
        <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
    </filter>

    <filter>
        <filter-name>sitemesh</filter-name>
        <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
    </filter>

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext*.xml</param-value>
    </context-param>

    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter-mapping>
        <filter-name>messageFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>

    <filter-mapping>
        <filter-name>lazyLoadingFilter</filter-name>
        <url-pattern>*.html</url-pattern>
    </filter-mapping>

    <filter-mapping>
        <filter-name>sitemesh</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>

    <filter-mapping>
        <filter-name>exportFilter</filter-name>
        <url-pattern>*.html</url-pattern>
    </filter-mapping>

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet>
        <servlet-name>dwr-invoker</servlet-name>
        <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
        <init-param>
            <param-name>debug</param-name>
            <param-value>true</param-value>
        </init-param>
    </servlet>

    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>*.html</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>dwr-invoker</servlet-name>
        <url-pattern>/dwr/*</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

    <error-page>
        <error-code>404</error-code>
        <location>/404.jsp</location>
    </error-page>

    <error-page>
        <error-code>500</error-code>
        <location>/error.jsp</location>
    </error-page>

</web-app>


text:
package ru.skycelot.metamodel.persistence;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 *
 */
@Entity
@Table(name = "principal")
public class User {

    @Id
    @Column(name = "id")
    private Long id;
    @Column(name = "login")
    private String login;
    @Column(name = "full_name")
    private String fullName;
    @Column(name = "password")
    private String password;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}