text:
import frappe
import json
from frappe import _
from frappe.boot import get_allowed_pages, get_allowed_reports
from frappe.desk.doctype.desktop_icon.desktop_icon import set_hidden, clear_desktop_icons_cache
from frappe.cache_manager import build_domain_restriced_doctype_cache, build_domain_restriced_page_cache, build_table_count_cache

@frappe.whitelist()
def get(module):
	"""Returns data (sections, list of reports, counts) to render module view in desk:
	`/desk/#Module/[name]`."""
	data = get_data(module)

	out = {
		"data": data
	}

	return out

@frappe.whitelist()
def hide_module(module):
	set_hidden(module, frappe.session.user, 1)
	clear_desktop_icons_cache()

def get_table_with_counts():
	counts = frappe.cache().get_value("information_schema:counts")
	if counts:
		return counts
	else:
		return build_table_count_cache()

def get_data(module, build=True):
	"""Get module data for the module view `desk/#Module/[name]`"""
	doctype_info = get_doctype_info(module)
	data = build_config_from_file(module)

	if not data:
		data = build_standard_config(module, doctype_info)
	else:
		add_custom_doctypes(data, doctype_info)

	add_section(data, _("Custom Reports"), "fa fa-list-alt",
		get_report_list(module))

	data = combine_common_sections(data)
	data = apply_permissions(data)

	# set_last_modified(data)

	if build:
		exists_cache = get_table_with_counts()
		def doctype_contains_a_record(name):
			exists = exists_cache.get(name)
			if not exists:
				if not frappe.db.get_value('DocType', name, 'issingle'):
					exists = frappe.db.count(name)
				else:
					exists = True
				exists_cache[name] = exists
			return exists

		for section in data:
			for item in section["items"]:
				# Onboarding

				# First disable based on exists of depends_on list
				doctype = item.get("doctype")
				dependencies = item.get("dependencies") or None
				if not dependencies and doctype:
					item["dependencies"] = [doctype]

				dependencies = item.get("dependencies")
				if dependencies:
					incomplete_dependencies = [d for d in dependencies if not doctype_contains_a_record(d)]
					if len(incomplete_dependencies):
						item["incomplete_dependencies"] = incomplete_dependencies

				if item.get("onboard"):
					# Mark Spotlights for initial
					if item.get("type") == "doctype":
						name = item.get("name")
						count = doctype_contains_a_record(name)

						item["count"] = count

	return data

def build_config_from_file(module):
	"""Build module info from `app/config/desktop.py` files."""
	data = []
	module = frappe.scrub(module)

	for app in frappe.get_installed_apps():
		try:
			data += get_config(app, module)
		except ImportError:
			pass

	return filter_by_restrict_to_domain(data)

def filter_by_restrict_to_domain(data):
	""" filter Pages and DocType depending on the Active Module(s) """
	doctypes = frappe.cache().get_value("domain_restricted_doctypes") or build_domain_restriced_doctype_cache()
	pages = frappe.cache().get_value("domain_restricted_pages") or build_domain_restriced_page_cache()

	for d in data:
		_items = []
		for item in d.get("items", []):

			item_type = item.get("type")
			item_name = item.get("name")

			if (item_name in pages) or (item_name in doctypes) or item_type == 'report':
				_items.append(item)

		d.update({ "items": _items })

	return data

def build_standard_config(module, doctype_info):
	"""Build standard module data from DocTypes."""
	if not frappe.db.get_value("Module Def", module):
		frappe.throw(_("Module Not Found"))

	data = []

	add_section(data, _("Documents"), "fa fa-star",
		[d for d in doctype_info if d.document_type in ("Document", "Transaction")])

	add_section(data, _("Setup"), "fa fa-cog",
		[d for d in doctype_info if d.document_type in ("Master", "Setup", "")])

	add_section(data, _("Standard Reports"), "fa fa-list",
		get_report_list(module, is_standard="Yes"))

	return data

def add_section(data, label, icon, items):
	"""Adds a section to the module data."""
	if not items: return
	data.append({
		"label": label,
		"icon": icon,
		"items": items
	})

def add_custom_doctypes(data, doctype_info):
	"""Adds Custom DocTypes to modules setup via `config/desktop.py`."""
	add_section(data, _("Documents"), "fa fa-star",
		[d for d in doctype_info if (d.custom and d.document_type in ("Document", "Transaction"))])

	add_section(data, _("Setup"), "fa fa-cog",
		[d for d in doctype_info if (d.custom and d.document_type in ("Setup", "Master", ""))])

def get_doctype_info(module):
	"""Returns list of non child DocTypes for given module."""
	active_domains = frappe.get_active_domains()

	doctype_info = frappe.get_all("DocType", filters={
		"module": module,
		"istable": 0
	}, or_filters={
		"ifnull(restrict_to_domain, '')": "",
		"restrict_to_domain": ("in", active_domains)
	}, fields=["'doctype' as type", "name", "description", "document_type",
		"custom", "issingle"], order_by="custom asc, document_type desc, name asc")

	for d in doctype_info:
		d.document_type = d.document_type or ""
		d.description = _(d.description or "")

	return doctype_info

def combine_common_sections(data):
	"""Combine sections declared in separate apps."""
	sections = []
	sections_dict = {}
	for each in data:
		if each["label"] not in sections_dict:
			sections_dict[each["label"]] = each
			sections.append(each)
		else:
			sections_dict[each["label"]]["items"] += each["items"]

	return sections

def apply_permissions(data):
	default_country = frappe.db.get_default("country")

	user = frappe.get_user()
	user.build_permissions()

	allowed_pages = get_allowed_pages()
	allowed_reports = get_allowed_reports()

	new_data = []
	for section in data:
		new_items = []

		for item in (section.get("items") or []):
			item = frappe._dict(item)

			if item.country and item.country!=default_country:
				continue

			if ((item.type=="doctype" and item.name in user.can_read)
				or (item.type=="page" and item.name in allowed_pages)
				or (item.type=="report" and item.name in allowed_reports)
				or item.type=="help"):

				new_items.append(item)

		if new_items:
			new_section = section.copy()
			new_section["items"] = new_items
			new_data.append(new_section)

	return new_data

def get_disabled_reports():
	if not hasattr(frappe.local, "disabled_reports"):
		frappe.local.disabled_reports = set(r.name for r in frappe.get_all("Report", {"disabled": 1}))
	return frappe.local.disabled_reports

def get_config(app, module):
	"""Load module info from `[app].config.[module]`."""
	config = frappe.get_module("{app}.config.{module}".format(app=app, module=module))
	config = config.get_data()

	sections = [s for s in config if s.get("condition", True)]

	disabled_reports = get_disabled_reports()
	for section in sections:
		items = []
		for item in section["items"]:
			if item["type"]=="report" and item["name"] in disabled_reports:
				continue
			# some module links might not have name
			if not item.get("name"):
				item["name"] = item.get("label")
			if not item.get("label"):
				item["label"] = _(item.get("name"))
			items.append(item)
		section['items'] = items

	return sections

def config_exists(app, module):
	try:
		frappe.get_module("{app}.config.{module}".format(app=app, module=module))
		return True
	except ImportError:
		return False

def add_setup_section(config, app, module, label, icon):
	"""Add common sections to `/desk#Module/Setup`"""
	try:
		setup_section = get_setup_section(app, module, label, icon)
		if setup_section:
			config.append(setup_section)
	except ImportError:
		pass

def get_setup_section(app, module, label, icon):
	"""Get the setup section from each module (for global Setup page)."""
	config = get_config(app, module)
	for section in config:
		if section.get("label")==_("Setup"):
			return {
				"label": label,
				"icon": icon,
				"items": section["items"]
			}

def get_onboard_items(app, module):
	try:
		sections = get_config(app, module)
	except ImportError:
		return []

	onboard_items = []
	fallback_items = []

	if not sections:
		doctype_info = get_doctype_info(module)
		sections = build_standard_config(module, doctype_info)

	for section in sections:
		for item in section["items"]:
			if item.get("onboard", 0) == 1:
				onboard_items.append(item)

			# in case onboard is not set
			fallback_items.append(item)

			if len(onboard_items) > 5:
				return onboard_items

	return onboard_items or fallback_items

@frappe.whitelist()
def get_links_for_module(app, module):
	return [{'value': l.get('name'), 'label': l.get('label')} for l in get_links(app, module)]

def get_links(app, module):
	try:
		sections = get_config(app, frappe.scrub(module))
	except ImportError:
		return []

	links = []
	for section in sections:
		for item in section['items']:
			links.append(item)
	return links

@frappe.whitelist()
def get_desktop_settings():
	from frappe.config import get_modules_from_all_apps_for_user
	all_modules = get_modules_from_all_apps_for_user()
	home_settings = get_home_settings()

	modules_by_name = {}
	for m in all_modules:
		modules_by_name[m['module_name']] = m

	module_categories = ['Modules', 'Domains', 'Places', 'Administration']
	user_modules_by_category = {}

	user_saved_modules_by_category = home_settings.modules_by_category or {}
	user_saved_links_by_module = home_settings.links_by_module or {}

	def apply_user_saved_links(module):
		module = frappe._dict(module)
		all_links = get_links(module.app, module.module_name)
		module_links_by_name = {}
		for link in all_links:
			module_links_by_name[link['name']] = link

		if module.module_name in user_saved_links_by_module:
			user_links = frappe.parse_json(user_saved_links_by_module[module.module_name])
			module.links = [module_links_by_name[l] for l in user_links if l in module_links_by_name]

		return module

	for category in module_categories:
		if category in user_saved_modules_by_category:
			user_modules = user_saved_modules_by_category[category]
			user_modules_by_category[category] = [apply_user_saved_links(modules_by_name[m]) \
				for m in user_modules if modules_by_name.get(m)]
		else:
			user_modules_by_category[category] = [apply_user_saved_links(m) \
				for m in all_modules if m.get('category') == category]

	# filter out hidden modules
	if home_settings.hidden_modules:
		for category in user_modules_by_category:
			hidden_modules = home_settings.hidden_modules or []
			modules = user_modules_by_category[category]
			user_modules_by_category[category] = [module for module in modules if module.module_name not in hidden_modules]

	return user_modules_by_category

@frappe.whitelist()
def update_hidden_modules(category_map):
	category_map = frappe.parse_json(category_map)
	home_settings = get_home_settings()

	saved_hidden_modules = home_settings.hidden_modules or []

	for category in category_map:
		config = frappe._dict(category_map[category])
		saved_hidden_modules += config.removed or []
		saved_hidden_modules = [d for d in saved_hidden_modules if d not in (config.added or [])]

		if home_settings.get('modules_by_category') and home_settings.modules_by_category.get(category):
			module_placement = [d for d in (config.added or []) if d not in home_settings.modules_by_category[category]]
			home_settings.modules_by_category[category] += module_placement

	home_settings.hidden_modules = saved_hidden_modules
	set_home_settings(home_settings)

	return get_desktop_settings()

@frappe.whitelist()
def update_global_hidden_modules(modules):
	modules = frappe.parse_json(modules)
	frappe.only_for('System Manager')

	doc = frappe.get_doc('User', 'Administrator')
	doc.set('block_modules', [])
	for module in modules:
		doc.append('block_modules', {
			'module': module
		})

	doc.save(ignore_permissions=True)

	return get_desktop_settings()

