text:
namespace xwalk {

class TizenPlatformSensor : public SensorProvider {
 public:
  TizenPlatformSensor();
  virtual ~TizenPlatformSensor();

  virtual bool Initialize() OVERRIDE;
  virtual void Finish() OVERRIDE;

 private:
  bool auto_rotation_enabled_;
  int accel_handle_;
  int gyro_handle_;

  static void OnEventReceived(unsigned int event_type,
      sensor_event_data_t* event_data, void* udata);
  static void OnAutoRotationEnabledChanged(keynode_t* node, void* udata);

  void ConnectSensor();

  scoped_ptr<base::Thread> sensor_thread_;

  DISALLOW_COPY_AND_ASSIGN(TizenPlatformSensor);
};

}  // namespace xwalk

#endif  // XWALK_TIZEN_MOBILE_SENSOR_TIZEN_PLATFORM_SENSOR_H_


text:
package com.podio.app;

import java.util.Arrays;
import java.util.List;

import org.codehaus.jettison.json.JSONException;
import org.junit.Assert;
import org.junit.Test;

import com.podio.APIApplicationException;
import com.podio.APIFactoryProvider;
import com.sun.jersey.api.client.ClientResponse.Status;

public class AppAPITest {

	private AppAPI getAPI() {
		return APIFactoryProvider.getDefault().getAPI(AppAPI.class);
	}

	@Test
	public void getNonExistingApp() {
		try {
			getAPI().getApp(222);
			Assert.fail();
		} catch (APIApplicationException e) {
			Assert.assertEquals(e.getStatus(), Status.NOT_FOUND);
			Assert.assertEquals(e.getError(), "not_found");
			Assert.assertEquals(e.getDescription(), "Object not found");
			Assert.assertEquals(e.getParameters(), null);
		}
	}

	@Test
	public void getAppFull() throws JSONException {
		Application app = getAPI().getApp(1);

		Assert.assertEquals(app.getId(), 1);
		Assert.assertNotNull(app.getConfiguration());
		Assert.assertEquals(app.getConfiguration().getDefaultView(),
				ApplicationViewType.BADGE);

		Assert.assertTrue(app.getFields().size() >= 21);

		ApplicationField stateField = app.getFields().get(0);
		Assert.assertEquals(stateField.getStatus(), ApplicationFieldStatus.ACTIVE);
		Assert.assertEquals(stateField.getType(), ApplicationFieldType.CATEGORY);
		Assert.assertEquals(stateField.getConfiguration().getLabel(),
				"Is hired?");
		Assert.assertEquals(stateField.getConfiguration().getSettings().getOptions().get(0).getText(), "yes");

		ApplicationField categoryField = app.getFields().get(15);
		Assert.assertEquals(categoryField.getType(), ApplicationFieldType.CATEGORY);
		Assert.assertEquals(categoryField.getConfiguration().getSettings().getMultiple(), true);
		Assert.assertEquals(categoryField.getConfiguration().getSettings().getOptions().get(0).getId(), 1);
		Assert.assertEquals(categoryField.getConfiguration().getSettings().getOptions().get(0).getStatus(), CategoryOptionStatus.ACTIVE);
		Assert.assertEquals(categoryField.getConfiguration().getSettings().getOptions().get(0).getText(), "Indie");
		Assert.assertEquals(categoryField.getConfiguration().getSettings().getOptions().get(0).getColor(), "DCEBD8");
	}

	@Test
	public void addApp() {
		int appId = getAPI().addApp(
				new ApplicationCreate(1, new ApplicationConfigurationCreate(
						"Tests", "Test", "Description", "Usage", "ExternalId",
						"23.png", true, ApplicationViewType.BADGE, true, true,
						false, null, false, false, null, false, null, false,
						null, Arrays.asList(new ApplicationTaskCreate("Task 1",
								1), new ApplicationTaskCreate("Task 2"))),
						Arrays.asList(new ApplicationFieldCreate(
								ApplicationFieldType.TEXT,
								new ApplicationFieldConfiguration("Title",
										"Description", 0, null, true)))));
		Assert.assertTrue(appId > 0);
	}

	@Test
	public void updateApp() {
		getAPI().updateApp(
				1,
				new ApplicationUpdate(
						new ApplicationConfigurationCreate("Tests", "Test",
								"Description", "Usage", "ExternalId", "23.png",
								true, ApplicationViewType.BADGE, true, true,
								false, null, false, false, null, false, null,
								false, null, Arrays.asList(
										new ApplicationTaskCreate("Task 1", 1),
										new ApplicationTaskCreate("Task 2"))),
						Arrays.asList(new ApplicationFieldUpdate(1,
								new ApplicationFieldConfiguration("Is hired?",
										"Description", 10,
										ApplicationFieldSettings
												.getState(Arrays.asList("yes",
														"no", "maybe")), true)))));
	}

	@Test
	public void getField() {
		ApplicationField field = getAPI().getField(1, 1);

		Assert.assertEquals(field.getId(), 1);
		Assert.assertEquals(field.getType(), ApplicationFieldType.CATEGORY);
		Assert.assertEquals(field.getExternalId(), "is-hired");
		Assert.assertEquals(field.getConfiguration().getLabel(), "Is hired?");
		Assert.assertEquals(field.getConfiguration().getDelta(), 0);
		Assert.assertEquals(field.getConfiguration().getSettings().getOptions().get(0).getId(), 1);
		Assert.assertEquals(field.getConfiguration().getSettings().getOptions().get(0).getStatus(), CategoryOptionStatus.ACTIVE);
		Assert.assertEquals(field.getConfiguration().getSettings().getOptions().get(0).getText(), "yes");
		Assert.assertEquals(field.getConfiguration().getSettings().getOptions().get(0).getColor(), "D2E4EB");
	}

	@Test
	public void addField() {
		int fieldId = getAPI().addField(
				1,
				new ApplicationFieldCreate(ApplicationFieldType.TEXT,
						new ApplicationFieldConfiguration("Description",
								"Field description", 0,
								ApplicationFieldSettings
										.getText(TextFieldSize.LARGE), true)));
		Assert.assertTrue(fieldId > 10);
	}

	@Test
	public void updateField() {
		getAPI().updateField(
				1,
				1,
				new ApplicationFieldConfiguration("Is hired?", "Description",
						10, ApplicationFieldSettings.getState(Arrays.asList(
								"yes", "no", "maybe")), true));
	}

	@Test
	public void deleteField() {
		getAPI().deleteField(1, 1);
	}

	@Test
	public void installApp() {
		int appId = getAPI().install(1, 1);
		Assert.assertTrue(appId > 1);

	}

	@Test
	public void updateOrder() {
		getAPI().updateOrder(1, Arrays.asList(1, 2));
	}

	@Test
	public void getAppsInSpace() {
		List<Application> apps = getAPI().getAppsOnSpace(1);

		Assert.assertEquals(apps.size(), 2);
		Assert.assertEquals(apps.get(0).getId(), 20);
		Assert.assertEquals(apps.get(1).getId(), 1);
	}

	@Test
	public void getTopApps() {
		List<Application> apps = getAPI().getTopApps(null);

		Assert.assertEquals(apps.size(), 1);
		Assert.assertEquals(apps.get(0).getId(), 1);
	}

	@Test
	public void getApps() {
		List<Application> apps = getAPI().getApps();
		Assert.assertEquals(apps.size(), 3);

		Assert.assertEquals(apps.get(0).getId(), 1);
	}

	@Test
	public void getAppDependencies() {
		Dependencies dependencies = getAPI().getDependencies(2);

		Assert.assertEquals(dependencies.getApps().size(), 2);
		Assert.assertEquals(dependencies.getDependencies().size(), 2);
		Assert.assertEquals(dependencies.getDependencies().get(1).get(0)
				.intValue(), 3);
	}

	@Test
	public void deactivateApp() {
		getAPI().deactivateApp(1);
	}

	@Test
	public void activateApp() {
		getAPI().activateApp(2);
	}
}

redpajama_set_name: RedPajamaGithub


text:
using __gnu_test::forward_iterator_wrapper;

struct S { };

bool
operator<(const S&, const S&) {return true;}

struct X { };

bool
predicate(const X&, const X&) {return true;}

forward_iterator_wrapper<S>
test1(forward_iterator_wrapper<S>& s)
{ return std::upper_bound(s, s, *s); }

forward_iterator_wrapper<X>
test2(forward_iterator_wrapper<X>& x)
{ return std::upper_bound(x, x, *x, predicate); }


text:
@implementation SkillListModel

@end


text:
{MESSAGES}

<form method="post" action="{URI|htmlspecialchars}" id="taxonomy-edit-{GET.id}">