@frappe.whitelist()
def update_modules_order(module_category, modules):
	modules = frappe.parse_json(modules)
	home_settings = get_home_settings()

	home_settings.modules_by_category = home_settings.modules_by_category or {}
	home_settings.modules_by_category[module_category] = modules

	set_home_settings(home_settings)

@frappe.whitelist()
def update_links_for_module(module_name, links):
	links = frappe.parse_json(links)
	home_settings = get_home_settings()

	home_settings.setdefault('links_by_module', {})
	home_settings['links_by_module'].setdefault(module_name, None)
	home_settings['links_by_module'][module_name] = links

	set_home_settings(home_settings)

	return get_desktop_settings()

@frappe.whitelist()
def get_options_for_show_hide_cards():
	global_options = []

	if 'System Manager' in frappe.get_roles():
		global_options = get_options_for_global_modules()

	return {
		'user_options': get_options_for_user_blocked_modules(),
		'global_options': global_options
	}

@frappe.whitelist()
def get_options_for_global_modules():
	from frappe.config import get_modules_from_all_apps
	all_modules = get_modules_from_all_apps()

	blocked_modules = frappe.get_doc('User', 'Administrator').get_blocked_modules()

	options = []
	for module in all_modules:
		module = frappe._dict(module)
		options.append({
			'category': module.category,
			'label': module.label,
			'value': module.module_name,
			'checked': module.module_name not in blocked_modules
		})

	return options

@frappe.whitelist()
def get_options_for_user_blocked_modules():
	from frappe.config import get_modules_from_all_apps_for_user
	all_modules = get_modules_from_all_apps_for_user()
	home_settings = get_home_settings()

	hidden_modules = home_settings.hidden_modules or []

	options = []
	for module in all_modules:
		module = frappe._dict(module)
		options.append({
			'category': module.category,
			'label': module.label,
			'value': module.module_name,
			'checked': module.module_name not in hidden_modules
		})

	return options

def set_home_settings(home_settings):
	frappe.cache().hset('home_settings', frappe.session.user, home_settings)
	frappe.db.set_value('User', frappe.session.user, 'home_settings', json.dumps(home_settings))

@frappe.whitelist()
def get_home_settings():
	def get_from_db():
		settings = frappe.db.get_value("User", frappe.session.user, 'home_settings')
		return frappe.parse_json(settings or '{}')

	home_settings = frappe.cache().hget('home_settings', frappe.session.user, get_from_db)
	return home_settings

def get_module_link_items_from_list(app, module, list_of_link_names):
	try:
		sections = get_config(app, frappe.scrub(module))
	except ImportError:
		return []

	links = []
	for section in sections:
		for item in section["items"]:
			if item.get("label", "") in list_of_link_names:
				links.append(item)

	return links

def set_last_modified(data):
	for section in data:
		for item in section["items"]:
			if item["type"] == "doctype":
				item["last_modified"] = get_last_modified(item["name"])

def get_last_modified(doctype):
	def _get():
		try:
			last_modified = frappe.get_all(doctype, fields=["max(modified)"], as_list=True, limit_page_length=1)[0][0]
		except Exception as e:
			if frappe.db.is_table_missing(e):
				last_modified = None
			else:
				raise

		# hack: save as -1 so that it is cached
		if last_modified is None:
			last_modified = -1

		return last_modified

	last_modified = frappe.cache().hget("last_modified", doctype, _get)

	if last_modified==-1:
		last_modified = None

	return last_modified

def get_report_list(module, is_standard="No"):
	"""Returns list on new style reports for modules."""
	reports =  frappe.get_list("Report", fields=["name", "ref_doctype", "report_type"], filters=
		{"is_standard": is_standard, "disabled": 0, "module": module},
		order_by="name")

	out = []
	for r in reports:
		out.append({
			"type": "report",
			"doctype": r.ref_doctype,
			"is_query_report": 1 if r.report_type in ("Query Report", "Script Report", "Custom Report") else 0,
			"label": _(r.name),
			"name": r.name
		})

	return out


text:
<?php

namespace Deploy\Service;

use ZfcUser\Mapper\User as UserMapper;

class UserService
{
    /**
     * @var \ZfcUser\Mapper\User
     */
    protected $userMapper;

    public function __construct(UserMapper $userMapper)
    {
        $this->userMapper = $userMapper;
    }

    /**
     * Find a user
     *
     * @param int $id
     * @return \ZfcUser\Entity\User
     */
    public function findById($id)
    {
        return $this->userMapper->findById($id);
    }
}

redpajama_set_name: RedPajamaGithub


text:
Editing Balance

<?php echo render('balance/_form'); ?>

	<?php echo Html::anchor('balance/view/'.$balance->id, 'View'); ?> |
	<?php echo Html::anchor('balance', 'Back'); ?>


text:
title: CheckBox
---
Multi-selection controls

## Examples

```jsx
<CheckBox text="CheckBox" />
```

## States

### Disabled

```jsx
<CheckBox text="CheckBox" disabled />
```

### Checked

```jsx
<CheckBox text="CheckBox" checked />
```

## API

### Props

Name | Description | Type | Optional value | Default
--- | --- | --- | --- | ---
`children` | - | string, element | - | -
`text` | - | string | - | Empty string ('')
`textStyle` | - | style | - | -
`disabled` | - | bool | - | `false`
`checked` | - | bool | - | `false`

### Events

Name | Description
--- | ---
`onCheckedChange` | -


text:
describe('S3Service', function(){
	var S3Service, $rootScope, $q, $httpBackend;
	var mockFile = {file:[{"name":"file.bin", "size":1024, "type":"application/binary"}]};
	var mockVideo = {file:[{"name":"testFile.mp4", "size":1024, "type":"video/mp4"}]};

    beforeEach(angular.mock.module('adminUI'));

    beforeEach(inject(function($injector) {
		$rootScope = $injector.get('$rootScope');
		$q = $injector.get('$q');
		$httpBackend = $injector.get('$httpBackend');
        createService = function($httpBackend, $rootScope, $q) {
            return $injector.get('S3Service');
        }
    }));

	describe('SetBucket Test', function() {
		beforeEach((function(){
			S3Service = createService($httpBackend, $rootScope, $q);
		}));

        it('should exist', function() {
            expect(S3Service.setBucket).toBeDefined();
		});

		it('should make the bucket defined', function() {
			expect(S3Service.bucket).toBeNull();
			spyOn(S3Service, 'setBucket').and.callThrough();
			S3Service.setBucket(mockFile);
			expect(S3Service.setBucket).toHaveBeenCalled();
			expect(S3Service.bucket).toBeDefined();
		});
	});

	describe('Upload Test', function() {

		beforeEach((function(){
			S3Service = createService($httpBackend, $rootScope, $q);
		}));

		it('should let notify the user that upload has started', function() {
			var mockBucket = { putObject: function (param, callback) {
												callback(false, "Ok");
												return mockBucket;
											},
								 on: function(eventname, callback) {
										return mockBucket;
									}
			};
			spyOn(toastr, "info");
			spyOn(mockBucket, "putObject").and.callThrough();
			spyOn(mockBucket, "on");
			S3Service.upload(mockVideo, mockBucket);

			expect(mockBucket.putObject).toHaveBeenCalled();
			expect(mockBucket.on).toHaveBeenCalled();
			expect(S3Service.bucket).toBe(mockBucket);
			expect(toastr.info).toHaveBeenCalled();

		});

		it('should return rejected promise', function(done) {
			var rejected;
			var promise;
			var mockBucket = { putObject: function (param, callback) {
												var err = {message: "OK", code: 123};
												callback(err, null);
												return mockBucket;
											},
								 on: function(eventname, callback) {
										return mockBucket;
									}
			};
			spyOn(mockBucket, "putObject").and.callThrough();
			spyOn(mockBucket, "on");
			promise = S3Service.upload(mockVideo, mockBucket);
			promise.then(function(result) {
				rejected = "NotOK";
			}, function(error) {
				rejected = error.message;
			})
			$rootScope.$digest();
			done();
			expect(rejected).toBe("OK");
		});

		it('should return resolved promise', function(done) {
			S3Service = createService($httpBackend, $rootScope, $q);
			var resolved;
			var promise;
			var mockBucket = { putObject: function(param, callback) {
									var data = {message: "OK", code: 123};
									callback(false, data);
									return mockBucket;
								},
								 on: function(eventname, callback) {
										return mockBucket;
									}
			};
			spyOn(mockBucket, "putObject").and.callThrough();
			spyOn(mockBucket, "on");
			promise = S3Service.upload(mockVideo, mockBucket)
			promise.then(function(result) {
				resolved = result.message;
			}, function(error) {
				resolved = "NotOK";
			})
			$rootScope.$digest();
			done();
			expect(resolved).toBe("OK");

		});

		it('should broadcast progress', function() {
			spyOn($rootScope, '$broadcast');
			var mockBucket = { putObject: function (param, callback) {
									return S3Service.bucket;
								},
								 on: function(eventname, callback) {
										var progress = {loaded: 100, total: 100};
										callback(progress);
										return progress;
									}
			};
			var result = S3Service.upload(mockVideo, mockBucket);
			spyOn(mockBucket, 'putObject').and.callThrough();
			spyOn(mockBucket, 'on').and.callThrough();
			expect($rootScope.$broadcast).toHaveBeenCalledWith('progressEvent', {loaded: 100, total: 100});
		});

		it('Satisfy coverall else branch', function() {
			spyOn($rootScope, '$broadcast');
			var mockBucket = { putObject: function (param, callback) {
									return S3Service.bucket;
								},
								 on: function(eventname, callback) {
										var progress = {loaded: 0, total: 100};
										callback(progress);
										return progress;
									}
			};
			var result = S3Service.upload(mockVideo, mockBucket);
			spyOn(mockBucket, 'putObject').and.callThrough();
			spyOn(mockBucket, 'on').and.callThrough();
			expect($rootScope.$broadcast).toHaveBeenCalledWith('progressEvent', {loaded: 0, total: 100});
		});
	});

	describe('getItemsInBucket() tests', function() {
		beforeEach((function(){
			S3Service = createService($httpBackend, $rootScope, $q);
		}));

		it('should return rejected promise', function(done) {
			var promise;
			var rejected;
			var mockBucket = { listObjects: function(param, callback) {
									var err = {message: "OK", code: 123};
									callback(err, null);
									return mockBucket;
								}
			};
			spyOn(mockBucket, "listObjects").and.callThrough();
			promise = S3Service.getItemsInBucket(null, mockBucket); // Not sure what S3Objects in param is for
			promise.then(function(result) {
				rejected = "NotOK";
			}, function(err) {
				rejected = err.message;
			})
			$rootScope.$digest();
			done();
			expect(rejected).toBe("OK");
		});
		it('toastr error method should have been called', function(done) {
			var promise;
			var resolved;
			var mockBucket = { listObjects: function(param, callback) {
									var data = {message: "OK", code: 123,
												Contents: [{length: 1, Key: "123", ETag: 123}]
												};
									callback(null, data);
									return mockBucket;
								},
								getSignedUrl: function(type, target, callback) {
									var err = "OK"
									callback(err, null);
								}
			};
			spyOn(toastr, "error");
			spyOn(mockBucket, "getSignedUrl").and.callThrough();
			spyOn(mockBucket, "listObjects").and.callThrough();
			promise = S3Service.getItemsInBucket(null, mockBucket); // Not sure what S3Objects in param is for
			expect(mockBucket.getSignedUrl).toHaveBeenCalled();
			promise.then(function(result) {
				resolved = result;
			}, function(err) {
				resolved = "NotOk";
			})
			$rootScope.$digest();
			done();
			expect(resolved.length).toBe(0);
			expect(toastr.error).toHaveBeenCalled();
		});
		it('should return resolved promise with the item to return', function(done){
			var promise;
			var resolved;
			var mockContent = [{length: 1, Key: "123", ETag: "123", LastModified : "Now"}];
			var mockUrl = "mockUrl";
			var mockBucket = { 	listObjects: function(param, callback) {
												var data = {message: "OK", code: 123,
														Contents: mockContent
														};
												callback(null, data);
												return mockBucket;
											},

								getSignedUrl: function(type, target, callback) {
									var mockUrl2 = mockUrl;
									var err = "OK";
									callback(null, mockUrl2);
								}
			};
			spyOn(toastr, "error");
			spyOn(mockBucket, "getSignedUrl").and.callThrough();
			spyOn(mockBucket, "listObjects").and.callThrough();
			promise = S3Service.getItemsInBucket(null, mockBucket); // Not sure what S3Objects in param is for
			promise.then(function(result) {
				resolved = result;
			}, function(err) {
				resolved = "NotOk";
			})
			expect(mockBucket.getSignedUrl).toHaveBeenCalled();
			expect(toastr.error).not.toHaveBeenCalled();
			$rootScope.$digest();
			done();
			expect(resolved.length).toBe(1);
			expect(resolved).toEqual([{title: mockContent[0].ETag, date: mockContent[0].LastModified, url: mockUrl, tag: mockContent[0].ETag}]);
		});
		it('should return resolved promise with no item to return (due to item being thumbnail)', function(done){
			var promise;
			var resolved;
			var mockContent = [{length: 1, Key: "123_thumb.jpeg", ETag: "123", LastModified : "Now"}];
			var mockUrl = "mockUrl";
			var mockBucket = { 	listObjects: function(param, callback) {
												var data = {message: "OK", code: 123,
														Contents: mockContent
														};
												callback(null, data);
												return mockBucket;
											},

								getSignedUrl: function(type, target, callback) {
									var mockUrl2 = mockUrl;
									var err = "OK";
									callback(null, mockUrl2);
								}
			};
			spyOn(toastr, "error");
			spyOn(mockBucket, "getSignedUrl").and.callThrough();
			spyOn(mockBucket, "listObjects").and.callThrough();
			promise = S3Service.getItemsInBucket(null, mockBucket); // Not sure what S3Objects in param is for
			promise.then(function(result) {
				resolved = result;
			}, function(err) {
				resolved = "NotOk";
			})
			expect(mockBucket.getSignedUrl).not.toHaveBeenCalled();
			expect(toastr.error).not.toHaveBeenCalled();
			$rootScope.$digest();
			done();
			expect(resolved.length).toBe(0);
		});
	});

	describe('retrieveThumbnail() tests', function() {
		beforeEach((function(){
			S3Service = createService($httpBackend, $rootScope, $q);
		}));

		it('should return rejected promise and called toastr error', function(done) {
			var promise;
			var rejected;
			var mockFilename = "123";
			var mockBucket = {getSignedUrl: function(type, target, callback) {
												var err = "OK";
												callback(err, null);
											}
			};
			spyOn(toastr, "error");
			spyOn(mockBucket, "getSignedUrl").and.callThrough();
			promise = S3Service.retrieveThumbnail(mockFilename, mockBucket);
			promise.then(function(result) {
				rejected = "NotOK";
			}, function(err) {
				rejected = err;
			})
			expect(mockBucket.getSignedUrl).toHaveBeenCalled();
			expect(toastr.error).toHaveBeenCalled();
			$rootScope.$digest();
			done();
			expect(rejected).toBe("OK");
		});
		it('should return resolved promise', function(done) {
			var promise;
			var resolved;
			var mockFilename = "123";
			var mockUrl = "mockUrl";
			var mockBucket = {getSignedUrl: function(type, target, callback) {
												var data = "Thumbnail";
												callback(null, data);
											}
			};
			spyOn(toastr, "error");
			spyOn(mockBucket, "getSignedUrl").and.callThrough();
			promise = S3Service.retrieveThumbnail(mockFilename, mockBucket);
			promise.then(function(result) {
				resolved = result;
			}, function(err) {
				resolved = "NotOk";
			})
			expect(mockBucket.getSignedUrl).toHaveBeenCalled();
			expect(toastr.error).not.toHaveBeenCalled();
			$rootScope.$digest();
			done();
			expect(resolved).toEqual("Thumbnail");
		});
	});

	describe('convertDataURIToBlob() tests', function() {
		beforeEach((function(){
			S3Service = createService($httpBackend, $rootScope, $q);
		}));
		it('should return a Blob object', function() {
			var mockURI = "base64,MTIzNDU=";
			var result = $rootScope.convertDataURIToBlob(mockURI);
			expect((result instanceof Blob)).toEqual(true);
		});
	});

	describe('uploadThumbnailToS3() tests', function() {
		beforeEach((function(){
			S3Service = createService($httpBackend, $rootScope, $q);
		}));
		it('Failure Case: should call toastr error', function() {
			var mockBlobData = "123";
			var mockFilename = "1234";
			var mockBucket = {putObject: function(params, callback) {
												var err = "OK";
												callback(err, null);
										}
			};
			spyOn(toastr, "error");
			$rootScope.uploadThumbnailToS3(mockBlobData, mockFilename,mockBucket);
			expect(toastr.error).toHaveBeenCalled();
		});
		it('Success Case: should not call toastr error', function() {
			var mockBlobData = "123";
			var mockFilename = "1234";
			var mockBucket = {putObject: function(params, callback) {
												var data = "OK";
												callback(null, data);
										}
			};
			spyOn(toastr, "error");
			$rootScope.uploadThumbnailToS3(mockBlobData, mockFilename,mockBucket);
			expect(toastr.error).not.toHaveBeenCalled();
		});
	});

	describe('handleS3Media() tests', function() {
		beforeEach((function(){
			S3Service = createService($httpBackend, $rootScope, $q);
		}));
		it('should set S3Service.mediaObject correctly', function() {
			var mockMediaObject = "123";
			S3Service.handleS3Media(mockMediaObject);
			expect(S3Service.mediaObject).toBe(mockMediaObject);
		});
	});
	describe('notifyComplete() tests', function() {
		beforeEach((function(){
			S3Service = createService($httpBackend, $rootScope, $q);
		}));

		it('Should set media object to null', function() {
			S3Service.mediaObject = "123";
			expect(S3Service.mediaObject).not.toBe(null);
			S3Service.notifyComplete();
			expect(S3Service.mediaObject).toBe(null);
		});
		it('Should emit "S3AddFinished" event', function() {
			var emitted = false;
			$rootScope.$on('S3AddFinished', function() {
				emitted = true;
			});
			expect(emitted).toBe(false);
			S3Service.notifyComplete();
			expect(emitted).toBe(true);
		});
	});
});


text:
title: Champernowne's constant
localeTitle: ثابت تشامبرنون
---
## المشكلة 40: ثابت Champernowne

هذا هو كعب. [ساعد مجتمعنا على توسيعه](https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/coding-interview-prep/project-euler/problem-40-champernownes-constant/index.md) .