{ONXSHOP_REQUEST_taxonomy #component/breadcrumb_taxonomy~id=GET.id~}

Add taxonomy category here ...

Basic

Minor Tweaks

		<button class="save" type="submit" name="save" value="save">Save</button>

			<fieldset>
				<legend>Taxonomy item</legend>

					Name
					<input type="text" title="The category title" class="text title" id="taxonomy-label-title" name="taxonomy[label][title]" value="{TAXONOMY.label.title|htmlspecialchars}"/>

					Publish (Visibility in context of Taxonomy)
					<input type="checkbox" id="taxonomy-label-publish" name="taxonomy[label][publish]" {TAXONOMY.label.publish_check} />

			</fieldset>
			<fieldset>
				<legend>Images</legend>

					{ONXSHOP_REQUEST_imagelist #bo/component/file_list~type=add_to_taxonomy:relation=taxonomy:node_id=GET.id~}

			</fieldset>

					Description
					<textarea style="height: 50px" name="taxonomy[label][description]" id="taxonomy-label-description">{TAXONOMY.label.description|htmlspecialchars}</textarea>

		<input type="hidden" name="taxonomy[label][id]" value="{TAXONOMY.label.id}" />

</form>


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "http://google-web-toolkit.googlecode.com/svn/trunk/distro-source/core/src/gwt-module.dtd">
<module>
	<inherits name='com.badlogic.gdx.backends.gdx_backends_gwt' />
	<inherits name='TicTacToeGame' />
	<entry-point class='com.niltonvasques.tictactoe.client.GwtLauncher' />
	<set-configuration-property name="gdx.assetpath" value="../TicTacToe-android/assets" />
</module>


text: Posts: <?php echo $_POST['post-text']; ?>.


text:
function AdvancedFormController($scope) {
    var master = {
        name: 'John Smith',
        address:{
            line1: '123 Main St.',
            city:'Anytown',
            state:'AA',
            zip:'12345'
        },
        contacts:[
            {type:'phone', value:'1(234) 555-1212'}
        ]
    };

    $scope.state = /^\w\w$/;
    $scope.zip = /^\d\d\d\d\d$/;

    $scope.cancel = function() {
        $scope.form = angular.copy(master);
    };

    $scope.save = function() {
        master = $scope.form;
        $scope.cancel();
    };

    $scope.addContact = function() {
        $scope.form.contacts.push({type:'', value:''});
    };

    $scope.removeContact = function(index) {
        $scope.form.contacts.splice(index, 1);
    };

    $scope.isCancelDisabled = function() {
        return angular.equals(master, $scope.form);
    };

    $scope.isSaveDisabled = function() {
        return $scope.myForm.$invalid || angular.equals(master, $scope.form);
    };

    $scope.cancel();
}


text:
import sys
import os
import re

from Tkinter import *
import tkFileDialog
import tkMessageBox
import traceback

import quiz_spec_gui_model

model = quiz_spec_gui_model.model()
question_library_path = ''

def add_scrolling_canvas(window,orientations):
	canvas = Canvas(window)
	if orientations.find("h") != -1:
		xscrollbar = Scrollbar(window,orient="h",command=canvas.xview)
		canvas.configure(xscrollcommand=xscrollbar.set)
		xscrollbar.grid(row=1,column=0,sticky="ew")
	if orientations.find("v") != -1:
		yscrollbar = Scrollbar(window,orient="v",command=canvas.yview)
		canvas.configure(yscrollcommand=yscrollbar.set)
		yscrollbar.grid(row=0,column=1,sticky="ns")
	canvas.grid(row=0,column=0,sticky="nsew")
	window.grid_rowconfigure(0,weight=1)
	window.grid_columnconfigure(0,weight=1)
	canvas.configure(scrollregion=canvas.bbox("all"))
	window.canvas = canvas

#### main window event handling ################################################
def get_focus():
	try:
		widget = main.focus_get()
		return widget.position
	except:
		return None

def update_mark(event):
	entry = event.widget
	model.update_group(entry.position, 0, entry.get())

def update_count(event):
	entry = event.widget
	model.update_group(entry.position, 1, entry.get())

def update_ui_hints(event):
	# disable all context-sensitive commands, then selectively re-enable
	for i in range(4,6):
		groups.entryconfigure(i,state = DISABLED)
	focus = get_focus()
	if focus is None:
		return
	if group_buffer is not None:
		groups.entryconfigure(5, state = NORMAL) # clear group buffer
	groups.entryconfigure(4, state = NORMAL) # delete group
	groups.entryconfigure(6, state = NORMAL) # add directories
	groups.entryconfigure(7, state = NORMAL) # remove directories

def gen_add_callback(position):
	return lambda:add_dirs_dialogue(position,True,None)

def gen_remove_callback(position):
	return lambda:remove_dirs_dialogue(position)

def check_qre_callback(entry,position):
	return lambda:check_question_re(entry,position)

def check_question_re(entry,position):
	re_string = entry.get()
	try:
		re.compile(re_string)
		model.group_update_dir(position,re_string)
		tkMessageBox.showinfo("","Regular expression recorded")
	except:
		tkMessageBox.showerror(title='Illegal regular expression',
		 message=traceback.format_exc())

def view_question_callback(position):
	return lambda:view_questions(position)

def view_questions(i):
	s = ''
	L = model.get_question_list()
	if type(L[i][2]) == str:
		s = L[i][2]
	add_dirs_dialogue(i,False,s)

def refresh():
	main.canvas.delete(ALL)

	# headers
	mark_header = Label(main.canvas,text = 'Mark')
	main.canvas.create_window(0,0,window=mark_header,anchor=NW)
	count_header = Label(main.canvas,text = 'Count')
	main.canvas.create_window(50,0,window=count_header,anchor=NW)
	dirs_header = Label(main.canvas,text = 'Directories')
	main.canvas.create_window(100,0,window=dirs_header,anchor=NW)

	# widget group rows
	question_list = model.get_question_list()
	for i in range(len(question_list)):
		mark = Entry(main.canvas,width = 4)
		mark.position = i
		mark.insert(0,str(question_list[i][0]))
		mark.bind(sequence='<KeyRelease>',func=update_mark)
		count = Entry(main.canvas,width = 4)
		count.position = i
		count.insert(0,str(question_list[i][1]))
		count.bind(sequence='<KeyRelease>',func=update_count)
		#place widgets
		main.canvas.create_window(0,30*(i+1),window=mark,anchor=NW)
		main.canvas.create_window(50,30*(i+1),window=count,anchor=NW)
		if type(question_list[i][2]) == str: # a pattern group
			pattern = Entry(main.canvas,width = 24)
			pattern.position = i
			s = ''
			if type(question_list[i][2]) == str:
				s = question_list[i][2]
			pattern.insert(0,s)
			#pattern.bind(sequence='<KeyRelease>',func=update_count)
			main.canvas.create_window(100,30*(i+1),window=pattern,
			 anchor=NW)
			check_button = Button(main.canvas,text="Check",
			 command=check_qre_callback(pattern,i))
			view_button = Button(main.canvas,text="View",
			 command=view_question_callback(i))
			main.canvas.create_window(300,30*(i+1),
			 window=check_button,anchor=NW)
			main.canvas.create_window(370,30*(i+1),
			 window=view_button,anchor=NW)
		else:
			add_button = Button(main.canvas,text="Add",
			 command=gen_add_callback(i))
			main.canvas.create_window(370,30*(i+1),
			 window=add_button,anchor=NW)
		remove_button = Button(main.canvas,text="Remove",
			command=gen_remove_callback(i))
		main.canvas.create_window(430,30*(i+1),window=remove_button,
			anchor=NW)

	main.canvas.config(scrollregion=main.canvas.bbox(ALL))
	update_ui_hints(None)

#### File menu #################################################################
saved_filename = ''

def new():
	global model,saved_filename
	saved_filename = ''
	model = quiz_spec_gui_model.model()

	refresh()

def load():
	global saved_filename
	handle = tkFileDialog.askopenfilename()
	try:
		model.load(handle)
		saved_filename = handle
	except:
		saved_filename = ''

	refresh()

def save_as():
	global saved_filename
	handle = tkFileDialog.asksaveasfile(mode='w')
	if handle:
		saved_filename = handle.name
		model.save(saved_filename)
		update_ui_hints(None)

def save():
	global saved_filename
	if saved_filename == '':
		save_as()
	else:
		model.save(saved_filename)
		update_ui_hints(None)

#### Groups menu ###############################################################
group_buffer = None # holds most recently deleted group, a crude clipboard
dirs_popup = None

def add_group(after,is_list):
	position = get_focus()
	if position is None:
		position = 0
	elif after:
		position += 1
	model.insert_group(position,group_buffer,is_list)

	refresh()

def delete_group():
	global group_buffer
	position = get_focus()
	if position is not None:
		group_buffer = model.remove_group(position)

	refresh()

def clear_group_buffer():
	global group_buffer
	group_buffer = None

fvalue=''
def callback(entry,filter_popup):
	global fvalue
	tmp = entry.get()
	try:
		re.compile(tmp)
		fvalue = tmp
		filter_popup.destroy()
	except:
		tkMessageBox.showerror(title='Illegal regular expression',
		 message=traceback.format_exc())

def set_add_directory_filter():
	filter_popup = Toplevel()
	filter_popup.grab_set()
	filter_popup.title("Set add directory filter")

	global fvalue
	label = Label(filter_popup,text="Input your directory filter:")
	label.grid(row=0)
	entry = Entry(filter_popup)
	entry.grid(row = 1)
	entry.insert(0,fvalue)
	button = Button(filter_popup,text = 'OK',command=lambda:callback(entry,filter_popup))
	button.grid(row = 2)

def process_dir_list(position,action,dir_list,checkbox_values):
	for i in range(len(dir_list)):
		if checkbox_values[i].get():
			if action == 'add':
				model.group_add_dir(position,dir_list[i])
			else:
				model.group_remove_dir(position,dir_list[i])

	dirs_popup.destroy()
	refresh()

def preview_question(q):
	# import question class
	q = os.path.join(question_library_path,q)
	exec(open(os.path.join(q,'types.py'),'r').read())
	exec('import question.'+product_family)
	exec('question_obj = question.'+product_family+'.'+question_type+'(q)')

	# get question preview
	preview = question_obj.get_preview()

	# create a popup window to display question preview
	preview_popup = Toplevel()
	preview_popup.title = (q)
	add_scrolling_canvas(preview_popup,"vh")
	preview_popup.geometry("500x500")
	label = Label(preview_popup,text=preview)
	preview_popup.canvas.create_window(0,0,window=label,anchor=NW)

def gen_preview_callback(q):
	return lambda:preview_question(q)

def get_question_dirs(base_dir,question_library_path):
	all_questions = []
	L = os.listdir(os.path.join(question_library_path,base_dir))
	for d in L:
		p = os.path.join(base_dir,d)
		t = os.path.join(question_library_path,base_dir,d,'types.py')
		if os.path.isfile(t):
			all_questions.append(p)
		else:
			all_questions += get_question_dirs(p,
			 question_library_path)
	return all_questions

def add_dirs_dialogue(position,is_add,re_pattern):
	global dirs_popup
	dirs_popup = Toplevel()
	dirs_popup.grab_set()
	s = "Add directories"
	if not is_add:
		s = "View directories"
	dirs_popup.title(s)
	add_scrolling_canvas(dirs_popup,"v")
	dirs_popup.geometry("300x500")

	# casting to set type allows us to use set difference to filter out the
	# dirs that are already present:
	d_list = list(set(get_question_dirs(question_library_path,''))-
	 set(model.get_dir_list(position)))
	d_list.sort()
	dir_list = []
	if re_pattern == None:
		re_pattern = fvalue
	for i in range(len(d_list)):
		if re.search(re_pattern,d_list[i]):
			dir_list.append(d_list[i])

	checkbox_values = []
	last_row = 0 # need i defined even if there are no rows
	for i in range(len(dir_list)):
		question_dir = dir_list[i]
		if is_add:
			value = IntVar()
			checkbox_values.append(value)
			checkbox = Checkbutton(dirs_popup,variable=value)
			dirs_popup.canvas.create_window(0,30*last_row,
			 window=checkbox, anchor=NW)

		pre_button = Button(dirs_popup.canvas,text="Preview",
		 command=gen_preview_callback(dir_list[i]))
		dirs_popup.canvas.create_window(30,30*last_row,
		 window=pre_button,anchor=NW)

		question_label = Label(dirs_popup,text=question_dir)
		dirs_popup.canvas.create_window(120,30*last_row,
		 window=question_label,anchor=NW)
		last_row += 1
	if is_add:
		add_button = Button(dirs_popup.canvas,text="Add",
		 command=lambda:process_dir_list(position,'add',dir_list,
		 checkbox_values))
		dirs_popup.canvas.create_window(0,30*(last_row+2),
		 window=add_button,anchor=NW)

		cancel_button = Button(dirs_popup.canvas,text="Cancel",
		 command=dirs_popup.destroy)
		dirs_popup.canvas.create_window(100,30*(last_row+2),
		 window=cancel_button,anchor=NW)

		# tell the scroll bars the new size of the canvas:
	dirs_popup.canvas.config(scrollregion=dirs_popup.canvas.bbox(ALL))

def remove_dirs_dialogue(position):
	global dirs_popup
	dirs_popup = Toplevel()
	dirs_popup.grab_set()
	dirs_popup.title("Remove directories")
	add_scrolling_canvas(dirs_popup,"v")
	dirs_popup.geometry("300x500")

	dir_list = model.get_dir_list(position)

	checkbox_values = []
	i = 0 # need i defined even if there are no rows
	for i in range(len(dir_list)):
		question_dir = dir_list[i]
		value = IntVar()
		checkbox_values.append(value)

		checkbox = Checkbutton(dirs_popup,variable=value)
		dirs_popup.canvas.create_window(0,30*i,window=checkbox,
		 anchor=NW)

		question_label = Label(dirs_popup,text=question_dir)
		dirs_popup.canvas.create_window(30,30*i,window=question_label,
		 anchor=NW)

	last_row = i
	remove = Button(dirs_popup.canvas,text="Remove",
	 command=lambda: process_dir_list(position,'remove',dir_list,
	 checkbox_values))
	dirs_popup.canvas.create_window(0,30*(last_row+1),window=remove,
	 anchor=NW)

	cancel = Button(dirs_popup.canvas,text="Cancel",
	 command=dirs_popup.destroy)
	dirs_popup.canvas.create_window(100,30*(last_row+1),window=cancel,
	 anchor=NW)

	# tell the scroll bars the new size of the canvas:
	dirs_popup.canvas.config(scrollregion=dirs_popup.canvas.bbox(ALL))

#### Quiz parameters menu ######################################################
quiz_params_popup = None

def quiz_params_dialogue():
	global quiz_params_popup
	quiz_params_popup = Toplevel()
	quiz_params_popup.title("Quiz Parameters")
	quiz_params_popup.grab_set()

	practice_mode_var = BooleanVar(quiz_params_popup)
	practice_mode_var.set(model.get_practice_mode())
	practice_mode_label = Label(quiz_params_popup,text="Practice mode:")
	practice_mode_label.grid(row = 0,column = 0)
	practice_mode_menu = OptionMenu(quiz_params_popup,practice_mode_var,
	 False,True)
	practice_mode_menu.grid(row = 0,column = 1)

	standalone_var = BooleanVar(quiz_params_popup)
	standalone_var.set(model.get_standalone())
	standalone_label = Label(quiz_params_popup,text="Single-question quiz:")
	standalone_label.grid(row = 1,column = 0)
	standalone_menu = OptionMenu(quiz_params_popup,standalone_var,False,
	 True)
	standalone_menu.grid(row = 1,column = 1)

	logged_var = BooleanVar(quiz_params_popup)
	logged_var.set(model.get_logged())
	logged_label = Label(quiz_params_popup,text="Quiz logging:")
	logged_label.grid(row = 2,column = 0)
	logged_menu = OptionMenu(quiz_params_popup,logged_var,False,True)
	logged_menu.grid(row = 2,column = 1)

	log_dir_label = Label(quiz_params_popup,text='Log directory:')
	log_dir_label.grid(row = 3,column = 0)
	log_dir = Entry(quiz_params_popup)
	log_dir.insert(0, model.get_log_dir())
	log_dir.grid(row = 3,column = 1)

	ok = Button(quiz_params_popup,text = "OK",command =
		lambda: set_quiz_params(
			practice_mode_var.get(),
			standalone_var.get(),
			logged_var.get(),
			log_dir.get()
		)
	)
	ok.grid(row = 4,columnspan = 2)

def set_quiz_params(
		practice_mode_var,
		standalone_var,
		logged_var,
		log_dir
	):
	model.set_practice_mode(practice_mode_var)
	model.set_standalone(standalone_var)
	model.set_logged(logged_var)
	model.set_log_dir(log_dir)
	quiz_params_popup.destroy()

#### main code #################################################################
if len(sys.argv) != 2:
	print 'Usage: python '+sys.argv[0]+' <question library path>'
	sys.exit(-1)
# resolve question library path, then try to work out where
# web2py/applications/cqg/ and quiz_specifications/ are
question_library_path = os.path.abspath(sys.argv[1])
try:
	# where are we? (first entry in argv is the called program's path)
	bin_dir = os.path.split(sys.argv[0])[0]
	# resolve relative paths from here
	cqg_dir = os.path.join(bin_dir,"../web2py/applications/cqg")
	quiz_specs_dir = os.path.join(bin_dir,"../quiz_specifications")
	sys.path.append(os.path.abspath(cqg_dir))
	os.chdir(quiz_specs_dir)
except:
	print "Warning: this doesn't look like a complete CQG install,"
	print "so question previewing is unavailable."

# init Tkinter GUI:
main = Tk()
main.geometry("700x200")
main.title("Quiz Specification GUI")
add_scrolling_canvas(main,"hv")

menubar = Menu(main)
# file menu
file_m = Menu(menubar,tearoff = 0)
file_m.add_command(label = 'New',command = new)
file_m.add_command(label = 'Open...',command = load)
file_m.add_command(label = 'Save',command = save)
file_m.add_command(label = 'Save as...',command = save_as)
file_m.add_command(label = 'Exit',command = main.quit)
menubar.add_cascade(label = 'File',menu = file_m)
# groups menu
groups = Menu(menubar,tearoff = 0)
groups.add_command(label = "Add group before:list",
command = lambda:add_group(False,True))
groups.add_command(label = "Add group before:pattern",
command = lambda:add_group(False,False))
groups.add_command(label = "Add group after:list",
command = lambda:add_group(True,True))
groups.add_command(label = "Add group after:pattern",
command = lambda:add_group(True,False))
groups.add_command(label = "Delete group",command = delete_group)
groups.add_command(label = "Clear group buffer",command = clear_group_buffer)
groups.add_command(label = "Set add directory filter",command = lambda:set_add_directory_filter())
menubar.add_cascade(label = "Groups", menu = groups)
# quiz parameters menu
quiz_params = Menu(menubar,tearoff = 0)
quiz_params.add_command(label = 'Set quiz parameters',
 command = quiz_params_dialogue)
menubar.add_cascade(label = 'Quiz parameters',menu = quiz_params)
main.config(menu = menubar)

menubar.bind(sequence = '<Button-1>', func = update_ui_hints)

# run the gui
refresh()
mainloop()


text:
using namespace System;

 #define KEYDOWN(name, key) (name[key] & 0x80)

namespace IgneelDirectInput {

	public ref class DKeyBoard sealed: public Keyboard , IPoollableInput
	{
	internal:
		IDirectInputDevice8* keyboard;
		Byte* buffer;
		bool pooled;
	public:
		DKeyBoard(IDirectInput8* input, InputContext^ context, HANDLE hEvent);

		OVERRIDE( bool IsKeyPressed(Keys key) );

		virtual void Pool();

		virtual void Reset();

	protected :
		OVERRIDE( void OnDispose(bool ));
	};

}


text:
"""
To run these tests you need to have at least configured airflow in
local mode and run:

`airflow initdb`
"""
import os
from datetime import datetime

import pytest
from airflow.operators.dummy import DummyOperator

from domino.airflow import DominoOperator
from domino.exceptions import RunFailedException
from airflow import DAG
from airflow.models import TaskInstance

TEST_PROJECT = os.environ.get("DOMINO_TEST_PROJECT")

def test_airflow_dags():
    pytest.importorskip("airflow")

    from airflow import DAG
    from airflow.models import TaskInstance

    start_time = datetime.now()

    dag = DAG(dag_id="airflow_dag_test_0", start_date=start_time)
    task = DummyOperator(
        dag=dag,
        task_id='run_this_last',
    )

    task.run()
    ti = TaskInstance(task=task, execution_date=start_time)
    task.execute(ti.get_template_context())

def test_operator():
    start_time = datetime.now()

    dag = DAG(dag_id="foo", start_date=start_time)
    task = DominoOperator(
        dag=dag,
        task_id="foo",
        project=TEST_PROJECT,
        isDirect=True,
        command=["python -V"],
    )

    task.run()
    ti = TaskInstance(task=task, execution_date=start_time)
    task.execute(ti.get_template_context())

def test_operator_fail(caplog):
    execution_dt = datetime.now()

    dag = DAG(dag_id="foo", start_date=execution_dt)
    task = DominoOperator(
        dag=dag,
        task_id="foo",
        project=TEST_PROJECT,
        isDirect=True,
        command=["python -c 'import sys; sys.exit(1)'"],
    )

    with pytest.raises(RunFailedException):
        task.run()
        ti = TaskInstance(task=task, execution_date=execution_dt)
        task.execute(ti.get_template_context())

def test_operator_fail_invalid_tier(caplog):
    execution_dt = datetime.now()

    dag = DAG(dag_id="foo", start_date=execution_dt)
    task = DominoOperator(
        dag=dag,
        task_id="foo",
        project=TEST_PROJECT,
        isDirect=True,
        command=["python -V"],
        tier="this tier does not exist",
    )

    with pytest.raises(ValueError):
        task.run()
        ti = TaskInstance(task=task, execution_date=execution_dt)
        task.execute(ti.get_template_context())


text:
<!DOCTYPE html>

    <title>GainDb</title>
    <meta charset="utf-8">
    <meta name="robots" content="noindex, follow">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="lib/jquery-mobile/css/jquery.mobile-1.3.2.css">


text:
// Copyright 2014 The Cockroach Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
// implied. See the License for the specific language governing
// permissions and limitations under the License.
//
// Author: Spencer Kimball (spencer.kimball@gmail.com)

package storage

import (
	"bytes"
	"errors"
	"math"

	"github.com/gogo/protobuf/proto"

	"github.com/cockroachdb/cockroach/keys"
	"github.com/cockroachdb/cockroach/roachpb"
	"github.com/cockroachdb/cockroach/storage/engine"
	"github.com/cockroachdb/cockroach/util"
	"github.com/cockroachdb/cockroach/util/encoding"
	"github.com/cockroachdb/cockroach/util/uuid"
)

var errEmptyTxnID = errors.New("empty Transaction ID used in sequence cache")

// The SequenceCache provides idempotence for request retries. Each
// transactional request to a range specifies an Transaction ID and sequence number
// which uniquely identifies a client command. After commands have
// been replicated via Raft, they are executed against the state
// machine and the results are stored in the SequenceCache.
//
// The SequenceCache stores responses in the underlying engine, using
// keys derived from Range ID, txn ID and sequence number.
//
// A SequenceCache is not thread safe. Access to it is serialized
// through Raft.
type SequenceCache struct {
	rangeID      roachpb.RangeID
	min, max     roachpb.Key
	scratchEntry roachpb.SequenceCacheEntry
	scratchBuf   [256]byte
}

// NewSequenceCache returns a new sequence cache. Every range replica
// maintains a sequence cache, not just the leader.
func NewSequenceCache(rangeID roachpb.RangeID) *SequenceCache {
	return &SequenceCache{
		rangeID: rangeID,
		// The epoch and sequence numbers are encoded in decreasing order.
		min: keys.SequenceCacheKey(rangeID, txnIDMin, math.MaxUint32, math.MaxUint32),
		max: keys.SequenceCacheKey(rangeID, txnIDMax, 0, 0),
	}
}

var txnIDMin = new(uuid.UUID)
var txnIDMax = new(uuid.UUID)

func init() {
	for i := range txnIDMin.Bytes() {
		txnIDMin.UUID[i] = '\x00'
	}
	for i := range txnIDMax.Bytes() {
		txnIDMax.UUID[i] = '\xff'
	}
}

// ClearData removes all persisted items stored in the cache.
func (sc *SequenceCache) ClearData(e engine.Engine) error {
	_, err := engine.ClearRange(e, engine.MakeMVCCMetadataKey(sc.min), engine.MakeMVCCMetadataKey(sc.max))
	return err
}

// Get looks up the latest sequence number recorded for this transaction ID.
// The latest entry is that with the highest epoch (and then, highest
// sequence). On a miss, zero is returned for both. If an entry is found and a
// SequenceCacheEntry is provided, it is populated from the found value.
func (sc *SequenceCache) Get(e engine.Engine, txnID *uuid.UUID, dest *roachpb.SequenceCacheEntry) (uint32, uint32, error) {
	if txnID == nil {
		return 0, 0, errEmptyTxnID
	}

	// Pull response from disk and read into reply if available. Sequence
	// number sorts in decreasing order, so this gives us the largest entry or
	// an entry which isn't ours. To avoid encoding an end key for the scan,
	// we just scan and check via a simple prefix check whether we read a
	// key for "our" cache id.
	prefix := keys.SequenceCacheKeyPrefix(sc.rangeID, txnID)
	kvs, _, err := engine.MVCCScan(e, prefix, sc.max, 1, /* num */
		roachpb.ZeroTimestamp, true /* consistent */, nil /* txn */)
	if err != nil || len(kvs) == 0 || !bytes.HasPrefix(kvs[0].Key, prefix) {
		return 0, 0, err
	}
	_, epoch, seq, err := decodeSequenceCacheKey(kvs[0].Key, sc.scratchBuf[:0])
	if err != nil {
		return 0, 0, err
	}
	if dest != nil {
		dest.Reset()
		// Caller wants to have the unmarshaled value.
		if err := kvs[0].Value.GetProto(dest); err != nil {
			return 0, 0, err
		}
	}
	return epoch, seq, nil
}

// GetAllTransactionID returns all the key-value pairs for the given transaction ID from
// the engine.
func (sc *SequenceCache) GetAllTransactionID(e engine.Engine, txnID *uuid.UUID) ([]roachpb.KeyValue, error) {
	prefix := keys.SequenceCacheKeyPrefix(sc.rangeID, txnID)
	kvs, _, err := engine.MVCCScan(e, prefix, prefix.PrefixEnd(), 0, /* max */
		roachpb.ZeroTimestamp, true /* consistent */, nil /* txn */)
	return kvs, err
}

// Iterate walks through the sequence cache, invoking the given callback for
// each unmarshaled entry with the key, the transaction ID and the decoded
// entry.
func (sc *SequenceCache) Iterate(e engine.Engine, f func([]byte, *uuid.UUID, roachpb.SequenceCacheEntry)) {
	_, _ = engine.MVCCIterate(e, sc.min, sc.max, roachpb.ZeroTimestamp,
		true /* consistent */, nil /* txn */, false, /* !reverse */
		func(kv roachpb.KeyValue) (bool, error) {
			var entry roachpb.SequenceCacheEntry
			txnID, _, _, err := decodeSequenceCacheKey(kv.Key, nil)
			if err != nil {
				panic(err) // TODO(tschottdorf): ReplicaCorruptionError
			}
			if err := kv.Value.GetProto(&entry); err != nil {
				panic(err) // TODO(tschottdorf): ReplicaCorruptionError
			}
			f(kv.Key, txnID, entry)
			return false, nil
		})
}

// TODO(nvanbenschoten): We pass MVCCStats in, but the actual key handling is
// too low level to update it.
func copySeqCache(e engine.Engine, ms *engine.MVCCStats, srcID, dstID roachpb.RangeID, keyMin, keyMax engine.MVCCKey) (int, error) {
	var scratch [64]byte
	var count int
	err := e.Iterate(keyMin, keyMax,
		func(kv engine.MVCCKeyValue) (bool, error) {
			// Decode the key into a cmd, skipping on error. Otherwise,
			// write it to the corresponding key in the new cache.
			txnID, epoch, seq, err := decodeSequenceCacheMVCCKey(kv.Key, scratch[:0])
			if err != nil {
				return false, util.Errorf("could not decode a sequence cache key %s: %s",
					kv.Key, err)
			}
			key := keys.SequenceCacheKey(dstID, txnID, epoch, seq)
			encKey := engine.MakeMVCCMetadataKey(key)
			// Decode the value, update the checksum and re-encode.
			meta := &engine.MVCCMetadata{}
			if err := proto.Unmarshal(kv.Value, meta); err != nil {
				return false, util.Errorf("could not decode sequence cache value %s [% x]: %s",
					kv.Key, kv.Value, err)
			}
			value := meta.Value()
			value.ClearChecksum()
			value.InitChecksum(key)
			meta.RawBytes = value.RawBytes
			_, _, err = engine.PutProto(e, encKey, meta)
			count++
			return false, err
		})
	return count, err
}

// CopyInto copies all the results from this sequence cache into the destRangeID
// sequence cache. Failures decoding individual cache entries return an error.
// On success, returns the number of entries (key-value pairs) copied.
func (sc *SequenceCache) CopyInto(e engine.Engine, ms *engine.MVCCStats, destRangeID roachpb.RangeID) (int, error) {
	return copySeqCache(e, ms, sc.rangeID, destRangeID,
		engine.MakeMVCCMetadataKey(sc.min), engine.MakeMVCCMetadataKey(sc.max))
}

// CopyFrom copies all the persisted results from the originRangeID
// sequence cache into this one. Note that the cache will not be
// locked while copying is in progress. Failures decoding individual
// entries return an error. The copy is done directly using the engine
// instead of interpreting values through MVCC for efficiency.
// On success, returns the number of entries (key-value pairs) copied.
func (sc *SequenceCache) CopyFrom(e engine.Engine, ms *engine.MVCCStats, originRangeID roachpb.RangeID) (int, error) {
	originMin := engine.MakeMVCCMetadataKey(
		keys.SequenceCacheKey(originRangeID, txnIDMin, math.MaxUint32, math.MaxUint32))
	originMax := engine.MakeMVCCMetadataKey(
		keys.SequenceCacheKey(originRangeID, txnIDMax, 0, 0))
	return copySeqCache(e, ms, originRangeID, sc.rangeID, originMin, originMax)
}

// Del removes all sequence cache entries for the given transaction.
func (sc *SequenceCache) Del(e engine.Engine, ms *engine.MVCCStats, txnID *uuid.UUID) error {
	startKey := keys.SequenceCacheKeyPrefix(sc.rangeID, txnID)
	_, err := engine.MVCCDeleteRange(e, nil /* TODO(nvanbenschoten) */, startKey, startKey.PrefixEnd(), 0 /* max */, roachpb.ZeroTimestamp, nil /* txn */)
	return err
}

// Put writes a sequence number for the specified transaction ID.
func (sc *SequenceCache) Put(e engine.Engine, ms *engine.MVCCStats, txnID *uuid.UUID, epoch, seq uint32, txnKey roachpb.Key, txnTS roachpb.Timestamp, pErr *roachpb.Error) error {
	if seq <= 0 || txnID == nil {
		return errEmptyTxnID
	}
	if !sc.shouldCacheError(pErr) {
		return nil
	}

	// Write the response value to the engine.
	key := keys.SequenceCacheKey(sc.rangeID, txnID, epoch, seq)
	sc.scratchEntry = roachpb.SequenceCacheEntry{Key: txnKey, Timestamp: txnTS}
	return engine.MVCCPutProto(e, ms, key, roachpb.ZeroTimestamp, nil /* txn */, &sc.scratchEntry)
}

// Responses with write-too-old, write-intent and not leader errors
// are retried on the server, and so are not recorded in the sequence
// cache in the hopes of retrying to a successful outcome.
func (sc *SequenceCache) shouldCacheError(pErr *roachpb.Error) bool {
	switch pErr.GetDetail().(type) {
	case *roachpb.WriteTooOldError, *roachpb.WriteIntentError, *roachpb.NotLeaderError, *roachpb.RangeKeyMismatchError:
		return false
	}
	return true
}

func decodeSequenceCacheKey(key roachpb.Key, dest []byte) (*uuid.UUID, uint32, uint32, error) {
	// TODO(tschottdorf): redundant check.
	if !bytes.HasPrefix(key, keys.LocalRangeIDPrefix) {
		return nil, 0, 0, util.Errorf("key %s does not have %s prefix", key, keys.LocalRangeIDPrefix)
	}
	// Cut the prefix, the Range ID, and the infix specifier.
	b := key[len(keys.LocalRangeIDPrefix):]
	b, _, err := encoding.DecodeUvarintAscending(b)
	if err != nil {
		return nil, 0, 0, err
	}
	b = b[1:]
	if !bytes.HasPrefix(b, keys.LocalSequenceCacheSuffix) {
		return nil, 0, 0, util.Errorf("key %s does not contain the sequence cache suffix %s",
			key, keys.LocalSequenceCacheSuffix)
	}
	// Cut the sequence cache suffix.
	b = b[len(keys.LocalSequenceCacheSuffix):]
	// Decode the id.
	b, idBytes, err := encoding.DecodeBytesAscending(b, dest)
	if err != nil {
		return nil, 0, 0, err
	}
	// Decode the epoch.
	b, epoch, err := encoding.DecodeUint32Descending(b)
	if err != nil {
		return nil, 0, 0, err
	}
	// Decode the sequence number.
	b, seq, err := encoding.DecodeUint32Descending(b)
	if err != nil {
		return nil, 0, 0, err
	}
	if len(b) > 0 {
		return nil, 0, 0, util.Errorf("key %q has leftover bytes after decode: %s; indicates corrupt key",
			key, b)
	}
	txnID, err := uuid.FromBytes(idBytes)
	return txnID, epoch, seq, err
}

func decodeSequenceCacheMVCCKey(encKey engine.MVCCKey, dest []byte) (*uuid.UUID, uint32, uint32, error) {
	if encKey.IsValue() {
		return nil, 0, 0, util.Errorf("key %s is not a raw MVCC value", encKey)
	}
	return decodeSequenceCacheKey(encKey.Key, dest)
}


text:
import os
import json
from copy import copy

import lux
from lux import route, JSON_CONTENT_TYPES
from lux.extensions import base, sitemap

from pulsar import ImproperlyConfigured
from pulsar.utils.slugify import slugify
from pulsar.apps.wsgi import Json, Html, Router

from .builder import (DirBuilder, FileBuilder, BuildError, SkipBuild,
                      Unsupported, normpath)
from .contents import Article, parse_date, page_info

class ErrorRouter(lux.Router, DirBuilder):
    status_code = 500

    def get(self, request):
        app = request.app
        return app.html_response(request, self.html_body_template,
                                 status_code=self.status_code)

class HtmlRouter(lux.HtmlRouter):
    '''Base class for static Html routes.
    '''
    def state_template(self, app):
        '''Template used when in html5 mode
        '''
        div = Html('div', cn=self.angular_view_class)
        div.data({'compile-html': ''})
        return div.render()

class MediaBuilder(base.MediaRouter, FileBuilder):

    def build(self, app, location=None):
        '''Build the files for this Builder
        '''
        if location is None:
            location = os.path.abspath(app.config['STATIC_LOCATION'])
        if self.built is not None:
            return self.built
        self.built = []
        for url_base, src in self.extension_paths(app):
            for upath, src, ext in self.all_files(app, src):
                url = '%s.%s' % (os.path.join(url_base, upath), ext)
                self.build_file(app, location, src=src, name=url)

class JsonRedirect(Router):

    def __init__(self, route):
        route = str(route)
        if route.startswith('/'):
            route = route[1:]
        self.target = '/%s' % route
        if route.endswith('/'):
            route = route[:-1]
        assert route, 'JSON route not defined'
        super(JsonRedirect, self).__init__('/%s.json' % route)

    def get(self, request):
        return request.redirect(self.target)

class JsonRoot(Router, FileBuilder):
    '''The root for :class:`.JsonContent`
    '''
    response_content_types = JSON_CONTENT_TYPES

    def apis(self, request):
        routes = {}
        site_url = request.config['SITE_URL']
        for route in self.routes:
            path = route.path()
            if site_url:
                path = '%s%s' % (site_url, path)
            url = '%s.json' % path
            routes['%s_url' % route.name] = url
        return routes

    def get(self, request):
        return Json(self.apis(request)).http_response(request)

class JsonFile(Router, FileBuilder):
    '''Serve/build a json file
    '''
    html_router = None

    def get(self, request):
        app = request.app
        response = request.response
        content = self.get_content(request)
        # Get the JSON representation of the resource
        data = content.json(request)
        if data:
            html_router = self.html_router
            urlargs = request.urlargs
            # The index page
            if urlargs.get('path') == 'index':
                urlargs['path'] = ''
            data['api_url'] = app.site_url(self.relative_path(request))
            html = html_router.get_route(html_router.childname('view'))
            urlparams = content.urlparams(html.route.variables)
            path = html.path(**urlparams)
            data['html_url'] = app.site_url(normpath(path))
            return Json(data).http_response(request)
        else:
            raise Unsupported
        return Json(data).http_response(request)

    def should_build(self, app, name):
        '''Don't build json api for special contents (404 for example)
        '''
        return name not in app.config['STATIC_SPECIALS']

    def all(self, app, html=True, draft=False):
        all = []
        o = 'modified' if draft else 'date'
        for d in self.build(app):
            data = json.loads(d.body.decode('utf-8'))
            if bool(data.get('priority') == '0') is not draft:
                continue
            if not html:
                data = dict(page_info(data))
            all.append(data)
        return list(reversed(sorted(
            all, key=lambda d: parse_date(d.get('date', d['modified'])))))

class JsonContent(Router, DirBuilder):
    '''Handle JSON contents in a directory
    '''
    html_router = None
    JsonFileRouter = JsonFile

    def __init__(self, route, dir=None, name=None, html_router=None):
        route = self.valid_route(route, dir)[:-1] or os.path.basename(self.dir)
        self.src = '%s.json' % route
        assert html_router, 'html router required'
        super(JsonContent, self).__init__(route)

        content = html_router.content
        # When the html router is an index template, add the index.json
        # resource for rendering the index page
        if html_router.index_template:
            self.add_child(
                JsonIndex('index.json',
                          dir=self.dir,
                          html_router=html_router.remove_content_template(),
                          meta=copy(html_router.meta),
                          index_template=html_router.index_template))

        child_router = html_router.get_route(html_router.childname('view'))
        self.add_child(self.JsonFileRouter('<path:id>',
                                           dir=self.dir,
                                           name='json_files',
                                           content=content,
                                           html_router=html_router,
                                           meta=copy(child_router.meta)))

    def get(self, request):
        '''Build all the contents
        '''
        files = self.get_route('json_files')
        data = files.all(request.app, html=False)
        return Json(data).http_response(request)

class JsonIndex(Router, FileBuilder):
    index_template = None

    def build_file(self, app, location):
        src = app.template_full_path(self.index_template)
        return super(JsonIndex, self).build_file(app, location, src, 'index')

    def get(self, request):
        app = request.app
        src = app.template_full_path(self.index_template)
        content = self.read_file(app, src, 'index', False)
        data = content.json(request)
        html_router = self.html_router
        data['api_url'] = app.site_url(self.relative_path(request))
        urlparams = content.urlparams(html_router.route.variables)
        path = html_router.path(**urlparams)
        data['html_url'] = app.site_url(normpath(path))
        return Json(data).http_response(request)

class HtmlFile(HtmlRouter, FileBuilder):
    '''Serve an Html file.
    '''
    @property
    def html_router(self):
        return self.parent

    def get_html(self, request):
        content = self.get_content(request)
        if content._meta.slug in request.config['STATIC_SPECIALS']:
            request.cache.uirouter = False
        else:
            request.cache.uirouter = self.uirouter
        return content.html(request)

    def get_api_info(self, app):
        if self.parent:
            return self.parent.get_api_info(app)

class HtmlContent(HtmlRouter, DirBuilder):
    '''Serve a directory of files rendered in a similar fashion

    The directory could contains blog posts for example.
    If an ``index.html`` file is available, it is rendered with the
    directory url.
    '''
    api = None
    '''The Json api router if available.
    '''
    child_url = '<path:slug>'
    '''The relative url of files within the directory'''
    drafts = 'drafts'
    '''Drafts url. If not provided drafts wont be rendered.
    '''
    index_template = None
    meta_children = None
    '''Metadata dictionary for children routes
    '''
    drafts_template = 'blogindex.html'
    '''The children render the children routes of this router
    '''
    '''Context for the body tag'''
    priority = 1
    JsonApiRouter = JsonContent
    HtmlFileRouter = HtmlFile

    def __init__(self, route, *routes, **params):
        route = self.valid_route(route, params.pop('dir', None))
        name = slugify(params.pop('name', None) or route or self.dir)
        super(HtmlContent, self).__init__(route, *routes, name=name, **params)
        # Add drafts index
        if self.drafts:
            self.add_child(Drafts(self.drafts,
                                  name=self.childname('drafts'),
                                  index_template=self.drafts_template))
        self.meta = copy(self.meta) if self.meta else {}
        # Add children routes
        meta = copy(self.meta)
        if self.meta_children:
            meta.update(self.meta_children)
        file = self.HtmlFileRouter(self.child_url, dir=self.dir,
                                   name=self.childname('view'),
                                   content=self.content,
                                   html_body_template=self.html_body_template,
                                   meta=meta,
                                   uirouter=self.uirouter,
                                   uimodules=self.uimodules)
        self.add_child(file)
        #
        for url_path, file_path, ext in self.all_files(
                include_subdirectories=False):
            if url_path == 'index':
                self.src = file_path
        if self.src and self.index_template:
            raise ImproperlyConfigured(
                'Both index and index template specified')

    def jsonApi(self):
        return self.JsonApiRouter(self.route.path,
                                  dir=self.dir,
                                  html_router=self)

    def get_api_info(self, app):
        if self.api:
            url = app.config['SITE_URL'] + self.api.path()
            return {'name': self.api.name,
                    'url': url,
                    'type': 'static'}

    def angular_page(self, app, router, page):
        if self.index_template:
            url = app.config['SITE_URL'] + self.api.path()
            page['apiItems'] = {'name': self.api.name,
                                'url': '%s.json' % url,
                                'type': 'static'}

    def get_html(self, request):
        if self.src and request.cache.building_static:
            raise SkipBuild     # it will be built by the file handler
        if self.index_template:
            doc = request.html_document
            app = request.app
            files = self.api.get_route('json_files') if self.api else None
            if files:
                doc.jscontext['items'] = files.all(app, html=False)
            src = app.template_full_path(self.index_template)
            # set content and template to nothing, Important
            self.remove_content_template()
            content = self.read_file(app, src, 'index', False)
            return content.html(request)
        elif self.src:
            content = self.read_file(request.app, self.src, 'index')
            return content.html(request)
        else:
            raise SkipBuild

    def remove_content_template(self):
        self.content = None
        self.meta.pop('template', None)
        return self

class Drafts(HtmlRouter, FileBuilder):
    '''A page collecting all drafts
    '''
    priority = 0
    uirouter = False
    uimodules = ['lux.blog']

    def get_html(self, request):
        if self.index_template and self.parent:
            app = request.app
            api = self.parent.api
            doc = request.html_document
            doc.head.replace_meta('robots', 'noindex, nofollow')
            files = api.get_route('json_files') if api else None
            if files:
                doc.jscontext['items'] = files.all(app, html=False, draft=True)
            src = app.template_full_path(self.index_template)
            content = self.read_file(app, src, 'index')
            return content.html(request)
        else:
            raise SkipBuild

class Blog(HtmlContent):
    '''Defaults for a blog url
    '''
    index_template = 'blogindex.html'
    content = Article
    uimodules = ['lux.blog']

class Sitemap(sitemap.Sitemap, FileBuilder):

    def items(self, request):
        for item in self.parent.built:
            if item and item.content_type == 'text/html':
                yield item

    def build_file(self, app, location, src=None, name=None):
        router = self.parent
        assert isinstance(router, HtmlContent), ('Static sitemap requires '
                                                 'HtmlContent')
        router.build_done(self._build_file)
        self.built.append(None)

    def _build_file(self, app, location, build):
        path = self.route.path
        request = app.wsgi_request(path=path, extra={'HTTP_ACCEPT': '*/*'})
        response = self.response(request.environ, {})
        #
        dst_filename = os.path.join(location, path[1:])
        dirname = os.path.dirname(dst_filename)
        if not os.path.isdir(dirname):
            os.makedirs(dirname)
        app.logger.info('Creating "%s"', dst_filename)
        with open(dst_filename, 'wb') as f:
            f.write(response.content[0])


text:
from keras.datasets import mnist
from keras.utils import to_categorical
from keras import layers
from keras import models

# Define model
model = models.Sequential()
model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(28, 28, 1)))
model.add(layers.MaxPooling2D((2, 2)))
model.add(layers.Conv2D(64, (3, 3), activation='relu'))
model.add(layers.MaxPooling2D((2, 2)))
model.add(layers.Conv2D(64, (3, 3), activation='relu'))