[سيساعدك دليل النمط السريع هذا على ضمان قبول طلب السحب](https://github.com/freecodecamp/guides/blob/master/README.md) .


text:
#pragma once

#include "driver/shaders/spirv/spirv_common.h"
#include "vk_common.h"
#include "vk_manager.h"

struct VulkanCreationInfo;

// linearised version of VkDynamicState
enum VulkanDynamicStateIndex
{
  VkDynamicViewport,
  VkDynamicScissor,
  VkDynamicLineWidth,
  VkDynamicDepthBias,
  VkDynamicBlendConstants,
  VkDynamicDepthBounds,
  VkDynamicStencilCompareMask,
  VkDynamicStencilWriteMask,
  VkDynamicStencilReference,
  VkDynamicViewportWScalingNV,
  VkDynamicDiscardRectangleEXT,
  VkDynamicSampleLocationsEXT,
  VkDynamicViewportShadingRatePaletteNV,
  VkDynamicViewportCoarseSampleOrderNV,
  VkDynamicExclusiveScissorNV,
  VkDynamicCount,
};

VkDynamicState ConvertDynamicState(VulkanDynamicStateIndex idx);
VulkanDynamicStateIndex ConvertDynamicState(VkDynamicState state);

struct DescSetLayout
{
  void Init(VulkanResourceManager *resourceMan, VulkanCreationInfo &info,
            const VkDescriptorSetLayoutCreateInfo *pCreateInfo);

  void CreateBindingsArray(std::vector<DescriptorSetSlot *> &descBindings) const;
  void UpdateBindingsArray(const DescSetLayout &prevLayout,
                           std::vector<DescriptorSetSlot *> &descBindings) const;

  struct Binding
  {
    // set reasonable defaults in the constructor as with sparse descriptor set layouts
    // some elements could be untouched. We set stageFlags to 0 so the UI ignores these
    // elements
    Binding()
        : descriptorType(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER),
          descriptorCount(1),
          stageFlags(0),
          immutableSampler(NULL)
    {
    }
    // Copy the immutable sampler
    Binding(const Binding &b)
        : descriptorType(b.descriptorType),
          descriptorCount(b.descriptorCount),
          stageFlags(b.stageFlags),
          immutableSampler(NULL)
    {
      if(b.immutableSampler)
      {
        immutableSampler = new ResourceId[descriptorCount];
        memcpy(immutableSampler, b.immutableSampler, sizeof(ResourceId) * descriptorCount);
      }
    }
    ~Binding() { SAFE_DELETE_ARRAY(immutableSampler); }
    VkDescriptorType descriptorType;
    uint32_t descriptorCount;
    VkShaderStageFlags stageFlags;
    ResourceId *immutableSampler;
  };
  vector<Binding> bindings;

  uint32_t dynamicCount;
  VkDescriptorSetLayoutCreateFlags flags;

  bool operator==(const DescSetLayout &other) const;
  bool operator!=(const DescSetLayout &other) const { return !(*this == other); }
};

struct DescUpdateTemplateApplication
{
  std::vector<VkDescriptorBufferInfo> bufInfo;
  std::vector<VkDescriptorImageInfo> imgInfo;
  std::vector<VkBufferView> bufView;

  std::vector<VkWriteDescriptorSet> writes;
};

struct DescUpdateTemplate
{
  void Init(VulkanResourceManager *resourceMan, VulkanCreationInfo &info,
            const VkDescriptorUpdateTemplateCreateInfo *pCreateInfo);

  void Apply(const void *pData, DescUpdateTemplateApplication &application);

  DescSetLayout layout;

  VkPipelineBindPoint bindPoint;

  size_t dataByteSize;

  uint32_t texelBufferViewCount;
  uint32_t bufferInfoCount;
  uint32_t imageInfoCount;

  std::vector<VkDescriptorUpdateTemplateEntry> updates;
};

struct VulkanCreationInfo
{
  struct Pipeline
  {
    void Init(VulkanResourceManager *resourceMan, VulkanCreationInfo &info,
              const VkGraphicsPipelineCreateInfo *pCreateInfo);
    void Init(VulkanResourceManager *resourceMan, VulkanCreationInfo &info,
              const VkComputePipelineCreateInfo *pCreateInfo);

    ResourceId layout;
    ResourceId renderpass;
    uint32_t subpass;

    // a variant of the pipeline that uses subpass 0, used for when we are replaying in isolation.
    // See loadRPs in the RenderPass info
    VkPipeline subpass0pipe;

    // VkGraphicsPipelineCreateInfo
    VkPipelineCreateFlags flags;

    // VkPipelineShaderStageCreateInfo
    struct Shader
    {
      Shader() : refl(NULL), mapping(NULL), patchData(NULL) {}
      ResourceId module;
      string entryPoint;
      ShaderReflection *refl;
      ShaderBindpointMapping *mapping;
      SPIRVPatchData *patchData;

      vector<SpecConstant> specialization;
    };
    Shader shaders[6];

    // VkPipelineVertexInputStateCreateInfo
    struct Binding
    {
      uint32_t vbufferBinding;
      uint32_t bytestride;
      bool perInstance;

      // VkVertexInputBindingDivisorDescriptionEXT
      uint32_t instanceDivisor;
    };
    vector<Binding> vertexBindings;

    struct Attribute
    {
      uint32_t location;
      uint32_t binding;
      VkFormat format;
      uint32_t byteoffset;
    };
    vector<Attribute> vertexAttrs;

    // VkPipelineInputAssemblyStateCreateInfo
    VkPrimitiveTopology topology;
    bool primitiveRestartEnable;

    // VkPipelineTessellationStateCreateInfo
    uint32_t patchControlPoints;

    // VkPipelineTessellationDomainOriginStateCreateInfo
    VkTessellationDomainOrigin tessellationDomainOrigin;

    // VkPipelineViewportStateCreateInfo
    uint32_t viewportCount;
    vector<VkViewport> viewports;
    vector<VkRect2D> scissors;

    // VkPipelineRasterizationStateCreateInfo
    bool depthClampEnable;
    bool rasterizerDiscardEnable;
    VkPolygonMode polygonMode;
    VkCullModeFlags cullMode;
    VkFrontFace frontFace;
    bool depthBiasEnable;
    float depthBiasConstantFactor;
    float depthBiasClamp;
    float depthBiasSlopeFactor;
    float lineWidth;

    // VkPipelineRasterizationStateStreamCreateInfoEXT
    uint32_t rasterizationStream;

    // VkPipelineRasterizationStateStreamCreateInfoEXT
    bool depthClipEnable;

    // VkPipelineRasterizationConservativeStateCreateInfoEXT
    VkConservativeRasterizationModeEXT conservativeRasterizationMode;
    float extraPrimitiveOverestimationSize;

    // VkPipelineMultisampleStateCreateInfo
    VkSampleCountFlagBits rasterizationSamples;
    bool sampleShadingEnable;
    float minSampleShading;
    VkSampleMask sampleMask;
    bool alphaToCoverageEnable;
    bool alphaToOneEnable;

    // VkPipelineSampleLocationsStateCreateInfoEXT
    struct
    {
      bool enabled;
      VkExtent2D gridSize;
      std::vector<VkSampleLocationEXT> locations;
    } sampleLocations;

    // VkPipelineDepthStencilStateCreateInfo
    bool depthTestEnable;
    bool depthWriteEnable;
    VkCompareOp depthCompareOp;
    bool depthBoundsEnable;
    bool stencilTestEnable;
    VkStencilOpState front;
    VkStencilOpState back;
    float minDepthBounds;
    float maxDepthBounds;

    // VkPipelineColorBlendStateCreateInfo
    bool logicOpEnable;
    VkLogicOp logicOp;
    float blendConst[4];

    struct Attachment
    {
      bool blendEnable;

      struct BlendOp
      {
        VkBlendFactor Source;
        VkBlendFactor Destination;
        VkBlendOp Operation;
      } blend, alphaBlend;

      uint8_t channelWriteMask;
    };
    vector<Attachment> attachments;

    // VkPipelineDynamicStateCreateInfo
    bool dynamicStates[VkDynamicCount];

    // VkPipelineDiscardRectangleStateCreateInfoEXT
    std::vector<VkRect2D> discardRectangles;
    VkDiscardRectangleModeEXT discardMode;
  };
  map<ResourceId, Pipeline> m_Pipeline;

  struct PipelineLayout
  {
    void Init(VulkanResourceManager *resourceMan, VulkanCreationInfo &info,
              const VkPipelineLayoutCreateInfo *pCreateInfo);

    vector<VkPushConstantRange> pushRanges;
    vector<ResourceId> descSetLayouts;
  };
  map<ResourceId, PipelineLayout> m_PipelineLayout;

  struct RenderPass
  {
    void Init(VulkanResourceManager *resourceMan, VulkanCreationInfo &info,
              const VkRenderPassCreateInfo *pCreateInfo);
    void Init(VulkanResourceManager *resourceMan, VulkanCreationInfo &info,
              const VkRenderPassCreateInfo2KHR *pCreateInfo);

    struct Attachment
    {
      VkAttachmentDescriptionFlags flags;
      VkFormat format;
      VkSampleCountFlagBits samples;
      VkAttachmentLoadOp loadOp;
      VkAttachmentStoreOp storeOp;
      VkAttachmentLoadOp stencilLoadOp;
      VkAttachmentStoreOp stencilStoreOp;
      VkImageLayout initialLayout;
      VkImageLayout finalLayout;
    };

    vector<Attachment> attachments;

    struct Subpass
    {
      // these are split apart since they layout is
      // rarely used but the indices are often used
      vector<uint32_t> inputAttachments;
      vector<uint32_t> colorAttachments;
      vector<uint32_t> resolveAttachments;
      int32_t depthstencilAttachment;
      int32_t fragmentDensityAttachment;

      vector<VkImageLayout> inputLayouts;
      vector<VkImageLayout> colorLayouts;
      VkImageLayout depthstencilLayout;
      VkImageLayout fragmentDensityLayout;

      std::vector<uint32_t> multiviews;
    };
    vector<Subpass> subpasses;

    // one for each subpass, as we preserve attachments
    // in the layout that the subpass uses
    vector<VkRenderPass> loadRPs;
  };
  map<ResourceId, RenderPass> m_RenderPass;

  struct Framebuffer
  {
    void Init(VulkanResourceManager *resourceMan, VulkanCreationInfo &info,
              const VkFramebufferCreateInfo *pCreateInfo);

    struct Attachment
    {
      ResourceId view;
      VkFormat format;
    };
    vector<Attachment> attachments;

    uint32_t width, height, layers;

    // See above in loadRPs - we need to duplicate and make framebuffer equivalents for each
    vector<VkFramebuffer> loadFBs;
  };
  map<ResourceId, Framebuffer> m_Framebuffer;

  struct Memory
  {
    void Init(VulkanResourceManager *resourceMan, VulkanCreationInfo &info,
              const VkMemoryAllocateInfo *pAllocInfo);

    uint32_t memoryTypeIndex;
    uint64_t size;

    VkBuffer wholeMemBuf;
  };
  map<ResourceId, Memory> m_Memory;

  struct Buffer
  {
    void Init(VulkanResourceManager *resourceMan, VulkanCreationInfo &info,
              const VkBufferCreateInfo *pCreateInfo);

    VkBufferUsageFlags usage;
    uint64_t size;
  };
  map<ResourceId, Buffer> m_Buffer;

  struct BufferView
  {
    void Init(VulkanResourceManager *resourceMan, VulkanCreationInfo &info,
              const VkBufferViewCreateInfo *pCreateInfo);

    ResourceId buffer;
    VkFormat format;
    uint64_t offset;
    uint64_t size;
  };
  map<ResourceId, BufferView> m_BufferView;

  struct Image
  {
    void Init(VulkanResourceManager *resourceMan, VulkanCreationInfo &info,
              const VkImageCreateInfo *pCreateInfo);

    VkImageType type;
    VkFormat format;
    VkExtent3D extent;
    int arrayLayers, mipLevels;
    VkSampleCountFlagBits samples;

    bool cube;
    TextureCategory creationFlags;
  };
  map<ResourceId, Image> m_Image;

  struct Sampler
  {
    void Init(VulkanResourceManager *resourceMan, VulkanCreationInfo &info,
              const VkSamplerCreateInfo *pCreateInfo);

    VkFilter magFilter;
    VkFilter minFilter;
    VkSamplerMipmapMode mipmapMode;
    VkSamplerAddressMode address[3];
    float mipLodBias;
    float maxAnisotropy;
    bool compareEnable;
    VkCompareOp compareOp;
    float minLod;
    float maxLod;
    VkBorderColor borderColor;
    bool unnormalizedCoordinates;
    VkSamplerReductionModeEXT reductionMode;

    ResourceId ycbcr;
  };
  map<ResourceId, Sampler> m_Sampler;

  struct YCbCrSampler
  {
    void Init(VulkanResourceManager *resourceMan, VulkanCreationInfo &info,
              const VkSamplerYcbcrConversionCreateInfo *pCreateInfo);

    YcbcrConversion ycbcrModel;
    YcbcrRange ycbcrRange;
    TextureSwizzle swizzle[4];
    ChromaSampleLocation xChromaOffset;
    ChromaSampleLocation yChromaOffset;
    FilterMode chromaFilter;
    bool forceExplicitReconstruction;
  };
  map<ResourceId, YCbCrSampler> m_YCbCrSampler;

  struct ImageView
  {
    void Init(VulkanResourceManager *resourceMan, VulkanCreationInfo &info,
              const VkImageViewCreateInfo *pCreateInfo);

    ResourceId image;
    VkFormat format;
    VkImageSubresourceRange range;
    TextureSwizzle swizzle[4];
  };
  map<ResourceId, ImageView> m_ImageView;

  struct ShaderModule
  {
    void Init(VulkanResourceManager *resourceMan, VulkanCreationInfo &info,
              const VkShaderModuleCreateInfo *pCreateInfo);

    SPVModule spirv;

    string unstrippedPath;

    struct Reflection
    {
      uint32_t stageIndex;
      string entryPoint;
      string disassembly;
      ShaderReflection refl;
      ShaderBindpointMapping mapping;
      SPIRVPatchData patchData;

      void Init(VulkanResourceManager *resourceMan, ResourceId id, const SPVModule &spv,
                const std::string &entry, VkShaderStageFlagBits stage);
    };
    map<string, Reflection> m_Reflections;
  };
  map<ResourceId, ShaderModule> m_ShaderModule;

  struct DescSetPool
  {
    void Init(VulkanResourceManager *resourceMan, VulkanCreationInfo &info,
              const VkDescriptorPoolCreateInfo *pCreateInfo);

    uint32_t maxSets;
    std::vector<VkDescriptorPoolSize> poolSizes;

    void CreateOverflow(VkDevice device, VulkanResourceManager *resourceMan);

    std::vector<VkDescriptorPool> overflow;
  };
  map<ResourceId, DescSetPool> m_DescSetPool;

  map<ResourceId, string> m_Names;
  map<ResourceId, SwapchainInfo> m_SwapChain;
  map<ResourceId, DescSetLayout> m_DescSetLayout;
  map<ResourceId, DescUpdateTemplate> m_DescUpdateTemplate;

  // just contains the queueFamilyIndex (after remapping)
  map<ResourceId, uint32_t> m_Queue;
};


text:
SirTrevor.BlockAdd = (function(){

  var BlockAdd = function(block_element) {
    this.$block = block_element;
    this._ensureElement();
    this._bindFunctions();

    this.initialize();
  };

  _.extend(BlockAdd.prototype, FunctionBind, Renderable, SirTrevor.Events, {

    tagName: 'a',
    className: 'btn--editor-panel',
    attributes: {
      html: ''+i18n.t('general:add')+''
    },

    bound: ['create'],

    create: function(e)  {
      SirTrevor.EventBus.trigger('showBlockControls', this.$block);
    },

    initialize: function() {
      this.$el.on('click', this, this.create);
    }

  });

  return BlockAdd;

})();


text:
package com.njdaeger.java.configuration.exceptions;

public class PlayerNotInMemory extends Exception {

	private static final long serialVersionUID = 1L;

	public PlayerNotInMemory() {
		super("The player confifuration is not loaded in memory.");
	}

}


text:
package com.github.maven_nar;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.StringUtils;

import com.github.maven_nar.cpptasks.CCTask;
import com.github.maven_nar.cpptasks.CUtil;
import com.github.maven_nar.cpptasks.CompilerDef;
import com.github.maven_nar.cpptasks.LinkerDef;
import com.github.maven_nar.cpptasks.OutputTypeEnum;
import com.github.maven_nar.cpptasks.RuntimeType;
import com.github.maven_nar.cpptasks.SubsystemEnum;
import com.github.maven_nar.cpptasks.types.LibrarySet;
import com.github.maven_nar.cpptasks.types.LinkerArgument;
import com.github.maven_nar.cpptasks.types.SystemLibrarySet;

/**
 * Compiles native source files.
 *
 * @requiresSession
 * @author Mark Donszelmann
 */
@Mojo(name = "nar-compile", defaultPhase = LifecyclePhase.COMPILE, requiresProject = true,
  requiresDependencyResolution = ResolutionScope.COMPILE)
public class NarCompileMojo extends AbstractCompileMojo {
  /**
   * The current build session instance.
   */
  @Component
  protected MavenSession session;

  private void copyInclude(final Compiler c) throws IOException, MojoExecutionException, MojoFailureException {
    if (c == null) {
      return;
    }
    c.copyIncludeFiles(
        getMavenProject(),
        getLayout().getIncludeDirectory(getTargetDirectory(), getMavenProject().getArtifactId(),
            getMavenProject().getVersion()));
  }

  private void createLibrary(final Project antProject, final Library library)
      throws MojoExecutionException, MojoFailureException {
    getLog().debug("Creating Library " + library);
    // configure task
    final CCTask task = new CCTask();
    task.setCommandLogLevel(this.commandLogLevel);
    task.setProject(antProject);

    task.setDecorateLinkerOptions(this.decorateLinkerOptions);

    // subsystem
    final SubsystemEnum subSystem = new SubsystemEnum();
    subSystem.setValue(library.getSubSystem());
    task.setSubsystem(subSystem);

    // set max cores
    task.setMaxCores(getMaxCores(getAOL()));

    // outtype
    final OutputTypeEnum outTypeEnum = new OutputTypeEnum();
    final String type = library.getType();
    outTypeEnum.setValue(type);
    task.setOuttype(outTypeEnum);

    // stdc++
    task.setLinkCPP(library.linkCPP());

    // fortran
    task.setLinkFortran(library.linkFortran());
    task.setLinkFortranMain(library.linkFortranMain());

    // outDir
    File outDir;
    if (type.equals(Library.EXECUTABLE)) {
      outDir = getLayout().getBinDirectory(getTargetDirectory(), getMavenProject().getArtifactId(),
          getMavenProject().getVersion(), getAOL().toString());
    } else {
      outDir = getLayout().getLibDirectory(getTargetDirectory(), getMavenProject().getArtifactId(),
          getMavenProject().getVersion(), getAOL().toString(), type);
    }
    outDir.mkdirs();

    // outFile
    // FIXME NAR-90 we could get the final name from layout
    final File outFile = new File(outDir, getOutput(getAOL(), type));
    getLog().debug("NAR - output: '" + outFile + "'");
    task.setOutfile(outFile);

    // object directory
    File objDir = new File(getTargetDirectory(), "obj");
    objDir = new File(objDir, getAOL().toString());
    objDir.mkdirs();
    task.setObjdir(objDir);

    // failOnError, libtool
    task.setFailonerror(failOnError(getAOL()));
    task.setLibtool(useLibtool(getAOL()));

    // runtime
    final RuntimeType runtimeType = new RuntimeType();
    runtimeType.setValue(getRuntime(getAOL()));
    task.setRuntime(runtimeType);

    // IDL, MC, RC compilations should probably be 'generate source' type
    // actions, seperate from main build.
    // Needs resolution of handling for generate sources.
    // Order is somewhat important here, IDL and MC generate outputs that are
    // (often) included in the RC compilation
    if (getIdl() != null) {
      final CompilerDef idl = getIdl().getCompiler(Compiler.MAIN, null);
      if (idl != null) {
        task.addConfiguredCompiler(idl);
      }
    }
    if (getMessage() != null) {
      final CompilerDef mc = getMessage().getCompiler(Compiler.MAIN, null);
      if (mc != null) {
        task.addConfiguredCompiler(mc);
      }
    }
    if (getResource() != null) {
      final CompilerDef res = getResource().getCompiler(Compiler.MAIN, null);
      if (res != null) {
        task.addConfiguredCompiler(res);
      }
    }

    // Darren Sargent Feb 11 2010: Use Compiler.MAIN for "type"...appears the
    // wrong "type" variable was being used
    // since getCompiler() expects "main" or "test", whereas the "type" variable
    // here is "executable", "shared" etc.
    // add C++ compiler
    if (getCpp() != null) {
      final CompilerDef cpp = getCpp().getCompiler(Compiler.MAIN, null);
      if (cpp != null) {
        task.addConfiguredCompiler(cpp);
      }
    }

    // add C compiler
    if (getC() != null) {
      final CompilerDef c = getC().getCompiler(Compiler.MAIN, null);
      if (c != null) {
        task.addConfiguredCompiler(c);
      }
    }

    // add Fortran compiler
    if (getFortran() != null) {
      final CompilerDef fortran = getFortran().getCompiler(Compiler.MAIN, null);
      if (fortran != null) {
        task.addConfiguredCompiler(fortran);
      }
    }
    // end Darren

    // add javah include path
    final File jniDirectory = getJavah().getJniDirectory();
    if (jniDirectory.exists()) {
      task.createIncludePath().setPath(jniDirectory.getPath());
    }

    // add java include paths
    getJava().addIncludePaths(task, type);

    getMsvc().configureCCTask(this, task);

    final List<NarArtifact> dependencies = getNarArtifacts();
    // add dependency include paths
    for (final Object element : dependencies) {
      // FIXME, handle multiple includes from one NAR
      final NarArtifact narDependency = (NarArtifact) element;
      final String binding = narDependency.getNarInfo().getBinding(getAOL(), Library.STATIC);
      getLog().debug("Looking for " + narDependency + " found binding " + binding);
      if (!binding.equals(Library.JNI)) {
        final File unpackDirectory = getUnpackDirectory();
        final File include = getLayout().getIncludeDirectory(unpackDirectory, narDependency.getArtifactId(),
            narDependency.getBaseVersion());
        getLog().debug("Looking for include directory: " + include);
        if (include.exists()) {
          task.createIncludePath().setPath(include.getPath());
        } else {
          throw new MojoExecutionException("NAR: unable to locate include path: " + include);
        }
      }
    }

    // add linker
    final LinkerDef linkerDefinition = getLinker().getLinker(this, antProject, getOS(), getAOL().getKey() + ".linker.",
        type);
    task.addConfiguredLinker(linkerDefinition);

    // add dependency libraries
    // FIXME: what about PLUGIN and STATIC, depending on STATIC, should we
    // not add all libraries, see NARPLUGIN-96
    if (type.equals(Library.SHARED) || type.equals(Library.JNI) || type.equals(Library.EXECUTABLE)) {

      final List depLibOrder = getDependencyLibOrder();
      List depLibs = dependencies;

      // reorder the libraries that come from the nar dependencies
      // to comply with the order specified by the user
      if (depLibOrder != null && !depLibOrder.isEmpty()) {
        final List tmp = new LinkedList();

        for (final Iterator i = depLibOrder.iterator(); i.hasNext();) {
          final String depToOrderName = (String) i.next();

          for (final Iterator j = depLibs.iterator(); j.hasNext();) {
            final NarArtifact dep = (NarArtifact) j.next();
            final String depName = dep.getGroupId() + ":" + dep.getArtifactId();

            if (depName.equals(depToOrderName)) {
              tmp.add(dep);
              j.remove();
            }
          }
        }

        tmp.addAll(depLibs);
        depLibs = tmp;
      }

      for (final Iterator i = depLibs.iterator(); i.hasNext();) {
        final NarArtifact dependency = (NarArtifact) i.next();

        // FIXME no handling of "local"

        // FIXME, no way to override this at this stage
        final String binding = dependency.getNarInfo().getBinding(getAOL(), Library.NONE);
        getLog().debug("Using Binding: " + binding);
        AOL aol = getAOL();
        aol = dependency.getNarInfo().getAOL(getAOL());
        getLog().debug("Using Library AOL: " + aol.toString());

        if (!binding.equals(Library.JNI) && !binding.equals(Library.NONE) && !binding.equals(Library.EXECUTABLE)) {
          final File unpackDirectory = getUnpackDirectory();

          final File dir = getLayout().getLibDirectory(unpackDirectory, dependency.getArtifactId(),
              dependency.getBaseVersion(), aol.toString(), binding);

          getLog().debug("Looking for Library Directory: " + dir);
          if (dir.exists()) {
            final LibrarySet libSet = new LibrarySet();
            libSet.setProject(antProject);

            // FIXME, no way to override
            final String libs = dependency.getNarInfo().getLibs(getAOL());
            if (libs != null && !libs.equals("")) {
              getLog().debug("Using LIBS = " + libs);
              libSet.setLibs(new CUtil.StringArrayBuilder(libs));
              libSet.setDir(dir);
              task.addLibset(libSet);
            }
          } else {
            getLog().debug("Library Directory " + dir + " does NOT exist.");
          }

          // FIXME, look again at this, for multiple dependencies we may need to
          // remove duplicates
          final String options = dependency.getNarInfo().getOptions(getAOL());
          if (options != null && !options.equals("")) {
            getLog().debug("Using OPTIONS = " + options);
            final LinkerArgument arg = new LinkerArgument();
            arg.setValue(options);
            linkerDefinition.addConfiguredLinkerArg(arg);
          }

          final String sysLibs = dependency.getNarInfo().getSysLibs(getAOL());
          if (sysLibs != null && !sysLibs.equals("")) {
            getLog().debug("Using SYSLIBS = " + sysLibs);
            final SystemLibrarySet sysLibSet = new SystemLibrarySet();
            sysLibSet.setProject(antProject);

            sysLibSet.setLibs(new CUtil.StringArrayBuilder(sysLibs));
            task.addSyslibset(sysLibSet);
          }
        }
      }
    }

    // Add JVM to linker
    getJava().addRuntime(task, getJavaHome(getAOL()), getOS(), getAOL().getKey() + ".java.");

    // execute
    try {
      task.execute();
    } catch (final BuildException e) {
      throw new MojoExecutionException("NAR: Compile failed", e);
    }

    // FIXME, this should be done in CPPTasks at some point
    if (getRuntime(getAOL()).equals("dynamic") && getOS().equals(OS.WINDOWS)
        && getLinker().getName(null, null).equals("msvc") && !getLinker().getVersion(this).startsWith("6.")) {
      final String[] env = new String[] {
        "PATH=" + getMsvc().getPathVariable().getValue()
      };
      final String libType = library.getType();
      if (libType.equals(Library.JNI) || libType.equals(Library.SHARED)) {
        final String dll = outFile.getPath() + ".dll";
        final String manifest = dll + ".manifest";
        final int result = NarUtil.runCommand("cmd", new String[] {
            "/C", "mt.exe", "/manifest", manifest, "/outputresource:" + dll + ";#2"
        }, null, env, getLog());
        if (result != 0) {
          throw new MojoFailureException("MT.EXE failed with exit code: " + result);
        }
      } else if (libType.equals(Library.EXECUTABLE)) {
        final String exe = outFile.getPath() + ".exe";
        final String manifest = exe + ".manifest";
        final int result = NarUtil.runCommand("cmd", new String[] {
            "/C", "mt.exe", "/manifest", manifest, "/outputresource:" + exe + ";#1"
        }, null, env, getLog());
        if (result != 0) {
          throw new MojoFailureException("MT.EXE failed with exit code: " + result);
        }
      }
    }
  }

  /**
   * List the dependencies needed for compilation, those dependencies are used
   * to get the include paths needed for
   * compilation and to get the libraries paths and names needed for linking.
   */
  @Override
  protected List<Artifact> getArtifacts() {
    try {
      final List<String> scopes = new ArrayList<String>();
      scopes.add(Artifact.SCOPE_COMPILE);
      scopes.add(Artifact.SCOPE_PROVIDED);
      // scopes.add(Artifact.SCOPE_RUNTIME);
      scopes.add(Artifact.SCOPE_SYSTEM);
      // scopes.add(Artifact.SCOPE_TEST);
      return getNarManager().getDependencies(scopes);
    } catch (final MojoExecutionException e) {
      e.printStackTrace();
    } catch (final MojoFailureException e) {
      e.printStackTrace();
    }
    return Collections.EMPTY_LIST;
  }

  private List getSourcesFor(final Compiler compiler) throws MojoFailureException, MojoExecutionException {
    if (compiler == null) {
      return Collections.EMPTY_LIST;
    }

    try {
      final List files = new ArrayList();
      final List srcDirs = compiler.getSourceDirectories();
      for (final Iterator i = srcDirs.iterator(); i.hasNext();) {
        final File dir = (File) i.next();
        if (dir.exists()) {
          files.addAll(FileUtils.getFiles(dir, StringUtils.join(compiler.getIncludes().iterator(), ","), null));
        }
      }
      return files;
    } catch (final IOException e) {
      return Collections.EMPTY_LIST;
    }
  }

  @Override
  public final void narExecute() throws MojoExecutionException, MojoFailureException {

    // make sure destination is there
    getTargetDirectory().mkdirs();

    // check for source files
    int noOfSources = 0;
    noOfSources += getSourcesFor(getCpp()).size();
    noOfSources += getSourcesFor(getC()).size();
    noOfSources += getSourcesFor(getFortran()).size();
    if (noOfSources > 0) {
      getLog().info("Compiling " + noOfSources + " native files");
      for (final Library library : getLibraries()) {
        createLibrary(getAntProject(), library);
      }
    } else {
      getLog().info("Nothing to compile");
    }

    try {
      // FIXME, should the include paths be defined at a higher level ?
      copyInclude(getCpp());
      copyInclude(getC());
      copyInclude(getFortran());
    } catch (final IOException e) {
      throw new MojoExecutionException("NAR: could not copy include files", e);
    }

    getNarInfo().writeToDirectory(this.classesDirectory);
  }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Bull. Soc. Imp. nat. Moscou 44: 129 (1871)

#### Original name
Dematium atrovirens Harz, 1871

### Remarks
null


text:
using Mod;
using UnityEngine;

[AddComponentMenu("NGUI/Internal/Debug")]
// ReSharper disable once CheckNamespace
public class NGUIDebug : MonoBehaviour
{
    private void Awake()
    {
        Shelter.Log("{0} cannot be removed.", nameof(NGUIDebug));
    }
}


text:
package com.hkh.korealocal114.service;

import android.content.Context;

/**
 * 글 재등록 서비스
 * @author hkh
 *
 */
public class RepostService extends ServiceBase {

	public RepostService(Context context) {
		super(context);
	}

}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.authorization.fluent;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
import com.azure.resourcemanager.authorization.fluent.models.Get2ItemsItem;
import com.azure.resourcemanager.authorization.fluent.models.Get3ItemsItem;
import com.azure.resourcemanager.authorization.fluent.models.Get6ItemsItem;
import com.azure.resourcemanager.authorization.fluent.models.Get7ItemsItem;
import com.azure.resourcemanager.authorization.fluent.models.Get8ItemsItem;
import com.azure.resourcemanager.authorization.fluent.models.MicrosoftGraphGroupInner;
import java.util.List;
import reactor.core.publisher.Mono;

/** An instance of this class provides access to all the operations defined in GroupsGroupsClient. */
public interface GroupsGroupsClient {
    /**
     * Get entities from groups.
     *
     * @param consistencyLevel Indicates the requested consistency level.
     * @param top Show only the first n items.
     * @param skip Skip the first n items.
     * @param search Search items by search phrases.
     * @param filter Filter items by property values.
     * @param count Include count of items.
     * @param orderby Order items by property values.
     * @param select Select properties to be returned.
     * @param expand Expand related entities.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return entities from groups as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedFlux<MicrosoftGraphGroupInner> listGroupAsync(
        String consistencyLevel,
        Integer top,
        Integer skip,
        String search,
        String filter,
        Boolean count,
        List<Get6ItemsItem> orderby,
        List<Get7ItemsItem> select,
        List<Get8ItemsItem> expand);

    /**
     * Get entities from groups.
     *
     * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return entities from groups as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedFlux<MicrosoftGraphGroupInner> listGroupAsync();

    /**
     * Get entities from groups.
     *
     * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return entities from groups as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<MicrosoftGraphGroupInner> listGroup();

    /**
     * Get entities from groups.
     *
     * @param consistencyLevel Indicates the requested consistency level.
     * @param top Show only the first n items.
     * @param skip Skip the first n items.
     * @param search Search items by search phrases.
     * @param filter Filter items by property values.
     * @param count Include count of items.
     * @param orderby Order items by property values.
     * @param select Select properties to be returned.
     * @param expand Expand related entities.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return entities from groups as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<MicrosoftGraphGroupInner> listGroup(
        String consistencyLevel,
        Integer top,
        Integer skip,
        String search,
        String filter,
        Boolean count,
        List<Get6ItemsItem> orderby,
        List<Get7ItemsItem> select,
        List<Get8ItemsItem> expand,
        Context context);

    /**
     * Add new entity to groups.
     *
     * @param body New entity.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return group along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Response<MicrosoftGraphGroupInner>> createGroupWithResponseAsync(MicrosoftGraphGroupInner body);

    /**
     * Add new entity to groups.
     *
     * @param body New entity.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return group on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<MicrosoftGraphGroupInner> createGroupAsync(MicrosoftGraphGroupInner body);

    /**
     * Add new entity to groups.
     *
     * @param body New entity.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return group along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<MicrosoftGraphGroupInner> createGroupWithResponse(MicrosoftGraphGroupInner body, Context context);

    /**
     * Add new entity to groups.
     *
     * @param body New entity.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return group.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    MicrosoftGraphGroupInner createGroup(MicrosoftGraphGroupInner body);

    /**
     * Get entity from groups by key.
     *
     * @param groupId key: id of group.
     * @param consistencyLevel Indicates the requested consistency level.
     * @param select Select properties to be returned.
     * @param expand Expand related entities.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return entity from groups by key along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Response<MicrosoftGraphGroupInner>> getGroupWithResponseAsync(
        String groupId, String consistencyLevel, List<Get2ItemsItem> select, List<Get3ItemsItem> expand);

    /**
     * Get entity from groups by key.
     *
     * @param groupId key: id of group.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return entity from groups by key on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<MicrosoftGraphGroupInner> getGroupAsync(String groupId);

    /**
     * Get entity from groups by key.
     *
     * @param groupId key: id of group.
     * @param consistencyLevel Indicates the requested consistency level.
     * @param select Select properties to be returned.
     * @param expand Expand related entities.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return entity from groups by key along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<MicrosoftGraphGroupInner> getGroupWithResponse(
        String groupId,
        String consistencyLevel,
        List<Get2ItemsItem> select,
        List<Get3ItemsItem> expand,
        Context context);

    /**
     * Get entity from groups by key.
     *
     * @param groupId key: id of group.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return entity from groups by key.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    MicrosoftGraphGroupInner getGroup(String groupId);

    /**
     * Update entity in groups.
     *
     * @param groupId key: id of group.
     * @param body New property values.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Response<Void>> updateGroupWithResponseAsync(String groupId, MicrosoftGraphGroupInner body);

    /**
     * Update entity in groups.
     *
     * @param groupId key: id of group.
     * @param body New property values.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Void> updateGroupAsync(String groupId, MicrosoftGraphGroupInner body);

    /**
     * Update entity in groups.
     *
     * @param groupId key: id of group.
     * @param body New property values.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<Void> updateGroupWithResponse(String groupId, MicrosoftGraphGroupInner body, Context context);

    /**
     * Update entity in groups.
     *
     * @param groupId key: id of group.
     * @param body New property values.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void updateGroup(String groupId, MicrosoftGraphGroupInner body);

    /**
     * Delete entity from groups.
     *
     * @param groupId key: id of group.
     * @param ifMatch ETag.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Response<Void>> deleteGroupWithResponseAsync(String groupId, String ifMatch);

    /**
     * Delete entity from groups.
     *
     * @param groupId key: id of group.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Void> deleteGroupAsync(String groupId);

    /**
     * Delete entity from groups.
     *
     * @param groupId key: id of group.
     * @param ifMatch ETag.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<Void> deleteGroupWithResponse(String groupId, String ifMatch, Context context);

    /**
     * Delete entity from groups.
     *
     * @param groupId key: id of group.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
     *     rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void deleteGroup(String groupId);
}


text:
package org.jboss.weld.tests.extensions.lifecycle.processBeanAttributes.modify;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import jakarta.enterprise.util.AnnotationLiteral;
import jakarta.inject.Qualifier;

@Qualifier
@Target({ TYPE, METHOD, PARAMETER, FIELD })
@Retention(RUNTIME)
@interface Cute {

    @SuppressWarnings("all")
    static class Literal extends AnnotationLiteral<Cute> implements Cute {
    }
}


text:
module Foundation where

import           Import.NoFoundation
import           Database.Persist.Sql (ConnectionPool, runSqlPool)
import           Control.Monad.Logger (LoggingT, runLoggingT)
import           Text.Hamlet          (hamletFile)
import           Text.Lucius          (luciusFile)
import           Text.Jasmine         (minifym)
import           Yesod.Default.Util   (addStaticContentExternal)
import           Yesod.Core.Types     (Logger)
import qualified Yesod.Core.Unsafe as Unsafe
import           Plugin.Auth.Email

import           Layout.Component.Alert (getAlertT, Level(Danger), changeAlertLevelT)

-- | The foundation datatype for your application. This can be a good place to
-- keep settings and values requiring initialization before your application
-- starts running, such as database connections. Every handler will have
-- access to the data present here.
data App = App
    { appSettings    :: AppSettings
    , appStatic      :: Static -- ^ Settings for static file serving.
    , appConnPool    :: ConnectionPool -- ^ Database connection pool.
    , appHttpManager :: Manager
    , appLogger      :: Logger
    }

instance HasHttpManager App where
    getHttpManager = appHttpManager

mkMessage "App" "messages" "en"

-- This is where we define all of the routes in our application. For a full
-- explanation of the syntax, please see:
-- http://www.yesodweb.com/book/routing-and-handlers
--
-- Note that this is really half the story; in Application.hs, mkYesodDispatch
-- generates the rest of the code. Please see the linked documentation for an
-- explanation for this split.
mkYesodData "App" $(parseRoutesFile "config/routes")

-- | A convenient synonym for creating forms.
type Form x = Html -> MForm (HandlerT App IO) (FormResult x, Widget)

-- Please see the documentation for the Yesod typeclass. There are a number
-- of settings which can be configured by overriding methods here.
instance Yesod App where
    -- Controls the base of generated URLs. For more information on modifying,
    -- see: https://github.com/yesodweb/yesod/wiki/Overriding-approot
    approot = ApprootMaster $ appRoot . appSettings

    -- Store session data on the client in encrypted cookies,
    -- default session idle timeout is 120 minutes
    makeSessionBackend _ = fmap Just $ defaultClientSessionBackend
        120    -- timeout in minutes
        "config/client_session_key.aes"

    defaultLayout content = buildLayout $ do
        toWidgetHead $(luciusFile "templates/layout/public/global.lucius")

        $(widgetFile "layout/public/default")

    -- The page to be redirected to when authentication is required.
    authRoute _ = Just $ AuthR LoginR

    -- Routes not requiring authentication.
    isAuthorized (AuthR _) _
        = return Authorized
    isAuthorized PageHomeR _
        = return Authorized
    isAuthorized (PageViewR _) _
        = return Authorized
    isAuthorized FaviconR _
        = return Authorized
    isAuthorized RobotsR _
        = return Authorized
    isAuthorized _ _
        = maybeAuthId >>= \userM -> return $ case userM of
            Just _  -> Authorized
            Nothing -> AuthenticationRequired

    -- This function creates static content files in the static folder
    -- and names them based on a hash of their content. This allows
    -- expiration dates to be set far in the future without worry of
    -- users receiving stale content.
    addStaticContent ext mime content = do
        master <- getYesod
        let staticDir = appStaticDir $ appSettings master
        addStaticContentExternal
            minifym
            genFileName
            staticDir
            (StaticR . flip StaticRoute [])
            ext
            mime
            content
      where
        -- Generate a unique filename based on the content itself
        genFileName lbs = "autogen-" ++ base64md5 lbs

    -- What messages should be logged. The following includes all messages when
    -- in development, and warnings and errors in production.
    shouldLog app _source level =
        appShouldLogAll (appSettings app)
            || level == LevelWarn
            || level == LevelError

    makeLogger = return . appLogger

-- How to run database actions.
instance YesodPersist App where
    type YesodPersistBackend App = SqlBackend
    runDB action = do
        master <- getYesod
        runSqlPool action $ appConnPool master

instance YesodPersistRunner App where
    getDBRunner = defaultGetDBRunner appConnPool

instance YesodAuth App where
    type AuthId App = UserId

    authLayout content = do
        (currCrumb, parentCrumbs) <- breadcrumbs
        route  <- getCurrentRoute
        alertM <- getAlertT >>= \alert -> return $ case route of
            Just (AuthR LoginR) -> changeAlertLevelT Danger alert
            _                   -> alert

        buildLayout $ do
            let alert          = $(widgetFile "components/alert")
                pageIdentifier = "login" :: Text

            toWidgetHead $(luciusFile "templates/layout/public/global.lucius")

            $(widgetFile "layout/public/auth")

    -- Where to send a user after successful login
    loginDest _ = AdminR
    -- Where to send a user after logout
    logoutDest _ = AuthR LoginR
    -- Override the above two destinations when a Referer: header is present
    redirectToReferer _ = False

    getAuthId creds = runDB $ do
        x <- getBy $ UniqueUser (credsIdent creds)

        return $ case x of
            Just (Entity uid _) -> Just uid
            Nothing             -> Nothing

    -- You can add other plugins like BrowserID, email or OAuth here
    authPlugins _ = [authEmail]

    authHttpManager = getHttpManager

instance YesodAuthPersist App

instance YesodAuthEmail App where
    type AuthEmailId App = UserId

    addUnverified email verkey = runDB $ insert $
        User email Nothing (Just verkey) False

    sendVerifyEmail _ _ vurl = liftIO $ do
        putStrLn "================="
        print vurl
        putStrLn "================="

    getVerifyKey uid = runDB (get uid) >>= return . join . fmap userVerkey

    setVerifyKey uid vkey = runDB $ update uid [UserVerkey =. Just vkey]

    verifyAccount uid = runDB $ get uid >>= \userM -> case userM of
        Just _  -> update uid [UserVerified =. True] >> return (Just uid)
        Nothing -> return Nothing

    getPassword uid = runDB (get uid) >>= return . join . fmap userPassword

    setPassword uid spass = runDB $ get uid >>= \userM -> case userM of
        Just _  -> update uid [UserPassword =. Just spass]
        Nothing -> return ()

    getEmailCreds email = do
        userM <- runDB $ getBy (UniqueUser email)

        return $ case userM of
            Nothing                -> Nothing
            Just (Entity uid user) -> Just EmailCreds
                { emailCredsId     = uid
                , emailCredsAuthId = Just uid
                , emailCredsStatus = isJust (userPassword user)
                , emailCredsVerkey = userVerkey user
                , emailCredsEmail  = email
                }

    getEmail uid = runDB (get uid) >>= return . fmap userEmail

    afterPasswordRoute _ = AdminR

-- This instance is required to use forms. You can modify renderMessage to
-- achieve customized and internationalized form validation messages.
instance RenderMessage App FormMessage where
    renderMessage _ _ = defaultFormMessage

instance YesodBreadcrumbs App where
    breadcrumb r = do
        msgRender <- getMessageRender

        let returnI (msg, path) = return (msgRender msg, path)

        returnI $ case r of
            AdminR
                -> (MsgAdmin, Nothing)
            PageListFirstR
                -> (MsgPages, Just AdminR)
            (PageListR _)
                -> (MsgPages, Just AdminR)
            PageCreateR
                -> (MsgCreatePage, Just PageListFirstR)
            (PageViewR _)
                -> (MsgViewPage, Just PageListFirstR)
            (PageEditR _)
                -> (MsgEditPage, Just PageListFirstR)
            (PageRemoveConfirmR _)
                -> (MsgRemovePage, Just PageListFirstR)
            (UserListR _)
                -> (MsgUsers, Just AdminR)
            UserListFirstR
                -> (MsgUsers, Just AdminR)
            UserCreateR
                -> (MsgCreateUser, Just UserListFirstR)
            (UserViewR _)
                -> (MsgViewUser, Just UserListFirstR)
            (UserEditR _)
                -> (MsgEditUser, Just UserListFirstR)
            (UserRemoveConfirmR _)
                -> (MsgRemoveUser, Just UserListFirstR)
            ThemeIndexR
                -> (MsgTheme, Just AdminR)
            ThemeAPIReferenceR
                -> (MsgAPIReference, Just ThemeIndexR)
            ThemeCompabilityCheckR
                -> (MsgAPIReference, Just ThemeIndexR)
            (AuthR _)
                -> (MsgAuthentication, Nothing)
            _
                -> (MsgUnknown, Just AdminR)

unsafeHandler :: App -> Handler a -> IO a
unsafeHandler = Unsafe.fakeHandlerGetLogger appLogger

buildLayout :: WidgetT App IO () -> HandlerT App IO Html
buildLayout widget = do
    pc <- widgetToPageContent $ do
        $(combineScripts 'StaticR [js_jquery_min_js])
        $(combineStylesheets 'StaticR [css_bootstrap_css])
        widget

    withUrlRenderer $(hamletFile "templates/base.hamlet")

type DBRunnerIO =  forall (m :: * -> *) a. (MonadIO m, MonadBaseControl IO m)
                => SqlPersistT (Control.Monad.Logger.LoggingT m) a
                -> m a

runDBIO :: App -> DBRunnerIO
runDBIO master@App{..} action = do
    let logFunc = messageLoggerSource master appLogger

    runLoggingT (runSqlPool action appConnPool) logFunc


text:
#ifndef __CONFIGS_Z16F2800100ZCOG_INCLUDE_BOARD_H
#define __CONFIGS_Z16F2800100ZCOG_INCLUDE_BOARD_H

/****************************************************************************
 * Included Files
 ****************************************************************************/

/****************************************************************************
 * Definitions
 ****************************************************************************/
/* The Z16F2800100ZCOG board has a 20MHz crystal.  The ZNEO clocking will be
 * configured to use this crystal frequency directly as the clock source
 */

#define BOARD_XTAL_FREQUENCY   20000000 /* 20MHz */
#define BOARD_CLKSRC           1        /* Clock source = external crystal */
#define BOARD_SYSTEM_FREQUENCY BOARD_XTAL_FREQUENCY

/* Flash option bits
 *
 * "Each time the option bits are programmed or erased, the device must be
 *  Reset for the change to take place. During any reset operation .., the
 *  option bits are automatically read from the Program memory and written
 *  to Option Configuration registers. ... Option Bit Control Register are
 *  loaded before the device exits Reset and the ZNEO CPU begins code
 *  execution. The Option Configuration registers are not part of the
 *  Register file and are not accessible for read or write access."
 */

#ifndef __ASSEMBLY__
#  define BOARD_FLOPTION0 (Z16F_FLOPTION0_MAXPWR | Z16F_FLOPTION0_WDTRES | \
                           Z16F_FLOPTION0_WDTA0 | Z16F_FLOPTION0_VBOA0 | \
                           Z16F_FLOPTION0_DBGUART | Z16F_FLOPTION0_FWP | \
                           Z16F_FLOPTION0_RP)

#  define BOARD_FLOPTION1 (Z16F_FLOPTION1_RESVD | Z16F_FLOPTION1_MCEN | \
                           Z16F_FLOPTION1_OFFH | Z16F_FLOPTION1_OFFL)

#  define BOARD_FLOPTION2 Z16F_FLOPTION2_RESVD

#  define BOARD_FLOPTION3 (Z16F_FLOPTION3_RESVD | Z16F_FLOPTION3_NORMAL | \
                           Z16F_FLOPTION3_ROMLESS)

/* The same settings, pre-digested for assembly language */

#else
#  define BOARD_FLOPTION0 %ff
#  define BOARD_FLOPTION1 %ff
#  define BOARD_FLOPTION2 %ff
#  define BOARD_FLOPTION3 %ff
#endif

/* LED pattern definitions
 *
 * The z16f2800100zcog board has four LEDs:
 *
 * - Green LED D1 which illuminates in the presence of Vcc
 * - Red LED D2 connected to chip port PA0_T0IN
 * - Yellow LED D3 connected to chip port PA1_T0OUT
 * - Green LED D4 connected to chip port PA2_DE0
 */

#define LED_STARTED            0
#define LED_HEAPALLOCATE       1
#define LED_IRQSENABLED        2
#define LED_STACKCREATED       3
#define LED_IDLE               4
#define LED_INIRQ              5
#define LED_SIGNAL             6
#define LED_ASSERTION          7
#define LED_PANIC              8

/****************************************************************************
 * Public Functions
 ****************************************************************************/

#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C" {
#else
#define EXTERN extern
#endif

#undef EXTERN
#if defined(__cplusplus)
}
#endif

#endif  /* __CONFIGS_Z16F2800100ZCOG_INCLUDE_BOARD_H */


text:
/**
	Utilities for operating BitBoard variables.
*/
#ifndef __UTILS_HPP_
#define __UTILS_HPP_