model.add(layers.Flatten())
model.add(layers.Dense(64, activation='relu'))
model.add(layers.Dense(10, activation='softmax'))

model.summary()

# Get data
(train_images, train_labels), (test_images, test_labels) = mnist.load_data()

train_images = train_images.reshape((60000, 28, 28, 1))
train_images = train_images.astype('float32') / 255

test_images = test_images.reshape((10000, 28, 28, 1))
test_images = test_images.astype('float32') / 255

train_labels = to_categorical(train_labels)
test_labels = to_categorical(test_labels)

# Compile & Train
model.compile(optimizer='rmsprop', loss='categorical_crossentropy', metrics=['accuracy'])
model.fit(train_images, train_labels, epochs=5, batch_size=64)

# Evaluate
test_loss, test_acc = model.evaluate(test_images, test_labels)
print("Test accuracy", test_acc)


text:
{{ homepage.html.OnDate ? formatDate(homepage.html.OnDate) : '' }}

{{ homepage.html.Venue ? formatStr(homepage.html.Venue) : '' }}

{{ homepage.html.Time ? formatTime(homepage.html.Time) : '' }}

Article title

{{ homepage.html.Venue ? formatPeople(homepage.html.PeopleOrganisations) : '' }}


text:
package test.github1336;

import org.testng.annotations.Test;