#include "defines.hpp"

namespace procon26 {
	extern const BitBoard UP_SHIFT_MASK[];
	extern const BitBoard DOWN_SHIFT_MASK[];
	extern const BitBoard LEFT_SHIFT_MASK[];
	extern const BitBoard RIGHT_SHIFT_MASK[];
	extern const int ROTATION90_IDX[];
	extern const int ROTATION270_IDX[];

	void printBitBoard(BitBoard bitboard);

	inline BitBoard shiftLeft(BitBoard bitboard, int shift) {
		return (bitboard << shift) & LEFT_SHIFT_MASK[shift];
	}

	inline BitBoard shiftRight(BitBoard bitboard, int shift) {
		return (bitboard >> shift) & RIGHT_SHIFT_MASK[shift];
	}

	inline BitBoard shiftUp(BitBoard bitboard, int shift) {
		// Speed-up of: return bitboard << (shift*BOARD_HEIGHT) & UP_SHIFT_MASK[shift];
		return (bitboard << (shift << 3)) & UP_SHIFT_MASK[shift];
	}

	inline BitBoard shiftDown(BitBoard bitboard, int shift) {
		// Speed-up of: return bitboard >> (shift*BOARD_HEIGHT) & DOWN_SHIFT_MASK[shift];
		return (bitboard >> (shift << 3)) & DOWN_SHIFT_MASK[shift];
	}

	inline BitBoard reverseHorizontal(BitBoard bitboard) {
		bitboard = ((bitboard & 0x5555555555555555ull) << 1) | ((bitboard & 0xAAAAAAAAAAAAAAAAull) >> 1);
		bitboard = ((bitboard & 0x3333333333333333ull) << 2) | ((bitboard & 0xCCCCCCCCCCCCCCCCull) >> 2);
		return ((bitboard & 0x0F0F0F0F0F0F0F0Full) << 4) | ((bitboard & 0xF0F0F0F0F0F0F0F0ull) >> 4);
	}

	inline BitBoard reverseVertical(BitBoard bitboard) {
		bitboard = ((bitboard & 0x00FF00FF00FF00FFull) << 8) | ((bitboard & 0xFF00FF00FF00FF00ull) >> 8);
		bitboard = ((bitboard & 0x0000FFFF0000FFFFull) << 16) | ((bitboard & 0xFFFF0000FFFF0000ull) >> 16);
		return ((bitboard & 0x00000000FFFFFFFFull) << 32) | ((bitboard & 0xFFFFFFFF00000000ull) >> 32);
	}

	inline BitBoard rotate90(BitBoard bitboard) {
		BitBoard rotated = 0ull;

		for (int i = 0; i < NUM_BLOCKS_IN_BITBOARD; i++) {
			rotated |= ((bitboard >> ROTATION90_IDX[i]) & 1) << (NUM_BLOCKS_IN_BITBOARD - i - 1);
		}

		return rotated;
	}