public class TestNG1NoPriority extends BaseClass {
  @Test
  public void test1TestNG1() {
    runTest("http://testng.org/doc/download.html");
  }

  @Test
  public void test2TestNG1() {
    runTest("http://www3.lenovo.com/in/en/");
  }

  @Test
  public void test3TestNG1() {
    runTest("https://github.com/");
  }
}


text:
export DE="xfce"
export DESKTOP_SESSION="xfce"
export XDG_CURRENT_DESKTOP="XFCE"


text:
title: How to handle different CocoaPods versions
---

# Using different CocoaPods versions in different projects

By default the [CocoaPods](https://cocoapods.org) is a system gem but if you need to use a specific version of it the best way to go is using [Bundler](http://bundler.io/). Just follow these steps to configure the [CocoaPods](https://cocoapods.org) version to be used:

Create a Gemfile in your project's directory where you keep your Podfile. The Gemfile should include the [CocoaPods](https://cocoapods.org) version to use (the example shows how to use version 0.38.0)

	source 'https://rubygems.org'
	gem 'cocoapods', '0.38.0'

 When done simply run the following commands in the terminal:

    gem install bundler
    bundle install
    bundle exec pod install

As you can see simply by adding the `bundle exec` to your command you can use [Bundler](http://bundler.io/) to use the [CocoaPods](https://cocoapods.org) version that is specified in the Gemfile and is installed by the `bundle install` command and it executes the specified `pod install` line using this version.

# Using different Cocoapods versions on Bitrise

The Virtual Machines that [Bitrise](https://bitrise.io) uses have [Bundler](http://bundler.io/) installed already and the Run CocoaPods install step [https://github.com/bitrise-io/steps-cocoapods-and-repository-validator](https://github.com/bitrise-io/steps-cocoapods-and-repository-validator) also checks for a Gemfile so there are only two simple steps to follow if you don't want to use the latest version of [CocoaPods](https://cocoapods.org) for your project

1. Add the Gemfile to your repository where you keep your Podfile and make sure to stage, commit and push it
2. Add the [Run CocoaPods install](https://github.com/bitrise-io/steps-cocoapods-and-repository-validator) step to your workflow
+ The [Run CocoaPods install](https://github.com/bitrise-io/steps-cocoapods-and-repository-validator) step has an option *Update CocoaPods version?* that updates the system version of [CocoaPods](https://cocoapods.org). Since you are using a different version and you don't need the latest simply change this value to false


text:
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.text.pdf.draw;
using Edc.Domain.Models;
using Document = Edc.Domain.Models.Document;
using Font = iTextSharp.text.Font;
using Section = Edc.Domain.Models.Section;

namespace Edc.Domain
{
    public static class PdfDocumentGenerator
    {

        public static MemoryStream GenerateComplexDocument(Document documentToBeGenerated)
        {
            using (var ms = new MemoryStream())
            {
                var doc = new iTextSharp.text.Document();
                PdfWriter writer = PdfWriter.GetInstance(doc, ms);
                doc.Open();
                var path = Environment.GetFolderPath(Environment.SpecialFolder.Fonts);
                string arialuniTff = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts), "ARIALUNI.TTF");
                FontFactory.Register(arialuniTff);

                var bfR = BaseFont.CreateFont(arialuniTff, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
                var times = new Font(bfR, 12, Font.NORMAL, BaseColor.BLACK);
                doc.AddTitle(documentToBeGenerated.Title);
                doc.Add(new Paragraph(documentToBeGenerated.Title, times));
                doc.Add(new Paragraph(documentToBeGenerated.Author.ToString(), times));

                doc.Add(new Paragraph("Ключови думи: " + String.Join(", ", documentToBeGenerated.GetDocumentTopKeywords().Select(k => k.Name)), times));

                var sectionIndex = 1;
                foreach (var section in documentToBeGenerated.Sections)
                {
                    doc.NewPage();
                    doc.Add(new Paragraph("" + sectionIndex + ". " + section.Title, times));

                    var subsections = section.Subsections.Where(s => s.Content != null).ToList();
                    var subSectionIndex = 1;
                    foreach (var subsection in subsections)
                    {
                        doc.Add(new Paragraph("" + sectionIndex + "." +subSectionIndex +". " + subsection.Title, times));
                        subSectionIndex++;
                        doc.Add(new Paragraph(subsection.Content.MainText, times));
                    }

                    sectionIndex++;
                }
                doc.Close();

                return ms;
            }
        }

        public static MemoryStream GenerateSimpleDocument(SectionContent sectionToBeGenerated)
        {
            using (var ms = new MemoryStream())
            {
                var doc = new iTextSharp.text.Document();
                PdfWriter writer = PdfWriter.GetInstance(doc, ms);
                doc.Open();
                var path = Environment.GetFolderPath(Environment.SpecialFolder.Fonts);
                string arialuniTff = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts), "ARIALUNI.TTF");
                FontFactory.Register(arialuniTff);

                var bfR = BaseFont.CreateFont(arialuniTff, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
                doc.AddTitle(sectionToBeGenerated.Title);
                var times = new Font(bfR, 12, Font.NORMAL, BaseColor.BLACK);

                doc.Add(new Paragraph(sectionToBeGenerated.Title, times));
                doc.Add(new LineSeparator());
                doc.Add(new Paragraph(sectionToBeGenerated.MainText, times));

                doc.Close();

                return ms;
            }
        }
    }
}


text:
import arcpy
from arcpy import env
env.overwriteOutput = True

#parameters

#Layer to be calculated
InLayer = arcpy.GetParameterAsText(0)
#InField: Layer which will receive final data
InField = arcpy.GetParameterAsText(1)
#SourceLayer: Layer which contributes data.
SourceLayer = arcpy.GetParameterAsText(2)
#SourceField: source field
SourceField = arcpy.GetParameterAsText(3)
#SpatShip = spatial relationship - same as Spatial Join tool
SpatShip = arcpy.GetParameterAsText(4)
#MergeRule: How to handle one-to-many relationships
MergeRule = arcpy.GetParameterAsText(5)
#SearchDist: search distance
SearchDist = arcpy.GetParameterAsText(6)

#Create field map a la forrestchev
#thanks to forrestchev on GIS StackExchange
#this field mapping code sets up the Spatial Join code later
#to create an output with only the Target_FID and the source field.
ScratchFMS = arcpy.FieldMappings()
ScratchFMS.addTable(SourceLayer)
SourceIndex = ScratchFMS.findFieldMapIndex(SourceField)
SourceFM = ScratchFMS.getFieldMap(SourceIndex)
ScratchFMS = arcpy.FieldMappings()
SourceFM.addInputField(SourceLayer, SourceField)
SourceFM.mergeRule = MergeRule
ScratchFMS.addFieldMap(SourceFM)

#spatial join to scratch features
arcpy.SpatialJoin_analysis(InLayer, SourceLayer, "ScratchSJ", "JOIN_ONE_TO_ONE",
                          "KEEP_ALL", ScratchFMS, SpatShip, SearchDist)
arcpy.AddMessage("Spatial Join completed.")

#create dictionary object for join purposes.
#the key will be the Target FID, and the value is the target field value.
JoinDict = {}
with arcpy.da.SearchCursor("ScratchSJ", ("TARGET_FID", SourceField)) as cursor:
    for row in cursor:
        fid = row[0]
        val = row[1]
        JoinDict[fid] = val

arcpy.AddMessage("Dictionary created.")

#Update cursor, hinges on dictionary
with arcpy.da.UpdateCursor(InLayer, ("OID@", InField)) as cursor:
    #reach into dictionary using FID values
    for row in cursor:
        #Search for dictionary item with feature's FID as key
        val = JoinDict[row[0]]
        row[1] = val
        cursor.updateRow(row)

#delete ScratchSJ file.
arcpy.Delete_management("ScratchSJ")


text:
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using BrightstarDB.Client;
using BrightstarDB.Storage;
using Foundation;
using NUnit.Framework;
using Path = BrightstarDB.Portable.Compatibility.Path;

namespace BrightstarDB.Portable.iOS.Tests
{
    [TestFixture]
    public class StoreTests
    {
        private readonly string _runId = DateTime.Now.Ticks.ToString(CultureInfo.InvariantCulture);
        private readonly IPersistenceManager _pm = new PersistenceManager();

        [Test]
        public void TestCreateAndDeleteStore()
        {
            var client = GetEmbeddedClient();
            var storeName = "TestCreateStore_" + _runId;
            var storePath = Path.Combine(TestConfiguration.StoreLocation, storeName);
            var dataPath = Path.Combine(storePath, "data.bs");
            client.CreateStore(storeName);

            Assert.IsTrue(client.DoesStoreExist(storeName), "Expected True from DoesStoreExist after store created.");
            Assert.IsTrue(_pm.DirectoryExists(TestConfiguration.StoreLocation), "Expected stores directory at {0}", TestConfiguration.StoreLocation);
            Assert.IsTrue(_pm.DirectoryExists(storePath), "Expected store directory at {0}", storePath);
            Assert.IsTrue(_pm.FileExists(dataPath), "Expected B* data file at {0}", dataPath);

            client.DeleteStore(storeName);

            Task.Delay(50).Wait(); // Wait to allow store to shutdown

            Assert.IsTrue(_pm.DirectoryExists(TestConfiguration.StoreLocation), "Expected stores directory at {0} after store deleted.", TestConfiguration.StoreLocation);
            Assert.IsFalse(_pm.FileExists(dataPath), "Expected data file to be deleted from {0}.", dataPath);
            Assert.IsFalse(_pm.DirectoryExists(storePath), "Expected store directory to be deleted from {0}.", storePath);
            Assert.IsFalse(client.DoesStoreExist(storeName), "Expected False from DoesStoreExist after store deleted.");
        }

        [Test]
        public void TestRdfImportExport()
        {
            var client = GetEmbeddedClient();
            var storeName = "TestRdfImportExport_" + _runId;
            var importPath = Path.Combine(TestConfiguration.StoreLocation, "import");
            if (!Directory.Exists(importPath)) Directory.CreateDirectory(importPath);

            _pm.CopyFile(Path.Combine(Path.Combine(NSBundle.MainBundle.BundlePath, "TestData"), "simple.txt"), Path.Combine(importPath, "simple.txt"), true);

            client.CreateStore(storeName);

            // RDF import
            var job = client.StartImport(storeName, "simple.txt");
            AssertJobSuccessful(client, storeName, job);

            // RDF export
            job = client.StartExport(storeName, "simple.export.nt");
            AssertJobSuccessful(client, storeName, job);

            var exportFilePath = Path.Combine(importPath, "simple.export.nt");
            Assert.IsTrue(_pm.FileExists(exportFilePath));
        }

        [Test]
        public void TestExecuteTransaction()
        {
            var client = GetEmbeddedClient();
            var storeName = "TestExecuteTransaction_" + _runId;

            client.CreateStore(storeName);

            // Test a simple addition of triples
            var insertData = new StringBuilder();
            insertData.AppendLine(@"<http://example.org/people/alice> <http://xmlns.com/foaf/0.1/name> ""Alice"".");
            insertData.AppendLine(
                @"<http://example.org/people/alice> <http://xmlns.com/foaf/0.1/mbox> ""alice@example.org"".");
            var job = client.ExecuteTransaction(storeName, null, null, insertData.ToString());
            AssertJobSuccessful(client, storeName, job);

            // Test an update with a precondition which is met
            const string tripleToDelete = @"<http://example.org/people/alice> <http://xmlns.com/foaf/0.1/mbox> ""alice@example.org"".";
            const string tripleToInsert = @"<http://example.org/people/alice> <http://xmlns.com/foaf/0.1/mbox_sha1sum> ""FAKESHA1""";
            job = client.ExecuteTransaction(storeName, tripleToDelete, tripleToDelete, tripleToInsert);
            AssertJobSuccessful(client, storeName, job);

            // Test an update with a precondition which is not met
            job = client.ExecuteTransaction(storeName, tripleToDelete, tripleToDelete, tripleToInsert);
            while (!(job.JobCompletedOk || job.JobCompletedWithErrors))
            {
                Task.Delay(3).Wait();
                job = client.GetJobInfo(storeName, job.JobId);
            }
            Assert.IsTrue(job.JobCompletedWithErrors);
        }

        [Test]
        public void TestQuery()
        {
            var client = GetEmbeddedClient();
            var storeName = "TestQuery_" + _runId;
            client.CreateStore(storeName);

            var insertData = new StringBuilder();
            insertData.AppendLine(@"<http://example.org/people/alice> <http://xmlns.com/foaf/0.1/name> ""Alice"".");
            insertData.AppendLine(
                @"<http://example.org/people/alice> <http://xmlns.com/foaf/0.1/knows> <http://example.org/people/bob> .");
            insertData.AppendLine(@"<http://example.org/people/alice> <http://xmlns.com/foaf/0.1/knows> <http://example.org/people/carol> .");
            insertData.AppendLine(@"<http://example.org/people/bob> <http://xmlns.com/foaf/0.1/name> ""Bob"" .");
            insertData.AppendLine(@"<http://example.org/people/carol> <http://xmlns.com/foaf/0.1/name> ""Carol"" .");

            var job = client.ExecuteTransaction(storeName, null, null, insertData.ToString());
            AssertJobSuccessful(client, storeName, job);

            const string query = "PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?p ?n WHERE { <http://example.org/people/alice> foaf:knows ?p . ?p foaf:name ?n }";
            var resultStream = client.ExecuteQuery(storeName, query);
            var doc = XDocument.Load(resultStream);
            Assert.IsNotNull(doc.Root);
            var rows = new List<XElement>(doc.SparqlResultRows());
            Assert.AreEqual(2, rows.Count);

            foreach (var row in rows)
            {
                Assert.IsNotNull(row.GetColumnValue("p"));
                Assert.IsNotNull(row.GetColumnValue("n"));
            }
        }

        private void AssertJobSuccessful(IBrightstarService client, string storeName, IJobInfo job)
        {
            while (!(job.JobCompletedOk || job.JobCompletedWithErrors))
            {
                Task.Delay(3).Wait();
                job = client.GetJobInfo(storeName, job.JobId);
            }
            Assert.IsTrue(job.JobCompletedOk, "Job failed with message: {0} : {1}", job.StatusMessage, job.ExceptionInfo);
        }

        private IBrightstarService GetEmbeddedClient()
        {
            return BrightstarService.GetClient("type=embedded;storesDirectory=" + TestConfiguration.StoreLocation);
        }
    }
}


text:
###ip.conf

    server {
    listen 80 default_server;
    server_name _;
    return 403;
    }

    server {
    listen 443 default_server;
    server_name _;
          ssl_certificate  ip.crt;           #cacert.pem 文件路径
          ssl_certificate_key ip.key;    #privkey.pem 文件路径
          ssl on;
    return 403;
    }

###https.conf
###### https 配置
    server {
       listen 80;
       server_name  domain.com;
       location / {
            proxy_pass http://127.0.0.1:38080;
            proxy_set_header Host $host;
            proxy_redirect off;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_connect_timeout 60;
            proxy_read_timeout 600;
            proxy_send_timeout 600;
        }
    }
    server {
    listen 443 ;
    server_name domain.com;
    ssl_certificate domain.crt;
    ssl_certificate_key domain.key;
    ssl on;
    ssl_session_timeout 5m;
    ssl_protocols SSLv2 SSLv3 TLSv1;
    ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers on;

       location / {
            proxy_pass http://127.0.0.1:38080;
            proxy_set_header Host $host;
            proxy_redirect off;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_connect_timeout 60;
            proxy_read_timeout 600;
            proxy_send_timeout 600;
        }

    }

###强制使用HTTPS
    server {
      listen       80;
          server_name  domain.com ;
          rewrite ^ https://$http_host$request_uri? permanent;    #强制将http重定向到https
        }
    server {
    listen 443 ;
    server_name domain.com;
    ssl_certificate domain.crt;
    ssl_certificate_key domain.key;
    ssl on;
    ssl_session_timeout 5m;
    ssl_protocols SSLv2 SSLv3 TLSv1;
    ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers on;

       location / {
            proxy_pass http://127.0.0.1:38080;
            proxy_set_header Host $host;
            proxy_redirect off;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_connect_timeout 60;
            proxy_read_timeout 600;
            proxy_send_timeout 600;
        }

    }


text:
from autobahn.twisted.websocket import WebSocketServerProtocol, \
    WebSocketServerFactory
from json import loads as json_loads
#from dispatcher import *
from random import uniform
from sys import stdout
from twisted.python import log
from twisted.internet import reactor
from gc import collect as gc_collect
from json import dumps as json_dumps

DEBUG = True
PORT = 8000
URL = "ws://8.8.8.8:%d"
MAX_CON = 100

"""@package docstring
Websocket interface module.

Websocket interface implementation for prediction model implementation, input
interfaces are: studentID, and a list of courseID, provides the quality and
prediction values after classification/estimation process.
"""

class BackendServerProtocol(WebSocketServerProtocol):
    dispatchers = {}

    def onConnect(self, request):
        print("Client connecting: %s"%( request.peer ))

    def onOpen(self):
        print("WebSocket connection open.")

    def onMessage(self, payload, isBinary):
        #dispatcher = WSDispatcher()
        if isBinary:
            print("Binary message received: %d bytes"%( len( payload ) ))
        else:
            json_string = format(payload.decode('utf8'))
            json_input = json_loads( json_string )
            #pprint( json_input )
        #try:
        #    dispatcher = self.dispatchers[self.peer]
        #except:
        #    dispatcher = WSDispatcher()
        #    self.dispatchers[self.peer] = dispatcher

        # echo back message verbatim
        #self.sendMessage( dispatcher.risk( json_input ), False )
        result = {'risk':uniform(0,1),'quality':uniform(0,1)}
        self.sendMessage( json_dumps(result), False )

    def onClose(self, wasClean, code, reason):
        #try:
        #    del(self.dispatchers[self.peer])
        #except:
        #    pass
        gc_collect()
        print("WebSocket connection closed: %s"%( reason ))

if __name__ == '__main__':

    log.startLogging( stdout )

    factory = WebSocketServerFactory(URL%PORT, debug=DEBUG)
    factory.protocol = BackendServerProtocol
    factory.setProtocolOptions(maxConnections=MAX_CON)

    reactor.listenTCP( PORT, factory )
    reactor.run()


text:
package io.github.msurdi.redeye.api;

import org.junit.Test;

import java.util.Arrays;

import static org.junit.Assert.*;

public class EntryTest {

    @Test
    public void testValidId() {
        Entry entry = Entry.builder().id("id").build();
        assertNotEquals("", entry.getId());
        assertNotNull(entry.getId());
    }

    @Test
    public void testExisting() {
        Entry entry = Entry.builder().id("id").build();
        assertEquals("id", entry.getId());
    }

    @Test
    public void testValues() {
        Entry entry = Entry.builder().id("id").build();

        // Assert there are no values
        assertEquals(0, entry.getValues().size());

        entry.getValues().set("name1", "value1");
        assertEquals("value1", entry.getValues().get("name1"));

        assertEquals(null, entry.getValues().get("inexistent"));
    }

    @Test
    public void testDefault() {
        Entry entry = Entry.builder().id("id").build();
        entry.getValues().set("name1", "value1");
        entry.getValues().set("name2", "value2");
        String[] expected = "value1 value2".split(" ");
        String[] value = entry.getDefault().split(" ");
        Arrays.sort(expected);
        Arrays.sort(value);
        assertArrayEquals(expected, value);
    }

    @Test
    public void testEquals() {
        Entry entry1 = Entry.builder().id("id1").build();
        Entry entry2 = Entry.builder().id("id1").build();
        assertEquals(entry1, entry2);

        entry1.getValues().set("key1", "value1");
        entry2.getValues().set("key1", "value1");

        assertEquals(entry1, entry2);

        entry1.getValues().set("key1", "value3");
        assertNotEquals(entry1, entry2);
    }

}


text:
#include "Gwen/Controls/Slider.h"
#include "Gwen/Controls/HorizontalSlider.h"

using namespace Gwen;
using namespace Gwen::Controls;
using namespace Gwen::ControlsInternal;

GWEN_CONTROL_CONSTRUCTOR( HorizontalSlider )
{
	m_SliderBar->SetHorizontal( true );
}

float HorizontalSlider::CalculateValue()
{
	return  (float)m_SliderBar->X() / (float)( Width() - m_SliderBar->Width() );
}

void HorizontalSlider::UpdateBarFromValue()
{
	m_SliderBar->MoveTo( ( Width() - m_SliderBar->Width() ) * ( m_fValue ), m_SliderBar->Y() );
}

void HorizontalSlider::OnMouseClickLeft( int x, int y, bool bDown )
{
	m_SliderBar->MoveTo( CanvasPosToLocal( Gwen::Point( x, y ) ).x - m_SliderBar->Width() * 0.5,  m_SliderBar->Y() );
	m_SliderBar->OnMouseClickLeft( x, y, bDown );
	OnMoved( m_SliderBar );
}

void HorizontalSlider::Layout(Skin::Base* /*skin*/)
{
	m_SliderBar->SetSize( 15, Height() );
}

void HorizontalSlider::Render( Skin::Base* skin )
{
	skin->DrawSlider( this, true, m_bClampToNotches ? m_iNumNotches : 0, m_SliderBar->Width() );
}


text:
package management.cli;

import hydra.Log;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CountDownLatch;

import management.util.HydraUtil;

import com.gemstone.gemfire.management.cli.Result;
import com.gemstone.gemfire.management.internal.cli.CommandManager;
import com.gemstone.gemfire.management.internal.cli.result.CommandResult;
import com.gemstone.gemfire.management.internal.cli.shell.Gfsh;

/*-
 *
 * Sample class for demonstrating how to use TestableShell
 *
 */
public class TestCLI {

  private static void execCommand(String id, TestableGfsh shell, String command) throws IOException, ClassNotFoundException {

    Util.log(id + " : Executing command " + command);
    shell.addChars(command).addChars(";").newline();
    shell.waitForOutput();
    if(shell.hasError()){
      Util.log("Command failed with error " + shell.getError());
      System.exit(0);
    }else{
      Map completorOutput = shell.getCompletorOutput();
      Map commandOutput = shell.getCommandOutput();
      Util.debug(id + " : Command completorOutput for " + command + "--->" + completorOutput);
      Util.debug(id + " : Command outputText for " + command + "--->" + shell.getOutputText());
      Util.log(id + " : Command output for " + command + "--->" + commandOutput);
      Collection values = commandOutput.values();
      for(Object r : values){
    	  if(r instanceof CommandResult){
    		  CommandResult result = (CommandResult) r;
    		  Util.log(id + " : CommandResult  " + HydraUtil.ObjectToString(result));
    	  }else if(r instanceof Result){
    		  Result result = (Result)r;
    		  Util.log(id + " : result status " + result.getStatus());
    		  Util.log(id + " result in toString format " + result.toString());
    	  }
      }

    }
    shell.clearEvents();
  }

  private static void execCommandWithTestConnect(String id, TestableGfsh shell, String command) throws IOException, ClassNotFoundException{
	  execCommand(id,shell, "connect");
      boolean connected = shell.isConnectedAndReady();
      if(connected){
    	  execCommand(id,shell, command);
	      execCommand(id,shell, "disconnect");
	      connected = shell.isConnectedAndReady();
	      if(connected){
	    	  Util.error("Connect command failed to dis-connect to manager");
	    	  System.exit(0);
	      }
      }else{
    	  Util.error("Connect command failed to connect to manager");
    	  System.exit(0);
      }
  }

  public static class ShellThread implements Runnable{

	private TestableGfsh gfsh=null;
	private String commands[] =null;
	private int numIterations = 10;
	private String id=null;
	private CountDownLatch latch=null;

	public void setLatch(CountDownLatch latch) {
		this.latch = latch;
	}

	public void setNumIterations(int numIterations) {
		this.numIterations = numIterations;
	}

	public void setCommands(String[] commands) {
		this.commands = commands;
	}

	public void setTimeout(long t){
		gfsh.setTimeout(t);
	}

	public ShellThread(String id) throws ClassNotFoundException, IOException{
		this.id = id;
		String argss[] = {};
		gfsh= new TestableGfsh(id, true, argss);
		gfsh.start();
	}

	@Override
	public void run() {
		for (int i = 0; i < numIterations; i++) {
	      //if(i%100==0)
	    	  Util.error("Executing command number " + i);
	      String command = HydraUtil.getRandomElement(commands);
	      try {
			execCommandWithTestConnect(id,gfsh, command);
			latch.countDown();
			} catch (IOException e) {
				Util.error(e);
				System.exit(0);
			} catch (ClassNotFoundException e) {
				Util.error(e);
				System.exit(0);
			}
	    }
	    Util.log("Terminating shell - " + id);
	    gfsh.eof();
	    Util.log("Terminated shell - " + id);
	}
  }

  public static void main(String[] args) throws IOException, ClassNotFoundException {

	Log.createLogWriter( "test", args[0] );
    Gfsh.SUPPORT_MUTLIPLESHELL = true;
    TestableGfsh.setVirtualTerminal(false);
    Set set = CommandManager.getInstance().getCommands().keySet();
    Util.log("Total command loaded " + set.size());
    Util.log("Commands : " + HydraUtil.ObjectToString(set));

    // check-auto complete
    //execCommand("Shell1", shell, "\t");
    //execCommand("Shell2",shell2, "\t");

    /*-
     * Check timeouts with sleep command
    shell.setTimeout(15);
    execCommand("shell1", shell, "sleep");

    shell.setTimeout(5);
    Util.log("Expecting sleep timeout error");
    execCommand("shell1", shell, "sleep");
    Util.log("Completed sleep test");*/

    //execCommand("Shell1", shell, "connect");
    //execCommand("Shell2",shell2, "connect");

    int NUM_COMMANDS = Integer.parseInt(args[1]);
    int NUM_THREAD = Integer.parseInt(args[2]);

    Util.log("Starting with logLevel " +args[0] + " Threds " + NUM_THREAD + " iterations " + NUM_COMMANDS);

    CountDownLatch latch = new CountDownLatch(NUM_COMMANDS*NUM_THREAD);
    String commands[] = { "help", "history", "list member", "list region"};
    List<Thread> threads = new ArrayList<Thread>();
    for(int i=0;i<NUM_THREAD;i++){
    	ShellThread thread1 = new ShellThread("ShellThread"+i);
    	thread1.setCommands(commands);
        thread1.setLatch(latch);
        thread1.setNumIterations(NUM_COMMANDS);
        thread1.setTimeout(5);
        Thread t1 = new Thread(thread1);
        t1.setName("ShellThread-"+i);
        threads.add(t1);
    }

    for(Thread t : threads)
    	t.start();
    try {
		latch.await();
	} catch (InterruptedException e) {
		e.printStackTrace();
		Util.error(e);
	}
    /*-
    shell2.setTimeout(5);
    for (int i = 0; i < NUM_COMMANDS; i++) {
      if(i%10==0)
    	  Util.error("Executing command number " + i);
      String command = HydraUtil.getRandomElement(commands);
      execCommandWithTestConnect("Shell2",shell2, command);
      execCommandWithTestConnect("Shell1",shell, command);
    }*/
  }

}


text:
document.addEventListener('DOMContentLoaded', function() {
	document.removeEventListener('DOMContentLoaded', arguments.callee, false);
	init();
}, false );

function init() {
	_gaq.push(['_trackPageview']);

	chrome.extension.sendMessage({ message: "getAbbreviation" }, function(response) {
		console.log(response);
		if (response) {
			document.getElementById('abbreviation').value = response.abbreviation;
		}
	});

	function onAbbreviationEvent() {
		var value = document.getElementById('abbreviation').value;
		var abbreviation = makeAbbreviation(document.getElementById('abbreviation').value);

		if (value != abbreviation) {
			document.getElementById('abbreviation').value = abbreviation;
		}

		if (abbreviation == '') {
			document.getElementById('rename-btn').setAttribute('disabled', 'disabled');
		} else {
			document.getElementById('rename-btn').removeAttribute('disabled');
		}
	}

	document.getElementById('abbreviation').addEventListener("propertychange", onAbbreviationEvent);
	document.getElementById('abbreviation').addEventListener("keyup", onAbbreviationEvent);
	document.getElementById('abbreviation').addEventListener("input", onAbbreviationEvent);
	document.getElementById('abbreviation').addEventListener("paste", onAbbreviationEvent);

	document.getElementById('form').onsubmit = function() {
		return false;
	}

	document.getElementById('rename-btn').onclick = function() {
		_gaq.push(['_trackEvent', 'Popup Rename Button', 'clicked']);

		chrome.extension.sendMessage({ message: "setAbbreviation", abbreviation: document.getElementById('abbreviation').value }, function(response) {
			sendMessageToExtensionTabs("refresh");
			window.close();
		});

		return false;
	}

	document.getElementById('remove-btn').onclick = function() {
		_gaq.push(['_trackEvent', 'Popup Delete Button', 'clicked']);

		chrome.extension.sendMessage({ message: "delete" }, function(response) {
			sendMessageToExtensionTabs("refresh");
			window.close();
		});

		return false;
	}
}


text:
DIR_LIST=`find . -type d -name vendor`

# Remove directories used for versioning
find $DIR_LIST -type d -name ".bzr" -o -name ".git" -exec rm -rf {} \;

## Removing all yaml files which are normally config files (travis.yml)
find $DIR_LIST -type f -name "*.yml" -exec rm -r {} \;

## Removing all golang test files
find $DIR_LIST -type f -name "*_test.go" -exec rm -r {} \;

## Removing all files starting with a dot (like .gitignore)
find $DIR_LIST -type f -name ".*" -exec rm -r {} \;

## Removing all .txt files which are normally test data or docs
## Excluding files mentioned above as e.x. nranchev/go-libGeoIP has the license in a .txt file
find $DIR_LIST -type f -name "*.txt" -a ! \( -iname "LICENSE.*" -o -iname "CHANGELOG.*" -o -iname "PATENT.*" -o -iname "CONTRIBUTORS.*" -o -iname "README.*" \) -exec rm -r {} \;

## Removing all *.cfg files
find $DIR_LIST -type f -name "*.cfg" -exec rm -r {} \;

## Removing all *.bat files
find $DIR_LIST -type f -name "*.bat" -exec rm -r {} \;


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Front extends CI_Controller
{

    public function index()
    {
        $this->home_view();
    }

    public function home_view()
    {
        $this->load->model('Mdl_admin');
        $data['vw_home_front'] = 'vw_home_front';
        $data['msg'] = '';
        $data['settings'] = $this->Mdl_admin->load_settings();
        $data['slideshow'] = $this->Mdl_admin->load_slide();
        $data['home'] = $this->Mdl_admin->load_home();
        $data['supply'] = $this->Mdl_admin->load_supply();

        $this->load->view('vw_front',$data);
    }
    public function story_view()
    {
        $this->load->model('Mdl_admin');
        $data['vw_pages_front'] = 'vw_pages_front';
        $data['msg'] = '';
        $data['settings'] = $this->Mdl_admin->load_settings();
        $data['pages'] = $this->Mdl_admin->load_pages("Our Story");
        $data['supply'] = $this->Mdl_admin->load_supply();

        $this->load->view('vw_front',$data);
    }
    public function team_view()
    {
        $this->load->model('Mdl_admin');
        $data['vw_pages_front'] = 'vw_pages_front';
        $data['msg'] = '';
        $data['settings'] = $this->Mdl_admin->load_settings();
        $data['pages'] = $this->Mdl_admin->load_pages("Our Team");
        $data['supply'] = $this->Mdl_admin->load_supply();

        $this->load->view('vw_front',$data);
    }
    public function technology_view()
    {
        $this->load->model('Mdl_admin');
        $data['vw_pages_front'] = 'vw_pages_front';
        $data['msg'] = '';
        $data['settings'] = $this->Mdl_admin->load_settings();
        $data['pages'] = $this->Mdl_admin->load_pages("Technology");
        $data['supply'] = $this->Mdl_admin->load_supply();

        $this->load->view('vw_front',$data);
    }
    public function supply_view()
    {
        $this->load->model('Mdl_admin');
        $data['vw_supply_front'] = 'vw_supply_front';
        $data['msg'] = '';
        $data['settings'] = $this->Mdl_admin->load_settings();
        $data['slideshow'] = $this->Mdl_admin->load_slide();
        $data['supply'] = $this->Mdl_admin->load_supply();

        $this->load->view('vw_front',$data);
    }
    public function services_view()
    {
        $this->load->model('Mdl_admin');
        $data['vw_services_front'] = 'vw_services_front';
        $data['msg'] = '';
        $data['settings'] = $this->Mdl_admin->load_settings();
        $data['slideshow'] = $this->Mdl_admin->load_slide();
        $data['services'] = $this->Mdl_admin->load_services();
        $data['supply'] = $this->Mdl_admin->load_supply();

        $this->load->view('vw_front',$data);
    }
    public function customer_view()
    {
        $this->load->model('Mdl_admin');
        $data['vw_customer_front'] = 'vw_customer_front';
        $data['msg'] = '';
        $data['settings'] = $this->Mdl_admin->load_settings();
        $data['slideshow'] = $this->Mdl_admin->load_slide();
        $data['customer'] = $this->Mdl_admin->load_customer();
        $data['supply'] = $this->Mdl_admin->load_supply();

        $this->load->view('vw_front',$data);
    }
    public function contact_us()
    {
        $this->load->model('Mdl_admin');
        $data['vw_contact'] = 'vw_contact';
        $data['msg'] = '';
        $data['settings'] = $this->Mdl_admin->load_settings();
        $data['slideshow'] = $this->Mdl_admin->load_slide();
        $data['customer'] = $this->Mdl_admin->load_customer();
        $data['supply'] = $this->Mdl_admin->load_supply();

        $this->load->view('vw_front',$data);
    }
    public function send_message()
    {

        $this->load->model('Mdl_admin');
        $data['vw_contact'] = 'vw_contact';
        $data['supply'] = $this->Mdl_admin->load_supply();
        $data['settings'] = $this->Mdl_admin->load_settings();

        $result = $this->Mdl_admin->message();
        if($result==1)
        {
            $data['msg'] = 'Thank you for your message!!';
            $data['msg_type'] = 'success';
        }
        else
        {
            $data['msg'] = 'Sorry!! There Was a problem while sending your message.Try Again!!';
            $data['msg_type'] = 'danger';
        }

        $this->load->view('vw_front',$data);
    }
}


text:
package io.trigger.forge.android.modules.tcp.util;

import java.io.UnsupportedEncodingException;

public class Util {

	public static String byteArrayToString(byte[] byteArray, int length, String charset)
			throws UnsupportedEncodingException {
		byte[] receivedCorrect = new byte[length];

		for (int i = 0; i < length; i++) {
			receivedCorrect[i] = byteArray[i];
		}

		return new String(receivedCorrect, charset);
	}

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">

<title>
  Class global.AttrOperator
</title>

All Packages  Class Hierarchy  This Package  Previous  Next  Index

  Class global.AttrOperator

java.lang.Object
   |
   +----global.AttrOperator

 public class AttrOperator

 extends Object

Enumeration class for AttrOperator

	aopEQ

	aopGE

	aopGT

	aopLE

	aopLT

	aopNE

	aopNOP

	aopNOT

	attrOperator

	opRANGE

	AttrOperator(int)

 AttrOperator Constructor

 An attribute operator types can be defined as

   AttrOperator attrOperator = new AttrOperator(AttrOperator.aopEQ);

 and subsequently used as

   if (attrOperator.attrOperator == AttrOperator.aopEQ) ....

	toString()

aopEQ

 public static final int aopEQ

aopLT

 public static final int aopLT

aopGT

 public static final int aopGT

aopNE

 public static final int aopNE

aopLE

 public static final int aopLE

aopGE

 public static final int aopGE

aopNOT

 public static final int aopNOT

aopNOP

 public static final int aopNOP

opRANGE

 public static final int opRANGE

attrOperator

 public int attrOperator

AttrOperator

 public AttrOperator(int _attrOperator)

 AttrOperator Constructor

 An attribute operator types can be defined as

   AttrOperator attrOperator = new AttrOperator(AttrOperator.aopEQ);

 and subsequently used as

   if (attrOperator.attrOperator == AttrOperator.aopEQ) ....

 Parameters:

 _attrOperator - The available attribute operators

toString

 public String toString()

 Overrides:

 toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index


text:
<!DOCTYPE html>

	<title> correctness:   JSON.stringify() replacer returning a date object  </title>

FAILED (This TC requires JavaScript enabled)


text:
generate TXT file for submission at
http://xml2rfc.ietf.org/

Check a draft for nits at:
https://tools.ietf.org/tools/idnits/

Internet-Draft submission at
https://datatracker.ietf.org/submit/


text:
<?xml version='1.0' encoding='UTF-8'?>
<hudson.tasks.Mailer_-DescriptorImpl plugin="mailer@1.13">
  <hudsonUrl>http://10.130.28.78:8008/</hudsonUrl>
  <useSsl>false</useSsl>
  <charset>UTF-8</charset>
</hudson.tasks.Mailer_-DescriptorImpl>


text:
<title>Target Commands - Debugging with GDB</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Debugging with GDB">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Targets.html#Targets" title="Targets">
<link rel="prev" href="Active-Targets.html#Active-Targets" title="Active Targets">
<link rel="next" href="Byte-Order.html#Byte-Order" title="Byte Order">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">

<meta http-equiv="Content-Style-Type" content="text/css">

Next: Byte Order,
Previous: Active Targets,
Up: Targets

19.2 Commands for Managing Targets

target <var>type</var> <var>parameters</var>
Connects the gdb host environment to a target machine or
process.  A target is typically a protocol for talking to debugging
facilities.  You use the argument <var>type</var> to specify the type or
protocol of the target machine.

Further <var>parameters</var> are interpreted by the target protocol, but
typically include things like device names or host names to connect
with, process numbers, and baud rates.

The target command does not repeat if you press <RET> again
after executing the command.

help target
Displays the names of all targets available.  To display targets
currently selected, use either info target or info files
(see Commands to Specify Files).

help target <var>name</var>
Describe a particular target, including any parameters necessary to
select it.

set gnutarget <var>args</var>
gdb uses its own library BFD to read your files.  gdb
knows whether it is reading an <dfn>executable</dfn>,
a <dfn>core</dfn>, or a <dfn>.o</dfn> file; however, you can specify the file format
with the set gnutarget command.  Unlike most target commands,
with gnutarget the target refers to a program, not a machine.

Warning: To specify a file format with set gnutarget,
you must know the actual BFD name.

See Commands to Specify Files.

show gnutarget
Use the show gnutarget command to display what file format
gnutarget is set to read.  If you have not set gnutarget,
gdb will determine the file format for each file automatically,
and show gnutarget displays ‘<samp>The current BFD target is "auto"</samp>’.

Here are some common targets (available, or not, depending on the GDB
configuration):

target exec <var>program</var>
An executable file.  ‘<samp>target exec <var>program</var></samp>’ is the same as
‘<samp>exec-file <var>program</var></samp>’.

target core <var>filename</var>
A core dump file.  ‘<samp>target core <var>filename</var></samp>’ is the same as
‘<samp>core-file <var>filename</var></samp>’.

target remote <var>medium</var>
A remote system connected to gdb via a serial line or network
connection.  This command tells gdb to use its own remote
protocol over <var>medium</var> for debugging.  See Remote Debugging.

For example, if you have a board connected to <samp>/dev/ttya</samp> on the
machine running gdb, you could say:

          target remote /dev/ttya

target remote supports the load command.  This is only
useful if you have some other way of getting the stub to the target
system, and you can put it somewhere in memory where it won't get
clobbered by the download.

target sim [<var>simargs</var>] ...
Builtin CPU simulator.  gdb includes simulators for most architectures.
In general,

                  target sim
                  load
                  run

works; however, you cannot assume that a specific memory map, device
drivers, or even basic I/O is available, although some simulators do
provide these.  For info about any processor-specific simulator details,
see the appropriate section in Embedded Processors.

Some configurations may include these targets as well:

target nrom <var>dev</var>
NetROM ROM emulator.  This target only supports downloading.

Different targets are available on different configurations of gdb;
your configuration may have more or fewer targets.

Many remote targets require you to download the executable's code once
you've successfully established a connection.  You may wish to control
various aspects of this process.

set hash
This command controls whether a hash mark ‘<samp>#</samp>’ is displayed while
downloading a file to the remote monitor.  If on, a hash mark is
displayed after each S-record is successfully downloaded to the
monitor.

show hash
Show the current status of displaying the hash mark.

set debug monitor
Enable or disable display of communications messages between
gdb and the remote monitor.

show debug monitor
Show the current status of displaying communications between
gdb and the remote monitor.

load <var>filename</var>
Depending on what remote debugging facilities are configured into
gdb, the load command may be available.  Where it exists, it
is meant to make <var>filename</var> (an executable) available for debugging
on the remote system—by downloading, or dynamic linking, for example.
load also records the <var>filename</var> symbol table in gdb, like
the add-symbol-file command.

If your gdb does not have a load command, attempting to
execute it gets the error message “You can't do that when your
target is ...”

The file is loaded at whatever address is specified in the executable.
For some object file formats, you can specify the load address when you
link the program; for other formats, like a.out, the object file format
specifies a fixed address.

Depending on the remote side capabilities, gdb may be able to
load programs into flash memory.

load does not repeat if you press <RET> again after using it.