	inline BitBoard rotate180(BitBoard bitboard) {
		return reverseVertical(reverseHorizontal(bitboard));
	}

	inline BitBoard rotate270(BitBoard bitboard) {
		BitBoard rotated = 0ull;

		for (int i = 0; i < NUM_BLOCKS_IN_BITBOARD; i++) {
			rotated |= ((bitboard >> ROTATION270_IDX[i]) & 1) << (NUM_BLOCKS_IN_BITBOARD - i - 1);
		}

		return rotated;
	}

	inline int countBits(BitBoard bitboard) {
		// Requires SSE4.2
		return __builtin_popcountll(bitboard);
	}

	inline BitBoard setOneBit(int sx, int sy) {
		// Speed-up of: return (0x8000000000000000ull >> sx) >> (sy * BOARD_WIDTH);
		return (0x8000000000000000ull >> sx) >> (sy << 3);
	}

	inline bool isDuplicate(BitBoard lhs, BitBoard rhs) {
		int count = countBits(lhs);

		if (count != countBits(rhs))
			return false;

		for (int x = 0; x < BOARD_WIDTH; x++) {
			for (int y = 0; y < BOARD_HEIGHT; y++) {
				BitBoard upleft = shiftUp(shiftLeft(lhs, x), y);
				BitBoard downleft = shiftDown(shiftLeft(lhs, x), y);
				BitBoard upright = shiftUp(shiftRight(lhs, x), y);
				BitBoard downright = shiftDown(shiftRight(lhs, x), y);

				if (count == countBits(upleft & rhs)
				 || count == countBits(downleft & rhs)
				 || count == countBits(upright & rhs)
				 || count == countBits(downright & rhs))
					return true;
			}
		}

		return false;
	}

	inline int countOneContact(BitBoard bitboard) {
		BitBoard l = shiftRight(bitboard, 1) & ~bitboard;
		BitBoard r = shiftLeft(bitboard, 1) & ~bitboard;
		BitBoard t = shiftDown(bitboard, 1) & ~bitboard;
		BitBoard b = shiftUp(bitboard, 1) & ~bitboard;

		BitBoard inner =  r & ~l & ~t & ~b
            		   | ~r &  l & ~t & ~b
              		 | ~r & ~l &  t & ~b
              		 | ~r & ~l & ~t &  b;

		return countBits(inner)
		     + countBits(0x0101010101010101ull & bitboard)
		     + countBits(0x8080808080808080ull & bitboard)
		     + countBits(0xFF00000000000000ull & bitboard)
		     + countBits(0x00000000000000FFull & bitboard);
	}

	inline int countCornerContact(BitBoard bitboard) {
		BitBoard l = shiftRight(bitboard, 1) & ~bitboard;
		BitBoard r = shiftLeft(bitboard, 1) & ~bitboard;
		BitBoard t = shiftDown(bitboard, 1) & ~bitboard;
		BitBoard b = shiftUp(bitboard, 1) & ~bitboard;

		BitBoard corner =  r & ~l &  t & ~b
                    |  r & ~l & ~t &  b
                    | ~r &  l &  t & ~b
                    | ~r &  l & ~t &  b;

    return countBits(corner);
	}

	inline int countBothSideContact(BitBoard bitboard) {
		BitBoard l = shiftRight(bitboard, 1) & ~bitboard;
		BitBoard r = shiftLeft(bitboard, 1) & ~bitboard;
		BitBoard t = shiftDown(bitboard, 1) & ~bitboard;
		BitBoard b = shiftUp(bitboard, 1) & ~bitboard;

		BitBoard both_side =  r &  l & ~t & ~b
                       | ~r & ~l &  t &  b;

    return countBits(both_side);
	}

	inline int countThreeContact(BitBoard bitboard) {
		BitBoard l = shiftRight(bitboard, 1) & ~bitboard;
		BitBoard r = shiftLeft(bitboard, 1) & ~bitboard;
		BitBoard t = shiftDown(bitboard, 1) & ~bitboard;
		BitBoard b = shiftUp(bitboard, 1) & ~bitboard;

    BitBoard three =  r &  l &  t & ~b
                   |  r &  l & ~t &  b
                   |  r & ~l &  t &  b
                   | ~r &  l &  t &  b;

    return countBits(three);
	}

	inline int countFourContact(BitBoard bitboard) {
		BitBoard l = shiftRight(bitboard, 1) & ~bitboard;
		BitBoard r = shiftLeft(bitboard, 1) & ~bitboard;
		BitBoard t = shiftDown(bitboard, 1) & ~bitboard;
		BitBoard b = shiftUp(bitboard, 1) & ~bitboard;

    BitBoard four = r & l & t & b;

    return countBits(four);
	}

	inline int findTopmost(BitBoard bitboard) {
		int topleft_idx = __builtin_clzll(bitboard);
    return topleft_idx >> 3;
	}

	inline int findBottommost(BitBoard bitboard) {
		int bottomright_idx = __builtin_ctzll(bitboard);
    return BOARD_HEIGHT - 1 - (bottomright_idx >> 3);
	}

	inline int findLeftmost(BitBoard bitboard) {
		if (bitboard & 0x8080808080808080ull) {
      return 0;
    } else if (bitboard & 0x4040404040404040ull) {
      return 1;
    } else if (bitboard & 0x2020202020202020ull) {
      return 2;
    } else if (bitboard & 0x1010101010101010ull) {
      return 3;
    } else if (bitboard & 0x0808080808080808ull) {
      return 4;
    } else if (bitboard & 0x0404040404040404ull) {
      return 5;
    } else if (bitboard & 0x0202020202020202ull) {
      return 6;
    } else if (bitboard & 0x0101010101010101ull) {
      return 7;
    }
	}

	inline int findRightmost(BitBoard bitboard) {
    if (bitboard & 0x0101010101010101ull) {
      return 7;
    } else if (bitboard & 0x0202020202020202ull) {
      return 6;
    } else if (bitboard & 0x0404040404040404ull) {
      return 5;
    } else if (bitboard & 0x0808080808080808ull) {
      return 4;
    } else if (bitboard & 0x1010101010101010ull) {
      return 3;
    } else if (bitboard & 0x2020202020202020ull) {
      return 2;
    } else if (bitboard & 0x4040404040404040ull) {
      return 1;
    } else if (bitboard & 0x8080808080808080ull) {
      return 0;
    }
	}

  inline bool isLtype(BitBoard bitboard) {
    if (countBits(bitboard) != 3)
      return false;

    BitBoard r = shiftRight(bitboard, 1);
    BitBoard l = shiftLeft(bitboard, 1);
    BitBoard u = shiftUp(bitboard, 1);
    BitBoard d = shiftDown(bitboard, 1);

    return (bitboard & r & u) || (bitboard & r & d) || (bitboard & l & u) || (bitboard & l & d);
  }

  inline bool isItype(BitBoard bitboard) {
    if (countBits(bitboard) != 3)
      return false;

    return !isLtype(bitboard);
  }
}

#endif // __UTILS_HPP_