code stringlengths 5 1.01M | repo_name stringlengths 5 84 | path stringlengths 4 311 | language stringclasses 30 values | license stringclasses 15 values | size int64 5 1.01M | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|
import {ChangeDetectionStrategy, Component, EventEmitter, Input, Output} from '@angular/core';
import {BehaviorSubject, Observable} from 'rxjs';
import {map} from 'rxjs/operators';
import {FlowListItem, FlowsByCategory} from '../../components/flow_picker/flow_list_item';
import {compareAlphabeticallyBy} from '../../lib/type_utils';
interface FlowOverviewCategory {
readonly title: string;
readonly items: ReadonlyArray<FlowListItem>;
}
/**
* Component that displays available Flows.
*/
@Component({
selector: 'flows-overview',
templateUrl: './flows_overview.ng.html',
styleUrls: ['./flows_overview.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class FlowsOverview {
@Input()
set flowsByCategory(value: FlowsByCategory|null) {
this.flowsByCategory$.next(value);
}
get flowsByCategory(): FlowsByCategory|null {
return this.flowsByCategory$.value;
}
private readonly flowsByCategory$ =
new BehaviorSubject<FlowsByCategory|null>(null);
readonly categories$: Observable<ReadonlyArray<FlowOverviewCategory>> =
this.flowsByCategory$.pipe(
map(fbc => {
const result = Array.from(fbc?.entries() ?? [])
.map(([categoryTitle, items]) => {
const sortedItems = [...items];
sortedItems.sort(compareAlphabeticallyBy(
item => item.friendlyName));
return {
title: categoryTitle,
items: sortedItems,
};
});
result.sort(compareAlphabeticallyBy(cat => cat.title));
return result;
}),
);
/**
* Event that is triggered when a flow is selected.
*/
@Output() flowSelected = new EventEmitter<FlowListItem>();
trackByCategoryTitle(index: number, category: FlowOverviewCategory): string {
return category.title;
}
trackByFlowName(index: number, fli: FlowListItem): string {
return fli.name;
}
}
| google/grr | grr/server/grr_response_server/gui/ui/components/flow_picker/flows_overview.ts | TypeScript | apache-2.0 | 2,137 | [
30522,
12324,
1063,
2904,
12870,
22014,
6494,
2618,
6292,
1010,
6922,
1010,
2724,
23238,
12079,
1010,
7953,
1010,
6434,
1065,
2013,
1005,
1030,
16108,
1013,
4563,
1005,
1025,
12324,
1063,
15592,
12083,
20614,
1010,
27885,
8043,
12423,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* SPDX-License-Identifier: LGPL-2.1+ */
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <errno.h>
#include <sys/epoll.h>
#include <sys/stat.h>
#include <unistd.h>
#include "libudev.h"
#include "alloc-util.h"
#include "dbus-swap.h"
#include "escape.h"
#include "exit-status.h"
#include "fd-util.h"
#include "format-util.h"
#include "fstab-util.h"
#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
#include "special.h"
#include "string-table.h"
#include "string-util.h"
#include "swap.h"
#include "udev-util.h"
#include "unit-name.h"
#include "unit.h"
#include "virt.h"
static const UnitActiveState state_translation_table[_SWAP_STATE_MAX] = {
[SWAP_DEAD] = UNIT_INACTIVE,
[SWAP_ACTIVATING] = UNIT_ACTIVATING,
[SWAP_ACTIVATING_DONE] = UNIT_ACTIVE,
[SWAP_ACTIVE] = UNIT_ACTIVE,
[SWAP_DEACTIVATING] = UNIT_DEACTIVATING,
[SWAP_DEACTIVATING_SIGTERM] = UNIT_DEACTIVATING,
[SWAP_DEACTIVATING_SIGKILL] = UNIT_DEACTIVATING,
[SWAP_FAILED] = UNIT_FAILED
};
static int swap_dispatch_timer(sd_event_source *source, usec_t usec, void *userdata);
static int swap_dispatch_io(sd_event_source *source, int fd, uint32_t revents, void *userdata);
static bool SWAP_STATE_WITH_PROCESS(SwapState state) {
return IN_SET(state,
SWAP_ACTIVATING,
SWAP_ACTIVATING_DONE,
SWAP_DEACTIVATING,
SWAP_DEACTIVATING_SIGTERM,
SWAP_DEACTIVATING_SIGKILL);
}
static void swap_unset_proc_swaps(Swap *s) {
assert(s);
if (!s->from_proc_swaps)
return;
s->parameters_proc_swaps.what = mfree(s->parameters_proc_swaps.what);
s->from_proc_swaps = false;
}
static int swap_set_devnode(Swap *s, const char *devnode) {
Hashmap *swaps;
Swap *first;
int r;
assert(s);
r = hashmap_ensure_allocated(&UNIT(s)->manager->swaps_by_devnode, &path_hash_ops);
if (r < 0)
return r;
swaps = UNIT(s)->manager->swaps_by_devnode;
if (s->devnode) {
first = hashmap_get(swaps, s->devnode);
LIST_REMOVE(same_devnode, first, s);
if (first)
hashmap_replace(swaps, first->devnode, first);
else
hashmap_remove(swaps, s->devnode);
s->devnode = mfree(s->devnode);
}
if (devnode) {
s->devnode = strdup(devnode);
if (!s->devnode)
return -ENOMEM;
first = hashmap_get(swaps, s->devnode);
LIST_PREPEND(same_devnode, first, s);
return hashmap_replace(swaps, first->devnode, first);
}
return 0;
}
static void swap_init(Unit *u) {
Swap *s = SWAP(u);
assert(s);
assert(UNIT(s)->load_state == UNIT_STUB);
s->timeout_usec = u->manager->default_timeout_start_usec;
s->exec_context.std_output = u->manager->default_std_output;
s->exec_context.std_error = u->manager->default_std_error;
s->parameters_proc_swaps.priority = s->parameters_fragment.priority = -1;
s->control_command_id = _SWAP_EXEC_COMMAND_INVALID;
u->ignore_on_isolate = true;
}
static void swap_unwatch_control_pid(Swap *s) {
assert(s);
if (s->control_pid <= 0)
return;
unit_unwatch_pid(UNIT(s), s->control_pid);
s->control_pid = 0;
}
static void swap_done(Unit *u) {
Swap *s = SWAP(u);
assert(s);
swap_unset_proc_swaps(s);
swap_set_devnode(s, NULL);
s->what = mfree(s->what);
s->parameters_fragment.what = mfree(s->parameters_fragment.what);
s->parameters_fragment.options = mfree(s->parameters_fragment.options);
s->exec_runtime = exec_runtime_unref(s->exec_runtime, false);
exec_command_done_array(s->exec_command, _SWAP_EXEC_COMMAND_MAX);
s->control_command = NULL;
dynamic_creds_unref(&s->dynamic_creds);
swap_unwatch_control_pid(s);
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
}
static int swap_arm_timer(Swap *s, usec_t usec) {
int r;
assert(s);
if (s->timer_event_source) {
r = sd_event_source_set_time(s->timer_event_source, usec);
if (r < 0)
return r;
return sd_event_source_set_enabled(s->timer_event_source, SD_EVENT_ONESHOT);
}
if (usec == USEC_INFINITY)
return 0;
r = sd_event_add_time(
UNIT(s)->manager->event,
&s->timer_event_source,
CLOCK_MONOTONIC,
usec, 0,
swap_dispatch_timer, s);
if (r < 0)
return r;
(void) sd_event_source_set_description(s->timer_event_source, "swap-timer");
return 0;
}
static int swap_add_device_dependencies(Swap *s) {
assert(s);
if (!s->what)
return 0;
if (!s->from_fragment)
return 0;
if (is_device_path(s->what))
return unit_add_node_dependency(UNIT(s), s->what, MANAGER_IS_SYSTEM(UNIT(s)->manager), UNIT_BINDS_TO, UNIT_DEPENDENCY_FILE);
else
/* File based swap devices need to be ordered after
* systemd-remount-fs.service, since they might need a
* writable file system. */
return unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, SPECIAL_REMOUNT_FS_SERVICE, NULL, true, UNIT_DEPENDENCY_FILE);
}
static int swap_add_default_dependencies(Swap *s) {
int r;
assert(s);
if (!UNIT(s)->default_dependencies)
return 0;
if (!MANAGER_IS_SYSTEM(UNIT(s)->manager))
return 0;
if (detect_container() > 0)
return 0;
/* swap units generated for the swap dev links are missing the
* ordering dep against the swap target. */
r = unit_add_dependency_by_name(UNIT(s), UNIT_BEFORE, SPECIAL_SWAP_TARGET, NULL, true, UNIT_DEPENDENCY_DEFAULT);
if (r < 0)
return r;
return unit_add_two_dependencies_by_name(UNIT(s), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true, UNIT_DEPENDENCY_DEFAULT);
}
static int swap_verify(Swap *s) {
_cleanup_free_ char *e = NULL;
int r;
if (UNIT(s)->load_state != UNIT_LOADED)
return 0;
r = unit_name_from_path(s->what, ".swap", &e);
if (r < 0)
return log_unit_error_errno(UNIT(s), r, "Failed to generate unit name from path: %m");
if (!unit_has_name(UNIT(s), e)) {
log_unit_error(UNIT(s), "Value of What= and unit name do not match, not loading.");
return -EINVAL;
}
if (s->exec_context.pam_name && s->kill_context.kill_mode != KILL_CONTROL_GROUP) {
log_unit_error(UNIT(s), "Unit has PAM enabled. Kill mode must be set to 'control-group'. Refusing to load.");
return -EINVAL;
}
return 0;
}
static int swap_load_devnode(Swap *s) {
_cleanup_udev_device_unref_ struct udev_device *d = NULL;
struct stat st;
const char *p;
assert(s);
if (stat(s->what, &st) < 0 || !S_ISBLK(st.st_mode))
return 0;
d = udev_device_new_from_devnum(UNIT(s)->manager->udev, 'b', st.st_rdev);
if (!d)
return 0;
p = udev_device_get_devnode(d);
if (!p)
return 0;
return swap_set_devnode(s, p);
}
static int swap_load(Unit *u) {
int r;
Swap *s = SWAP(u);
assert(s);
assert(u->load_state == UNIT_STUB);
/* Load a .swap file */
if (SWAP(u)->from_proc_swaps)
r = unit_load_fragment_and_dropin_optional(u);
else
r = unit_load_fragment_and_dropin(u);
if (r < 0)
return r;
if (u->load_state == UNIT_LOADED) {
if (UNIT(s)->fragment_path)
s->from_fragment = true;
if (!s->what) {
if (s->parameters_fragment.what)
s->what = strdup(s->parameters_fragment.what);
else if (s->parameters_proc_swaps.what)
s->what = strdup(s->parameters_proc_swaps.what);
else {
r = unit_name_to_path(u->id, &s->what);
if (r < 0)
return r;
}
if (!s->what)
return -ENOMEM;
}
path_kill_slashes(s->what);
if (!UNIT(s)->description) {
r = unit_set_description(u, s->what);
if (r < 0)
return r;
}
r = unit_require_mounts_for(UNIT(s), s->what, UNIT_DEPENDENCY_IMPLICIT);
if (r < 0)
return r;
r = swap_add_device_dependencies(s);
if (r < 0)
return r;
r = swap_load_devnode(s);
if (r < 0)
return r;
r = unit_patch_contexts(u);
if (r < 0)
return r;
r = unit_add_exec_dependencies(u, &s->exec_context);
if (r < 0)
return r;
r = unit_set_default_slice(u);
if (r < 0)
return r;
r = swap_add_default_dependencies(s);
if (r < 0)
return r;
}
return swap_verify(s);
}
static int swap_setup_unit(
Manager *m,
const char *what,
const char *what_proc_swaps,
int priority,
bool set_flags) {
_cleanup_free_ char *e = NULL;
bool delete = false;
Unit *u = NULL;
int r;
SwapParameters *p;
assert(m);
assert(what);
assert(what_proc_swaps);
r = unit_name_from_path(what, ".swap", &e);
if (r < 0)
return log_unit_error_errno(u, r, "Failed to generate unit name from path: %m");
u = manager_get_unit(m, e);
if (u &&
SWAP(u)->from_proc_swaps &&
!path_equal(SWAP(u)->parameters_proc_swaps.what, what_proc_swaps)) {
log_error("Swap %s appeared twice with different device paths %s and %s", e, SWAP(u)->parameters_proc_swaps.what, what_proc_swaps);
return -EEXIST;
}
if (!u) {
delete = true;
r = unit_new_for_name(m, sizeof(Swap), e, &u);
if (r < 0)
goto fail;
SWAP(u)->what = strdup(what);
if (!SWAP(u)->what) {
r = -ENOMEM;
goto fail;
}
unit_add_to_load_queue(u);
} else
delete = false;
p = &SWAP(u)->parameters_proc_swaps;
if (!p->what) {
p->what = strdup(what_proc_swaps);
if (!p->what) {
r = -ENOMEM;
goto fail;
}
}
if (set_flags) {
SWAP(u)->is_active = true;
SWAP(u)->just_activated = !SWAP(u)->from_proc_swaps;
}
SWAP(u)->from_proc_swaps = true;
p->priority = priority;
unit_add_to_dbus_queue(u);
return 0;
fail:
log_unit_warning_errno(u, r, "Failed to load swap unit: %m");
if (delete)
unit_free(u);
return r;
}
static int swap_process_new(Manager *m, const char *device, int prio, bool set_flags) {
_cleanup_udev_device_unref_ struct udev_device *d = NULL;
struct udev_list_entry *item = NULL, *first = NULL;
const char *dn;
struct stat st;
int r;
assert(m);
r = swap_setup_unit(m, device, device, prio, set_flags);
if (r < 0)
return r;
/* If this is a block device, then let's add duplicates for
* all other names of this block device */
if (stat(device, &st) < 0 || !S_ISBLK(st.st_mode))
return 0;
d = udev_device_new_from_devnum(m->udev, 'b', st.st_rdev);
if (!d)
return 0;
/* Add the main device node */
dn = udev_device_get_devnode(d);
if (dn && !streq(dn, device))
swap_setup_unit(m, dn, device, prio, set_flags);
/* Add additional units for all symlinks */
first = udev_device_get_devlinks_list_entry(d);
udev_list_entry_foreach(item, first) {
const char *p;
/* Don't bother with the /dev/block links */
p = udev_list_entry_get_name(item);
if (streq(p, device))
continue;
if (path_startswith(p, "/dev/block/"))
continue;
if (stat(p, &st) >= 0)
if (!S_ISBLK(st.st_mode) ||
st.st_rdev != udev_device_get_devnum(d))
continue;
swap_setup_unit(m, p, device, prio, set_flags);
}
return r;
}
static void swap_set_state(Swap *s, SwapState state) {
SwapState old_state;
Swap *other;
assert(s);
old_state = s->state;
s->state = state;
if (!SWAP_STATE_WITH_PROCESS(state)) {
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
swap_unwatch_control_pid(s);
s->control_command = NULL;
s->control_command_id = _SWAP_EXEC_COMMAND_INVALID;
}
if (state != old_state)
log_unit_debug(UNIT(s), "Changed %s -> %s", swap_state_to_string(old_state), swap_state_to_string(state));
unit_notify(UNIT(s), state_translation_table[old_state], state_translation_table[state], true);
/* If there other units for the same device node have a job
queued it might be worth checking again if it is runnable
now. This is necessary, since swap_start() refuses
operation with EAGAIN if there's already another job for
the same device node queued. */
LIST_FOREACH_OTHERS(same_devnode, other, s)
if (UNIT(other)->job)
job_add_to_run_queue(UNIT(other)->job);
}
static int swap_coldplug(Unit *u) {
Swap *s = SWAP(u);
SwapState new_state = SWAP_DEAD;
int r;
assert(s);
assert(s->state == SWAP_DEAD);
if (s->deserialized_state != s->state)
new_state = s->deserialized_state;
else if (s->from_proc_swaps)
new_state = SWAP_ACTIVE;
if (new_state == s->state)
return 0;
if (s->control_pid > 0 &&
pid_is_unwaited(s->control_pid) &&
SWAP_STATE_WITH_PROCESS(new_state)) {
r = unit_watch_pid(UNIT(s), s->control_pid);
if (r < 0)
return r;
r = swap_arm_timer(s, usec_add(u->state_change_timestamp.monotonic, s->timeout_usec));
if (r < 0)
return r;
}
if (!IN_SET(new_state, SWAP_DEAD, SWAP_FAILED)) {
(void) unit_setup_dynamic_creds(u);
(void) unit_setup_exec_runtime(u);
}
swap_set_state(s, new_state);
return 0;
}
static void swap_dump(Unit *u, FILE *f, const char *prefix) {
char buf[FORMAT_TIMESPAN_MAX];
Swap *s = SWAP(u);
SwapParameters *p;
assert(s);
assert(f);
if (s->from_proc_swaps)
p = &s->parameters_proc_swaps;
else if (s->from_fragment)
p = &s->parameters_fragment;
else
p = NULL;
fprintf(f,
"%sSwap State: %s\n"
"%sResult: %s\n"
"%sWhat: %s\n"
"%sFrom /proc/swaps: %s\n"
"%sFrom fragment: %s\n",
prefix, swap_state_to_string(s->state),
prefix, swap_result_to_string(s->result),
prefix, s->what,
prefix, yes_no(s->from_proc_swaps),
prefix, yes_no(s->from_fragment));
if (s->devnode)
fprintf(f, "%sDevice Node: %s\n", prefix, s->devnode);
if (p)
fprintf(f,
"%sPriority: %i\n"
"%sOptions: %s\n",
prefix, p->priority,
prefix, strempty(p->options));
fprintf(f,
"%sTimeoutSec: %s\n",
prefix, format_timespan(buf, sizeof(buf), s->timeout_usec, USEC_PER_SEC));
if (s->control_pid > 0)
fprintf(f,
"%sControl PID: "PID_FMT"\n",
prefix, s->control_pid);
exec_context_dump(&s->exec_context, f, prefix);
kill_context_dump(&s->kill_context, f, prefix);
cgroup_context_dump(&s->cgroup_context, f, prefix);
}
static int swap_spawn(Swap *s, ExecCommand *c, pid_t *_pid) {
ExecParameters exec_params = {
.flags = EXEC_APPLY_SANDBOXING|EXEC_APPLY_CHROOT|EXEC_APPLY_TTY_STDIN,
.stdin_fd = -1,
.stdout_fd = -1,
.stderr_fd = -1,
};
pid_t pid;
int r;
assert(s);
assert(c);
assert(_pid);
r = unit_prepare_exec(UNIT(s));
if (r < 0)
return r;
r = swap_arm_timer(s, usec_add(now(CLOCK_MONOTONIC), s->timeout_usec));
if (r < 0)
goto fail;
manager_set_exec_params(UNIT(s)->manager, &exec_params);
unit_set_exec_params(UNIT(s), &exec_params);
r = exec_spawn(UNIT(s),
c,
&s->exec_context,
&exec_params,
s->exec_runtime,
&s->dynamic_creds,
&pid);
if (r < 0)
goto fail;
r = unit_watch_pid(UNIT(s), pid);
if (r < 0)
/* FIXME: we need to do something here */
goto fail;
*_pid = pid;
return 0;
fail:
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
return r;
}
static void swap_enter_dead(Swap *s, SwapResult f) {
assert(s);
if (s->result == SWAP_SUCCESS)
s->result = f;
if (s->result != SWAP_SUCCESS)
log_unit_warning(UNIT(s), "Failed with result '%s'.", swap_result_to_string(s->result));
swap_set_state(s, s->result != SWAP_SUCCESS ? SWAP_FAILED : SWAP_DEAD);
s->exec_runtime = exec_runtime_unref(s->exec_runtime, true);
exec_context_destroy_runtime_directory(&s->exec_context, UNIT(s)->manager->prefix[EXEC_DIRECTORY_RUNTIME]);
unit_unref_uid_gid(UNIT(s), true);
dynamic_creds_destroy(&s->dynamic_creds);
}
static void swap_enter_active(Swap *s, SwapResult f) {
assert(s);
if (s->result == SWAP_SUCCESS)
s->result = f;
swap_set_state(s, SWAP_ACTIVE);
}
static void swap_enter_dead_or_active(Swap *s, SwapResult f) {
assert(s);
if (s->from_proc_swaps)
swap_enter_active(s, f);
else
swap_enter_dead(s, f);
}
static void swap_enter_signal(Swap *s, SwapState state, SwapResult f) {
int r;
KillOperation kop;
assert(s);
if (s->result == SWAP_SUCCESS)
s->result = f;
if (state == SWAP_DEACTIVATING_SIGTERM)
kop = KILL_TERMINATE;
else
kop = KILL_KILL;
r = unit_kill_context(UNIT(s), &s->kill_context, kop, -1, s->control_pid, false);
if (r < 0)
goto fail;
if (r > 0) {
r = swap_arm_timer(s, usec_add(now(CLOCK_MONOTONIC), s->timeout_usec));
if (r < 0)
goto fail;
swap_set_state(s, state);
} else if (state == SWAP_DEACTIVATING_SIGTERM && s->kill_context.send_sigkill)
swap_enter_signal(s, SWAP_DEACTIVATING_SIGKILL, SWAP_SUCCESS);
else
swap_enter_dead_or_active(s, SWAP_SUCCESS);
return;
fail:
log_unit_warning_errno(UNIT(s), r, "Failed to kill processes: %m");
swap_enter_dead_or_active(s, SWAP_FAILURE_RESOURCES);
}
static void swap_enter_activating(Swap *s) {
_cleanup_free_ char *opts = NULL;
int r;
assert(s);
unit_warn_leftover_processes(UNIT(s));
s->control_command_id = SWAP_EXEC_ACTIVATE;
s->control_command = s->exec_command + SWAP_EXEC_ACTIVATE;
if (s->from_fragment) {
int priority = -1;
r = fstab_find_pri(s->parameters_fragment.options, &priority);
if (r < 0)
log_warning_errno(r, "Failed to parse swap priority \"%s\", ignoring: %m", s->parameters_fragment.options);
else if (r == 1 && s->parameters_fragment.priority >= 0)
log_warning("Duplicate swap priority configuration by Priority and Options fields.");
if (r <= 0 && s->parameters_fragment.priority >= 0) {
if (s->parameters_fragment.options)
r = asprintf(&opts, "%s,pri=%i", s->parameters_fragment.options, s->parameters_fragment.priority);
else
r = asprintf(&opts, "pri=%i", s->parameters_fragment.priority);
if (r < 0)
goto fail;
}
}
r = exec_command_set(s->control_command, "/sbin/swapon", NULL);
if (r < 0)
goto fail;
if (s->parameters_fragment.options || opts) {
r = exec_command_append(s->control_command, "-o",
opts ? : s->parameters_fragment.options, NULL);
if (r < 0)
goto fail;
}
r = exec_command_append(s->control_command, s->what, NULL);
if (r < 0)
goto fail;
swap_unwatch_control_pid(s);
r = swap_spawn(s, s->control_command, &s->control_pid);
if (r < 0)
goto fail;
swap_set_state(s, SWAP_ACTIVATING);
return;
fail:
log_unit_warning_errno(UNIT(s), r, "Failed to run 'swapon' task: %m");
swap_enter_dead_or_active(s, SWAP_FAILURE_RESOURCES);
}
static void swap_enter_deactivating(Swap *s) {
int r;
assert(s);
s->control_command_id = SWAP_EXEC_DEACTIVATE;
s->control_command = s->exec_command + SWAP_EXEC_DEACTIVATE;
r = exec_command_set(s->control_command,
"/sbin/swapoff",
s->what,
NULL);
if (r < 0)
goto fail;
swap_unwatch_control_pid(s);
r = swap_spawn(s, s->control_command, &s->control_pid);
if (r < 0)
goto fail;
swap_set_state(s, SWAP_DEACTIVATING);
return;
fail:
log_unit_warning_errno(UNIT(s), r, "Failed to run 'swapoff' task: %m");
swap_enter_dead_or_active(s, SWAP_FAILURE_RESOURCES);
}
static int swap_start(Unit *u) {
Swap *s = SWAP(u), *other;
int r;
assert(s);
/* We cannot fulfill this request right now, try again later please! */
if (IN_SET(s->state,
SWAP_DEACTIVATING,
SWAP_DEACTIVATING_SIGTERM,
SWAP_DEACTIVATING_SIGKILL))
return -EAGAIN;
/* Already on it! */
if (s->state == SWAP_ACTIVATING)
return 0;
assert(IN_SET(s->state, SWAP_DEAD, SWAP_FAILED));
if (detect_container() > 0)
return -EPERM;
/* If there's a job for another swap unit for the same node
* running, then let's not dispatch this one for now, and wait
* until that other job has finished. */
LIST_FOREACH_OTHERS(same_devnode, other, s)
if (UNIT(other)->job && UNIT(other)->job->state == JOB_RUNNING)
return -EAGAIN;
r = unit_start_limit_test(u);
if (r < 0) {
swap_enter_dead(s, SWAP_FAILURE_START_LIMIT_HIT);
return r;
}
r = unit_acquire_invocation_id(u);
if (r < 0)
return r;
s->result = SWAP_SUCCESS;
u->reset_accounting = true;
swap_enter_activating(s);
return 1;
}
static int swap_stop(Unit *u) {
Swap *s = SWAP(u);
assert(s);
switch (s->state) {
case SWAP_DEACTIVATING:
case SWAP_DEACTIVATING_SIGTERM:
case SWAP_DEACTIVATING_SIGKILL:
/* Already on it */
return 0;
case SWAP_ACTIVATING:
case SWAP_ACTIVATING_DONE:
/* There's a control process pending, directly enter kill mode */
swap_enter_signal(s, SWAP_DEACTIVATING_SIGTERM, SWAP_SUCCESS);
return 0;
case SWAP_ACTIVE:
if (detect_container() > 0)
return -EPERM;
swap_enter_deactivating(s);
return 1;
default:
assert_not_reached("Unexpected state.");
}
}
static int swap_serialize(Unit *u, FILE *f, FDSet *fds) {
Swap *s = SWAP(u);
assert(s);
assert(f);
assert(fds);
unit_serialize_item(u, f, "state", swap_state_to_string(s->state));
unit_serialize_item(u, f, "result", swap_result_to_string(s->result));
if (s->control_pid > 0)
unit_serialize_item_format(u, f, "control-pid", PID_FMT, s->control_pid);
if (s->control_command_id >= 0)
unit_serialize_item(u, f, "control-command", swap_exec_command_to_string(s->control_command_id));
return 0;
}
static int swap_deserialize_item(Unit *u, const char *key, const char *value, FDSet *fds) {
Swap *s = SWAP(u);
assert(s);
assert(fds);
if (streq(key, "state")) {
SwapState state;
state = swap_state_from_string(value);
if (state < 0)
log_unit_debug(u, "Failed to parse state value: %s", value);
else
s->deserialized_state = state;
} else if (streq(key, "result")) {
SwapResult f;
f = swap_result_from_string(value);
if (f < 0)
log_unit_debug(u, "Failed to parse result value: %s", value);
else if (f != SWAP_SUCCESS)
s->result = f;
} else if (streq(key, "control-pid")) {
pid_t pid;
if (parse_pid(value, &pid) < 0)
log_unit_debug(u, "Failed to parse control-pid value: %s", value);
else
s->control_pid = pid;
} else if (streq(key, "control-command")) {
SwapExecCommand id;
id = swap_exec_command_from_string(value);
if (id < 0)
log_unit_debug(u, "Failed to parse exec-command value: %s", value);
else {
s->control_command_id = id;
s->control_command = s->exec_command + id;
}
} else
log_unit_debug(u, "Unknown serialization key: %s", key);
return 0;
}
_pure_ static UnitActiveState swap_active_state(Unit *u) {
assert(u);
return state_translation_table[SWAP(u)->state];
}
_pure_ static const char *swap_sub_state_to_string(Unit *u) {
assert(u);
return swap_state_to_string(SWAP(u)->state);
}
_pure_ static bool swap_check_gc(Unit *u) {
Swap *s = SWAP(u);
assert(s);
return s->from_proc_swaps;
}
static void swap_sigchld_event(Unit *u, pid_t pid, int code, int status) {
Swap *s = SWAP(u);
SwapResult f;
assert(s);
assert(pid >= 0);
if (pid != s->control_pid)
return;
s->control_pid = 0;
if (is_clean_exit(code, status, EXIT_CLEAN_COMMAND, NULL))
f = SWAP_SUCCESS;
else if (code == CLD_EXITED)
f = SWAP_FAILURE_EXIT_CODE;
else if (code == CLD_KILLED)
f = SWAP_FAILURE_SIGNAL;
else if (code == CLD_DUMPED)
f = SWAP_FAILURE_CORE_DUMP;
else
assert_not_reached("Unknown code");
if (s->result == SWAP_SUCCESS)
s->result = f;
if (s->control_command) {
exec_status_exit(&s->control_command->exec_status, &s->exec_context, pid, code, status);
s->control_command = NULL;
s->control_command_id = _SWAP_EXEC_COMMAND_INVALID;
}
log_unit_full(u, f == SWAP_SUCCESS ? LOG_DEBUG : LOG_NOTICE, 0,
"Swap process exited, code=%s status=%i", sigchld_code_to_string(code), status);
switch (s->state) {
case SWAP_ACTIVATING:
case SWAP_ACTIVATING_DONE:
if (f == SWAP_SUCCESS || s->from_proc_swaps)
swap_enter_active(s, f);
else
swap_enter_dead(s, f);
break;
case SWAP_DEACTIVATING:
case SWAP_DEACTIVATING_SIGKILL:
case SWAP_DEACTIVATING_SIGTERM:
swap_enter_dead_or_active(s, f);
break;
default:
assert_not_reached("Uh, control process died at wrong time.");
}
/* Notify clients about changed exit status */
unit_add_to_dbus_queue(u);
}
static int swap_dispatch_timer(sd_event_source *source, usec_t usec, void *userdata) {
Swap *s = SWAP(userdata);
assert(s);
assert(s->timer_event_source == source);
switch (s->state) {
case SWAP_ACTIVATING:
case SWAP_ACTIVATING_DONE:
log_unit_warning(UNIT(s), "Activation timed out. Stopping.");
swap_enter_signal(s, SWAP_DEACTIVATING_SIGTERM, SWAP_FAILURE_TIMEOUT);
break;
case SWAP_DEACTIVATING:
log_unit_warning(UNIT(s), "Deactivation timed out. Stopping.");
swap_enter_signal(s, SWAP_DEACTIVATING_SIGTERM, SWAP_FAILURE_TIMEOUT);
break;
case SWAP_DEACTIVATING_SIGTERM:
if (s->kill_context.send_sigkill) {
log_unit_warning(UNIT(s), "Swap process timed out. Killing.");
swap_enter_signal(s, SWAP_DEACTIVATING_SIGKILL, SWAP_FAILURE_TIMEOUT);
} else {
log_unit_warning(UNIT(s), "Swap process timed out. Skipping SIGKILL. Ignoring.");
swap_enter_dead_or_active(s, SWAP_FAILURE_TIMEOUT);
}
break;
case SWAP_DEACTIVATING_SIGKILL:
log_unit_warning(UNIT(s), "Swap process still around after SIGKILL. Ignoring.");
swap_enter_dead_or_active(s, SWAP_FAILURE_TIMEOUT);
break;
default:
assert_not_reached("Timeout at wrong time.");
}
return 0;
}
static int swap_load_proc_swaps(Manager *m, bool set_flags) {
unsigned i;
int r = 0;
assert(m);
rewind(m->proc_swaps);
(void) fscanf(m->proc_swaps, "%*s %*s %*s %*s %*s\n");
for (i = 1;; i++) {
_cleanup_free_ char *dev = NULL, *d = NULL;
int prio = 0, k;
k = fscanf(m->proc_swaps,
"%ms " /* device/file */
"%*s " /* type of swap */
"%*s " /* swap size */
"%*s " /* used */
"%i\n", /* priority */
&dev, &prio);
if (k != 2) {
if (k == EOF)
break;
log_warning("Failed to parse /proc/swaps:%u.", i);
continue;
}
if (cunescape(dev, UNESCAPE_RELAX, &d) < 0)
return log_oom();
device_found_node(m, d, true, DEVICE_FOUND_SWAP, set_flags);
k = swap_process_new(m, d, prio, set_flags);
if (k < 0)
r = k;
}
return r;
}
static int swap_dispatch_io(sd_event_source *source, int fd, uint32_t revents, void *userdata) {
Manager *m = userdata;
Unit *u;
int r;
assert(m);
assert(revents & EPOLLPRI);
r = swap_load_proc_swaps(m, true);
if (r < 0) {
log_error_errno(r, "Failed to reread /proc/swaps: %m");
/* Reset flags, just in case, for late calls */
LIST_FOREACH(units_by_type, u, m->units_by_type[UNIT_SWAP]) {
Swap *swap = SWAP(u);
swap->is_active = swap->just_activated = false;
}
return 0;
}
manager_dispatch_load_queue(m);
LIST_FOREACH(units_by_type, u, m->units_by_type[UNIT_SWAP]) {
Swap *swap = SWAP(u);
if (!swap->is_active) {
/* This has just been deactivated */
swap_unset_proc_swaps(swap);
switch (swap->state) {
case SWAP_ACTIVE:
swap_enter_dead(swap, SWAP_SUCCESS);
break;
default:
/* Fire again */
swap_set_state(swap, swap->state);
break;
}
if (swap->what)
device_found_node(m, swap->what, false, DEVICE_FOUND_SWAP, true);
} else if (swap->just_activated) {
/* New swap entry */
switch (swap->state) {
case SWAP_DEAD:
case SWAP_FAILED:
(void) unit_acquire_invocation_id(UNIT(swap));
swap_enter_active(swap, SWAP_SUCCESS);
break;
case SWAP_ACTIVATING:
swap_set_state(swap, SWAP_ACTIVATING_DONE);
break;
default:
/* Nothing really changed, but let's
* issue an notification call
* nonetheless, in case somebody is
* waiting for this. */
swap_set_state(swap, swap->state);
break;
}
}
/* Reset the flags for later calls */
swap->is_active = swap->just_activated = false;
}
return 1;
}
static Unit *swap_following(Unit *u) {
Swap *s = SWAP(u);
Swap *other, *first = NULL;
assert(s);
/* If the user configured the swap through /etc/fstab or
* a device unit, follow that. */
if (s->from_fragment)
return NULL;
LIST_FOREACH_OTHERS(same_devnode, other, s)
if (other->from_fragment)
return UNIT(other);
/* Otherwise, make everybody follow the unit that's named after
* the swap device in the kernel */
if (streq_ptr(s->what, s->devnode))
return NULL;
LIST_FOREACH_AFTER(same_devnode, other, s)
if (streq_ptr(other->what, other->devnode))
return UNIT(other);
LIST_FOREACH_BEFORE(same_devnode, other, s) {
if (streq_ptr(other->what, other->devnode))
return UNIT(other);
first = other;
}
/* Fall back to the first on the list */
return UNIT(first);
}
static int swap_following_set(Unit *u, Set **_set) {
Swap *s = SWAP(u), *other;
Set *set;
int r;
assert(s);
assert(_set);
if (LIST_JUST_US(same_devnode, s)) {
*_set = NULL;
return 0;
}
set = set_new(NULL);
if (!set)
return -ENOMEM;
LIST_FOREACH_OTHERS(same_devnode, other, s) {
r = set_put(set, other);
if (r < 0)
goto fail;
}
*_set = set;
return 1;
fail:
set_free(set);
return r;
}
static void swap_shutdown(Manager *m) {
assert(m);
m->swap_event_source = sd_event_source_unref(m->swap_event_source);
m->proc_swaps = safe_fclose(m->proc_swaps);
m->swaps_by_devnode = hashmap_free(m->swaps_by_devnode);
}
static void swap_enumerate(Manager *m) {
int r;
assert(m);
if (!m->proc_swaps) {
m->proc_swaps = fopen("/proc/swaps", "re");
if (!m->proc_swaps) {
if (errno == ENOENT)
log_debug("Not swap enabled, skipping enumeration");
else
log_error_errno(errno, "Failed to open /proc/swaps: %m");
return;
}
r = sd_event_add_io(m->event, &m->swap_event_source, fileno(m->proc_swaps), EPOLLPRI, swap_dispatch_io, m);
if (r < 0) {
log_error_errno(r, "Failed to watch /proc/swaps: %m");
goto fail;
}
/* Dispatch this before we dispatch SIGCHLD, so that
* we always get the events from /proc/swaps before
* the SIGCHLD of /sbin/swapon. */
r = sd_event_source_set_priority(m->swap_event_source, SD_EVENT_PRIORITY_NORMAL-10);
if (r < 0) {
log_error_errno(r, "Failed to change /proc/swaps priority: %m");
goto fail;
}
(void) sd_event_source_set_description(m->swap_event_source, "swap-proc");
}
r = swap_load_proc_swaps(m, false);
if (r < 0)
goto fail;
return;
fail:
swap_shutdown(m);
}
int swap_process_device_new(Manager *m, struct udev_device *dev) {
struct udev_list_entry *item = NULL, *first = NULL;
_cleanup_free_ char *e = NULL;
const char *dn;
Unit *u;
int r = 0;
assert(m);
assert(dev);
dn = udev_device_get_devnode(dev);
if (!dn)
return 0;
r = unit_name_from_path(dn, ".swap", &e);
if (r < 0)
return r;
u = manager_get_unit(m, e);
if (u)
r = swap_set_devnode(SWAP(u), dn);
first = udev_device_get_devlinks_list_entry(dev);
udev_list_entry_foreach(item, first) {
_cleanup_free_ char *n = NULL;
int q;
q = unit_name_from_path(udev_list_entry_get_name(item), ".swap", &n);
if (q < 0)
return q;
u = manager_get_unit(m, n);
if (u) {
q = swap_set_devnode(SWAP(u), dn);
if (q < 0)
r = q;
}
}
return r;
}
int swap_process_device_remove(Manager *m, struct udev_device *dev) {
const char *dn;
int r = 0;
Swap *s;
dn = udev_device_get_devnode(dev);
if (!dn)
return 0;
while ((s = hashmap_get(m->swaps_by_devnode, dn))) {
int q;
q = swap_set_devnode(s, NULL);
if (q < 0)
r = q;
}
return r;
}
static void swap_reset_failed(Unit *u) {
Swap *s = SWAP(u);
assert(s);
if (s->state == SWAP_FAILED)
swap_set_state(s, SWAP_DEAD);
s->result = SWAP_SUCCESS;
}
static int swap_kill(Unit *u, KillWho who, int signo, sd_bus_error *error) {
return unit_kill_common(u, who, signo, -1, SWAP(u)->control_pid, error);
}
static int swap_get_timeout(Unit *u, usec_t *timeout) {
Swap *s = SWAP(u);
usec_t t;
int r;
if (!s->timer_event_source)
return 0;
r = sd_event_source_get_time(s->timer_event_source, &t);
if (r < 0)
return r;
if (t == USEC_INFINITY)
return 0;
*timeout = t;
return 1;
}
static bool swap_supported(void) {
static int supported = -1;
/* If swap support is not available in the kernel, or we are
* running in a container we don't support swap units, and any
* attempts to starting one should fail immediately. */
if (supported < 0)
supported =
access("/proc/swaps", F_OK) >= 0 &&
detect_container() <= 0;
return supported;
}
static int swap_control_pid(Unit *u) {
Swap *s = SWAP(u);
assert(s);
return s->control_pid;
}
static const char* const swap_exec_command_table[_SWAP_EXEC_COMMAND_MAX] = {
[SWAP_EXEC_ACTIVATE] = "ExecActivate",
[SWAP_EXEC_DEACTIVATE] = "ExecDeactivate",
};
DEFINE_STRING_TABLE_LOOKUP(swap_exec_command, SwapExecCommand);
static const char* const swap_result_table[_SWAP_RESULT_MAX] = {
[SWAP_SUCCESS] = "success",
[SWAP_FAILURE_RESOURCES] = "resources",
[SWAP_FAILURE_TIMEOUT] = "timeout",
[SWAP_FAILURE_EXIT_CODE] = "exit-code",
[SWAP_FAILURE_SIGNAL] = "signal",
[SWAP_FAILURE_CORE_DUMP] = "core-dump",
[SWAP_FAILURE_START_LIMIT_HIT] = "start-limit-hit",
};
DEFINE_STRING_TABLE_LOOKUP(swap_result, SwapResult);
const UnitVTable swap_vtable = {
.object_size = sizeof(Swap),
.exec_context_offset = offsetof(Swap, exec_context),
.cgroup_context_offset = offsetof(Swap, cgroup_context),
.kill_context_offset = offsetof(Swap, kill_context),
.exec_runtime_offset = offsetof(Swap, exec_runtime),
.dynamic_creds_offset = offsetof(Swap, dynamic_creds),
.sections =
"Unit\0"
"Swap\0"
"Install\0",
.private_section = "Swap",
.init = swap_init,
.load = swap_load,
.done = swap_done,
.coldplug = swap_coldplug,
.dump = swap_dump,
.start = swap_start,
.stop = swap_stop,
.kill = swap_kill,
.get_timeout = swap_get_timeout,
.serialize = swap_serialize,
.deserialize_item = swap_deserialize_item,
.active_state = swap_active_state,
.sub_state_to_string = swap_sub_state_to_string,
.check_gc = swap_check_gc,
.sigchld_event = swap_sigchld_event,
.reset_failed = swap_reset_failed,
.control_pid = swap_control_pid,
.bus_vtable = bus_swap_vtable,
.bus_set_property = bus_swap_set_property,
.bus_commit_properties = bus_swap_commit_properties,
.following = swap_following,
.following_set = swap_following_set,
.enumerate = swap_enumerate,
.shutdown = swap_shutdown,
.supported = swap_supported,
.status_message_formats = {
.starting_stopping = {
[0] = "Activating swap %s...",
[1] = "Deactivating swap %s...",
},
.finished_start_job = {
[JOB_DONE] = "Activated swap %s.",
[JOB_FAILED] = "Failed to activate swap %s.",
[JOB_TIMEOUT] = "Timed out activating swap %s.",
},
.finished_stop_job = {
[JOB_DONE] = "Deactivated swap %s.",
[JOB_FAILED] = "Failed deactivating swap %s.",
[JOB_TIMEOUT] = "Timed out deactivating swap %s.",
},
},
};
| neheb/systemd | src/core/swap.c | C | gpl-2.0 | 46,326 | [
30522,
1013,
1008,
23772,
2595,
1011,
6105,
1011,
8909,
4765,
18095,
1024,
1048,
21600,
2140,
1011,
1016,
1012,
1015,
1009,
1008,
1013,
1013,
1008,
1008,
1008,
2023,
5371,
2003,
2112,
1997,
2291,
2094,
1012,
9385,
2230,
18798,
11802,
2102,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular.module('authService', [])
.factory('AuthService',
['$q', '$timeout', '$http', '$rootScope',
function ($q, $timeout, $http, $rootScope) {
// create user variable
var user = null;
// return available functions for use in the controllers
return ({
isLoggedIn: isLoggedIn,
getUserStatus: getUserStatus,
login: login,
logout: logout,
register: register,
getRegUsers: getRegUsers,
deleteUser: deleteUser
});
function isLoggedIn() {
return user;
}
function getUserStatus() {
return $http.get('/user/status')
// handle success
.success(function (data) {
user = data.status;
})
// handle error
.error(function (data) {
user = false;
});
}
function login(username, password) {
// create a new instance of deferred
var deferred = $q.defer();
// send a post request to the server
$http.post('/user/login',
{username: username, password: password})
// handle success
.success(function (data, status) {
if (status === 200 && data.status) {
user = true;
$rootScope.user = data.user;
window.sessionStorage["userInfo"] = JSON.stringify(data.user);
$rootScope.userInfo = JSON.parse(window.sessionStorage["userInfo"]);
window.sessionStorage["user"] = data.user;
deferred.resolve(data.user);
} else {
user = false;
deferred.reject();
}
})
// handle error
.error(function (data) {
user = false;
deferred.reject();
});
// return promise object
return deferred.promise;
}
function logout() {
// create a new instance of deferred
var deferred = $q.defer();
// send a get request to the server
$http.get('/user/logout')
// handle success
.success(function (data) {
user = false;
deferred.resolve();
})
// handle error
.error(function (data) {
user = false;
deferred.reject();
});
// return promise object
return deferred.promise;
}
function register(regUser) {
// create a new instance of deferred
var deferred = $q.defer();
// send a post request to the server
$http.post('/user/signup', regUser)
// handle success
.success(function (data, status) {
if (status === 200 && data.status) {
deferred.resolve();
} else {
deferred.reject();
}
})
// handle error
.error(function (data) {
deferred.reject();
});
// return promise object
return deferred.promise;
}
function getRegUsers() {
var deferred = $q.defer();
$http.get('/user/allUsers')
.success(function (data, status) {
if (status === 200) {
$rootScope.regUsers = data;
deferred.resolve();
}
else {
deferred.reject();
}
})
// handle error
.error(function () {
deferred.reject();
});
// return promise object
return deferred.promise;
}
function deleteUser(id) {
var deferred = $q.defer();
$http.delete('/user/deleteUser', {params: {username: id}})
.success(function (data, status) {
if (status === 200) {
deferred.resolve();
}
})
// handle error
.error(function () {
deferred.reject();
});
return deferred.promise;
}
}
]
); | MotivityWorkOrg/buildingMaintenanceApp | client/js/services/authService.js | JavaScript | mit | 5,728 | [
30522,
16108,
1012,
11336,
1006,
1005,
8740,
26830,
2121,
7903,
2063,
1005,
1010,
1031,
1033,
1007,
1012,
4713,
1006,
1005,
8740,
26830,
2121,
7903,
2063,
1005,
1010,
1031,
1005,
1002,
1053,
1005,
1010,
1005,
1002,
2051,
5833,
1005,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
require 'doorkeeper/oauth/assertion_access_token_request'
module Doorkeeper
module Request
class Assertion
def self.build(server)
new(server)
end
attr_reader :server
def initialize(server)
@server = server
end
def request
@request ||= OAuth::AssertionAccessTokenRequest.new(server, Doorkeeper.configuration)
end
def authorize
request.authorize
end
end
end
end | kioru/doorkeeper-jwt_assertion | lib/doorkeeper/request/assertion.rb | Ruby | mit | 416 | [
30522,
5478,
1005,
2341,
13106,
1013,
1051,
4887,
2705,
1013,
23617,
1035,
3229,
1035,
19204,
1035,
5227,
1005,
11336,
2341,
13106,
11336,
5227,
2465,
23617,
13366,
2969,
1012,
30524,
1051,
4887,
2705,
1024,
1024,
23617,
6305,
9623,
16033,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package composition.webserviceclients.bruteforceprevention
import com.tzavellas.sse.guice.ScalaModule
import uk.gov.dvla.vehicles.presentation.common.webserviceclients.bruteforceprevention
import uk.gov.dvla.vehicles.presentation.common.webserviceclients.bruteforceprevention.BruteForcePreventionWebService
final class BruteForcePreventionWebServiceBinding extends ScalaModule {
def configure() = bind[BruteForcePreventionWebService].to[bruteforceprevention.WebServiceImpl].asEagerSingleton()
}
| dvla/vrm-retention-online | app/composition/webserviceclients/bruteforceprevention/BruteForcePreventionWebServiceBinding.scala | Scala | mit | 500 | [
30522,
7427,
5512,
1012,
4773,
8043,
7903,
8586,
8751,
7666,
1012,
26128,
14821,
28139,
15338,
3258,
12324,
4012,
1012,
1056,
4143,
15985,
8523,
1012,
7020,
2063,
1012,
26458,
3401,
1012,
26743,
5302,
8566,
2571,
12324,
2866,
1012,
18079,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* ################################################################
*
* ProActive Parallel Suite(TM): The Java(TM) library for
* Parallel, Distributed, Multi-Core Computing for
* Enterprise Grids & Clouds
*
* Copyright (C) 1997-2011 INRIA/University of
* Nice-Sophia Antipolis/ActiveEon
* Contact: proactive@ow2.org or contact@activeeon.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation; version 3 of
* the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* If needed, contact us to obtain a release under GPL Version 2 or 3
* or a different license than the AGPL.
*
* Initial developer(s): The ProActive Team
* http://proactive.inria.fr/team_members.htm
* Contributor(s):
*
* ################################################################
* $$PROACTIVE_INITIAL_DEV$$
*/
package org.ow2.proactive.resourcemanager.selection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import org.apache.log4j.Logger;
import org.apache.log4j.MDC;
import org.objectweb.proactive.api.PAActiveObject;
import org.objectweb.proactive.api.PAFuture;
import org.objectweb.proactive.core.node.Node;
import org.objectweb.proactive.core.node.NodeException;
import org.objectweb.proactive.utils.NamedThreadFactory;
import org.ow2.proactive.resourcemanager.authentication.Client;
import org.ow2.proactive.resourcemanager.core.RMCore;
import org.ow2.proactive.resourcemanager.core.properties.PAResourceManagerProperties;
import org.ow2.proactive.resourcemanager.exception.NotConnectedException;
import org.ow2.proactive.resourcemanager.rmnode.RMNode;
import org.ow2.proactive.resourcemanager.selection.policies.ShufflePolicy;
import org.ow2.proactive.resourcemanager.selection.topology.TopologyHandler;
import org.ow2.proactive.scripting.Script;
import org.ow2.proactive.scripting.ScriptException;
import org.ow2.proactive.scripting.ScriptResult;
import org.ow2.proactive.scripting.SelectionScript;
import org.ow2.proactive.utils.Criteria;
import org.ow2.proactive.utils.NodeSet;
import org.ow2.proactive.utils.appenders.MultipleFileAppender;
/**
* An interface of selection manager which is responsible for
* nodes selection from a pool of free nodes for further scripts execution.
*
*/
public abstract class SelectionManager {
private final static Logger logger = Logger.getLogger(SelectionManager.class);
private RMCore rmcore;
private static final int SELECTION_THEADS_NUMBER = PAResourceManagerProperties.RM_SELECTION_MAX_THREAD_NUMBER
.getValueAsInt();
private ExecutorService scriptExecutorThreadPool;
private Set<String> inProgress;
// the policy for arranging nodes
private SelectionPolicy selectionPolicy;
public SelectionManager() {
}
public SelectionManager(RMCore rmcore) {
this.rmcore = rmcore;
this.scriptExecutorThreadPool = Executors.newFixedThreadPool(SELECTION_THEADS_NUMBER,
new NamedThreadFactory("Selection manager threadpool"));
this.inProgress = Collections.synchronizedSet(new HashSet<String>());
String policyClassName = PAResourceManagerProperties.RM_SELECTION_POLICY.getValueAsString();
try {
Class<?> policyClass = Class.forName(policyClassName);
selectionPolicy = (SelectionPolicy) policyClass.newInstance();
} catch (Exception e) {
logger.error("Cannot use the specified policy class: " + policyClassName, e);
logger.warn("Using the default class: " + ShufflePolicy.class.getName());
selectionPolicy = new ShufflePolicy();
}
}
/**
* Arranges nodes for script execution based on some criteria
* for example previous execution statistics.
*
* @param nodes - nodes list for script execution
* @param scripts - set of selection scripts
* @return collection of arranged nodes
*/
public abstract List<RMNode> arrangeNodesForScriptExecution(final List<RMNode> nodes,
List<SelectionScript> scripts);
/**
* Predicts script execution result. Allows to avoid duplicate script execution
* on the same node.
*
* @param script - script to execute
* @param rmnode - target node
* @return true if script will pass on the node
*/
public abstract boolean isPassed(SelectionScript script, RMNode rmnode);
/**
* Processes script result and updates knowledge base of
* selection manager at the same time.
*
* @param script - executed script
* @param scriptResult - obtained script result
* @param rmnode - node on which script has been executed
* @return whether node is selected
*/
public abstract boolean processScriptResult(SelectionScript script, ScriptResult<Boolean> scriptResult,
RMNode rmnode);
public NodeSet selectNodes(Criteria criteria, Client client) {
if (criteria.getComputationDescriptors() != null) {
// logging selection script execution into tasks logs
MDC.getContext().put(MultipleFileAppender.FILE_NAMES, criteria.getComputationDescriptors());
}
boolean hasScripts = criteria.getScripts() != null && criteria.getScripts().size() > 0;
logger.info(client + " requested " + criteria.getSize() + " nodes with " + criteria.getTopology());
if (logger.isDebugEnabled()) {
if (hasScripts) {
logger.debug("Selection scripts:");
for (SelectionScript s : criteria.getScripts()) {
logger.debug(s);
}
}
if (criteria.getBlackList() != null && criteria.getBlackList().size() > 0) {
logger.debug("Black list nodes:");
for (Node n : criteria.getBlackList()) {
logger.debug(n);
}
}
}
// can throw Exception if topology is disabled
TopologyHandler handler = RMCore.topologyManager.getHandler(criteria.getTopology());
List<RMNode> freeNodes = rmcore.getFreeNodes();
// filtering out the "free node list"
// removing exclusion and checking permissions
List<RMNode> filteredNodes = filterOut(freeNodes, criteria.getBlackList(), client);
if (filteredNodes.size() == 0) {
return new NodeSet();
}
// arranging nodes according to the selection policy
// if could be shuffling or node source priorities
List<RMNode> afterPolicyNodes = selectionPolicy.arrangeNodes(criteria.getSize(), filteredNodes,
client);
// arranging nodes for script execution
List<RMNode> arrangedNodes = arrangeNodesForScriptExecution(afterPolicyNodes, criteria.getScripts());
List<Node> matchedNodes = null;
if (criteria.getTopology().isTopologyBased()) {
// run scripts on all available nodes
matchedNodes = runScripts(arrangedNodes, criteria.getScripts());
} else {
// run scripts not on all nodes, but always on missing number of nodes
// until required node set is found
matchedNodes = new LinkedList<Node>();
while (matchedNodes.size() < criteria.getSize()) {
int requiredNodesNumber = criteria.getSize() - matchedNodes.size();
int numberOfNodesForScriptExecution = requiredNodesNumber;
if (numberOfNodesForScriptExecution < SELECTION_THEADS_NUMBER) {
// we can run "SELECTION_THEADS_NUMBER" scripts in parallel
// in case when we need less nodes it still useful to
// the full capacity of the thread pool to find nodes quicker
// it is not important if we find more nodes than needed
// subset will be selected later (topology handlers)
numberOfNodesForScriptExecution = SELECTION_THEADS_NUMBER;
}
List<RMNode> subset = arrangedNodes.subList(0, Math.min(numberOfNodesForScriptExecution,
arrangedNodes.size()));
matchedNodes.addAll(runScripts(subset, criteria.getScripts()));
// removing subset of arrangedNodes
subset.clear();
if (arrangedNodes.size() == 0) {
break;
}
}
}
if (hasScripts) {
logger.debug(matchedNodes.size() + " nodes found after scripts execution for " + client);
}
// now we have a list of nodes which match to selection scripts
// selecting subset according to topology requirements
// TopologyHandler handler = RMCore.topologyManager.getHandler(topologyDescriptor);
if (criteria.getTopology().isTopologyBased()) {
logger.debug("Filtering nodes with topology " + criteria.getTopology());
}
NodeSet selectedNodes = handler.select(criteria.getSize(), matchedNodes);
if (selectedNodes.size() < criteria.getSize() && !criteria.isBestEffort()) {
selectedNodes.clear();
if (selectedNodes.getExtraNodes() != null) {
selectedNodes.getExtraNodes().clear();
}
}
// the nodes are selected, now mark them as busy.
for (Node node : new LinkedList<Node>(selectedNodes)) {
try {
// Synchronous call
rmcore.setBusyNode(node.getNodeInformation().getURL(), client);
} catch (NotConnectedException e) {
// client has disconnected during getNodes request
logger.warn(e.getMessage(), e);
return null;
} catch (NodeException e) {
// if something happened with node after scripts were executed
// just return less nodes and do not restart the search
selectedNodes.remove(node);
rmcore.setDownNode(node.getNodeInformation().getURL());
}
}
// marking extra selected nodes as busy
if (selectedNodes.size() > 0 && selectedNodes.getExtraNodes() != null) {
for (Node node : new LinkedList<Node>(selectedNodes.getExtraNodes())) {
try {
// synchronous call
rmcore.setBusyNode(node.getNodeInformation().getURL(), client);
} catch (NotConnectedException e) {
// client has disconnected during getNodes request
logger.warn(e.getMessage(), e);
return null;
} catch (NodeException e) {
selectedNodes.getExtraNodes().remove(node);
rmcore.setDownNode(node.getNodeInformation().getURL());
}
}
}
String extraNodes = selectedNodes.getExtraNodes() != null && selectedNodes.getExtraNodes().size() > 0 ? "and " +
selectedNodes.getExtraNodes().size() + " extra nodes"
: "";
logger.info(client + " will get " + selectedNodes.size() + " nodes " + extraNodes);
if (logger.isDebugEnabled()) {
for (Node n : selectedNodes) {
logger.debug(n.getNodeInformation().getURL());
}
}
MDC.getContext().remove(MultipleFileAppender.FILE_NAMES);
return selectedNodes;
}
/**
* Runs scripts on given set of nodes and returns matched nodes.
* It blocks until all results are obtained.
*
* @param candidates nodes to execute scripts on
* @param scripts set of scripts to execute on each node
* @return nodes matched to all scripts
*/
private List<Node> runScripts(List<RMNode> candidates, List<SelectionScript> scripts) {
List<Node> matched = new LinkedList<Node>();
if (candidates.size() == 0) {
return matched;
}
// creating script executors object to be run in dedicated thread pool
List<Callable<Node>> scriptExecutors = new LinkedList<Callable<Node>>();
synchronized (inProgress) {
if (inProgress.size() > 0) {
logger.warn(inProgress.size() + " nodes are in process of script execution");
for (String nodeName : inProgress) {
logger.warn(nodeName);
}
logger.warn("Something is wrong on these nodes");
}
for (RMNode node : candidates) {
if (!inProgress.contains(node.getNodeURL())) {
inProgress.add(node.getNodeURL());
scriptExecutors.add(new ScriptExecutor(node, scripts, this));
}
}
}
ScriptException scriptException = null;
try {
// launching
Collection<Future<Node>> matchedNodes = scriptExecutorThreadPool.invokeAll(scriptExecutors,
PAResourceManagerProperties.RM_SELECT_SCRIPT_TIMEOUT.getValueAsInt(),
TimeUnit.MILLISECONDS);
int index = 0;
// waiting for the results
for (Future<Node> futureNode : matchedNodes) {
if (!futureNode.isCancelled()) {
Node node = null;
try {
node = futureNode.get();
if (node != null) {
matched.add(node);
}
} catch (InterruptedException e) {
logger.warn("Interrupting the selection manager");
return matched;
} catch (ExecutionException e) {
// SCHEDULING-954 : an exception in script call is considered as an exception
// thrown by the script itself.
scriptException = new ScriptException("Exception occurs in selection script call", e
.getCause());
}
} else {
// no script result was obtained
logger.warn("Timeout on " + scriptExecutors.get(index));
// in this case scriptExecutionFinished may not be called
scriptExecutionFinished(((ScriptExecutor) scriptExecutors.get(index)).getRMNode()
.getNodeURL());
}
index++;
}
} catch (InterruptedException e1) {
logger.warn("Interrupting the selection manager");
}
// if the script passes on some nodes ignore the exception
if (scriptException != null && matched.size() == 0) {
throw scriptException;
}
return matched;
}
/**
* Removes exclusion nodes and nodes not accessible for the client
*
* @param freeNodes
* @param exclusion
* @param client
* @return
*/
private List<RMNode> filterOut(List<RMNode> freeNodes, NodeSet exclusion, Client client) {
List<RMNode> filteredList = new ArrayList<RMNode>();
for (RMNode node : freeNodes) {
// checking the permission
try {
client.checkPermission(node.getUserPermission(), client +
" is not authorized to get the node " + node.getNodeURL() + " from " +
node.getNodeSource().getName());
} catch (SecurityException e) {
// client does not have an access to this node
logger.debug(e.getMessage());
continue;
}
if (!contains(exclusion, node)) {
filteredList.add(node);
}
}
return filteredList;
}
public <T> List<ScriptResult<T>> executeScript(final Script<T> script, final Collection<RMNode> nodes) {
// TODO: add a specific timeout for script execution
final int timeout = PAResourceManagerProperties.RM_EXECUTE_SCRIPT_TIMEOUT.getValueAsInt();
final ArrayList<Callable<ScriptResult<T>>> scriptExecutors = new ArrayList<Callable<ScriptResult<T>>>(
nodes.size());
// Execute the script on each selected node
for (final RMNode node : nodes) {
scriptExecutors.add(new Callable<ScriptResult<T>>() {
@Override
public ScriptResult<T> call() throws Exception {
// Execute with a timeout the script by the remote handler
// and always async-unlock the node, exceptions will be treated as ExecutionException
try {
ScriptResult<T> res = node.executeScript(script);
PAFuture.waitFor(res, timeout);
return res;
//return PAFuture.getFutureValue(res, timeout);
} finally {
// cleaning the node
try {
node.clean();
} catch (Throwable ex) {
logger.error("Cannot clean the node " + node.getNodeURL(), ex);
}
SelectionManager.this.rmcore.unlockNodes(Collections.singleton(node.getNodeURL()));
}
}
@Override
public String toString() {
return "executing script on " + node.getNodeURL();
}
});
}
// Invoke all Callables and get the list of futures
List<Future<ScriptResult<T>>> futures = null;
try {
futures = this.scriptExecutorThreadPool
.invokeAll(scriptExecutors, timeout, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
logger.warn("Interrupted while waiting, unable to execute all scripts", e);
Thread.currentThread().interrupt();
}
final List<ScriptResult<T>> results = new LinkedList<ScriptResult<T>>();
int index = 0;
// waiting for the results
for (final Future<ScriptResult<T>> future : futures) {
final String description = scriptExecutors.get(index++).toString();
ScriptResult<T> result = null;
try {
result = future.get();
} catch (CancellationException e) {
result = new ScriptResult<T>(new ScriptException("Cancelled due to timeout expiration when " +
description, e));
} catch (InterruptedException e) {
result = new ScriptResult<T>(new ScriptException("Cancelled due to interruption when " +
description));
} catch (ExecutionException e) {
// Unwrap the root exception
Throwable rex = e.getCause();
result = new ScriptResult<T>(new ScriptException("Exception occured in script call when " +
description, rex));
}
results.add(result);
}
return results;
}
/**
* Indicates that script execution is finished for the node with specified url.
*/
public void scriptExecutionFinished(String nodeUrl) {
synchronized (inProgress) {
inProgress.remove(nodeUrl);
}
}
/**
* Handles shut down of the selection manager
*/
public void shutdown() {
// shutdown the thread pool without waiting for script execution completions
scriptExecutorThreadPool.shutdownNow();
PAActiveObject.terminateActiveObject(false);
}
/**
* Return true if node contains the node set.
*
* @param nodeset - a list of nodes to inspect
* @param node - a node to find
* @return true if node contains the node set.
*/
private boolean contains(NodeSet nodeset, RMNode node) {
if (nodeset == null)
return false;
for (Node n : nodeset) {
try {
if (n.getNodeInformation().getURL().equals(node.getNodeURL())) {
return true;
}
} catch (Exception e) {
continue;
}
}
return false;
}
}
| acontes/scheduling | src/resource-manager/src/org/ow2/proactive/resourcemanager/selection/SelectionManager.java | Java | agpl-3.0 | 21,348 | [
30522,
1013,
1008,
1008,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright 2009, 2010 Free Software Foundation, Inc.
*
* This software is distributed under the terms of the GNU Affero Public License.
* See the COPYING file in the main directory for details.
*
* This use of this software may be subject to additional restrictions.
* See the LEGAL file in the main directory for details.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LOGGER_H
#define LOGGER_H
#include <stdint.h>
#include <stdio.h>
#include <sstream>
#include <list>
#include <map>
#include <string>
#include "Threads.h"
#define DEFAULT_LOGGING_LEVEL "INFO"
#define DEFAULT_ALARM_PORT 10101
#define DEFAULT_MAX_ALARMS 10
#define _LOG(level) \
Log(Log::LOG_##level).get() << pthread_self() \
<< " " __FILE__ ":" << __LINE__ << ":" << __FUNCTION__ << ": "
#define LOG(wLevel) \
if (gLoggingLevel(__FILE__)>=Log::LOG_##wLevel) _LOG(wLevel)
#define OBJLOG(wLevel) \
if (gLoggingLevel(__FILE__)>=Log::LOG_##wLevel) _LOG(wLevel) << "obj: " << this << ' '
#define ISLOGGING(wLevel) \
(gLoggingLevel(__FILE__)>=Log::LOG_##wLevel)
#define LOG_ASSERT(x) { if (!(x)) LOG(ALARM) << "assertion " #x " failed"; } assert(x);
/**
A thread-safe logger, directable to any file or stream.
Derived from Dr. Dobb's Sept. 2007 issue.
This object is NOT the global logger;
every log record is an object of this class.
*/
class Log {
public:
/** Available logging levels. */
enum Level {
LOG_FORCE,
LOG_ERROR,
LOG_ALARM,
LOG_WARN,
LOG_NOTICE,
LOG_INFO,
LOG_DEBUG,
LOG_DEEPDEBUG
};
protected:
std::ostringstream mStream; ///< This is where we write the long.
Level mReportLevel; ///< Level of current repot.
static FILE *sFile;
public:
Log(Level wReportLevel)
:mReportLevel(wReportLevel)
{ }
// Most of the work in in the desctructor.
~Log();
std::ostringstream& get();
};
std::ostringstream& operator<<(std::ostringstream& os, Log::Level);
std::list<std::string> gGetLoggerAlarms(); ///< Get a copy of the recent alarm list.
/**@ Global control and initialization of the logging system. */
//@{
void gLogInit(const char* defaultLevel = DEFAULT_LOGGING_LEVEL);
Log::Level gLoggingLevel(const char *filename);
//@}
/**@name Global logging file control. */
//@{
void gSetLogFile(FILE*);
bool gSetLogFile(const char*);
//@}
#endif
// vim: ts=4 sw=4
| 0x7678/openbts- | CommonLibs/Logger.h | C | gpl-3.0 | 2,944 | [
30522,
1013,
1008,
1008,
9385,
2268,
1010,
2230,
2489,
4007,
3192,
1010,
4297,
1012,
1008,
1008,
2023,
4007,
2003,
5500,
2104,
1996,
3408,
1997,
1996,
27004,
21358,
7512,
2080,
2270,
6105,
1012,
1008,
2156,
1996,
24731,
5371,
1999,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.example.plugintest.manymethods.f.c;
public class A5 {
public static void a0(String msg) { System.out.println("msg=" + msg + 0); }
public static void a1(String msg) { System.out.println("msg=" + msg + 1); }
public static void a2(String msg) { System.out.println("msg=" + msg + 2); }
public static void a3(String msg) { System.out.println("msg=" + msg + 3); }
public static void a4(String msg) { System.out.println("msg=" + msg + 4); }
public static void a5(String msg) { System.out.println("msg=" + msg + 5); }
public static void a6(String msg) { System.out.println("msg=" + msg + 6); }
public static void a7(String msg) { System.out.println("msg=" + msg + 7); }
public static void a8(String msg) { System.out.println("msg=" + msg + 8); }
public static void a9(String msg) { System.out.println("msg=" + msg + 9); }
public static void a10(String msg) { System.out.println("msg=" + msg + 10); }
public static void a11(String msg) { System.out.println("msg=" + msg + 11); }
public static void a12(String msg) { System.out.println("msg=" + msg + 12); }
public static void a13(String msg) { System.out.println("msg=" + msg + 13); }
public static void a14(String msg) { System.out.println("msg=" + msg + 14); }
public static void a15(String msg) { System.out.println("msg=" + msg + 15); }
public static void a16(String msg) { System.out.println("msg=" + msg + 16); }
public static void a17(String msg) { System.out.println("msg=" + msg + 17); }
public static void a18(String msg) { System.out.println("msg=" + msg + 18); }
public static void a19(String msg) { System.out.println("msg=" + msg + 19); }
public static void a20(String msg) { System.out.println("msg=" + msg + 20); }
public static void a21(String msg) { System.out.println("msg=" + msg + 21); }
public static void a22(String msg) { System.out.println("msg=" + msg + 22); }
public static void a23(String msg) { System.out.println("msg=" + msg + 23); }
public static void a24(String msg) { System.out.println("msg=" + msg + 24); }
public static void a25(String msg) { System.out.println("msg=" + msg + 25); }
public static void a26(String msg) { System.out.println("msg=" + msg + 26); }
public static void a27(String msg) { System.out.println("msg=" + msg + 27); }
public static void a28(String msg) { System.out.println("msg=" + msg + 28); }
public static void a29(String msg) { System.out.println("msg=" + msg + 29); }
public static void a30(String msg) { System.out.println("msg=" + msg + 30); }
public static void a31(String msg) { System.out.println("msg=" + msg + 31); }
public static void a32(String msg) { System.out.println("msg=" + msg + 32); }
public static void a33(String msg) { System.out.println("msg=" + msg + 33); }
public static void a34(String msg) { System.out.println("msg=" + msg + 34); }
public static void a35(String msg) { System.out.println("msg=" + msg + 35); }
public static void a36(String msg) { System.out.println("msg=" + msg + 36); }
public static void a37(String msg) { System.out.println("msg=" + msg + 37); }
public static void a38(String msg) { System.out.println("msg=" + msg + 38); }
public static void a39(String msg) { System.out.println("msg=" + msg + 39); }
public static void a40(String msg) { System.out.println("msg=" + msg + 40); }
public static void a41(String msg) { System.out.println("msg=" + msg + 41); }
public static void a42(String msg) { System.out.println("msg=" + msg + 42); }
public static void a43(String msg) { System.out.println("msg=" + msg + 43); }
public static void a44(String msg) { System.out.println("msg=" + msg + 44); }
public static void a45(String msg) { System.out.println("msg=" + msg + 45); }
public static void a46(String msg) { System.out.println("msg=" + msg + 46); }
public static void a47(String msg) { System.out.println("msg=" + msg + 47); }
public static void a48(String msg) { System.out.println("msg=" + msg + 48); }
public static void a49(String msg) { System.out.println("msg=" + msg + 49); }
public static void a50(String msg) { System.out.println("msg=" + msg + 50); }
public static void a51(String msg) { System.out.println("msg=" + msg + 51); }
public static void a52(String msg) { System.out.println("msg=" + msg + 52); }
public static void a53(String msg) { System.out.println("msg=" + msg + 53); }
public static void a54(String msg) { System.out.println("msg=" + msg + 54); }
public static void a55(String msg) { System.out.println("msg=" + msg + 55); }
public static void a56(String msg) { System.out.println("msg=" + msg + 56); }
public static void a57(String msg) { System.out.println("msg=" + msg + 57); }
public static void a58(String msg) { System.out.println("msg=" + msg + 58); }
public static void a59(String msg) { System.out.println("msg=" + msg + 59); }
public static void a60(String msg) { System.out.println("msg=" + msg + 60); }
public static void a61(String msg) { System.out.println("msg=" + msg + 61); }
public static void a62(String msg) { System.out.println("msg=" + msg + 62); }
public static void a63(String msg) { System.out.println("msg=" + msg + 63); }
public static void a64(String msg) { System.out.println("msg=" + msg + 64); }
public static void a65(String msg) { System.out.println("msg=" + msg + 65); }
public static void a66(String msg) { System.out.println("msg=" + msg + 66); }
public static void a67(String msg) { System.out.println("msg=" + msg + 67); }
public static void a68(String msg) { System.out.println("msg=" + msg + 68); }
public static void a69(String msg) { System.out.println("msg=" + msg + 69); }
public static void a70(String msg) { System.out.println("msg=" + msg + 70); }
public static void a71(String msg) { System.out.println("msg=" + msg + 71); }
public static void a72(String msg) { System.out.println("msg=" + msg + 72); }
public static void a73(String msg) { System.out.println("msg=" + msg + 73); }
public static void a74(String msg) { System.out.println("msg=" + msg + 74); }
public static void a75(String msg) { System.out.println("msg=" + msg + 75); }
public static void a76(String msg) { System.out.println("msg=" + msg + 76); }
public static void a77(String msg) { System.out.println("msg=" + msg + 77); }
public static void a78(String msg) { System.out.println("msg=" + msg + 78); }
public static void a79(String msg) { System.out.println("msg=" + msg + 79); }
public static void a80(String msg) { System.out.println("msg=" + msg + 80); }
public static void a81(String msg) { System.out.println("msg=" + msg + 81); }
public static void a82(String msg) { System.out.println("msg=" + msg + 82); }
public static void a83(String msg) { System.out.println("msg=" + msg + 83); }
public static void a84(String msg) { System.out.println("msg=" + msg + 84); }
public static void a85(String msg) { System.out.println("msg=" + msg + 85); }
public static void a86(String msg) { System.out.println("msg=" + msg + 86); }
public static void a87(String msg) { System.out.println("msg=" + msg + 87); }
public static void a88(String msg) { System.out.println("msg=" + msg + 88); }
public static void a89(String msg) { System.out.println("msg=" + msg + 89); }
public static void a90(String msg) { System.out.println("msg=" + msg + 90); }
public static void a91(String msg) { System.out.println("msg=" + msg + 91); }
public static void a92(String msg) { System.out.println("msg=" + msg + 92); }
public static void a93(String msg) { System.out.println("msg=" + msg + 93); }
public static void a94(String msg) { System.out.println("msg=" + msg + 94); }
public static void a95(String msg) { System.out.println("msg=" + msg + 95); }
public static void a96(String msg) { System.out.println("msg=" + msg + 96); }
public static void a97(String msg) { System.out.println("msg=" + msg + 97); }
public static void a98(String msg) { System.out.println("msg=" + msg + 98); }
public static void a99(String msg) { System.out.println("msg=" + msg + 99); }
}
| limpoxe/Android-Plugin-Framework | Samples/PluginTest/src/main/java/com/example/plugintest/manymethods/f/c/A5.java | Java | mit | 8,249 | [
30522,
7427,
4012,
1012,
2742,
1012,
13354,
18447,
4355,
1012,
2116,
11368,
6806,
5104,
1012,
1042,
1012,
1039,
1025,
2270,
2465,
1037,
2629,
1063,
2270,
10763,
11675,
1037,
2692,
1006,
5164,
5796,
2290,
1007,
1063,
2291,
1012,
2041,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/**
* @version $Id: application.php 14401 2010-01-26 14:10:00Z louis $
* @package Joomla
* @subpackage Installation
* @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
/**
* Joomla! Application class
*
* Provide many supporting API functions
*
* @package Joomla
* @final
*/
class JInstallation extends JApplication
{
/**
* The url of the site
*
* @var string
* @access protected
*/
var $_siteURL = null;
/**
* Class constructor
*
* @access protected
* @param array An optional associative array of configuration settings.
* Recognized key values include 'clientId' (this list is not meant to be comprehensive).
*/
function __construct($config = array())
{
$config['clientId'] = 2;
parent::__construct($config);
JError::setErrorHandling(E_ALL, 'Ignore');
$this->_createConfiguration();
//Set the root in the URI based on the application name
JURI::root(null, str_replace('/'.$this->getName(), '', JURI::base(true)));
}
/**
* Render the application
*
* @access public
*/
function render()
{
$document =& JFactory::getDocument();
$config =& JFactory::getConfig();
$user =& JFactory::getUser();
switch($document->getType())
{
case 'html':
//set metadata
$document->setTitle(JText::_('PAGE_TITLE'));
break;
default: break;
}
// Define component path
define( 'JPATH_COMPONENT', JPATH_BASE.DS.'installer');
define( 'JPATH_COMPONENT_SITE', JPATH_SITE.DS.'installer');
define( 'JPATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR.DS.'installer');
// Execute the component
ob_start();
require_once(JPATH_COMPONENT.DS.'installer.php');
$contents = ob_get_contents();
ob_end_clean();
$params = array(
'template' => 'template',
'file' => 'index.php',
'directory' => JPATH_THEMES
);
$document->setBuffer( $contents, 'installation');
$document->setTitle(JText::_('PAGE_TITLE'));
$data = $document->render(false, $params);
JResponse::setBody($data);
}
/**
* Initialise the application.
*
* @access public
*/
function initialise( $options = array())
{
//Get the localisation information provided in the localise xml file
$forced = $this->getLocalise();
// Check URL arguement - useful when user has just set the language preferences
if(empty($options['language']))
{
$vars = JRequest::getVar('vars');
if ( is_array($vars) && ! empty($vars['lang']) )
{
$varLang = $vars['lang'];
$options['language'] = $varLang;
}
}
// Check the application state - useful when the user has previously set the language preference
if(empty($options['language']))
{
$configLang = $this->getUserState('application.lang');
if ( $configLang ) {
$options['language'] = $configLang;
}
}
// This could be a first-time visit - try to determine what the client accepts
if(empty($options['language']))
{
if ( empty($forced['lang'])) {
jimport('joomla.language.helper');
$options['language'] = JLanguageHelper::detectLanguage();
} else {
$options['language'] = $forced['lang'];
}
}
// Give the user English
if (empty($options['language'])) {
$options['language'] = 'en-GB';
}
//Set the language in the class
$conf =& JFactory::getConfig();
$conf->setValue('config.language', $options['language']);
$conf->setValue('config.debug_lang', $forced['debug']);
}
/**
* Set configuration values
*
* @access private
* @param array Array of configuration values
* @param string The namespace
*/
function setCfg( $vars, $namespace = 'config' ) {
$this->_registry->loadArray( $vars, $namespace );
}
/**
* Create the configuration registry
*
* @access private
*/
function _createConfiguration()
{
jimport( 'joomla.registry.registry' );
// Create the registry with a default namespace of config which is read only
$this->_registry = new JRegistry( 'config' );
}
/**
* Get the template
*
* @return string The template name
*/
function getTemplate()
{
return 'template';
}
/**
* Create the user session
*
* @access private
* @param string The sessions name
* @return object JSession
*/
function &_createSession( $name )
{
$options = array();
$options['name'] = $name;
$session = &JFactory::getSession($options);
if (!is_a($session->get('registry'), 'JRegistry')) {
// Registry has been corrupted somehow
$session->set('registry', new JRegistry('session'));
}
return $session;
}
/**
* returns the langauge code and help url set in the localise.xml file.
* Used for forcing a particular language in localised releases
*/
function getLocalise()
{
$xml = & JFactory::getXMLParser('Simple');
if (!$xml->loadFile(JPATH_SITE.DS.'installation'.DS.'localise.xml')) {
return 'no file'; //null;
}
// Check that it's a localise file
if ($xml->document->name() != 'localise') {
return 'not a localise'; //null;
}
$tags = $xml->document->children();
$ret = array();
$ret['lang'] = $tags[0]->data();
$ret['helpurl'] = $tags[1]->data();
$ret['debug'] = $tags[2]->data();
return $ret;
}
/**
* Returns the installed admin language files in the administrative and
* front-end area.
*
* @access private
* @return array Array with installed language packs in admin area
*/
function getLocaliseAdmin()
{
jimport('joomla.filesystem.folder');
// Read the files in the admin area
$path = JLanguage::getLanguagePath(JPATH_SITE.DS.'administrator');
$langfiles['admin'] = JFolder::folders( $path );
$path = JLanguage::getLanguagePath(JPATH_SITE);
$langfiles['site'] = JFolder::folders( $path );
return $langfiles;
}
}
?>
| heqiaoliu/Viral-Dark-Matter | tmp/install_4f209c9de9bf1/installation/includes/application.php | PHP | gpl-2.0 | 6,128 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
1030,
2544,
1002,
8909,
1024,
4646,
1012,
25718,
14748,
24096,
2230,
1011,
5890,
1011,
2656,
2403,
1024,
2184,
1024,
4002,
2480,
3434,
1002,
1008,
1030,
7427,
28576,
19968,
2050,
1008,
1030,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
class JConfig {
public $offline = '0';
public $offline_message = 'Diese Website ist zurzeit im Wartungsmodus.<br />Bitte später wiederkommen.';
public $display_offline_message = '1';
public $offline_image = '';
public $sitename = 'Hallenturnier';
public $editor = 'tinymce';
public $captcha = '0';
public $list_limit = '20';
public $access = '1';
public $debug = '0';
public $debug_lang = '0';
public $dbtype = 'mysqli';
public $host = 'localhost';
public $user = 'root';
public $password = '';
public $db = 'hallenturnier';
public $dbprefix = 'i78q0_';
public $live_site = '';
public $secret = 'G67cpOyTPnArzg1i';
public $gzip = '0';
public $error_reporting = 'default';
public $helpurl = 'http://help.joomla.org/proxy/index.php?option=com_help&keyref=Help{major}{minor}:{keyref}';
public $ftp_host = '';
public $ftp_port = '';
public $ftp_user = '';
public $ftp_pass = '';
public $ftp_root = '';
public $ftp_enable = '';
public $offset = 'UTC';
public $mailonline = '1';
public $mailer = 'mail';
public $mailfrom = 'christian.lochmatter@gmail.com';
public $fromname = 'Hallenturnier';
public $sendmail = '/usr/sbin/sendmail';
public $smtpauth = '0';
public $smtpuser = '';
public $smtppass = '';
public $smtphost = 'localhost';
public $smtpsecure = 'none';
public $smtpport = '25';
public $caching = '0';
public $cache_handler = 'file';
public $cachetime = '15';
public $MetaDesc = '';
public $MetaKeys = '';
public $MetaTitle = '1';
public $MetaAuthor = '1';
public $MetaVersion = '0';
public $robots = '';
public $sef = '1';
public $sef_rewrite = '0';
public $sef_suffix = '0';
public $unicodeslugs = '0';
public $feed_limit = '10';
public $log_path = 'E:\\kjoff\\bin\\xampp-win32-1.8.1-VC9\\xampp\\htdocs\\joomla_hallenturnier/logs';
public $tmp_path = 'E:\\kjoff\\bin\\xampp-win32-1.8.1-VC9\\xampp\\htdocs\\joomla_hallenturnier/tmp';
public $lifetime = '15';
public $session_handler = 'database';
} | clo/joomla_hallenturnier | configuration.php | PHP | gpl-2.0 | 1,973 | [
30522,
1026,
1029,
25718,
2465,
29175,
2239,
8873,
2290,
1063,
2270,
1002,
2125,
4179,
1027,
1005,
1014,
1005,
1025,
2270,
1002,
2125,
4179,
1035,
4471,
1027,
1005,
8289,
2063,
4037,
21541,
17924,
4371,
4183,
10047,
2162,
21847,
25855,
1761... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package remove_duplicates_from_sorted_list;
import common.ListNode;
public class RemoveDuplicatesfromSortedList {
public class Solution {
public ListNode deleteDuplicates(ListNode head) {
if (head != null) {
ListNode pre = head;
ListNode p = pre.next;
while (p != null) {
if (p.val == pre.val) {
pre.next = p.next;
} else {
pre = p;
}
p = p.next;
}
}
return head;
}
}
public static class UnitTest {
}
}
| quantumlaser/code2016 | LeetCode/Answers/Leetcode-java-solution/remove_duplicates_from_sorted_list/RemoveDuplicatesfromSortedList.java | Java | mit | 668 | [
30522,
7427,
6366,
1035,
24473,
2015,
1035,
2013,
1035,
19616,
1035,
2862,
1025,
12324,
2691,
1012,
30524,
3653,
1027,
2132,
1025,
2862,
3630,
3207,
1052,
1027,
3653,
1012,
2279,
1025,
2096,
1006,
1052,
999,
1027,
19701,
1007,
1063,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright (C) 2013 Brian Muramatsu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.btmura.android.reddit.app;
import android.database.Cursor;
import android.os.Bundle;
import android.support.v4.content.Loader;
import android.widget.ListAdapter;
interface Controller<A extends ListAdapter> {
// Lifecycle methods
void restoreInstanceState(Bundle savedInstanceState);
void saveInstanceState(Bundle outState);
// Loader-related methods
Loader<Cursor> createLoader();
void swapCursor(Cursor cursor);
A getAdapter();
}
| btmura/rbb | src/com/btmura/android/reddit/app/Controller.java | Java | apache-2.0 | 1,071 | [
30522,
1013,
1008,
1008,
9385,
1006,
1039,
1007,
2286,
4422,
14163,
14672,
10422,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1008,
2017,
2089,
2025,
2224,
2023,
5371,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Function template extract_or_default</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../../index.html" title="Chapter 1. Boost.Log v2">
<link rel="up" href="../../attributes.html#header.boost.log.attributes.value_extraction_hpp" title="Header <boost/log/attributes/value_extraction.hpp>">
<link rel="prev" href="extract_or_def_idp20406624.html" title="Function template extract_or_default">
<link rel="next" href="visitation_result.html" title="Class visitation_result">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="extract_or_def_idp20406624.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../attributes.html#header.boost.log.attributes.value_extraction_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="visitation_result.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.log.extract_or_def_idp20415472"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template extract_or_default</span></h2>
<p>boost::log::extract_or_default</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../attributes.html#header.boost.log.attributes.value_extraction_hpp" title="Header <boost/log/attributes/value_extraction.hpp>">boost/log/attributes/value_extraction.hpp</a>>
</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> DescriptorT<span class="special">,</span> <span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="special">></span> <span class="keyword">class</span> ActorT<span class="special">,</span>
<span class="keyword">typename</span> DefaultT<span class="special">></span>
<a class="link" href="result_of/extract_or_default.html" title="Struct template extract_or_default">result_of::extract_or_default</a><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">DescriptorT</span><span class="special">::</span><span class="identifier">value_type</span><span class="special">,</span> <span class="identifier">DefaultT</span><span class="special">,</span> <span class="identifier">DescriptorT</span> <span class="special">></span><span class="special">::</span><span class="identifier">type</span>
<span class="identifier">extract_or_default</span><span class="special">(</span><span class="identifier">expressions</span><span class="special">::</span><span class="identifier">attribute_keyword</span><span class="special"><</span> <span class="identifier">DescriptorT</span><span class="special">,</span> <span class="identifier">ActorT</span> <span class="special">></span> <span class="keyword">const</span> <span class="special">&</span> keyword<span class="special">,</span>
<span class="identifier">record_view</span> <span class="keyword">const</span> <span class="special">&</span> rec<span class="special">,</span> <span class="identifier">DefaultT</span> <span class="keyword">const</span> <span class="special">&</span> def_val<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idp83758512"></a><h2>Description</h2>
<p>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be visited.</p>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../doc/src/images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>Caution must be exercised if the default value is a temporary object. Because the function returns a reference, if the temporary object is destroyed, the reference may become dangling.</p></td></tr>
</table></div>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">def_val</code></span></p></td>
<td><p>The default value </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">keyword</code></span></p></td>
<td><p>The keyword of the attribute value to extract. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">rec</code></span></p></td>
<td><p>A log record view. The attribute value will be sought among those associated with the record. </p></td>
</tr>
</tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>The extracted value, if found. The default value otherwise. </p></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2007-2016 Andrey Semashev<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>).
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="extract_or_def_idp20406624.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../attributes.html#header.boost.log.attributes.value_extraction_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="visitation_result.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| calvinfarias/IC2015-2 | BOOST/boost_1_61_0/libs/log/doc/html/boost/log/extract_or_def_idp20415472.html | HTML | mit | 6,839 | [
30522,
1026,
16129,
1028,
1026,
2132,
1028,
1026,
18804,
8299,
1011,
1041,
15549,
2615,
1027,
1000,
4180,
1011,
2828,
1000,
4180,
1027,
1000,
3793,
1013,
16129,
1025,
25869,
13462,
1027,
2149,
1011,
2004,
6895,
2072,
1000,
1028,
1026,
2516,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
var searchData=
[
['wizard_2ec',['wizard.c',['../wizard_8c.html',1,'']]],
['wrapper_2ecpp',['wrapper.cpp',['../wrapper_8cpp.html',1,'']]],
['wxforms_2ec',['wxforms.c',['../wxforms_8c.html',1,'']]]
];
| gregnietsky/dtsguiapp | doxygen/html/search/files_77.js | JavaScript | gpl-3.0 | 206 | [
30522,
13075,
3945,
2850,
2696,
1027,
1031,
1031,
1005,
10276,
1035,
1016,
8586,
1005,
1010,
1031,
1005,
10276,
1012,
1039,
1005,
1010,
1031,
1005,
1012,
1012,
1013,
10276,
1035,
1022,
2278,
1012,
16129,
1005,
1010,
1015,
1010,
1005,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
import re
from PyQt5.QtCore import Qt, pyqtSlot
from PyQt5.QtWidgets import (
QPushButton,
QLineEdit,
QVBoxLayout,
QGridLayout,
QDialog,
QTableView,
QAbstractItemView,
QSpacerItem,
QSizePolicy,
QHeaderView,
)
from .exclude_list_table import ExcludeListTable
from core.exclude import AlreadyThereException
from hscommon.trans import trget
tr = trget("ui")
class ExcludeListDialog(QDialog):
def __init__(self, app, parent, model, **kwargs):
flags = Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint
super().__init__(parent, flags, **kwargs)
self.app = app
self.specific_actions = frozenset()
self._setupUI()
self.model = model # ExcludeListDialogCore
self.model.view = self
self.table = ExcludeListTable(app, view=self.tableView) # Qt ExcludeListTable
self._row_matched = False # test if at least one row matched our test string
self._input_styled = False
self.buttonAdd.clicked.connect(self.addStringFromLineEdit)
self.buttonRemove.clicked.connect(self.removeSelected)
self.buttonRestore.clicked.connect(self.restoreDefaults)
self.buttonClose.clicked.connect(self.accept)
self.buttonHelp.clicked.connect(self.display_help_message)
self.buttonTestString.clicked.connect(self.onTestStringButtonClicked)
self.inputLine.textEdited.connect(self.reset_input_style)
self.testLine.textEdited.connect(self.reset_input_style)
self.testLine.textEdited.connect(self.reset_table_style)
def _setupUI(self):
layout = QVBoxLayout(self)
gridlayout = QGridLayout()
self.buttonAdd = QPushButton(tr("Add"))
self.buttonRemove = QPushButton(tr("Remove Selected"))
self.buttonRestore = QPushButton(tr("Restore defaults"))
self.buttonTestString = QPushButton(tr("Test string"))
self.buttonClose = QPushButton(tr("Close"))
self.buttonHelp = QPushButton(tr("Help"))
self.inputLine = QLineEdit()
self.testLine = QLineEdit()
self.tableView = QTableView()
triggers = (
QAbstractItemView.DoubleClicked | QAbstractItemView.EditKeyPressed | QAbstractItemView.SelectedClicked
)
self.tableView.setEditTriggers(triggers)
self.tableView.setSelectionMode(QTableView.ExtendedSelection)
self.tableView.setSelectionBehavior(QTableView.SelectRows)
self.tableView.setShowGrid(False)
vheader = self.tableView.verticalHeader()
vheader.setSectionsMovable(True)
vheader.setVisible(False)
hheader = self.tableView.horizontalHeader()
hheader.setSectionsMovable(False)
hheader.setSectionResizeMode(QHeaderView.Fixed)
hheader.setStretchLastSection(True)
hheader.setHighlightSections(False)
hheader.setVisible(True)
gridlayout.addWidget(self.inputLine, 0, 0)
gridlayout.addWidget(self.buttonAdd, 0, 1, Qt.AlignLeft)
gridlayout.addWidget(self.buttonRemove, 1, 1, Qt.AlignLeft)
gridlayout.addWidget(self.buttonRestore, 2, 1, Qt.AlignLeft)
gridlayout.addWidget(self.buttonHelp, 3, 1, Qt.AlignLeft)
gridlayout.addWidget(self.buttonClose, 4, 1)
gridlayout.addWidget(self.tableView, 1, 0, 6, 1)
gridlayout.addItem(QSpacerItem(0, 0, QSizePolicy.Minimum, QSizePolicy.Expanding), 4, 1)
gridlayout.addWidget(self.buttonTestString, 6, 1)
gridlayout.addWidget(self.testLine, 6, 0)
layout.addLayout(gridlayout)
self.inputLine.setPlaceholderText(tr("Type a python regular expression here..."))
self.inputLine.setFocus()
self.testLine.setPlaceholderText(tr("Type a file system path or filename here..."))
self.testLine.setClearButtonEnabled(True)
# --- model --> view
def show(self):
super().show()
self.inputLine.setFocus()
@pyqtSlot()
def addStringFromLineEdit(self):
text = self.inputLine.text()
if not text:
return
try:
self.model.add(text)
except AlreadyThereException:
self.app.show_message("Expression already in the list.")
return
except Exception as e:
self.app.show_message(f"Expression is invalid: {e}")
return
self.inputLine.clear()
def removeSelected(self):
self.model.remove_selected()
def restoreDefaults(self):
self.model.restore_defaults()
def onTestStringButtonClicked(self):
input_text = self.testLine.text()
if not input_text:
self.reset_input_style()
return
# If at least one row matched, we know whether table is highlighted or not
self._row_matched = self.model.test_string(input_text)
self.table.refresh()
# Test the string currently in the input text box as well
input_regex = self.inputLine.text()
if not input_regex:
self.reset_input_style()
return
compiled = None
try:
compiled = re.compile(input_regex)
except re.error:
self.reset_input_style()
return
if self.model.is_match(input_text, compiled):
self.inputLine.setStyleSheet("background-color: rgb(10, 200, 10);")
self._input_styled = True
else:
self.reset_input_style()
def reset_input_style(self):
"""Reset regex input line background"""
if self._input_styled:
self.inputLine.setStyleSheet(self.styleSheet())
self._input_styled = False
def reset_table_style(self):
if self._row_matched:
self._row_matched = False
self.model.reset_rows_highlight()
self.table.refresh()
def display_help_message(self):
self.app.show_message(
tr(
"""\
These (case sensitive) python regular expressions will filter out files during scans.<br>\
Directores will also have their <strong>default state</strong> set to Excluded \
in the Directories tab if their name happens to match one of the selected regular expressions.<br>\
For each file collected, two tests are performed to determine whether or not to completely ignore it:<br>\
<li>1. Regular expressions with no path separator in them will be compared to the file name only.</li>
<li>2. Regular expressions with at least one path separator in them will be compared to the full path to the file.</li><br>
Example: if you want to filter out .PNG files from the "My Pictures" directory only:<br>\
<code>.*My\\sPictures\\\\.*\\.png</code><br><br>\
You can test the regular expression with the "test string" button after pasting a fake path in the test field:<br>\
<code>C:\\\\User\\My Pictures\\test.png</code><br><br>
Matching regular expressions will be highlighted.<br>\
If there is at least one highlight, the path or filename tested will be ignored during scans.<br><br>\
Directories and files starting with a period '.' are filtered out by default.<br><br>"""
)
)
| arsenetar/dupeguru | qt/exclude_list_dialog.py | Python | gpl-3.0 | 7,359 | [
30522,
1001,
2023,
4007,
2003,
7000,
2104,
1996,
1000,
14246,
2140,
2615,
2509,
1000,
6105,
2004,
2649,
1999,
1996,
1000,
6105,
1000,
5371,
1010,
1001,
2029,
2323,
2022,
2443,
2007,
2023,
7427,
1012,
1996,
3408,
2024,
2036,
2800,
2012,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# (c) Copyright 2006-2008 Nick Sieger <nicksieger@gmail.com>
# See the file LICENSE.txt included with the distribution for
# software license details.
require File.dirname(__FILE__) + "/../../spec_helper.rb"
require 'stringio'
describe "The RSpec reporter" do
before(:each) do
@error = mock("error")
@error.stub!(:expectation_not_met?).and_return(false)
@error.stub!(:pending_fixed?).and_return(false)
@report_mgr = mock("report manager")
@options = mock("options")
@args = [@options, StringIO.new("")]
@args.shift if Spec::VERSION::MAJOR == 1 && Spec::VERSION::MINOR < 1
@fmt = CI::Reporter::RSpec.new *@args
@fmt.report_manager = @report_mgr
@formatter = mock("formatter")
@fmt.formatter = @formatter
end
it "should use a progress bar formatter by default" do
fmt = CI::Reporter::RSpec.new *@args
fmt.formatter.should be_instance_of(Spec::Runner::Formatter::ProgressBarFormatter)
end
it "should use a specdoc formatter for RSpecDoc" do
fmt = CI::Reporter::RSpecDoc.new *@args
fmt.formatter.should be_instance_of(Spec::Runner::Formatter::SpecdocFormatter)
end
it "should create a test suite with one success, one failure, and one pending" do
@report_mgr.should_receive(:write_report).and_return do |suite|
suite.testcases.length.should == 3
suite.testcases[0].should_not be_failure
suite.testcases[0].should_not be_error
suite.testcases[1].should be_error
suite.testcases[2].name.should =~ /\(PENDING\)/
end
example_group = mock "example group"
example_group.stub!(:description).and_return "A context"
@formatter.should_receive(:start).with(3)
@formatter.should_receive(:example_group_started).with(example_group)
@formatter.should_receive(:example_started).exactly(3).times
@formatter.should_receive(:example_passed).once
@formatter.should_receive(:example_failed).once
@formatter.should_receive(:example_pending).once
@formatter.should_receive(:start_dump).once
@formatter.should_receive(:dump_failure).once
@formatter.should_receive(:dump_summary).once
@formatter.should_receive(:dump_pending).once
@formatter.should_receive(:close).once
@fmt.start(3)
@fmt.example_group_started(example_group)
@fmt.example_started("should pass")
@fmt.example_passed("should pass")
@fmt.example_started("should fail")
@fmt.example_failed("should fail", 1, @error)
@fmt.example_started("should be pending")
@fmt.example_pending("A context", "should be pending", "Not Yet Implemented")
@fmt.start_dump
@fmt.dump_failure(1, mock("failure"))
@fmt.dump_summary(0.1, 3, 1, 1)
@fmt.dump_pending
@fmt.close
end
it "should support RSpec 1.0.8 #add_behavior" do
@formatter.should_receive(:start)
@formatter.should_receive(:add_behaviour).with("A context")
@formatter.should_receive(:example_started).once
@formatter.should_receive(:example_passed).once
@formatter.should_receive(:dump_summary)
@report_mgr.should_receive(:write_report)
@fmt.start(2)
@fmt.add_behaviour("A context")
@fmt.example_started("should pass")
@fmt.example_passed("should pass")
@fmt.dump_summary(0.1, 1, 0, 0)
end
it "should use the example #description method when available" do
group = mock "example group"
group.stub!(:description).and_return "group description"
example = mock "example"
example.stub!(:description).and_return "should do something"
@formatter.should_receive(:start)
@formatter.should_receive(:example_group_started).with(group)
@formatter.should_receive(:example_started).with(example).once
@formatter.should_receive(:example_passed).once
@formatter.should_receive(:dump_summary)
@report_mgr.should_receive(:write_report).and_return do |suite|
suite.testcases.last.name.should == "should do something"
end
@fmt.start(2)
@fmt.example_group_started(group)
@fmt.example_started(example)
@fmt.example_passed(example)
@fmt.dump_summary(0.1, 1, 0, 0)
end
end
| Dreyerized/bananascrum | vendor/gems/ci_reporter-1.6.0/spec/ci/reporter/rspec_spec.rb | Ruby | gpl-2.0 | 4,078 | [
30522,
1001,
1006,
1039,
1007,
9385,
2294,
1011,
2263,
4172,
6859,
2099,
1026,
4172,
11741,
4590,
1030,
20917,
4014,
1012,
30524,
1035,
5371,
1035,
1035,
1007,
1009,
1000,
1013,
1012,
1012,
1013,
1012,
1012,
1013,
28699,
1035,
2393,
2121,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using System.Web.Mvc;
using FFLTask.SRV.ServiceInterface;
using FFLTask.UI.PC.Filter;
using FFLTask.SRV.ViewModel.Account;
using FFLTask.SRV.ViewModel.Shared;
namespace FFLTask.UI.PC.Controllers
{
public class RegisterController : BaseController
{
private IRegisterService _registerService;
public RegisterController(IRegisterService registerService)
{
_registerService = registerService;
}
#region URL: /Register
[HttpGet]
[CheckCookieEnabled]
public ActionResult Index()
{
return View(new RegisterModel());
}
[HttpPost]
public ActionResult Index(RegisterModel model)
{
if (!ModelState.IsValid)
{
return View(model);
}
model.ImageCode = imageCodeHelper.CheckResult();
if (model.ImageCode.ImageCodeError != ImageCodeError.NoError)
{
return View(model);
}
if (_registerService.GetUserByName(model.UserName) > 0)
{
ModelState.AddModelError("UserName", "*用户名已被使用");
return View(model);
}
int userId = _registerService.Do(model);
userHelper.SetUserId(userId.ToString());
return RedirectToAction("Profile", "User");
}
#endregion
#region Ajax
public JsonResult IsUserNameExist(string name)
{
bool duplicated = _registerService.GetUserByName(name) > 0;
return Json(duplicated);
}
#endregion
}
}
| feilang864/task.zyfei.net | UI/PC/Controllers/RegisterController.cs | C# | mit | 1,657 | [
30522,
2478,
2291,
1012,
4773,
1012,
19842,
2278,
1025,
2478,
21461,
24458,
6711,
1012,
5034,
2615,
1012,
2326,
18447,
2121,
12172,
1025,
2478,
21461,
24458,
6711,
1012,
21318,
1012,
7473,
1012,
11307,
1025,
2478,
21461,
24458,
6711,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
--
-- Add per-user disable flag
--
ALTER TABLE guacamole_user ADD COLUMN disabled boolean NOT NULL DEFAULT FALSE;
--
-- Add per-user password expiration flag
--
ALTER TABLE guacamole_user ADD COLUMN expired boolean NOT NULL DEFAULT FALSE;
| lato333/guacamole-client | extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/schema/upgrade/upgrade-pre-0.9.7.sql | SQL | apache-2.0 | 1,051 | [
30522,
1011,
1011,
1011,
1011,
7000,
2000,
1996,
15895,
4007,
3192,
1006,
2004,
2546,
1007,
2104,
2028,
1011,
1011,
2030,
2062,
12130,
6105,
10540,
1012,
2156,
1996,
5060,
5371,
1011,
1011,
5500,
2007,
2023,
2147,
2005,
3176,
2592,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* Security tag library.
*
* <pre>
* Copyright (c) 2006, Craig Condit. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* </pre>
*/
package org.randomcoder.taglibs.security; | insideo/randomcoder-taglibs | src/main/java/org/randomcoder/taglibs/security/package-info.java | Java | bsd-2-clause | 1,491 | [
30522,
1013,
1008,
1008,
1008,
3036,
6415,
3075,
1012,
1008,
1008,
1026,
3653,
1028,
1008,
9385,
1006,
1039,
30524,
1012,
2035,
2916,
9235,
1012,
1008,
1008,
25707,
1998,
2224,
1999,
3120,
1998,
12441,
3596,
1010,
2007,
2030,
2302,
1008,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// personal includes ".h"
#include "EUTELESCOPE.h"
#include "EUTelBaseDetector.h"
#include "EUTelTLUDetector.h"
// system includes <>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
using namespace std;
using namespace eutelescope;
EUTelTLUDetector::EUTelTLUDetector() : EUTelBaseDetector() {
_name = "TLU";
// nothing else to do !
}
void EUTelTLUDetector::setAndMask(unsigned short value) { _andMask = value; }
void EUTelTLUDetector::setOrMask(unsigned short value) { _orMask = value; }
void EUTelTLUDetector::setVetoMask(unsigned short value) { _vetoMask = value; }
void EUTelTLUDetector::setDUTMask(unsigned short value) { _dutMask = value; }
void EUTelTLUDetector::setFirmwareID(unsigned short value) {
_firmwareID = value;
}
void EUTelTLUDetector::setTimeInterval(short value) { _timeInterval = value; }
void EUTelTLUDetector::print(ostream &os) const {
size_t w = 35;
os << resetiosflags(ios::right) << setiosflags(ios::left) << setfill('.')
<< setw(w) << setiosflags(ios::left) << "Detector name "
<< resetiosflags(ios::left) << " " << _name << endl
<< setw(w) << setiosflags(ios::left) << "AndMask "
<< resetiosflags(ios::left) << " 0x" << to_hex(_andMask, 2) << endl
<< setw(w) << setiosflags(ios::left) << "OrMask "
<< resetiosflags(ios::left) << " 0x" << to_hex(_orMask, 2) << endl
<< setw(w) << setiosflags(ios::left) << "VetoMask "
<< resetiosflags(ios::left) << " 0x" << to_hex(_vetoMask, 2) << endl
<< setw(w) << setiosflags(ios::left) << "DUTMask "
<< resetiosflags(ios::left) << " 0x" << to_hex(_dutMask, 2) << endl
<< setw(w) << setiosflags(ios::left) << "FirmwareID "
<< resetiosflags(ios::left) << " " << _firmwareID << endl
<< setw(w) << setiosflags(ios::left) << "TimeInterval "
<< resetiosflags(ios::left) << " " << _timeInterval << setfill(' ')
<< endl;
}
| freidt/eudaq | nreader/detdescription/EUTelTLUDetector.cc | C++ | lgpl-3.0 | 1,905 | [
30522,
1013,
1013,
3167,
2950,
1000,
1012,
1044,
1000,
1001,
2421,
1000,
7327,
9834,
2229,
16186,
1012,
1044,
1000,
1001,
2421,
1000,
7327,
9834,
15058,
3207,
26557,
4263,
1012,
1044,
1000,
1001,
2421,
1000,
7327,
9834,
19646,
12672,
26557,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
This file is part of cpp-ethereum.
cpp-ethereum is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
cpp-ethereum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file whisperMessage.cpp
* @author Vladislav Gluhovsky <vlad@ethdev.com>
* @date June 2015
*/
#include <boost/test/unit_test.hpp>
#include <libdevcore/SHA3.h>
#include <libwhisper/BloomFilter.h>
#include <test/libtesteth/TestHelper.h>
using namespace std;
using namespace dev;
using namespace dev::test;
using namespace dev::shh;
using TopicBloomFilterShort = TopicBloomFilterBase<4>;
using TopicBloomFilterTest = TopicBloomFilterBase<TopicBloomFilterSize>;
void testAddNonExisting(TopicBloomFilterShort& _f, AbridgedTopic const& _h)
{
BOOST_REQUIRE(!_f.containsRaw(_h));
_f.addRaw(_h);
BOOST_REQUIRE(_f.containsRaw(_h));
}
void testRemoveExisting(TopicBloomFilterShort& _f, AbridgedTopic const& _h)
{
BOOST_REQUIRE(_f.containsRaw(_h));
_f.removeRaw(_h);
BOOST_REQUIRE(!_f.containsRaw(_h));
}
void testAddNonExistingBloom(TopicBloomFilterShort& _f, AbridgedTopic const& _h)
{
BOOST_REQUIRE(!_f.containsBloom(_h));
_f.addBloom(_h);
BOOST_REQUIRE(_f.containsBloom(_h));
}
void testRemoveExistingBloom(TopicBloomFilterShort& _f, AbridgedTopic const& _h)
{
BOOST_REQUIRE(_f.containsBloom(_h));
_f.removeBloom(_h);
BOOST_REQUIRE(!_f.containsBloom(_h));
}
double calculateExpected(TopicBloomFilterTest const& f, int n)
{
int const m = f.size * 8; // number of bits in the bloom
int const k = BitsPerBloom; // number of hash functions (e.g. bits set to 1 in every bloom)
double singleBitSet = 1.0 / m; // probability of any bit being set after inserting a single bit
double singleBitNotSet = (1.0 - singleBitSet);
double singleNot = 1; // single bit not set after inserting N elements in the bloom filter
for (int i = 0; i < k * n; ++i)
singleNot *= singleBitNotSet;
double single = 1.0 - singleNot; // probability of a single bit being set after inserting N elements in the bloom filter
double kBitsSet = 1; // probability of K bits being set after inserting N elements in the bloom filter
for (int i = 0; i < k; ++i)
kBitsSet *= single;
return kBitsSet;
}
double testFalsePositiveRate(TopicBloomFilterTest const& f, int inserted, Topic& x)
{
int const c_sampleSize = 1000;
int falsePositive = 0;
for (int i = 0; i < c_sampleSize; ++i)
{
x = sha3(x);
AbridgedTopic a(x);
if (f.containsBloom(a))
++falsePositive;
}
double res = double(falsePositive) / double(c_sampleSize);
double expected = calculateExpected(f, inserted);
double allowed = expected * 1.2 + 0.05; // allow deviations ~25%
//cnote << "Inserted: " << inserted << ", False Positive Rate: " << res << ", Expected: " << expected;
BOOST_REQUIRE(res <= allowed);
return expected;
}
BOOST_FIXTURE_TEST_SUITE(bloomFilter, TestOutputHelper)
//
// Disabled tests as they are unstable and tend to stall the test suite.
//
BOOST_AUTO_TEST_CASE(dummyTest)
{
// Added this test such that the test executable has at least one test
}
//BOOST_AUTO_TEST_CASE(falsePositiveRate)
//{
// VerbosityHolder setTemporaryLevel(10);
// cnote << "Testing Bloom Filter False Positive Rate...";
// TopicBloomFilterTest f;
// Topic x(0xC0DEFEED); // deterministic pseudorandom value
// double expectedRate = 0;
// for (int i = 1; i < 50 && isless(expectedRate, 0.5); ++i)
// {
// x = sha3(x);
// f.addBloom(AbridgedTopic(x));
// expectedRate = testFalsePositiveRate(f, i, x);
// }
//}
//BOOST_AUTO_TEST_CASE(bloomFilterRandom)
//{
// VerbosityHolder setTemporaryLevel(10);
// cnote << "Testing Bloom Filter matching...";
// TopicBloomFilterShort f;
// vector<AbridgedTopic> vec;
// Topic x(0xDEADBEEF);
// int const c_rounds = 4;
// for (int i = 0; i < c_rounds; ++i, x = sha3(x))
// vec.push_back(abridge(x));
// for (int i = 0; i < c_rounds; ++i)
// testAddNonExisting(f, vec[i]);
// for (int i = 0; i < c_rounds; ++i)
// testRemoveExisting(f, vec[i]);
// for (int i = 0; i < c_rounds; ++i)
// testAddNonExistingBloom(f, vec[i]);
// for (int i = 0; i < c_rounds; ++i)
// testRemoveExistingBloom(f, vec[i]);
//}
//BOOST_AUTO_TEST_CASE(bloomFilterRaw)
//{
// VerbosityHolder setTemporaryLevel(10);
// cnote << "Testing Raw Bloom matching...";
// TopicBloomFilterShort f;
// AbridgedTopic b00000001(0x01);
// AbridgedTopic b00010000(0x10);
// AbridgedTopic b00011000(0x18);
// AbridgedTopic b00110000(0x30);
// AbridgedTopic b00110010(0x32);
// AbridgedTopic b00111000(0x38);
// AbridgedTopic b00000110(0x06);
// AbridgedTopic b00110110(0x36);
// AbridgedTopic b00110111(0x37);
// testAddNonExisting(f, b00000001);
// testAddNonExisting(f, b00010000);
// testAddNonExisting(f, b00011000);
// testAddNonExisting(f, b00110000);
// BOOST_REQUIRE(f.contains(b00111000));
// testAddNonExisting(f, b00110010);
// testAddNonExisting(f, b00000110);
// BOOST_REQUIRE(f.contains(b00110110));
// BOOST_REQUIRE(f.contains(b00110111));
// f.removeRaw(b00000001);
// f.removeRaw(b00000001);
// f.removeRaw(b00000001);
// BOOST_REQUIRE(!f.contains(b00000001));
// BOOST_REQUIRE(f.contains(b00010000));
// BOOST_REQUIRE(f.contains(b00011000));
// BOOST_REQUIRE(f.contains(b00110000));
// BOOST_REQUIRE(f.contains(b00110010));
// BOOST_REQUIRE(f.contains(b00111000));
// BOOST_REQUIRE(f.contains(b00000110));
// BOOST_REQUIRE(f.contains(b00110110));
// BOOST_REQUIRE(!f.contains(b00110111));
// f.removeRaw(b00010000);
// BOOST_REQUIRE(!f.contains(b00000001));
// BOOST_REQUIRE(f.contains(b00010000));
// BOOST_REQUIRE(f.contains(b00011000));
// BOOST_REQUIRE(f.contains(b00110000));
// BOOST_REQUIRE(f.contains(b00110010));
// BOOST_REQUIRE(f.contains(b00111000));
// BOOST_REQUIRE(f.contains(b00000110));
// BOOST_REQUIRE(f.contains(b00110110));
// BOOST_REQUIRE(!f.contains(b00110111));
// f.removeRaw(b00111000);
// BOOST_REQUIRE(!f.contains(b00000001));
// BOOST_REQUIRE(f.contains(b00010000));
// BOOST_REQUIRE(!f.contains(b00011000));
// BOOST_REQUIRE(f.contains(b00110000));
// BOOST_REQUIRE(f.contains(b00110010));
// BOOST_REQUIRE(!f.contains(b00111000));
// BOOST_REQUIRE(f.contains(b00000110));
// BOOST_REQUIRE(f.contains(b00110110));
// BOOST_REQUIRE(!f.contains(b00110111));
// f.addRaw(b00000001);
// BOOST_REQUIRE(f.contains(b00000001));
// BOOST_REQUIRE(f.contains(b00010000));
// BOOST_REQUIRE(!f.contains(b00011000));
// BOOST_REQUIRE(f.contains(b00110000));
// BOOST_REQUIRE(f.contains(b00110010));
// BOOST_REQUIRE(!f.contains(b00111000));
// BOOST_REQUIRE(f.contains(b00000110));
// BOOST_REQUIRE(f.contains(b00110110));
// BOOST_REQUIRE(f.contains(b00110111));
// f.removeRaw(b00110111);
// BOOST_REQUIRE(!f.contains(b00000001));
// BOOST_REQUIRE(f.contains(b00010000));
// BOOST_REQUIRE(!f.contains(b00011000));
// BOOST_REQUIRE(!f.contains(b00110000));
// BOOST_REQUIRE(!f.contains(b00110010));
// BOOST_REQUIRE(!f.contains(b00111000));
// BOOST_REQUIRE(!f.contains(b00000110));
// BOOST_REQUIRE(!f.contains(b00110110));
// BOOST_REQUIRE(!f.contains(b00110111));
// f.removeRaw(b00110111);
// BOOST_REQUIRE(!f.contains(b00000001));
// BOOST_REQUIRE(!f.contains(b00010000));
// BOOST_REQUIRE(!f.contains(b00011000));
// BOOST_REQUIRE(!f.contains(b00110000));
// BOOST_REQUIRE(!f.contains(b00110010));
// BOOST_REQUIRE(!f.contains(b00111000));
// BOOST_REQUIRE(!f.contains(b00000110));
// BOOST_REQUIRE(!f.contains(b00110110));
// BOOST_REQUIRE(!f.contains(b00110111));
//}
//static const unsigned DistributionTestSize = TopicBloomFilterSize;
//static const unsigned TestArrSize = 8 * DistributionTestSize;
//void updateDistribution(FixedHash<DistributionTestSize> const& _h, array<unsigned, TestArrSize>& _distribution)
//{
// unsigned bits = 0;
// for (unsigned i = 0; i < DistributionTestSize; ++i)
// if (_h[i])
// for (unsigned j = 0; j < 8; ++j)
// if (_h[i] & c_powerOfTwoBitMmask[j])
// {
// _distribution[i * 8 + j]++;
// if (++bits >= BitsPerBloom)
// return;
// }
//}
//BOOST_AUTO_TEST_CASE(distributionRate)
//{
// cnote << "Testing Bloom Filter Distribution Rate...";
// array<unsigned, TestArrSize> distribution;
// for (unsigned i = 0; i < TestArrSize; ++i)
// distribution[i] = 0;
// Topic x(0xC0FFEE); // deterministic pseudorandom value
// for (unsigned i = 0; i < 26000; ++i)
// {
// x = sha3(x);
// FixedHash<DistributionTestSize> h = TopicBloomFilter::bloom(abridge(x));
// updateDistribution(h, distribution);
// }
// unsigned average = 0;
// for (unsigned i = 0; i < TestArrSize; ++i)
// average += distribution[i];
// average /= TestArrSize;
// unsigned deviation = average / 3;
// unsigned maxAllowed = average + deviation;
// unsigned minAllowed = average - deviation;
// unsigned maximum = 0;
// unsigned minimum = 0xFFFFFFFF;
// for (unsigned i = 0; i < TestArrSize; ++i)
// {
// unsigned const& z = distribution[i];
// if (z > maximum)
// maximum = z;
// else if (z < minimum)
// minimum = z;
// }
// cnote << minimum << average << maximum;
// BOOST_REQUIRE(minimum > minAllowed);
// BOOST_REQUIRE(maximum < maxAllowed);
//}
BOOST_AUTO_TEST_SUITE_END()
| chfast/cpp-ethereum | test/libwhisper/bloomFilter.cpp | C++ | gpl-3.0 | 9,520 | [
30522,
1013,
1008,
2023,
5371,
2003,
2112,
1997,
18133,
2361,
1011,
28855,
14820,
1012,
18133,
2361,
1011,
28855,
14820,
2003,
2489,
4007,
1024,
2017,
2064,
2417,
2923,
3089,
8569,
2618,
2009,
1998,
1013,
2030,
30524,
2115,
5724,
1007,
2151... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
-----------------------------------
-- Area: Windurst Woods
-- NPC: Matata
-- Type: Standard NPC
-- Involved in quest: In a Stew
-- !pos 131 -5 -109 241
-----------------------------------
require("scripts/globals/quests")
-----------------------------------
function onTrade(player,npc,trade)
end
function onTrigger(player,npc)
local IAS = player:getQuestStatus(WINDURST, IN_A_STEW)
local IASvar = player:getVar("IASvar")
local CB = player:getQuestStatus(WINDURST, CHOCOBILIOUS)
-- IN A STEW
if IAS == QUEST_ACCEPTED and IASvar == 1 then
player:startEvent(233, 0, 0, 4545) -- In a Stew in progress
elseif IAS == QUEST_ACCEPTED and IASvar == 2 then
player:startEvent(237) -- In a Stew reminder
elseif IAS == QUEST_COMPLETED then
player:startEvent(241) -- new dialog after In a Stew
-- CHOCOBILIOUS
elseif CB == QUEST_COMPLETED then
player:startEvent(226) -- Chocobilious complete
-- STANDARD DIALOG
else
player:startEvent(223)
end
end
function onEventUpdate(player,csid,option)
end
function onEventFinish(player,csid,option)
-- IN A STEW
if csid == 233 then
player:setVar("IASvar", 2)
end
end
| m3rlin87/darkstar | scripts/zones/Windurst_Woods/npcs/Matata.lua | Lua | gpl-3.0 | 1,209 | [
30522,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
2181,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<html xmlns="http://www.w3.org/1999/xhtml"><head><title></title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><link rel="stylesheet" href="css/black-tie/jquery-ui-1.8.2.custom.css" type="text/css"></link><link rel="stylesheet" href="css/jquery.treeview.css" type="text/css"></link><link rel="stylesheet" href="css/default.css" type="text/css"></link><script type="text/javascript" src="js/jquery-1.4.2.min.js"></script><script type="text/javascript" src="js/jquery-ui-1.8.2.custom.min.js"></script><script type="text/javascript" src="js/jquery.cookie.js"></script><script type="text/javascript" src="js/jquery.treeview.js"></script></head><body><script type="text/javascript">
$(document).ready(function()
{
$(".filetree").treeview({
animated: "fast",
collapsed: true,
persist: "cookie"
});
});
function jq_escape(myid)
{
return '#' + myid.replace(/(#|\$|:|\.|\(|\))/g, '\\$1');
}
function applySearchHash()
{
hashes = document.location.hash.substr(1, document.location.hash.length);
if (hashes != "")
{
hashes = hashes.split('/');
$.each(hashes, function(index, hash)
{
node = $(jq_escape(hash));
switch (node[0].nodeName)
{
case 'DIV':
tabs = node.parents('.tabs');
$(tabs[0]).tabs('select', '#' + hash)
break;
case 'A':
window.scrollTo(0, node.offset().top);
break;
}
});
}
}
jQuery(function()
{
jQuery(".tabs").tabs();
applySearchHash();
});
</script><div id="maincontainer"><div id="header"><h1><img src="images/top-stopper.png"></img></h1></div><ul xmlns="" id="menu">
<li><a href="graph.html">Class diagram</a></li>
<li><a href="markers.html">TODO / Markers</a></li>
<li><a href="parse_markers.html">Errors</a></li>
</ul>
<div id="content_container"><div xmlns="" id="content">
<h1>OpenCloud/LoadBalancer/Service.php</h1>
<div class="file_menu">
<a href="#classes">Classes</a> |</div>
<div class="properties">
<h1>Properties</h1>
<label class="property-key">author</label><div class="property-value"></div>
<label class="property-key">copyright</label><div class="property-value"></div>
<label class="property-key">package</label><div class="property-value"></div>
<label class="property-key">version</label><div class="property-value"></div>
</div>
<h2>Description</h2>Rackspace's Cloud Load Balancers<br><br><a name="classes"></a><h2>Classes</h2>
<div id="Service" class="class">
<h3>Service</h3>
<div class="properties">
<h1>Properties</h1>
<label class="property-key">Extends</label><div class="property-value">
</div>
<label class="property-key">Implements</label><div class="property-value">
</div>
<label class="property-key">author</label><div class="property-value">
<a title="" href="mailto:glen.campbell@rackspace.com">Glen Campbell</a>
</div>
<label class="property-key">Abstract</label><div class="property-value">No
</div>
<label class="property-key">Final</label><div class="property-value">No
</div>
</div>
<h4>Description</h4>
<em>The Rackspace Cloud Load Balancers</em><br>Nova is used as a basis for several products, including Compute services
as well as Rackspace's Cloud Databases. This class is, in essence, a vehicle
for sharing common code between those other classes.<br><div id="methods_Service">
<h4>Methods</h4>
<a style="font-style: italic;" href="#Service::Algorithm()">Algorithm</a>,
<a style="font-style: italic;" href="#Service::AlgorithmList()">AlgorithmList</a>,
<a style="font-style: italic;" href="#Service::AllowedDomain()">AllowedDomain</a>,
<a style="font-style: italic;" href="#Service::AllowedDomainList()">AllowedDomainList</a>,
<a style="font-style: italic;" href="#Service::BillableLoadBalancer()">BillableLoadBalancer</a>,
<a style="font-style: italic;" href="#Service::BillableLoadBalancerList()">BillableLoadBalancerList</a>,
<a style="font-style: italic;" href="#Service::LoadBalancer()">LoadBalancer</a>,
<a style="font-style: italic;" href="#Service::LoadBalancerList()">LoadBalancerList</a>,
<a style="font-style: italic;" href="#Service::Protocol()">Protocol</a>,
<a style="font-style: italic;" href="#Service::ProtocolList()">ProtocolList</a>,
<a style="font-style: italic;" href="#Service::Url()">Url</a>,
<a style="font-style: italic;" href="#Service::__construct()">__construct</a>,
<div class="method">
<a id="Service::Algorithm()"></a><h3>Algorithm<span class="nb-faded-text">(
$data
= null,
)
</span>
:
<span class="nb-faded-text">\OpenCloud\LoadBalancer\LoadBalancerService\Algorithm</span>
</h3>
<h4>Description</h4>
<em>single algorithm (should never be called directly)</em><br><small>convenience method used by the Collection factory</small><br><h4>Arguments</h4>
<table>
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr></thead>
<tbody><tr>
<td>$data</td>
<td style="white-space: normal;">n/a</td>
<td></td>
<td>null</td>
</tr></tbody>
</table>
<h4>Return value</h4>
<table>
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tbody><tr>
<td>\OpenCloud\LoadBalancer\LoadBalancerService\Algorithm</td>
<td></td>
</tr></tbody>
</table>
</div>
<div class="method">
<a id="Service::AlgorithmList()"></a><h3>AlgorithmList<span class="nb-faded-text">(
)
</span>
:
<span class="nb-faded-text">\OpenCloud\LoadBalancer\Collection</span>
</h3>
<h4>Description</h4>
<em>a list of Algorithm objects</em><br><h4>Return value</h4>
<table>
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tbody><tr>
<td>\OpenCloud\LoadBalancer\Collection</td>
<td></td>
</tr></tbody>
</table>
<h4>Tags</h4>
<table>
<thead><tr>
<th>Name</th>
<th>Description</th>
</tr></thead>
<tbody><tr>
<td>api</td>
<td></td>
</tr></tbody>
</table>
</div>
<div class="method">
<a id="Service::AllowedDomain()"></a><h3>AllowedDomain<span class="nb-faded-text">(
mixed
$data
= null,
)
</span>
:
<span class="nb-faded-text">\OpenCloud\LoadBalancer\LoadBalancerService\AllowedDomain</span>
</h3>
<h4>Description</h4>
<em>returns allowed domain</em><br><h4>Arguments</h4>
<table>
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr></thead>
<tbody><tr>
<td>$data</td>
<td style="white-space: normal;">mixed</td>
<td><p>either an array of values or null</p></td>
<td>null</td>
</tr></tbody>
</table>
<h4>Return value</h4>
<table>
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tbody><tr>
<td>\OpenCloud\LoadBalancer\LoadBalancerService\AllowedDomain</td>
<td></td>
</tr></tbody>
</table>
<h4>Tags</h4>
<table>
<thead><tr>
<th>Name</th>
<th>Description</th>
</tr></thead>
<tbody><tr>
<td>api</td>
<td></td>
</tr></tbody>
</table>
</div>
<div class="method">
<a id="Service::AllowedDomainList()"></a><h3>AllowedDomainList<span class="nb-faded-text">(
)
</span>
:
<span class="nb-faded-text">\OpenCloud\LoadBalancer\Collection</span>
</h3>
<h4>Description</h4>
<em>returns Collection of AllowedDomain object</em><br><h4>Return value</h4>
<table>
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tbody><tr>
<td>\OpenCloud\LoadBalancer\Collection</td>
<td></td>
</tr></tbody>
</table>
<h4>Tags</h4>
<table>
<thead><tr>
<th>Name</th>
<th>Description</th>
</tr></thead>
<tbody><tr>
<td>api</td>
<td></td>
</tr></tbody>
</table>
</div>
<div class="method">
<a id="Service::BillableLoadBalancer()"></a><h3>BillableLoadBalancer<span class="nb-faded-text">(
string
$id
= null,
)
</span>
:
<span class="nb-faded-text">\OpenCloud\LoadBalancer\LoadBalancerService\LoadBalancer</span>
</h3>
<h4>Description</h4>
<em>creates a new BillableLoadBalancer object (read-only)</em><br><h4>Arguments</h4>
<table>
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr></thead>
<tbody><tr>
<td>$id</td>
<td style="white-space: normal;">string</td>
<td><p>the identifier of the load balancer</p></td>
<td>null</td>
</tr></tbody>
</table>
<h4>Return value</h4>
<table>
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tbody><tr>
<td>\OpenCloud\LoadBalancer\LoadBalancerService\LoadBalancer</td>
<td></td>
</tr></tbody>
</table>
<h4>Tags</h4>
<table>
<thead><tr>
<th>Name</th>
<th>Description</th>
</tr></thead>
<tbody><tr>
<td>api</td>
<td></td>
</tr></tbody>
</table>
</div>
<div class="method">
<a id="Service::BillableLoadBalancerList()"></a><h3>BillableLoadBalancerList<span class="nb-faded-text">(
boolean
$detail
= true,
array
$filter
= array(),
)
</span>
:
<span class="nb-faded-text">\OpenCloud\Collection</span>
</h3>
<h4>Description</h4>
<em>returns a Collection of BillableLoadBalancer objects</em><br><h4>Arguments</h4>
<table>
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr></thead>
<tbody>
<tr>
<td>$detail</td>
<td style="white-space: normal;">boolean</td>
<td><p>if TRUE (the default), then all details are
returned; otherwise, the minimal set (ID, name) are retrieved</p>
</td>
<td>true</td>
</tr>
<tr>
<td>$filter</td>
<td style="white-space: normal;">array</td>
<td><p>if provided, a set of key/value pairs that are
set as query string parameters to the query</p>
</td>
<td>array()</td>
</tr>
</tbody>
</table>
<h4>Return value</h4>
<table>
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tbody><tr>
<td>\OpenCloud\Collection</td>
<td></td>
</tr></tbody>
</table>
<h4>Tags</h4>
<table>
<thead><tr>
<th>Name</th>
<th>Description</th>
</tr></thead>
<tbody><tr>
<td>api</td>
<td></td>
</tr></tbody>
</table>
</div>
<div class="method">
<a id="Service::LoadBalancer()"></a><h3>LoadBalancer<span class="nb-faded-text">(
string
$id
= NULL,
)
</span>
:
<span class="nb-faded-text">\OpenCloud\LoadBalancer\LoadBalancerService\LoadBalancer</span>
</h3>
<h4>Description</h4>
<em>creates a new LoadBalancer object</em><br><h4>Arguments</h4>
<table>
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr></thead>
<tbody><tr>
<td>$id</td>
<td style="white-space: normal;">string</td>
<td><p>the identifier of the load balancer</p></td>
<td>NULL</td>
</tr></tbody>
</table>
<h4>Return value</h4>
<table>
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tbody><tr>
<td>\OpenCloud\LoadBalancer\LoadBalancerService\LoadBalancer</td>
<td></td>
</tr></tbody>
</table>
<h4>Tags</h4>
<table>
<thead><tr>
<th>Name</th>
<th>Description</th>
</tr></thead>
<tbody><tr>
<td>api</td>
<td></td>
</tr></tbody>
</table>
</div>
<div class="method">
<a id="Service::LoadBalancerList()"></a><h3>LoadBalancerList<span class="nb-faded-text">(
boolean
$detail
= true,
array
$filter
= array(),
)
</span>
:
<span class="nb-faded-text">\OpenCloud\Collection</span>
</h3>
<h4>Description</h4>
<em>returns a Collection of LoadBalancer objects</em><br><h4>Arguments</h4>
<table>
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr></thead>
<tbody>
<tr>
<td>$detail</td>
<td style="white-space: normal;">boolean</td>
<td><p>if TRUE (the default), then all details are
returned; otherwise, the minimal set (ID, name) are retrieved</p>
</td>
<td>true</td>
</tr>
<tr>
<td>$filter</td>
<td style="white-space: normal;">array</td>
<td><p>if provided, a set of key/value pairs that are
set as query string parameters to the query</p>
</td>
<td>array()</td>
</tr>
</tbody>
</table>
<h4>Return value</h4>
<table>
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tbody><tr>
<td>\OpenCloud\Collection</td>
<td></td>
</tr></tbody>
</table>
<h4>Tags</h4>
<table>
<thead><tr>
<th>Name</th>
<th>Description</th>
</tr></thead>
<tbody><tr>
<td>api</td>
<td></td>
</tr></tbody>
</table>
</div>
<div class="method">
<a id="Service::Protocol()"></a><h3>Protocol<span class="nb-faded-text">(
$data
= null,
)
</span>
:
<span class="nb-faded-text">\OpenCloud\LoadBalancer\LoadBalancerService\Protocol</span>
</h3>
<h4>Description</h4>
<em>single protocol (should never be called directly)</em><br><small>Convenience method to be used by the ProtocolList Collection.</small><br><h4>Arguments</h4>
<table>
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr></thead>
<tbody><tr>
<td>$data</td>
<td style="white-space: normal;">n/a</td>
<td></td>
<td>null</td>
</tr></tbody>
</table>
<h4>Return value</h4>
<table>
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tbody><tr>
<td>\OpenCloud\LoadBalancer\LoadBalancerService\Protocol</td>
<td></td>
</tr></tbody>
</table>
</div>
<div class="method">
<a id="Service::ProtocolList()"></a><h3>ProtocolList<span class="nb-faded-text">(
)
</span>
:
<span class="nb-faded-text">\OpenCloud\LoadBalancer\Collection</span>
</h3>
<h4>Description</h4>
<em>a list of Protocol objects</em><br><h4>Return value</h4>
<table>
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tbody><tr>
<td>\OpenCloud\LoadBalancer\Collection</td>
<td></td>
</tr></tbody>
</table>
<h4>Tags</h4>
<table>
<thead><tr>
<th>Name</th>
<th>Description</th>
</tr></thead>
<tbody><tr>
<td>api</td>
<td></td>
</tr></tbody>
</table>
</div>
<div class="method">
<a id="Service::Url()"></a><h3>Url<span class="nb-faded-text">(
string
$resource
= self::URL_RESOURCE,
array
$args
= array(),
)
</span>
:
<span class="nb-faded-text">n/a</span>
</h3>
<h4>Description</h4>
<em>Returns the URL of this service, or optionally that of
an instance</em><br><h4>Arguments</h4>
<table>
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr></thead>
<tbody>
<tr>
<td>$resource</td>
<td style="white-space: normal;">string</td>
<td><p>the resource required</p></td>
<td>self::URL_RESOURCE</td>
</tr>
<tr>
<td>$args</td>
<td style="white-space: normal;">array</td>
<td><p>extra arguments to pass to the URL as query strings</p></td>
<td>array()</td>
</tr>
</tbody>
</table>
<h4>Return value</h4>
<table>
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tbody><tr>
<td>n/a</td>
<td>n/a</td>
</tr></tbody>
</table>
</div>
<div class="method">
<a id="Service::__construct()"></a><h3>__construct<span class="nb-faded-text">(
\OpenCloud\OpenStack
$conn,
string
$name,
string
$region,
string
$urltype,
)
</span>
:
<span class="nb-faded-text">n/a</span>
</h3>
<h4>Description</h4>
<em>Creates a new LoadBalancerService connection</em><br><small>This is not normally called directly, but via the factory method on the
OpenStack or Rackspace connection object.</small><br><h4>Arguments</h4>
<table>
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr></thead>
<tbody>
<tr>
<td>$conn</td>
<td style="white-space: normal;">\OpenCloud\OpenStack</td>
<td><p>the connection on which to create the service</p></td>
<td></td>
</tr>
<tr>
<td>$name</td>
<td style="white-space: normal;">string</td>
<td><p>the name of the service (e.g., "cloudDatabases")</p>
</td>
<td></td>
</tr>
<tr>
<td>$region</td>
<td style="white-space: normal;">string</td>
<td><p>the region of the service (e.g., "DFW" or "LON")</p>
</td>
<td></td>
</tr>
<tr>
<td>$urltype</td>
<td style="white-space: normal;">string</td>
<td><p>the type of URL (normally "publicURL")</p>
</td>
<td></td>
</tr>
</tbody>
</table>
<h4>Return value</h4>
<table>
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tbody><tr>
<td>n/a</td>
<td>n/a</td>
</tr></tbody>
</table>
</div>
</div>
<div id="constants_Service">
<h4>Constants</h4>
<a id="Service::JSON_ELEMENT"></a><div class="constant">
<h3>
<span class="nb-faded-text">
</span>JSON_ELEMENT<span class="nb-faded-text">
= 'loadBalancers'</span>
</h3>
<em></em><br><small></small><br><br>
</div>
<a id="Service::SERVICE_OBJECT_CLASS"></a><div class="constant">
<h3>
<span class="nb-faded-text">
</span>SERVICE_OBJECT_CLASS<span class="nb-faded-text">
= 'LoadBalancer'</span>
</h3>
<em></em><br><small></small><br><br>
</div>
<a id="Service::SERVICE_TYPE"></a><div class="constant">
<h3>
<span class="nb-faded-text">
</span>SERVICE_TYPE<span class="nb-faded-text">
= 'rax:load-balancer'</span>
</h3>
<em></em><br><small></small><br><br>
</div>
<a id="Service::URL_RESOURCE"></a><div class="constant">
<h3>
<span class="nb-faded-text">
</span>URL_RESOURCE<span class="nb-faded-text">
= 'loadbalancers'</span>
</h3>
<em></em><br><small></small><br><br>
</div>
</div>
<div style="clear: both"></div>
</div>
</div>
<small xmlns="" class="footer">Documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor 2.0.0b6
</a>.</small></div><div id="index"><div class="padder"><input id="search_box"></input><div class="section">
<h1>Namespaces</h1>
<ul id="namespaces-" class="filetree">
<li class="closed">
<span class="folder">OpenCloud</span><ul>
<li><span class="class"><a href="OpenCloud.OpenStack.html#OpenStack">OpenStack</a><br><small>The OpenStack class represents a relationship (or "connection")
between a user and a service.</small></span></li>
<li><span class="class"><a href="OpenCloud.Rackspace.html#Rackspace">Rackspace</a><br><small>Rackspace extends the OpenStack class with support for Rackspace's
API key and tenant requirements.</small></span></li>
<li class="closed">
<span class="folder">CloudMonitoring</span><ul>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Service.html#Service">Service</a><br><small>The Rackspace Cloud Monitoring service.</small></span></li>
<li class="closed">
<span class="folder">Exception</span><ul>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.AgentException.html#AgentException">AgentException</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.AlarmException.html#AlarmException">AlarmException</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.CheckException.html#CheckException">CheckException</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.CloudMonitoringException.html#CloudMonitoringException">CloudMonitoringException</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.EntityException.html#EntityException">EntityException</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.MetricException.html#MetricException">MetricException</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.NotificationHistoryException.html#NotificationHistoryException">NotificationHistoryException</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.NotificationPlanException.html#NotificationPlanException">NotificationPlanException</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.ServiceException.html#ServiceException">ServiceException</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.TestException.html#TestException">TestException</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.ZoneException.html#ZoneException">ZoneException</a><br><small></small></span></li>
</ul>
</li>
<li class="closed">
<span class="folder">Resource</span><ul>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.AbstractResource.html#AbstractResource">AbstractResource</a><br><small>Abstract AbstractResource class.</small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.Account.html#Account">Account</a><br><small>Account class.</small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.Agent.html#Agent">Agent</a><br><small>Agent class.</small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.AgentConnection.html#AgentConnection">AgentConnection</a><br><small>AgentConnection class.</small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.AgentHost.html#AgentHost">AgentHost</a><br><small>Agent class.</small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.AgentHostInfo.html#AgentHostInfo">AgentHostInfo</a><br><small>Agent class.</small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.AgentTarget.html#AgentTarget">AgentTarget</a><br><small>Agent class.</small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.AgentToken.html#AgentToken">AgentToken</a><br><small>Agent class.</small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.Alarm.html#Alarm">Alarm</a><br><small>Alarm class.</small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.Changelog.html#Changelog">Changelog</a><br><small>Changelog class.</small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.Check.html#Check">Check</a><br><small>Check class.</small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.CheckType.html#CheckType">CheckType</a><br><small>CheckType class.</small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.Entity.html#Entity">Entity</a><br><small>Entity class.</small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.Metric.html#Metric">Metric</a><br><small>Metric class.</small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.Notification.html#Notification">Notification</a><br><small>Notification class.</small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.NotificationHistory.html#NotificationHistory">NotificationHistory</a><br><small>NotificationHistory class.</small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.NotificationPlan.html#NotificationPlan">NotificationPlan</a><br><small>Abstract AbstractResource class.</small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.NotificationType.html#NotificationType">NotificationType</a><br><small>NotificationType class.</small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.ReadOnlyResource.html#ReadonlyResource">ReadonlyResource</a><br><small>ReadonlyResource class.</small></span></li>
<li><span class="interface"><a href="OpenCloud.CloudMonitoring.Resource.ResourceInterface.html#ResourceInterface">ResourceInterface</a><br><small>ResourceInterface interface.</small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.View.html#View">View</a><br><small>View class.</small></span></li>
<li><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.Zone.html#Zone">Zone</a><br><small>Zone class.</small></span></li>
</ul>
</li>
</ul>
</li>
<li class="closed">
<span class="folder">Common</span><ul>
<li><span class="class"><a href="OpenCloud.Common.Base.html#Base">Base</a><br><small>The Base class is the root class for all other objects used or defined by
this SDK.</small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Collection.html#Collection">Collection</a><br><small>Provides an abstraction for working with ordered sets of objects</small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Debug.html#Debug">Debug</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Lang.html#Lang">Lang</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Metadata.html#Metadata">Metadata</a><br><small>The Metadata class represents either Server or Image metadata</small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Nova.html#Nova">Nova</a><br><small>Nova is an abstraction layer for the OpenStack compute service.</small></span></li>
<li><span class="class"><a href="OpenCloud.Common.ObjectStore.html#ObjectStore">ObjectStore</a><br><small>Intermediate (abstract) class to implement shared
features of all object-storage classes</small></span></li>
<li><span class="class"><a href="OpenCloud.Common.PersistentObject.html#PersistentObject">PersistentObject</a><br><small>represents an object that has the ability to be
retrieved, created, updated, and deleted.</small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Service.html#Service">Service</a><br><small>This class defines a "service"—a relationship between a specific OpenStack
and a provided service, represented by a URL in the service catalog.</small></span></li>
<li><span class="class"><a href="OpenCloud.Common.ServiceCatalogItem.html#ServiceCatalogItem">ServiceCatalogItem</a><br><small>Holds information on a single service from the Service Catalog</small></span></li>
<li class="closed">
<span class="folder">Exceptions</span><ul>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.AsyncError.html#AsyncError">AsyncError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.AsyncHttpError.html#AsyncHttpError">AsyncHttpError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.AsyncTimeoutError.html#AsyncTimeoutError">AsyncTimeoutError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.AttributeError.html#AttributeError">AttributeError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.AuthenticationError.html#AuthenticationError">AuthenticationError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.BaseException.html#BaseException">BaseException</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.CdnError.html#CdnError">CdnError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.CdnHttpError.html#CdnHttpError">CdnHttpError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.CdnNotAvailableError.html#CdnNotAvailableError">CdnNotAvailableError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.CdnTtlError.html#CdnTtlError">CdnTtlError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.CollectionError.html#CollectionError">CollectionError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.ContainerCreateError.html#ContainerCreateError">ContainerCreateError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.ContainerDeleteError.html#ContainerDeleteError">ContainerDeleteError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.ContainerError.html#ContainerError">ContainerError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.ContainerNameError.html#ContainerNameError">ContainerNameError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.ContainerNotEmptyError.html#ContainerNotEmptyError">ContainerNotEmptyError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.ContainerNotFoundError.html#ContainerNotFoundError">ContainerNotFoundError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.CreateError.html#CreateError">CreateError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.CreateUpdateError.html#CreateUpdateError">CreateUpdateError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.CredentialError.html#CredentialError">CredentialError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.DatabaseCreateError.html#DatabaseCreateError">DatabaseCreateError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.DatabaseDeleteError.html#DatabaseDeleteError">DatabaseDeleteError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.DatabaseListError.html#DatabaseListError">DatabaseListError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.DatabaseNameError.html#DatabaseNameError">DatabaseNameError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.DatabaseUpdateError.html#DatabaseUpdateError">DatabaseUpdateError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.DeleteError.html#DeleteError">DeleteError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.DocumentError.html#DocumentError">DocumentError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.DomainError.html#DomainError">DomainError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.EmptyResponseError.html#EmptyResponseError">EmptyResponseError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.EndpointError.html#EndpointError">EndpointError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.FlavorError.html#FlavorError">FlavorError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.HttpError.html#HttpError">HttpError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.HttpForbiddenError.html#HttpForbiddenError">HttpForbiddenError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.HttpOverLimitError.html#HttpOverLimitError">HttpOverLimitError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.HttpRetryError.html#HttpRetryError">HttpRetryError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.HttpTimeoutError.html#HttpTimeoutError">HttpTimeoutError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.HttpUnauthorizedError.html#HttpUnauthorizedError">HttpUnauthorizedError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.HttpUrlError.html#HttpUrlError">HttpUrlError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.IOError.html#IOError">IOError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.IdRequiredError.html#IdRequiredError">IdRequiredError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.ImageError.html#ImageError">ImageError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.InstanceCreateError.html#InstanceCreateError">InstanceCreateError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.InstanceDeleteError.html#InstanceDeleteError">InstanceDeleteError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.InstanceError.html#InstanceError">InstanceError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.InstanceFlavorError.html#InstanceFlavorError">InstanceFlavorError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.InstanceNotFound.html#InstanceNotFound">InstanceNotFound</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.InstanceUpdateError.html#InstanceUpdateError">InstanceUpdateError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.InvalidArgumentError.html#InvalidArgumentError">InvalidArgumentError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.InvalidIdTypeError.html#InvalidIdTypeError">InvalidIdTypeError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.InvalidIpTypeError.html#InvalidIpTypeError">InvalidIpTypeError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.InvalidParameterError.html#InvalidParameterError">InvalidParameterError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.InvalidRequestError.html#InvalidRequestError">InvalidRequestError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.JsonError.html#JsonError">JsonError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.MetadataCreateError.html#MetadataCreateError">MetadataCreateError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.MetadataDeleteError.html#MetadataDeleteError">MetadataDeleteError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.MetadataError.html#MetadataError">MetadataError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.MetadataJsonError.html#MetadataJsonError">MetadataJsonError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.MetadataKeyError.html#MetadataKeyError">MetadataKeyError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.MetadataPrefixError.html#MetadataPrefixError">MetadataPrefixError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.MetadataUpdateError.html#MetadataUpdateError">MetadataUpdateError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.MisMatchedChecksumError.html#MisMatchedChecksumError">MisMatchedChecksumError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.MissingValueError.html#MissingValueError">MissingValueError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.NameError.html#NameError">NameError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.NetworkCreateError.html#NetworkCreateError">NetworkCreateError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.NetworkDeleteError.html#NetworkDeleteError">NetworkDeleteError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.NetworkError.html#NetworkError">NetworkError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.NetworkUpdateError.html#NetworkUpdateError">NetworkUpdateError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.NetworkUrlError.html#NetworkUrlError">NetworkUrlError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.NoContentTypeError.html#NoContentTypeError">NoContentTypeError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.NoNameError.html#NoNameError">NoNameError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.ObjFetchError.html#ObjFetchError">ObjFetchError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.ObjectCopyError.html#ObjectCopyError">ObjectCopyError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.ObjectError.html#ObjectError">ObjectError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.RebuildError.html#RebuildError">RebuildError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.RecordTypeError.html#RecordTypeError">RecordTypeError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.ServerActionError.html#ServerActionError">ServerActionError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.ServerCreateError.html#ServerCreateError">ServerCreateError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.ServerDeleteError.html#ServerDeleteError">ServerDeleteError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.ServerIpsError.html#ServerIpsError">ServerIpsError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.ServerJsonError.html#ServerJsonError">ServerJsonError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.ServerUpdateError.html#ServerUpdateError">ServerUpdateError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.ServerUrlError.html#ServerUrlError">ServerUrlError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.ServiceValueError.html#ServiceValueError">ServiceValueError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.SnapshotError.html#SnapshotError">SnapshotError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.TempUrlMethodError.html#TempUrlMethodError">TempUrlMethodError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.UnknownError.html#UnknownError">UnknownError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.UnknownParameterError.html#UnknownParameterError">UnknownParameterError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.UnrecognizedServiceError.html#UnrecognizedServiceError">UnrecognizedServiceError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.UnsupportedExtensionError.html#UnsupportedExtensionError">UnsupportedExtensionError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.UnsupportedFeatureExtension.html#UnsupportedFeatureExtension">UnsupportedFeatureExtension</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.UnsupportedVersionError.html#UnsupportedVersionError">UnsupportedVersionError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.UpdateError.html#UpdateError">UpdateError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.UrlError.html#UrlError">UrlError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.UserCreateError.html#UserCreateError">UserCreateError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.UserDeleteError.html#UserDeleteError">UserDeleteError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.UserListError.html#UserListError">UserListError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.UserNameError.html#UserNameError">UserNameError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.UserUpdateError.html#UserUpdateError">UserUpdateError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.VolumeError.html#VolumeError">VolumeError</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Exceptions.VolumeTypeError.html#VolumeTypeError">VolumeTypeError</a><br><small></small></span></li>
</ul>
</li>
<li class="closed">
<span class="folder">Request</span><ul>
<li><span class="class"><a href="OpenCloud.Common.Request.Curl.html#Curl">Curl</a><br><small>The CurlRequest class is a simple wrapper to CURL functions. Not only does
this permit stubbing of the interface as described under the HttpRequest
interface, it could potentially allow us to replace the interface methods
with other function calls in the future.</small></span></li>
<li><span class="interface"><a href="OpenCloud.Common.Request.HttpRequestInterface.html#HttpRequestInterface">HttpRequestInterface</a><br><small>The HttpRequest interface defines methods for wrapping CURL; this allows
those methods to be stubbed out for unit testing, thus allowing us to
test without actually making live calls.</small></span></li>
<li class="closed">
<span class="folder">Response</span><ul>
<li><span class="class"><a href="OpenCloud.Common.Request.Response.Blank.html#Blank">Blank</a><br><small>The HttpResponse returns an object with status information, separated
headers, and any response body necessary.</small></span></li>
<li><span class="class"><a href="OpenCloud.Common.Request.Response.Http.html#Http">Http</a><br><small>The HttpResponse returns an object with status information, separated
headers, and any response body necessary.</small></span></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="closed">
<span class="folder">Compute</span><ul>
<li><span class="class"><a href="OpenCloud.Compute.Flavor.html#Flavor">Flavor</a><br><small>The Flavor class represents a flavor defined by the Compute service</small></span></li>
<li><span class="class"><a href="OpenCloud.Compute.Image.html#Image">Image</a><br><small>The Image class represents a stored machine image returned by the
Compute service.</small></span></li>
<li><span class="class"><a href="OpenCloud.Compute.Network.html#Network">Network</a><br><small>The Network class represents a single virtual network</small></span></li>
<li><span class="class"><a href="OpenCloud.Compute.Server.html#Server">Server</a><br><small>The Server class represents a single server node.</small></span></li>
<li><span class="class"><a href="OpenCloud.Compute.ServerMetadata.html#ServerMetadata">ServerMetadata</a><br><small>This class handles server metadata</small></span></li>
<li><span class="class"><a href="OpenCloud.Compute.Service.html#Service">Service</a><br><small>The Compute class represents the OpenStack Nova service.</small></span></li>
<li><span class="class"><a href="OpenCloud.Compute.VolumeAttachment.html#VolumeAttachment">VolumeAttachment</a><br><small>The VolumeAttachment class represents a volume that is attached
to a server.</small></span></li>
</ul>
</li>
<li class="closed">
<span class="folder">DNS</span><ul>
<li><span class="class"><a href="OpenCloud.DNS.AsyncResponse.html#AsyncResponse">AsyncResponse</a><br><small>The AsyncResponse class encapsulates the data returned by a Cloud DNS
asynchronous response.</small></span></li>
<li><span class="class"><a href="OpenCloud.DNS.Domain.html#Domain">Domain</a><br><small>The Domain class represents a single domain</small></span></li>
<li><span class="class"><a href="OpenCloud.DNS.Object.html#Object">Object</a><br><small>The DnsObject class is an extension of the PersistentObject class that
permits the asynchronous responses used by Cloud DNS</small></span></li>
<li><span class="class"><a href="OpenCloud.DNS.PtrRecord.html#PtrRecord">PtrRecord</a><br><small>PTR records are used for reverse DNS</small></span></li>
<li><span class="class"><a href="OpenCloud.DNS.Record.html#Record">Record</a><br><small>The Record class represents a single domain record</small></span></li>
<li><span class="class"><a href="OpenCloud.DNS.Service.html#Service">Service</a><br><small>This class defines a "service"—a relationship between a specific OpenStack
and a provided service, represented by a URL in the service catalog.</small></span></li>
<li><span class="class"><a href="OpenCloud.DNS.Subdomain.html#Subdomain">Subdomain</a><br><small>The Subdomain is basically another domain, albeit one that is a child of
a parent domain. In terms of the code involved, the JSON is slightly
different than a top-level domain, and the parent is a domain instead of
the DNS service itself.</small></span></li>
</ul>
</li>
<li class="closed">
<span class="folder">Database</span><ul>
<li><span class="class"><a href="OpenCloud.Database.Database.html#Database">Database</a><br><small>This class represents a Database in the Rackspace "Red Dwarf"
database-as-a-service product.</small></span></li>
<li><span class="class"><a href="OpenCloud.Database.Instance.html#Instance">Instance</a><br><small>Instance represents an instance of DbService, similar to a Server in a
Compute service</small></span></li>
<li><span class="class"><a href="OpenCloud.Database.Service.html#Service">Service</a><br><small>The Rackspace Database As A Service (aka "Red Dwarf")</small></span></li>
<li><span class="class"><a href="OpenCloud.Database.User.html#User">User</a><br><small>This class represents a User in the Rackspace "Red Dwarf"
database-as-a-service product.</small></span></li>
</ul>
</li>
<li class="closed">
<span class="folder">LoadBalancer</span><ul>
<li><span class="class"><a href="OpenCloud.LoadBalancer.Algorithm.html#Algorithm">Algorithm</a><br><small>sub-resource to manage algorithms (read-only)</small></span></li>
<li><span class="class"><a href="OpenCloud.LoadBalancer.AllowedDomain.html#AllowedDomain">AllowedDomain</a><br><small>sub-resource to manage allowed domains</small></span></li>
<li><span class="class"><a href="OpenCloud.LoadBalancer.BillableLoadBalancer.html#BillableLoadBalancer">BillableLoadBalancer</a><br><small>used to get a list of billable load balancers for a specific date range</small></span></li>
<li><span class="class"><a href="OpenCloud.LoadBalancer.LoadBalancer.html#LoadBalancer">LoadBalancer</a><br><small>The LoadBalancer class represents a single load balancer</small></span></li>
<li><span class="class"><a href="OpenCloud.LoadBalancer.Protocol.html#Protocol">Protocol</a><br><small>sub-resource to manage protocols (read-only)</small></span></li>
<li><span class="class"><a href="OpenCloud.LoadBalancer.Service.html#Service">Service</a><br><small>The Rackspace Cloud Load Balancers</small></span></li>
<li class="closed">
<span class="folder">Resources</span><ul>
<li><span class="class"><a href="OpenCloud.LoadBalancer.Resources.Access.html#Access">Access</a><br><small>sub-resource to manage access lists</small></span></li>
<li><span class="class"><a href="OpenCloud.LoadBalancer.Resources.ConnectionLogging.html#ConnectionLogging">ConnectionLogging</a><br><small>sub-resource to manage connection logging</small></span></li>
<li><span class="class"><a href="OpenCloud.LoadBalancer.Resources.ConnectionThrottle.html#ConnectionThrottle">ConnectionThrottle</a><br><small>sub-resource to manage connection throttling</small></span></li>
<li><span class="class"><a href="OpenCloud.LoadBalancer.Resources.ContentCaching.html#ContentCaching">ContentCaching</a><br><small>sub-resource to manage content caching</small></span></li>
<li><span class="class"><a href="OpenCloud.LoadBalancer.Resources.ErrorPage.html#ErrorPage">ErrorPage</a><br><small>The /loadbalancer/{id}/errorpage manages the error page for the load
balancer.</small></span></li>
<li><span class="class"><a href="OpenCloud.LoadBalancer.Resources.HealthMonitor.html#HealthMonitor">HealthMonitor</a><br><small>sub-resource to manage health monitor info</small></span></li>
<li><span class="class"><a href="OpenCloud.LoadBalancer.Resources.Metadata.html#Metadata">Metadata</a><br><small>sub-resource to manage Metadata</small></span></li>
<li><span class="class"><a href="OpenCloud.LoadBalancer.Resources.Node.html#Node">Node</a><br><small>information on a single node in the load balancer</small></span></li>
<li><span class="class"><a href="OpenCloud.LoadBalancer.Resources.NodeEvent.html#NodeEvent">NodeEvent</a><br><small>a single node event, usually called as part of a Collection</small></span></li>
<li><span class="class"><a href="OpenCloud.LoadBalancer.Resources.Readonly.html#Readonly">Readonly</a><br><small>This defines a read-only SubResource - one that cannot be created, updated,
or deleted. Many subresources are like this, and this simplifies their
class definitions.</small></span></li>
<li><span class="class"><a href="OpenCloud.LoadBalancer.Resources.SSLTermination.html#SSLTermination">SSLTermination</a><br><small>sub-resource to manage SSL termination</small></span></li>
<li><span class="class"><a href="OpenCloud.LoadBalancer.Resources.SessionPersistence.html#SessionPersistence">SessionPersistence</a><br><small>sub-resource to manage session persistence setting</small></span></li>
<li><span class="class"><a href="OpenCloud.LoadBalancer.Resources.Stats.html#Stats">Stats</a><br><small>Stats returns statistics about the load balancer</small></span></li>
<li><span class="class"><a href="OpenCloud.LoadBalancer.Resources.SubResource.html#SubResource">SubResource</a><br><small>SubResource is an abstract class that handles subresources of a
LoadBalancer object; for example, the
`/loadbalancers/{id}/errorpage`. Since most of the subresources are
handled in a similar manner, this consolidates the functions.</small></span></li>
<li><span class="class"><a href="OpenCloud.LoadBalancer.Resources.Usage.html#Usage">Usage</a><br><small>used to get usage data for a load balancer</small></span></li>
<li><span class="class"><a href="OpenCloud.LoadBalancer.Resources.VirtualIp.html#VirtualIp">VirtualIp</a><br><small>VirtualIp represents a single virtual IP (usually returned in a Collection)</small></span></li>
</ul>
</li>
</ul>
</li>
<li class="closed">
<span class="folder">ObjectStore</span><ul>
<li><span class="class"><a href="OpenCloud.ObjectStore.CDNContainer.html#CDNContainer">CDNContainer</a><br><small>A simple container for the CDN Service</small></span></li>
<li><span class="class"><a href="OpenCloud.ObjectStore.Container.html#Container">Container</a><br><small>A regular container with a (potentially) CDN container</small></span></li>
<li><span class="class"><a href="OpenCloud.ObjectStore.DataObject.html#DataObject">DataObject</a><br><small>A DataObject is an object in the ObjectStore</small></span></li>
<li><span class="class"><a href="OpenCloud.ObjectStore.ObjectStoreBase.html#ObjectStoreBase">ObjectStoreBase</a><br><small>A base class for common code shared between the ObjectStore and
ObjectStoreCDN
objects</small></span></li>
<li><span class="class"><a href="OpenCloud.ObjectStore.ObjectStoreCDN.html#ObjectStoreCDN">ObjectStoreCDN</a><br><small>This is the CDN related to the ObjectStore</small></span></li>
<li><span class="class"><a href="OpenCloud.ObjectStore.Service.html#Service">Service</a><br><small>ObjectStore - this defines the object-store (Cloud Files) service.</small></span></li>
</ul>
</li>
<li class="closed">
<span class="folder">Orchestration</span><ul>
<li><span class="class"><a href="OpenCloud.Orchestration.Resource.html#Resource">Resource</a><br><small></small></span></li>
<li><span class="class"><a href="OpenCloud.Orchestration.Service.html#Service">Service</a><br><small>The Orchestration class represents the OpenStack Heat service.</small></span></li>
<li><span class="class"><a href="OpenCloud.Orchestration.Stack.html#Stack">Stack</a><br><small>The Stack class requires a CloudFormation template and may contain additional
parameters for that template.</small></span></li>
</ul>
</li>
<li class="closed">
<span class="folder">Volume</span><ul>
<li><span class="class"><a href="OpenCloud.Volume.Service.html#Service">Service</a><br><small>Nova is an abstraction layer for the OpenStack compute service.</small></span></li>
<li><span class="class"><a href="OpenCloud.Volume.Snapshot.html#Snapshot">Snapshot</a><br><small>The Snapshot class represents a single block storage snapshot</small></span></li>
<li><span class="class"><a href="OpenCloud.Volume.Volume.html#Volume">Volume</a><br><small>The Volume class represents a single block storage volume</small></span></li>
<li><span class="class"><a href="OpenCloud.Volume.VolumeType.html#VolumeType">VolumeType</a><br><small>The VolumeType class represents a single block storage volume type</small></span></li>
</ul>
</li>
</ul>
</li>
<li class="closed">
<span class="folder">global</span><ul></ul>
</li>
</ul>
</div><div class="section">
<h1>Packages</h1>
<ul id="packages-" class="filetree">
<li class="closed">
<span class="folder">Default</span><ul id="packages_" class="filetree">
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.AbstractResource.html#AbstractResource">AbstractResource</a><br><small>Abstract AbstractResource class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.Resources.Access.html#Access">Access</a><br><small>sub-resource to manage access lists</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.Account.html#Account">Account</a><br><small>Account class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.Agent.html#Agent">Agent</a><br><small>Agent class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.AgentConnection.html#AgentConnection">AgentConnection</a><br><small>AgentConnection class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.AgentException.html#AgentException">AgentException</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.AgentHost.html#AgentHost">AgentHost</a><br><small>Agent class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.AgentHostInfo.html#AgentHostInfo">AgentHostInfo</a><br><small>Agent class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.AgentTarget.html#AgentTarget">AgentTarget</a><br><small>Agent class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.AgentToken.html#AgentToken">AgentToken</a><br><small>Agent class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.Alarm.html#Alarm">Alarm</a><br><small>Alarm class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.AlarmException.html#AlarmException">AlarmException</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.Algorithm.html#Algorithm">Algorithm</a><br><small>sub-resource to manage algorithms (read-only)</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.AllowedDomain.html#AllowedDomain">AllowedDomain</a><br><small>sub-resource to manage allowed domains</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.AsyncError.html#AsyncError">AsyncError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.AsyncHttpError.html#AsyncHttpError">AsyncHttpError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.DNS.AsyncResponse.html#AsyncResponse">AsyncResponse</a><br><small>The AsyncResponse class encapsulates the data returned by a Cloud DNS
asynchronous response.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.AsyncTimeoutError.html#AsyncTimeoutError">AsyncTimeoutError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.AttributeError.html#AttributeError">AttributeError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.AuthenticationError.html#AuthenticationError">AuthenticationError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Base.html#Base">Base</a><br><small>The Base class is the root class for all other objects used or defined by
this SDK.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.BaseException.html#BaseException">BaseException</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.BillableLoadBalancer.html#BillableLoadBalancer">BillableLoadBalancer</a><br><small>used to get a list of billable load balancers for a specific date range</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Request.Response.Blank.html#Blank">Blank</a><br><small>The HttpResponse returns an object with status information, separated
headers, and any response body necessary.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.ObjectStore.CDNContainer.html#CDNContainer">CDNContainer</a><br><small>A simple container for the CDN Service</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.CdnError.html#CdnError">CdnError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.CdnHttpError.html#CdnHttpError">CdnHttpError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.CdnNotAvailableError.html#CdnNotAvailableError">CdnNotAvailableError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.CdnTtlError.html#CdnTtlError">CdnTtlError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.Changelog.html#Changelog">Changelog</a><br><small>Changelog class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.Check.html#Check">Check</a><br><small>Check class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.CheckException.html#CheckException">CheckException</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.CheckType.html#CheckType">CheckType</a><br><small>CheckType class.</small></span></li>
<li class="closed"><span class="class"><a href="Autoload.html#ClassLoader">ClassLoader</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.CloudMonitoringException.html#CloudMonitoringException">CloudMonitoringException</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Collection.html#Collection">Collection</a><br><small>Provides an abstraction for working with ordered sets of objects</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.CollectionError.html#CollectionError">CollectionError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.Resources.ConnectionLogging.html#ConnectionLogging">ConnectionLogging</a><br><small>sub-resource to manage connection logging</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.Resources.ConnectionThrottle.html#ConnectionThrottle">ConnectionThrottle</a><br><small>sub-resource to manage connection throttling</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.ObjectStore.Container.html#Container">Container</a><br><small>A regular container with a (potentially) CDN container</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.ContainerCreateError.html#ContainerCreateError">ContainerCreateError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.ContainerDeleteError.html#ContainerDeleteError">ContainerDeleteError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.ContainerError.html#ContainerError">ContainerError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.ContainerNameError.html#ContainerNameError">ContainerNameError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.ContainerNotEmptyError.html#ContainerNotEmptyError">ContainerNotEmptyError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.ContainerNotFoundError.html#ContainerNotFoundError">ContainerNotFoundError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.Resources.ContentCaching.html#ContentCaching">ContentCaching</a><br><small>sub-resource to manage content caching</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.CreateError.html#CreateError">CreateError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.CreateUpdateError.html#CreateUpdateError">CreateUpdateError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.CredentialError.html#CredentialError">CredentialError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Request.Curl.html#Curl">Curl</a><br><small>The CurlRequest class is a simple wrapper to CURL functions. Not only does
this permit stubbing of the interface as described under the HttpRequest
interface, it could potentially allow us to replace the interface methods
with other function calls in the future.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.ObjectStore.DataObject.html#DataObject">DataObject</a><br><small>A DataObject is an object in the ObjectStore</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Database.Database.html#Database">Database</a><br><small>This class represents a Database in the Rackspace "Red Dwarf"
database-as-a-service product.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.DatabaseCreateError.html#DatabaseCreateError">DatabaseCreateError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.DatabaseDeleteError.html#DatabaseDeleteError">DatabaseDeleteError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.DatabaseListError.html#DatabaseListError">DatabaseListError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.DatabaseNameError.html#DatabaseNameError">DatabaseNameError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.DatabaseUpdateError.html#DatabaseUpdateError">DatabaseUpdateError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Debug.html#Debug">Debug</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.DeleteError.html#DeleteError">DeleteError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.DocumentError.html#DocumentError">DocumentError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.DNS.Domain.html#Domain">Domain</a><br><small>The Domain class represents a single domain</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.DomainError.html#DomainError">DomainError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.EmptyResponseError.html#EmptyResponseError">EmptyResponseError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.EndpointError.html#EndpointError">EndpointError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.Entity.html#Entity">Entity</a><br><small>Entity class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.EntityException.html#EntityException">EntityException</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.Resources.ErrorPage.html#ErrorPage">ErrorPage</a><br><small>The /loadbalancer/{id}/errorpage manages the error page for the load
balancer.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Compute.Flavor.html#Flavor">Flavor</a><br><small>The Flavor class represents a flavor defined by the Compute service</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.FlavorError.html#FlavorError">FlavorError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.Resources.HealthMonitor.html#HealthMonitor">HealthMonitor</a><br><small>sub-resource to manage health monitor info</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Request.Response.Http.html#Http">Http</a><br><small>The HttpResponse returns an object with status information, separated
headers, and any response body necessary.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.HttpError.html#HttpError">HttpError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.HttpForbiddenError.html#HttpForbiddenError">HttpForbiddenError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.HttpOverLimitError.html#HttpOverLimitError">HttpOverLimitError</a><br><small></small></span></li>
<li class="closed"><span class="interface"><a href="OpenCloud.Common.Request.HttpRequestInterface.html#HttpRequestInterface">HttpRequestInterface</a><br><small>The HttpRequest interface defines methods for wrapping CURL; this allows
those methods to be stubbed out for unit testing, thus allowing us to
test without actually making live calls.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.HttpRetryError.html#HttpRetryError">HttpRetryError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.HttpTimeoutError.html#HttpTimeoutError">HttpTimeoutError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.HttpUnauthorizedError.html#HttpUnauthorizedError">HttpUnauthorizedError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.HttpUrlError.html#HttpUrlError">HttpUrlError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.IOError.html#IOError">IOError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.IdRequiredError.html#IdRequiredError">IdRequiredError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Compute.Image.html#Image">Image</a><br><small>The Image class represents a stored machine image returned by the
Compute service.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.ImageError.html#ImageError">ImageError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Database.Instance.html#Instance">Instance</a><br><small>Instance represents an instance of DbService, similar to a Server in a
Compute service</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.InstanceCreateError.html#InstanceCreateError">InstanceCreateError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.InstanceDeleteError.html#InstanceDeleteError">InstanceDeleteError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.InstanceError.html#InstanceError">InstanceError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.InstanceFlavorError.html#InstanceFlavorError">InstanceFlavorError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.InstanceNotFound.html#InstanceNotFound">InstanceNotFound</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.InstanceUpdateError.html#InstanceUpdateError">InstanceUpdateError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.InvalidArgumentError.html#InvalidArgumentError">InvalidArgumentError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.InvalidIdTypeError.html#InvalidIdTypeError">InvalidIdTypeError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.InvalidIpTypeError.html#InvalidIpTypeError">InvalidIpTypeError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.InvalidParameterError.html#InvalidParameterError">InvalidParameterError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.InvalidRequestError.html#InvalidRequestError">InvalidRequestError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.JsonError.html#JsonError">JsonError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Lang.html#Lang">Lang</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.LoadBalancer.html#LoadBalancer">LoadBalancer</a><br><small>The LoadBalancer class represents a single load balancer</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Metadata.html#Metadata">Metadata</a><br><small>The Metadata class represents either Server or Image metadata</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.Resources.Metadata.html#Metadata">Metadata</a><br><small>sub-resource to manage Metadata</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.MetadataCreateError.html#MetadataCreateError">MetadataCreateError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.MetadataDeleteError.html#MetadataDeleteError">MetadataDeleteError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.MetadataError.html#MetadataError">MetadataError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.MetadataJsonError.html#MetadataJsonError">MetadataJsonError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.MetadataKeyError.html#MetadataKeyError">MetadataKeyError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.MetadataPrefixError.html#MetadataPrefixError">MetadataPrefixError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.MetadataUpdateError.html#MetadataUpdateError">MetadataUpdateError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.Metric.html#Metric">Metric</a><br><small>Metric class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.MetricException.html#MetricException">MetricException</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.MisMatchedChecksumError.html#MisMatchedChecksumError">MisMatchedChecksumError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.MissingValueError.html#MissingValueError">MissingValueError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.NameError.html#NameError">NameError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Compute.Network.html#Network">Network</a><br><small>The Network class represents a single virtual network</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.NetworkCreateError.html#NetworkCreateError">NetworkCreateError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.NetworkDeleteError.html#NetworkDeleteError">NetworkDeleteError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.NetworkError.html#NetworkError">NetworkError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.NetworkUpdateError.html#NetworkUpdateError">NetworkUpdateError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.NetworkUrlError.html#NetworkUrlError">NetworkUrlError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.NoContentTypeError.html#NoContentTypeError">NoContentTypeError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.NoNameError.html#NoNameError">NoNameError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.Resources.Node.html#Node">Node</a><br><small>information on a single node in the load balancer</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.Resources.NodeEvent.html#NodeEvent">NodeEvent</a><br><small>a single node event, usually called as part of a Collection</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.Notification.html#Notification">Notification</a><br><small>Notification class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.NotificationHistory.html#NotificationHistory">NotificationHistory</a><br><small>NotificationHistory class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.NotificationHistoryException.html#NotificationHistoryException">NotificationHistoryException</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.NotificationPlan.html#NotificationPlan">NotificationPlan</a><br><small>Abstract AbstractResource class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.NotificationPlanException.html#NotificationPlanException">NotificationPlanException</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.NotificationType.html#NotificationType">NotificationType</a><br><small>NotificationType class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Nova.html#Nova">Nova</a><br><small>Nova is an abstraction layer for the OpenStack compute service.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.ObjFetchError.html#ObjFetchError">ObjFetchError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.DNS.Object.html#Object">Object</a><br><small>The DnsObject class is an extension of the PersistentObject class that
permits the asynchronous responses used by Cloud DNS</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.ObjectCopyError.html#ObjectCopyError">ObjectCopyError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.ObjectError.html#ObjectError">ObjectError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.ObjectStore.html#ObjectStore">ObjectStore</a><br><small>Intermediate (abstract) class to implement shared
features of all object-storage classes</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.ObjectStore.ObjectStoreBase.html#ObjectStoreBase">ObjectStoreBase</a><br><small>A base class for common code shared between the ObjectStore and
ObjectStoreCDN
objects</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.ObjectStore.ObjectStoreCDN.html#ObjectStoreCDN">ObjectStoreCDN</a><br><small>This is the CDN related to the ObjectStore</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.OpenStack.html#OpenStack">OpenStack</a><br><small>The OpenStack class represents a relationship (or "connection")
between a user and a service.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.PersistentObject.html#PersistentObject">PersistentObject</a><br><small>represents an object that has the ability to be
retrieved, created, updated, and deleted.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.Protocol.html#Protocol">Protocol</a><br><small>sub-resource to manage protocols (read-only)</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.DNS.PtrRecord.html#PtrRecord">PtrRecord</a><br><small>PTR records are used for reverse DNS</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Rackspace.html#Rackspace">Rackspace</a><br><small>Rackspace extends the OpenStack class with support for Rackspace's
API key and tenant requirements.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.Resources.Readonly.html#Readonly">Readonly</a><br><small>This defines a read-only SubResource - one that cannot be created, updated,
or deleted. Many subresources are like this, and this simplifies their
class definitions.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.ReadOnlyResource.html#ReadonlyResource">ReadonlyResource</a><br><small>ReadonlyResource class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.RebuildError.html#RebuildError">RebuildError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.DNS.Record.html#Record">Record</a><br><small>The Record class represents a single domain record</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.RecordTypeError.html#RecordTypeError">RecordTypeError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Orchestration.Resource.html#Resource">Resource</a><br><small></small></span></li>
<li class="closed"><span class="interface"><a href="OpenCloud.CloudMonitoring.Resource.ResourceInterface.html#ResourceInterface">ResourceInterface</a><br><small>ResourceInterface interface.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.Resources.SSLTermination.html#SSLTermination">SSLTermination</a><br><small>sub-resource to manage SSL termination</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Compute.Server.html#Server">Server</a><br><small>The Server class represents a single server node.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.ServerActionError.html#ServerActionError">ServerActionError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.ServerCreateError.html#ServerCreateError">ServerCreateError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.ServerDeleteError.html#ServerDeleteError">ServerDeleteError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.ServerIpsError.html#ServerIpsError">ServerIpsError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.ServerJsonError.html#ServerJsonError">ServerJsonError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Compute.ServerMetadata.html#ServerMetadata">ServerMetadata</a><br><small>This class handles server metadata</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.ServerUpdateError.html#ServerUpdateError">ServerUpdateError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.ServerUrlError.html#ServerUrlError">ServerUrlError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Service.html#Service">Service</a><br><small>The Rackspace Cloud Monitoring service.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Service.html#Service">Service</a><br><small>This class defines a "service"—a relationship between a specific OpenStack
and a provided service, represented by a URL in the service catalog.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Compute.Service.html#Service">Service</a><br><small>The Compute class represents the OpenStack Nova service.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Database.Service.html#Service">Service</a><br><small>The Rackspace Database As A Service (aka "Red Dwarf")</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.DNS.Service.html#Service">Service</a><br><small>This class defines a "service"—a relationship between a specific OpenStack
and a provided service, represented by a URL in the service catalog.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.Service.html#Service">Service</a><br><small>The Rackspace Cloud Load Balancers</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.ObjectStore.Service.html#Service">Service</a><br><small>ObjectStore - this defines the object-store (Cloud Files) service.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Orchestration.Service.html#Service">Service</a><br><small>The Orchestration class represents the OpenStack Heat service.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Volume.Service.html#Service">Service</a><br><small>Nova is an abstraction layer for the OpenStack compute service.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.ServiceCatalogItem.html#ServiceCatalogItem">ServiceCatalogItem</a><br><small>Holds information on a single service from the Service Catalog</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.ServiceException.html#ServiceException">ServiceException</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.ServiceValueError.html#ServiceValueError">ServiceValueError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.Resources.SessionPersistence.html#SessionPersistence">SessionPersistence</a><br><small>sub-resource to manage session persistence setting</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Volume.Snapshot.html#Snapshot">Snapshot</a><br><small>The Snapshot class represents a single block storage snapshot</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.SnapshotError.html#SnapshotError">SnapshotError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Orchestration.Stack.html#Stack">Stack</a><br><small>The Stack class requires a CloudFormation template and may contain additional
parameters for that template.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.Resources.Stats.html#Stats">Stats</a><br><small>Stats returns statistics about the load balancer</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.Resources.SubResource.html#SubResource">SubResource</a><br><small>SubResource is an abstract class that handles subresources of a
LoadBalancer object; for example, the
`/loadbalancers/{id}/errorpage`. Since most of the subresources are
handled in a similar manner, this consolidates the functions.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.DNS.Subdomain.html#Subdomain">Subdomain</a><br><small>The Subdomain is basically another domain, albeit one that is a child of
a parent domain. In terms of the code involved, the JSON is slightly
different than a top-level domain, and the parent is a domain instead of
the DNS service itself.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.TempUrlMethodError.html#TempUrlMethodError">TempUrlMethodError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.TestException.html#TestException">TestException</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.UnknownError.html#UnknownError">UnknownError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.UnknownParameterError.html#UnknownParameterError">UnknownParameterError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.UnrecognizedServiceError.html#UnrecognizedServiceError">UnrecognizedServiceError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.UnsupportedExtensionError.html#UnsupportedExtensionError">UnsupportedExtensionError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.UnsupportedFeatureExtension.html#UnsupportedFeatureExtension">UnsupportedFeatureExtension</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.UnsupportedVersionError.html#UnsupportedVersionError">UnsupportedVersionError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.UpdateError.html#UpdateError">UpdateError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.UrlError.html#UrlError">UrlError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.Resources.Usage.html#Usage">Usage</a><br><small>used to get usage data for a load balancer</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Database.User.html#User">User</a><br><small>This class represents a User in the Rackspace "Red Dwarf"
database-as-a-service product.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.UserCreateError.html#UserCreateError">UserCreateError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.UserDeleteError.html#UserDeleteError">UserDeleteError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.UserListError.html#UserListError">UserListError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.UserNameError.html#UserNameError">UserNameError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.UserUpdateError.html#UserUpdateError">UserUpdateError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.View.html#View">View</a><br><small>View class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.LoadBalancer.Resources.VirtualIp.html#VirtualIp">VirtualIp</a><br><small>VirtualIp represents a single virtual IP (usually returned in a Collection)</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Volume.Volume.html#Volume">Volume</a><br><small>The Volume class represents a single block storage volume</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Compute.VolumeAttachment.html#VolumeAttachment">VolumeAttachment</a><br><small>The VolumeAttachment class represents a volume that is attached
to a server.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.VolumeError.html#VolumeError">VolumeError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Volume.VolumeType.html#VolumeType">VolumeType</a><br><small>The VolumeType class represents a single block storage volume type</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.Common.Exceptions.VolumeTypeError.html#VolumeTypeError">VolumeTypeError</a><br><small></small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.Zone.html#Zone">Zone</a><br><small>Zone class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Exception.ZoneException.html#ZoneException">ZoneException</a><br><small></small></span></li>
</ul>
</li>
<li class="closed">
<span class="folder">global</span><ul id="packages_global" class="filetree"></ul>
</li>
<li class="closed">
<span class="folder">phpOpenCloud</span><ul id="packages_phpOpenCloud" class="filetree">
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Resource.AbstractResource.html#AbstractResource">AbstractResource</a><br><small>Abstract AbstractResource class.</small></span></li>
<li class="closed"><span class="class"><a href="OpenCloud.CloudMonitoring.Service.html#Service">Service</a><br><small>The Rackspace Cloud Monitoring service.</small></span></li>
</ul>
</li>
</ul>
</div>
</div></div><div id="footer"><div class="padder"></div></div></div></body></html>
| intrepidnetworkinc/obma | htdocs/sites/all/libraries/php-opencloud/docs/api/OpenCloud.LoadBalancer.Service.html | HTML | gpl-3.0 | 92,842 | [
30522,
1026,
16129,
20950,
3619,
1027,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
8917,
1013,
2639,
1013,
1060,
11039,
19968,
1000,
1028,
1026,
2132,
1028,
1026,
2516,
1028,
1026,
1013,
2516,
1028,
1026,
18804,
8299,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// { dg-do compile }
// { dg-options "-O -w -Wno-psabi" }
typedef int vec __attribute__((vector_size(32)));
vec fn1()
{
vec x, zero{};
vec one = zero + 1;
return x < zero ? one : zero;
}
| Gurgel100/gcc | gcc/testsuite/g++.dg/pr86159.C | C++ | gpl-2.0 | 194 | [
30522,
1013,
1013,
1063,
1040,
2290,
1011,
2079,
4012,
22090,
1065,
1013,
1013,
1063,
1040,
2290,
1011,
7047,
1000,
1011,
1051,
1011,
1059,
1011,
1059,
3630,
1011,
8827,
28518,
1000,
1065,
21189,
12879,
20014,
2310,
2278,
1035,
1035,
17961,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2013 The NovaCoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "db.h"
#include "miner.h"
#include "kernel.h"
using namespace std;
//////////////////////////////////////////////////////////////////////////////
//
// BitcoinMiner
//
string strMintMessage = "Info: Mining suspended due to locked wallet.";
string strMintWarning;
extern unsigned int nMinerSleep;
int static FormatHashBlocks(void* pbuffer, unsigned int len)
{
unsigned char* pdata = (unsigned char*)pbuffer;
unsigned int blocks = 1 + ((len + 8) / 64);
unsigned char* pend = pdata + 64 * blocks;
memset(pdata + len, 0, 64 * blocks - len);
pdata[len] = 0x80;
unsigned int bits = len * 8;
pend[-1] = (bits >> 0) & 0xff;
pend[-2] = (bits >> 8) & 0xff;
pend[-3] = (bits >> 16) & 0xff;
pend[-4] = (bits >> 24) & 0xff;
return blocks;
}
static const unsigned int pSHA256InitState[8] =
{0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19};
void SHA256Transform(void* pstate, void* pinput, const void* pinit)
{
SHA256_CTX ctx;
unsigned char data[64];
SHA256_Init(&ctx);
for (int i = 0; i < 16; i++)
((uint32_t*)data)[i] = ByteReverse(((uint32_t*)pinput)[i]);
for (int i = 0; i < 8; i++)
ctx.h[i] = ((uint32_t*)pinit)[i];
SHA256_Update(&ctx, data, sizeof(data));
for (int i = 0; i < 8; i++)
((uint32_t*)pstate)[i] = ctx.h[i];
}
// Some explaining would be appreciated
class COrphan
{
public:
CTransaction* ptx;
set<uint256> setDependsOn;
double dPriority;
double dFeePerKb;
COrphan(CTransaction* ptxIn)
{
ptx = ptxIn;
dPriority = dFeePerKb = 0;
}
void print() const
{
printf("COrphan(hash=%s, dPriority=%.1f, dFeePerKb=%.1f)\n",
ptx->GetHash().ToString().substr(0,10).c_str(), dPriority, dFeePerKb);
BOOST_FOREACH(uint256 hash, setDependsOn)
printf(" setDependsOn %s\n", hash.ToString().substr(0,10).c_str());
}
};
uint64 nLastBlockTx = 0;
uint64 nLastBlockSize = 0;
int64 nLastCoinStakeSearchInterval = 0;
// We want to sort transactions by priority and fee, so:
typedef boost::tuple<double, double, CTransaction*> TxPriority;
class TxPriorityCompare
{
bool byFee;
public:
TxPriorityCompare(bool _byFee) : byFee(_byFee) { }
bool operator()(const TxPriority& a, const TxPriority& b)
{
if (byFee)
{
if (a.get<1>() == b.get<1>())
return a.get<0>() < b.get<0>();
return a.get<1>() < b.get<1>();
}
else
{
if (a.get<0>() == b.get<0>())
return a.get<1>() < b.get<1>();
return a.get<0>() < b.get<0>();
}
}
};
// CreateNewBlock: create new block (without proof-of-work/proof-of-stake)
CBlock* CreateNewBlock(CWallet* pwallet, bool fProofOfStake)
{
// Create new block
auto_ptr<CBlock> pblock(new CBlock());
if (!pblock.get())
return NULL;
// Create coinbase tx
CTransaction txNew;
txNew.vin.resize(1);
txNew.vin[0].prevout.SetNull();
txNew.vout.resize(1);
if (!fProofOfStake)
{
CReserveKey reservekey(pwallet);
txNew.vout[0].scriptPubKey << reservekey.GetReservedKey() << OP_CHECKSIG;
}
else
txNew.vout[0].SetEmpty();
// Add our coinbase tx as first transaction
pblock->vtx.push_back(txNew);
// Largest block you're willing to create:
unsigned int nBlockMaxSize = GetArg("-blockmaxsize", MAX_BLOCK_SIZE_GEN/2);
// Limit to betweeen 1K and MAX_BLOCK_SIZE-1K for sanity:
nBlockMaxSize = std::max((unsigned int)1000, std::min((unsigned int)(MAX_BLOCK_SIZE-1000), nBlockMaxSize));
// How much of the block should be dedicated to high-priority transactions,
// included regardless of the fees they pay
unsigned int nBlockPrioritySize = GetArg("-blockprioritysize", 11000);
nBlockPrioritySize = std::min(nBlockMaxSize, nBlockPrioritySize);
// Minimum block size you want to create; block will be filled with free transactions
// until there are no more or the block reaches this size:
unsigned int nBlockMinSize = GetArg("-blockminsize", 0);
nBlockMinSize = std::min(nBlockMaxSize, nBlockMinSize);
// Fee-per-kilobyte amount considered the same as "free"
// Be careful setting this: if you set it to zero then
// a transaction spammer can cheaply fill blocks using
// 1-satoshi-fee transactions. It should be set above the real
// cost to you of processing a transaction.
int64 nMinTxFee = MIN_TX_FEE;
if (mapArgs.count("-mintxfee"))
ParseMoney(mapArgs["-mintxfee"], nMinTxFee);
CBlockIndex* pindexPrev = pindexBest;
pblock->nBits = GetNextTargetRequired(pindexPrev, fProofOfStake);
// Collect memory pool transactions into the block
int64 nFees = 0;
{
LOCK2(cs_main, mempool.cs);
CCoinsViewCache view(*pcoinsTip, true);
// Priority order to process transactions
list<COrphan> vOrphan; // list memory doesn't move
map<uint256, vector<COrphan*> > mapDependers;
// This vector will be sorted into a priority queue:
vector<TxPriority> vecPriority;
vecPriority.reserve(mempool.mapTx.size());
for (map<uint256, CTransaction>::iterator mi = mempool.mapTx.begin(); mi != mempool.mapTx.end(); ++mi)
{
CTransaction& tx = (*mi).second;
if (tx.IsCoinBase() || tx.IsCoinStake() || !tx.IsFinal())
continue;
COrphan* porphan = NULL;
double dPriority = 0;
int64 nTotalIn = 0;
bool fMissingInputs = false;
BOOST_FOREACH(const CTxIn& txin, tx.vin)
{
// Read prev transaction
CCoins coins;
if (!view.GetCoins(txin.prevout.hash, coins))
{
// This should never happen; all transactions in the memory
// pool should connect to either transactions in the chain
// or other transactions in the memory pool.
if (!mempool.mapTx.count(txin.prevout.hash))
{
printf("ERROR: mempool transaction missing input\n");
if (fDebug) assert("mempool transaction missing input" == 0);
fMissingInputs = true;
if (porphan)
vOrphan.pop_back();
break;
}
// Has to wait for dependencies
if (!porphan)
{
// Use list for automatic deletion
vOrphan.push_back(COrphan(&tx));
porphan = &vOrphan.back();
}
mapDependers[txin.prevout.hash].push_back(porphan);
porphan->setDependsOn.insert(txin.prevout.hash);
nTotalIn += mempool.mapTx[txin.prevout.hash].vout[txin.prevout.n].nValue;
continue;
}
int64 nValueIn = coins.vout[txin.prevout.n].nValue;
nTotalIn += nValueIn;
int nConf = pindexPrev->nHeight - coins.nHeight;
dPriority += (double)nValueIn * nConf;
}
if (fMissingInputs) continue;
// Priority is sum(valuein * age) / txsize
unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
dPriority /= nTxSize;
// This is a more accurate fee-per-kilobyte than is used by the client code, because the
// client code rounds up the size to the nearest 1K. That's good, because it gives an
// incentive to create smaller transactions.
double dFeePerKb = double(nTotalIn-tx.GetValueOut()) / (double(nTxSize)/1000.0);
if (porphan)
{
porphan->dPriority = dPriority;
porphan->dFeePerKb = dFeePerKb;
}
else
vecPriority.push_back(TxPriority(dPriority, dFeePerKb, &(*mi).second));
}
// Collect transactions into block
uint64 nBlockSize = 1000;
uint64 nBlockTx = 0;
int nBlockSigOps = 100;
bool fSortedByFee = (nBlockPrioritySize <= 0);
TxPriorityCompare comparer(fSortedByFee);
std::make_heap(vecPriority.begin(), vecPriority.end(), comparer);
while (!vecPriority.empty()) {
unsigned int nAdjTime = GetAdjustedTime();
// Take highest priority transaction off the priority queue:
double dPriority = vecPriority.front().get<0>();
double dFeePerKb = vecPriority.front().get<1>();
CTransaction& tx = *(vecPriority.front().get<2>());
std::pop_heap(vecPriority.begin(), vecPriority.end(), comparer);
vecPriority.pop_back();
// second layer cached modifications just for this transaction
CCoinsViewCache viewTemp(view, true);
// Size limits
unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
if (nBlockSize + nTxSize >= nBlockMaxSize)
continue;
// Legacy limits on sigOps:
unsigned int nTxSigOps = tx.GetLegacySigOpCount();
if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)
continue;
// Timestamp limit
if ((tx.nTime > nAdjTime) || (fProofOfStake && tx.nTime > pblock->vtx[0].nTime))
continue;
// Simplify transaction fee - allow free = false
int64 nMinFee = tx.GetMinFee(nBlockSize, false, GMF_BLOCK);
// Skip free transactions if we're past the minimum block size:
if (fSortedByFee && (dFeePerKb < nMinTxFee) && (nBlockSize + nTxSize >= nBlockMinSize))
continue;
// Prioritize by fee once past the priority size or we run out of high-priority
// transactions:
if (!fSortedByFee &&
((nBlockSize + nTxSize >= nBlockPrioritySize) || (dPriority < COIN * 144 / 250)))
{
fSortedByFee = true;
comparer = TxPriorityCompare(fSortedByFee);
std::make_heap(vecPriority.begin(), vecPriority.end(), comparer);
}
if (!tx.CheckInputs(viewTemp, CS_ALWAYS, true, false))
continue;
int64 nTxFees = tx.GetValueIn(viewTemp)-tx.GetValueOut();
if (nTxFees < nMinFee)
continue;
nTxSigOps += tx.GetP2SHSigOpCount(viewTemp);
if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)
continue;
/*
* We need to call UpdateCoins using actual block timestamp, so don't perform this here.
*
CTxUndo txundo;
if (!tx.UpdateCoins(viewTemp, txundo, pindexPrev->nHeight+1, pblock->nTime))
continue;
*/
// push changes from the second layer cache to the first one
viewTemp.Flush();
uint256 hash = tx.GetHash();
// Added
pblock->vtx.push_back(tx);
nBlockSize += nTxSize;
++nBlockTx;
nBlockSigOps += nTxSigOps;
nFees += nTxFees;
if (fDebug && GetBoolArg("-printpriority"))
{
printf("priority %.1f feeperkb %.1f txid %s\n",
dPriority, dFeePerKb, tx.GetHash().ToString().c_str());
}
// Add transactions that depend on this one to the priority queue
if (mapDependers.count(hash))
{
BOOST_FOREACH(COrphan* porphan, mapDependers[hash])
{
if (!porphan->setDependsOn.empty())
{
porphan->setDependsOn.erase(hash);
if (porphan->setDependsOn.empty())
{
vecPriority.push_back(TxPriority(porphan->dPriority, porphan->dFeePerKb, porphan->ptx));
std::push_heap(vecPriority.begin(), vecPriority.end(), comparer);
}
}
}
}
}
nLastBlockTx = nBlockTx;
nLastBlockSize = nBlockSize;
if (fDebug && GetBoolArg("-printpriority"))
printf("CreateNewBlock(): total size %"PRI64u"\n", nBlockSize);
if (!fProofOfStake)
pblock->vtx[0].vout[0].nValue = GetProofOfWorkReward(pindexPrev->nHeight, nFees);
// Fill in header
pblock->hashPrevBlock = pindexPrev->GetBlockHash();
pblock->nTime = max(pindexPrev->GetMedianTimePast()+1, pblock->GetMaxTransactionTime());
pblock->nTime = max(pblock->GetBlockTime(), PastDrift(pindexPrev->GetBlockTime()));
if (!fProofOfStake)
pblock->UpdateTime(pindexPrev);
pblock->nNonce = 0;
}
return pblock.release();
}
void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce)
{
// Update nExtraNonce
static uint256 hashPrevBlock;
if (hashPrevBlock != pblock->hashPrevBlock)
{
nExtraNonce = 0;
hashPrevBlock = pblock->hashPrevBlock;
}
++nExtraNonce;
unsigned int nHeight = pindexPrev->nHeight+1; // Height first in coinbase required
pblock->vtx[0].vin[0].scriptSig = (CScript() << nHeight << CBigNum(nExtraNonce)) + COINBASE_FLAGS;
assert(pblock->vtx[0].vin[0].scriptSig.size() <= 100);
pblock->hashMerkleRoot = pblock->BuildMerkleTree();
}
void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash1)
{
//
// Pre-build hash buffers
//
struct
{
struct unnamed2
{
int nVersion;
uint256 hashPrevBlock;
uint256 hashMerkleRoot;
unsigned int nTime;
unsigned int nBits;
unsigned int nNonce;
}
block;
unsigned char pchPadding0[64];
uint256 hash1;
unsigned char pchPadding1[64];
}
tmp;
memset(&tmp, 0, sizeof(tmp));
tmp.block.nVersion = pblock->nVersion;
tmp.block.hashPrevBlock = pblock->hashPrevBlock;
tmp.block.hashMerkleRoot = pblock->hashMerkleRoot;
tmp.block.nTime = pblock->nTime;
tmp.block.nBits = pblock->nBits;
tmp.block.nNonce = pblock->nNonce;
FormatHashBlocks(&tmp.block, sizeof(tmp.block));
FormatHashBlocks(&tmp.hash1, sizeof(tmp.hash1));
// Byte swap all the input buffer
for (unsigned int i = 0; i < sizeof(tmp)/4; i++)
((unsigned int*)&tmp)[i] = ByteReverse(((unsigned int*)&tmp)[i]);
// Precalc the first half of the first hash, which stays constant
SHA256Transform(pmidstate, &tmp.block, pSHA256InitState);
memcpy(pdata, &tmp.block, 128);
memcpy(phash1, &tmp.hash1, 64);
}
bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey)
{
uint256 hashBlock = pblock->GetHash();
uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256();
if(!pblock->IsProofOfWork())
return error("CheckWork() : %s is not a proof-of-work block", hashBlock.GetHex().c_str());
if (hashBlock > hashTarget)
return error("CheckWork() : proof-of-work not meeting target");
//// debug print
printf("CheckWork() : new proof-of-work block found \n hash: %s \ntarget: %s\n", hashBlock.GetHex().c_str(), hashTarget.GetHex().c_str());
pblock->print();
printf("generated %s\n", FormatMoney(pblock->vtx[0].vout[0].nValue).c_str());
// Found a solution
{
LOCK(cs_main);
if (pblock->hashPrevBlock != hashBestChain)
return error("CheckWork() : generated block is stale");
// Remove key from key pool
reservekey.KeepKey();
// Track how many getdata requests this block gets
{
LOCK(wallet.cs_wallet);
wallet.mapRequestCount[hashBlock] = 0;
}
// Process this block the same as if we had received it from another node
if (!ProcessBlock(NULL, pblock))
return error("CheckWork() : ProcessBlock, block not accepted");
}
return true;
}
bool CheckStake(CBlock* pblock, CWallet& wallet)
{
uint256 proofHash = 0, hashTarget = 0;
uint256 hashBlock = pblock->GetHash();
bool fFatal = false;
if(!pblock->IsProofOfStake())
return error("CheckStake() : %s is not a proof-of-stake block", hashBlock.GetHex().c_str());
// verify hash target and signature of coinstake tx
if (!CheckProofOfStake(pblock->vtx[1], pblock->nBits, proofHash, hashTarget, fFatal, true))
return error("CheckStake() : proof-of-stake checking failed");
//// debug print
printf("CheckStake() : new proof-of-stake block found \n hash: %s \nproofhash: %s \ntarget: %s\n", hashBlock.GetHex().c_str(), proofHash.GetHex().c_str(), hashTarget.GetHex().c_str());
pblock->print();
printf("out %s\n", FormatMoney(pblock->vtx[1].GetValueOut()).c_str());
// Found a solution
{
LOCK(cs_main);
if (pblock->hashPrevBlock != hashBestChain)
return error("CheckStake() : generated block is stale");
// Track how many getdata requests this block gets
{
LOCK(wallet.cs_wallet);
wallet.mapRequestCount[hashBlock] = 0;
}
// Process this block the same as if we had received it from another node
if (!ProcessBlock(NULL, pblock))
return error("CheckStake() : ProcessBlock, block not accepted");
}
return true;
}
void StakeMiner(CWallet *pwallet)
{
SetThreadPriority(THREAD_PRIORITY_LOWEST);
// Make this thread recognisable as the mining thread
RenameThread("novacoin-miner");
// Each thread has its own counter
unsigned int nExtraNonce = 0;
while (true)
{
if (fShutdown)
return;
while (pwallet->IsLocked())
{
strMintWarning = strMintMessage;
Sleep(1000);
if (fShutdown)
return;
}
while (vNodes.empty() || IsInitialBlockDownload())
{
Sleep(1000);
if (fShutdown)
return;
}
strMintWarning = "";
//
// Create new block
//
CBlockIndex* pindexPrev = pindexBest;
auto_ptr<CBlock> pblock(CreateNewBlock(pwallet, true));
if (!pblock.get())
return;
IncrementExtraNonce(pblock.get(), pindexPrev, nExtraNonce);
// Trying to sign a block
if (pblock->SignBlock(*pwallet))
{
strMintWarning = _("Stake generation: new block found!");
SetThreadPriority(THREAD_PRIORITY_NORMAL);
CheckStake(pblock.get(), *pwallet);
SetThreadPriority(THREAD_PRIORITY_LOWEST);
Sleep(1000);
}
else
Sleep(nMinerSleep);
}
}
| Infernoman/Sembros-Next | src/miner.cpp | C++ | mit | 19,473 | [
30522,
1013,
1013,
9385,
1006,
1039,
1007,
2268,
1011,
2230,
20251,
6182,
17823,
22591,
3406,
1013,
1013,
9385,
1006,
1039,
1007,
2268,
1011,
2262,
1996,
2978,
3597,
2378,
9797,
1013,
1013,
9385,
1006,
1039,
1007,
2286,
1996,
6846,
3597,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
let _ = require('lodash');
let async = require('async');
const pip_services3_commons_node_1 = require("pip-services3-commons-node");
const pip_services3_facade_node_1 = require("pip-services3-facade-node");
class RolesOperationsV1 extends pip_services3_facade_node_1.FacadeOperations {
constructor() {
super();
this._dependencyResolver.put('roles', new pip_services3_commons_node_1.Descriptor('pip-services-roles', 'client', '*', '*', '1.0'));
}
setReferences(references) {
super.setReferences(references);
this._rolesClient = this._dependencyResolver.getOneRequired('roles');
}
getUserRolesOperation() {
return (req, res) => {
this.getUserRoles(req, res);
};
}
grantUserRolesOperation() {
return (req, res) => {
this.grantUserRoles(req, res);
};
}
revokeUserRolesOperation() {
return (req, res) => {
this.revokeUserRoles(req, res);
};
}
getUserRoles(req, res) {
let userId = req.route.params.user_id;
this._rolesClient.getRolesById(null, userId, this.sendResult(req, res));
}
grantUserRoles(req, res) {
let userId = req.route.params.user_id;
let roles = req.body;
this._rolesClient.grantRoles(null, userId, roles, this.sendResult(req, res));
}
revokeUserRoles(req, res) {
let userId = req.route.params.user_id;
let roles = req.body;
this._rolesClient.revokeRoles(null, userId, roles, this.sendResult(req, res));
}
}
exports.RolesOperationsV1 = RolesOperationsV1;
//# sourceMappingURL=RolesOperationsV1.js.map | pip-services-users/pip-facade-users-node | obj/src/operations/version1/RolesOperationsV1.js | JavaScript | mit | 1,730 | [
30522,
1000,
2224,
9384,
1000,
1025,
4874,
1012,
9375,
21572,
4842,
3723,
1006,
14338,
1010,
1000,
1035,
1035,
9686,
5302,
8566,
2571,
1000,
1010,
1063,
3643,
1024,
2995,
1065,
1007,
1025,
2292,
1035,
1027,
5478,
1006,
1005,
8840,
8883,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hive.spark.client;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import org.apache.hive.spark.counter.SparkCounters;
import org.apache.spark.api.java.JavaFutureAction;
import org.apache.spark.api.java.JavaSparkContext;
class JobContextImpl implements JobContext {
private final JavaSparkContext sc;
private final ThreadLocal<MonitorCallback> monitorCb;
private final Map<String, List<JavaFutureAction<?>>> monitoredJobs;
private final List<String> addedJars;
public JobContextImpl(JavaSparkContext sc) {
this.sc = sc;
this.monitorCb = new ThreadLocal<MonitorCallback>();
monitoredJobs = new ConcurrentHashMap<String, List<JavaFutureAction<?>>>();
addedJars = new CopyOnWriteArrayList<String>();
}
@Override
public JavaSparkContext sc() {
return sc;
}
@Override
public <T> JavaFutureAction<T> monitor(JavaFutureAction<T> job,
SparkCounters sparkCounters, Set<Integer> cachedRDDIds) {
monitorCb.get().call(job, sparkCounters, cachedRDDIds);
return job;
}
@Override
public Map<String, List<JavaFutureAction<?>>> getMonitoredJobs() {
return monitoredJobs;
}
@Override
public List<String> getAddedJars() {
return addedJars;
}
void setMonitorCb(MonitorCallback cb) {
monitorCb.set(cb);
}
void stop() {
monitoredJobs.clear();
sc.stop();
}
}
| winningsix/hive | spark-client/src/main/java/org/apache/hive/spark/client/JobContextImpl.java | Java | apache-2.0 | 2,285 | [
30522,
1013,
1008,
1008,
7000,
2000,
1996,
15895,
4007,
3192,
1006,
2004,
2546,
30524,
1012,
1008,
1996,
2004,
2546,
15943,
2023,
5371,
2000,
2017,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1008,
1006,
1996,
1000,
6105,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
$help = array();
/**
* Backup Settings
*/
$help['tip_backup_enabled'] = dgettext(
'help',
'Enable Backup process'
);
$help['tip_backup_configuration_files'] = dgettext(
'help',
'Backup configuration files (MySQL, Zend, Apache, PHP, SNMP, centreon, centreon-engine, centreon-broker)'
);
$help['tip_backup_database_centreon'] = dgettext(
'help',
'Backup centreon database'
);
$help['tip_backup_database_centreon_storage'] = dgettext(
'help',
'Backup centreon_storage database'
);
$help['tip_backup_database_type'] = dgettext(
'help',
'Backup type for centreon_storage database : mysqldump or LVM snapshot (need available space on MySQL LVM)'
);
$help['tip_backup_database_full'] = dgettext(
'help',
'Full backup period'
);
$help['tip_backup_database_partial'] = dgettext(
'help',
'Partial backup period (available on partitioned tables)'
);
$help['tip_backup_directory'] = dgettext(
'help',
'Directory where backups will be stored'
);
$help['tip_backup_tmp_directory'] = dgettext(
'help',
'Temporary directory used by backup process'
);
$help['tip_backup_retention'] = dgettext(
'help',
'Backup retention (in days)'
);
$help['tip_backup_mysql_conf'] = dgettext(
'help',
'MySQL configuration file path (i.e. /etc/my.cnf.d/centreon.cnf)'
);
$help['tip_backup_zend_conf'] = dgettext(
'help',
'Zend configuration file path (i.e. /etc/php.d/zendguard.ini)'
);
$help['tip_backup_export_scp_enabled'] = dgettext(
'help',
'Use SCP to copy backup on remote host'
);
$help['tip_backup_export_scp_user'] = dgettext(
'help',
'Remote user used by SCP'
);
$help['tip_backup_export_scp_host'] = dgettext(
'help',
'Remote host to copy by SCP'
);
$help['tip_backup_export_scp_directory'] = dgettext(
'help',
'Remote directory to copy by SCP'
);
| s-duret/centreon | www/include/Administration/parameters/backup/help.php | PHP | gpl-2.0 | 1,863 | [
30522,
1026,
1029,
25718,
1002,
2393,
1027,
9140,
1006,
1007,
1025,
1013,
1008,
1008,
1008,
10200,
10906,
1008,
1013,
1002,
2393,
1031,
1005,
5955,
1035,
10200,
1035,
9124,
1005,
1033,
1027,
1040,
18150,
18209,
1006,
1005,
2393,
1005,
1010,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
module Tire
module Model
module Persistence
# Provides infrastructure for storing records in _Elasticsearch_.
#
module Storage
def self.included(base)
base.class_eval do
extend ClassMethods
include InstanceMethods
end
end
module ClassMethods
def create(args={})
document = new(args)
return false unless document.valid?
if result = document.save
document
else
result
end
end
end
module InstanceMethods
def update_attribute(name, value)
__update_attributes name => value
save
end
def update_attributes(attributes={})
__update_attributes attributes
save
end
def update_index
run_callbacks :update_elasticsearch_index do
if destroyed?
response = index.remove self
else
if response = index.store( self, {:percolate => percolator} )
self.id ||= response['_id']
self._index = response['_index']
self._type = response['_type']
self._version = response['_version']
self.matches = response['matches']
end
end
response
end
end
def save
return false unless valid?
run_callbacks :save do
response = update_index
!! response['ok']
end
end
def destroy
run_callbacks :destroy do
@destroyed = true
response = update_index
! response.nil?
end
end
def destroyed? ; !!@destroyed; end
def persisted? ; !!id && !!_version; end
def new_record? ; !persisted?; end
end
end
end
end
end
| HenleyChiu/tire | lib/tire/model/persistence/storage.rb | Ruby | mit | 2,068 | [
30522,
11336,
12824,
11336,
2944,
11336,
28297,
1001,
3640,
6502,
2005,
23977,
2636,
1999,
1035,
21274,
17310,
11140,
1035,
1012,
1001,
11336,
5527,
13366,
2969,
1012,
2443,
1006,
2918,
1007,
2918,
1012,
2465,
1035,
9345,
2140,
2079,
7949,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.builder.component.dsl;
import javax.annotation.Generated;
import org.apache.camel.Component;
import org.apache.camel.builder.component.AbstractComponentBuilder;
import org.apache.camel.builder.component.ComponentBuilder;
import org.apache.camel.component.mina.MinaComponent;
/**
* Socket level networking using TCP or UDP with Apache Mina 2.x.
*
* Generated by camel-package-maven-plugin - do not edit this file!
*/
@Generated("org.apache.camel.maven.packaging.ComponentDslMojo")
public interface MinaComponentBuilderFactory {
/**
* Mina (camel-mina)
* Socket level networking using TCP or UDP with Apache Mina 2.x.
*
* Category: networking,tcp,udp
* Since: 2.10
* Maven coordinates: org.apache.camel:camel-mina
*
* @return the dsl builder
*/
static MinaComponentBuilder mina() {
return new MinaComponentBuilderImpl();
}
/**
* Builder for the Mina component.
*/
interface MinaComponentBuilder extends ComponentBuilder<MinaComponent> {
/**
* Whether or not to disconnect(close) from Mina session right after
* use. Can be used for both consumer and producer.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: common
*
* @param disconnect the value to set
* @return the dsl builder
*/
default MinaComponentBuilder disconnect(boolean disconnect) {
doSetProperty("disconnect", disconnect);
return this;
}
/**
* You can enable the Apache MINA logging filter. Apache MINA uses slf4j
* logging at INFO level to log all input and output.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: common
*
* @param minaLogger the value to set
* @return the dsl builder
*/
default MinaComponentBuilder minaLogger(boolean minaLogger) {
doSetProperty("minaLogger", minaLogger);
return this;
}
/**
* Setting to set endpoint as one-way or request-response.
*
* The option is a: <code>boolean</code> type.
*
* Default: true
* Group: common
*
* @param sync the value to set
* @return the dsl builder
*/
default MinaComponentBuilder sync(boolean sync) {
doSetProperty("sync", sync);
return this;
}
/**
* You can configure the timeout that specifies how long to wait for a
* response from a remote server. The timeout unit is in milliseconds,
* so 60000 is 60 seconds.
*
* The option is a: <code>long</code> type.
*
* Default: 30000
* Group: common
*
* @param timeout the value to set
* @return the dsl builder
*/
default MinaComponentBuilder timeout(long timeout) {
doSetProperty("timeout", timeout);
return this;
}
/**
* Maximum amount of time it should take to send data to the MINA
* session. Default is 10000 milliseconds.
*
* The option is a: <code>long</code> type.
*
* Default: 10000
* Group: common
*
* @param writeTimeout the value to set
* @return the dsl builder
*/
default MinaComponentBuilder writeTimeout(long writeTimeout) {
doSetProperty("writeTimeout", writeTimeout);
return this;
}
/**
* Allows for bridging the consumer to the Camel routing Error Handler,
* which mean any exceptions occurred while the consumer is trying to
* pickup incoming messages, or the likes, will now be processed as a
* message and handled by the routing Error Handler. By default the
* consumer will use the org.apache.camel.spi.ExceptionHandler to deal
* with exceptions, that will be logged at WARN or ERROR level and
* ignored.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: consumer
*
* @param bridgeErrorHandler the value to set
* @return the dsl builder
*/
default MinaComponentBuilder bridgeErrorHandler(
boolean bridgeErrorHandler) {
doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
return this;
}
/**
* If the clientMode is true, mina consumer will connect the address as
* a TCP client.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: consumer
*
* @param clientMode the value to set
* @return the dsl builder
*/
default MinaComponentBuilder clientMode(boolean clientMode) {
doSetProperty("clientMode", clientMode);
return this;
}
/**
* If sync is enabled then this option dictates MinaConsumer if it
* should disconnect where there is no reply to send back.
*
* The option is a: <code>boolean</code> type.
*
* Default: true
* Group: consumer (advanced)
*
* @param disconnectOnNoReply the value to set
* @return the dsl builder
*/
default MinaComponentBuilder disconnectOnNoReply(
boolean disconnectOnNoReply) {
doSetProperty("disconnectOnNoReply", disconnectOnNoReply);
return this;
}
/**
* If sync is enabled this option dictates MinaConsumer which logging
* level to use when logging a there is no reply to send back.
*
* The option is a:
* <code>org.apache.camel.LoggingLevel</code> type.
*
* Default: WARN
* Group: consumer (advanced)
*
* @param noReplyLogLevel the value to set
* @return the dsl builder
*/
default MinaComponentBuilder noReplyLogLevel(
org.apache.camel.LoggingLevel noReplyLogLevel) {
doSetProperty("noReplyLogLevel", noReplyLogLevel);
return this;
}
/**
* Whether the producer should be started lazy (on the first message).
* By starting lazy you can use this to allow CamelContext and routes to
* startup in situations where a producer may otherwise fail during
* starting and cause the route to fail being started. By deferring this
* startup to be lazy then the startup failure can be handled during
* routing messages via Camel's routing error handlers. Beware that when
* the first message is processed then creating and starting the
* producer may take a little time and prolong the total processing time
* of the processing.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: producer
*
* @param lazyStartProducer the value to set
* @return the dsl builder
*/
default MinaComponentBuilder lazyStartProducer(boolean lazyStartProducer) {
doSetProperty("lazyStartProducer", lazyStartProducer);
return this;
}
/**
* Whether to create the InetAddress once and reuse. Setting this to
* false allows to pickup DNS changes in the network.
*
* The option is a: <code>boolean</code> type.
*
* Default: true
* Group: producer (advanced)
*
* @param cachedAddress the value to set
* @return the dsl builder
*/
default MinaComponentBuilder cachedAddress(boolean cachedAddress) {
doSetProperty("cachedAddress", cachedAddress);
return this;
}
/**
* Sessions can be lazily created to avoid exceptions, if the remote
* server is not up and running when the Camel producer is started.
*
* The option is a: <code>boolean</code> type.
*
* Default: true
* Group: producer (advanced)
*
* @param lazySessionCreation the value to set
* @return the dsl builder
*/
default MinaComponentBuilder lazySessionCreation(
boolean lazySessionCreation) {
doSetProperty("lazySessionCreation", lazySessionCreation);
return this;
}
/**
* Whether autowiring is enabled. This is used for automatic autowiring
* options (the option must be marked as autowired) by looking up in the
* registry to find if there is a single instance of matching type,
* which then gets configured on the component. This can be used for
* automatic configuring JDBC data sources, JMS connection factories,
* AWS Clients, etc.
*
* The option is a: <code>boolean</code> type.
*
* Default: true
* Group: advanced
*
* @param autowiredEnabled the value to set
* @return the dsl builder
*/
default MinaComponentBuilder autowiredEnabled(boolean autowiredEnabled) {
doSetProperty("autowiredEnabled", autowiredEnabled);
return this;
}
/**
* To use the shared mina configuration.
*
* The option is a:
* <code>org.apache.camel.component.mina.MinaConfiguration</code> type.
*
* Group: advanced
*
* @param configuration the value to set
* @return the dsl builder
*/
default MinaComponentBuilder configuration(
org.apache.camel.component.mina.MinaConfiguration configuration) {
doSetProperty("configuration", configuration);
return this;
}
/**
* Number of worker threads in the worker pool for TCP and UDP.
*
* The option is a: <code>int</code> type.
*
* Default: 16
* Group: advanced
*
* @param maximumPoolSize the value to set
* @return the dsl builder
*/
default MinaComponentBuilder maximumPoolSize(int maximumPoolSize) {
doSetProperty("maximumPoolSize", maximumPoolSize);
return this;
}
/**
* Whether to use ordered thread pool, to ensure events are processed
* orderly on the same channel.
*
* The option is a: <code>boolean</code> type.
*
* Default: true
* Group: advanced
*
* @param orderedThreadPoolExecutor the value to set
* @return the dsl builder
*/
default MinaComponentBuilder orderedThreadPoolExecutor(
boolean orderedThreadPoolExecutor) {
doSetProperty("orderedThreadPoolExecutor", orderedThreadPoolExecutor);
return this;
}
/**
* Only used for TCP. You can transfer the exchange over the wire
* instead of just the body. The following fields are transferred: In
* body, Out body, fault body, In headers, Out headers, fault headers,
* exchange properties, exchange exception. This requires that the
* objects are serializable. Camel will exclude any non-serializable
* objects and log it at WARN level.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: advanced
*
* @param transferExchange the value to set
* @return the dsl builder
*/
default MinaComponentBuilder transferExchange(boolean transferExchange) {
doSetProperty("transferExchange", transferExchange);
return this;
}
/**
* The mina component installs a default codec if both, codec is null
* and textline is false. Setting allowDefaultCodec to false prevents
* the mina component from installing a default codec as the first
* element in the filter chain. This is useful in scenarios where
* another filter must be the first in the filter chain, like the SSL
* filter.
*
* The option is a: <code>boolean</code> type.
*
* Default: true
* Group: codec
*
* @param allowDefaultCodec the value to set
* @return the dsl builder
*/
default MinaComponentBuilder allowDefaultCodec(boolean allowDefaultCodec) {
doSetProperty("allowDefaultCodec", allowDefaultCodec);
return this;
}
/**
* To use a custom minda codec implementation.
*
* The option is a:
* <code>org.apache.mina.filter.codec.ProtocolCodecFactory</code> type.
*
* Group: codec
*
* @param codec the value to set
* @return the dsl builder
*/
default MinaComponentBuilder codec(
org.apache.mina.filter.codec.ProtocolCodecFactory codec) {
doSetProperty("codec", codec);
return this;
}
/**
* To set the textline protocol decoder max line length. By default the
* default value of Mina itself is used which are 1024.
*
* The option is a: <code>int</code> type.
*
* Default: 1024
* Group: codec
*
* @param decoderMaxLineLength the value to set
* @return the dsl builder
*/
default MinaComponentBuilder decoderMaxLineLength(
int decoderMaxLineLength) {
doSetProperty("decoderMaxLineLength", decoderMaxLineLength);
return this;
}
/**
* To set the textline protocol encoder max line length. By default the
* default value of Mina itself is used which are Integer.MAX_VALUE.
*
* The option is a: <code>int</code> type.
*
* Default: -1
* Group: codec
*
* @param encoderMaxLineLength the value to set
* @return the dsl builder
*/
default MinaComponentBuilder encoderMaxLineLength(
int encoderMaxLineLength) {
doSetProperty("encoderMaxLineLength", encoderMaxLineLength);
return this;
}
/**
* You can configure the encoding (a charset name) to use for the TCP
* textline codec and the UDP protocol. If not provided, Camel will use
* the JVM default Charset.
*
* The option is a: <code>java.lang.String</code> type.
*
* Group: codec
*
* @param encoding the value to set
* @return the dsl builder
*/
default MinaComponentBuilder encoding(java.lang.String encoding) {
doSetProperty("encoding", encoding);
return this;
}
/**
* You can set a list of Mina IoFilters to use.
*
* The option is a:
* <code>java.util.List&lt;org.apache.mina.core.filterchain.IoFilter&gt;</code> type.
*
* Group: codec
*
* @param filters the value to set
* @return the dsl builder
*/
default MinaComponentBuilder filters(
java.util.List<org.apache.mina.core.filterchain.IoFilter> filters) {
doSetProperty("filters", filters);
return this;
}
/**
* Only used for TCP. If no codec is specified, you can use this flag to
* indicate a text line based codec; if not specified or the value is
* false, then Object Serialization is assumed over TCP.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: codec
*
* @param textline the value to set
* @return the dsl builder
*/
default MinaComponentBuilder textline(boolean textline) {
doSetProperty("textline", textline);
return this;
}
/**
* Only used for TCP and if textline=true. Sets the text line delimiter
* to use. If none provided, Camel will use DEFAULT. This delimiter is
* used to mark the end of text.
*
* The option is a:
* <code>org.apache.camel.component.mina.MinaTextLineDelimiter</code> type.
*
* Group: codec
*
* @param textlineDelimiter the value to set
* @return the dsl builder
*/
default MinaComponentBuilder textlineDelimiter(
org.apache.camel.component.mina.MinaTextLineDelimiter textlineDelimiter) {
doSetProperty("textlineDelimiter", textlineDelimiter);
return this;
}
/**
* Whether to auto start SSL handshake.
*
* The option is a: <code>boolean</code> type.
*
* Default: true
* Group: security
*
* @param autoStartTls the value to set
* @return the dsl builder
*/
default MinaComponentBuilder autoStartTls(boolean autoStartTls) {
doSetProperty("autoStartTls", autoStartTls);
return this;
}
/**
* To configure SSL security.
*
* The option is a:
* <code>org.apache.camel.support.jsse.SSLContextParameters</code> type.
*
* Group: security
*
* @param sslContextParameters the value to set
* @return the dsl builder
*/
default MinaComponentBuilder sslContextParameters(
org.apache.camel.support.jsse.SSLContextParameters sslContextParameters) {
doSetProperty("sslContextParameters", sslContextParameters);
return this;
}
/**
* Enable usage of global SSL context parameters.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: security
*
* @param useGlobalSslContextParameters the value to set
* @return the dsl builder
*/
default MinaComponentBuilder useGlobalSslContextParameters(
boolean useGlobalSslContextParameters) {
doSetProperty("useGlobalSslContextParameters", useGlobalSslContextParameters);
return this;
}
}
class MinaComponentBuilderImpl
extends
AbstractComponentBuilder<MinaComponent>
implements
MinaComponentBuilder {
@Override
protected MinaComponent buildConcreteComponent() {
return new MinaComponent();
}
private org.apache.camel.component.mina.MinaConfiguration getOrCreateConfiguration(
org.apache.camel.component.mina.MinaComponent component) {
if (component.getConfiguration() == null) {
component.setConfiguration(new org.apache.camel.component.mina.MinaConfiguration());
}
return component.getConfiguration();
}
@Override
protected boolean setPropertyOnComponent(
Component component,
String name,
Object value) {
switch (name) {
case "disconnect": getOrCreateConfiguration((MinaComponent) component).setDisconnect((boolean) value); return true;
case "minaLogger": getOrCreateConfiguration((MinaComponent) component).setMinaLogger((boolean) value); return true;
case "sync": getOrCreateConfiguration((MinaComponent) component).setSync((boolean) value); return true;
case "timeout": getOrCreateConfiguration((MinaComponent) component).setTimeout((long) value); return true;
case "writeTimeout": getOrCreateConfiguration((MinaComponent) component).setWriteTimeout((long) value); return true;
case "bridgeErrorHandler": ((MinaComponent) component).setBridgeErrorHandler((boolean) value); return true;
case "clientMode": getOrCreateConfiguration((MinaComponent) component).setClientMode((boolean) value); return true;
case "disconnectOnNoReply": getOrCreateConfiguration((MinaComponent) component).setDisconnectOnNoReply((boolean) value); return true;
case "noReplyLogLevel": getOrCreateConfiguration((MinaComponent) component).setNoReplyLogLevel((org.apache.camel.LoggingLevel) value); return true;
case "lazyStartProducer": ((MinaComponent) component).setLazyStartProducer((boolean) value); return true;
case "cachedAddress": getOrCreateConfiguration((MinaComponent) component).setCachedAddress((boolean) value); return true;
case "lazySessionCreation": getOrCreateConfiguration((MinaComponent) component).setLazySessionCreation((boolean) value); return true;
case "autowiredEnabled": ((MinaComponent) component).setAutowiredEnabled((boolean) value); return true;
case "configuration": ((MinaComponent) component).setConfiguration((org.apache.camel.component.mina.MinaConfiguration) value); return true;
case "maximumPoolSize": getOrCreateConfiguration((MinaComponent) component).setMaximumPoolSize((int) value); return true;
case "orderedThreadPoolExecutor": getOrCreateConfiguration((MinaComponent) component).setOrderedThreadPoolExecutor((boolean) value); return true;
case "transferExchange": getOrCreateConfiguration((MinaComponent) component).setTransferExchange((boolean) value); return true;
case "allowDefaultCodec": getOrCreateConfiguration((MinaComponent) component).setAllowDefaultCodec((boolean) value); return true;
case "codec": getOrCreateConfiguration((MinaComponent) component).setCodec((org.apache.mina.filter.codec.ProtocolCodecFactory) value); return true;
case "decoderMaxLineLength": getOrCreateConfiguration((MinaComponent) component).setDecoderMaxLineLength((int) value); return true;
case "encoderMaxLineLength": getOrCreateConfiguration((MinaComponent) component).setEncoderMaxLineLength((int) value); return true;
case "encoding": getOrCreateConfiguration((MinaComponent) component).setEncoding((java.lang.String) value); return true;
case "filters": getOrCreateConfiguration((MinaComponent) component).setFilters((java.util.List) value); return true;
case "textline": getOrCreateConfiguration((MinaComponent) component).setTextline((boolean) value); return true;
case "textlineDelimiter": getOrCreateConfiguration((MinaComponent) component).setTextlineDelimiter((org.apache.camel.component.mina.MinaTextLineDelimiter) value); return true;
case "autoStartTls": getOrCreateConfiguration((MinaComponent) component).setAutoStartTls((boolean) value); return true;
case "sslContextParameters": getOrCreateConfiguration((MinaComponent) component).setSslContextParameters((org.apache.camel.support.jsse.SSLContextParameters) value); return true;
case "useGlobalSslContextParameters": ((MinaComponent) component).setUseGlobalSslContextParameters((boolean) value); return true;
default: return false;
}
}
}
} | nikhilvibhav/camel | core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MinaComponentBuilderFactory.java | Java | apache-2.0 | 24,837 | [
30522,
1013,
1008,
1008,
7000,
2000,
1996,
15895,
4007,
3192,
1006,
2004,
2546,
1007,
2104,
2028,
2030,
2062,
1008,
12130,
6105,
10540,
1012,
2156,
1996,
5060,
5371,
5500,
2007,
1008,
2023,
2147,
2005,
3176,
2592,
4953,
9385,
6095,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# mkdirp-promise [![version][npm-version]][npm-url] [![License][npm-license]][license-url]
[Promise] version of [mkdirp]:
> Like mkdir -p, but in node.js!
[![Build Status][travis-image]][travis-url]
[![Downloads][npm-downloads]][npm-url]
[![Code Climate][codeclimate-quality]][codeclimate-url]
[![Coverage Status][codeclimate-coverage]][codeclimate-url]
[![Dependencies][david-image]][david-url]
## Install
```sh
npm install --save mkdirp-promise
```
## API
```js
var mkdirp = require('mkdirp-promise')
```
### mkdirp(dir, [, options])
*pattern*: `String`
*options*: `Object` or `String`
Return: `Object` ([Promise])
When it finishes, it will be [*fulfilled*](http://promisesaplus.com/#point-26) with the first directory made that had to be created, if any.
When it fails, it will be [*rejected*](http://promisesaplus.com/#point-30) with an error as its first argument.
```js
mkdirp('/tmp/foo/bar/baz')
.then(function (made) {
console.log(made) //=> '/tmp/foo'
})
.catch(function (err) {
console.error(err)
})
})
```
#### options
The option object will be directly passed to [mkdirp](https://github.com/substack/node-mkdirp#mkdirpdir-opts-cb).
## License
[ISC License](LICENSE) © [Ahmad Nassri](https://www.ahmadnassri.com/)
[license-url]: https://github.com/ahmadnassri/mkdirp-promise/blob/master/LICENSE
[travis-url]: https://travis-ci.org/ahmadnassri/mkdirp-promise
[travis-image]: https://img.shields.io/travis/ahmadnassri/mkdirp-promise.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/mkdirp-promise
[npm-license]: https://img.shields.io/npm/l/mkdirp-promise.svg?style=flat-square
[npm-version]: https://img.shields.io/npm/v/mkdirp-promise.svg?style=flat-square
[npm-downloads]: https://img.shields.io/npm/dm/mkdirp-promise.svg?style=flat-square
[codeclimate-url]: https://codeclimate.com/github/ahmadnassri/mkdirp-promise
[codeclimate-quality]: https://img.shields.io/codeclimate/github/ahmadnassri/mkdirp-promise.svg?style=flat-square
[codeclimate-coverage]: https://img.shields.io/codeclimate/coverage/github/ahmadnassri/mkdirp-promise.svg?style=flat-square
[david-url]: https://david-dm.org/ahmadnassri/mkdirp-promise
[david-image]: https://img.shields.io/david/ahmadnassri/mkdirp-promise.svg?style=flat-square
[mkdirp]: https://github.com/substack/node-mkdirp
[Promise]: http://promisesaplus.com/
| silklabs/silk | node_modules/mkdirp-promise/README.md | Markdown | mit | 2,370 | [
30522,
1001,
12395,
4305,
14536,
1011,
4872,
1031,
999,
1031,
2544,
1033,
1031,
27937,
2213,
1011,
2544,
1033,
1033,
1031,
27937,
2213,
1011,
24471,
2140,
1033,
1031,
999,
1031,
6105,
1033,
1031,
27937,
2213,
1011,
6105,
1033,
1033,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights
* Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.redshift.model.transform;
import org.w3c.dom.Node;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.util.XpathUtils;
import com.amazonaws.transform.StandardErrorUnmarshaller;
import com.amazonaws.services.redshift.model.ClusterQuotaExceededException;
public class ClusterQuotaExceededExceptionUnmarshaller extends
StandardErrorUnmarshaller {
public ClusterQuotaExceededExceptionUnmarshaller() {
super(ClusterQuotaExceededException.class);
}
@Override
public AmazonServiceException unmarshall(Node node) throws Exception {
// Bail out if this isn't the right error code that this
// marshaller understands
String errorCode = parseErrorCode(node);
if (errorCode == null || !errorCode.equals("ClusterQuotaExceeded"))
return null;
ClusterQuotaExceededException e = (ClusterQuotaExceededException) super
.unmarshall(node);
return e;
}
}
| nterry/aws-sdk-java | aws-java-sdk-redshift/src/main/java/com/amazonaws/services/redshift/model/transform/ClusterQuotaExceededExceptionUnmarshaller.java | Java | apache-2.0 | 1,589 | [
30522,
1013,
1008,
1008,
9385,
2230,
1011,
2355,
9733,
1012,
4012,
1010,
4297,
1012,
2030,
2049,
18460,
1012,
2035,
2916,
1008,
9235,
1012,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package pgparser
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
var (
singleRecordString = `({http://www.example.com/image1.png,http://www.example.com/image2.png},image/png,"a logo",123456)`
multipleRecordString = `{"({http://www.example.com/image1.png,http://www.example.com/image2.png},image/png,\"a logo\",123456)","({http://www.example.com/banner.png},image/png,\"a banner\",123456)"}`
unquotedString = `this is a test`
emptyArray = `{}`
)
type record struct {
URLs []string
Type string
Name string
Size int
}
func TestSingleRecord(t *testing.T) {
a := assert.New(t)
var r record
if !a.NoError(Unmarshal(singleRecordString, &r)) {
return
}
a.Equal(record{
URLs: []string{
"http://www.example.com/image1.png",
"http://www.example.com/image2.png",
},
Type: "image/png",
Name: "a logo",
Size: 123456,
}, r)
}
func TestMultipleRecords(t *testing.T) {
a := assert.New(t)
var r []record
if !a.NoError(Unmarshal(multipleRecordString, &r)) {
return
}
a.Equal([]record{
{
URLs: []string{
"http://www.example.com/image1.png",
"http://www.example.com/image2.png",
},
Type: "image/png",
Name: "a logo",
Size: 123456,
},
{
URLs: []string{
"http://www.example.com/banner.png",
},
Type: "image/png",
Name: "a banner",
Size: 123456,
},
}, r)
}
func TestByteSlice(t *testing.T) {
a := assert.New(t)
var r []byte
if !a.NoError(Unmarshal(unquotedString, &r)) {
return
}
a.Equal([]byte(unquotedString), r)
}
func TestByteSliceQuoted(t *testing.T) {
a := assert.New(t)
var r []byte
if !a.NoError(Unmarshal("\""+unquotedString+"\"", &r)) {
return
}
a.Equal([]byte(unquotedString), r)
}
func TestString(t *testing.T) {
a := assert.New(t)
var r string
if !a.NoError(Unmarshal(unquotedString, &r)) {
return
}
a.Equal(unquotedString, r)
}
func TestStringQuoted(t *testing.T) {
a := assert.New(t)
var r string
if !a.NoError(Unmarshal("\""+unquotedString+"\"", &r)) {
return
}
a.Equal(unquotedString, r)
}
func TestBadTarget(t *testing.T) {
a := assert.New(t)
var r interface{}
a.Error(Unmarshal("t", &r))
}
func TestNonPointerTarget(t *testing.T) {
a := assert.New(t)
var r string
a.Error(Unmarshal("t", r))
}
func TestBadSourceForString(t *testing.T) {
a := assert.New(t)
var s string
a.Error(Unmarshal(emptyArray, &s))
}
func TestBadSourceForByteSlice(t *testing.T) {
a := assert.New(t)
var s []byte
a.Error(Unmarshal(emptyArray, &s))
}
func TestBadSourceForArray(t *testing.T) {
a := assert.New(t)
var l []string
a.Error(Unmarshal("x", &l))
}
func TestBadSourceForTuple(t *testing.T) {
a := assert.New(t)
var s struct{ A, B, C string }
a.Error(Unmarshal("x", &s))
}
func TestUnclosedArray(t *testing.T) {
a := assert.New(t)
var l []string
a.Error(Unmarshal("{a,b,c", &l))
}
func TestUnclosedTuple(t *testing.T) {
a := assert.New(t)
var s struct{ A, B, C string }
a.Error(Unmarshal("(a,b,c", &s))
}
func TestMismatchedArrayDelimiters(t *testing.T) {
a := assert.New(t)
var l []string
a.Error(Unmarshal("{a,b,c)", &l))
}
func TestMismatchedTupleDelimiters(t *testing.T) {
a := assert.New(t)
var s struct{ A, B, C string }
a.Error(Unmarshal("(a,b,c}", &s))
}
func TestUnfinishedTuple(t *testing.T) {
a := assert.New(t)
var s struct{ A, B, C string }
a.Error(Unmarshal("(a,b)", &s))
}
func TestGoodInt(t *testing.T) {
a := assert.New(t)
var i int
if a.NoError(Unmarshal("2147483647", &i)) {
a.Equal("2147483647", fmt.Sprintf("%d", i))
}
}
func TestGoodUint(t *testing.T) {
a := assert.New(t)
var i uint
if a.NoError(Unmarshal("4294967295", &i)) {
a.Equal("4294967295", fmt.Sprintf("%d", i))
}
}
func TestGoodInt8(t *testing.T) {
a := assert.New(t)
var i int8
if a.NoError(Unmarshal("127", &i)) {
a.Equal("127", fmt.Sprintf("%d", i))
}
}
func TestGoodUint8(t *testing.T) {
a := assert.New(t)
var i uint8
if a.NoError(Unmarshal("255", &i)) {
a.Equal("255", fmt.Sprintf("%d", i))
}
}
func TestGoodInt16(t *testing.T) {
a := assert.New(t)
var i int16
if a.NoError(Unmarshal("32767", &i)) {
a.Equal("32767", fmt.Sprintf("%d", i))
}
}
func TestGoodUint16(t *testing.T) {
a := assert.New(t)
var i uint16
if a.NoError(Unmarshal("65535", &i)) {
a.Equal("65535", fmt.Sprintf("%d", i))
}
}
func TestGoodInt32(t *testing.T) {
a := assert.New(t)
var i int32
if a.NoError(Unmarshal("2147483647", &i)) {
a.Equal("2147483647", fmt.Sprintf("%d", i))
}
}
func TestGoodUint32(t *testing.T) {
a := assert.New(t)
var i uint32
if a.NoError(Unmarshal("4294967295", &i)) {
a.Equal("4294967295", fmt.Sprintf("%d", i))
}
}
func TestGoodInt64(t *testing.T) {
a := assert.New(t)
var i int64
if a.NoError(Unmarshal("9223372036854775807", &i)) {
a.Equal("9223372036854775807", fmt.Sprintf("%d", i))
}
}
func TestGoodUint64(t *testing.T) {
a := assert.New(t)
var i uint64
if a.NoError(Unmarshal("18446744073709551615", &i)) {
a.Equal("18446744073709551615", fmt.Sprintf("%d", i))
}
}
func TestTooLongInt(t *testing.T) {
a := assert.New(t)
var i int
a.Error(Unmarshal("2147483648", &i))
}
func TestTooLongUint(t *testing.T) {
a := assert.New(t)
var i uint
a.Error(Unmarshal("4294967296", &i))
}
func TestTooLongInt8(t *testing.T) {
a := assert.New(t)
var i int8
a.Error(Unmarshal("128", &i))
}
func TestTooLongUint8(t *testing.T) {
a := assert.New(t)
var i uint8
a.Error(Unmarshal("256", &i))
}
func TestTooLongInt16(t *testing.T) {
a := assert.New(t)
var i int16
a.Error(Unmarshal("32768", &i))
}
func TestTooLongUint16(t *testing.T) {
a := assert.New(t)
var i uint16
a.Error(Unmarshal("65536", &i))
}
func TestTooLongInt32(t *testing.T) {
a := assert.New(t)
var i int32
a.Error(Unmarshal("2147483648", &i))
}
func TestTooLongUint32(t *testing.T) {
a := assert.New(t)
var i uint32
a.Error(Unmarshal("4294967296", &i))
}
func TestTooLongInt64(t *testing.T) {
a := assert.New(t)
var i int64
a.Error(Unmarshal("9223372036854775808", &i))
}
func TestTooLongUint64(t *testing.T) {
a := assert.New(t)
var i uint64
a.Error(Unmarshal("18446744073709551616", &i))
}
func TestBadSourceForInt(t *testing.T) {
a := assert.New(t)
var i int
a.Error(Unmarshal(emptyArray, &i))
}
func TestBadSourceForUint(t *testing.T) {
a := assert.New(t)
var i uint
a.Error(Unmarshal(emptyArray, &i))
}
func TestBadSourceForInt8(t *testing.T) {
a := assert.New(t)
var i int8
a.Error(Unmarshal(emptyArray, &i))
}
func TestBadSourceForUint8(t *testing.T) {
a := assert.New(t)
var i uint8
a.Error(Unmarshal(emptyArray, &i))
}
func TestBadSourceForInt16(t *testing.T) {
a := assert.New(t)
var i int16
a.Error(Unmarshal(emptyArray, &i))
}
func TestBadSourceForUint16(t *testing.T) {
a := assert.New(t)
var i uint16
a.Error(Unmarshal(emptyArray, &i))
}
func TestBadSourceForInt32(t *testing.T) {
a := assert.New(t)
var i int32
a.Error(Unmarshal(emptyArray, &i))
}
func TestBadSourceForUint32(t *testing.T) {
a := assert.New(t)
var i uint32
a.Error(Unmarshal(emptyArray, &i))
}
func TestBadSourceForInt64(t *testing.T) {
a := assert.New(t)
var i int64
a.Error(Unmarshal(emptyArray, &i))
}
func TestBadSourceForUint64(t *testing.T) {
a := assert.New(t)
var i uint64
a.Error(Unmarshal(emptyArray, &i))
}
| deoxxa/pgparser | parser_test.go | GO | bsd-3-clause | 7,370 | [
30522,
7427,
18720,
19362,
8043,
12324,
1006,
1000,
4718,
2102,
1000,
1000,
5604,
1000,
1000,
21025,
2705,
12083,
1012,
4012,
1013,
7683,
2099,
1013,
19919,
1013,
20865,
1000,
1007,
13075,
1006,
2309,
2890,
27108,
5104,
18886,
3070,
1027,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* This file is part of huborcid.
*
* huborcid is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* huborcid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with huborcid. If not, see <http://www.gnu.org/licenses/>.
*/
// GamePad API
// https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html
// By Eric Bidelman
// FF has Gamepad API support only in special builds, but not in any release (even behind a flag)
// Their current implementation has no way to feature detect, only events to bind to.
// http://www.html5rocks.com/en/tutorials/doodles/gamepad/#toc-featuredetect
// but a patch will bring them up to date with the spec when it lands (and they'll pass this test)
// https://bugzilla.mozilla.org/show_bug.cgi?id=690935
Modernizr.addTest('gamepads', !!Modernizr.prefixed('getGamepads', navigator));
| Cineca/OrcidHub | src/main/webapp/bower_components/modernizr/feature-detects/gamepad.js | JavaScript | agpl-3.0 | 1,299 | [
30522,
1013,
1008,
1008,
2023,
5371,
2003,
2112,
1997,
9594,
2953,
6895,
2094,
1012,
1008,
1008,
9594,
2953,
6895,
2094,
2003,
2489,
4007,
1024,
2017,
2064,
2417,
2923,
3089,
8569,
2618,
2009,
1998,
1013,
2030,
19933,
1008,
2009,
2104,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright 2005-2017 Dozer Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dozer.functional_tests;
import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
import java.util.TreeMap;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.dozer.Mapper;
import org.dozer.vo.TestObject;
import org.dozer.vo.TestObjectPrime;
import org.dozer.vo.map.ChildDOM;
import org.dozer.vo.map.CustomMap;
import org.dozer.vo.map.CustomMapIF;
import org.dozer.vo.map.GenericDOM;
import org.dozer.vo.map.MapTestObject;
import org.dozer.vo.map.MapTestObjectPrime;
import org.dozer.vo.map.MapToMap;
import org.dozer.vo.map.MapToMapPrime;
import org.dozer.vo.map.MapToProperty;
import org.dozer.vo.map.NestedObj;
import org.dozer.vo.map.NestedObjPrime;
import org.dozer.vo.map.ParentDOM;
import org.dozer.vo.map.PropertyToMap;
import org.dozer.vo.map.SimpleObj;
import org.dozer.vo.map.SimpleObjPrime;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
/**
* @author tierney.matt
* @author garsombke.franz
*/
public class MapTypeTest extends AbstractFunctionalTest {
@Test
public void testMapToVo() throws Exception {
// Test simple Map --> Vo with custom mappings defined.
mapper = getMapper(new String[] { "mapMapping2.xml" });
NestedObj nestedObj = newInstance(NestedObj.class);
nestedObj.setField1("nestedfield1value");
Map<String, Serializable> src = newInstance(HashMap.class);
src.put("field1", "mapnestedfield1value");
src.put("nested", nestedObj);
SimpleObjPrime result = mapper.map(src, SimpleObjPrime.class, "caseA");
assertEquals(src.get("field1"), result.getField1());
assertEquals(nestedObj.getField1(), result.getNested().getField1());
}
@Test
public void testMapToVoSimple() throws Exception {
mapper = getMapper(new String[] { });
NestedObj nestedObj = newInstance(NestedObj.class);
nestedObj.setField1("nestedfield1value");
Map<String, Serializable> src = newInstance(HashMap.class);
src.put("field1", "mapnestedfield1value");
SimpleObjPrime result = mapper.map(src, SimpleObjPrime.class);
assertEquals(src.get("field1"), result.getField1());
}
@Test
public void testMapToVoWithRenameField() throws Exception {
// Test simple Map --> Vo with custom mappings defined.
mapper = getMapper(new String[] { "mapMapping2.xml" });
NestedObj nestedObj = newInstance(NestedObj.class);
nestedObj.setField1("nestedfield1value");
Map<String, Object> src = new HashMap<String, Object>();
src.put("first", "mapnestedfield1value");
src.put("nested", nestedObj);
SimpleObjPrime result = mapper.map(src, SimpleObjPrime.class, "caseC");
assertEquals(src.get("first"), result.getField1());
assertEquals(nestedObj.getField1(), result.getNested().getField1());
}
@Test
public void testMapToVoWithRenameFieldReverse() throws Exception {
// Test simple Map --> Vo with custom mappings defined.
mapper = getMapper(new String[] { "mapMapping2.xml" });
NestedObj nestedObj = newInstance(NestedObj.class);
nestedObj.setField1("nestedfield1value");
Map<String, Object> src = new HashMap<String, Object>();
src.put("first", "mapnestedfield1value");
src.put("nested", nestedObj);
SimpleObjPrime result = mapper.map(src, SimpleObjPrime.class, "caseD");
assertEquals(src.get("first"), result.getField1());
assertEquals(nestedObj.getField1(), result.getNested().getField1());
}
@Test
public void testMapToVo_CustomMappings() throws Exception {
// Test simple Map --> Vo with custom mappings defined.
mapper = getMapper(new String[] { "mapMapping2.xml" });
Map<String, String> src = newInstance(HashMap.class);
src.put("field1", "field1value");
src.put("field2", "field2value");
SimpleObjPrime result = mapper.map(src, SimpleObjPrime.class, "caseB");
assertNull(result.getField1());
assertEquals(src.get("field2"), result.getField2());
}
@Test
public void testMapToVoUsingMapId() {
// Simple map --> vo using a map-id
mapper = super.getMapper(new String[] { "mapMapping.xml" });
Map<String, String> src = newInstance(HashMap.class);
src.put("field1", "field1value");
src.put("field2", "field2value");
NestedObjPrime dest = mapper.map(src, NestedObjPrime.class, "caseB");
assertEquals(src.get("field1"), dest.getField1());
assertEquals(src.get("field2"), dest.getField2());
}
@Test
public void testMapToVoUsingMapId_FieldExclude() {
// Simple map --> vo using a map-id
mapper = super.getMapper(new String[] { "mapMapping.xml" });
Map<String, String> src = newInstance(HashMap.class);
src.put("field1", "field1value");
src.put("field2", "field2value");
NestedObjPrime dest = mapper.map(src, NestedObjPrime.class, "caseC");
assertNull("field was excluded and should be null", dest.getField1());
assertEquals(src.get("field2"), dest.getField2());
}
@Test
public void testNestedMapToVoUsingMapId() {
// Another test for nested Map --> Vo using <field map-id=....>
mapper = super.getMapper("mapMapping.xml");
SimpleObj src = newInstance(SimpleObj.class);
src.setField1("field1");
NestedObj nested = newInstance(NestedObj.class);
nested.setField1("nestedfield1");
src.setNested(nested);
Map<String, String> nested2 = newInstance(HashMap.class);
nested2.put("field1", "field1MapValue");
src.setNested2(nested2);
SimpleObjPrime result = mapper.map(src, SimpleObjPrime.class, "caseA2");
assertNull(result.getNested2().getField1());// field was excluded
assertEquals(src.getField1(), result.getField1());
assertEquals(src.getNested().getField1(), result.getNested().getField1());
}
@Test
public void testMapToVo_NoCustomMappings() throws Exception {
// Test simple Map --> Vo without any custom mappings defined.
NestedObj nestedObj = newInstance(NestedObj.class);
nestedObj.setField1("nestedfield1value");
Map<String, Serializable> src = newInstance(HashMap.class);
src.put("field1", "mapnestedfield1value");
src.put("nested", nestedObj);
SimpleObjPrime result = mapper.map(src, SimpleObjPrime.class);
assertEquals(src.get("field1"), result.getField1());
assertEquals(nestedObj.getField1(), result.getNested().getField1());
}
@Test
public void testVoToMap_NoCustomMappings() throws Exception {
// Test simple Vo --> Map without any custom mappings defined.
SimpleObjPrime src = newInstance(SimpleObjPrime.class);
src.setField1("someValueField1");
src.setField2("someValueField2");
src.setSimpleobjprimefield("someOtherValue");
NestedObjPrime nested = newInstance(NestedObjPrime.class);
nested.setField1("field1Value");
nested.setField2("field2Value");
src.setNested(nested);
NestedObjPrime nested2 = newInstance(NestedObjPrime.class);
src.setNested2(nested2);
// Map complex object to HashMap
Map<?, ?> destMap = newInstance(HashMap.class);
mapper.map(src, destMap);
// Map HashMap back to new instance of the complex object
SimpleObjPrime mappedSrc = mapper.map(destMap, SimpleObjPrime.class);
// Remapped complex type should equal original src if all fields were mapped both ways.
assertEquals(src, mappedSrc);
}
@Test
public void testMapToMap() throws Exception {
Mapper mapper = getMapper(new String[] { "mapInterfaceMapping.xml", "dozerBeanMapping.xml" });
TestObject to = newInstance(TestObject.class);
to.setOne("one");
TestObject to2 = newInstance(TestObject.class);
to2.setTwo(new Integer(2));
Map<String, TestObject> map = newInstance(HashMap.class);
map.put("to", to);
map.put("to2", to2);
Map<String, TestObject> map2 = newInstance(HashMap.class);
map2.put("to", to);
map2.put("to2", to2);
MapToMap mtm = new MapToMap(map, map2);
MapToMapPrime mtmp = mapper.map(mtm, MapToMapPrime.class);
assertEquals("one", ((TestObject) mtmp.getStandardMap().get("to")).getOne());
assertEquals(2, ((TestObject) mtmp.getStandardMap().get("to2")).getTwo().intValue());
// verify that we transformed from object to object prime
assertEquals("one", ((TestObjectPrime) mtmp.getStandardMapWithHint().get("to")).getOnePrime());
assertEquals(2, ((TestObjectPrime) mtmp.getStandardMapWithHint().get("to2")).getTwoPrime().intValue());
}
@Test
public void testMapToMapExistingDestination() throws Exception {
Mapper mapper = getMapper(new String[] { "mapInterfaceMapping.xml", "dozerBeanMapping.xml" });
TestObject to = newInstance(TestObject.class);
to.setOne("one");
TestObject to2 = newInstance(TestObject.class);
to2.setTwo(new Integer(2));
Map<String, TestObject> map = newInstance(HashMap.class);
map.put("to", to);
map.put("to2", to2);
MapToMap mtm = newInstance(MapToMap.class);
mtm.setStandardMap(map);
// create an existing map and set a value so we can test if it exists after
// mapping
MapToMapPrime mtmp = newInstance(MapToMapPrime.class);
Map<String, Serializable> map2 = newInstance(Hashtable.class);
map2.put("toDest", to);
mtmp.setStandardMap(map2);
mapper.map(mtm, mtmp);
assertEquals("one", ((TestObject) mtmp.getStandardMap().get("to")).getOne());
assertEquals(2, ((TestObject) mtmp.getStandardMap().get("to2")).getTwo().intValue());
assertEquals("one", ((TestObject) mtmp.getStandardMap().get("toDest")).getOne());
}
@Test
public void testPropertyClassLevelMap() throws Exception {
mapper = getMapper(new String[] { "dozerBeanMapping.xml" });
PropertyToMap ptm = newInstance(PropertyToMap.class);
ptm.setStringProperty("stringPropertyValue");
ptm.addStringProperty2("stringProperty2Value");
Map<?, ?> map = mapper.map(ptm, HashMap.class, "myTestMapping");
assertEquals("stringPropertyValue", map.get("stringProperty"));
assertEquals("stringProperty2Value", map.get("myStringProperty"));
CustomMapIF customMap = mapper.map(ptm, CustomMap.class, "myCustomTestMapping");
assertEquals("stringPropertyValue", customMap.getValue("stringProperty"));
assertEquals("stringProperty2Value", customMap.getValue("myStringProperty"));
CustomMapIF custom = newInstance(CustomMap.class);
custom.putValue("myKey", "myValue");
mapper.map(ptm, custom, "myCustomTestMapping");
assertEquals("stringPropertyValue", custom.getValue("stringProperty"));
assertEquals("myValue", custom.getValue("myKey"));
}
@Test
public void testPropertyClassLevelMap2() throws Exception {
mapper = getMapper(new String[] { "dozerBeanMapping.xml" });
PropertyToMap ptm = newInstance(PropertyToMap.class);
ptm.setStringProperty("stringPropertyValue");
ptm.addStringProperty2("stringProperty2Value");
CustomMapIF customMap = mapper.map(ptm, CustomMap.class, "myCustomTestMapping");
assertEquals("stringPropertyValue", customMap.getValue("stringProperty"));
assertEquals("stringProperty2Value", customMap.getValue("myStringProperty"));
}
@Test
public void testPropertyClassLevelMapBack() throws Exception {
// Map Back
mapper = getMapper(new String[] { "dozerBeanMapping.xml" });
Map<String, Object> map = newInstance(HashMap.class);
map.put("stringProperty", "stringPropertyValue");
map.put("integerProperty", new Integer("567"));
PropertyToMap property = mapper.map(map, PropertyToMap.class, "myTestMapping");
assertEquals("stringPropertyValue", property.getStringProperty());
CustomMapIF custom = newInstance(CustomMap.class);
custom.putValue("stringProperty", "stringPropertyValue");
PropertyToMap property2 = mapper.map(custom, PropertyToMap.class, "myCustomTestMapping");
assertEquals("stringPropertyValue", property2.getStringProperty());
map.put("stringProperty3", "myValue");
mapper.map(map, property, "myTestMapping");
assertEquals("myValue", property.getStringProperty3());
}
@Test
public void testPropertyToMap() throws Exception {
mapper = getMapper(new String[] { "dozerBeanMapping.xml" });
PropertyToMap ptm = newInstance(PropertyToMap.class);
ptm.setStringProperty("stringPropertyValue");
ptm.addStringProperty2("stringProperty2Value");
ptm.setStringProperty6("string6Value");
Map<String, Object> hashMap = newInstance(HashMap.class);
hashMap.put("reverseMapString", "reverseMapStringValue");
hashMap.put("reverseMapInteger", new Integer("567"));
ptm.setReverseMap(hashMap);
MapToProperty mtp = mapper.map(ptm, MapToProperty.class);
assertTrue(mtp.getHashMap().containsKey("stringProperty"));
assertTrue(mtp.getHashMap().containsValue("stringPropertyValue"));
assertTrue(mtp.getHashMap().containsKey("myStringProperty"));
assertTrue(mtp.getHashMap().containsValue("stringProperty2Value"));
assertFalse(mtp.getHashMap().containsValue("nullStringProperty"));
assertTrue(mtp.getNullHashMap().containsValue("string6Value"));
assertEquals("reverseMapStringValue", mtp.getReverseMapString());
assertEquals(((Integer) hashMap.get("reverseMapInteger")).toString(), mtp.getReverseMapInteger());
// Map Back
PropertyToMap dest = mapper.map(mtp, PropertyToMap.class);
assertTrue(dest.getStringProperty().equals("stringPropertyValue"));
assertTrue(dest.getStringProperty2().equals("stringProperty2Value"));
assertTrue(dest.getReverseMap().containsKey("reverseMapString"));
assertTrue(dest.getReverseMap().containsValue("reverseMapStringValue"));
assertNull(dest.getNullStringProperty());
}
@Test
public void testPropertyToCustomMap() throws Exception {
mapper = getMapper(new String[] { "dozerBeanMapping.xml" });
PropertyToMap ptm = newInstance(PropertyToMap.class);
ptm.setStringProperty3("stringProperty3Value");
ptm.setStringProperty4("stringProperty4Value");
ptm.setStringProperty5("stringProperty5Value");
MapToProperty mtp = mapper.map(ptm, MapToProperty.class);
assertEquals("stringProperty3Value", mtp.getCustomMap().getValue("myCustomProperty"));
assertEquals("stringProperty5Value", mtp.getCustomMap().getValue("stringProperty5"));
assertEquals("stringProperty4Value", mtp.getNullCustomMap().getValue("myCustomNullProperty"));
assertEquals("stringProperty5Value", mtp.getCustomMapWithDiffSetMethod().getValue("stringProperty5"));
// Map Back
PropertyToMap dest = mapper.map(mtp, PropertyToMap.class);
assertEquals("stringProperty3Value", dest.getStringProperty3());
assertEquals("stringProperty4Value", dest.getStringProperty4());
assertEquals("stringProperty5Value", dest.getStringProperty5());
}
@Test
public void testPropertyToClassLevelMap() throws Exception {
mapper = getMapper(new String[] { "dozerBeanMapping.xml" });
MapTestObject mto = newInstance(MapTestObject.class);
PropertyToMap ptm = newInstance(PropertyToMap.class);
Map<String, String> map = newInstance(HashMap.class);
map.put("reverseClassLevelMapString", "reverseClassLevelMapStringValue");
mto.setPropertyToMapMapReverse(map);
ptm.setStringProperty("stringPropertyValue");
ptm.addStringProperty2("stringProperty2Value");
ptm.setStringProperty3("stringProperty3Value");
ptm.setStringProperty4("stringProperty4Value");
ptm.setStringProperty5("stringProperty5Value");
mto.setPropertyToMap(ptm);
PropertyToMap ptm2 = newInstance(PropertyToMap.class);
ptm2.setStringProperty("stringPropertyValue");
mto.setPropertyToMapToNullMap(ptm2);
MapTestObjectPrime mtop = mapper.map(mto, MapTestObjectPrime.class);
assertTrue(mtop.getPropertyToMapMap().containsKey("stringProperty"));
assertTrue(mtop.getPropertyToMapMap().containsKey("myStringProperty"));
assertTrue(mtop.getPropertyToMapMap().containsKey("stringProperty3"));
assertTrue(mtop.getPropertyToMapMap().containsKey("stringProperty4"));
assertTrue(mtop.getPropertyToMapMap().containsKey("stringProperty5"));
assertTrue(mtop.getPropertyToMapMap().containsKey("nullStringProperty"));
assertTrue(mtop.getPropertyToMapMap().containsValue("stringPropertyValue"));
assertTrue(mtop.getPropertyToMapMap().containsValue("stringProperty2Value"));
assertTrue(mtop.getPropertyToMapMap().containsValue("stringProperty3Value"));
assertTrue(mtop.getPropertyToMapMap().containsValue("stringProperty4Value"));
assertTrue(mtop.getPropertyToMapMap().containsValue("stringProperty5Value"));
assertFalse(mtop.getPropertyToMapMap().containsValue("nullStringProperty"));
assertFalse(mtop.getPropertyToMapMap().containsKey("excludeMe"));
assertEquals("reverseClassLevelMapStringValue", mtop.getPropertyToMapReverse().getReverseClassLevelMapString());
assertTrue(mtop.getNullPropertyToMapMap().containsKey("stringProperty"));
assertEquals("stringPropertyValue", mtop.getNullPropertyToMapMap().get("stringProperty"));
// Map Back
MapTestObject mto2 = mapper.map(mtop, MapTestObject.class);
assertEquals("stringPropertyValue", mto2.getPropertyToMap().getStringProperty());
assertEquals("stringProperty2Value", mto2.getPropertyToMap().getStringProperty2());
assertEquals("stringProperty3Value", mto2.getPropertyToMap().getStringProperty3());
assertEquals("stringProperty4Value", mto2.getPropertyToMap().getStringProperty4());
assertEquals("stringProperty5Value", mto2.getPropertyToMap().getStringProperty5());
assertTrue(mto2.getPropertyToMapMapReverse().containsKey("reverseClassLevelMapString"));
assertEquals("reverseClassLevelMapStringValue", mto2.getPropertyToMapMapReverse().get("reverseClassLevelMapString"));
}
@Test
public void testPropertyToCustomClassLevelMap() throws Exception {
mapper = getMapper(new String[] { "dozerBeanMapping.xml" });
MapTestObject mto = newInstance(MapTestObject.class);
PropertyToMap ptm = newInstance(PropertyToMap.class);
ptm.setStringProperty("stringPropertyValue");
ptm.setStringProperty2("stringProperty2Value");
mto.setPropertyToCustomMap(ptm);
CustomMapIF customMap = newInstance(CustomMap.class);
customMap.putValue("stringProperty", "stringPropertyValue");
mto.setPropertyToCustomMapMapWithInterface(customMap);
MapTestObjectPrime mtop = mapper.map(mto, MapTestObjectPrime.class);
assertEquals("stringPropertyValue", mtop.getPropertyToCustomMapMap().getValue("stringProperty"));
assertNull(mtop.getPropertyToCustomMapMap().getValue("excludeMe"));
assertEquals("stringProperty2Value", mtop.getPropertyToCustomMapMap().getValue("myStringProperty"));
assertEquals("stringPropertyValue", mtop.getPropertyToCustomMapWithInterface().getStringProperty());
// Map Back
MapTestObject mto2 = mapper.map(mtop, MapTestObject.class);
assertEquals("stringPropertyValue", mto2.getPropertyToCustomMap().getStringProperty());
assertEquals("stringProperty2Value", mto2.getPropertyToCustomMap().getStringProperty2());
assertNull(mto2.getPropertyToCustomMap().getExcludeMe());
assertEquals("stringPropertyValue", mto2.getPropertyToCustomMapMapWithInterface().getValue("stringProperty"));
}
@Test
public void testMapGetSetMethod_ClassLevel() throws Exception {
runMapGetSetMethodTest("useCase1");
}
@Test
public void testMapGetSetMethod_FieldLevel() throws Exception {
runMapGetSetMethodTest("useCase2");
}
@Test
public void testDateFormat_CustomMapType() throws Exception {
// Test that date format works for mapping between String and Custom Map Type
mapper = getMapper(new String[] { "mapMapping3.xml" });
DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
String dateStr = "10/15/2005";
CustomMap src = newInstance(CustomMap.class);
src.putValue("fieldA", dateStr);
org.dozer.vo.SimpleObj dest = mapper.map(src, org.dozer.vo.SimpleObj.class);
assertNotNull("dest field should not be null", dest.getField5());
assertEquals("dest field contains wrong date value", df.parse(dateStr), dest.getField5().getTime());
CustomMap remappedSrc = mapper.map(dest, CustomMap.class);
assertEquals("remapped src field contains wrong date string", dateStr, remappedSrc.getValue("fieldA"));
}
private void runMapGetSetMethodTest(String mapId) throws Exception {
// Test that custom field converter works for Custom Map Types
mapper = getMapper(new String[] { "mapGetSetMethodMapping.xml" });
CustomMap src = newInstance(CustomMap.class);
src.putValue("fieldA", "someStringValue");
src.putValue("field2", "someOtherStringValue");
src.putValue("fieldC", "1");
src.putValue("fieldD", "2");
src.putValue("fieldE", "10-15-2005");
SimpleObj dest = mapper.map(src, SimpleObj.class, mapId);
assertEquals("wrong value for field1", src.getValue("fieldA"), dest.getField1());
assertEquals("wrong value for field2", src.getValue("field2"), dest.getField2());
assertEquals("wrong value for field3", Integer.valueOf("1"), dest.getField3());
assertEquals("wrong value for field4", Integer.valueOf("2"), dest.getField4());
Calendar expected = Calendar.getInstance();
expected.set(2005, 10, 15);
assertEquals(expected.get(Calendar.YEAR), dest.getField5().get(Calendar.YEAR));
assertEquals(Calendar.OCTOBER, dest.getField5().get(Calendar.MONTH));
assertEquals(expected.get(Calendar.DATE), dest.getField5().get(Calendar.DATE));
// Remap to test bi-directional mapping
CustomMap remappedSrc = mapper.map(dest, CustomMap.class, mapId);
assertTrue("remapped src should equal original src", EqualsBuilder.reflectionEquals(src.getMap(), remappedSrc.getMap()));
}
@Test
public void testMapType_NestedMapToVo_NoCustomMappings() throws Exception {
// Simple test checking that Maps get mapped to a VO without any custom mappings or map-id.
// Should behave like Vo --> Vo, matching on common attr(key) names.
Map<String, String> nested2 = newInstance(HashMap.class);
nested2.put("field1", "mapnestedfield1");
nested2.put("field2", null);
SimpleObj src = newInstance(SimpleObj.class);
src.setNested2(nested2);
SimpleObjPrime result = mapper.map(src, SimpleObjPrime.class);
assertNotNull(result.getNested2());
assertEquals(nested2.get("field1"), result.getNested2().getField1());
SimpleObj result2 = mapper.map(result, SimpleObj.class);
assertEquals(src, result2);
}
@Test
public void testMapType_MapToVo_CustomMapping_NoMapId() {
// Test nested Map --> Vo using custom mappings without map-id
mapper = getMapper("mapMapping3.xml");
NestedObj nested = newInstance(NestedObj.class);
nested.setField1("field1Value");
Map<String, String> nested2 = newInstance(HashMap.class);
nested2.put("field1", "mapnestedfield1value");
nested2.put("field2", "mapnestedfield2value");
SimpleObj src = newInstance(SimpleObj.class);
src.setNested2(nested2);
SimpleObjPrime result = mapper.map(src, SimpleObjPrime.class);
assertNull(result.getNested2().getField1());// field exclude in mappings file
assertEquals(nested2.get("field2"), result.getNested2().getField2());
}
@Ignore("Started failing for some reason. Tests very exotic functionality.")
@Test
public void testNestedCustomMap() {
mapper = getMapper("mapMapping4.xml");
ParentDOM src = newInstance(ParentDOM.class);
src.setTest("someTestValue");
ChildDOM child = newInstance(ChildDOM.class);
child.setChildName("someChildName");
src.setChild(child);
GenericDOM result = mapper.map(src, GenericDOM.class);
assertEquals("someTestValue", result.get("test"));
GenericDOM resultChild = (GenericDOM) result.get("child");
assertEquals("someChildName", resultChild.get("childName"));
}
@Test
public void testMapToVoUsingMapInterface() throws Exception {
// Test simple Map --> Vo with custom mappings defined.
mapper = getMapper("mapMapping5.xml");
Map<String, String> src = newInstance(HashMap.class);
src.put("stringValue", "somevalue");
SimpleObj dest = mapper.map(src, SimpleObj.class, "test-id");
assertEquals("wrong value found for field1", "somevalue", dest.getField1());
}
@Test
@Ignore("Known bug")
public void testEmptyMapToVo() throws Exception {
mapper = getMapper("mapMapping5.xml");
Map<String, String> src = newInstance(HashMap.class);
assertTrue(src.isEmpty());
SimpleObj dest = new SimpleObj();
dest.setField1("existingValue");
mapper.map(src, dest, "test-id");
assertEquals("existingValue", dest.getField1());
}
@Test
public void testMapToVoOverwritesExistingValue() throws Exception {
mapper = getMapper("mapMapping5.xml");
Map<String, String> src = newInstance(HashMap.class);
src.put("stringValue", "overwritten");
SimpleObj dest = new SimpleObj();
dest.setField1("existingValue");
mapper.map(src, dest, "test-id");
assertEquals("overwritten", dest.getField1());
}
@Test
public void testTreeMap() {
TreeMap map = new TreeMap();
map.put("a", "b");
TreeMap result = mapper.map(map, TreeMap.class);
assertNotNull(result);
assertEquals(1, result.size());
}
}
| STRiDGE/dozer | core/src/test/java/org/dozer/functional_tests/MapTypeTest.java | Java | apache-2.0 | 26,706 | [
30522,
1013,
1008,
1008,
9385,
2384,
1011,
2418,
2079,
6290,
2622,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1008,
2017,
2089,
2025,
2224,
2023,
5371,
3272,
1999,
12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
class RedisTest extends \PHPUnit_Framework_TestCase
{
const CRLF = "\r\n";
/**
* @return \Pimf\Redis
*/
protected function getRedis()
{
return new \Pimf\Redis(new Pimf\Adapter\Socket('krsteski.de', 80), 0);
}
/**
* @return \Pimf\Redis
*/
protected function getRedisMock()
{
return $this->getMockBuilder('\\Pimf\\Redis')
->disableOriginalConstructor()
->setMethods(array('get', 'expire', 'set', 'del', 'forget', 'select', 'put', 'inline', 'bulk', 'multibulk'))
->getMock();
}
/**
* Call protected/private method of a class.
*
* @param object &$object Instantiated object that we will run method on.
* @param string $methodName Method name to call
* @param array $parameters Array of parameters to pass into method.
*
* @return mixed Method return.
*/
public static function invokeMethod(&$object, $methodName, array $parameters = array())
{
$reflection = new \ReflectionClass(get_class($object));
$method = $reflection->getMethod($methodName);
$method->setAccessible(true);
return $method->invokeArgs($object, $parameters);
}
## start testing
public function testCreatingNewInstance()
{
new \Pimf\Redis(new Pimf\Adapter\Socket('127.0.0.1', 80), 0);
}
public function testGetDatabaseConnectionInstance()
{
\Pimf\Config::load(
array(
'cache' => array(
'storage' => 'redis',
'server' => array('host' => '127.0.0.1', 'port' => 11211, 'database' => 0)
)
),
true
);
$this->assertInstanceOf(
'\\Pimf\\Redis',
\Pimf\Redis::database()
);
}
/**
* @expectedException \RuntimeException
*/
public function testIfRedisDatabaseNotDefined()
{
\Pimf\Config::load(
array(
'cache' => array(
'storage' => '',
'server' => array('host' => '127.0.0.1', 'port' => 11211, 'database' => 0)
)
),
true
);
\Pimf\Redis::database('default2');
}
/**
* @expectedException \RuntimeException
*/
public function testGetReturnsNullWhenNotFound()
{
$redis = $this->getRedis();
$redis->expects($this->any())->method('connect')->will($this->returnValue($redis));
$redis->expects($this->once())->method('get')->will($this->returnValue(null));
$this->assertNull($redis->get('foo'));
}
/**
* @expectedException \RuntimeException
*/
public function testIfUnknownRedisResponse()
{
$redis = $this->getRedis();
self::invokeMethod($redis, 'parse', array('bad-response-string'));
}
/**
* @expectedException \RuntimeException
*/
public function testIfResponseIsRedisError()
{
$redis = $this->getRedis();
self::invokeMethod($redis, 'parse', array('-erro' . "\r\n"));
}
public function testHappyParsing()
{
$redis = $this->getRedisMock();
$redis->expects($this->any())->method('inline')->will($this->returnValue('ok'));
$redis->expects($this->any())->method('bulk')->will($this->returnValue('ok'));
$redis->expects($this->any())->method('multibulk')->will($this->returnValue('ok'));
$this->assertEquals('ok', self::invokeMethod($redis, 'parse', array('+ foo' . "\r\n")));
$this->assertEquals('ok', self::invokeMethod($redis, 'parse', array(': foo' . "\r\n")));
$this->assertEquals('ok', self::invokeMethod($redis, 'parse', array('* foo' . "\r\n")));
$this->assertEquals('ok', self::invokeMethod($redis, 'parse', array('$ foo' . "\r\n")));
}
public function testBuildingCommandBasedFromGivenMethodAndParameters()
{
$redis = $this->getRedis();
$this->assertEquals(
'*3' . self::CRLF . '$6' . self::CRLF . 'LRANGE' . self::CRLF . '$1' . self::CRLF . '0' . self::CRLF . '$1' . self::CRLF . '5' . self::CRLF . '',
self::invokeMethod($redis, 'command', array('lrange', array(0, 5))),
'problem on LRANGE'
);
$this->assertEquals(
'*2' . self::CRLF . '$3' . self::CRLF . 'GET' . self::CRLF . '$4' . self::CRLF . 'name' . self::CRLF,
self::invokeMethod($redis, 'command', array('get', array('name'))),
'problem on GET name var'
);
}
}
| gjerokrsteski/pimf-framework | tests/Pimf/RedisTest.php | PHP | mit | 4,613 | [
30522,
1026,
1029,
25718,
2465,
2417,
27870,
3367,
8908,
1032,
25718,
19496,
2102,
1035,
7705,
1035,
3231,
18382,
1063,
9530,
3367,
13675,
10270,
1027,
1000,
1032,
1054,
1032,
1050,
1000,
1025,
1013,
1008,
1008,
1008,
1030,
2709,
1032,
1425... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.alipay.api.response;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.trade.vendorpay.devicedata.upload response.
*
* @author auto create
* @since 1.0, 2016-12-08 00:51:39
*/
public class AlipayTradeVendorpayDevicedataUploadResponse extends AlipayResponse {
private static final long serialVersionUID = 5272579554188824387L;
}
| zeatul/poc | e-commerce/e-commerce-ecom-pay-service/src/main/java/com/alipay/api/response/AlipayTradeVendorpayDevicedataUploadResponse.java | Java | gpl-3.0 | 371 | [
30522,
7427,
4012,
1012,
4862,
4502,
2100,
1012,
17928,
1012,
3433,
1025,
12324,
4012,
1012,
4862,
4502,
2100,
1012,
17928,
1012,
4862,
4502,
16363,
13102,
5644,
2063,
1025,
1013,
1008,
1008,
1008,
4862,
4502,
2100,
17928,
1024,
4862,
4502,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using STSdb4.Storage;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace STSdb4.WaterfallTree
{
/// <summary>
/// Gives an opportunity for writting and reading of blocks on logical addresses (handles). Supports history for each block (versions).
/// </summary>
public interface IHeap
{
/// <summary>
/// Small user data (usually up to 256 bytes), atomic written with Commit()
/// </summary>
byte[] Tag { get; set; }
/// <summary>
/// Obtained handle is always unique
/// </summary>
long ObtainHandle();
void Release(long handle);
bool Exists(long handle);
/// <summary>
/// New block will be written always with version = CurrentVersion
/// If new block is written to handle and the last block of this handle have same version with the new one,
/// occupied space by the last block will be freed
/// Block can be read from specific version
/// If block is require to be read form specific version and block form this version doesn`t exist,
/// Read() return block with greatest existing version which less than the given
/// </summary>
void Write(long handle, byte[] buffer, int index, int count);
byte[] Read(long handle);
/// <summary>
///
/// </summary>
/// <param name="atVersion"></param>
/// <returns></returns>
IEnumerable<KeyValuePair<long, byte[]>> GetLatest(long atVersion);
/// <summary>
///
/// </summary>
/// <returns></returns>
KeyValuePair<long, Ptr>[] GetUsedSpace();
/// <summary>
/// After commit CurrentVersion is incremented.
/// </summary>
void Commit();
/// <summary>
///
/// </summary>
void Close();
long CurrentVersion { get; }
}
}
| zhouweiaccp/code | Cache/Plugin_Cache/supercache/Store/WaterfallTree/IHeap.cs | C# | apache-2.0 | 1,963 | [
30522,
2478,
8541,
18939,
2549,
1012,
5527,
1025,
2478,
2291,
1025,
2478,
2291,
1012,
6407,
1012,
12391,
1025,
2478,
2291,
1012,
11409,
4160,
1025,
2478,
2291,
1012,
3793,
1025,
3415,
15327,
8541,
18939,
2549,
1012,
14297,
13334,
1063,
1013... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="fa" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Doubloon</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+39"/>
<source><b>Doubloon</b> version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+41"/>
<source>Copyright © 2009-2015 The Bitcoin developers
Copyright © 2012-2014 The NovaCoin developers
Copyright © 2014 The BlackCoin developers
Copyright © 2014 The ShadowCash developers
Copyright © 2014-2015 The Doubloon developers</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source>
<translation>⏎ ⏎ این یک نرمافزار آزمایشی است⏎ ⏎ نرم افزار تحت مجوز MIT/X11 منتشر شده است. پروندهٔ COPYING یا نشانی http://www.opensource.org/licenses/mit-license.php. را ببینید⏎ ⏎ این محصول شامل نرمافزار توسعه دادهشده در پروژهٔ OpenSSL است. در این نرمافزار از OpenSSL Toolkit (http://www.openssl.org/) و نرمافزار رمزنگاری نوشته شده توسط اریک یانگ (eay@cryptsoft.com) و UPnP توسط توماس برنارد استفاده شده است.</translation>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Double-click to edit address or label</source>
<translation>برای ویرایش نشانی یا برچسب دوبار کلیک کنید</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>ایجاد نشانی جدید</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>نشانی انتخاب شده را در حافظهٔ سیستم کپی کن!</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-46"/>
<source>These are your Doubloon addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+60"/>
<source>&Copy Address</source>
<translation>&کپی نشانی</translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own an Doubloon address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation>حذف نشانی انتخابشده از لیست</translation>
</message>
<message>
<location line="-14"/>
<source>Verify a message to ensure it was signed with a specified Doubloon address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>&حذف</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+65"/>
<source>Copy &Label</source>
<translation>کپی و برچسب&گذاری</translation>
</message>
<message>
<location line="+2"/>
<source>&Edit</source>
<translation>&ویرایش</translation>
</message>
<message>
<location line="+250"/>
<source>Export Address Book Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>پروندهٔ نوع CSV جداشونده با کاما (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>برچسب</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>نشانی</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(بدون برچسب)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation>پنجرهٔ گذرواژه</translation>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>گذرواژه را وارد کنید</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>گذرواژهٔ جدید</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>تکرار گذرواژهٔ جدید</translation>
</message>
<message>
<location line="+33"/>
<source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>For staking only</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+35"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>گذرواژهٔ جدید کیف پول خود را وارد کنید.<br/>لطفاً از گذرواژهای با <b>حداقل ۱۰ حرف تصادفی</b>، یا <b>حداقل هشت کلمه</b> انتخاب کنید.</translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>رمزنگاری کیف پول</translation>
</message>
<message>
<location line="+7"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>انجام این عملیات نیازمند گذرواژهٔ کیف پول شما برای باز کردن قفل آن است.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>باز کردن قفل کیف پول</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>انجام این عملیات نیازمند گذرواژهٔ کیف پول شما برای رمزگشایی کردن آن است.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>رمزگشایی کیف پول</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>تغییر گذرواژه</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>گذرواژهٔ قدیمی و جدید کیف پول را وارد کنید.</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>تأیید رمزنگاری کیف پول</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR COINS</b>!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>آیا مطمئن هستید که میخواهید کیف پول خود را رمزنگاری کنید؟</translation>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation>مهم: هر نسخهٔ پشتیبانی که تا کنون از کیف پول خود تهیه کردهاید، باید با کیف پول رمزنگاری شدهٔ جدید جایگزین شود. به دلایل امنیتی، پروندهٔ قدیمی کیف پول بدون رمزنگاری، تا زمانی که از کیف پول رمزنگاریشدهٔ جدید استفاده نکنید، غیرقابل استفاده خواهد بود.</translation>
</message>
<message>
<location line="+103"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation>هشدار: کلید Caps Lock روشن است!</translation>
</message>
<message>
<location line="-133"/>
<location line="+60"/>
<source>Wallet encrypted</source>
<translation>کیف پول رمزنگاری شد</translation>
</message>
<message>
<location line="-58"/>
<source>Doubloon will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+44"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>رمزنگاری کیف پول با خطا مواجه شد</translation>
</message>
<message>
<location line="-56"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>رمزنگاری کیف پول بنا به یک خطای داخلی با شکست مواجه شد. کیف پول شما رمزنگاری نشد.</translation>
</message>
<message>
<location line="+7"/>
<location line="+50"/>
<source>The supplied passphrases do not match.</source>
<translation>گذرواژههای داده شده با هم تطابق ندارند.</translation>
</message>
<message>
<location line="-38"/>
<source>Wallet unlock failed</source>
<translation>بازگشایی قفل کیفپول با شکست مواجه شد</translation>
</message>
<message>
<location line="+1"/>
<location line="+12"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>گذرواژهٔ وارد شده برای رمزگشایی کیف پول نادرست بود.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>رمزگشایی ناموفق کیف پول</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation>گذرواژهٔ کیف پول با موفقیت عوض شد.</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+280"/>
<source>Sign &message...</source>
<translation>&امضای پیام...</translation>
</message>
<message>
<location line="+242"/>
<source>Synchronizing with network...</source>
<translation>همگامسازی با شبکه...</translation>
</message>
<message>
<location line="-308"/>
<source>&Overview</source>
<translation>&بررسی اجمالی</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>نمایش بررسی اجمالی کیف پول</translation>
</message>
<message>
<location line="+17"/>
<source>&Transactions</source>
<translation>&تراکنشها</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>مرور تاریخچهٔ تراکنشها</translation>
</message>
<message>
<location line="+5"/>
<source>&Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit the list of stored addresses and labels</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-13"/>
<source>&Receive coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show the list of addresses for receiving payments</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-7"/>
<source>&Send coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>E&xit</source>
<translation>&خروج</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>خروج از برنامه</translation>
</message>
<message>
<location line="+4"/>
<source>Show information about Doubloon</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>دربارهٔ &کیوت</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>نمایش اطلاعات دربارهٔ کیوت</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&تنظیمات...</translation>
</message>
<message>
<location line="+4"/>
<source>&Encrypt Wallet...</source>
<translation>&رمزنگاری کیف پول...</translation>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation>&پیشتیبانگیری از کیف پول...</translation>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>&تغییر گذرواژه...</translation>
</message>
<message numerus="yes">
<location line="+250"/>
<source>~%n block(s) remaining</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-247"/>
<source>&Export...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-62"/>
<source>Send coins to an Doubloon address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+45"/>
<source>Modify configuration options for Doubloon</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-14"/>
<source>Encrypt or decrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup wallet to another location</source>
<translation>تهیهٔ پشتیبان از کیف پول در یک مکان دیگر</translation>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>تغییر گذرواژهٔ مورد استفاده در رمزنگاری کیف پول</translation>
</message>
<message>
<location line="+10"/>
<source>&Debug window</source>
<translation>پنجرهٔ ا&شکالزدایی</translation>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation>باز کردن کنسول خطایابی و اشکالزدایی</translation>
</message>
<message>
<location line="-5"/>
<source>&Verify message...</source>
<translation>با&زبینی پیام...</translation>
</message>
<message>
<location line="-200"/>
<source>Doubloon</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet</source>
<translation>کیف پول</translation>
</message>
<message>
<location line="+178"/>
<source>&About Doubloon</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation>&نمایش/ عدم نمایش</translation>
</message>
<message>
<location line="+9"/>
<source>Unlock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>&Lock Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Lock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+34"/>
<source>&File</source>
<translation>&پرونده</translation>
</message>
<message>
<location line="+8"/>
<source>&Settings</source>
<translation>&تنظیمات</translation>
</message>
<message>
<location line="+8"/>
<source>&Help</source>
<translation>&کمکرسانی</translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation>نوارابزار برگهها</translation>
</message>
<message>
<location line="+8"/>
<source>Actions toolbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+9"/>
<source>[testnet]</source>
<translation>[شبکهٔ آزمایش]</translation>
</message>
<message>
<location line="+0"/>
<location line="+60"/>
<source>Doubloon client</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+70"/>
<source>%n active connection(s) to Doubloon network</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+40"/>
<source>Downloaded %1 blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+413"/>
<source>Staking.<br>Your weight is %1<br>Network weight is %2<br>Expected time to earn reward is %3</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Not staking because wallet is locked</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is syncing</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because you don't have mature coins</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-403"/>
<source>%n second(s) ago</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="-284"/>
<source>&Unlock Wallet...</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+288"/>
<source>%n minute(s) ago</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s) ago</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s) ago</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Up to date</source>
<translation>وضعیت بهروز</translation>
</message>
<message>
<location line="+7"/>
<source>Catching up...</source>
<translation>بهروز رسانی...</translation>
</message>
<message>
<location line="+10"/>
<source>Last received block was generated %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Sent transaction</source>
<translation>تراکنش ارسال شد</translation>
</message>
<message>
<location line="+1"/>
<source>Incoming transaction</source>
<translation>تراکنش دریافت شد</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>تاریخ: %1
مبلغ: %2
نوع: %3
نشانی: %4
</translation>
</message>
<message>
<location line="+100"/>
<location line="+15"/>
<source>URI handling</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<location line="+15"/>
<source>URI can not be parsed! This can be caused by an invalid Doubloon address or malformed URI parameters.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>کیف پول <b>رمزنگاری شده</b> است و هماکنون <b>باز</b> است</translation>
</message>
<message>
<location line="+10"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>کیف پول <b>رمزنگاری شده</b> است و هماکنون <b>قفل</b> است</translation>
</message>
<message>
<location line="+25"/>
<source>Backup Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+76"/>
<source>%n second(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n minute(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s)</source>
<translation><numerusform>%n ساعت</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation><numerusform>%n روز</numerusform></translation>
</message>
<message>
<location line="+18"/>
<source>Not staking</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoin.cpp" line="+109"/>
<source>A fatal error occurred. Doubloon can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+90"/>
<source>Network Alert</source>
<translation>پیام شبکه</translation>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<location filename="../forms/coincontroldialog.ui" line="+14"/>
<source>Coin Control</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Quantity:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Bytes:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+48"/>
<source>Amount:</source>
<translation>مبلغ:</translation>
</message>
<message>
<location line="+32"/>
<source>Priority:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+48"/>
<source>Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="+551"/>
<source>no</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="+51"/>
<source>After Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Change:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+69"/>
<source>(un)select all</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Tree mode</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>List mode</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+45"/>
<source>Amount</source>
<translation>مبلغ</translation>
</message>
<message>
<location line="+5"/>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Address</source>
<translation>نشانی</translation>
</message>
<message>
<location line="+5"/>
<source>Date</source>
<translation>تاریخ</translation>
</message>
<message>
<location line="+5"/>
<source>Confirmations</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirmed</source>
<translation>تأیید شده</translation>
</message>
<message>
<location line="+5"/>
<source>Priority</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="-515"/>
<source>Copy address</source>
<translation>کپی نشانی</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>کپی برچسب</translation>
</message>
<message>
<location line="+1"/>
<location line="+26"/>
<source>Copy amount</source>
<translation>کپی مقدار</translation>
</message>
<message>
<location line="-25"/>
<source>Copy transaction ID</source>
<translation>کپی شناسهٔ تراکنش</translation>
</message>
<message>
<location line="+24"/>
<source>Copy quantity</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Copy fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+317"/>
<source>highest</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>high</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>medium-high</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>low-medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>low</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>lowest</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+155"/>
<source>DUST</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>yes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>This label turns red, if the transaction size is bigger than 10000 bytes.
This means a fee of at least %1 per kb is required.
Can vary +/- 1 Byte per input.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transactions with higher priority get more likely into a block.
This label turns red, if the priority is smaller than "medium".
This means a fee of at least %1 per kb is required.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if any recipient receives an amount smaller than %1.
This means a fee of at least %2 is required.
Amounts below 0.546 times the minimum relay fee are shown as DUST.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if the change is smaller than %1.
This means a fee of at least %2 is required.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<location line="+66"/>
<source>(no label)</source>
<translation>(بدون برچسب)</translation>
</message>
<message>
<location line="-9"/>
<source>change from %1 (%2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>(change)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>ویرایش نشانی</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>&برچسب</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>&نشانی</translation>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+20"/>
<source>New receiving address</source>
<translation>نشانی دریافتی جدید</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>نشانی ارسالی جدید</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>ویرایش نشانی دریافتی</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>ویرایش نشانی ارسالی</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>نشانی وارد شده «%1» در حال حاضر در دفترچه وجود دارد.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid Doubloon address.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>نمیتوان کیف پول را رمزگشایی کرد.</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>ایجاد کلید جدید با شکست مواجه شد.</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+420"/>
<location line="+12"/>
<source>Doubloon-Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation>گزینهها</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation>&عمومی</translation>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation>پرداخت &کارمزد تراکنش</translation>
</message>
<message>
<location line="+31"/>
<source>Reserved amount does not participate in staking and is therefore spendable at any time.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Reserve</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Automatically start Doubloon after logging in to the system.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Start Doubloon on system login</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Detach databases at shutdown</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>&Network</source>
<translation>&شبکه</translation>
</message>
<message>
<location line="+6"/>
<source>Automatically open the Doubloon client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation>نگاشت درگاه شبکه با استفاده از پروتکل &UPnP</translation>
</message>
<message>
<location line="+7"/>
<source>Connect to the Doubloon network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation>آ&یپی پراکسی:</translation>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation>&درگاه:</translation>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation>درگاه پراکسی (مثال 9050)</translation>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation>&نسخهٔ SOCKS:</translation>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation>نسخهٔ پراکسی SOCKS (مثلاً 5)</translation>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation>&پنجره</translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation>تنها بعد از کوچک کردن پنجره، tray icon را نشان بده.</translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&کوچک کردن به سینی بهجای نوار وظیفه</translation>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation>مخفی کردن در نوار کناری بهجای خروج هنگام بستن پنجره. زمانی که این گزینه فعال است، برنامه فقط با استفاده از گزینهٔ خروج در منو قابل بسته شدن است.</translation>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation>کوچک کردن &در زمان بسته شدن</translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation>&نمایش</translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation>زبان &رابط کاربری:</translation>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting Doubloon.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation>&واحد نمایش مبالغ:</translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>انتخاب واحد پول مورد استفاده برای نمایش در پنجرهها و برای ارسال سکه.</translation>
</message>
<message>
<location line="+9"/>
<source>Whether to show Doubloon addresses in the transaction list or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation>نمایش ن&شانیها در فهرست تراکنشها</translation>
</message>
<message>
<location line="+7"/>
<source>Whether to show coin control features or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Display coin &control features (experts only!)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation>&تأیید</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>&لغو</translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+55"/>
<source>default</source>
<translation>پیشفرض</translation>
</message>
<message>
<location line="+149"/>
<location line="+9"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting Doubloon.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation>آدرس پراکسی داده شده صحیح نیست.</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>فرم</translation>
</message>
<message>
<location line="+33"/>
<location line="+231"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Doubloon network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-160"/>
<source>Stake:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-107"/>
<source>Wallet</source>
<translation>کیف پول</translation>
</message>
<message>
<location line="+49"/>
<source>Spendable:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Your current spendable balance</source>
<translation>تراز علیالحساب شما</translation>
</message>
<message>
<location line="+71"/>
<source>Immature:</source>
<translation>نارسیده:</translation>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation>تراز استخراج شده از معدن که هنوز بالغ نشده است</translation>
</message>
<message>
<location line="+20"/>
<source>Total:</source>
<translation>جمع کل:</translation>
</message>
<message>
<location line="+16"/>
<source>Your current total balance</source>
<translation>تراز کل فعلی شما</translation>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation><b>تراکنشهای اخیر</b></translation>
</message>
<message>
<location line="-108"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Total of coins that was staked, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../overviewpage.cpp" line="+113"/>
<location line="+1"/>
<source>out of sync</source>
<translation>ناهمگام</translation>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation>نام کلاینت</translation>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+348"/>
<source>N/A</source>
<translation>ناموجود</translation>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation>نسخهٔ کلاینت</translation>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation>&اطلاعات</translation>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation>نسخهٔ OpenSSL استفاده شده</translation>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation>زمان آغاز به کار</translation>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation>شبکه</translation>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation>تعداد ارتباطات</translation>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation>زنجیرهٔ بلوکها</translation>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation>تعداد فعلی بلوکها</translation>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation>تعداد تخمینی بلوکها</translation>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation>زمان آخرین بلوک</translation>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation>با&ز کردن</translation>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Show the Doubloon-Qt help message to get a list with possible Doubloon command-line options.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation>&کنسول</translation>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation>ساخت تاریخ</translation>
</message>
<message>
<location line="-104"/>
<source>Doubloon - Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Doubloon Core</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation>فایلِ لاگِ اشکال زدایی</translation>
</message>
<message>
<location line="+7"/>
<source>Open the Doubloon debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation>پاکسازی کنسول</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-33"/>
<source>Welcome to the Doubloon RPC console.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation>دکمههای بالا و پایین برای پیمایش تاریخچه و <b>Ctrl-L</b> برای پاک کردن صفحه.</translation>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation>برای نمایش یک مرور کلی از دستورات ممکن، عبارت <b>help</b> را بنویسید.</translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+182"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>ارسال سکه</translation>
</message>
<message>
<location line="+76"/>
<source>Coin Control Features</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Inputs...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>automatically selected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Insufficient funds!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+77"/>
<source>Quantity:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<location line="+35"/>
<source>0</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-19"/>
<source>Bytes:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Amount:</source>
<translation>مبلغ:</translation>
</message>
<message>
<location line="+22"/>
<location line="+86"/>
<location line="+86"/>
<location line="+32"/>
<source>0.00 OK</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-191"/>
<source>Priority:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>no</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>After Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+50"/>
<source>custom change address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+106"/>
<source>Send to multiple recipients at once</source>
<translation>ارسال به چند دریافتکنندهٔ بهطور همزمان</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation>&دریافتکنندهٔ جدید</translation>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>پاکسازی &همه</translation>
</message>
<message>
<location line="+28"/>
<source>Balance:</source>
<translation>تزار:</translation>
</message>
<message>
<location line="+16"/>
<source>123.456 OK</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation>عملیات ارسال را تأیید کنید</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>&ارسال</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-173"/>
<source>Enter an Doubloon address (e.g. F96m4dNBqCLh7ZYceQnLG7uPuva5mochZK)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Copy quantity</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>کپی مقدار</translation>
</message>
<message>
<location line="+1"/>
<source>Copy fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+86"/>
<source><b>%1</b> to %2 (%3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation>ارسال سکه را تأیید کنید</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The recipient address is not valid, please recheck.</source>
<translation>نشانی گیرنده معتبر نیست؛ لطفا دوباره بررسی کنید.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>مبلغ پرداخت باید بیشتر از ۰ باشد.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation>میزان پرداخت از تراز شما بیشتر است.</translation>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>با احتساب هزینهٔ %1 برای هر تراکنش، مجموع میزان پرداختی از مبلغ تراز شما بیشتر میشود.</translation>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>یک نشانی تکراری پیدا شد. در هر عملیات ارسال، به هر نشانی فقط مبلغ میتوان ارسال کرد.</translation>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+251"/>
<source>WARNING: Invalid Doubloon address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>(no label)</source>
<translation>(بدون برچسب)</translation>
</message>
<message>
<location line="+4"/>
<source>WARNING: unknown change address</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>A&مبلغ :</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>پرداخ&ت به:</translation>
</message>
<message>
<location line="+24"/>
<location filename="../sendcoinsentry.cpp" line="+25"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>برای این نشانی یک برچسب وارد کنید تا در دفترچهٔ آدرس ذخیره شود</translation>
</message>
<message>
<location line="+9"/>
<source>&Label:</source>
<translation>&برچسب:</translation>
</message>
<message>
<location line="+18"/>
<source>The address to send the payment to (e.g. F96m4dNBqCLh7ZYceQnLG7uPuva5mochZK)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Choose address from address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation>چسباندن نشانی از حافظهٔ سیستم</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter an Doubloon address (e.g. F96m4dNBqCLh7ZYceQnLG7uPuva5mochZK)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation>امضاها - امضا / تأیید یک پیام</translation>
</message>
<message>
<location line="+13"/>
<location line="+124"/>
<source>&Sign Message</source>
<translation>ا&مضای پیام</translation>
</message>
<message>
<location line="-118"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation>برای احراز اینکه پیامها از جانب شما هستند، میتوانید آنها را با نشانی خودتان امضا کنید. مراقب باشید چیزی که بدان اطمینان ندارید را امضا نکنید زیرا حملات فیشینگ ممکن است بخواهند از.پیامی با امضای شما سوءاستفاده کنند. تنها مواردی را که حاوی اطلاعات دقیق و قابل قبول برای شما هستند امضا کنید.</translation>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. F96m4dNBqCLh7ZYceQnLG7uPuva5mochZK)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+203"/>
<source>Choose an address from the address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-193"/>
<location line="+203"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="-193"/>
<source>Paste address from clipboard</source>
<translation>چسباندن نشانی از حافظهٔ سیستم</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation>پیامی را که میخواهید امضا کنید در اینجا وارد کنید</translation>
</message>
<message>
<location line="+24"/>
<source>Copy the current signature to the system clipboard</source>
<translation>امضای فعلی را به حافظهٔ سیستم کپی کن</translation>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this Doubloon address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Reset all sign message fields</source>
<translation>بازنشانی تمام فیلدهای پیام</translation>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>پاک &کردن همه</translation>
</message>
<message>
<location line="-87"/>
<location line="+70"/>
<source>&Verify Message</source>
<translation>&شناسایی پیام</translation>
</message>
<message>
<location line="-64"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation>برای شناسایی پیام، نشانیِ امضا کننده و متن پیام را وارد کنید. (مطمئن شوید که فاصلهها، تبها و خطوط را عیناً کپی میکنید.) مراقب باشید در امضا چیزی بیشتر از آنچه در پیام میبینید وجود نداشته باشد تا فریب دزدان اینترنتی و حملات از نوع MITM را نخورید.</translation>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. F96m4dNBqCLh7ZYceQnLG7uPuva5mochZK)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified Doubloon address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Reset all verify message fields</source>
<translation>بازنشانی تمام فیلدهای پیام</translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter an Doubloon address (e.g. F96m4dNBqCLh7ZYceQnLG7uPuva5mochZK)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation>برای ایجاد یک امضای جدید روی «امضای پیام» کلیک کنید</translation>
</message>
<message>
<location line="+3"/>
<source>Enter Doubloon signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation>نشانی وارد شده نامعتبر است.</translation>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation>لطفاً نشانی را بررسی کنید و دوباره تلاش کنید.</translation>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation>نشانی وارد شده به هیچ کلیدی اشاره نمیکند.</translation>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation>عملیات باز کرن قفل کیف پول لغو شد.</translation>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation>کلید خصوصی برای نشانی وارد شده در دسترس نیست.</translation>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation>امضای پیام با شکست مواجه شد.</translation>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation>پیام امضا شد.</translation>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation>امضا نمیتواند کدگشایی شود.</translation>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation>لطفاً امضا را بررسی نموده و دوباره تلاش کنید.</translation>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation>امضا با خلاصهٔ پیام مطابقت ندارد.</translation>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation>شناسایی پیام با شکست مواجه شد.</translation>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation>پیام شناسایی شد.</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+19"/>
<source>Open until %1</source>
<translation>باز تا %1</translation>
</message>
<message numerus="yes">
<location line="-2"/>
<source>Open for %n block(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+8"/>
<source>conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1/offline</source>
<translation>%1/آفلاین</translation>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1/تأیید نشده</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>%1 تأییدیه</translation>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation>وضعیت</translation>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation><numerusform>، پخش از طریق %n گره</numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>تاریخ</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation>منبع</translation>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation>تولید شده</translation>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation>فرستنده</translation>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation>گیرنده</translation>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation>آدرس شما</translation>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation>برچسب</translation>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation>بدهی</translation>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation><numerusform>بلوغ در %n بلوک دیگر</numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation>پذیرفته نشد</translation>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation>اعتبار</translation>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation>هزینهٔ تراکنش</translation>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation>مبلغ خالص</translation>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>پیام</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation>نظر</translation>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation>شناسهٔ تراکنش</translation>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 69 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation>اطلاعات اشکالزدایی</translation>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation>تراکنش</translation>
</message>
<message>
<location line="+5"/>
<source>Inputs</source>
<translation>ورودیها</translation>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>مبلغ</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation>درست</translation>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation>نادرست</translation>
</message>
<message>
<location line="-211"/>
<source>, has not been successfully broadcast yet</source>
<translation>، هنوز با موفقیت ارسال نشده</translation>
</message>
<message>
<location line="+35"/>
<source>unknown</source>
<translation>ناشناس</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation>جزئیات تراکنش</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>این پانل شامل توصیف کاملی از جزئیات تراکنش است</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+226"/>
<source>Date</source>
<translation>تاریخ</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>نوع</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>نشانی</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>مبلغ</translation>
</message>
<message>
<location line="+60"/>
<source>Open until %1</source>
<translation>باز شده تا %1</translation>
</message>
<message>
<location line="+12"/>
<source>Confirmed (%1 confirmations)</source>
<translation>تأیید شده (%1 تأییدیه)</translation>
</message>
<message numerus="yes">
<location line="-15"/>
<source>Open for %n more block(s)</source>
<translation><numerusform>باز برای %n بلوک دیگر</numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirming (%1 of %2 recommended confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Immature (%1 confirmations, will be available after %2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>این بلوک از هیچ همتای دیگری دریافت نشده است و احتمال میرود پذیرفته نشود!</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>تولید شده ولی قبول نشده</translation>
</message>
<message>
<location line="+42"/>
<source>Received with</source>
<translation>دریافتشده با</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation>دریافتشده از</translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>ارسالشده به</translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>پر داخت به خودتان</translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>استخراجشده</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>(ناموجود)</translation>
</message>
<message>
<location line="+190"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>وضعیت تراکنش. نشانگر را روی این فیلد نگه دارید تا تعداد تأییدیهها نشان داده شود.</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>تاریخ و ساعت دریافت تراکنش.</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>نوع تراکنش.</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>نشانی مقصد تراکنش.</translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>مبلغ کسر شده و یا اضافه شده به تراز.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+55"/>
<location line="+16"/>
<source>All</source>
<translation>همه</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>امروز</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>این هفته</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>این ماه</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>ماه گذشته</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>امسال</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>محدوده...</translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>دریافتشده با </translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>ارسال به</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>به خودتان</translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>استخراجشده</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>دیگر</translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation>برای جستوجو نشانی یا برچسب را وارد کنید</translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation>مبلغ حداقل</translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>کپی نشانی</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>کپی برچسب</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>کپی مقدار</translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation>کپی شناسهٔ تراکنش</translation>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>ویرایش برچسب</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation>نمایش جزئیات تراکنش</translation>
</message>
<message>
<location line="+144"/>
<source>Export Transaction Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>پروندهٔ نوع CSV جداشونده با کاما (*.csv)</translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation>تأیید شده</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>تاریخ</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>نوع</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>برچسب</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>نشانی</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>مبلغ</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation>شناسه</translation>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation>محدوده:</translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation>به</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+206"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+33"/>
<source>Doubloon version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Usage:</source>
<translation>استفاده:</translation>
</message>
<message>
<location line="+1"/>
<source>Send command to -server or doubloond</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>List commands</source>
<translation>نمایش لیست فرمانها</translation>
</message>
<message>
<location line="+1"/>
<source>Get help for a command</source>
<translation>راهنمایی در مورد یک دستور</translation>
</message>
<message>
<location line="+2"/>
<source>Options:</source>
<translation>گزینهها:</translation>
</message>
<message>
<location line="+2"/>
<source>Specify configuration file (default: Doubloon.conf)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Specify pid file (default: doubloond.pid)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify wallet file (within data directory)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation>مشخص کردن دایرکتوری دادهها</translation>
</message>
<message>
<location line="+2"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation>تنظیم اندازهٔ کَش پایگاهداده برحسب مگابایت (پیشفرض: ۲۵)</translation>
</message>
<message>
<location line="+1"/>
<source>Set database disk log size in megabytes (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Listen for connections on <port> (default: 69070 or testnet: 79080)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>حداکثر <n> اتصال با همتایان برقرار شود (پیشفرض: ۱۲۵)</translation>
</message>
<message>
<location line="+3"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation>اتصال به یک گره برای دریافت آدرسهای همتا و قطع اتصال پس از اتمام عملیات</translation>
</message>
<message>
<location line="+1"/>
<source>Specify your own public address</source>
<translation>آدرس عمومی خود را مشخص کنید</translation>
</message>
<message>
<location line="+5"/>
<source>Bind to given address. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Stake your coins to support network and gain reward (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>حد آستانه برای قطع ارتباط با همتایان بدرفتار (پیشفرض: ۱۰۰)</translation>
</message>
<message>
<location line="+1"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>مدت زمان جلوگیری از اتصال مجدد همتایان بدرفتار، به ثانیه (پیشفرض: ۸۴۶۰۰)</translation>
</message>
<message>
<location line="-44"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation>هنگام تنظیم پورت RPC %u برای گوش دادن روی IPv4 خطایی رخ داده است: %s</translation>
</message>
<message>
<location line="+51"/>
<source>Detach block and address databases. Increases shutdown time (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+109"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-87"/>
<source>Listen for JSON-RPC connections on <port> (default: 69069 or testnet: 79079)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-11"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>پذیرش دستورات خط فرمان و دستورات JSON-RPC</translation>
</message>
<message>
<location line="+101"/>
<source>Error: Transaction creation failed </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>Error: Wallet locked, unable to create transaction </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-8"/>
<source>Importing blockchain data file.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Importing bootstrap blockchain data file.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-88"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>اجرا در پشت زمینه بهصورت یک سرویس و پذیرش دستورات</translation>
</message>
<message>
<location line="+1"/>
<source>Use the test network</source>
<translation>استفاده از شبکهٔ آزمایش</translation>
</message>
<message>
<location line="-24"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation>پذیرش اتصالات از بیرون (پیش فرض:1 بدون پراکسی یا اتصال)</translation>
</message>
<message>
<location line="-38"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+117"/>
<source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-20"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation>هشدار: مبلغ paytxfee بسیار بالایی تنظیم شده است! این مبلغ هزینهای است که شما برای تراکنشها پرداخت میکنید.</translation>
</message>
<message>
<location line="+61"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong Doubloon will not work properly.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-31"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-18"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-30"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Block creation options:</source>
<translation>بستن گزینه ایجاد</translation>
</message>
<message>
<location line="-62"/>
<source>Connect only to the specified node(s)</source>
<translation>تنها در گره (های) مشخص شده متصل شوید</translation>
</message>
<message>
<location line="+4"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation>آدرس آی.پی. خود را شناسایی کنید (پیش فرض:1 در زمان when listening وno -externalip)</translation>
</message>
<message>
<location line="+94"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation>شنیدن هر گونه درگاه انجام پذیر نیست. ازlisten=0 برای اینکار استفاده کیند.</translation>
</message>
<message>
<location line="-90"/>
<source>Find peers using DNS lookup (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Sync checkpoints policy (default: strict)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+83"/>
<source>Invalid -tor address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Invalid amount for -reservebalance=<amount></source>
<translation type="unfinished"/>
</message>
<message>
<location line="-82"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation>حداکثر بافر دریافت شده بر اساس اتصال <n>* 1000 بایت (پیش فرض:5000)</translation>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation>حداکثر بافر دریافت شده بر اساس اتصال <n>* 1000 بایت (پیش فرض:1000)</translation>
</message>
<message>
<location line="-16"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation>تنها =به گره ها در شبکه متصا شوید <net> (IPv4, IPv6 or Tor)</translation>
</message>
<message>
<location line="+28"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Prepend debug output with timestamp</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation>گزینه ssl (به ویکیbitcoin برای راهنمای راه اندازی ssl مراجعه شود)</translation>
</message>
<message>
<location line="-74"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+41"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>اطلاعات ردگیری/اشکالزدایی را به جای فایل لاگ اشکالزدایی به کنسول بفرستید</translation>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation>حداقل سایز بلاک بر اساس بایت تنظیم شود (پیش فرض: 0)</translation>
</message>
<message>
<location line="-29"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation>فایل debug.log را در startup مشتری کوچک کن (پیش فرض:1 اگر اشکال زدایی روی نداد)</translation>
</message>
<message>
<location line="-42"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation>(میلی ثانیه )فاصله ارتباط خاص</translation>
</message>
<message>
<location line="+109"/>
<source>Unable to sign checkpoint, wrong checkpointkey?
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-80"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation>از UPnP برای شناسایی درگاه شنیداری استفاده کنید (پیش فرض:0)</translation>
</message>
<message>
<location line="-1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>از UPnP برای شناسایی درگاه شنیداری استفاده کنید (پیش فرض:1 در زمان شنیدن)</translation>
</message>
<message>
<location line="-25"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<source>Username for JSON-RPC connections</source>
<translation>JSON-RPC شناسه برای ارتباطات</translation>
</message>
<message>
<location line="+47"/>
<source>Verifying database integrity...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+57"/>
<source>WARNING: syncronized checkpoint violation detected, but skipped!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation>هشدار: این نسخه قدیمی است، روزآمدسازی مورد نیاز است</translation>
</message>
<message>
<location line="-48"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-54"/>
<source>Password for JSON-RPC connections</source>
<translation>JSON-RPC عبارت عبور برای ارتباطات</translation>
</message>
<message>
<location line="-84"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=doubloonrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "Doubloon Alert" admin@foo.com
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Find peers using internet relay chat (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>از آدرس آی پی خاص JSON-RPC قبول ارتباطات</translation>
</message>
<message>
<location line="+1"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>(127.0.0.1پیش فرض: ) &lt;ip&gt; دادن فرمانها برای استفاده گره ها روی</translation>
</message>
<message>
<location line="+1"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>زمانی که بهترین بلاک تغییر کرد، دستور را اجرا کن (%s در cmd با block hash جایگزین شده است)</translation>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation>هنگامی که یک تراکنش در کیف پولی رخ می دهد، دستور را اجرا کن(%s در دستورات بوسیله ی TxID جایگزین می شود)</translation>
</message>
<message>
<location line="+3"/>
<source>Require a confirmations for change (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Upgrade wallet to latest format</source>
<translation>wallet را به جدیدترین فرمت روزآمد کنید</translation>
</message>
<message>
<location line="+1"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation> (100پیش فرض:)&lt;n&gt; گذاشتن اندازه کلید روی </translation>
</message>
<message>
<location line="+1"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>اسکان مجدد زنجیر بلوکها برای گم والت معامله</translation>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 2500, 0 = all)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-6, default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Imports blocks from external blk000?.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>JSON-RPCبرای ارتباطات استفاده کنید OpenSSL (https)</translation>
</message>
<message>
<location line="+1"/>
<source>Server certificate file (default: server.cert)</source>
<translation> (server.certپیش فرض: )گواهی نامه سرور</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>(server.pemپیش فرض: ) کلید خصوصی سرور</translation>
</message>
<message>
<location line="+1"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+53"/>
<source>Error: Wallet unlocked for staking only, unable to create transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-158"/>
<source>This help message</source>
<translation>پیام کمکی</translation>
</message>
<message>
<location line="+95"/>
<source>Wallet %s resides outside data directory %s.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot obtain a lock on data directory %s. Doubloon is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-98"/>
<source>Doubloon</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+140"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation>امکان اتصال به %s از این رایانه وجود ندارد ( bind returned error %d, %s)</translation>
</message>
<message>
<location line="-130"/>
<source>Connect through socks proxy</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>به DNS اجازه بده تا برای addnode ، seednode و اتصال جستجو کند</translation>
</message>
<message>
<location line="+122"/>
<source>Loading addresses...</source>
<translation>بار گیری آدرس ها</translation>
</message>
<message>
<location line="-15"/>
<source>Error loading blkindex.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>خطا در بارگیری wallet.dat: کیف پول خراب شده است</translation>
</message>
<message>
<location line="+4"/>
<source>Error loading wallet.dat: Wallet requires newer version of Doubloon</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Wallet needed to be rewritten: restart Doubloon to complete</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat</source>
<translation>خطا در بارگیری wallet.dat</translation>
</message>
<message>
<location line="-16"/>
<source>Invalid -proxy address: '%s'</source>
<translation>آدرس پراکسی اشتباه %s</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation>شبکه مشخص شده غیرقابل شناسایی در onlynet: '%s'</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation>نسخه پراکسی ساکس غیرقابل شناسایی درخواست شده است: %i</translation>
</message>
<message>
<location line="+4"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation>آدرس قابل اتصال- شناسایی نیست %s</translation>
</message>
<message>
<location line="+2"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation>آدرس خارجی قابل اتصال- شناسایی نیست %s</translation>
</message>
<message>
<location line="-24"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>میزان وجه اشتباه برای paytxfee=<میزان وجه>: %s</translation>
</message>
<message>
<location line="+44"/>
<source>Error: could not start node</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Invalid amount</source>
<translation>میزان وجه اشتباه</translation>
</message>
<message>
<location line="+1"/>
<source>Insufficient funds</source>
<translation>بود جه نا کافی </translation>
</message>
<message>
<location line="-34"/>
<source>Loading block index...</source>
<translation>بار گیری شاخص بلوک</translation>
</message>
<message>
<location line="-103"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>به اتصال یک گره اضافه کنید و اتصال را باز نگاه دارید</translation>
</message>
<message>
<location line="+122"/>
<source>Unable to bind to %s on this computer. Doubloon is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-97"/>
<source>Fee per KB to add to transactions you send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+55"/>
<source>Invalid amount for -mininput=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Loading wallet...</source>
<translation>بار گیری والت</translation>
</message>
<message>
<location line="+8"/>
<source>Cannot downgrade wallet</source>
<translation>امکان تنزل نسخه در wallet وجود ندارد</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot initialize keypool</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot write default address</source>
<translation>آدرس پیش فرض قابل ذخیره نیست</translation>
</message>
<message>
<location line="+1"/>
<source>Rescanning...</source>
<translation>اسکان مجدد</translation>
</message>
<message>
<location line="+5"/>
<source>Done loading</source>
<translation>بار گیری انجام شده است</translation>
</message>
<message>
<location line="-167"/>
<source>To use the %s option</source>
<translation>برای استفاده از %s از انتخابات</translation>
</message>
<message>
<location line="+14"/>
<source>Error</source>
<translation>خطا</translation>
</message>
<message>
<location line="+6"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation>%s، شما باید یک rpcpassword را در فایل پیکربندی تنظیم کنید :⏎%s⏎ اگر فایل ایجاد نشد، یک فایل فقط متنی ایجاد کنید.
</translation>
</message>
</context>
</TS>
| OBAViJEST/boatcoinfinal | src/qt/locale/bitcoin_fa.ts | TypeScript | mit | 122,866 | [
30522,
1026,
1029,
20950,
2544,
1027,
1000,
1015,
1012,
1014,
1000,
1029,
1028,
1026,
999,
9986,
13874,
24529,
1028,
1026,
24529,
2653,
1027,
1000,
6904,
1000,
2544,
1027,
1000,
1016,
1012,
1015,
1000,
1028,
1026,
6123,
1028,
1026,
2171,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
{#-
Copyright (c) 2019 Charles University, Faculty of Arts,
Institute of the Czech National Corpus
Copyright (c) 2019 Tomas Machalek <tomas.machalek@gmail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2
dated June, 1991.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#}
{% extends "document.html" %}
{% block title %}{{ "Verification key confirmation"|_ }}{% endblock %}
{% block bodyonload %}
userTokenConfirmPage.init(__conf);
{% endblock %}
{% block headers %}
<style type="text/css">
p.token-confirmation {
font-size: 1.1em;
}
</style>
{% endblock %}
{% block main %}
<section>
<div class="bar"><h2>{{ "Verification key confirmation"|_ }}</h2></div>
<div>
{% if ok %}
<p class="token-confirmation">{{ label }} - {{ 'confirmed'|_ }}<p>
<p>
<a id="try-login" class="util-button">{{ 'Sign in'|_ }}</a>
</p>
{% else %}
<p class="token-confirmation">
{{ 'Confirmation key not found'|_ }}
</p>
<p>
<a class="util-button" href={{ sign_up_url }}>{{ 'Sign up'|_ }}</a>
</p>
{% endif %}
</div>
</section>
{% endblock %} | czcorpus/kontext | templates/user/token_confirm.html | HTML | gpl-2.0 | 1,701 | [
30522,
1063,
1001,
1011,
9385,
1006,
1039,
1007,
10476,
2798,
2118,
1010,
4513,
1997,
2840,
1010,
2820,
1997,
1996,
5569,
2120,
13931,
9385,
1006,
1039,
1007,
10476,
12675,
24532,
9453,
2243,
1026,
12675,
1012,
24532,
9453,
2243,
1030,
2091... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
class AsymmetricLicenseKey::Key
def initialize(user_id, public_key, private_key)
@user_id = user_id
@license_key = "123-#{user_id}-test"
end
def to_s
@license_key
end
end
| jonashuckestein/asymmetric_license_key | lib/asymmetric_license_key/key.rb | Ruby | mit | 192 | [
30522,
2465,
2004,
24335,
12589,
13231,
12325,
14839,
1024,
1024,
3145,
13366,
3988,
4697,
1006,
5310,
1035,
8909,
1010,
2270,
1035,
3145,
1010,
2797,
1035,
3145,
1007,
1030,
5310,
1035,
8909,
1027,
5310,
1035,
8909,
1030,
6105,
1035,
3145,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<title>Source code</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
</head>
<body>
<div class="sourceContainer">
<pre><span class="sourceLineNo">001</span>/**<a name="line.1"></a>
<span class="sourceLineNo">002</span> * Copyright (C) 2016 Gary Gregory. All rights reserved.<a name="line.2"></a>
<span class="sourceLineNo">003</span> *<a name="line.3"></a>
<span class="sourceLineNo">004</span> * See the NOTICE.txt file distributed with this work for additional<a name="line.4"></a>
<span class="sourceLineNo">005</span> * information regarding copyright ownership.<a name="line.5"></a>
<span class="sourceLineNo">006</span> * <a name="line.6"></a>
<span class="sourceLineNo">007</span> * Licensed under the Apache License, Version 2.0 (the "License");<a name="line.7"></a>
<span class="sourceLineNo">008</span> * you may not use this file except in compliance with the License.<a name="line.8"></a>
<span class="sourceLineNo">009</span> * You may obtain a copy of the License at<a name="line.9"></a>
<span class="sourceLineNo">010</span> * <a name="line.10"></a>
<span class="sourceLineNo">011</span> * http://www.apache.org/licenses/LICENSE-2.0<a name="line.11"></a>
<span class="sourceLineNo">012</span> * <a name="line.12"></a>
<span class="sourceLineNo">013</span> * Unless required by applicable law or agreed to in writing, software<a name="line.13"></a>
<span class="sourceLineNo">014</span> * distributed under the License is distributed on an "AS IS" BASIS,<a name="line.14"></a>
<span class="sourceLineNo">015</span> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<a name="line.15"></a>
<span class="sourceLineNo">016</span> * See the License for the specific language governing permissions and<a name="line.16"></a>
<span class="sourceLineNo">017</span> * limitations under the License.<a name="line.17"></a>
<span class="sourceLineNo">018</span> */<a name="line.18"></a>
<span class="sourceLineNo">019</span><a name="line.19"></a>
<span class="sourceLineNo">020</span>package com.garygregory.jcommander.converters.time;<a name="line.20"></a>
<span class="sourceLineNo">021</span><a name="line.21"></a>
<span class="sourceLineNo">022</span>import java.time.ZoneOffset;<a name="line.22"></a>
<span class="sourceLineNo">023</span><a name="line.23"></a>
<span class="sourceLineNo">024</span>import com.garygregory.jcommander.converters.AbstractBaseConverter;<a name="line.24"></a>
<span class="sourceLineNo">025</span><a name="line.25"></a>
<span class="sourceLineNo">026</span>/**<a name="line.26"></a>
<span class="sourceLineNo">027</span> * Converts a {@link String} into a {@link ZoneOffset}.<a name="line.27"></a>
<span class="sourceLineNo">028</span> * <p><a name="line.28"></a>
<span class="sourceLineNo">029</span> * For a description of the format, see {@link ZoneOffset#of(String)}.<a name="line.29"></a>
<span class="sourceLineNo">030</span> * </p><a name="line.30"></a>
<span class="sourceLineNo">031</span> * <a name="line.31"></a>
<span class="sourceLineNo">032</span> * <p><a name="line.32"></a>
<span class="sourceLineNo">033</span> * Example:<a name="line.33"></a>
<span class="sourceLineNo">034</span> * </p><a name="line.34"></a>
<span class="sourceLineNo">035</span> * <a name="line.35"></a>
<span class="sourceLineNo">036</span> * <pre class="prettyprint"><a name="line.36"></a>
<span class="sourceLineNo">037</span> * <code class="language-java">&#64;Parameter(names = { "--zoneOffset" }, converter = ZoneOffsetConverter.class)<a name="line.37"></a>
<span class="sourceLineNo">038</span> * private ZoneOffset zoneOffset;</code><a name="line.38"></a>
<span class="sourceLineNo">039</span> * </pre><a name="line.39"></a>
<span class="sourceLineNo">040</span> * <p><a name="line.40"></a>
<span class="sourceLineNo">041</span> * <a name="line.41"></a>
<span class="sourceLineNo">042</span> * @see ZoneOffset<a name="line.42"></a>
<span class="sourceLineNo">043</span> * @see ZoneOffset#of(String)<a name="line.43"></a>
<span class="sourceLineNo">044</span> * <a name="line.44"></a>
<span class="sourceLineNo">045</span> * @since 1.0.0<a name="line.45"></a>
<span class="sourceLineNo">046</span> * @author <a href="mailto:ggregory@garygregory.com">Gary Gregory</a><a name="line.46"></a>
<span class="sourceLineNo">047</span> */<a name="line.47"></a>
<span class="sourceLineNo">048</span>public class ZoneOffsetConverter extends AbstractBaseConverter<ZoneOffset> {<a name="line.48"></a>
<span class="sourceLineNo">049</span><a name="line.49"></a>
<span class="sourceLineNo">050</span> /**<a name="line.50"></a>
<span class="sourceLineNo">051</span> * Constructs a converter.<a name="line.51"></a>
<span class="sourceLineNo">052</span> * <a name="line.52"></a>
<span class="sourceLineNo">053</span> * @param optionName<a name="line.53"></a>
<span class="sourceLineNo">054</span> * The option name, may be null.<a name="line.54"></a>
<span class="sourceLineNo">055</span> */<a name="line.55"></a>
<span class="sourceLineNo">056</span> public ZoneOffsetConverter(final String optionName) {<a name="line.56"></a>
<span class="sourceLineNo">057</span> super(optionName, ZoneOffset.class);<a name="line.57"></a>
<span class="sourceLineNo">058</span> }<a name="line.58"></a>
<span class="sourceLineNo">059</span><a name="line.59"></a>
<span class="sourceLineNo">060</span> @Override<a name="line.60"></a>
<span class="sourceLineNo">061</span> protected ZoneOffset convertImpl(final String value) {<a name="line.61"></a>
<span class="sourceLineNo">062</span> return ZoneOffset.of(value);<a name="line.62"></a>
<span class="sourceLineNo">063</span> }<a name="line.63"></a>
<span class="sourceLineNo">064</span><a name="line.64"></a>
<span class="sourceLineNo">065</span>}<a name="line.65"></a>
</pre>
</div>
</body>
</html>
| garydgregory/jcommander-addons | docs/apidocs/src-html/com/garygregory/jcommander/converters/time/ZoneOffsetConverter.html | HTML | apache-2.0 | 6,165 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
16129,
1018,
1012,
5890,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
30524,
2516,
1028,
3120,
3642,
1026,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
@media (min-width: 980px) and (max-width: 1199px) {
.row {
margin-right: -40px;
*zoom: 1;
}
.row:before,
.row:after {
display: table;
content: "";
line-height: 0;
}
.row:after {
clear: both;
}
[class*="span"] {
float: right;
min-height: 1px;
margin-right: 40px;
}
.container,
.navbar-static-top .container,
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
width: 932px;
}
.span12 {
width: 932px;
}
.span11 {
width: 851px;
}
.span10 {
width: 770px;
}
.span9 {
width: 689px;
}
.span8 {
width: 608px;
}
.span7 {
width: 527px;
}
.span6 {
width: 446px;
}
.span5 {
width: 365px;
}
.span4 {
width: 284px;
}
.span3 {
width: 203px;
}
.span2 {
width: 122px;
}
.span1 {
width: 41px;
}
.offset12 {
margin-right: 1012px;
}
.offset11 {
margin-right: 931px;
}
.offset10 {
margin-right: 850px;
}
.offset9 {
margin-right: 769px;
}
.offset8 {
margin-right: 688px;
}
.offset7 {
margin-right: 607px;
}
.offset6 {
margin-right: 526px;
}
.offset5 {
margin-right: 445px;
}
.offset4 {
margin-right: 364px;
}
.offset3 {
margin-right: 283px;
}
.offset2 {
margin-right: 202px;
}
.offset1 {
margin-right: 121px;
}
.row-fluid {
width: 100%;
*zoom: 1;
}
.row-fluid:before,
.row-fluid:after {
display: table;
content: "";
line-height: 0;
}
.row-fluid:after {
clear: both;
}
.row-fluid [class*="span"] {
display: block;
width: 100%;
min-height: 30px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
float: right;
margin-right: 4.2918454935622%;
*margin-right: 4.2381974248927%;
}
.row-fluid [class*="span"]:first-child {
margin-right: 0;
}
.row-fluid .controls-row [class*="span"] + [class*="span"] {
margin-right: 4.2918454935622%;
}
.row-fluid .span12 {
width: 100%;
*width: 99.94635193133%;
}
.row-fluid .span11 {
width: 91.309012875536%;
*width: 91.255364806867%;
}
.row-fluid .span10 {
width: 82.618025751073%;
*width: 82.564377682403%;
}
.row-fluid .span9 {
width: 73.927038626609%;
*width: 73.87339055794%;
}
.row-fluid .span8 {
width: 65.236051502146%;
*width: 65.182403433476%;
}
.row-fluid .span7 {
width: 56.545064377682%;
*width: 56.491416309013%;
}
.row-fluid .span6 {
width: 47.854077253219%;
*width: 47.800429184549%;
}
.row-fluid .span5 {
width: 39.163090128755%;
*width: 39.109442060086%;
}
.row-fluid .span4 {
width: 30.472103004292%;
*width: 30.418454935622%;
}
.row-fluid .span3 {
width: 21.781115879828%;
*width: 21.727467811159%;
}
.row-fluid .span2 {
width: 13.090128755365%;
*width: 13.036480686695%;
}
.row-fluid .span1 {
width: 4.3991416309013%;
*width: 4.3454935622318%;
}
.row-fluid .offset12 {
margin-right: 108.58369098712%;
*margin-right: 108.47639484979%;
}
.row-fluid .offset12:first-child {
margin-right: 104.29184549356%;
*margin-right: 104.18454935622%;
}
.row-fluid .offset11 {
margin-right: 99.892703862661%;
*margin-right: 99.785407725322%;
}
.row-fluid .offset11:first-child {
margin-right: 95.600858369099%;
*margin-right: 95.49356223176%;
}
.row-fluid .offset10 {
margin-right: 91.201716738197%;
*margin-right: 91.094420600858%;
}
.row-fluid .offset10:first-child {
margin-right: 86.909871244635%;
*margin-right: 86.802575107296%;
}
.row-fluid .offset9 {
margin-right: 82.510729613734%;
*margin-right: 82.403433476395%;
}
.row-fluid .offset9:first-child {
margin-right: 78.218884120172%;
*margin-right: 78.111587982833%;
}
.row-fluid .offset8 {
margin-right: 73.81974248927%;
*margin-right: 73.712446351931%;
}
.row-fluid .offset8:first-child {
margin-right: 69.527896995708%;
*margin-right: 69.420600858369%;
}
.row-fluid .offset7 {
margin-right: 65.128755364807%;
*margin-right: 65.021459227468%;
}
.row-fluid .offset7:first-child {
margin-right: 60.836909871245%;
*margin-right: 60.729613733906%;
}
.row-fluid .offset6 {
margin-right: 56.437768240343%;
*margin-right: 56.330472103004%;
}
.row-fluid .offset6:first-child {
margin-right: 52.145922746781%;
*margin-right: 52.038626609442%;
}
.row-fluid .offset5 {
margin-right: 47.74678111588%;
*margin-right: 47.639484978541%;
}
.row-fluid .offset5:first-child {
margin-right: 43.454935622318%;
*margin-right: 43.347639484979%;
}
.row-fluid .offset4 {
margin-right: 39.055793991416%;
*margin-right: 38.948497854077%;
}
.row-fluid .offset4:first-child {
margin-right: 34.763948497854%;
*margin-right: 34.656652360515%;
}
.row-fluid .offset3 {
margin-right: 30.364806866953%;
*margin-right: 30.257510729614%;
}
.row-fluid .offset3:first-child {
margin-right: 26.072961373391%;
*margin-right: 25.965665236052%;
}
.row-fluid .offset2 {
margin-right: 21.673819742489%;
*margin-right: 21.56652360515%;
}
.row-fluid .offset2:first-child {
margin-right: 17.381974248927%;
*margin-right: 17.274678111588%;
}
.row-fluid .offset1 {
margin-right: 12.982832618026%;
*margin-right: 12.875536480687%;
}
.row-fluid .offset1:first-child {
margin-right: 8.6909871244635%;
*margin-right: 8.5836909871245%;
}
input,
textarea,
.uneditable-input {
margin-right: 0;
}
.controls-row [class*="span"] + [class*="span"] {
margin-right: 40px;
}
input.span12, textarea.span12, .uneditable-input.span12 {
width: 918px;
}
input.span11, textarea.span11, .uneditable-input.span11 {
width: 837px;
}
input.span10, textarea.span10, .uneditable-input.span10 {
width: 756px;
}
input.span9, textarea.span9, .uneditable-input.span9 {
width: 675px;
}
input.span8, textarea.span8, .uneditable-input.span8 {
width: 594px;
}
input.span7, textarea.span7, .uneditable-input.span7 {
width: 513px;
}
input.span6, textarea.span6, .uneditable-input.span6 {
width: 432px;
}
input.span5, textarea.span5, .uneditable-input.span5 {
width: 351px;
}
input.span4, textarea.span4, .uneditable-input.span4 {
width: 270px;
}
input.span3, textarea.span3, .uneditable-input.span3 {
width: 189px;
}
input.span2, textarea.span2, .uneditable-input.span2 {
width: 108px;
}
input.span1, textarea.span1, .uneditable-input.span1 {
width: 27px;
}
}
@media (min-width: 768px) and (max-width: 979px) {
.offset-12 {
margin-right: -736px;
}
.offset-11 {
margin-right: -673px;
}
.offset-10 {
margin-right: -610px;
}
.offset-9 {
margin-right: -547px;
}
.offset-8 {
margin-right: -484px;
}
.offset-7 {
margin-right: -421px;
}
.offset-6 {
margin-right: -358px;
}
.offset-5 {
margin-right: -295px;
}
.offset-4 {
margin-right: -232px;
}
.offset-3 {
margin-right: -169px;
}
.offset-2 {
margin-right: -106px;
}
.offset-1 {
margin-right: -43px;
}
}
@media (min-width: 980px) and (max-width: 1199px) {
.offset-12 {
margin-right: -932px;
}
.offset-11 {
margin-right: -851px;
}
.offset-10 {
margin-right: -770px;
}
.offset-9 {
margin-right: -689px;
}
.offset-8 {
margin-right: -608px;
}
.offset-7 {
margin-right: -527px;
}
.offset-6 {
margin-right: -446px;
}
.offset-5 {
margin-right: -365px;
}
.offset-4 {
margin-right: -284px;
}
.offset-3 {
margin-right: -203px;
}
.offset-2 {
margin-right: -122px;
}
.offset-1 {
margin-right: -41px;
}
}
@media (min-width: 1200px) {
.offset-12 {
margin-right: -960px;
}
.offset-11 {
margin-right: -877px;
}
.offset-10 {
margin-right: -794px;
}
.offset-9 {
margin-right: -711px;
}
.offset-8 {
margin-right: -628px;
}
.offset-7 {
margin-right: -545px;
}
.offset-6 {
margin-right: -462px;
}
.offset-5 {
margin-right: -379px;
}
.offset-4 {
margin-right: -296px;
}
.offset-3 {
margin-right: -213px;
}
.offset-2 {
margin-right: -130px;
}
.offset-1 {
margin-right: -47px;
}
}
@media (min-width: 600px) and (max-width: 767px) {
.row,
.row-fluid {
width: 100%;
margin-right: 0;
*zoom: 1;
}
.row:before,
.row:after,
.row-fluid:before,
.row-fluid:after {
display: table;
content: "";
line-height: 0;
}
.row:after,
.row-fluid:after {
clear: both;
}
.row [class*="span"],
.row-fluid [class*="span"] {
display: block;
width: 100%;
min-height: 30px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
float: right;
margin-right: 2.7173913043478%;
*margin-right: 2.6637432356783%;
}
.row [class*="span"]:first-child:not(.pull-right),
.row-fluid [class*="span"]:first-child:not(.pull-right) {
margin-right: 0;
}
.row [class*="span"].pull-left:first-child + [class*="span"]:not(.pull-right),
.row-fluid [class*="span"].pull-left:first-child + [class*="span"]:not(.pull-right) {
margin-right: 0;
}
.row .span12,
.row-fluid .span12 {
width: 100%;
*width: 99.94635193133%;
}
.row .span11,
.row-fluid .span11 {
width: 91.440217391304%;
*width: 91.386569322635%;
}
.row .span10,
.row-fluid .span10 {
width: 82.880434782609%;
*width: 82.826786713939%;
}
.row .span9,
.row-fluid .span9 {
width: 74.320652173913%;
*width: 74.267004105244%;
}
.row .span8,
.row-fluid .span8 {
width: 65.760869565217%;
*width: 65.707221496548%;
}
.row .span7,
.row-fluid .span7 {
width: 57.201086956522%;
*width: 57.147438887852%;
}
.row .span6,
.row-fluid .span6 {
width: 48.641304347826%;
*width: 48.587656279157%;
}
.row .span5,
.row-fluid .span5 {
width: 40.08152173913%;
*width: 40.027873670461%;
}
.row .span4,
.row-fluid .span4 {
width: 31.521739130435%;
*width: 31.468091061765%;
}
.row .span3,
.row-fluid .span3 {
width: 22.961956521739%;
*width: 22.90830845307%;
}
.row .span2,
.row-fluid .span2 {
width: 14.402173913043%;
*width: 14.348525844374%;
}
.row .span1,
.row-fluid .span1 {
width: 5.8423913043478%;
*width: 5.7887432356783%;
}
.span12 .row [class*="span"] {
margin-right: 2.7173913043478%;
*margin-right: 2.6637432356783%;
}
.span12 .row [class*="span"]:first-child {
margin-right: 0;
}
.span12 .row .span12 {
width: 100%;
*width: 99.94635193133%;
}
.span12 .row .span11 {
width: 91.440217391304%;
*width: 91.386569322635%;
}
.span12 .row .span10 {
width: 82.880434782609%;
*width: 82.826786713939%;
}
.span12 .row .span9 {
width: 74.320652173913%;
*width: 74.267004105244%;
}
.span12 .row .span8 {
width: 65.760869565217%;
*width: 65.707221496548%;
}
.span12 .row .span7 {
width: 57.201086956522%;
*width: 57.147438887852%;
}
.span12 .row .span6 {
width: 48.641304347826%;
*width: 48.587656279157%;
}
.span12 .row .span5 {
width: 40.08152173913%;
*width: 40.027873670461%;
}
.span12 .row .span4 {
width: 31.521739130435%;
*width: 31.468091061765%;
}
.span12 .row .span3 {
width: 22.961956521739%;
*width: 22.90830845307%;
}
.span12 .row .span2 {
width: 14.402173913043%;
*width: 14.348525844374%;
}
.span12 .row .span1 {
width: 5.8423913043478%;
*width: 5.7887432356783%;
}
.span11 .row [class*="span"] {
margin-right: 2.9717682020802%;
*margin-right: 2.9181201334107%;
}
.span11 .row [class*="span"]:first-child {
margin-right: 0;
}
.span11 .row .span11 {
width: 91.440217391304%;
*width: 91.386569322635%;
}
.span11 .row .span10 {
width: 82.880434782609%;
*width: 82.826786713939%;
}
.span11 .row .span9 {
width: 74.320652173913%;
*width: 74.267004105244%;
}
.span11 .row .span8 {
width: 65.760869565217%;
*width: 65.707221496548%;
}
.span11 .row .span7 {
width: 57.201086956522%;
*width: 57.147438887852%;
}
.span11 .row .span6 {
width: 48.641304347826%;
*width: 48.587656279157%;
}
.span11 .row .span5 {
width: 40.08152173913%;
*width: 40.027873670461%;
}
.span11 .row .span4 {
width: 31.521739130435%;
*width: 31.468091061765%;
}
.span11 .row .span3 {
width: 22.961956521739%;
*width: 22.90830845307%;
}
.span11 .row .span2 {
width: 14.402173913043%;
*width: 14.348525844374%;
}
.span11 .row .span1 {
width: 5.8423913043478%;
*width: 5.7887432356783%;
}
.span10 .row [class*="span"] {
margin-right: 3.2786885245902%;
*margin-right: 3.2250404559206%;
}
.span10 .row [class*="span"]:first-child {
margin-right: 0;
}
.span10 .row .span10 {
width: 90.638930163447%;
*width: 90.585282094778%;
}
.span10 .row .span9 {
width: 81.277860326894%;
*width: 81.224212258225%;
}
.span10 .row .span8 {
width: 71.916790490342%;
*width: 71.863142421672%;
}
.span10 .row .span7 {
width: 62.555720653789%;
*width: 62.502072585119%;
}
.span10 .row .span6 {
width: 53.194650817236%;
*width: 53.141002748567%;
}
.span10 .row .span5 {
width: 43.833580980684%;
*width: 43.779932912014%;
}
.span10 .row .span4 {
width: 34.472511144131%;
*width: 34.418863075461%;
}
.span10 .row .span3 {
width: 25.111441307578%;
*width: 25.057793238908%;
}
.span10 .row .span2 {
width: 15.750371471025%;
*width: 15.696723402356%;
}
.span10 .row .span1 {
width: 6.3893016344725%;
*width: 6.335653565803%;
}
.span9 .row [class*="span"] {
margin-right: 3.6563071297989%;
*margin-right: 3.6026590611294%;
}
.span9 .row [class*="span"]:first-child {
margin-right: 0;
}
.span9 .row .span9 {
width: 89.672131147541%;
*width: 89.618483078871%;
}
.span9 .row .span8 {
width: 79.344262295082%;
*width: 79.290614226412%;
}
.span9 .row .span7 {
width: 69.016393442623%;
*width: 68.962745373953%;
}
.span9 .row .span6 {
width: 58.688524590164%;
*width: 58.634876521494%;
}
.span9 .row .span5 {
width: 48.360655737705%;
*width: 48.307007669035%;
}
.span9 .row .span4 {
width: 38.032786885246%;
*width: 37.979138816576%;
}
.span9 .row .span3 {
width: 27.704918032787%;
*width: 27.651269964117%;
}
.span9 .row .span2 {
width: 17.377049180328%;
*width: 17.323401111658%;
}
.span9 .row .span1 {
width: 7.0491803278689%;
*width: 6.9955322591993%;
}
.span8 .row [class*="span"] {
margin-right: 4.1322314049587%;
*margin-right: 4.0785833362892%;
}
.span8 .row [class*="span"]:first-child {
margin-right: 0;
}
.span8 .row .span8 {
width: 88.482632541133%;
*width: 88.428984472464%;
}
.span8 .row .span7 {
width: 76.965265082267%;
*width: 76.911617013597%;
}
.span8 .row .span6 {
width: 65.4478976234%;
*width: 65.394249554731%;
}
.span8 .row .span5 {
width: 53.930530164534%;
*width: 53.876882095864%;
}
.span8 .row .span4 {
width: 42.413162705667%;
*width: 42.359514636998%;
}
.span8 .row .span3 {
width: 30.895795246801%;
*width: 30.842147178131%;
}
.span8 .row .span2 {
width: 19.378427787934%;
*width: 19.324779719265%;
}
.span8 .row .span1 {
width: 7.8610603290676%;
*width: 7.8074122603981%;
}
.span7 .row [class*="span"] {
margin-right: 4.750593824228%;
*margin-right: 4.6969457555585%;
}
.span7 .row [class*="span"]:first-child {
margin-right: 0;
}
.span7 .row .span7 {
width: 86.98347107438%;
*width: 86.929823005711%;
}
.span7 .row .span6 {
width: 73.96694214876%;
*width: 73.913294080091%;
}
.span7 .row .span5 {
width: 60.950413223141%;
*width: 60.896765154471%;
}
.span7 .row .span4 {
width: 47.933884297521%;
*width: 47.880236228851%;
}
.span7 .row .span3 {
width: 34.917355371901%;
*width: 34.863707303231%;
}
.span7 .row .span2 {
width: 21.900826446281%;
*width: 21.847178377611%;
}
.span7 .row .span1 {
width: 8.8842975206612%;
*width: 8.8306494519916%;
}
.span6 .row [class*="span"] {
margin-right: 5.586592178771%;
*margin-right: 5.5329441101014%;
}
.span6 .row [class*="span"]:first-child {
margin-right: 0;
}
.span6 .row .span6 {
width: 85.035629453682%;
*width: 84.981981385012%;
}
.span6 .row .span5 {
width: 70.071258907363%;
*width: 70.017610838694%;
}
.span6 .row .span4 {
width: 55.106888361045%;
*width: 55.053240292376%;
}
.span6 .row .span3 {
width: 40.142517814727%;
*width: 40.088869746057%;
}
.span6 .row .span2 {
width: 25.178147268409%;
*width: 25.124499199739%;
}
.span6 .row .span1 {
width: 10.21377672209%;
*width: 10.160128653421%;
}
.span5 .row [class*="span"] {
margin-right: 6.7796610169492%;
*margin-right: 6.7260129482796%;
}
.span5 .row [class*="span"]:first-child {
margin-right: 0;
}
.span5 .row .span5 {
width: 82.402234636872%;
*width: 82.348586568202%;
}
.span5 .row .span4 {
width: 64.804469273743%;
*width: 64.750821205073%;
}
.span5 .row .span3 {
width: 47.206703910615%;
*width: 47.153055841945%;
}
.span5 .row .span2 {
width: 29.608938547486%;
*width: 29.555290478817%;
}
.span5 .row .span1 {
width: 12.011173184358%;
*width: 11.957525115688%;
}
.span4 .row [class*="span"] {
margin-right: 8.6206896551724%;
*margin-right: 8.5670415865029%;
}
.span4 .row [class*="span"]:first-child {
margin-right: 0;
}
.span4 .row .span4 {
width: 78.64406779661%;
*width: 78.590419727941%;
}
.span4 .row .span3 {
width: 57.28813559322%;
*width: 57.234487524551%;
}
.span4 .row .span2 {
width: 35.932203389831%;
*width: 35.878555321161%;
}
.span4 .row .span1 {
width: 14.576271186441%;
*width: 14.522623117771%;
}
.span3 .row [class*="span"] {
margin-right: 11.834319526627%;
*margin-right: 11.780671457958%;
}
.span3 .row [class*="span"]:first-child {
margin-right: 0;
}
.span3 .row .span3 {
width: 72.844827586207%;
*width: 72.791179517537%;
}
.span3 .row .span2 {
width: 45.689655172414%;
*width: 45.636007103744%;
}
.span3 .row .span1 {
width: 18.534482758621%;
*width: 18.480834689951%;
}
.span2 .row [class*="span"] {
margin-right: 18.867924528302%;
*margin-right: 18.814276459632%;
}
.span2 .row [class*="span"]:first-child {
margin-right: 0;
}
.span2 .row .span2 {
width: 62.721893491124%;
*width: 62.668245422455%;
}
.span2 .row .span1 {
width: 25.443786982249%;
*width: 25.390138913579%;
}
.span1 .row [class*="span"] {
margin-right: 46.511627906977%;
*margin-right: 46.457979838307%;
}
.span1 .row [class*="span"]:first-child {
margin-right: 0;
}
.span1 .row .span1 {
width: 40.566037735849%;
*width: 40.51238966718%;
}
.spanfirst {
margin-right: 0 !important;
clear: right;
}
}
.row .span50,
.row-fluid .span50 {
width: 50%;
float: right;
}
.row .span33,
.row-fluid .span33 {
width: 33.3333%;
float: right;
}
.row .span25,
.row-fluid .span25 {
width: 25%;
float: right;
}
.row .span20,
.row-fluid .span20 {
width: 20%;
float: right;
}
.row .span16,
.row-fluid .span16 {
width: 16.6666%;
float: right;
}
.hidden-default {
display: none !important;
}
@media (min-width: 1200px) {
.hidden-wide {
display: none !important;
}
}
@media (min-width: 980px) and (max-width: 1199px) {
.hidden-normal {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 979px) {
.hidden-xtablet {
display: none !important;
}
}
@media (min-width: 600px) and (max-width: 767px) {
.hidden-tablet {
display: none !important;
}
}
@media (max-width: 599px) {
.hidden-mobile {
display: none !important;
}
}
.hidden {
display: none !important;
visibility: hidden;
}
@media (min-width: 768px) and (max-width: 979px) {
.jumbotron {
padding: 20px 0;
}
.jumbotron h1 {
font-size: 26px;
}
.jumbotron p {
font-size: 13px;
}
.masthead {
padding: 40px 0;
}
.masthead h1 {
font-size: 52px;
}
.masthead p {
font-size: 26px;
}
.masthead .btn-large {
font-size: 15px;
padding: 11px 15px;
margin-top: 0;
}
}
@media (max-width: 767px) {
.jumbotron {
padding: 20px 0;
}
.jumbotron h1 {
font-size: 26px;
}
.jumbotron p {
font-size: 15px;
}
.masthead {
padding: 20px 0;
}
.masthead h1 {
font-size: 26px;
}
.masthead p {
font-size: 15px;
}
.masthead .btn-large {
font-size: 13px;
padding: 11px 15px;
margin-top: 0;
}
}
@media (max-width: 767px) {
.always-show .mega > .mega-dropdown-menu,
.always-show .dropdown-menu {
display: block !important;
}
.navbar-collapse-fixed-top,
.navbar-collapse-fixed-bottom {
border-top: none;
position: fixed;
right: 0;
top: 0;
width: 100%;
z-index: 1000;
}
.navbar-collapse-fixed-top .nav-collapse,
.navbar-collapse-fixed-bottom .nav-collapse {
position: absolute;
width: 100%;
right: 0;
top: 31px;
margin: 0;
}
.navbar-collapse-fixed-top .nav-collapse.in,
.navbar-collapse-fixed-bottom .nav-collapse.in {
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.navbar-collapse-fixed-top .nav-collapse.in > *,
.navbar-collapse-fixed-bottom .nav-collapse.in > * {
-webkit-transform: translateZ(0);
}
.navbar-collapse-fixed-top .nav-collapse.animate,
.navbar-collapse-fixed-bottom .nav-collapse.animate {
overflow: hidden;
}
.navbar-collapse-fixed-bottom {
bottom: 0;
top: auto;
}
.navbar-collapse-fixed-bottom .nav-collapse {
bottom: 31px;
top: auto;
}
.navbar-collapse-fixed-bottom .btn-navbar {
position: absolute;
bottom: 0;
}
.logo-control .logo-img-sm {
display: block;
}
.logo-control .logo-img {
display: none;
}
}
@media (max-width: 767px) {
.ja-navhelper {
margin-right: -20px;
margin-left: -20px;
}
.breadcrumb {
padding: 10px 20px;
}
.t3-mainnav {
background: #ffffff;
border-top: 1px solid #f2f2f2;
height: auto;
}
.t3-mainnav .navbar {
margin-top: 0;
}
.t3-mainnav .navbar .btn-navbar {
margin-bottom: 10px;
}
.t3-mainnav .nav-collapse .nav {
margin: 0 !important;
}
.t3-mainnav .nav-collapse {
margin-top: 10px;
background: #fff;
top: 66px !important;
}
.t3-mainnav .nav-collapse .nav {
background-color: #fff !important;
margin: 0 20px 0 0;
}
.t3-mainnav .nav li.dropdown.open > .dropdown-toggle,
.t3-mainnav .nav li.dropdown.active > .dropdown-toggle,
.t3-mainnav .nav li.dropdown.open.active > .dropdown-toggle {
background: #fff;
color: #1ba1e2;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 0px;
}
.t3-mainnav .nav-collapse .nav > li > a {
margin-bottom: 0;
border-bottom: solid 1px #eee;
}
.t3-mainnav .navbar .nav > li > .dropdown-menu > li a {
background: #fff;
border-top: 1px solid #eee;
color: #666;
}
.t3-mainnav .navbar .nav > li > .dropdown-menu > li a:hover {
background: #fff;
color: #1ba1e2;
}
.t3-mainnav .nav li.dropdown.open.active > .dropdown-toggle:hover {
border-color: #eee;
}
.t3-mainnav .nav-collapse .nav > li > a,
.t3-mainnav .nav-collapse .dropdown-menu a {
border-bottom: solid 1px #eee;
color: #444;
font-weight: bold;
padding: 10px 20px;
text-shadow: none;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
.t3-mainnav .nav-collapse .dropdown-menu li + li a {
margin-bottom: 0;
}
.t3-mainnav .navbar .nav > li > .dropdown-menu > li.active a {
color: #1ba1e2;
}
.t3-mainnav .nav-collapse .nav > li > a:hover,
.t3-mainnav .nav-collapse .dropdown-menu a:hover {
background-color: none !important;
}
.t3-mainnav .nav li.dropdown > .dropdown-menu .active > a,
.t3-mainnav .nav li.dropdown > .dropdown-menu .active > a:hover {
background: #fff;
color: #1ba1e2;
font-weight: normal;
}
.t3-mainnav .nav li.dropdown > .dropdown-menu .active > .nav-child a {
color: #666;
}
.t3-mainnav .nav li.dropdown > .dropdown-menu .active > .nav-child .active a,
.t3-mainnav .nav li.dropdown > .dropdown-menu .active > .nav-child a:hover {
background: #fff;
color: #1ba1e2;
}
.t3-mainnav .nav-collapse .dropdown-menu a {
border-top: 1px solid #f2f2f2;
border-bottom: 0;
font-weight: normal;
padding: 10px 40px;
}
.t3-mainnav .nav-collapse .dropdown-menu a:hover {
background-color: none !important;
}
.ja-mainnav .nav-collapse .nav > li > a,
.ja-mainnav .nav-collapse .dropdown-menu a {
padding-right: 20px;
}
.ja-mainnav .nav-collapse .nav > li > a:hover,
.ja-mainnav .nav-collapse .dropdown-menu a:hover {
background: #fff;
}
.t3-mainnav .nav-collapse .dropdown-menu {
margin: 0;
padding: 0;
background-color: none;
border: none;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.t3-mainnav .nav-collapse .dropdown-menu .dropdown-menu {
padding-right: 20px;
}
.t3-mainnav .nav-collapse .dropdown-menu .dropdown-menu .mega-nav li > a {
padding-top: 0;
border-top: 0;
}
.t3-mainnav .navbar .nav > li > .dropdown-menu:before,
.t3-mainnav .navbar .nav > li > .dropdown-menu:after,
.t3-mainnav .navbar .nav > li > .dropdown-menu .divider {
display: none;
}
.customization {
display: none;
}
.t3-mainnav .navbar .nav > li > .dropdown-menu {
border: none;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 0px;
}
.t3-mainnav .dropdown-menu li > a:hover,
.t3-mainnav .dropdown-menu li > a:focus,
.t3-mainnav .dropdown-submenu:hover > a {
background: #fff;
}
}
@media (max-width: 599px) {
article img[align=left],
.img_caption.left,
article img[align=right],
.img_caption.right,
.img-fulltext-left,
.img-fulltext-right {
float: none !important;
margin-right: 0;
margin-left: 0;
width: 100% !important;
}
}
#form-login-username .input-prepend .input,
#form-login-password .input-prepend .input {
width: 80%;
}
@media (max-width: 767px) {
h1 {
font-size: 26px;
line-height: 1.25;
}
h1 small {
font-size: 26px;
}
h2 {
font-size: 19.5px;
line-height: 1.25;
}
h2 small {
font-size: 19.5px;
}
h3 {
font-size: 16.25px;
line-height: 1.25;
}
h3 small {
font-size: 13px;
}
h4,
h5,
h6 {
font-size: 13px;
line-height: 1.25;
}
h4 small,
h5 small,
h6 small {
font-size: 13px -2px;
}
}
@media (min-width: 768px) and (max-width: 979px) {
.head-search .input {
width: 90px !important;
}
ul.social-list li {
width: 100%;
}
div.contact .thumbnail {
float: none;
}
div.contact .thumbnail img {
width: 100%;
}
table.calendar tr td {
padding: 5px 2px;
}
}
@media (max-width: 767px) {
.logo {
float: none;
text-align: center;
}
.head-search {
float: none;
}
.head-search .input {
width: 100%;
}
.head-search .input:focus {
width: 100%;
}
.t3-mainnav {
float: none;
}
.container.ja-mainbody {
margin-top: 40px;
}
.ja-slideshow .container {
padding-top: 0;
margin-top: 170px;
}
.ja-slideshow .ja-ss-desc {
bottom: 40px;
}
.ja-slideshow .ja-ss-desc h2 {
font-size: 3em;
}
.ja-slideshow .ja-ss-desc h3 {
margin-bottom: 0;
}
.ja-slideshow .ja-ss-desc a.btn {
padding: 15px 30px;
}
.ja-sl {
padding-bottom: 20px;
padding-top: 20px;
}
.ja-sl-1 .module,
.ja-sl-1 .t3-module {
background: none;
border: none;
margin-bottom: 20px;
}
.home .ja-sl-1,
.home .ja-sl-5 {
margin-right: -20px;
margin-left: -20px;
}
.home .ja-sl-1 .jumbotron,
.home .ja-sl-5 .jumbotron {
padding-top: 30px;
padding-bottom: 10px;
}
.home .ja-sl-1 .jumbotron .btn-large,
.home .ja-sl-5 .jumbotron .btn-large {
font-size: 15px;
padding: 11px 15px;
}
.home .ja-sl-2 {
text-align: center;
}
.home .ja-sl-2 p {
font-size: 13px;
line-height: 20px;
}
.home .ja-sl-3 p img {
margin-bottom: 0;
margin-top: 20px;
}
.home .ja-sl-3 p,
.home .ja-sl-4 p {
font-size: 13px;
line-height: 20px;
}
.home .ja-sl-3 .jumbotron,
.home .ja-sl-4 .jumbotron {
padding-bottom: 0;
}
.home .ja-sl-3 .jumbotron h1,
.home .ja-sl-4 .jumbotron h1 {
margin-bottom: 10px;
margin-top: 10px;
}
.home .ja-sl-3 .jumbotron p,
.home .ja-sl-4 .jumbotron p {
font-size: 13px;
}
.ja-footnav {
padding: 20px 20px 0;
font-size: 11px;
}
.ja-footnav .module-title {
font-size: 13px;
font-weight: bold;
}
.ja-copyright {
padding: 20px 20px 40px;
*zoom: 1;
}
.ja-copyright:before,
.ja-copyright:after {
display: table;
content: "";
line-height: 0;
}
.ja-copyright:after {
clear: both;
}
.copyright,
.poweredby {
float: none;
}
.poweredby {
margin-top: 10px;
}
.ja-masshead {
margin: 100px 0 -40px;
padding: 0;
}
.ja-masshead h3 {
font-size: 30px;
font-size: 20px;
padding: 10px;
}
ul.social-list li {
width: auto;
}
ul.social-list li a strong {
display: none;
}
div.ja-ss-desc p {
display: none;
}
.ja-ss-items .ja-ss-item img {
width: 50%;
}
.contact .thumbnail {
display: none;
}
.ja-header .span8,
.ja-header .span2 {
float: right;
margin-right: 0;
}
.ja-header .ja-logo {
margin-right: 0;
right: 75px;
position: absolute;
width: auto;
}
.ja-header .ja-search {
float: left;
position: absolute;
left: 20px;
top: 5px;
width: auto;
}
.ja-header .ja-search .head-search {
margin-top: 17px;
}
.ja-header .t3-mainnav {
border-top: 0;
}
.head-search .input,
.head-search .input:focus {
width: 100px;
}
.ja-header .languageswitcherload {
bottom: 5px;
float: left;
position: absolute;
left: 20px;
width: 100%;
}
.ja-ss-thumbs {
margin-right: 0 !important;
}
.ja-sl-1,
.ja-sl-2,
.ja-sl-3,
.ja-sl-4,
.ja-sl-5,
.ja-sl-6 {
margin: 0 -20px;
padding-right: 20px;
padding-left: 20px;
}
.ja-footer,
.ja-footnav {
margin: 0 -20px;
padding-right: 20px;
padding-left: 20px;
}
}
@media (max-width: 480px) {
.ja-sidebar {
clear: both;
}
div.ja-ss-desc p {
display: none;
}
div.ja-ss-desc h2 {
font-size: 28px;
}
div.ja-ss-desc h3 {
font-size: 18px;
margin-bottom: 0;
}
div.ja-ss-desc a.btn-large {
padding: 10px;
}
.ja-masshead {
margin-right: -20px;
margin-left: -20px;
padding-right: 20px;
padding-left: 20px;
}
.ja-content {
margin-bottom: 20px;
}
.ja-sl-1,
.ja-sl-3,
.ja-sl-4,
.ja-sl-5,
.ja-sl-6,
.ja-footnav {
margin: 0 -20px;
padding: 20px;
}
div.all-partner .span2 {
text-align: center;
}
ul.social-list li a strong {
display: inline;
}
.ja-footer {
margin-right: -20px;
margin-left: -20px;
}
div.contact h3 {
font-size: 20px;
margin-bottom: 20px;
}
div.contact fieldset legend {
line-height: 1.5;
}
div.contact fieldset .control-group:nth-child(6) .control-label {
float: right;
margin-left: 5px;
}
div.contact fieldset .control-group:nth-child(6) .controls {
float: right;
}
div.contact fieldset .control-group:nth-child(6) .controls input {
margin-top: 0;
}
.login_form fieldset,
.login fieldset {
padding: 20px;
}
.memebers-info .span3 {
float: right;
width: 50%;
}
.memebers-info .span3:nth-child(2*n) {
padding-left: 10px;
}
.memebers-info .span3:nth-child(2*n+1) {
padding-right: 10px;
}
.pricing-table .four-cols .col {
border: 1px solid #ddd;
border-bottom: 0px;
width: 100%;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 0px;
}
.pricing-table .col-last {
border-bottom: 1px solid #ddd !important;
-webkit-border-bottom-left-radius: 3px;
-moz-border-radius-bottomleft: 3px;
border-bottom-left-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
-moz-border-radius-bottomright: 3px;
border-bottom-right-radius: 3px;
}
.pricing-table .col-header {
border-right: 0;
border-left: 0;
height: auto;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 0px;
}
.pricing-table .featured .col-header {
height: auto;
margin-top: 0;
}
.pricing-table .col-last .col-header {
border-left: 0;
}
.pricing-table ul li {
border-right: 0;
border-left: 0;
}
.pricing-table .col-last ul li {
border-left: 0;
}
.pricing-table .col-footer,
.pricing-table .col-last .col-footer {
border-left: 0;
border-right: 0;
border-bottom: 0;
height: auto;
}
.pricing-table .featured .col-footer {
border: 0;
height: auto;
margin-bottom: 0;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 0px;
}
div.componentheading {
font-size: 20px;
}
div.tagItemView {
float: none;
}
.ja-masshead {
margin-top: 100px !important;
margin-bottom: -40px !important;
}
.ja-masshead h3 {
font-size: 20px;
padding: 10px 0;
}
}
@media (max-width: 479px) {
.ja-slideshow .container {
padding-top: 10px;
}
.ja-masshead {
margin: 0 -20px;
padding: 0 20px;
}
.ja-content {
margin-bottom: 20px;
}
div.ja-ss-desc {
display: none;
}
.ja-ss-items .ja-ss-item img {
width: 100%;
}
.ja-navhelper {
display: none;
}
.memebers-info .span3 {
float: none;
padding: 0;
width: 100%;
}
ul.social-list li a strong {
display: none;
}
.ja-sl-1 .module {
border: 0 !important;
margin-bottom: 30px;
}
#search-form #finder-search .inputbox {
width: 60%;
}
div.search #search-searchword {
width: 200px;
}
div.itemIntroText img,
div.catItemIntroText img,
div.genericItemIntroText img,
div.latestItemIntroText img,
div.tagItemIntroText img,
div.userItemIntroText img {
border: 0;
margin: 0 0 10px;
padding: 0;
width: 100%;
}
div.itemHeader h2.itemTitle {
font-size: 20px;
line-height: 24px;
}
span.itemImage img {
width: 100%;
}
div.itemNavigation a.itemPrevious,
div.itemNavigation a.itemNext {
width: 100%;
}
div.itemCommentsForm form textarea.inputbox,
div.itemCommentsForm form input.inputbox {
width: 90%;
}
div.itemComments ul.itemCommentsList li {
padding-right: 0;
}
div.itemComments ul.itemCommentsList li .user-avatar {
display: none;
}
div.itemComments ul.itemCommentsList li .comment-inner span.arrow {
display: none;
}
.k2AccountPage table.admintable td input.inputbox {
width: 45%;
}
} | monkivn92/benhanonline | templates/ja_brisk/css/rtl/template-responsive.css | CSS | gpl-2.0 | 35,721 | [
30522,
1030,
2865,
1006,
8117,
1011,
9381,
1024,
25195,
2361,
2595,
1007,
1998,
1006,
4098,
1011,
9381,
1024,
13285,
2683,
2361,
2595,
1007,
1063,
1012,
5216,
1063,
7785,
1011,
2157,
1024,
1011,
2871,
2361,
2595,
1025,
1008,
24095,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
describe("Image", function() {
beforeEach(function() {
$("body").append($('<div id="sandbox"></div>'));
});
afterEach(function() {
$('#sandbox').remove();
$('.ui-dialog').remove();
});
it("add image into item content by factory", function() {
$('#sandbox').wikimate({});
$('#sandbox').wikimate('newItem', {type: 'factory'});
$('.new-image').click();
var image = "data:image/gif;base64,R0lGODlhEAAOALMAAOazToeHh0tLS/7LZv/0jvb29t/f3//Ub//ge8WSLf/rhf/3kdbW1mxsbP//mf///yH5BAAAAAAALAAAAAAQAA4AAARe8L1Ekyky67QZ1hLnjM5UUde0ECwLJoExKcppV0aCcGCmTIHEIUEqjgaORCMxIC6e0CcguWw6aFjsVMkkIr7g77ZKPJjPZqIyd7sJAgVGoEGv2xsBxqNgYPj/gAwXEQA7";
$('.image_url_input').val(image);
var done = $('.ui-button').filter(function(i, button) {
return $(button).text() == "Done";
});
done.click();
expect($('#sandbox .item').prop('class')).toEqual('item image');
expect($('#sandbox .item img').length).toEqual(1);
expect($('#sandbox .item img').prop('src')).toEqual(image);
expect($('#sandbox .item').story_item('data').type).toEqual('image');
expect($('#sandbox .item').story_item('data').text).toEqual(image);
});
it("should not add image when image url is blank", function() {
$('#sandbox').wikimate({});
$('#sandbox').wikimate('newItem', {type: 'factory'});
$('.new-image').click();
var done = $('.ui-button').filter(function(i, button) {
return $(button).text() == "Done";
});
done.click();
expect($('#sandbox .item').length).toEqual(0);
});
});
| xli/wikimate | spec/javascripts/image_spec.js | JavaScript | mit | 1,545 | [
30522,
6235,
1006,
1000,
3746,
1000,
1010,
3853,
1006,
1007,
1063,
2077,
5243,
2818,
1006,
3853,
1006,
1007,
1063,
1002,
1006,
1000,
2303,
1000,
1007,
1012,
10439,
10497,
1006,
1002,
1006,
1005,
1026,
4487,
2615,
8909,
1027,
1000,
5472,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
$def with (server)
<html>
<head>
<link href='/static/css/crypticweb.css' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="/static/jquery/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="/static/jquery/js/jquery-ui-1.10.1.custom.min.js"></script>
<script type="text/javascript">var SERVER="$server"</script>
<script type="text/javascript" src="/static/js/client.js"></script>
</head>
<body>
<div class="page">
<div class="header">
<div class="title">
<h1>Cryptic Crossword Clue Solver</h1>
</div>
<div class="info">
<a href="https://github.com/rdeits/cryptics">Source code</a> | <a href="http://blog.robindeits.com/2013/02/11/a-cryptic-crossword-clue-solver/">More information</a><br>
</div>
</div>
<div class="preamble">
<div class="solver_desc">
This is a general tool for solving cryptic (or "British-style") crossword clues. Run it by entering a cryptic clue along with the answer length (or lengths) in parentheses. If you know some of the letters in the answer, you can type them in after the lengths, using a single '.' for each unknown letter. Here are some examples of clues it can solve correctly:
</div>
<br>
<div id="sample_clues">
</div>
<br>
<div class="solver_desc">
Longer clues take longer to solve. You can help the solver by connecting words which act together with an underscore ('_') to from a phrase, as with "rises_and_falls" in the last example.
</div>
</div>
<div id="clue_entry">
<form name="main" method="post" id="clue_form">
<label for="Clue"></label>
<input name="Clue" type="text" id="clue_text" placeholder="Spin broken shingle (7) ..g...."/>
<input type="submit" value="Solve"/>
</form>
</div>
<div id="solution">
</div>
</div>
</body>
</html> | rdeits/cryptics | pycryptics/crypticweb/templates/index.html | HTML | mit | 1,985 | [
30522,
1002,
13366,
2007,
1006,
8241,
1007,
1026,
16129,
1028,
1026,
2132,
1028,
1026,
4957,
17850,
12879,
1027,
1005,
1013,
10763,
1013,
20116,
2015,
1013,
26483,
8545,
2497,
1012,
20116,
2015,
1005,
2128,
2140,
1027,
1005,
6782,
21030,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
{% extends "layout_picker.html" %}
{% block page_title %}
{{council.name}} - Apply for an older person's bus pass in {{council.shortName}}
{% endblock %}
{% block content %}
<main id="content" role="main">
<div class="photo-guide">
<a href="./need-photo" class="back-link">Other ways to get a photo</a>
<span class="marker">Guide part 7 of 13</span>
</div>
<h1 class="heading-xlarge">How to take your own digital passport photo</h1>
<h2 class="heading-medium">Check the lighting</h2>
<div class="text">
<p>There shouldn’t be any shadows on your face or behind your head.</p>
<p>Make sure:</p>
<ul class="list list-bullet">
<li>you use natural light (eg a large window facing you)</li>
<li>the lighting is even – don’t stand too close to a lamp that’s switched on</li>
</ul>
</div>
<div class="guidance-photos" aria-hidden="true">
<ul>
<li>
<img src="{{asset_path}}images/image-m1-plain.jpg" alt="">
<div class="result" style="height: 38px;">
<p class="approved">Approved</p>
</div>
</li>
<li>
<img src="{{asset_path}}images/image-m1-uneven-harsh.jpg" alt="">
<div class="result" style="height: 38px;">
<p class="failed">Uneven lighting</p>
</div>
</li>
<li>
<img src="{{asset_path}}images/image-m1-flash-shadow.jpg" alt="">
<div class="result" style="height: 38px;">
<p class="failed">Avoid shadows</p>
</div>
</li>
</ul>
</div>
<nav class="guide-nav">
<ul>
<li class="button-guide button-guide-previous">
<a class="button" href="photo-guide-space" role="button">Previous</a>
</li>
<li class="button-guide button-guide-previous">
<a class="button" href="photo-guide-headwear" role="button">Next</a>
</li>
</ul>
</nav>
</main>
{% endblock %}
| BucksCountyCouncil/verify-local-patterns | app/views/service-patterns/concessionary-travel/example-service/photo/photo-guide-lighting.html | HTML | mit | 2,093 | [
30522,
1063,
1003,
8908,
1000,
9621,
1035,
4060,
2121,
1012,
16129,
1000,
1003,
1065,
1063,
1003,
3796,
3931,
1035,
2516,
1003,
1065,
1063,
1063,
2473,
1012,
2171,
1065,
1065,
1011,
6611,
2005,
2019,
3080,
2711,
1005,
1055,
3902,
3413,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* @license AngularJS v1.3.16
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, angular, undefined) {
'use strict';
/**
* @ngdoc object
* @name angular.mock
* @description
*
* Namespace from 'angular-mocks.js' which contains testing related code.
*/
angular.mock = {};
/**
* ! This is a private undocumented service !
*
* @name $browser
*
* @description
* This service is a mock implementation of {@link ng.$browser}. It provides fake
* implementation for commonly used browser apis that are hard to test, e.g. setTimeout, xhr,
* cookies, etc...
*
* The api of this service is the same as that of the real {@link ng.$browser $browser}, except
* that there are several helper methods available which can be used in tests.
*/
angular.mock.$BrowserProvider = function() {
this.$get = function() {
return new angular.mock.$Browser();
};
};
angular.mock.$Browser = function() {
var self = this;
this.isMock = true;
self.$$url = "http://server/";
self.$$lastUrl = self.$$url; // used by url polling fn
self.pollFns = [];
// TODO(vojta): remove this temporary api
self.$$completeOutstandingRequest = angular.noop;
self.$$incOutstandingRequestCount = angular.noop;
// register url polling fn
self.onUrlChange = function(listener) {
self.pollFns.push(
function() {
if (self.$$lastUrl !== self.$$url || self.$$state !== self.$$lastState) {
self.$$lastUrl = self.$$url;
self.$$lastState = self.$$state;
listener(self.$$url, self.$$state);
}
}
);
return listener;
};
self.$$checkUrlChange = angular.noop;
self.cookieHash = {};
self.lastCookieHash = {};
self.deferredFns = [];
self.deferredNextId = 0;
self.defer = function(fn, delay) {
delay = delay || 0;
self.deferredFns.push({time:(self.defer.now + delay), fn:fn, id: self.deferredNextId});
self.deferredFns.sort(function(a, b) { return a.time - b.time;});
return self.deferredNextId++;
};
/**
* @name $browser#defer.now
*
* @description
* Current milliseconds mock time.
*/
self.defer.now = 0;
self.defer.cancel = function(deferId) {
var fnIndex;
angular.forEach(self.deferredFns, function(fn, index) {
if (fn.id === deferId) fnIndex = index;
});
if (fnIndex !== undefined) {
self.deferredFns.splice(fnIndex, 1);
return true;
}
return false;
};
/**
* @name $browser#defer.flush
*
* @description
* Flushes all pending requests and executes the defer callbacks.
*
* @param {number=} number of milliseconds to flush. See {@link #defer.now}
*/
self.defer.flush = function(delay) {
if (angular.isDefined(delay)) {
self.defer.now += delay;
} else {
if (self.deferredFns.length) {
self.defer.now = self.deferredFns[self.deferredFns.length - 1].time;
} else {
throw new Error('No deferred tasks to be flushed');
}
}
while (self.deferredFns.length && self.deferredFns[0].time <= self.defer.now) {
self.deferredFns.shift().fn();
}
};
self.$$baseHref = '/';
self.baseHref = function() {
return this.$$baseHref;
};
};
angular.mock.$Browser.prototype = {
/**
* @name $browser#poll
*
* @description
* run all fns in pollFns
*/
poll: function poll() {
angular.forEach(this.pollFns, function(pollFn) {
pollFn();
});
},
addPollFn: function(pollFn) {
this.pollFns.push(pollFn);
return pollFn;
},
url: function(url, replace, state) {
if (angular.isUndefined(state)) {
state = null;
}
if (url) {
this.$$url = url;
// Native pushState serializes & copies the object; simulate it.
this.$$state = angular.copy(state);
return this;
}
return this.$$url;
},
state: function() {
return this.$$state;
},
cookies: function(name, value) {
if (name) {
if (angular.isUndefined(value)) {
delete this.cookieHash[name];
} else {
if (angular.isString(value) && //strings only
value.length <= 4096) { //strict cookie storage limits
this.cookieHash[name] = value;
}
}
} else {
if (!angular.equals(this.cookieHash, this.lastCookieHash)) {
this.lastCookieHash = angular.copy(this.cookieHash);
this.cookieHash = angular.copy(this.cookieHash);
}
return this.cookieHash;
}
},
notifyWhenNoOutstandingRequests: function(fn) {
fn();
}
};
/**
* @ngdoc provider
* @name $exceptionHandlerProvider
*
* @description
* Configures the mock implementation of {@link ng.$exceptionHandler} to rethrow or to log errors
* passed to the `$exceptionHandler`.
*/
/**
* @ngdoc service
* @name $exceptionHandler
*
* @description
* Mock implementation of {@link ng.$exceptionHandler} that rethrows or logs errors passed
* to it. See {@link ngMock.$exceptionHandlerProvider $exceptionHandlerProvider} for configuration
* information.
*
*
* ```js
* describe('$exceptionHandlerProvider', function() {
*
* it('should capture log messages and exceptions', function() {
*
* module(function($exceptionHandlerProvider) {
* $exceptionHandlerProvider.mode('log');
* });
*
* inject(function($log, $exceptionHandler, $timeout) {
* $timeout(function() { $log.log(1); });
* $timeout(function() { $log.log(2); throw 'banana peel'; });
* $timeout(function() { $log.log(3); });
* expect($exceptionHandler.errors).toEqual([]);
* expect($log.assertEmpty());
* $timeout.flush();
* expect($exceptionHandler.errors).toEqual(['banana peel']);
* expect($log.log.logs).toEqual([[1], [2], [3]]);
* });
* });
* });
* ```
*/
angular.mock.$ExceptionHandlerProvider = function() {
var handler;
/**
* @ngdoc method
* @name $exceptionHandlerProvider#mode
*
* @description
* Sets the logging mode.
*
* @param {string} mode Mode of operation, defaults to `rethrow`.
*
* - `log`: Sometimes it is desirable to test that an error is thrown, for this case the `log`
* mode stores an array of errors in `$exceptionHandler.errors`, to allow later
* assertion of them. See {@link ngMock.$log#assertEmpty assertEmpty()} and
* {@link ngMock.$log#reset reset()}
* - `rethrow`: If any errors are passed to the handler in tests, it typically means that there
* is a bug in the application or test, so this mock will make these tests fail.
* For any implementations that expect exceptions to be thrown, the `rethrow` mode
* will also maintain a log of thrown errors.
*/
this.mode = function(mode) {
switch (mode) {
case 'log':
case 'rethrow':
var errors = [];
handler = function(e) {
if (arguments.length == 1) {
errors.push(e);
} else {
errors.push([].slice.call(arguments, 0));
}
if (mode === "rethrow") {
throw e;
}
};
handler.errors = errors;
break;
default:
throw new Error("Unknown mode '" + mode + "', only 'log'/'rethrow' modes are allowed!");
}
};
this.$get = function() {
return handler;
};
this.mode('rethrow');
};
/**
* @ngdoc service
* @name $log
*
* @description
* Mock implementation of {@link ng.$log} that gathers all logged messages in arrays
* (one array per logging level). These arrays are exposed as `logs` property of each of the
* level-specific log function, e.g. for level `error` the array is exposed as `$log.error.logs`.
*
*/
angular.mock.$LogProvider = function() {
var debug = true;
function concat(array1, array2, index) {
return array1.concat(Array.prototype.slice.call(array2, index));
}
this.debugEnabled = function(flag) {
if (angular.isDefined(flag)) {
debug = flag;
return this;
} else {
return debug;
}
};
this.$get = function() {
var $log = {
log: function() { $log.log.logs.push(concat([], arguments, 0)); },
warn: function() { $log.warn.logs.push(concat([], arguments, 0)); },
info: function() { $log.info.logs.push(concat([], arguments, 0)); },
error: function() { $log.error.logs.push(concat([], arguments, 0)); },
debug: function() {
if (debug) {
$log.debug.logs.push(concat([], arguments, 0));
}
}
};
/**
* @ngdoc method
* @name $log#reset
*
* @description
* Reset all of the logging arrays to empty.
*/
$log.reset = function() {
/**
* @ngdoc property
* @name $log#log.logs
*
* @description
* Array of messages logged using {@link ng.$log#log `log()`}.
*
* @example
* ```js
* $log.log('Some Log');
* var first = $log.log.logs.unshift();
* ```
*/
$log.log.logs = [];
/**
* @ngdoc property
* @name $log#info.logs
*
* @description
* Array of messages logged using {@link ng.$log#info `info()`}.
*
* @example
* ```js
* $log.info('Some Info');
* var first = $log.info.logs.unshift();
* ```
*/
$log.info.logs = [];
/**
* @ngdoc property
* @name $log#warn.logs
*
* @description
* Array of messages logged using {@link ng.$log#warn `warn()`}.
*
* @example
* ```js
* $log.warn('Some Warning');
* var first = $log.warn.logs.unshift();
* ```
*/
$log.warn.logs = [];
/**
* @ngdoc property
* @name $log#error.logs
*
* @description
* Array of messages logged using {@link ng.$log#error `error()`}.
*
* @example
* ```js
* $log.error('Some Error');
* var first = $log.error.logs.unshift();
* ```
*/
$log.error.logs = [];
/**
* @ngdoc property
* @name $log#debug.logs
*
* @description
* Array of messages logged using {@link ng.$log#debug `debug()`}.
*
* @example
* ```js
* $log.debug('Some Error');
* var first = $log.debug.logs.unshift();
* ```
*/
$log.debug.logs = [];
};
/**
* @ngdoc method
* @name $log#assertEmpty
*
* @description
* Assert that all of the logging methods have no logged messages. If any messages are present,
* an exception is thrown.
*/
$log.assertEmpty = function() {
var errors = [];
angular.forEach(['error', 'warn', 'info', 'log', 'debug'], function(logLevel) {
angular.forEach($log[logLevel].logs, function(log) {
angular.forEach(log, function(logItem) {
errors.push('MOCK $log (' + logLevel + '): ' + String(logItem) + '\n' +
(logItem.stack || ''));
});
});
});
if (errors.length) {
errors.unshift("Expected $log to be empty! Either a message was logged unexpectedly, or " +
"an expected log message was not checked and removed:");
errors.push('');
throw new Error(errors.join('\n---------\n'));
}
};
$log.reset();
return $log;
};
};
/**
* @ngdoc service
* @name $interval
*
* @description
* Mock implementation of the $interval service.
*
* Use {@link ngMock.$interval#flush `$interval.flush(millis)`} to
* move forward by `millis` milliseconds and trigger any functions scheduled to run in that
* time.
*
* @param {function()} fn A function that should be called repeatedly.
* @param {number} delay Number of milliseconds between each function call.
* @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat
* indefinitely.
* @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise
* will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.
* @returns {promise} A promise which will be notified on each iteration.
*/
angular.mock.$IntervalProvider = function() {
this.$get = ['$browser', '$rootScope', '$q', '$$q',
function($browser, $rootScope, $q, $$q) {
var repeatFns = [],
nextRepeatId = 0,
now = 0;
var $interval = function(fn, delay, count, invokeApply) {
var iteration = 0,
skipApply = (angular.isDefined(invokeApply) && !invokeApply),
deferred = (skipApply ? $$q : $q).defer(),
promise = deferred.promise;
count = (angular.isDefined(count)) ? count : 0;
promise.then(null, null, fn);
promise.$$intervalId = nextRepeatId;
function tick() {
deferred.notify(iteration++);
if (count > 0 && iteration >= count) {
var fnIndex;
deferred.resolve(iteration);
angular.forEach(repeatFns, function(fn, index) {
if (fn.id === promise.$$intervalId) fnIndex = index;
});
if (fnIndex !== undefined) {
repeatFns.splice(fnIndex, 1);
}
}
if (skipApply) {
$browser.defer.flush();
} else {
$rootScope.$apply();
}
}
repeatFns.push({
nextTime:(now + delay),
delay: delay,
fn: tick,
id: nextRepeatId,
deferred: deferred
});
repeatFns.sort(function(a, b) { return a.nextTime - b.nextTime;});
nextRepeatId++;
return promise;
};
/**
* @ngdoc method
* @name $interval#cancel
*
* @description
* Cancels a task associated with the `promise`.
*
* @param {promise} promise A promise from calling the `$interval` function.
* @returns {boolean} Returns `true` if the task was successfully cancelled.
*/
$interval.cancel = function(promise) {
if (!promise) return false;
var fnIndex;
angular.forEach(repeatFns, function(fn, index) {
if (fn.id === promise.$$intervalId) fnIndex = index;
});
if (fnIndex !== undefined) {
repeatFns[fnIndex].deferred.reject('canceled');
repeatFns.splice(fnIndex, 1);
return true;
}
return false;
};
/**
* @ngdoc method
* @name $interval#flush
* @description
*
* Runs interval tasks scheduled to be run in the next `millis` milliseconds.
*
* @param {number=} millis maximum timeout amount to flush up until.
*
* @return {number} The amount of time moved forward.
*/
$interval.flush = function(millis) {
now += millis;
while (repeatFns.length && repeatFns[0].nextTime <= now) {
var task = repeatFns[0];
task.fn();
task.nextTime += task.delay;
repeatFns.sort(function(a, b) { return a.nextTime - b.nextTime;});
}
return millis;
};
return $interval;
}];
};
/* jshint -W101 */
/* The R_ISO8061_STR regex is never going to fit into the 100 char limit!
* This directive should go inside the anonymous function but a bug in JSHint means that it would
* not be enacted early enough to prevent the warning.
*/
var R_ISO8061_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?:\:?(\d\d)(?:\:?(\d\d)(?:\.(\d{3}))?)?)?(Z|([+-])(\d\d):?(\d\d)))?$/;
function jsonStringToDate(string) {
var match;
if (match = string.match(R_ISO8061_STR)) {
var date = new Date(0),
tzHour = 0,
tzMin = 0;
if (match[9]) {
tzHour = int(match[9] + match[10]);
tzMin = int(match[9] + match[11]);
}
date.setUTCFullYear(int(match[1]), int(match[2]) - 1, int(match[3]));
date.setUTCHours(int(match[4] || 0) - tzHour,
int(match[5] || 0) - tzMin,
int(match[6] || 0),
int(match[7] || 0));
return date;
}
return string;
}
function int(str) {
return parseInt(str, 10);
}
function padNumber(num, digits, trim) {
var neg = '';
if (num < 0) {
neg = '-';
num = -num;
}
num = '' + num;
while (num.length < digits) num = '0' + num;
if (trim)
num = num.substr(num.length - digits);
return neg + num;
}
/**
* @ngdoc type
* @name angular.mock.TzDate
* @description
*
* *NOTE*: this is not an injectable instance, just a globally available mock class of `Date`.
*
* Mock of the Date type which has its timezone specified via constructor arg.
*
* The main purpose is to create Date-like instances with timezone fixed to the specified timezone
* offset, so that we can test code that depends on local timezone settings without dependency on
* the time zone settings of the machine where the code is running.
*
* @param {number} offset Offset of the *desired* timezone in hours (fractions will be honored)
* @param {(number|string)} timestamp Timestamp representing the desired time in *UTC*
*
* @example
* !!!! WARNING !!!!!
* This is not a complete Date object so only methods that were implemented can be called safely.
* To make matters worse, TzDate instances inherit stuff from Date via a prototype.
*
* We do our best to intercept calls to "unimplemented" methods, but since the list of methods is
* incomplete we might be missing some non-standard methods. This can result in errors like:
* "Date.prototype.foo called on incompatible Object".
*
* ```js
* var newYearInBratislava = new TzDate(-1, '2009-12-31T23:00:00Z');
* newYearInBratislava.getTimezoneOffset() => -60;
* newYearInBratislava.getFullYear() => 2010;
* newYearInBratislava.getMonth() => 0;
* newYearInBratislava.getDate() => 1;
* newYearInBratislava.getHours() => 0;
* newYearInBratislava.getMinutes() => 0;
* newYearInBratislava.getSeconds() => 0;
* ```
*
*/
angular.mock.TzDate = function(offset, timestamp) {
var self = new Date(0);
if (angular.isString(timestamp)) {
var tsStr = timestamp;
self.origDate = jsonStringToDate(timestamp);
timestamp = self.origDate.getTime();
if (isNaN(timestamp))
throw {
name: "Illegal Argument",
message: "Arg '" + tsStr + "' passed into TzDate constructor is not a valid date string"
};
} else {
self.origDate = new Date(timestamp);
}
var localOffset = new Date(timestamp).getTimezoneOffset();
self.offsetDiff = localOffset * 60 * 1000 - offset * 1000 * 60 * 60;
self.date = new Date(timestamp + self.offsetDiff);
self.getTime = function() {
return self.date.getTime() - self.offsetDiff;
};
self.toLocaleDateString = function() {
return self.date.toLocaleDateString();
};
self.getFullYear = function() {
return self.date.getFullYear();
};
self.getMonth = function() {
return self.date.getMonth();
};
self.getDate = function() {
return self.date.getDate();
};
self.getHours = function() {
return self.date.getHours();
};
self.getMinutes = function() {
return self.date.getMinutes();
};
self.getSeconds = function() {
return self.date.getSeconds();
};
self.getMilliseconds = function() {
return self.date.getMilliseconds();
};
self.getTimezoneOffset = function() {
return offset * 60;
};
self.getUTCFullYear = function() {
return self.origDate.getUTCFullYear();
};
self.getUTCMonth = function() {
return self.origDate.getUTCMonth();
};
self.getUTCDate = function() {
return self.origDate.getUTCDate();
};
self.getUTCHours = function() {
return self.origDate.getUTCHours();
};
self.getUTCMinutes = function() {
return self.origDate.getUTCMinutes();
};
self.getUTCSeconds = function() {
return self.origDate.getUTCSeconds();
};
self.getUTCMilliseconds = function() {
return self.origDate.getUTCMilliseconds();
};
self.getDay = function() {
return self.date.getDay();
};
// provide this method only on browsers that already have it
if (self.toISOString) {
self.toISOString = function() {
return padNumber(self.origDate.getUTCFullYear(), 4) + '-' +
padNumber(self.origDate.getUTCMonth() + 1, 2) + '-' +
padNumber(self.origDate.getUTCDate(), 2) + 'T' +
padNumber(self.origDate.getUTCHours(), 2) + ':' +
padNumber(self.origDate.getUTCMinutes(), 2) + ':' +
padNumber(self.origDate.getUTCSeconds(), 2) + '.' +
padNumber(self.origDate.getUTCMilliseconds(), 3) + 'Z';
};
}
//hide all methods not implemented in this mock that the Date prototype exposes
var unimplementedMethods = ['getUTCDay',
'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds',
'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear',
'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds',
'setYear', 'toDateString', 'toGMTString', 'toJSON', 'toLocaleFormat', 'toLocaleString',
'toLocaleTimeString', 'toSource', 'toString', 'toTimeString', 'toUTCString', 'valueOf'];
angular.forEach(unimplementedMethods, function(methodName) {
self[methodName] = function() {
throw new Error("Method '" + methodName + "' is not implemented in the TzDate mock");
};
});
return self;
};
//make "tzDateInstance instanceof Date" return true
angular.mock.TzDate.prototype = Date.prototype;
/* jshint +W101 */
angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
.config(['$provide', function($provide) {
var reflowQueue = [];
$provide.value('$$animateReflow', function(fn) {
var index = reflowQueue.length;
reflowQueue.push(fn);
return function cancel() {
reflowQueue.splice(index, 1);
};
});
$provide.decorator('$animate', ['$delegate', '$$asyncCallback', '$timeout', '$browser',
function($delegate, $$asyncCallback, $timeout, $browser) {
var animate = {
queue: [],
cancel: $delegate.cancel,
enabled: $delegate.enabled,
triggerCallbackEvents: function() {
$$asyncCallback.flush();
},
triggerCallbackPromise: function() {
$timeout.flush(0);
},
triggerCallbacks: function() {
this.triggerCallbackEvents();
this.triggerCallbackPromise();
},
triggerReflow: function() {
angular.forEach(reflowQueue, function(fn) {
fn();
});
reflowQueue = [];
}
};
angular.forEach(
['animate','enter','leave','move','addClass','removeClass','setClass'], function(method) {
animate[method] = function() {
animate.queue.push({
event: method,
element: arguments[0],
options: arguments[arguments.length - 1],
args: arguments
});
return $delegate[method].apply($delegate, arguments);
};
});
return animate;
}]);
}]);
/**
* @ngdoc function
* @name angular.mock.dump
* @description
*
* *NOTE*: this is not an injectable instance, just a globally available function.
*
* Method for serializing common angular objects (scope, elements, etc..) into strings, useful for
* debugging.
*
* This method is also available on window, where it can be used to display objects on debug
* console.
*
* @param {*} object - any object to turn into string.
* @return {string} a serialized string of the argument
*/
angular.mock.dump = function(object) {
return serialize(object);
function serialize(object) {
var out;
if (angular.isElement(object)) {
object = angular.element(object);
out = angular.element('<div></div>');
angular.forEach(object, function(element) {
out.append(angular.element(element).clone());
});
out = out.html();
} else if (angular.isArray(object)) {
out = [];
angular.forEach(object, function(o) {
out.push(serialize(o));
});
out = '[ ' + out.join(', ') + ' ]';
} else if (angular.isObject(object)) {
if (angular.isFunction(object.$eval) && angular.isFunction(object.$apply)) {
out = serializeScope(object);
} else if (object instanceof Error) {
out = object.stack || ('' + object.name + ': ' + object.message);
} else {
// TODO(i): this prevents methods being logged,
// we should have a better way to serialize objects
out = angular.toJson(object, true);
}
} else {
out = String(object);
}
return out;
}
function serializeScope(scope, offset) {
offset = offset || ' ';
var log = [offset + 'Scope(' + scope.$id + '): {'];
for (var key in scope) {
if (Object.prototype.hasOwnProperty.call(scope, key) && !key.match(/^(\$|this)/)) {
log.push(' ' + key + ': ' + angular.toJson(scope[key]));
}
}
var child = scope.$$childHead;
while (child) {
log.push(serializeScope(child, offset + ' '));
child = child.$$nextSibling;
}
log.push('}');
return log.join('\n' + offset);
}
};
/**
* @ngdoc service
* @name $httpBackend
* @description
* Fake HTTP backend implementation suitable for unit testing applications that use the
* {@link ng.$http $http service}.
*
* *Note*: For fake HTTP backend implementation suitable for end-to-end testing or backend-less
* development please see {@link ngMockE2E.$httpBackend e2e $httpBackend mock}.
*
* During unit testing, we want our unit tests to run quickly and have no external dependencies so
* we don’t want to send [XHR](https://developer.mozilla.org/en/xmlhttprequest) or
* [JSONP](http://en.wikipedia.org/wiki/JSONP) requests to a real server. All we really need is
* to verify whether a certain request has been sent or not, or alternatively just let the
* application make requests, respond with pre-trained responses and assert that the end result is
* what we expect it to be.
*
* This mock implementation can be used to respond with static or dynamic responses via the
* `expect` and `when` apis and their shortcuts (`expectGET`, `whenPOST`, etc).
*
* When an Angular application needs some data from a server, it calls the $http service, which
* sends the request to a real server using $httpBackend service. With dependency injection, it is
* easy to inject $httpBackend mock (which has the same API as $httpBackend) and use it to verify
* the requests and respond with some testing data without sending a request to a real server.
*
* There are two ways to specify what test data should be returned as http responses by the mock
* backend when the code under test makes http requests:
*
* - `$httpBackend.expect` - specifies a request expectation
* - `$httpBackend.when` - specifies a backend definition
*
*
* # Request Expectations vs Backend Definitions
*
* Request expectations provide a way to make assertions about requests made by the application and
* to define responses for those requests. The test will fail if the expected requests are not made
* or they are made in the wrong order.
*
* Backend definitions allow you to define a fake backend for your application which doesn't assert
* if a particular request was made or not, it just returns a trained response if a request is made.
* The test will pass whether or not the request gets made during testing.
*
*
* <table class="table">
* <tr><th width="220px"></th><th>Request expectations</th><th>Backend definitions</th></tr>
* <tr>
* <th>Syntax</th>
* <td>.expect(...).respond(...)</td>
* <td>.when(...).respond(...)</td>
* </tr>
* <tr>
* <th>Typical usage</th>
* <td>strict unit tests</td>
* <td>loose (black-box) unit testing</td>
* </tr>
* <tr>
* <th>Fulfills multiple requests</th>
* <td>NO</td>
* <td>YES</td>
* </tr>
* <tr>
* <th>Order of requests matters</th>
* <td>YES</td>
* <td>NO</td>
* </tr>
* <tr>
* <th>Request required</th>
* <td>YES</td>
* <td>NO</td>
* </tr>
* <tr>
* <th>Response required</th>
* <td>optional (see below)</td>
* <td>YES</td>
* </tr>
* </table>
*
* In cases where both backend definitions and request expectations are specified during unit
* testing, the request expectations are evaluated first.
*
* If a request expectation has no response specified, the algorithm will search your backend
* definitions for an appropriate response.
*
* If a request didn't match any expectation or if the expectation doesn't have the response
* defined, the backend definitions are evaluated in sequential order to see if any of them match
* the request. The response from the first matched definition is returned.
*
*
* # Flushing HTTP requests
*
* The $httpBackend used in production always responds to requests asynchronously. If we preserved
* this behavior in unit testing, we'd have to create async unit tests, which are hard to write,
* to follow and to maintain. But neither can the testing mock respond synchronously; that would
* change the execution of the code under test. For this reason, the mock $httpBackend has a
* `flush()` method, which allows the test to explicitly flush pending requests. This preserves
* the async api of the backend, while allowing the test to execute synchronously.
*
*
* # Unit testing with mock $httpBackend
* The following code shows how to setup and use the mock backend when unit testing a controller.
* First we create the controller under test:
*
```js
// The module code
angular
.module('MyApp', [])
.controller('MyController', MyController);
// The controller code
function MyController($scope, $http) {
var authToken;
$http.get('/auth.py').success(function(data, status, headers) {
authToken = headers('A-Token');
$scope.user = data;
});
$scope.saveMessage = function(message) {
var headers = { 'Authorization': authToken };
$scope.status = 'Saving...';
$http.post('/add-msg.py', message, { headers: headers } ).success(function(response) {
$scope.status = '';
}).error(function() {
$scope.status = 'ERROR!';
});
};
}
```
*
* Now we setup the mock backend and create the test specs:
*
```js
// testing controller
describe('MyController', function() {
var $httpBackend, $rootScope, createController, authRequestHandler;
// Set up the module
beforeEach(module('MyApp'));
beforeEach(inject(function($injector) {
// Set up the mock http service responses
$httpBackend = $injector.get('$httpBackend');
// backend definition common for all tests
authRequestHandler = $httpBackend.when('GET', '/auth.py')
.respond({userId: 'userX'}, {'A-Token': 'xxx'});
// Get hold of a scope (i.e. the root scope)
$rootScope = $injector.get('$rootScope');
// The $controller service is used to create instances of controllers
var $controller = $injector.get('$controller');
createController = function() {
return $controller('MyController', {'$scope' : $rootScope });
};
}));
afterEach(function() {
$httpBackend.verifyNoOutstandingExpectation();
$httpBackend.verifyNoOutstandingRequest();
});
it('should fetch authentication token', function() {
$httpBackend.expectGET('/auth.py');
var controller = createController();
$httpBackend.flush();
});
it('should fail authentication', function() {
// Notice how you can change the response even after it was set
authRequestHandler.respond(401, '');
$httpBackend.expectGET('/auth.py');
var controller = createController();
$httpBackend.flush();
expect($rootScope.status).toBe('Failed...');
});
it('should send msg to server', function() {
var controller = createController();
$httpBackend.flush();
// now you don’t care about the authentication, but
// the controller will still send the request and
// $httpBackend will respond without you having to
// specify the expectation and response for this request
$httpBackend.expectPOST('/add-msg.py', 'message content').respond(201, '');
$rootScope.saveMessage('message content');
expect($rootScope.status).toBe('Saving...');
$httpBackend.flush();
expect($rootScope.status).toBe('');
});
it('should send auth header', function() {
var controller = createController();
$httpBackend.flush();
$httpBackend.expectPOST('/add-msg.py', undefined, function(headers) {
// check if the header was send, if it wasn't the expectation won't
// match the request and the test will fail
return headers['Authorization'] == 'xxx';
}).respond(201, '');
$rootScope.saveMessage('whatever');
$httpBackend.flush();
});
});
```
*/
angular.mock.$HttpBackendProvider = function() {
this.$get = ['$rootScope', '$timeout', createHttpBackendMock];
};
/**
* General factory function for $httpBackend mock.
* Returns instance for unit testing (when no arguments specified):
* - passing through is disabled
* - auto flushing is disabled
*
* Returns instance for e2e testing (when `$delegate` and `$browser` specified):
* - passing through (delegating request to real backend) is enabled
* - auto flushing is enabled
*
* @param {Object=} $delegate Real $httpBackend instance (allow passing through if specified)
* @param {Object=} $browser Auto-flushing enabled if specified
* @return {Object} Instance of $httpBackend mock
*/
function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
var definitions = [],
expectations = [],
responses = [],
responsesPush = angular.bind(responses, responses.push),
copy = angular.copy;
function createResponse(status, data, headers, statusText) {
if (angular.isFunction(status)) return status;
return function() {
return angular.isNumber(status)
? [status, data, headers, statusText]
: [200, status, data, headers];
};
}
// TODO(vojta): change params to: method, url, data, headers, callback
function $httpBackend(method, url, data, callback, headers, timeout, withCredentials) {
var xhr = new MockXhr(),
expectation = expectations[0],
wasExpected = false;
function prettyPrint(data) {
return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp)
? data
: angular.toJson(data);
}
function wrapResponse(wrapped) {
if (!$browser && timeout) {
timeout.then ? timeout.then(handleTimeout) : $timeout(handleTimeout, timeout);
}
return handleResponse;
function handleResponse() {
var response = wrapped.response(method, url, data, headers);
xhr.$$respHeaders = response[2];
callback(copy(response[0]), copy(response[1]), xhr.getAllResponseHeaders(),
copy(response[3] || ''));
}
function handleTimeout() {
for (var i = 0, ii = responses.length; i < ii; i++) {
if (responses[i] === handleResponse) {
responses.splice(i, 1);
callback(-1, undefined, '');
break;
}
}
}
}
if (expectation && expectation.match(method, url)) {
if (!expectation.matchData(data))
throw new Error('Expected ' + expectation + ' with different data\n' +
'EXPECTED: ' + prettyPrint(expectation.data) + '\nGOT: ' + data);
if (!expectation.matchHeaders(headers))
throw new Error('Expected ' + expectation + ' with different headers\n' +
'EXPECTED: ' + prettyPrint(expectation.headers) + '\nGOT: ' +
prettyPrint(headers));
expectations.shift();
if (expectation.response) {
responses.push(wrapResponse(expectation));
return;
}
wasExpected = true;
}
var i = -1, definition;
while ((definition = definitions[++i])) {
if (definition.match(method, url, data, headers || {})) {
if (definition.response) {
// if $browser specified, we do auto flush all requests
($browser ? $browser.defer : responsesPush)(wrapResponse(definition));
} else if (definition.passThrough) {
$delegate(method, url, data, callback, headers, timeout, withCredentials);
} else throw new Error('No response defined !');
return;
}
}
throw wasExpected ?
new Error('No response defined !') :
new Error('Unexpected request: ' + method + ' ' + url + '\n' +
(expectation ? 'Expected ' + expectation : 'No more request expected'));
}
/**
* @ngdoc method
* @name $httpBackend#when
* @description
* Creates a new backend definition.
*
* @param {string} method HTTP method.
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
* data string and returns true if the data is as expected.
* @param {(Object|function(Object))=} headers HTTP headers or function that receives http header
* object and returns true if the headers match the current definition.
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled.
*
* - respond –
* `{function([status,] data[, headers, statusText])
* | function(function(method, url, data, headers)}`
* – The respond method takes a set of static data to be returned or a function that can
* return an array containing response status (number), response data (string), response
* headers (Object), and the text for the status (string). The respond method returns the
* `requestHandler` object for possible overrides.
*/
$httpBackend.when = function(method, url, data, headers) {
var definition = new MockHttpExpectation(method, url, data, headers),
chain = {
respond: function(status, data, headers, statusText) {
definition.passThrough = undefined;
definition.response = createResponse(status, data, headers, statusText);
return chain;
}
};
if ($browser) {
chain.passThrough = function() {
definition.response = undefined;
definition.passThrough = true;
return chain;
};
}
definitions.push(definition);
return chain;
};
/**
* @ngdoc method
* @name $httpBackend#whenGET
* @description
* Creates a new backend definition for GET requests. For more info see `when()`.
*
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled.
*/
/**
* @ngdoc method
* @name $httpBackend#whenHEAD
* @description
* Creates a new backend definition for HEAD requests. For more info see `when()`.
*
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled.
*/
/**
* @ngdoc method
* @name $httpBackend#whenDELETE
* @description
* Creates a new backend definition for DELETE requests. For more info see `when()`.
*
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled.
*/
/**
* @ngdoc method
* @name $httpBackend#whenPOST
* @description
* Creates a new backend definition for POST requests. For more info see `when()`.
*
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
* data string and returns true if the data is as expected.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled.
*/
/**
* @ngdoc method
* @name $httpBackend#whenPUT
* @description
* Creates a new backend definition for PUT requests. For more info see `when()`.
*
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
* data string and returns true if the data is as expected.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled.
*/
/**
* @ngdoc method
* @name $httpBackend#whenJSONP
* @description
* Creates a new backend definition for JSONP requests. For more info see `when()`.
*
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled.
*/
createShortMethods('when');
/**
* @ngdoc method
* @name $httpBackend#expect
* @description
* Creates a new request expectation.
*
* @param {string} method HTTP method.
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that
* receives data string and returns true if the data is as expected, or Object if request body
* is in JSON format.
* @param {(Object|function(Object))=} headers HTTP headers or function that receives http header
* object and returns true if the headers match the current expectation.
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled.
*
* - respond –
* `{function([status,] data[, headers, statusText])
* | function(function(method, url, data, headers)}`
* – The respond method takes a set of static data to be returned or a function that can
* return an array containing response status (number), response data (string), response
* headers (Object), and the text for the status (string). The respond method returns the
* `requestHandler` object for possible overrides.
*/
$httpBackend.expect = function(method, url, data, headers) {
var expectation = new MockHttpExpectation(method, url, data, headers),
chain = {
respond: function(status, data, headers, statusText) {
expectation.response = createResponse(status, data, headers, statusText);
return chain;
}
};
expectations.push(expectation);
return chain;
};
/**
* @ngdoc method
* @name $httpBackend#expectGET
* @description
* Creates a new request expectation for GET requests. For more info see `expect()`.
*
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @param {Object=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled. See #expect for more info.
*/
/**
* @ngdoc method
* @name $httpBackend#expectHEAD
* @description
* Creates a new request expectation for HEAD requests. For more info see `expect()`.
*
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @param {Object=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled.
*/
/**
* @ngdoc method
* @name $httpBackend#expectDELETE
* @description
* Creates a new request expectation for DELETE requests. For more info see `expect()`.
*
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @param {Object=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled.
*/
/**
* @ngdoc method
* @name $httpBackend#expectPOST
* @description
* Creates a new request expectation for POST requests. For more info see `expect()`.
*
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that
* receives data string and returns true if the data is as expected, or Object if request body
* is in JSON format.
* @param {Object=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled.
*/
/**
* @ngdoc method
* @name $httpBackend#expectPUT
* @description
* Creates a new request expectation for PUT requests. For more info see `expect()`.
*
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that
* receives data string and returns true if the data is as expected, or Object if request body
* is in JSON format.
* @param {Object=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled.
*/
/**
* @ngdoc method
* @name $httpBackend#expectPATCH
* @description
* Creates a new request expectation for PATCH requests. For more info see `expect()`.
*
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that
* receives data string and returns true if the data is as expected, or Object if request body
* is in JSON format.
* @param {Object=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled.
*/
/**
* @ngdoc method
* @name $httpBackend#expectJSONP
* @description
* Creates a new request expectation for JSONP requests. For more info see `expect()`.
*
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled.
*/
createShortMethods('expect');
/**
* @ngdoc method
* @name $httpBackend#flush
* @description
* Flushes all pending requests using the trained responses.
*
* @param {number=} count Number of responses to flush (in the order they arrived). If undefined,
* all pending requests will be flushed. If there are no pending requests when the flush method
* is called an exception is thrown (as this typically a sign of programming error).
*/
$httpBackend.flush = function(count, digest) {
if (digest !== false) $rootScope.$digest();
if (!responses.length) throw new Error('No pending request to flush !');
if (angular.isDefined(count) && count !== null) {
while (count--) {
if (!responses.length) throw new Error('No more pending request to flush !');
responses.shift()();
}
} else {
while (responses.length) {
responses.shift()();
}
}
$httpBackend.verifyNoOutstandingExpectation(digest);
};
/**
* @ngdoc method
* @name $httpBackend#verifyNoOutstandingExpectation
* @description
* Verifies that all of the requests defined via the `expect` api were made. If any of the
* requests were not made, verifyNoOutstandingExpectation throws an exception.
*
* Typically, you would call this method following each test case that asserts requests using an
* "afterEach" clause.
*
* ```js
* afterEach($httpBackend.verifyNoOutstandingExpectation);
* ```
*/
$httpBackend.verifyNoOutstandingExpectation = function(digest) {
if (digest !== false) $rootScope.$digest();
if (expectations.length) {
throw new Error('Unsatisfied requests: ' + expectations.join(', '));
}
};
/**
* @ngdoc method
* @name $httpBackend#verifyNoOutstandingRequest
* @description
* Verifies that there are no outstanding requests that need to be flushed.
*
* Typically, you would call this method following each test case that asserts requests using an
* "afterEach" clause.
*
* ```js
* afterEach($httpBackend.verifyNoOutstandingRequest);
* ```
*/
$httpBackend.verifyNoOutstandingRequest = function() {
if (responses.length) {
throw new Error('Unflushed requests: ' + responses.length);
}
};
/**
* @ngdoc method
* @name $httpBackend#resetExpectations
* @description
* Resets all request expectations, but preserves all backend definitions. Typically, you would
* call resetExpectations during a multiple-phase test when you want to reuse the same instance of
* $httpBackend mock.
*/
$httpBackend.resetExpectations = function() {
expectations.length = 0;
responses.length = 0;
};
return $httpBackend;
function createShortMethods(prefix) {
angular.forEach(['GET', 'DELETE', 'JSONP', 'HEAD'], function(method) {
$httpBackend[prefix + method] = function(url, headers) {
return $httpBackend[prefix](method, url, undefined, headers);
};
});
angular.forEach(['PUT', 'POST', 'PATCH'], function(method) {
$httpBackend[prefix + method] = function(url, data, headers) {
return $httpBackend[prefix](method, url, data, headers);
};
});
}
}
function MockHttpExpectation(method, url, data, headers) {
this.data = data;
this.headers = headers;
this.match = function(m, u, d, h) {
if (method != m) return false;
if (!this.matchUrl(u)) return false;
if (angular.isDefined(d) && !this.matchData(d)) return false;
if (angular.isDefined(h) && !this.matchHeaders(h)) return false;
return true;
};
this.matchUrl = function(u) {
if (!url) return true;
if (angular.isFunction(url.test)) return url.test(u);
if (angular.isFunction(url)) return url(u);
return url == u;
};
this.matchHeaders = function(h) {
if (angular.isUndefined(headers)) return true;
if (angular.isFunction(headers)) return headers(h);
return angular.equals(headers, h);
};
this.matchData = function(d) {
if (angular.isUndefined(data)) return true;
if (data && angular.isFunction(data.test)) return data.test(d);
if (data && angular.isFunction(data)) return data(d);
if (data && !angular.isString(data)) {
return angular.equals(angular.fromJson(angular.toJson(data)), angular.fromJson(d));
}
return data == d;
};
this.toString = function() {
return method + ' ' + url;
};
}
function createMockXhr() {
return new MockXhr();
}
function MockXhr() {
// hack for testing $http, $httpBackend
MockXhr.$$lastInstance = this;
this.open = function(method, url, async) {
this.$$method = method;
this.$$url = url;
this.$$async = async;
this.$$reqHeaders = {};
this.$$respHeaders = {};
};
this.send = function(data) {
this.$$data = data;
};
this.setRequestHeader = function(key, value) {
this.$$reqHeaders[key] = value;
};
this.getResponseHeader = function(name) {
// the lookup must be case insensitive,
// that's why we try two quick lookups first and full scan last
var header = this.$$respHeaders[name];
if (header) return header;
name = angular.lowercase(name);
header = this.$$respHeaders[name];
if (header) return header;
header = undefined;
angular.forEach(this.$$respHeaders, function(headerVal, headerName) {
if (!header && angular.lowercase(headerName) == name) header = headerVal;
});
return header;
};
this.getAllResponseHeaders = function() {
var lines = [];
angular.forEach(this.$$respHeaders, function(value, key) {
lines.push(key + ': ' + value);
});
return lines.join('\n');
};
this.abort = angular.noop;
}
/**
* @ngdoc service
* @name $timeout
* @description
*
* This service is just a simple decorator for {@link ng.$timeout $timeout} service
* that adds a "flush" and "verifyNoPendingTasks" methods.
*/
angular.mock.$TimeoutDecorator = ['$delegate', '$browser', function($delegate, $browser) {
/**
* @ngdoc method
* @name $timeout#flush
* @description
*
* Flushes the queue of pending tasks.
*
* @param {number=} delay maximum timeout amount to flush up until
*/
$delegate.flush = function(delay) {
$browser.defer.flush(delay);
};
/**
* @ngdoc method
* @name $timeout#verifyNoPendingTasks
* @description
*
* Verifies that there are no pending tasks that need to be flushed.
*/
$delegate.verifyNoPendingTasks = function() {
if ($browser.deferredFns.length) {
throw new Error('Deferred tasks to flush (' + $browser.deferredFns.length + '): ' +
formatPendingTasksAsString($browser.deferredFns));
}
};
function formatPendingTasksAsString(tasks) {
var result = [];
angular.forEach(tasks, function(task) {
result.push('{id: ' + task.id + ', ' + 'time: ' + task.time + '}');
});
return result.join(', ');
}
return $delegate;
}];
angular.mock.$RAFDecorator = ['$delegate', function($delegate) {
var queue = [];
var rafFn = function(fn) {
var index = queue.length;
queue.push(fn);
return function() {
queue.splice(index, 1);
};
};
rafFn.supported = $delegate.supported;
rafFn.flush = function() {
if (queue.length === 0) {
throw new Error('No rAF callbacks present');
}
var length = queue.length;
for (var i = 0; i < length; i++) {
queue[i]();
}
queue = [];
};
return rafFn;
}];
angular.mock.$AsyncCallbackDecorator = ['$delegate', function($delegate) {
var callbacks = [];
var addFn = function(fn) {
callbacks.push(fn);
};
addFn.flush = function() {
angular.forEach(callbacks, function(fn) {
fn();
});
callbacks = [];
};
return addFn;
}];
/**
*
*/
angular.mock.$RootElementProvider = function() {
this.$get = function() {
return angular.element('<div ng-app></div>');
};
};
/**
* @ngdoc service
* @name $controller
* @description
* A decorator for {@link ng.$controller} with additional `bindings` parameter, useful when testing
* controllers of directives that use {@link $compile#-bindtocontroller- `bindToController`}.
*
*
* ## Example
*
* ```js
*
* // Directive definition ...
*
* myMod.directive('myDirective', {
* controller: 'MyDirectiveController',
* bindToController: {
* name: '@'
* }
* });
*
*
* // Controller definition ...
*
* myMod.controller('MyDirectiveController', ['log', function($log) {
* $log.info(this.name);
* })];
*
*
* // In a test ...
*
* describe('myDirectiveController', function() {
* it('should write the bound name to the log', inject(function($controller, $log) {
* var ctrl = $controller('MyDirective', { /* no locals */ }, { name: 'Clark Kent' });
* expect(ctrl.name).toEqual('Clark Kent');
* expect($log.info.logs).toEqual(['Clark Kent']);
* });
* });
*
* ```
*
* @param {Function|string} constructor If called with a function then it's considered to be the
* controller constructor function. Otherwise it's considered to be a string which is used
* to retrieve the controller constructor using the following steps:
*
* * check if a controller with given name is registered via `$controllerProvider`
* * check if evaluating the string on the current scope returns a constructor
* * if $controllerProvider#allowGlobals, check `window[constructor]` on the global
* `window` object (not recommended)
*
* The string can use the `controller as property` syntax, where the controller instance is published
* as the specified property on the `scope`; the `scope` must be injected into `locals` param for this
* to work correctly.
*
* @param {Object} locals Injection locals for Controller.
* @param {Object=} bindings Properties to add to the controller before invoking the constructor. This is used
* to simulate the `bindToController` feature and simplify certain kinds of tests.
* @return {Object} Instance of given controller.
*/
angular.mock.$ControllerDecorator = ['$delegate', function($delegate) {
return function(expression, locals, later, ident) {
if (later && typeof later === 'object') {
var create = $delegate(expression, locals, true, ident);
angular.extend(create.instance, later);
return create();
}
return $delegate(expression, locals, later, ident);
};
}];
/**
* @ngdoc module
* @name ngMock
* @packageName angular-mocks
* @description
*
* # ngMock
*
* The `ngMock` module provides support to inject and mock Angular services into unit tests.
* In addition, ngMock also extends various core ng services such that they can be
* inspected and controlled in a synchronous manner within test code.
*
*
* <div doc-module-components="ngMock"></div>
*
*/
angular.module('ngMock', ['ng']).provider({
$browser: angular.mock.$BrowserProvider,
$exceptionHandler: angular.mock.$ExceptionHandlerProvider,
$log: angular.mock.$LogProvider,
$interval: angular.mock.$IntervalProvider,
$httpBackend: angular.mock.$HttpBackendProvider,
$rootElement: angular.mock.$RootElementProvider
}).config(['$provide', function($provide) {
$provide.decorator('$timeout', angular.mock.$TimeoutDecorator);
$provide.decorator('$$rAF', angular.mock.$RAFDecorator);
$provide.decorator('$$asyncCallback', angular.mock.$AsyncCallbackDecorator);
$provide.decorator('$rootScope', angular.mock.$RootScopeDecorator);
$provide.decorator('$controller', angular.mock.$ControllerDecorator);
}]);
/**
* @ngdoc module
* @name ngMockE2E
* @module ngMockE2E
* @packageName angular-mocks
* @description
*
* The `ngMockE2E` is an angular module which contains mocks suitable for end-to-end testing.
* Currently there is only one mock present in this module -
* the {@link ngMockE2E.$httpBackend e2e $httpBackend} mock.
*/
angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
$provide.decorator('$httpBackend', angular.mock.e2e.$httpBackendDecorator);
}]);
/**
* @ngdoc service
* @name $httpBackend
* @module ngMockE2E
* @description
* Fake HTTP backend implementation suitable for end-to-end testing or backend-less development of
* applications that use the {@link ng.$http $http service}.
*
* *Note*: For fake http backend implementation suitable for unit testing please see
* {@link ngMock.$httpBackend unit-testing $httpBackend mock}.
*
* This implementation can be used to respond with static or dynamic responses via the `when` api
* and its shortcuts (`whenGET`, `whenPOST`, etc) and optionally pass through requests to the
* real $httpBackend for specific requests (e.g. to interact with certain remote apis or to fetch
* templates from a webserver).
*
* As opposed to unit-testing, in an end-to-end testing scenario or in scenario when an application
* is being developed with the real backend api replaced with a mock, it is often desirable for
* certain category of requests to bypass the mock and issue a real http request (e.g. to fetch
* templates or static files from the webserver). To configure the backend with this behavior
* use the `passThrough` request handler of `when` instead of `respond`.
*
* Additionally, we don't want to manually have to flush mocked out requests like we do during unit
* testing. For this reason the e2e $httpBackend flushes mocked out requests
* automatically, closely simulating the behavior of the XMLHttpRequest object.
*
* To setup the application to run with this http backend, you have to create a module that depends
* on the `ngMockE2E` and your application modules and defines the fake backend:
*
* ```js
* myAppDev = angular.module('myAppDev', ['myApp', 'ngMockE2E']);
* myAppDev.run(function($httpBackend) {
* phones = [{name: 'phone1'}, {name: 'phone2'}];
*
* // returns the current list of phones
* $httpBackend.whenGET('/phones').respond(phones);
*
* // adds a new phone to the phones array
* $httpBackend.whenPOST('/phones').respond(function(method, url, data) {
* var phone = angular.fromJson(data);
* phones.push(phone);
* return [200, phone, {}];
* });
* $httpBackend.whenGET(/^\/templates\//).passThrough();
* //...
* });
* ```
*
* Afterwards, bootstrap your app with this new module.
*/
/**
* @ngdoc method
* @name $httpBackend#when
* @module ngMockE2E
* @description
* Creates a new backend definition.
*
* @param {string} method HTTP method.
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @param {(string|RegExp)=} data HTTP request body.
* @param {(Object|function(Object))=} headers HTTP headers or function that receives http header
* object and returns true if the headers match the current definition.
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
* control how a matched request is handled. You can save this object for later use and invoke
* `respond` or `passThrough` again in order to change how a matched request is handled.
*
* - respond –
* `{function([status,] data[, headers, statusText])
* | function(function(method, url, data, headers)}`
* – The respond method takes a set of static data to be returned or a function that can return
* an array containing response status (number), response data (string), response headers
* (Object), and the text for the status (string).
* - passThrough – `{function()}` – Any request matching a backend definition with
* `passThrough` handler will be passed through to the real backend (an XHR request will be made
* to the server.)
* - Both methods return the `requestHandler` object for possible overrides.
*/
/**
* @ngdoc method
* @name $httpBackend#whenGET
* @module ngMockE2E
* @description
* Creates a new backend definition for GET requests. For more info see `when()`.
*
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
* control how a matched request is handled. You can save this object for later use and invoke
* `respond` or `passThrough` again in order to change how a matched request is handled.
*/
/**
* @ngdoc method
* @name $httpBackend#whenHEAD
* @module ngMockE2E
* @description
* Creates a new backend definition for HEAD requests. For more info see `when()`.
*
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
* control how a matched request is handled. You can save this object for later use and invoke
* `respond` or `passThrough` again in order to change how a matched request is handled.
*/
/**
* @ngdoc method
* @name $httpBackend#whenDELETE
* @module ngMockE2E
* @description
* Creates a new backend definition for DELETE requests. For more info see `when()`.
*
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
* control how a matched request is handled. You can save this object for later use and invoke
* `respond` or `passThrough` again in order to change how a matched request is handled.
*/
/**
* @ngdoc method
* @name $httpBackend#whenPOST
* @module ngMockE2E
* @description
* Creates a new backend definition for POST requests. For more info see `when()`.
*
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @param {(string|RegExp)=} data HTTP request body.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
* control how a matched request is handled. You can save this object for later use and invoke
* `respond` or `passThrough` again in order to change how a matched request is handled.
*/
/**
* @ngdoc method
* @name $httpBackend#whenPUT
* @module ngMockE2E
* @description
* Creates a new backend definition for PUT requests. For more info see `when()`.
*
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @param {(string|RegExp)=} data HTTP request body.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
* control how a matched request is handled. You can save this object for later use and invoke
* `respond` or `passThrough` again in order to change how a matched request is handled.
*/
/**
* @ngdoc method
* @name $httpBackend#whenPATCH
* @module ngMockE2E
* @description
* Creates a new backend definition for PATCH requests. For more info see `when()`.
*
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @param {(string|RegExp)=} data HTTP request body.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
* control how a matched request is handled. You can save this object for later use and invoke
* `respond` or `passThrough` again in order to change how a matched request is handled.
*/
/**
* @ngdoc method
* @name $httpBackend#whenJSONP
* @module ngMockE2E
* @description
* Creates a new backend definition for JSONP requests. For more info see `when()`.
*
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition.
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
* control how a matched request is handled. You can save this object for later use and invoke
* `respond` or `passThrough` again in order to change how a matched request is handled.
*/
angular.mock.e2e = {};
angular.mock.e2e.$httpBackendDecorator =
['$rootScope', '$timeout', '$delegate', '$browser', createHttpBackendMock];
/**
* @ngdoc type
* @name $rootScope.Scope
* @module ngMock
* @description
* {@link ng.$rootScope.Scope Scope} type decorated with helper methods useful for testing. These
* methods are automatically available on any {@link ng.$rootScope.Scope Scope} instance when
* `ngMock` module is loaded.
*
* In addition to all the regular `Scope` methods, the following helper methods are available:
*/
angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
var $rootScopePrototype = Object.getPrototypeOf($delegate);
$rootScopePrototype.$countChildScopes = countChildScopes;
$rootScopePrototype.$countWatchers = countWatchers;
return $delegate;
// ------------------------------------------------------------------------------------------ //
/**
* @ngdoc method
* @name $rootScope.Scope#$countChildScopes
* @module ngMock
* @description
* Counts all the direct and indirect child scopes of the current scope.
*
* The current scope is excluded from the count. The count includes all isolate child scopes.
*
* @returns {number} Total number of child scopes.
*/
function countChildScopes() {
// jshint validthis: true
var count = 0; // exclude the current scope
var pendingChildHeads = [this.$$childHead];
var currentScope;
while (pendingChildHeads.length) {
currentScope = pendingChildHeads.shift();
while (currentScope) {
count += 1;
pendingChildHeads.push(currentScope.$$childHead);
currentScope = currentScope.$$nextSibling;
}
}
return count;
}
/**
* @ngdoc method
* @name $rootScope.Scope#$countWatchers
* @module ngMock
* @description
* Counts all the watchers of direct and indirect child scopes of the current scope.
*
* The watchers of the current scope are included in the count and so are all the watchers of
* isolate child scopes.
*
* @returns {number} Total number of watchers.
*/
function countWatchers() {
// jshint validthis: true
var count = this.$$watchers ? this.$$watchers.length : 0; // include the current scope
var pendingChildHeads = [this.$$childHead];
var currentScope;
while (pendingChildHeads.length) {
currentScope = pendingChildHeads.shift();
while (currentScope) {
count += currentScope.$$watchers ? currentScope.$$watchers.length : 0;
pendingChildHeads.push(currentScope.$$childHead);
currentScope = currentScope.$$nextSibling;
}
}
return count;
}
}];
if (window.jasmine || window.mocha) {
var currentSpec = null,
annotatedFunctions = [],
isSpecRunning = function() {
return !!currentSpec;
};
angular.mock.$$annotate = angular.injector.$$annotate;
angular.injector.$$annotate = function(fn) {
if (typeof fn === 'function' && !fn.$inject) {
annotatedFunctions.push(fn);
}
return angular.mock.$$annotate.apply(this, arguments);
};
(window.beforeEach || window.setup)(function() {
annotatedFunctions = [];
currentSpec = this;
});
(window.afterEach || window.teardown)(function() {
var injector = currentSpec.$injector;
annotatedFunctions.forEach(function(fn) {
delete fn.$inject;
});
angular.forEach(currentSpec.$modules, function(module) {
if (module && module.$$hashKey) {
module.$$hashKey = undefined;
}
});
currentSpec.$injector = null;
currentSpec.$modules = null;
currentSpec = null;
if (injector) {
injector.get('$rootElement').off();
injector.get('$browser').pollFns.length = 0;
}
// clean up jquery's fragment cache
angular.forEach(angular.element.fragments, function(val, key) {
delete angular.element.fragments[key];
});
MockXhr.$$lastInstance = null;
angular.forEach(angular.callbacks, function(val, key) {
delete angular.callbacks[key];
});
angular.callbacks.counter = 0;
});
/**
* @ngdoc function
* @name angular.mock.module
* @description
*
* *NOTE*: This function is also published on window for easy access.<br>
* *NOTE*: This function is declared ONLY WHEN running tests with jasmine or mocha
*
* This function registers a module configuration code. It collects the configuration information
* which will be used when the injector is created by {@link angular.mock.inject inject}.
*
* See {@link angular.mock.inject inject} for usage example
*
* @param {...(string|Function|Object)} fns any number of modules which are represented as string
* aliases or as anonymous module initialization functions. The modules are used to
* configure the injector. The 'ng' and 'ngMock' modules are automatically loaded. If an
* object literal is passed they will be registered as values in the module, the key being
* the module name and the value being what is returned.
*/
window.module = angular.mock.module = function() {
var moduleFns = Array.prototype.slice.call(arguments, 0);
return isSpecRunning() ? workFn() : workFn;
/////////////////////
function workFn() {
if (currentSpec.$injector) {
throw new Error('Injector already created, can not register a module!');
} else {
var modules = currentSpec.$modules || (currentSpec.$modules = []);
angular.forEach(moduleFns, function(module) {
if (angular.isObject(module) && !angular.isArray(module)) {
modules.push(function($provide) {
angular.forEach(module, function(value, key) {
$provide.value(key, value);
});
});
} else {
modules.push(module);
}
});
}
}
};
/**
* @ngdoc function
* @name angular.mock.inject
* @description
*
* *NOTE*: This function is also published on window for easy access.<br>
* *NOTE*: This function is declared ONLY WHEN running tests with jasmine or mocha
*
* The inject function wraps a function into an injectable function. The inject() creates new
* instance of {@link auto.$injector $injector} per test, which is then used for
* resolving references.
*
*
* ## Resolving References (Underscore Wrapping)
* Often, we would like to inject a reference once, in a `beforeEach()` block and reuse this
* in multiple `it()` clauses. To be able to do this we must assign the reference to a variable
* that is declared in the scope of the `describe()` block. Since we would, most likely, want
* the variable to have the same name of the reference we have a problem, since the parameter
* to the `inject()` function would hide the outer variable.
*
* To help with this, the injected parameters can, optionally, be enclosed with underscores.
* These are ignored by the injector when the reference name is resolved.
*
* For example, the parameter `_myService_` would be resolved as the reference `myService`.
* Since it is available in the function body as _myService_, we can then assign it to a variable
* defined in an outer scope.
*
* ```
* // Defined out reference variable outside
* var myService;
*
* // Wrap the parameter in underscores
* beforeEach( inject( function(_myService_){
* myService = _myService_;
* }));
*
* // Use myService in a series of tests.
* it('makes use of myService', function() {
* myService.doStuff();
* });
*
* ```
*
* See also {@link angular.mock.module angular.mock.module}
*
* ## Example
* Example of what a typical jasmine tests looks like with the inject method.
* ```js
*
* angular.module('myApplicationModule', [])
* .value('mode', 'app')
* .value('version', 'v1.0.1');
*
*
* describe('MyApp', function() {
*
* // You need to load modules that you want to test,
* // it loads only the "ng" module by default.
* beforeEach(module('myApplicationModule'));
*
*
* // inject() is used to inject arguments of all given functions
* it('should provide a version', inject(function(mode, version) {
* expect(version).toEqual('v1.0.1');
* expect(mode).toEqual('app');
* }));
*
*
* // The inject and module method can also be used inside of the it or beforeEach
* it('should override a version and test the new version is injected', function() {
* // module() takes functions or strings (module aliases)
* module(function($provide) {
* $provide.value('version', 'overridden'); // override version here
* });
*
* inject(function(version) {
* expect(version).toEqual('overridden');
* });
* });
* });
*
* ```
*
* @param {...Function} fns any number of functions which will be injected using the injector.
*/
var ErrorAddingDeclarationLocationStack = function(e, errorForStack) {
this.message = e.message;
this.name = e.name;
if (e.line) this.line = e.line;
if (e.sourceId) this.sourceId = e.sourceId;
if (e.stack && errorForStack)
this.stack = e.stack + '\n' + errorForStack.stack;
if (e.stackArray) this.stackArray = e.stackArray;
};
ErrorAddingDeclarationLocationStack.prototype.toString = Error.prototype.toString;
window.inject = angular.mock.inject = function() {
var blockFns = Array.prototype.slice.call(arguments, 0);
var errorForStack = new Error('Declaration Location');
return isSpecRunning() ? workFn.call(currentSpec) : workFn;
/////////////////////
function workFn() {
var modules = currentSpec.$modules || [];
var strictDi = !!currentSpec.$injectorStrict;
modules.unshift('ngMock');
modules.unshift('ng');
var injector = currentSpec.$injector;
if (!injector) {
if (strictDi) {
// If strictDi is enabled, annotate the providerInjector blocks
angular.forEach(modules, function(moduleFn) {
if (typeof moduleFn === "function") {
angular.injector.$$annotate(moduleFn);
}
});
}
injector = currentSpec.$injector = angular.injector(modules, strictDi);
currentSpec.$injectorStrict = strictDi;
}
for (var i = 0, ii = blockFns.length; i < ii; i++) {
if (currentSpec.$injectorStrict) {
// If the injector is strict / strictDi, and the spec wants to inject using automatic
// annotation, then annotate the function here.
injector.annotate(blockFns[i]);
}
try {
/* jshint -W040 *//* Jasmine explicitly provides a `this` object when calling functions */
injector.invoke(blockFns[i] || angular.noop, this);
/* jshint +W040 */
} catch (e) {
if (e.stack && errorForStack) {
throw new ErrorAddingDeclarationLocationStack(e, errorForStack);
}
throw e;
} finally {
errorForStack = null;
}
}
}
};
angular.mock.inject.strictDi = function(value) {
value = arguments.length ? !!value : true;
return isSpecRunning() ? workFn() : workFn;
function workFn() {
if (value !== currentSpec.$injectorStrict) {
if (currentSpec.$injector) {
throw new Error('Injector already created, can not modify strict annotations');
} else {
currentSpec.$injectorStrict = value;
}
}
}
};
}
})(window, window.angular);
| DreamInSun/OneRing | xdiamond/bower_components/angular-mocks/angular-mocks.js | JavaScript | apache-2.0 | 82,636 | [
30522,
1013,
1008,
1008,
1008,
1030,
6105,
16108,
22578,
1058,
2487,
1012,
1017,
1012,
2385,
1008,
1006,
1039,
1007,
2230,
1011,
2297,
8224,
1010,
4297,
1012,
8299,
1024,
1013,
1013,
16108,
22578,
1012,
8917,
1008,
6105,
1024,
10210,
1008,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jsonp({"cep":"55034070","logradouro":"Rua Euclides Figueredo","bairro":"Agamenom Magalh\u00e3es","cidade":"Caruaru","uf":"PE","estado":"Pernambuco"});
| lfreneda/cepdb | api/v1/55034070.jsonp.js | JavaScript | cc0-1.0 | 151 | [
30522,
1046,
3385,
2361,
1006,
1063,
1000,
8292,
2361,
1000,
1024,
1000,
13274,
22022,
2692,
19841,
1000,
1010,
1000,
8833,
12173,
8162,
2080,
1000,
1024,
1000,
21766,
2050,
7327,
20464,
8621,
20965,
13094,
26010,
1000,
1010,
1000,
21790,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
FROM ubuntu
ADD a.out /a.out
| ghaering/poc-docker-coredump | Dockerfile | Dockerfile | mit | 30 | [
30522,
2013,
1057,
8569,
3372,
2226,
5587,
1037,
1012,
2041,
1013,
1037,
1012,
2041,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
(function()
{
CKEDITOR.dialog.add( 'pastetext', function( editor )
{
return {
title : editor.lang.pasteText.title,
minWidth : CKEDITOR.env.ie && CKEDITOR.env.quirks ? 368 : 350,
minHeight : 240,
onShow : function(){ this.setupContent(); },
onOk : function(){ this.commitContent(); },
contents :
[
{
label : editor.lang.common.generalTab,
id : 'general',
elements :
[
{
type : 'html',
id : 'pasteMsg',
html : '<div style="white-space:normal;width:340px;">' + editor.lang.clipboard.pasteMsg + '</div>'
},
{
type : 'textarea',
id : 'content',
className : 'cke_pastetext',
onLoad : function()
{
var label = this.getDialog().getContentElement( 'general', 'pasteMsg' ).getElement(),
input = this.getElement().getElementsByTag( 'textarea' ).getItem( 0 );
input.setAttribute( 'aria-labelledby', label.$.id );
input.setStyle( 'direction', editor.config.contentsLangDirection );
},
focus : function()
{
this.getElement().focus();
},
setup : function()
{
this.setValue( '' );
},
commit : function()
{
var value = this.getValue();
setTimeout( function()
{
editor.fire( 'paste', { 'text' : value } );
}, 0 );
}
}
]
}
]
};
});
})();
| taobataoma/saivi | cms/editor/ckeditor/_source/plugins/pastetext/dialogs/pastetext.js | JavaScript | apache-2.0 | 1,694 | [
30522,
1013,
1008,
9385,
1006,
1039,
1007,
2494,
1011,
2286,
1010,
23616,
6499,
3126,
3401,
1011,
15296,
2080,
14161,
7875,
10609,
1012,
2035,
2916,
9235,
1012,
2005,
13202,
1010,
2156,
6105,
1012,
16129,
2030,
8299,
1024,
1013,
1013,
23616... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package aws
import (
"fmt"
"log"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
)
func resourceAwsSubnet() *schema.Resource {
return &schema.Resource{
Create: resourceAwsSubnetCreate,
Read: resourceAwsSubnetRead,
Update: resourceAwsSubnetUpdate,
Delete: resourceAwsSubnetDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(10 * time.Minute),
Delete: schema.DefaultTimeout(10 * time.Minute),
},
SchemaVersion: 1,
MigrateState: resourceAwsSubnetMigrateState,
Schema: map[string]*schema.Schema{
"vpc_id": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"cidr_block": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"ipv6_cidr_block": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"availability_zone": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ConflictsWith: []string{"availability_zone_id"},
},
"availability_zone_id": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ConflictsWith: []string{"availability_zone"},
},
"map_public_ip_on_launch": {
Type: schema.TypeBool,
Optional: true,
Default: false,
},
"assign_ipv6_address_on_creation": {
Type: schema.TypeBool,
Optional: true,
Default: false,
},
"ipv6_cidr_block_association_id": {
Type: schema.TypeString,
Computed: true,
},
"arn": {
Type: schema.TypeString,
Computed: true,
},
"tags": tagsSchema(),
"owner_id": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
func resourceAwsSubnetCreate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).ec2conn
createOpts := &ec2.CreateSubnetInput{
AvailabilityZone: aws.String(d.Get("availability_zone").(string)),
AvailabilityZoneId: aws.String(d.Get("availability_zone_id").(string)),
CidrBlock: aws.String(d.Get("cidr_block").(string)),
VpcId: aws.String(d.Get("vpc_id").(string)),
}
if v, ok := d.GetOk("ipv6_cidr_block"); ok {
createOpts.Ipv6CidrBlock = aws.String(v.(string))
}
var err error
resp, err := conn.CreateSubnet(createOpts)
if err != nil {
return fmt.Errorf("Error creating subnet: %s", err)
}
// Get the ID and store it
subnet := resp.Subnet
d.SetId(*subnet.SubnetId)
log.Printf("[INFO] Subnet ID: %s", *subnet.SubnetId)
// Wait for the Subnet to become available
log.Printf("[DEBUG] Waiting for subnet (%s) to become available", *subnet.SubnetId)
stateConf := &resource.StateChangeConf{
Pending: []string{"pending"},
Target: []string{"available"},
Refresh: SubnetStateRefreshFunc(conn, *subnet.SubnetId),
Timeout: 10 * time.Minute,
}
_, err = stateConf.WaitForState()
if err != nil {
return fmt.Errorf(
"Error waiting for subnet (%s) to become ready: %s",
d.Id(), err)
}
return resourceAwsSubnetUpdate(d, meta)
}
func resourceAwsSubnetRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).ec2conn
resp, err := conn.DescribeSubnets(&ec2.DescribeSubnetsInput{
SubnetIds: []*string{aws.String(d.Id())},
})
if err != nil {
if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidSubnetID.NotFound" {
// Update state to indicate the subnet no longer exists.
d.SetId("")
return nil
}
return err
}
if resp == nil {
return nil
}
subnet := resp.Subnets[0]
d.Set("vpc_id", subnet.VpcId)
d.Set("availability_zone", subnet.AvailabilityZone)
d.Set("availability_zone_id", subnet.AvailabilityZoneId)
d.Set("cidr_block", subnet.CidrBlock)
d.Set("map_public_ip_on_launch", subnet.MapPublicIpOnLaunch)
d.Set("assign_ipv6_address_on_creation", subnet.AssignIpv6AddressOnCreation)
// Make sure those values are set, if an IPv6 block exists it'll be set in the loop
d.Set("ipv6_cidr_block_association_id", "")
d.Set("ipv6_cidr_block", "")
for _, a := range subnet.Ipv6CidrBlockAssociationSet {
if *a.Ipv6CidrBlockState.State == "associated" { //we can only ever have 1 IPv6 block associated at once
d.Set("ipv6_cidr_block_association_id", a.AssociationId)
d.Set("ipv6_cidr_block", a.Ipv6CidrBlock)
break
}
}
d.Set("arn", subnet.SubnetArn)
d.Set("tags", tagsToMap(subnet.Tags))
d.Set("owner_id", subnet.OwnerId)
return nil
}
func resourceAwsSubnetUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).ec2conn
d.Partial(true)
if err := setTags(conn, d); err != nil {
return err
} else {
d.SetPartial("tags")
}
if d.HasChange("map_public_ip_on_launch") {
modifyOpts := &ec2.ModifySubnetAttributeInput{
SubnetId: aws.String(d.Id()),
MapPublicIpOnLaunch: &ec2.AttributeBooleanValue{
Value: aws.Bool(d.Get("map_public_ip_on_launch").(bool)),
},
}
log.Printf("[DEBUG] Subnet modify attributes: %#v", modifyOpts)
_, err := conn.ModifySubnetAttribute(modifyOpts)
if err != nil {
return err
} else {
d.SetPartial("map_public_ip_on_launch")
}
}
// We have to be careful here to not go through a change of association if this is a new resource
// A New resource here would denote that the Update func is called by the Create func
if d.HasChange("ipv6_cidr_block") && !d.IsNewResource() {
// We need to handle that we disassociate the IPv6 CIDR block before we try and associate the new one
// This could be an issue as, we could error out when we try and add the new one
// We may need to roll back the state and reattach the old one if this is the case
_, new := d.GetChange("ipv6_cidr_block")
if v, ok := d.GetOk("ipv6_cidr_block_association_id"); ok {
//Firstly we have to disassociate the old IPv6 CIDR Block
disassociateOps := &ec2.DisassociateSubnetCidrBlockInput{
AssociationId: aws.String(v.(string)),
}
_, err := conn.DisassociateSubnetCidrBlock(disassociateOps)
if err != nil {
return err
}
// Wait for the CIDR to become disassociated
log.Printf(
"[DEBUG] Waiting for IPv6 CIDR (%s) to become disassociated",
d.Id())
stateConf := &resource.StateChangeConf{
Pending: []string{"disassociating", "associated"},
Target: []string{"disassociated"},
Refresh: SubnetIpv6CidrStateRefreshFunc(conn, d.Id(), d.Get("ipv6_cidr_block_association_id").(string)),
Timeout: 3 * time.Minute,
}
if _, err := stateConf.WaitForState(); err != nil {
return fmt.Errorf(
"Error waiting for IPv6 CIDR (%s) to become disassociated: %s",
d.Id(), err)
}
}
//Now we need to try and associate the new CIDR block
associatesOpts := &ec2.AssociateSubnetCidrBlockInput{
SubnetId: aws.String(d.Id()),
Ipv6CidrBlock: aws.String(new.(string)),
}
resp, err := conn.AssociateSubnetCidrBlock(associatesOpts)
if err != nil {
//The big question here is, do we want to try and reassociate the old one??
//If we have a failure here, then we may be in a situation that we have nothing associated
return err
}
// Wait for the CIDR to become associated
log.Printf(
"[DEBUG] Waiting for IPv6 CIDR (%s) to become associated",
d.Id())
stateConf := &resource.StateChangeConf{
Pending: []string{"associating", "disassociated"},
Target: []string{"associated"},
Refresh: SubnetIpv6CidrStateRefreshFunc(conn, d.Id(), *resp.Ipv6CidrBlockAssociation.AssociationId),
Timeout: 3 * time.Minute,
}
if _, err := stateConf.WaitForState(); err != nil {
return fmt.Errorf(
"Error waiting for IPv6 CIDR (%s) to become associated: %s",
d.Id(), err)
}
d.SetPartial("ipv6_cidr_block")
}
if d.HasChange("assign_ipv6_address_on_creation") {
modifyOpts := &ec2.ModifySubnetAttributeInput{
SubnetId: aws.String(d.Id()),
AssignIpv6AddressOnCreation: &ec2.AttributeBooleanValue{
Value: aws.Bool(d.Get("assign_ipv6_address_on_creation").(bool)),
},
}
log.Printf("[DEBUG] Subnet modify attributes: %#v", modifyOpts)
_, err := conn.ModifySubnetAttribute(modifyOpts)
if err != nil {
return err
} else {
d.SetPartial("assign_ipv6_address_on_creation")
}
}
d.Partial(false)
return resourceAwsSubnetRead(d, meta)
}
func resourceAwsSubnetDelete(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).ec2conn
log.Printf("[INFO] Deleting subnet: %s", d.Id())
if err := deleteLingeringLambdaENIs(conn, d, "subnet-id"); err != nil {
return fmt.Errorf("Failed to delete Lambda ENIs: %s", err)
}
req := &ec2.DeleteSubnetInput{
SubnetId: aws.String(d.Id()),
}
wait := resource.StateChangeConf{
Pending: []string{"pending"},
Target: []string{"destroyed"},
Timeout: 10 * time.Minute,
MinTimeout: 1 * time.Second,
Refresh: func() (interface{}, string, error) {
_, err := conn.DeleteSubnet(req)
if err != nil {
if apiErr, ok := err.(awserr.Error); ok {
if apiErr.Code() == "DependencyViolation" {
// There is some pending operation, so just retry
// in a bit.
return 42, "pending", nil
}
if apiErr.Code() == "InvalidSubnetID.NotFound" {
return 42, "destroyed", nil
}
}
return 42, "failure", err
}
return 42, "destroyed", nil
},
}
if _, err := wait.WaitForState(); err != nil {
return fmt.Errorf("Error deleting subnet: %s", err)
}
return nil
}
// SubnetStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch a Subnet.
func SubnetStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc {
return func() (interface{}, string, error) {
resp, err := conn.DescribeSubnets(&ec2.DescribeSubnetsInput{
SubnetIds: []*string{aws.String(id)},
})
if err != nil {
if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidSubnetID.NotFound" {
resp = nil
} else {
log.Printf("Error on SubnetStateRefresh: %s", err)
return nil, "", err
}
}
if resp == nil {
// Sometimes AWS just has consistency issues and doesn't see
// our instance yet. Return an empty state.
return nil, "", nil
}
subnet := resp.Subnets[0]
return subnet, *subnet.State, nil
}
}
func SubnetIpv6CidrStateRefreshFunc(conn *ec2.EC2, id string, associationId string) resource.StateRefreshFunc {
return func() (interface{}, string, error) {
opts := &ec2.DescribeSubnetsInput{
SubnetIds: []*string{aws.String(id)},
}
resp, err := conn.DescribeSubnets(opts)
if err != nil {
if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidSubnetID.NotFound" {
resp = nil
} else {
log.Printf("Error on SubnetIpv6CidrStateRefreshFunc: %s", err)
return nil, "", err
}
}
if resp == nil {
// Sometimes AWS just has consistency issues and doesn't see
// our instance yet. Return an empty state.
return nil, "", nil
}
if resp.Subnets[0].Ipv6CidrBlockAssociationSet == nil {
return nil, "", nil
}
for _, association := range resp.Subnets[0].Ipv6CidrBlockAssociationSet {
if *association.AssociationId == associationId {
return association, *association.Ipv6CidrBlockState.State, nil
}
}
return nil, "", nil
}
}
| youhong316/terraform | vendor/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_subnet.go | GO | mpl-2.0 | 11,481 | [
30522,
7427,
22091,
2015,
12324,
1006,
1000,
4718,
2102,
1000,
1000,
8833,
1000,
1000,
2051,
1000,
1000,
21025,
2705,
12083,
1012,
4012,
1013,
22091,
2015,
1013,
22091,
2015,
1011,
17371,
2243,
1011,
2175,
1013,
22091,
2015,
1000,
1000,
210... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#pragma once
// ------------------------------------------------------------------------------------------------
#include "Base/Shared.hpp"
#include "Base/Vector3.hpp"
#include "Base/Quaternion.hpp"
#include "Base/Color4.hpp"
#include "Base/ScriptSrc.hpp"
// ------------------------------------------------------------------------------------------------
#include <vector>
#include <unordered_map>
// ------------------------------------------------------------------------------------------------
namespace SqMod {
/* ------------------------------------------------------------------------------------------------
* Circular locks employed by the central core.
*/
enum CoreCircularLocks
{
CCL_RELOAD_SCRIPTS = (1u << 0u),
CCL_EMIT_SERVER_OPTION = (1u << 1u)
};
/* ------------------------------------------------------------------------------------------------
* Core module class responsible for managing resources.
*/
class Core
{
private:
// --------------------------------------------------------------------------------------------
static Core s_Inst; // Core instance.
/* --------------------------------------------------------------------------------------------
* Default constructor.
*/
Core() noexcept;
/* --------------------------------------------------------------------------------------------
* Destructor.
*/
~Core();
protected:
// --------------------------------------------------------------------------------------------
typedef std::vector< std::pair< Area *, LightObj > > AreaList; // List of colided areas.
/* --------------------------------------------------------------------------------------------
* Helper structure used to identify a blip entity instance on the server.
*/
struct BlipInst
{
/* ----------------------------------------------------------------------------------------
* Default constructor.
*/
BlipInst() = default;
/* ----------------------------------------------------------------------------------------
* Destructor.
*/
~BlipInst()
{
if (VALID_ENTITY(mID))
{
Destroy(!Core::Get().ShuttingDown(), SQMOD_DESTROY_CLEANUP, NullLightObj());
}
}
/* ----------------------------------------------------------------------------------------
* Destroy the entity instance from the server, if necessary.
*/
void Destroy(bool destroy, Int32 header, LightObj & payload);
/* ----------------------------------------------------------------------------------------
* Reset the instance to the default values.
*/
void ResetInstance();
/* ----------------------------------------------------------------------------------------
* Create the associated signals.
*/
void InitEvents();
/* ----------------------------------------------------------------------------------------
* Clear the associated signals.
*/
void DropEvents();
// ----------------------------------------------------------------------------------------
Int32 mID{-1}; // The unique number that identifies this entity on the server.
Uint32 mFlags{ENF_DEFAULT}; // Various options and states that can be toggled on the instance.
CBlip * mInst{nullptr}; // Pointer to the actual instance used to interact this entity.
LightObj mObj{}; // Script object of the instance used to interact this entity.
// ----------------------------------------------------------------------------------------
Int32 mWorld{-1}; // The identifier of the world in which this blip was created.
Int32 mScale{-1}; // The scale of the blip.
// ----------------------------------------------------------------------------------------
Int32 mSprID{-1};
// ----------------------------------------------------------------------------------------
LightObj mEvents{}; // Table containing the emitted entity events.
// ----------------------------------------------------------------------------------------
Vector3 mPosition{};
Color4 mColor{};
// ----------------------------------------------------------------------------------------
SignalPair mOnDestroyed{};
SignalPair mOnCustom{};
};
/* --------------------------------------------------------------------------------------------
* Helper structure used to identify a checkpoint entity instance on the server.
*/
struct CheckpointInst
{
/* ----------------------------------------------------------------------------------------
* Default constructor.
*/
CheckpointInst() = default;
/* ----------------------------------------------------------------------------------------
* Destructor.
*/
~CheckpointInst()
{
if (VALID_ENTITY(mID))
{
Destroy(!Core::Get().ShuttingDown(), SQMOD_DESTROY_CLEANUP, NullLightObj());
}
}
/* ----------------------------------------------------------------------------------------
* Destroy the entity instance from the server, if necessary.
*/
void Destroy(bool destroy, Int32 header, LightObj & payload);
/* ----------------------------------------------------------------------------------------
* Reset the instance to the default values.
*/
void ResetInstance();
/* ----------------------------------------------------------------------------------------
* Create the associated signals.
*/
void InitEvents();
/* ----------------------------------------------------------------------------------------
* Clear the associated signals.
*/
void DropEvents();
// ----------------------------------------------------------------------------------------
Int32 mID{-1}; // The unique number that identifies this entity on the server.
Uint32 mFlags{ENF_DEFAULT}; // Various options and states that can be toggled on the instance.
CCheckpoint * mInst{nullptr}; // Pointer to the actual instance used to interact this entity.
LightObj mObj{}; // Script object of the instance used to interact this entity.
// ----------------------------------------------------------------------------------------
LightObj mEvents{}; // Table containing the emitted entity events.
// ----------------------------------------------------------------------------------------
SignalPair mOnDestroyed{};
SignalPair mOnCustom{};
#if SQMOD_SDK_LEAST(2, 1)
SignalPair mOnStream{};
#endif
// ----------------------------------------------------------------------------------------
SignalPair mOnEntered{};
SignalPair mOnExited{};
SignalPair mOnWorld{};
SignalPair mOnRadius{};
};
/* --------------------------------------------------------------------------------------------
* Helper structure used to identify a key-bind entity instance on the server.
*/
struct KeybindInst
{
/* ----------------------------------------------------------------------------------------
* Default constructor.
*/
KeybindInst() = default;
/* ----------------------------------------------------------------------------------------
* Destructor.
*/
~KeybindInst()
{
if (VALID_ENTITY(mID))
{
Destroy(!Core::Get().ShuttingDown(), SQMOD_DESTROY_CLEANUP, NullLightObj());
}
}
/* ----------------------------------------------------------------------------------------
* Destroy the entity instance from the server, if necessary.
*/
void Destroy(bool destroy, Int32 header, LightObj & payload);
/* ----------------------------------------------------------------------------------------
* Reset the instance to the default values.
*/
void ResetInstance();
/* ----------------------------------------------------------------------------------------
* Create the associated signals.
*/
void InitEvents();
/* ----------------------------------------------------------------------------------------
* Clear the associated signals.
*/
void DropEvents();
// ----------------------------------------------------------------------------------------
Int32 mID{-1}; // The unique number that identifies this entity on the server.
Uint32 mFlags{ENF_DEFAULT}; // Various options and states that can be toggled on the instance.
CKeybind * mInst{nullptr}; // Pointer to the actual instance used to interact this entity.
LightObj mObj{}; // Script object of the instance used to interact this entity.
// ----------------------------------------------------------------------------------------
Int32 mFirst{-1}; // Key-code of the first button from the triggering combination.
Int32 mSecond{-1}; // Key-code of the second button from the triggering combination.
Int32 mThird{-1}; // Key-code of the third button from the triggering combination.
Int32 mRelease{-1}; // Whether the key-bind reacts to button press or release.
// ----------------------------------------------------------------------------------------
LightObj mEvents{}; // Table containing the emitted entity events.
// ----------------------------------------------------------------------------------------
SignalPair mOnDestroyed{};
SignalPair mOnCustom{};
// ----------------------------------------------------------------------------------------
SignalPair mOnKeyPress{};
SignalPair mOnKeyRelease{};
};
/* --------------------------------------------------------------------------------------------
* Helper structure used to identify an object entity instance on the server.
*/
struct ObjectInst
{
/* ----------------------------------------------------------------------------------------
* Default constructor.
*/
ObjectInst() = default;
/* ----------------------------------------------------------------------------------------
* Destructor.
*/
~ObjectInst()
{
if (VALID_ENTITY(mID))
{
Destroy(!Core::Get().ShuttingDown(), SQMOD_DESTROY_CLEANUP, NullLightObj());
}
}
/* ----------------------------------------------------------------------------------------
* Destroy the entity instance from the server, if necessary.
*/
void Destroy(bool destroy, Int32 header, LightObj & payload);
/* ----------------------------------------------------------------------------------------
* Reset the instance to the default values.
*/
void ResetInstance();
/* ----------------------------------------------------------------------------------------
* Create the associated signals.
*/
void InitEvents();
/* ----------------------------------------------------------------------------------------
* Clear the associated signals.
*/
void DropEvents();
// ----------------------------------------------------------------------------------------
Int32 mID{-1}; // The unique number that identifies this entity on the server.
Uint32 mFlags{ENF_DEFAULT}; // Various options and states that can be toggled on the instance.
CObject * mInst{nullptr}; // Pointer to the actual instance used to interact this entity.
LightObj mObj{}; // Script object of the instance used to interact this entity.
// ----------------------------------------------------------------------------------------
LightObj mEvents{}; // Table containing the emitted entity events.
// ----------------------------------------------------------------------------------------
SignalPair mOnDestroyed{};
SignalPair mOnCustom{};
#if SQMOD_SDK_LEAST(2, 1)
SignalPair mOnStream{};
#endif
// ----------------------------------------------------------------------------------------
SignalPair mOnShot{};
SignalPair mOnTouched{};
SignalPair mOnWorld{};
SignalPair mOnAlpha{};
SignalPair mOnReport{};
};
/* --------------------------------------------------------------------------------------------
* Helper structure used to identify a pickup entity instance on the server.
*/
struct PickupInst
{
/* ----------------------------------------------------------------------------------------
* Default constructor.
*/
PickupInst() = default;
/* ----------------------------------------------------------------------------------------
* Destructor.
*/
~PickupInst()
{
if (VALID_ENTITY(mID))
{
Destroy(!Core::Get().ShuttingDown(), SQMOD_DESTROY_CLEANUP, NullLightObj());
}
}
/* ----------------------------------------------------------------------------------------
* Destroy the entity instance from the server, if necessary.
*/
void Destroy(bool destroy, Int32 header, LightObj & payload);
/* ----------------------------------------------------------------------------------------
* Reset the instance to the default values.
*/
void ResetInstance();
/* ----------------------------------------------------------------------------------------
* Create the associated signals.
*/
void InitEvents();
/* ----------------------------------------------------------------------------------------
* Clear the associated signals.
*/
void DropEvents();
// ----------------------------------------------------------------------------------------
Int32 mID{-1}; // The unique number that identifies this entity on the server.
Uint32 mFlags{ENF_DEFAULT}; // Various options and states that can be toggled on the instance.
CPickup * mInst{nullptr}; // Pointer to the actual instance used to interact this entity.
LightObj mObj{}; // Script object of the instance used to interact this entity.
// ----------------------------------------------------------------------------------------
LightObj mEvents{}; // Table containing the emitted entity events.
// ----------------------------------------------------------------------------------------
SignalPair mOnDestroyed{};
SignalPair mOnCustom{};
#if SQMOD_SDK_LEAST(2, 1)
SignalPair mOnStream{};
#endif
// ----------------------------------------------------------------------------------------
SignalPair mOnRespawn{};
SignalPair mOnClaimed{};
SignalPair mOnCollected{};
SignalPair mOnWorld{};
SignalPair mOnAlpha{};
SignalPair mOnAutomatic{};
SignalPair mOnAutoTimer{};
SignalPair mOnOption{};
};
/* --------------------------------------------------------------------------------------------
* Helper structure used to identify a player entity instance on the server.
*/
struct PlayerInst
{
/* ----------------------------------------------------------------------------------------
* Default constructor.
*/
PlayerInst() = default;
/* ----------------------------------------------------------------------------------------
* Destructor.
*/
~PlayerInst()
{
if (VALID_ENTITY(mID))
{
Destroy(false, SQMOD_DESTROY_CLEANUP, NullLightObj());
}
}
/* ----------------------------------------------------------------------------------------
* Destroy the entity instance from the server, if necessary.
*/
void Destroy(bool destroy, Int32 header, LightObj & payload);
/* ----------------------------------------------------------------------------------------
* Reset the instance to the default values.
*/
void ResetInstance();
/* ----------------------------------------------------------------------------------------
* Create the associated signals.
*/
void InitEvents();
/* ----------------------------------------------------------------------------------------
* Clear the associated signals.
*/
void DropEvents();
// ----------------------------------------------------------------------------------------
Int32 mID{-1}; // The unique number that identifies this entity on the server.
Uint32 mFlags{ENF_DEFAULT}; // Various options and states that can be toggled on the instance.
CPlayer * mInst{nullptr}; // Pointer to the actual instance used to interact this entity.
LightObj mObj{}; // Script object of the instance used to interact this entity.
// ----------------------------------------------------------------------------------------
AreaList mAreas{}; // Areas the player is currently in.
Float64 mDistance{0}; // Distance traveled while tracking was enabled.
// ----------------------------------------------------------------------------------------
SQInteger mTrackPosition{0}; // The number of times to track position changes.
SQInteger mTrackHeading{0}; // The number of times to track heading changes.
// ----------------------------------------------------------------------------------------
Int32 mTrackPositionHeader{0}; // Header to send when triggering position callback.
LightObj mTrackPositionPayload{}; // Payload to send when triggering position callback.
// ----------------------------------------------------------------------------------------
Int32 mKickBanHeader{0}; // Header to send when triggering kick/ban callback.
LightObj mKickBanPayload{}; // Payload to send when triggering kick/ban callback.
// ----------------------------------------------------------------------------------------
Int32 mLastWeapon{-1}; // Last known weapon of the player entity.
Float32 mLastHealth{0}; // Last known health of the player entity.
Float32 mLastArmour{0}; // Last known armor of the player entity.
Float32 mLastHeading{0}; // Last known heading of the player entity.
Vector3 mLastPosition{}; // Last known position of the player entity.
// ----------------------------------------------------------------------------------------
Int32 mAuthority{0}; // The authority level of the managed player.
// ----------------------------------------------------------------------------------------
LightObj mEvents{}; // Table containing the emitted entity events.
// ----------------------------------------------------------------------------------------
SignalPair mOnDestroyed{};
SignalPair mOnCustom{};
#if SQMOD_SDK_LEAST(2, 1)
SignalPair mOnStream{};
#endif
// ----------------------------------------------------------------------------------------
SignalPair mOnRequestClass{};
SignalPair mOnRequestSpawn{};
SignalPair mOnSpawn{};
SignalPair mOnWasted{};
SignalPair mOnKilled{};
SignalPair mOnEmbarking{};
SignalPair mOnEmbarked{};
SignalPair mOnDisembark{};
SignalPair mOnRename{};
SignalPair mOnState{};
SignalPair mOnStateNone{};
SignalPair mOnStateNormal{};
SignalPair mOnStateAim{};
SignalPair mOnStateDriver{};
SignalPair mOnStatePassenger{};
SignalPair mOnStateEnterDriver{};
SignalPair mOnStateEnterPassenger{};
SignalPair mOnStateExit{};
SignalPair mOnStateUnspawned{};
SignalPair mOnAction{};
SignalPair mOnActionNone{};
SignalPair mOnActionNormal{};
SignalPair mOnActionAiming{};
SignalPair mOnActionShooting{};
SignalPair mOnActionJumping{};
SignalPair mOnActionLieDown{};
SignalPair mOnActionGettingUp{};
SignalPair mOnActionJumpVehicle{};
SignalPair mOnActionDriving{};
SignalPair mOnActionDying{};
SignalPair mOnActionWasted{};
SignalPair mOnActionEmbarking{};
SignalPair mOnActionDisembarking{};
SignalPair mOnBurning{};
SignalPair mOnCrouching{};
SignalPair mOnGameKeys{};
SignalPair mOnStartTyping{};
SignalPair mOnStopTyping{};
SignalPair mOnAway{};
SignalPair mOnMessage{};
SignalPair mOnCommand{};
SignalPair mOnPrivateMessage{};
SignalPair mOnKeyPress{};
SignalPair mOnKeyRelease{};
SignalPair mOnSpectate{};
SignalPair mOnUnspectate{};
SignalPair mOnCrashreport{};
SignalPair mOnModuleList{};
SignalPair mOnObjectShot{};
SignalPair mOnObjectTouched{};
SignalPair mOnPickupClaimed{};
SignalPair mOnPickupCollected{};
SignalPair mOnCheckpointEntered{};
SignalPair mOnCheckpointExited{};
SignalPair mOnClientScriptData{};
#if SQMOD_SDK_LEAST(2, 1)
SignalPair mOnEntityStream{};
#endif
SignalPair mOnUpdate{};
SignalPair mOnHealth{};
SignalPair mOnArmour{};
SignalPair mOnWeapon{};
SignalPair mOnHeading{};
SignalPair mOnPosition{};
SignalPair mOnOption{};
SignalPair mOnAdmin{};
SignalPair mOnWorld{};
SignalPair mOnTeam{};
SignalPair mOnSkin{};
SignalPair mOnMoney{};
SignalPair mOnScore{};
SignalPair mOnWantedLevel{};
SignalPair mOnImmunity{};
SignalPair mOnAlpha{};
SignalPair mOnEnterArea{};
SignalPair mOnLeaveArea{};
};
/* --------------------------------------------------------------------------------------------
* Helper structure used to identify a vehicle entity instance on the server.
*/
struct VehicleInst
{
/* ----------------------------------------------------------------------------------------
* Default constructor.
*/
VehicleInst() = default;
/* ----------------------------------------------------------------------------------------
* Destructor.
*/
~VehicleInst()
{
if (VALID_ENTITY(mID))
{
Destroy(!Core::Get().ShuttingDown(), SQMOD_DESTROY_CLEANUP, NullLightObj());
}
}
/* ----------------------------------------------------------------------------------------
* Destroy the entity instance from the server, if necessary.
*/
void Destroy(bool destroy, Int32 header, LightObj & payload);
/* ----------------------------------------------------------------------------------------
* Reset the instance to the default values.
*/
void ResetInstance();
/* ----------------------------------------------------------------------------------------
* Create the associated signals.
*/
void InitEvents();
/* ----------------------------------------------------------------------------------------
* Clear the associated signals.
*/
void DropEvents();
// ----------------------------------------------------------------------------------------
Int32 mID{-1}; // The unique number that identifies this entity on the server.
Uint32 mFlags{ENF_DEFAULT}; // Various options and states that can be toggled on the instance.
CVehicle * mInst{nullptr}; // Pointer to the actual instance used to interact this entity.
LightObj mObj{}; // Script object of the instance used to interact this entity.
// ----------------------------------------------------------------------------------------
AreaList mAreas{}; // Areas the vehicle is currently in.
Float64 mDistance{0}; // Distance traveled while tracking was enabled.
// ----------------------------------------------------------------------------------------
SQInteger mTrackPosition{0}; // The number of times to track position changes.
SQInteger mTrackRotation{0}; // The number of times to track rotation changes.
// ----------------------------------------------------------------------------------------
Int32 mLastPrimaryColor{-1}; // Last known secondary-color of the player entity.
Int32 mLastSecondaryColor{-1}; // Last known primary-color of the player entity.
Float32 mLastHealth{0}; // Last known health of the player entity.
Vector3 mLastPosition{}; // Last known position of the player entity.
Quaternion mLastRotation{}; // Last known rotation of the player entity.
// ----------------------------------------------------------------------------------------
LightObj mEvents{}; // Table containing the emitted entity events.
// ----------------------------------------------------------------------------------------
SignalPair mOnDestroyed{};
SignalPair mOnCustom{};
#if SQMOD_SDK_LEAST(2, 1)
SignalPair mOnStream{};
#endif
// ----------------------------------------------------------------------------------------
SignalPair mOnEmbarking{};
SignalPair mOnEmbarked{};
SignalPair mOnDisembark{};
SignalPair mOnExplode{};
SignalPair mOnRespawn{};
SignalPair mOnUpdate{};
SignalPair mOnColor{};
SignalPair mOnHealth{};
SignalPair mOnPosition{};
SignalPair mOnRotation{};
SignalPair mOnOption{};
SignalPair mOnWorld{};
SignalPair mOnImmunity{};
SignalPair mOnPartStatus{};
SignalPair mOnTyreStatus{};
SignalPair mOnDamageData{};
SignalPair mOnRadio{};
SignalPair mOnHandlingRule{};
SignalPair mOnEnterArea{};
SignalPair mOnLeaveArea{};
};
public:
// --------------------------------------------------------------------------------------------
typedef std::vector< BlipInst > Blips; // Blips entity instances container.
typedef std::vector< CheckpointInst > Checkpoints; // Checkpoints entity instances container.
typedef std::vector< KeybindInst > Keybinds; // Key-binds entity instances container.
typedef std::vector< ObjectInst > Objects; // Objects entity instances container.
typedef std::vector< PickupInst > Pickups; // Pickups entity instances container.
typedef std::vector< PlayerInst > Players; // Players entity instances container.
typedef std::vector< VehicleInst > Vehicles; // Vehicles entity instances container.
// --------------------------------------------------------------------------------------------
typedef std::vector< ScriptSrc > Scripts; // List of loaded scripts.
// --------------------------------------------------------------------------------------------
typedef std::unordered_map< String, String > Options; // List of custom options.
private:
// --------------------------------------------------------------------------------------------
Int32 m_State; // Current plug-in state.
HSQUIRRELVM m_VM; // Script virtual machine.
Scripts m_Scripts; // Loaded scripts objects.
Scripts m_PendingScripts; // Pending scripts objects.
Options m_Options; // Custom configuration options.
// --------------------------------------------------------------------------------------------
Blips m_Blips; // Blips pool.
Checkpoints m_Checkpoints; // Checkpoints pool.
Keybinds m_Keybinds; // Key-binds pool.
Objects m_Objects; // Objects pool.
Pickups m_Pickups; // Pickups pool.
Players m_Players; // Players pool.
Vehicles m_Vehicles; // Vehicles pool.
// --------------------------------------------------------------------------------------------
LightObj m_Events; // Table containing the emitted module events.
// --------------------------------------------------------------------------------------------
Uint32 m_CircularLocks; // Prevent events from triggering themselves.
// --------------------------------------------------------------------------------------------
Int32 m_ReloadHeader; // The specified reload header.
LightObj m_ReloadPayload; // The specified reload payload.
// --------------------------------------------------------------------------------------------
CStr m_IncomingNameBuffer; // Name of an incoming connection.
size_t m_IncomingNameCapacity; // Incoming connection name size.
// --------------------------------------------------------------------------------------------
bool m_AreasEnabled; // Whether area tracking is enabled.
bool m_Debugging; // Enable debugging features, if any.
bool m_Executed; // Whether the scripts were executed.
bool m_Shutdown; // Whether the server currently shutting down.
bool m_LockPreLoadSignal; // Lock pre load signal container.
bool m_LockPostLoadSignal; // Lock post load signal container.
bool m_LockUnloadSignal; // Lock unload signal container.
bool m_EmptyInit; // Whether to initialize without any scripts.
// --------------------------------------------------------------------------------------------
Int32 m_Verbosity; // Restrict the amount of outputted information.
// --------------------------------------------------------------------------------------------
LightObj m_NullBlip; // Null Blips instance.
LightObj m_NullCheckpoint; // Null Checkpoints instance.
LightObj m_NullKeybind; // Null Key-instance pool.
LightObj m_NullObject; // Null Objects instance.
LightObj m_NullPickup; // Null Pickups instance.
LightObj m_NullPlayer; // Null Players instance.
LightObj m_NullVehicle; // Null Vehicles instance.
public:
/* --------------------------------------------------------------------------------------------
* Copy constructor. (disabled)
*/
Core(const Core & o) = delete;
/* --------------------------------------------------------------------------------------------
* Move constructor. (disabled)
*/
Core(Core && o) = delete;
/* --------------------------------------------------------------------------------------------
* Copy assignment operator. (disabled)
*/
Core & operator = (const Core & o) = delete;
/* --------------------------------------------------------------------------------------------
* Move assignment operator. (disabled)
*/
Core & operator = (Core && o) = delete;
/* --------------------------------------------------------------------------------------------
* Retrieve the core instance.
*/
static Core & Get()
{
return s_Inst;
}
/* --------------------------------------------------------------------------------------------
* Initialize the plug-in core.
*/
bool Initialize();
/* --------------------------------------------------------------------------------------------
* Load and execute plug-in resources.
*/
bool Execute();
/* --------------------------------------------------------------------------------------------
* Terminate the plug-in core.
*/
void Terminate(bool shutdown = false);
/* --------------------------------------------------------------------------------------------
* Reload the plug-in core.
*/
bool Reload();
/* --------------------------------------------------------------------------------------------
* Create the null instances of entity classes. Thus, locking them from further changes.
*/
void EnableNullEntities();
/* --------------------------------------------------------------------------------------------
* Modify the current plug-in state.
*/
void SetState(Int32 val)
{
m_State = val;
}
/* --------------------------------------------------------------------------------------------
* Retrieve the current plug-in state.
*/
Int32 GetState() const
{
return m_State;
}
/* --------------------------------------------------------------------------------------------
* See whether debugging option was enabled in the plug-in.
*/
bool IsDebugging() const
{
return m_Debugging;
}
/* --------------------------------------------------------------------------------------------
* See whether all queued scripts were executed and the plug-in fully started.
*/
bool IsExecuted() const
{
return m_Executed;
}
/* --------------------------------------------------------------------------------------------
* See whether the server is currently in the process of shutting down.
*/
bool ShuttingDown() const
{
return m_Shutdown;
}
/* --------------------------------------------------------------------------------------------
* See whether area tracking should be enabled on newlly created entities.
*/
bool AreasEnabled() const
{
return m_AreasEnabled;
}
/* --------------------------------------------------------------------------------------------
* Toggle whether area tracking should be enabled on newlly created entities.
*/
void AreasEnabled(bool toggle)
{
m_AreasEnabled = toggle;
}
/* --------------------------------------------------------------------------------------------
* Retrieve the value of the specified option.
*/
const String & GetOption(const String & name) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the value of the specified option or the fall back value if it doesn't exist.
*/
const String & GetOption(const String & name, const String & value) const;
/* --------------------------------------------------------------------------------------------
* Modify the value of the specified option.
*/
void SetOption(const String & name, const String & value);
/* --------------------------------------------------------------------------------------------
* Retrieve the script source associated with a certain path in the scripts list.
*/
Scripts::iterator FindScript(CSStr src);
/* --------------------------------------------------------------------------------------------
* Retrieve the script source associated with a certain path in the pending scripts list.
*/
Scripts::iterator FindPendingScript(CSStr src);
/* --------------------------------------------------------------------------------------------
* Retrieve the scripts list. Should not be modified directly! Information purposes only.
*/
Scripts & GetScripts()
{
return m_Scripts;
}
/* --------------------------------------------------------------------------------------------
* Retrieve the pending scripts list. Should not be modified directly! Information purposes only.
*/
Scripts & GetPendingScripts()
{
return m_PendingScripts;
}
/* --------------------------------------------------------------------------------------------
* Retrieve the virtual machine.
*/
HSQUIRRELVM GetVM() const
{
return m_VM;
}
/* --------------------------------------------------------------------------------------------
* Retrieve the global events table.
*/
LightObj & GetEvents()
{
return m_Events;
}
/* --------------------------------------------------------------------------------------------
* Retrieve the circular locks.
*/
Uint32 & GetCircularLock()
{
return m_CircularLocks;
}
/* --------------------------------------------------------------------------------------------
* Retrieve the preload signal if not complete.
*/
LightObj & GetPreLoadEvent()
{
return m_LockPreLoadSignal ? NullLightObj() : mOnPreLoad.second;
}
/* --------------------------------------------------------------------------------------------
* Retrieve the postload signal if not complete.
*/
LightObj & GetPostLoadEvent()
{
return m_LockPostLoadSignal ? NullLightObj() : mOnPostLoad.second;
}
/* --------------------------------------------------------------------------------------------
* Retrieve the unload signal if not complete.
*/
LightObj & GetUnloadEvent()
{
return m_LockUnloadSignal ? NullLightObj() : mOnUnload.second;
}
/* --------------------------------------------------------------------------------------------
* See if certain circular locks are enabled.
*/
bool IsCircularLock(Uint32 lock) const
{
return static_cast< bool >(m_CircularLocks & lock);
}
/* --------------------------------------------------------------------------------------------
* Set the header and payload for the reload.
*/
void SetReloadInfo(Int32 header, LightObj & payload)
{
m_ReloadHeader = header;
m_ReloadPayload = payload;
}
/* --------------------------------------------------------------------------------------------
* Reset the header and payload for the reload.
*/
void ResetReloadInfo()
{
m_ReloadHeader = -1;
m_ReloadPayload.Release();
}
/* --------------------------------------------------------------------------------------------
* Retrieve the specified reload header.
*/
Int32 GetReloadHeader() const
{
return m_ReloadHeader;
}
/* --------------------------------------------------------------------------------------------
* Retrieve the specified reload header.
*/
LightObj & GetReloadPayload()
{
return m_ReloadPayload;
}
/* --------------------------------------------------------------------------------------------
* Adds a script to the load queue.
*/
bool LoadScript(CSStr filepath, bool delay);
/* --------------------------------------------------------------------------------------------
* Modify the name for the currently assigned incoming connection.
*/
void SetIncomingName(CSStr name);
/* --------------------------------------------------------------------------------------------
* Retrieve the name for the currently assigned incoming connection.
*/
CSStr GetIncomingName()
{
return (!m_IncomingNameBuffer) ? _SC("") : m_IncomingNameBuffer;
}
/* --------------------------------------------------------------------------------------------
* Retrieves a line of code from a certain source.
*/
String FetchCodeLine(CSStr src, SQInteger line, bool trim = true);
protected:
/* --------------------------------------------------------------------------------------------
* Script execution process.
*/
static bool DoScripts(Scripts::iterator itr, Scripts::iterator end);
/* --------------------------------------------------------------------------------------------
* Script output handlers.
*/
static void PrintFunc(HSQUIRRELVM vm, CSStr msg, ...);
static void ErrorFunc(HSQUIRRELVM vm, CSStr msg, ...);
/* --------------------------------------------------------------------------------------------
* Script error handlers.
*/
static SQInteger RuntimeErrorHandler(HSQUIRRELVM vm);
static void CompilerErrorHandler(HSQUIRRELVM vm, CSStr desc, CSStr src,
SQInteger line, SQInteger column);
bool CompilerErrorHandlerEx(CSStr desc, CSStr src, SQInteger line, SQInteger column);
/* --------------------------------------------------------------------------------------------
* Entity scanners.
*/
void ImportBlips();
void ImportCheckpoints();
void ImportKeybinds();
void ImportObjects();
void ImportPickups();
void ImportPlayers();
void ImportVehicles();
/* --------------------------------------------------------------------------------------------
* Entity allocators.
*/
BlipInst & AllocBlip(Int32 id, bool owned, Int32 header, LightObj & payload);
CheckpointInst & AllocCheckpoint(Int32 id, bool owned, Int32 header, LightObj & payload);
KeybindInst & AllocKeybind(Int32 id, bool owned, Int32 header, LightObj & payload);
ObjectInst & AllocObject(Int32 id, bool owned, Int32 header, LightObj & payload);
PickupInst & AllocPickup(Int32 id, bool owned, Int32 header, LightObj & payload);
VehicleInst & AllocVehicle(Int32 id, bool owned, Int32 header, LightObj & payload);
/* --------------------------------------------------------------------------------------------
* Entity deallocator.
*/
void DeallocBlip(Int32 id, bool destroy, Int32 header, LightObj & payload);
void DeallocCheckpoint(Int32 id, bool destroy, Int32 header, LightObj & payload);
void DeallocKeybind(Int32 id, bool destroy, Int32 header, LightObj & payload);
void DeallocObject(Int32 id, bool destroy, Int32 header, LightObj & payload);
void DeallocPickup(Int32 id, bool destroy, Int32 header, LightObj & payload);
void DeallocVehicle(Int32 id, bool destroy, Int32 header, LightObj & payload);
public:
/* --------------------------------------------------------------------------------------------
* Entity creators.
*/
LightObj & NewBlip(Int32 index, Int32 world, Float32 x, Float32 y, Float32 z,
Int32 scale, Uint32 color, Int32 sprid,
Int32 header, LightObj & payload);
LightObj & NewCheckpoint(Int32 player, Int32 world, bool sphere, Float32 x, Float32 y, Float32 z,
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Float32 radius,
Int32 header, LightObj & payload);
LightObj & NewKeybind(Int32 slot, bool release,
Int32 primary, Int32 secondary, Int32 alternative,
Int32 header, LightObj & payload);
LightObj & NewObject(Int32 model, Int32 world, Float32 x, Float32 y, Float32 z,
Int32 alpha, Int32 header, LightObj & payload);
LightObj & NewPickup(Int32 model, Int32 world, Int32 quantity,
Float32 x, Float32 y, Float32 z, Int32 alpha, bool automatic,
Int32 header, LightObj & payload);
LightObj & NewVehicle(Int32 model, Int32 world, Float32 x, Float32 y, Float32 z,
Float32 angle, Int32 primary, Int32 secondary,
Int32 header, LightObj & payload);
/* --------------------------------------------------------------------------------------------
* Entity destroyers.
*/
bool DelBlip(Int32 id, Int32 header, LightObj & payload);
bool DelCheckpoint(Int32 id, Int32 header, LightObj & payload);
bool DelKeybind(Int32 id, Int32 header, LightObj & payload);
bool DelObject(Int32 id, Int32 header, LightObj & payload);
bool DelPickup(Int32 id, Int32 header, LightObj & payload);
bool DelVehicle(Int32 id, Int32 header, LightObj & payload);
/* --------------------------------------------------------------------------------------------
* Entity retrievers.
*/
BlipInst & GetBlip(Int32 id) { return m_Blips.at(static_cast< size_t >(id)); }
CheckpointInst & GetCheckpoint(Int32 id) { return m_Checkpoints.at(static_cast< size_t >(id)); }
KeybindInst & GetKeybind(Int32 id) { return m_Keybinds.at(static_cast< size_t >(id)); }
ObjectInst & GetObj(Int32 id) { return m_Objects.at(static_cast< size_t >(id)); }
PickupInst & GetPickup(Int32 id) { return m_Pickups.at(static_cast< size_t >(id)); }
PlayerInst & GetPlayer(Int32 id) { return m_Players.at(static_cast< size_t >(id)); }
VehicleInst & GetVehicle(Int32 id) { return m_Vehicles.at(static_cast< size_t >(id)); }
/* --------------------------------------------------------------------------------------------
* Pool retrievers.
*/
const Blips & GetBlips() const { return m_Blips; }
const Checkpoints & GetCheckpoints() const { return m_Checkpoints; }
const Keybinds & GetKeybinds() const { return m_Keybinds; }
const Objects & GetObjs() const { return m_Objects; }
const Pickups & GetPickups() const { return m_Pickups; }
const Players & GetPlayers() const { return m_Players; }
const Vehicles & GetVehicles() const { return m_Vehicles; }
/* --------------------------------------------------------------------------------------------
* Null instance retrievers.
*/
LightObj & GetNullBlip() { return m_NullBlip; }
LightObj & GetNullCheckpoint() { return m_NullCheckpoint; }
LightObj & GetNullKeybind() { return m_NullKeybind; }
LightObj & GetNullObject() { return m_NullObject; }
LightObj & GetNullPickup() { return m_NullPickup; }
LightObj & GetNullPlayer() { return m_NullPlayer; }
LightObj & GetNullVehicle() { return m_NullVehicle; }
/* --------------------------------------------------------------------------------------------
* Container cleaner.
*/
void ClearContainer(EntityType type);
protected:
/* --------------------------------------------------------------------------------------------
* Signal initialization and termination.
*/
void InitEvents();
void DropEvents();
public:
/* --------------------------------------------------------------------------------------------
* Player lifetime management.
*/
void ConnectPlayer(Int32 id, Int32 header, LightObj & payload);
void DisconnectPlayer(Int32 id, Int32 header, LightObj & payload);
/* --------------------------------------------------------------------------------------------
* Emit a custom event.
*/
void EmitCustomEvent(Int32 group, Int32 header, LightObj & payload);
/* --------------------------------------------------------------------------------------------
* Server events.
*/
void EmitBlipCreated(Int32 blip, Int32 header, LightObj & payload);
void EmitCheckpointCreated(Int32 forcefield, Int32 header, LightObj & payload);
void EmitKeybindCreated(Int32 keybind, Int32 header, LightObj & payload);
void EmitObjectCreated(Int32 object, Int32 header, LightObj & payload);
void EmitPickupCreated(Int32 pickup, Int32 header, LightObj & payload);
void EmitPlayerCreated(Int32 player, Int32 header, LightObj & payload);
void EmitVehicleCreated(Int32 vehicle, Int32 header, LightObj & payload);
void EmitBlipDestroyed(Int32 blip, Int32 header, LightObj & payload);
void EmitCheckpointDestroyed(Int32 forcefield, Int32 header, LightObj & payload);
void EmitKeybindDestroyed(Int32 keybind, Int32 header, LightObj & payload);
void EmitObjectDestroyed(Int32 object, Int32 header, LightObj & payload);
void EmitPickupDestroyed(Int32 pickup, Int32 header, LightObj & payload);
void EmitPlayerDestroyed(Int32 player, Int32 header, LightObj & payload);
void EmitVehicleDestroyed(Int32 vehicle, Int32 header, LightObj & payload);
void EmitBlipCustom(Int32 blip, Int32 header, LightObj & payload);
void EmitCheckpointCustom(Int32 forcefield, Int32 header, LightObj & payload);
void EmitKeybindCustom(Int32 keybind, Int32 header, LightObj & payload);
void EmitObjectCustom(Int32 object, Int32 header, LightObj & payload);
void EmitPickupCustom(Int32 pickup, Int32 header, LightObj & payload);
void EmitPlayerCustom(Int32 player, Int32 header, LightObj & payload);
void EmitVehicleCustom(Int32 vehicle, Int32 header, LightObj & payload);
void EmitServerStartup();
void EmitServerShutdown();
void EmitServerFrame(Float32 elapsed_time);
void EmitPluginCommand(Uint32 command_identifier, CCStr message);
void EmitIncomingConnection(CStr player_name, size_t name_buffer_size, CCStr user_password, CCStr ip_address);
void EmitPlayerRequestClass(Int32 player_id, Int32 offset);
void EmitPlayerRequestSpawn(Int32 player_id);
void EmitPlayerSpawn(Int32 player_id);
void EmitPlayerWasted(Int32 player_id, Int32 reason);
void EmitPlayerKilled(Int32 player_id, Int32 killer_id, Int32 reason, vcmpBodyPart body_part, bool team_kill);
void EmitPlayerEmbarking(Int32 player_id, Int32 vehicle_id, Int32 slot_index);
void EmitPlayerEmbarked(Int32 player_id, Int32 vehicle_id, Int32 slot_index);
void EmitPlayerDisembark(Int32 player_id, Int32 vehicle_id);
void EmitPlayerRename(Int32 player_id, CCStr old_name, CCStr new_name);
void EmitPlayerState(Int32 player_id, Int32 old_state, Int32 new_state);
void EmitStateNone(Int32 player_id, Int32 old_state);
void EmitStateNormal(Int32 player_id, Int32 old_state);
void EmitStateAim(Int32 player_id, Int32 old_state);
void EmitStateDriver(Int32 player_id, Int32 old_state);
void EmitStatePassenger(Int32 player_id, Int32 old_state);
void EmitStateEnterDriver(Int32 player_id, Int32 old_state);
void EmitStateEnterPassenger(Int32 player_id, Int32 old_state);
void EmitStateExit(Int32 player_id, Int32 old_state);
void EmitStateUnspawned(Int32 player_id, Int32 old_state);
void EmitPlayerAction(Int32 player_id, Int32 old_action, Int32 new_action);
void EmitActionNone(Int32 player_id, Int32 old_action);
void EmitActionNormal(Int32 player_id, Int32 old_action);
void EmitActionAiming(Int32 player_id, Int32 old_action);
void EmitActionShooting(Int32 player_id, Int32 old_action);
void EmitActionJumping(Int32 player_id, Int32 old_action);
void EmitActionLieDown(Int32 player_id, Int32 old_action);
void EmitActionGettingUp(Int32 player_id, Int32 old_action);
void EmitActionJumpVehicle(Int32 player_id, Int32 old_action);
void EmitActionDriving(Int32 player_id, Int32 old_action);
void EmitActionDying(Int32 player_id, Int32 old_action);
void EmitActionWasted(Int32 player_id, Int32 old_action);
void EmitActionEmbarking(Int32 player_id, Int32 old_action);
void EmitActionDisembarking(Int32 player_id, Int32 old_action);
void EmitPlayerBurning(Int32 player_id, bool is_on_fire);
void EmitPlayerCrouching(Int32 player_id, bool is_crouching);
void EmitPlayerGameKeys(Int32 player_id, Uint32 old_keys, Uint32 new_keys);
void EmitPlayerStartTyping(Int32 player_id);
void EmitPlayerStopTyping(Int32 player_id);
void EmitPlayerAway(Int32 player_id, bool is_away);
void EmitPlayerMessage(Int32 player_id, CCStr message);
void EmitPlayerCommand(Int32 player_id, CCStr message);
void EmitPlayerPrivateMessage(Int32 player_id, Int32 target_player_id, CCStr message);
void EmitPlayerKeyPress(Int32 player_id, Int32 bind_id);
void EmitPlayerKeyRelease(Int32 player_id, Int32 bind_id);
void EmitPlayerSpectate(Int32 player_id, Int32 target_player_id);
void EmitPlayerUnspectate(Int32 player_id);
void EmitPlayerCrashreport(Int32 player_id, CCStr report);
void EmitPlayerModuleList(Int32 player_id, CCStr list);
void EmitVehicleExplode(Int32 vehicle_id);
void EmitVehicleRespawn(Int32 vehicle_id);
void EmitObjectShot(Int32 object_id, Int32 player_id, Int32 weapon_id);
void EmitObjectTouched(Int32 object_id, Int32 player_id);
void EmitPickupClaimed(Int32 pickup_id, Int32 player_id);
void EmitPickupCollected(Int32 pickup_id, Int32 player_id);
void EmitPickupRespawn(Int32 pickup_id);
void EmitCheckpointEntered(Int32 checkpoint_id, Int32 player_id);
void EmitCheckpointExited(Int32 checkpoint_id, Int32 player_id);
/* --------------------------------------------------------------------------------------------
* Miscellaneous events.
*/
void EmitCheckpointWorld(Int32 checkpoint_id, Int32 old_world, Int32 new_world);
void EmitCheckpointRadius(Int32 checkpoint_id, Float32 old_radius, Float32 new_radius);
void EmitObjectWorld(Int32 object_id, Int32 old_world, Int32 new_world);
void EmitObjectAlpha(Int32 object_id, Int32 old_alpha, Int32 new_alpha, Int32 time);
void EmitPickupWorld(Int32 pickup_id, Int32 old_world, Int32 new_world);
void EmitPickupAlpha(Int32 pickup_id, Int32 old_alpha, Int32 new_alpha);
void EmitPickupAutomatic(Int32 pickup_id, bool old_status, bool new_status);
void EmitPickupAutoTimer(Int32 pickup_id, Int32 old_timer, Int32 new_timer);
void EmitPickupOption(Int32 pickup_id, Int32 option_id, bool value, Int32 header, LightObj & payload);
void EmitObjectReport(Int32 object_id, bool old_status, bool new_status, bool touched);
void EmitPlayerHealth(Int32 player_id, Float32 old_health, Float32 new_health);
void EmitPlayerArmour(Int32 player_id, Float32 old_armour, Float32 new_armour);
void EmitPlayerWeapon(Int32 player_id, Int32 old_weapon, Int32 new_weapon);
void EmitPlayerHeading(Int32 player_id, Float32 old_heading, Float32 new_heading);
void EmitPlayerPosition(Int32 player_id);
void EmitPlayerOption(Int32 player_id, Int32 option_id, bool value, Int32 header, LightObj & payload);
void EmitPlayerAdmin(Int32 player_id, bool old_status, bool new_status);
void EmitPlayerWorld(Int32 player_id, Int32 old_world, Int32 new_world, bool secondary);
void EmitPlayerTeam(Int32 player_id, Int32 old_team, Int32 new_team);
void EmitPlayerSkin(Int32 player_id, Int32 old_skin, Int32 new_skin);
void EmitPlayerMoney(Int32 player_id, Int32 old_money, Int32 new_money);
void EmitPlayerScore(Int32 player_id, Int32 old_score, Int32 new_score);
void EmitPlayerWantedLevel(Int32 player_id, Int32 old_level, Int32 new_level);
void EmitPlayerImmunity(Int32 player_id, Int32 old_immunity, Int32 new_immunity);
void EmitPlayerAlpha(Int32 player_id, Int32 old_alpha, Int32 new_alpha, Int32 fade);
void EmitPlayerEnterArea(Int32 player_id, LightObj & area_obj);
void EmitPlayerLeaveArea(Int32 player_id, LightObj & area_obj);
void EmitVehicleColor(Int32 vehicle_id, Int32 changed);
void EmitVehicleHealth(Int32 vehicle_id, Float32 old_health, Float32 new_health);
void EmitVehiclePosition(Int32 vehicle_id);
void EmitVehicleRotation(Int32 vehicle_id);
void EmitVehicleOption(Int32 vehicle_id, Int32 option_id, bool value, Int32 header, LightObj & payload);
void EmitVehicleWorld(Int32 vehicle_id, Int32 old_world, Int32 new_world);
void EmitVehicleImmunity(Int32 vehicle_id, Int32 old_immunity, Int32 new_immunity);
void EmitVehiclePartStatus(Int32 vehicle_id, Int32 part, Int32 old_status, Int32 new_status);
void EmitVehicleTyreStatus(Int32 vehicle_id, Int32 tyre, Int32 old_status, Int32 new_status);
void EmitVehicleDamageData(Int32 vehicle_id, Uint32 old_data, Uint32 new_data);
void EmitVehicleRadio(Int32 vehicle_id, Int32 old_radio, Int32 new_radio);
void EmitVehicleHandlingRule(Int32 vehicle_id, Int32 rule, SQFloat old_data, SQFloat new_data);
void EmitVehicleEnterArea(Int32 player_id, LightObj & area_obj);
void EmitVehicleLeaveArea(Int32 player_id, LightObj & area_obj);
void EmitServerOption(Int32 option, bool value, Int32 header, LightObj & payload);
void EmitScriptReload(Int32 header, LightObj & payload);
void EmitScriptLoaded();
/* --------------------------------------------------------------------------------------------
* Entity pool changes events.
*/
void EmitEntityPool(vcmpEntityPool entity_type, Int32 entity_id, bool is_deleted);
#if SQMOD_SDK_LEAST(2, 1)
/* --------------------------------------------------------------------------------------------
* Entity streaming changes events.
*/
void EmitCheckpointStream(int32_t player_id, int32_t entity_id, bool is_deleted);
void EmitObjectStream(int32_t player_id, int32_t entity_id, bool is_deleted);
void EmitPickupStream(int32_t player_id, int32_t entity_id, bool is_deleted);
void EmitPlayerStream(int32_t player_id, int32_t entity_id, bool is_deleted);
void EmitVehicleStream(int32_t player_id, int32_t entity_id, bool is_deleted);
void EmitEntityStreaming(int32_t player_id, int32_t entity_id, vcmpEntityPool entity_type, bool is_deleted);
#endif
/* --------------------------------------------------------------------------------------------
* Entity update events.
*/
void EmitPlayerUpdate(Int32 player_id, vcmpPlayerUpdate update_type);
void EmitVehicleUpdate(Int32 vehicle_id, vcmpVehicleUpdate update_type);
/* --------------------------------------------------------------------------------------------
* Client data streams event.
*/
void EmitClientScriptData(Int32 player_id, const uint8_t * data, size_t size);
public:
/* --------------------------------------------------------------------------------------------
* Module signals.
*/
SignalPair mOnPreLoad;
SignalPair mOnPostLoad;
SignalPair mOnUnload;
/* --------------------------------------------------------------------------------------------
* Server signals.
*/
SignalPair mOnCustomEvent;
SignalPair mOnBlipCreated;
SignalPair mOnCheckpointCreated;
SignalPair mOnKeybindCreated;
SignalPair mOnObjectCreated;
SignalPair mOnPickupCreated;
SignalPair mOnPlayerCreated;
SignalPair mOnVehicleCreated;
SignalPair mOnBlipDestroyed;
SignalPair mOnCheckpointDestroyed;
SignalPair mOnKeybindDestroyed;
SignalPair mOnObjectDestroyed;
SignalPair mOnPickupDestroyed;
SignalPair mOnPlayerDestroyed;
SignalPair mOnVehicleDestroyed;
SignalPair mOnBlipCustom;
SignalPair mOnCheckpointCustom;
SignalPair mOnKeybindCustom;
SignalPair mOnObjectCustom;
SignalPair mOnPickupCustom;
SignalPair mOnPlayerCustom;
SignalPair mOnVehicleCustom;
#if SQMOD_SDK_LEAST(2, 1)
SignalPair mOnCheckpointStream;
SignalPair mOnObjectStream;
SignalPair mOnPickupStream;
SignalPair mOnPlayerStream;
SignalPair mOnVehicleStream;
#endif
SignalPair mOnServerStartup;
SignalPair mOnServerShutdown;
SignalPair mOnServerFrame;
SignalPair mOnIncomingConnection;
SignalPair mOnPlayerRequestClass;
SignalPair mOnPlayerRequestSpawn;
SignalPair mOnPlayerSpawn;
SignalPair mOnPlayerWasted;
SignalPair mOnPlayerKilled;
SignalPair mOnPlayerEmbarking;
SignalPair mOnPlayerEmbarked;
SignalPair mOnPlayerDisembark;
SignalPair mOnPlayerRename;
SignalPair mOnPlayerState;
SignalPair mOnStateNone;
SignalPair mOnStateNormal;
SignalPair mOnStateAim;
SignalPair mOnStateDriver;
SignalPair mOnStatePassenger;
SignalPair mOnStateEnterDriver;
SignalPair mOnStateEnterPassenger;
SignalPair mOnStateExit;
SignalPair mOnStateUnspawned;
SignalPair mOnPlayerAction;
SignalPair mOnActionNone;
SignalPair mOnActionNormal;
SignalPair mOnActionAiming;
SignalPair mOnActionShooting;
SignalPair mOnActionJumping;
SignalPair mOnActionLieDown;
SignalPair mOnActionGettingUp;
SignalPair mOnActionJumpVehicle;
SignalPair mOnActionDriving;
SignalPair mOnActionDying;
SignalPair mOnActionWasted;
SignalPair mOnActionEmbarking;
SignalPair mOnActionDisembarking;
SignalPair mOnPlayerBurning;
SignalPair mOnPlayerCrouching;
SignalPair mOnPlayerGameKeys;
SignalPair mOnPlayerStartTyping;
SignalPair mOnPlayerStopTyping;
SignalPair mOnPlayerAway;
SignalPair mOnPlayerMessage;
SignalPair mOnPlayerCommand;
SignalPair mOnPlayerPrivateMessage;
SignalPair mOnPlayerKeyPress;
SignalPair mOnPlayerKeyRelease;
SignalPair mOnPlayerSpectate;
SignalPair mOnPlayerUnspectate;
SignalPair mOnPlayerCrashreport;
SignalPair mOnPlayerModuleList;
SignalPair mOnVehicleExplode;
SignalPair mOnVehicleRespawn;
SignalPair mOnObjectShot;
SignalPair mOnObjectTouched;
SignalPair mOnObjectWorld;
SignalPair mOnObjectAlpha;
SignalPair mOnObjectReport;
SignalPair mOnPickupClaimed;
SignalPair mOnPickupCollected;
SignalPair mOnPickupRespawn;
SignalPair mOnPickupWorld;
SignalPair mOnPickupAlpha;
SignalPair mOnPickupAutomatic;
SignalPair mOnPickupAutoTimer;
SignalPair mOnPickupOption;
SignalPair mOnCheckpointEntered;
SignalPair mOnCheckpointExited;
SignalPair mOnCheckpointWorld;
SignalPair mOnCheckpointRadius;
SignalPair mOnEntityPool;
SignalPair mOnClientScriptData;
SignalPair mOnPlayerUpdate;
SignalPair mOnVehicleUpdate;
SignalPair mOnPlayerHealth;
SignalPair mOnPlayerArmour;
SignalPair mOnPlayerWeapon;
SignalPair mOnPlayerHeading;
SignalPair mOnPlayerPosition;
SignalPair mOnPlayerOption;
SignalPair mOnPlayerAdmin;
SignalPair mOnPlayerWorld;
SignalPair mOnPlayerTeam;
SignalPair mOnPlayerSkin;
SignalPair mOnPlayerMoney;
SignalPair mOnPlayerScore;
SignalPair mOnPlayerWantedLevel;
SignalPair mOnPlayerImmunity;
SignalPair mOnPlayerAlpha;
SignalPair mOnPlayerEnterArea;
SignalPair mOnPlayerLeaveArea;
SignalPair mOnVehicleColor;
SignalPair mOnVehicleHealth;
SignalPair mOnVehiclePosition;
SignalPair mOnVehicleRotation;
SignalPair mOnVehicleOption;
SignalPair mOnVehicleWorld;
SignalPair mOnVehicleImmunity;
SignalPair mOnVehiclePartStatus;
SignalPair mOnVehicleTyreStatus;
SignalPair mOnVehicleDamageData;
SignalPair mOnVehicleRadio;
SignalPair mOnVehicleHandlingRule;
SignalPair mOnVehicleEnterArea;
SignalPair mOnVehicleLeaveArea;
#if SQMOD_SDK_LEAST(2, 1)
SignalPair mOnEntityStream;
#endif
SignalPair mOnServerOption;
SignalPair mOnScriptReload;
SignalPair mOnScriptLoaded;
};
/* ------------------------------------------------------------------------------------------------
* Structure used to preserve the core state across recursive event calls from the server.
*/
struct CoreState
{
/* --------------------------------------------------------------------------------------------
* Backup the current core state.
*/
CoreState()
: m_State(Core::Get().GetState())
{
//...
}
/* --------------------------------------------------------------------------------------------
* Backup the current core state and set the given state.
*/
explicit CoreState(int s)
: m_State(Core::Get().GetState())
{
Core::Get().SetState(s);
}
/* --------------------------------------------------------------------------------------------
* Copy constructor (disabled).
*/
CoreState(const CoreState & o) = delete;
/* --------------------------------------------------------------------------------------------
* Move constructor (disabled).
*/
CoreState(CoreState && o) = delete;
/* --------------------------------------------------------------------------------------------
* Destructor. Restore the grabbed core state.
*/
~CoreState()
{
Core::Get().SetState(m_State);
}
/* --------------------------------------------------------------------------------------------
* Copy assignment operator (disabled).
*/
CoreState & operator = (const CoreState & o) = delete;
/* --------------------------------------------------------------------------------------------
* Move assignment operator (disabled).
*/
CoreState & operator = (CoreState && o) = delete;
/* --------------------------------------------------------------------------------------------
* Retrieve the guarded state.
*/
int GetValue() const
{
return m_State;
}
protected:
int m_State; // The core state at the time when this instance was created.
};
} // Namespace:: SqMod
| iSLC/VCMP-SqMod | module/Core.hpp | C++ | mit | 67,057 | [
30522,
1001,
10975,
8490,
2863,
2320,
1013,
1013,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace Outil\ServiceBundle\Param;
use Symfony\Component\HttpKernel\Exception\Exception;
class Param{
// private $mailer;
// private $locale;
// private $minLength;
// public function __construct(\Swift_Mailer $mailer, $locale, $minLength)
// {
// $this->mailer = $mailer;
// $this->locale = $locale;
// $this->minLength = (int) $minLength;
// }
/**
* Vérifie si le texte est un spam ou non
*
* param string $text
* return bool
*/
public function except($text)
{
throw new \Exception('Votre message a été détecté comme spam !');
}
} | junioraby/architec.awardspace.info | src/Outil/ServiceBundle/Param/Param.php | PHP | mit | 605 | [
30522,
1026,
1029,
25718,
3415,
15327,
2041,
4014,
1032,
2326,
27265,
2571,
1032,
11498,
2213,
1025,
2224,
25353,
2213,
14876,
4890,
1032,
6922,
1032,
8299,
5484,
11877,
1032,
6453,
1032,
6453,
1025,
2465,
11498,
2213,
1063,
1013,
1013,
279... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html data-context="Build Apps" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<title>setname - Legato Docs</title>
<meta content="legato™ is an open source Linux-based embedded platform designed to simplify connected IoT application development" name="description"/>
<meta content="legato, iot" name="keywords"/>
<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/>
<meta content="19.11.3" name="legato-version"/>
<link href="resources/images/legato.ico" rel="shortcut icon"/>
<link href="resources/images/legato.ico" rel="icon" type="image/x-icon"/>
<link href="resources/images/legato.ico" rel="shortcut icon" type="image/x-icon"/>
<link href="resources/images/legato.ico" rel="apple-touch-icon" type="image/x-icon"/>
<link href="resources/css/style.css" media="screen" rel="stylesheet" type="text/css"/>
<link href="resources/css/font-awesome.css" rel="stylesheet" type="text/css"/>
<!--[if IE]>
<script src="resources/js/html5shiv.js"></script>
<script src="resources/js/respond.js"></script>
<![endif]-->
<script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
<script src="resources/js/main.js"></script>
<script src="tocs/Build_Apps_Tools.json"></script>
</head>
<body>
<noscript>
<input class="modal-closing-trick" id="modal-closing-trick" type="checkbox"/>
<div id="nojs">
<label for="modal-closing-trick">
<span>You seem to not have Javascript <a href="http://enable-javascript.com">enabled</a>, so site functionality like the search and navigation tree won't work.</span>
</label>
</div>
</noscript>
<div class="wrapper">
<div class="fa fa-bars documentation" id="menu-trigger"></div>
<div id="top">
<header>
<nav>
<a class="navlink" href="/">Introduction</a><a class="navlink selected" href="buildAppsMain.html">Build Apps</a><a class="navlink" href="buildPlatformMain.html">Build Platform</a><a class="navlink" href="aboutMain.html">About</a>
</nav>
</header>
</div>
<div class="white" id="menudocumentation">
<header>
<a href="/"> <img alt="Back to Legato Homepage" id="logo" src="resources/images/legato_logo.png"/></a>
<h2>/ Build Apps</h2>
<nav class="secondary">
<a href="getStarted.html">Get Started</a><a href="concepts.html">Concepts</a><a href="apiGuidesMain.html">API Guides</a><a class="link-selected" href="tools.html">Tools</a><a href="howToMain.html">How To</a><a href="experimentalMain.html">Experimental Features</a>
</nav>
<nav class="ui-front">
<i class="fa fa-search" id="search-icon"></i>
<input id="searchbox" placeholder="Search"/>
</nav>
</header>
</div>
<div id="resizable">
<div id="left">
<div id="tree1"></div>
</div>
</div>
<div class="content">
<div class="header">
<div class="headertitle">
<h1 class="title">setname </h1> </div>
</div><div class="contents">
<div class="textblock"><h1>NAME</h1>
<p><b>setname</b> - change the hostname of the target</p>
<h1>SYNOPSIS</h1>
<p><code>setname NAME [TARGET_IP]</code><br/>
</p>
<h1>DESCRIPTION</h1>
<pre class="fragment"> With a default prompt set, when you log into the target by UART or ssh,
the commandline prompt will be root\@swi-mdm9x15. If you are logged into
multiple targets or you have multiple targets on your network, it can
be helpful to give each its own hostname so its easy to tell which device
you have connected to.
After running this command, the hostname of the target will be changed to
the name given in NAME.</pre> <h1>ENVIRONMENT</h1>
<pre class="fragment">If the TARGET_IP value is not given and the environment variable DEST_IP
is set then DEST_IP will be used as TARGET_IP
</pre><h1>NOTES</h1>
<pre class="fragment"> Unfortunately, due to the way shells set up their internal variables only
the prompt of new shells will manifest the new hostname. Currently open
shells will continue to show the previous hostname.</pre> <hr/>
<p class="copyright"> Copyright (C) Sierra Wireless Inc. </p>
</div></div>
<br clear="left"/>
</div>
</div>
<link href="resources/css/jqtree.css" rel="stylesheet" type="text/css"/>
<script src="resources/js/tree.jquery.js" type="text/javascript"></script>
<script src="resources/js/jquery.cookie.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<link href="resources/css/perfect-scrollbar.min.css" rel="stylesheet"/>
<script src="resources/js/perfect-scrollbar.jquery.min.js"></script>
</body>
</html>
| legatoproject/legato-docs | 19_11_3/toolsHost_setname.html | HTML | mpl-2.0 | 4,626 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
1060,
11039,
19968,
1015,
1012,
1014,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jsonp({"cep":"62030240","logradouro":"Rua Padre Anchieta","bairro":"Campo dos Velhos","cidade":"Sobral","uf":"CE","estado":"Cear\u00e1"});
| lfreneda/cepdb | api/v1/62030240.jsonp.js | JavaScript | cc0-1.0 | 139 | [
30522,
1046,
3385,
2361,
1006,
1063,
1000,
8292,
2361,
1000,
1024,
1000,
23612,
14142,
18827,
2692,
1000,
1010,
1000,
8833,
12173,
8162,
2080,
1000,
1024,
1000,
21766,
2050,
28612,
2019,
5428,
12928,
1000,
1010,
1000,
21790,
18933,
1000,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Glue - Robust Go and Javascript Socket Library
* Copyright (C) 2015 Roland Singer <roland.singer[at]desertbit.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
var glue = function(host, options) {
// Turn on strict mode.
'use strict';
// Include the dependencies.
@@include('./emitter.js')
@@include('./websocket.js')
@@include('./ajaxsocket.js')
/*
* Constants
*/
var Version = "1.9.1",
MainChannelName = "m";
var SocketTypes = {
WebSocket: "WebSocket",
AjaxSocket: "AjaxSocket"
};
var Commands = {
Len: 2,
Init: 'in',
Ping: 'pi',
Pong: 'po',
Close: 'cl',
Invalid: 'iv',
DontAutoReconnect: 'dr',
ChannelData: 'cd'
};
var States = {
Disconnected: "disconnected",
Connecting: "connecting",
Reconnecting: "reconnecting",
Connected: "connected"
};
var DefaultOptions = {
// The base URL is appended to the host string. This value has to match with the server value.
baseURL: "/glue/",
// Force a socket type.
// Values: false, "WebSocket", "AjaxSocket"
forceSocketType: false,
// Kill the connect attempt after the timeout.
connectTimeout: 10000,
// If the connection is idle, ping the server to check if the connection is stil alive.
pingInterval: 35000,
// Reconnect if the server did not response with a pong within the timeout.
pingReconnectTimeout: 5000,
// Whenever to automatically reconnect if the connection was lost.
reconnect: true,
reconnectDelay: 1000,
reconnectDelayMax: 5000,
// To disable set to 0 (endless).
reconnectAttempts: 10,
// Reset the send buffer after the timeout.
resetSendBufferTimeout: 10000
};
/*
* Variables
*/
var emitter = new Emitter,
bs = false,
mainChannel,
initialConnectedOnce = false, // If at least one successful connection was made.
bsNewFunc, // Function to create a new backend socket.
currentSocketType,
currentState = States.Disconnected,
reconnectCount = 0,
autoReconnectDisabled = false,
connectTimeout = false,
pingTimeout = false,
pingReconnectTimeout = false,
sendBuffer = [],
resetSendBufferTimeout = false,
resetSendBufferTimedOut = false,
isReady = false, // If true, the socket is initialized and ready.
beforeReadySendBuffer = [], // Buffer to hold requests for the server while the socket is not ready yet.
socketID = "";
/*
* Include the dependencies
*/
// Exported helper methods for the dependencies.
var closeSocket, send, sendBuffered;
@@include('./utils.js')
@@include('./channel.js')
/*
* Methods
*/
// Function variables.
var reconnect, triggerEvent;
// Sends the data to the server if a socket connection exists, otherwise it is discarded.
// If the socket is not ready yet, the data is buffered until the socket is ready.
send = function(data) {
if (!bs) {
return;
}
// If the socket is not ready yet, buffer the data.
if (!isReady) {
beforeReadySendBuffer.push(data);
return;
}
// Send the data.
bs.send(data);
};
// Hint: the isReady flag has to be true before calling this function!
var sendBeforeReadyBufferedData = function() {
// Skip if empty.
if (beforeReadySendBuffer.length === 0) {
return;
}
// Send the buffered data.
for (var i = 0; i < beforeReadySendBuffer.length; i++) {
send(beforeReadySendBuffer[i]);
}
// Clear the buffer.
beforeReadySendBuffer = [];
};
var stopResetSendBufferTimeout = function() {
// Reset the flag.
resetSendBufferTimedOut = false;
// Stop the timeout timer if present.
if (resetSendBufferTimeout !== false) {
clearTimeout(resetSendBufferTimeout);
resetSendBufferTimeout = false;
}
};
var startResetSendBufferTimeout = function() {
// Skip if already running or if already timed out.
if (resetSendBufferTimeout !== false || resetSendBufferTimedOut) {
return;
}
// Start the timeout.
resetSendBufferTimeout = setTimeout(function() {
// Update the flags.
resetSendBufferTimeout = false;
resetSendBufferTimedOut = true;
// Return if already empty.
if (sendBuffer.length === 0) {
return;
}
// Call the discard callbacks if defined.
var buf;
for (var i = 0; i < sendBuffer.length; i++) {
buf = sendBuffer[i];
if (buf.discardCallback && utils.isFunction(buf.discardCallback)) {
try {
buf.discardCallback(buf.data);
}
catch (err) {
console.log("glue: failed to call discard callback: " + err.message);
}
}
}
// Trigger the event if any buffered send data is discarded.
triggerEvent("discard_send_buffer");
// Reset the buffer.
sendBuffer = [];
}, options.resetSendBufferTimeout);
};
var sendDataFromSendBuffer = function() {
// Stop the reset send buffer tiemout.
stopResetSendBufferTimeout();
// Skip if empty.
if (sendBuffer.length === 0) {
return;
}
// Send data, which could not be send...
var buf;
for (var i = 0; i < sendBuffer.length; i++) {
buf = sendBuffer[i];
send(buf.cmd + buf.data);
}
// Clear the buffer again.
sendBuffer = [];
};
// Send data to the server.
// This is a helper method which handles buffering,
// if the socket is currently not connected.
// One optional discard callback can be passed.
// It is called if the data could not be send to the server.
// The data is passed as first argument to the discard callback.
// returns:
// 1 if immediately send,
// 0 if added to the send queue and
// -1 if discarded.
sendBuffered = function(cmd, data, discardCallback) {
// Be sure, that the data value is an empty
// string if not passed to this method.
if (!data) {
data = "";
}
// Add the data to the send buffer if disconnected.
// They will be buffered for a short timeout to bridge short connection errors.
if (!bs || currentState !== States.Connected) {
// If already timed out, then call the discard callback and return.
if (resetSendBufferTimedOut) {
if (discardCallback && utils.isFunction(discardCallback)) {
discardCallback(data);
}
return -1;
}
// Reset the send buffer after a specific timeout.
startResetSendBufferTimeout();
// Append to the buffer.
sendBuffer.push({
cmd: cmd,
data: data,
discardCallback: discardCallback
});
return 0;
}
// Send the data with the command to the server.
send(cmd + data);
return 1;
};
var stopConnectTimeout = function() {
// Stop the timeout timer if present.
if (connectTimeout !== false) {
clearTimeout(connectTimeout);
connectTimeout = false;
}
};
var resetConnectTimeout = function() {
// Stop the timeout.
stopConnectTimeout();
// Start the timeout.
connectTimeout = setTimeout(function() {
// Update the flag.
connectTimeout = false;
// Trigger the event.
triggerEvent("connect_timeout");
// Reconnect to the server.
reconnect();
}, options.connectTimeout);
};
var stopPingTimeout = function() {
// Stop the timeout timer if present.
if (pingTimeout !== false) {
clearTimeout(pingTimeout);
pingTimeout = false;
}
// Stop the reconnect timeout.
if (pingReconnectTimeout !== false) {
clearTimeout(pingReconnectTimeout);
pingReconnectTimeout = false;
}
};
var resetPingTimeout = function() {
// Stop the timeout.
stopPingTimeout();
// Start the timeout.
pingTimeout = setTimeout(function() {
// Update the flag.
pingTimeout = false;
// Request a Pong response to check if the connection is still alive.
send(Commands.Ping);
// Start the reconnect timeout.
pingReconnectTimeout = setTimeout(function() {
// Update the flag.
pingReconnectTimeout = false;
// Trigger the event.
triggerEvent("timeout");
// Reconnect to the server.
reconnect();
}, options.pingReconnectTimeout);
}, options.pingInterval);
};
var newBackendSocket = function() {
// If at least one successfull connection was made,
// then create a new socket using the last create socket function.
// Otherwise determind which socket layer to use.
if (initialConnectedOnce) {
bs = bsNewFunc();
return;
}
// Fallback to the ajax socket layer if there was no successful initial
// connection and more than one reconnection attempt was made.
if (reconnectCount > 1) {
bsNewFunc = newAjaxSocket;
bs = bsNewFunc();
currentSocketType = SocketTypes.AjaxSocket;
return;
}
// Choose the socket layer depending on the browser support.
if ((!options.forceSocketType && window.WebSocket) ||
options.forceSocketType === SocketTypes.WebSocket)
{
bsNewFunc = newWebSocket;
currentSocketType = SocketTypes.WebSocket;
}
else
{
bsNewFunc = newAjaxSocket;
currentSocketType = SocketTypes.AjaxSocket;
}
// Create the new socket.
bs = bsNewFunc();
};
var initSocket = function(data) {
// Parse the data JSON string to an object.
data = JSON.parse(data);
// Validate.
// Close the socket and log the error on invalid data.
if (!data.socketID) {
closeSocket();
console.log("glue: socket initialization failed: invalid initialization data received");
return;
}
// Set the socket ID.
socketID = data.socketID;
// The socket initialization is done.
// ##################################
// Set the ready flag.
isReady = true;
// First send all data messages which were
// buffered because the socket was not ready.
sendBeforeReadyBufferedData();
// Now set the state and trigger the event.
currentState = States.Connected;
triggerEvent("connected");
// Send the queued data from the send buffer if present.
// Do this after the next tick to be sure, that
// the connected event gets fired first.
setTimeout(sendDataFromSendBuffer, 0);
};
var connectSocket = function() {
// Set a new backend socket.
newBackendSocket();
// Set the backend socket events.
bs.onOpen = function() {
// Stop the connect timeout.
stopConnectTimeout();
// Reset the reconnect count.
reconnectCount = 0;
// Set the flag.
initialConnectedOnce = true;
// Reset or start the ping timeout.
resetPingTimeout();
// Prepare the init data to be send to the server.
var data = {
version: Version
};
// Marshal the data object to a JSON string.
data = JSON.stringify(data);
// Send the init data to the server with the init command.
// Hint: the backend socket is used directly instead of the send function,
// because the socket is not ready yet and this part belongs to the
// initialization process.
bs.send(Commands.Init + data);
};
bs.onClose = function() {
// Reconnect the socket.
reconnect();
};
bs.onError = function(msg) {
// Trigger the error event.
triggerEvent("error", [msg]);
// Reconnect the socket.
reconnect();
};
bs.onMessage = function(data) {
// Reset the ping timeout.
resetPingTimeout();
// Log if the received data is too short.
if (data.length < Commands.Len) {
console.log("glue: received invalid data from server: data is too short.");
return;
}
// Extract the command from the received data string.
var cmd = data.substr(0, Commands.Len);
data = data.substr(Commands.Len);
if (cmd === Commands.Ping) {
// Response with a pong message.
send(Commands.Pong);
}
else if (cmd === Commands.Pong) {
// Don't do anything.
// The ping timeout was already reset.
}
else if (cmd === Commands.Invalid) {
// Log.
console.log("glue: server replied with an invalid request notification!");
}
else if (cmd === Commands.DontAutoReconnect) {
// Disable auto reconnections.
autoReconnectDisabled = true;
// Log.
console.log("glue: server replied with an don't automatically reconnect request. This might be due to an incompatible protocol version.");
}
else if (cmd === Commands.Init) {
initSocket(data);
}
else if (cmd === Commands.ChannelData) {
// Obtain the two values from the data string.
var v = utils.unmarshalValues(data);
if (!v) {
console.log("glue: server requested an invalid channel data request: " + data);
return;
}
// Trigger the event.
channel.emitOnMessage(v.first, v.second);
}
else {
console.log("glue: received invalid data from server with command '" + cmd + "' and data '" + data + "'!");
}
};
// Connect during the next tick.
// The user should be able to connect the event functions first.
setTimeout(function() {
// Set the state and trigger the event.
if (reconnectCount > 0) {
currentState = States.Reconnecting;
triggerEvent("reconnecting");
}
else {
currentState = States.Connecting;
triggerEvent("connecting");
}
// Reset or start the connect timeout.
resetConnectTimeout();
// Connect to the server
bs.open();
}, 0);
};
var resetSocket = function() {
// Stop the timeouts.
stopConnectTimeout();
stopPingTimeout();
// Reset flags and variables.
isReady = false;
socketID = "";
// Clear the buffer.
// This buffer is attached to each single socket.
beforeReadySendBuffer = [];
// Reset previous backend sockets if defined.
if (bs) {
// Set dummy functions.
// This will ensure, that previous old sockets don't
// call our valid methods. This would mix things up.
bs.onOpen = bs.onClose = bs.onMessage = bs.onError = function() {};
// Reset everything and close the socket.
bs.reset();
bs = false;
}
};
reconnect = function() {
// Reset the socket.
resetSocket();
// If no reconnections should be made or more than max
// reconnect attempts where made, trigger the disconnected event.
if ((options.reconnectAttempts > 0 && reconnectCount > options.reconnectAttempts) ||
options.reconnect === false || autoReconnectDisabled)
{
// Set the state and trigger the event.
currentState = States.Disconnected;
triggerEvent("disconnected");
return;
}
// Increment the count.
reconnectCount += 1;
// Calculate the reconnect delay.
var reconnectDelay = options.reconnectDelay * reconnectCount;
if (reconnectDelay > options.reconnectDelayMax) {
reconnectDelay = options.reconnectDelayMax;
}
// Try to reconnect.
setTimeout(function() {
connectSocket();
}, reconnectDelay);
};
closeSocket = function() {
// Check if the socket exists.
if (!bs) {
return;
}
// Notify the server.
send(Commands.Close);
// Reset the socket.
resetSocket();
// Set the state and trigger the event.
currentState = States.Disconnected;
triggerEvent("disconnected");
};
/*
* Initialize section
*/
// Create the main channel.
mainChannel = channel.get(MainChannelName);
// Prepare the host string.
// Use the current location if the host string is not set.
if (!host) {
host = window.location.protocol + "//" + window.location.host;
}
// The host string has to start with http:// or https://
if (!host.match("^http://") && !host.match("^https://")) {
console.log("glue: invalid host: missing 'http://' or 'https://'!");
return;
}
// Merge the options with the default options.
options = utils.extend({}, DefaultOptions, options);
// The max value can't be smaller than the delay.
if (options.reconnectDelayMax < options.reconnectDelay) {
options.reconnectDelayMax = options.reconnectDelay;
}
// Prepare the base URL.
// The base URL has to start and end with a slash.
if (options.baseURL.indexOf("/") !== 0) {
options.baseURL = "/" + options.baseURL;
}
if (options.baseURL.slice(-1) !== "/") {
options.baseURL = options.baseURL + "/";
}
// Create the initial backend socket and establish a connection to the server.
connectSocket();
/*
* Socket object
*/
var socket = {
// version returns the glue socket protocol version.
version: function() {
return Version;
},
// type returns the current used socket type as string.
// Either "WebSocket" or "AjaxSocket".
type: function() {
return currentSocketType;
},
// state returns the current socket state as string.
// Following states are available:
// - "disconnected"
// - "connecting"
// - "reconnecting"
// - "connected"
state: function() {
return currentState;
},
// socketID returns the socket's ID.
// This is a cryptographically secure pseudorandom number.
socketID: function() {
return socketID;
},
// send a data string to the server.
// One optional discard callback can be passed.
// It is called if the data could not be send to the server.
// The data is passed as first argument to the discard callback.
// returns:
// 1 if immediately send,
// 0 if added to the send queue and
// -1 if discarded.
send: function(data, discardCallback) {
mainChannel.send(data, discardCallback);
},
// onMessage sets the function which is triggered as soon as a message is received.
onMessage: function(f) {
mainChannel.onMessage(f);
},
// on binds event functions to events.
// This function is equivalent to jQuery's on method syntax.
// Following events are available:
// - "connected"
// - "connecting"
// - "disconnected"
// - "reconnecting"
// - "error"
// - "connect_timeout"
// - "timeout"
// - "discard_send_buffer"
on: function() {
emitter.on.apply(emitter, arguments);
},
// Reconnect to the server.
// This is ignored if the socket is not disconnected.
// It will reconnect automatically if required.
reconnect: function() {
if (currentState !== States.Disconnected) {
return;
}
// Reset the reconnect count and the auto reconnect disabled flag.
reconnectCount = 0;
autoReconnectDisabled = false;
// Reconnect the socket.
reconnect();
},
// close the socket connection.
close: function() {
closeSocket();
},
// channel returns the given channel object specified by name
// to communicate in a separate channel than the default one.
channel: function(name) {
return channel.get(name);
}
};
// Define the function body of the triggerEvent function.
triggerEvent = function() {
emitter.emit.apply(emitter, arguments);
};
// Return the newly created socket.
return socket;
};
| desertbit/glue | client/src/glue.js | JavaScript | mit | 23,197 | [
30522,
1013,
1008,
1008,
25238,
1011,
15873,
2175,
1998,
9262,
22483,
22278,
3075,
1008,
9385,
1006,
1039,
1007,
2325,
8262,
3220,
1026,
8262,
1012,
3220,
1031,
2012,
1033,
5532,
16313,
1012,
4012,
1028,
1008,
1008,
2023,
2565,
2003,
2489,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
"""Update a task in maniphest.
you can use the 'task id' output from the 'arcyon task-create' command as input
to this command.
usage examples:
update task '99' with a new title, only show id:
$ arcyon task-update 99 -t 'title' --format-id
99
"""
# =============================================================================
# CONTENTS
# -----------------------------------------------------------------------------
# aoncmd_taskupdate
#
# Public Functions:
# getFromfilePrefixChars
# setupParser
# process
#
# -----------------------------------------------------------------------------
# (this contents block is generated, edits will be lost)
# =============================================================================
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import textwrap
import phlcon_maniphest
import phlcon_project
import phlcon_user
import phlsys_makeconduit
def getFromfilePrefixChars():
return ""
def setupParser(parser):
# make a list of priority names in increasing order of importance
priority_name_list = phlcon_maniphest.PRIORITIES.keys()
priority_name_list.sort(
key=lambda x: phlcon_maniphest.PRIORITIES[x])
priorities = parser.add_argument_group(
'optional priority arguments',
'use any of ' + textwrap.fill(
str(priority_name_list)))
output_group = parser.add_argument_group(
'Output format arguments',
'Mutually exclusive, defaults to "--format-summary"')
output = output_group.add_mutually_exclusive_group()
opt = parser.add_argument_group(
'Optional task arguments',
'You can supply these later via the web interface if you wish')
priorities.add_argument(
'--priority',
'-p',
choices=priority_name_list,
metavar="PRIORITY",
default=None,
type=str,
help="the priority or importance of the task")
parser.add_argument(
'id',
metavar='INT',
help='the id of the task',
type=str)
parser.add_argument(
'--title',
'-t',
metavar='STRING',
help='the short title of the task',
default=None,
type=str)
opt.add_argument(
'--description',
'-d',
metavar='STRING',
help='the long description of the task',
default=None,
type=str)
opt.add_argument(
'--owner',
'-o',
metavar='USER',
help='the username of the owner',
type=str)
opt.add_argument(
'--ccs',
'-c',
nargs="*",
metavar='USER',
help='a list of usernames to cc on the task',
type=str)
opt.add_argument(
'--projects',
nargs="*",
metavar='PROJECT',
default=[],
help='a list of project names to add the task to',
type=str)
opt.add_argument(
'--comment',
'-m',
metavar='STRING',
help='an optional comment to make on the task',
default=None,
type=str)
output.add_argument(
'--format-summary',
action='store_true',
help='will print a human-readable summary of the result.')
output.add_argument(
'--format-id',
action='store_true',
help='will print just the id of the new task, for scripting.')
output.add_argument(
'--format-url',
action='store_true',
help='will print just the url of the new task, for scripting.')
phlsys_makeconduit.add_argparse_arguments(parser)
def process(args):
if args.title and not args.title.strip():
print('you must supply a non-empty title', file=sys.stderr)
return 1
conduit = phlsys_makeconduit.make_conduit(
args.uri, args.user, args.cert, args.act_as_user)
# create_task expects an integer
priority = None
if args.priority is not None:
priority = phlcon_maniphest.PRIORITIES[args.priority]
# conduit expects PHIDs not plain usernames
user_phids = phlcon_user.UserPhidCache(conduit)
if args.owner:
user_phids.add_hint(args.owner)
if args.ccs:
user_phids.add_hint_list(args.ccs)
owner = user_phids.get_phid(args.owner) if args.owner else None
ccs = [user_phids.get_phid(u) for u in args.ccs] if args.ccs else None
# conduit expects PHIDs not plain project names
projects = None
if args.projects:
project_to_phid = phlcon_project.make_project_to_phid_dict(conduit)
projects = [project_to_phid[p] for p in args.projects]
result = phlcon_maniphest.update_task(
conduit,
args.id,
args.title,
args.description,
priority,
owner,
ccs,
projects,
args.comment)
if args.format_id:
print(result.id)
elif args.format_url:
print(result.uri)
else: # args.format_summary:
message = (
"Updated task '{task_id}', you can view it at this URL:\n"
" {url}"
).format(
task_id=result.id,
url=result.uri)
print(message)
# -----------------------------------------------------------------------------
# Copyright (C) 2013-2014 Bloomberg Finance L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ------------------------------ END-OF-FILE ----------------------------------
| kjedruczyk/phabricator-tools | py/aon/aoncmd_taskupdate.py | Python | apache-2.0 | 5,958 | [
30522,
1000,
1000,
1000,
10651,
1037,
4708,
1999,
23624,
8458,
4355,
1012,
2017,
2064,
2224,
1996,
1005,
4708,
8909,
1005,
6434,
2013,
1996,
1005,
8115,
14001,
4708,
1011,
3443,
1005,
3094,
2004,
7953,
2000,
2023,
3094,
1012,
8192,
4973,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
//////////////////////////////////////////////////////////////////////////
// Name: plate_detect Header
// Version: 1.2
// Date: 2014-09-28
// MDate: 2015-03-13
// Author: liuruoze
// Copyright: liuruoze
// Reference: Mastering OpenCV with Practical Computer Vision Projects
// Reference: CSDN Bloger taotao1233
// Desciption:
// Defines CPlateDetect
//////////////////////////////////////////////////////////////////////////
#ifndef EASYPR_CORE_PLATEDETECT_H_
#define EASYPR_CORE_PLATEDETECT_H_
#include "easypr/core/plate_locate.h"
#include "easypr/core/plate_judge.h"
/*! \namespace easypr
Namespace where all the C++ EasyPR functionality resides
*/
namespace easypr {
class CPlateDetect {
public:
CPlateDetect();
~CPlateDetect();
//! Éî¶È³µÅƼì²â£¬Ê¹ÓÃÑÕÉ«Óë¶þ´ÎSobel·¨×ÛºÏ
int plateDetect(Mat src, std::vector<CPlate>& resultVec,
bool showDetectArea = true, int index = 0);
//! չʾÖмäµÄ½á¹û
int showResult(const Mat& result);
//! ×°ÔØSVMÄ£ÐÍ
void LoadSVM(std::string s);
//! Éú»îģʽÓ빤ҵģʽÇл»
inline void setPDLifemode(bool param) { m_plateLocate->setLifemode(param); }
//! ÊÇ·ñ¿ªÆôµ÷ÊÔģʽ
inline void setPDDebug(bool param) { m_plateLocate->setDebug(param); }
//! »ñÈ¡µ÷ÊÔģʽ״̬
inline bool getPDDebug() { return m_plateLocate->getDebug(); }
//! ÉèÖÃÓë¶ÁÈ¡±äÁ¿
inline void setGaussianBlurSize(int param) {
m_plateLocate->setGaussianBlurSize(param);
}
inline int getGaussianBlurSize() const {
return m_plateLocate->getGaussianBlurSize();
}
inline void setMorphSizeWidth(int param) {
m_plateLocate->setMorphSizeWidth(param);
}
inline int getMorphSizeWidth() const {
return m_plateLocate->getMorphSizeWidth();
}
inline void setMorphSizeHeight(int param) {
m_plateLocate->setMorphSizeHeight(param);
}
inline int getMorphSizeHeight() const {
return m_plateLocate->getMorphSizeHeight();
}
inline void setVerifyError(float param) {
m_plateLocate->setVerifyError(param);
}
inline float getVerifyError() const {
return m_plateLocate->getVerifyError();
}
inline void setVerifyAspect(float param) {
m_plateLocate->setVerifyAspect(param);
}
inline float getVerifyAspect() const {
return m_plateLocate->getVerifyAspect();
}
inline void setVerifyMin(int param) { m_plateLocate->setVerifyMin(param); }
inline void setVerifyMax(int param) { m_plateLocate->setVerifyMax(param); }
inline void setJudgeAngle(int param) { m_plateLocate->setJudgeAngle(param); }
inline void setMaxPlates(int param) { m_maxPlates = param; }
inline int getMaxPlates() const { return m_maxPlates; }
private:
//! ÉèÖÃÒ»·ùͼÖÐ×î¶àÓжàÉÙ³µÅÆ
int m_maxPlates;
//! ³µÅƶ¨Î»
CPlateLocate* m_plateLocate;
};
} /*! \namespace easypr*/
#endif // EASYPR_CORE_PLATEDETECT_H_ | wrestle/EasyPR | include/easypr/core/plate_detect.h | C | apache-2.0 | 2,831 | [
30522,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/**
* @package hubzero-cms
* @copyright Copyright (c) 2005-2020 The Regents of the University of California.
* @license http://opensource.org/licenses/MIT MIT
*/
namespace Components\Forum\Api\Controllers;
use Hubzero\Component\ApiController;
use Components\Forum\Models\UsersCategory;
use Request;
use User;
require_once dirname(dirname(__DIR__)) . '/models/usersCategory.php';
class UsersCategoriesv2_0 extends ApiController
{
/**
* Create user's categories
*
* @apiMethod POST
* @apiUri /api/v2.0/forum/userscategories/create
* @apiParameter {
* "name": "category_id",
* "description": "Forum category's ID",
* "type": "integer",
* "required": true
* }
* @apiParameter {
* "name": "user_id",
* "description": "User's ID",
* "type": "integer",
* "required": true
* }
* @return TODO
*/
public function createTask()
{
$userId = Request::getInt('userId');
$currentUserId = User::get('id');
$this->_requiresMatchingUser($currentUserId, $userId);
$categoriesIds = Request::getArray('categoriesIds');
$usersCategories = $this->_instantiateUsersCategories($categoriesIds, $currentUserId);
$errors = $this->_saveUsersCategories($usersCategories);
$arrayCategories = array_map(function($usersCategory) {
return $usersCategory->toArray();
}, $usersCategories);
$result = array(
'records' => $arrayCategories,
'errors' => $errors
);
$result['status'] = empty($errors) ? 'success' : 'error';
$this->send($result);
}
/**
* Instantiate user's categories
*
* @param array $categoriesIds
* @param integer $currentUserId
* @return array
*/
protected function _instantiateUsersCategories($categoriesIds, $currentUserId)
{
$usersCategories = array_map(function($categoryId) use ($currentUserId) {
$usersCategory = UsersCategory::blank();
$usersCategory->set(array(
'category_id' => $categoryId,
'user_id' => $currentUserId
));
return $usersCategory;
}, $categoriesIds);
return $usersCategories;
}
/**
* Save user's categories
*
* @param array $usersCategories
* @return array
*/
protected function _saveUsersCategories($usersCategories)
{
$errors = array();
foreach ($usersCategories as $usersCategory)
{
if (!$usersCategory->save())
{
$instanceErrors = $usersCategory->getErrors();
array_push($errors, $instanceErrors);
}
}
return $errors;
}
/**
* Destroys user's categories
*
* @apiMethod DELETE
* @apiUri /api/v2.0/forum/userscategories/destroy
* @apiParameter {
* "name": "category_id",
* "description": "Forum category's ID",
* "type": "integer",
* "required": true
* }
* @apiParameter {
* "name": "user_id",
* "description": "User's ID",
* "type": "integer",
* "required": true
* }
* @return TODO
*/
public function destroyTask()
{
$userId = Request::getInt('userId');
$currentUserId = User::get('id');
$this->_requiresMatchingUser($currentUserId, $userId);
$categoriesIds = Request::getArray('categoriesIds');
$usersCategories = UsersCategory::all()
->whereEquals('user_id', $userId)
->whereIn('category_id', $categoriesIds);
$errors = $this->_destroyUsersCategories($usersCategories);
$arrayCategories = $usersCategories->rows()->toArray();
$result = array(
'records' => $arrayCategories,
'errors' => $errors
);
$result['status'] = empty($errors) ? 'success' : 'error';
$this->send($result);
}
/**
* Destroy user's categories
*
* @param array $usersCategories
* @return array
*/
protected function _destroyUsersCategories($usersCategories)
{
$errors = array();
foreach ($usersCategories as $usersCategory)
{
if (!$usersCategory->destroy())
{
$instanceErrors = $usersCategory->getErrors();
array_push($errors, $instanceErrors);
}
}
return $errors;
}
/**
* Check user's id
*
* @param integer $currentUserId
* @param integer $userId
* @return void
*/
protected function _requiresMatchingUser($currentUserId, $userId)
{
if ($currentUserId !== $userId)
{
$error = array(
'status' => 'error',
'error' => 'User ID mismatch, unable to proceed.'
);
$this->send($result);
}
}
}
| hubzero/hubzero-cms | core/components/com_forum/api/controllers/userscategoriesv2_0.php | PHP | gpl-2.0 | 4,385 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
1030,
7427,
9594,
6290,
2080,
1011,
4642,
2015,
1008,
1030,
9385,
9385,
1006,
1039,
1007,
2384,
1011,
12609,
1996,
22832,
1997,
1996,
2118,
1997,
2662,
1012,
1008,
1030,
6105,
8299,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
//******************************************************************************
//
// Copyright (c) 2016 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
//******************************************************************************
#pragma once
#import <UIKit/UIKitExport.h>
#import <Foundation/NSObject.h>
@class UIDocumentMenuViewController;
@class UIDocumentPickerViewController;
@protocol UIDocumentMenuDelegate <NSObject>
- (void)documentMenu:(UIDocumentMenuViewController*)documentMenu didPickDocumentPicker:(UIDocumentPickerViewController*)documentPicker;
@optional
- (void)documentMenuWasCancelled:(UIDocumentMenuViewController*)documentMenu;
@end
| pradipd/WinObjC | include/UIKit/UIDocumentMenuDelegate.h | C | mit | 1,204 | [
30522,
1013,
1013,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# - Find QT 4
# This module can be used to find Qt4.
# The most important issue is that the Qt4 qmake is available via the system path.
# This qmake is then used to detect basically everything else.
# This module defines a number of key variables and macros.
# First is QT_USE_FILE which is the path to a CMake file that can be included
# to compile Qt 4 applications and libraries. By default, the QtCore and QtGui
# libraries are loaded. This behavior can be changed by setting one or more
# of the following variables to true before doing INCLUDE(${QT_USE_FILE}):
# QT_DONT_USE_QTCORE
# QT_DONT_USE_QTGUI
# QT_USE_QT3SUPPORT
# QT_USE_QTASSISTANT
# QT_USE_QTDESIGNER
# QT_USE_QTMOTIF
# QT_USE_QTMAIN
# QT_USE_QTNETWORK
# QT_USE_QTNSPLUGIN
# QT_USE_QTOPENGL
# QT_USE_QTSQL
# QT_USE_QTXML
# QT_USE_QTSVG
# QT_USE_QTTEST
# QT_USE_QTUITOOLS
# QT_USE_QTDBUS
# QT_USE_QTSCRIPT
# QT_USE_QTASSISTANTCLIENT
# QT_USE_QTHELP
# QT_USE_QTWEBKIT
# QT_USE_QTXMLPATTERNS
# QT_USE_PHONON
#
# The file pointed to by QT_USE_FILE will set up your compile environment
# by adding include directories, preprocessor defines, and populate a
# QT_LIBRARIES variable containing all the Qt libraries and their dependencies.
# Add the QT_LIBRARIES variable to your TARGET_LINK_LIBRARIES.
#
# Typical usage could be something like:
# FIND_PACKAGE(Qt4)
# SET(QT_USE_QTXML 1)
# INCLUDE(${QT_USE_FILE})
# ADD_EXECUTABLE(myexe main.cpp)
# TARGET_LINK_LIBRARIES(myexe ${QT_LIBRARIES})
#
#
# There are also some files that need processing by some Qt tools such as moc
# and uic. Listed below are macros that may be used to process those files.
#
# macro QT4_WRAP_CPP(outfiles inputfile ... OPTIONS ...)
# create moc code from a list of files containing Qt class with
# the Q_OBJECT declaration. Options may be given to moc, such as those found
# when executing "moc -help"
#
# macro QT4_WRAP_UI(outfiles inputfile ... OPTIONS ...)
# create code from a list of Qt designer ui files.
# Options may be given to uic, such as those found
# when executing "uic -help"
#
# macro QT4_ADD_RESOURCES(outfiles inputfile ... OPTIONS ...)
# create code from a list of Qt resource files.
# Options may be given to rcc, such as those found
# when executing "rcc -help"
#
# macro QT4_GENERATE_MOC(inputfile outputfile )
# creates a rule to run moc on infile and create outfile.
# Use this if for some reason QT4_WRAP_CPP() isn't appropriate, e.g.
# because you need a custom filename for the moc file or something similar.
#
# macro QT4_AUTOMOC(sourcefile1 sourcefile2 ... )
# This macro is still experimental.
# It can be used to have moc automatically handled.
# So if you have the files foo.h and foo.cpp, and in foo.h a
# a class uses the Q_OBJECT macro, moc has to run on it. If you don't
# want to use QT4_WRAP_CPP() (which is reliable and mature), you can insert
# #include "foo.moc"
# in foo.cpp and then give foo.cpp as argument to QT4_AUTOMOC(). This will the
# scan all listed files at cmake-time for such included moc files and if it finds
# them cause a rule to be generated to run moc at build time on the
# accompanying header file foo.h.
# If a source file has the SKIP_AUTOMOC property set it will be ignored by this macro.
#
# macro QT4_ADD_DBUS_INTERFACE(outfiles interface basename)
# create a the interface header and implementation files with the
# given basename from the given interface xml file and add it to
# the list of sources.
# To disable generating a namespace header, set the source file property
# NO_NAMESPACE to TRUE on the interface file.
#
# macro QT4_ADD_DBUS_INTERFACES(outfiles inputfile ... )
# create the interface header and implementation files
# for all listed interface xml files
# the name will be automatically determined from the name of the xml file
# To disable generating namespace headers, set the source file property
# NO_NAMESPACE to TRUE for these inputfiles.
#
# macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname [basename] [classname])
# create a dbus adaptor (header and implementation file) from the xml file
# describing the interface, and add it to the list of sources. The adaptor
# forwards the calls to a parent class, defined in parentheader and named
# parentclassname. The name of the generated files will be
# <basename>adaptor.{cpp,h} where basename defaults to the basename of the xml file.
# If <classname> is provided, then it will be used as the classname of the
# adaptor itself.
#
# macro QT4_GENERATE_DBUS_INTERFACE( header [interfacename] OPTIONS ...)
# generate the xml interface file from the given header.
# If the optional argument interfacename is omitted, the name of the
# interface file is constructed from the basename of the header with
# the suffix .xml appended.
# Options may be given to qdbuscpp2xml, such as those found when executing "qdbuscpp2xml --help"
#
# QT_FOUND If false, don't try to use Qt.
# QT4_FOUND If false, don't try to use Qt 4.
#
# QT_QTCORE_FOUND True if QtCore was found.
# QT_QTGUI_FOUND True if QtGui was found.
# QT_QT3SUPPORT_FOUND True if Qt3Support was found.
# QT_QTASSISTANT_FOUND True if QtAssistant was found.
# QT_QTDBUS_FOUND True if QtDBus was found.
# QT_QTDESIGNER_FOUND True if QtDesigner was found.
# QT_QTDESIGNERCOMPONENTS True if QtDesignerComponents was found.
# QT_QTMOTIF_FOUND True if QtMotif was found.
# QT_QTNETWORK_FOUND True if QtNetwork was found.
# QT_QTNSPLUGIN_FOUND True if QtNsPlugin was found.
# QT_QTOPENGL_FOUND True if QtOpenGL was found.
# QT_QTSQL_FOUND True if QtSql was found.
# QT_QTXML_FOUND True if QtXml was found.
# QT_QTSVG_FOUND True if QtSvg was found.
# QT_QTSCRIPT_FOUND True if QtScript was found.
# QT_QTTEST_FOUND True if QtTest was found.
# QT_QTUITOOLS_FOUND True if QtUiTools was found.
# QT_QTASSISTANTCLIENT_FOUND True if QtAssistantClient was found.
# QT_QTHELP_FOUND True if QtHelp was found.
# QT_QTWEBKIT_FOUND True if QtWebKit was found.
# QT_QTXMLPATTERNS_FOUND True if QtXmlPatterns was found.
# QT_PHONON_FOUND True if phonon was found.
#
#
# QT_DEFINITIONS Definitions to use when compiling code that uses Qt.
# You do not need to use this if you include QT_USE_FILE.
# The QT_USE_FILE will also define QT_DEBUG and QT_NO_DEBUG
# to fit your current build type. Those are not contained
# in QT_DEFINITIONS.
#
# QT_INCLUDES List of paths to all include directories of
# Qt4 QT_INCLUDE_DIR and QT_QTCORE_INCLUDE_DIR are
# always in this variable even if NOTFOUND,
# all other INCLUDE_DIRS are
# only added if they are found.
# You do not need to use this if you include QT_USE_FILE.
#
#
# Include directories for the Qt modules are listed here.
# You do not need to use these variables if you include QT_USE_FILE.
#
# QT_INCLUDE_DIR Path to "include" of Qt4
# QT_QT_INCLUDE_DIR Path to "include/Qt"
# QT_QT3SUPPORT_INCLUDE_DIR Path to "include/Qt3Support"
# QT_QTASSISTANT_INCLUDE_DIR Path to "include/QtAssistant"
# QT_QTCORE_INCLUDE_DIR Path to "include/QtCore"
# QT_QTDESIGNER_INCLUDE_DIR Path to "include/QtDesigner"
# QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR Path to "include/QtDesigner"
# QT_QTDBUS_INCLUDE_DIR Path to "include/QtDBus"
# QT_QTGUI_INCLUDE_DIR Path to "include/QtGui"
# QT_QTMOTIF_INCLUDE_DIR Path to "include/QtMotif"
# QT_QTNETWORK_INCLUDE_DIR Path to "include/QtNetwork"
# QT_QTNSPLUGIN_INCLUDE_DIR Path to "include/QtNsPlugin"
# QT_QTOPENGL_INCLUDE_DIR Path to "include/QtOpenGL"
# QT_QTSQL_INCLUDE_DIR Path to "include/QtSql"
# QT_QTXML_INCLUDE_DIR Path to "include/QtXml"
# QT_QTSVG_INCLUDE_DIR Path to "include/QtSvg"
# QT_QTSCRIPT_INCLUDE_DIR Path to "include/QtScript"
# QT_QTTEST_INCLUDE_DIR Path to "include/QtTest"
# QT_QTASSISTANTCLIENT_INCLUDE_DIR Path to "include/QtAssistant"
# QT_QTHELP_INCLUDE_DIR Path to "include/QtHelp"
# QT_QTWEBKIT_INCLUDE_DIR Path to "include/QtWebKit"
# QT_QTXMLPATTERNS_INCLUDE_DIR Path to "include/QtXmlPatterns"
# QT_PHONON_INCLUDE_DIR Path to "include/phonon"
#
# QT_LIBRARY_DIR Path to "lib" of Qt4
#
# QT_PLUGINS_DIR Path to "plugins" for Qt4
#
# For every library of Qt, a QT_QTFOO_LIBRARY variable is defined, with the full path to the library.
#
# So there are the following variables:
# The Qt3Support library: QT_QT3SUPPORT_LIBRARY
#
# The QtAssistant library: QT_QTASSISTANT_LIBRARY
#
# The QtCore library: QT_QTCORE_LIBRARY
#
# The QtDBus library: QT_QTDBUS_LIBRARY
#
# The QtDesigner library: QT_QTDESIGNER_LIBRARY
#
# The QtDesignerComponents library: QT_QTDESIGNERCOMPONENTS_LIBRARY
#
# The QtGui library: QT_QTGUI_LIBRARY
#
# The QtMotif library: QT_QTMOTIF_LIBRARY
#
# The QtNetwork library: QT_QTNETWORK_LIBRARY
#
# The QtNsPLugin library: QT_QTNSPLUGIN_LIBRARY
#
# The QtOpenGL library: QT_QTOPENGL_LIBRARY
#
# The QtSql library: QT_QTSQL_LIBRARY
#
# The QtXml library: QT_QTXML_LIBRARY
#
# The QtSvg library: QT_QTSVG_LIBRARY
#
# The QtScript library: QT_QTSCRIPT_LIBRARY
#
# The QtTest library: QT_QTTEST_LIBRARY
#
# The qtmain library for Windows QT_QTMAIN_LIBRARY
#
# The QtUiTools library: QT_QTUITOOLS_LIBRARY
#
# The QtAssistantClient library: QT_QTASSISTANTCLIENT_LIBRARY
#
# The QtHelp library: QT_QTHELP_LIBRARY
#
# The QtWebKit library: QT_QTWEBKIT_LIBRARY
#
# The QtXmlPatterns library: QT_QTXMLPATTERNS_LIBRARY
#
# The Phonon library: QT_PHONON_LIBRARY
#
# also defined, but NOT for general use are
# QT_MOC_EXECUTABLE Where to find the moc tool.
# QT_UIC_EXECUTABLE Where to find the uic tool.
# QT_UIC3_EXECUTABLE Where to find the uic3 tool.
# QT_RCC_EXECUTABLE Where to find the rcc tool
# QT_DBUSCPP2XML_EXECUTABLE Where to find the qdbuscpp2xml tool.
# QT_DBUSXML2CPP_EXECUTABLE Where to find the qdbusxml2cpp tool.
# QT_LUPDATE_EXECUTABLE Where to find the lupdate tool.
# QT_LRELEASE_EXECUTABLE Where to find the lrelease tool.
#
# QT_DOC_DIR Path to "doc" of Qt4
# QT_MKSPECS_DIR Path to "mkspecs" of Qt4
#
#
# These are around for backwards compatibility
# they will be set
# QT_WRAP_CPP Set true if QT_MOC_EXECUTABLE is found
# QT_WRAP_UI Set true if QT_UIC_EXECUTABLE is found
#
# These variables do _NOT_ have any effect anymore (compared to FindQt.cmake)
# QT_MT_REQUIRED Qt4 is now always multithreaded
#
# These variables are set to "" Because Qt structure changed
# (They make no sense in Qt4)
# QT_QT_LIBRARY Qt-Library is now split
# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
# See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
if (QT4_QMAKE_FOUND)
# Check already done in this cmake run, nothing more to do
else (QT4_QMAKE_FOUND)
# check that QT_NO_DEBUG is defined for release configurations
MACRO(QT_CHECK_FLAG_EXISTS FLAG VAR DOC)
IF(NOT ${VAR} MATCHES "${FLAG}")
SET(${VAR} "${${VAR}} ${FLAG}"
CACHE STRING "Flags used by the compiler during ${DOC} builds." FORCE)
ENDIF(NOT ${VAR} MATCHES "${FLAG}")
ENDMACRO(QT_CHECK_FLAG_EXISTS FLAG VAR)
QT_CHECK_FLAG_EXISTS(-DQT_NO_DEBUG CMAKE_CXX_FLAGS_RELWITHDEBINFO "Release with Debug Info")
QT_CHECK_FLAG_EXISTS(-DQT_NO_DEBUG CMAKE_CXX_FLAGS_RELEASE "release")
QT_CHECK_FLAG_EXISTS(-DQT_NO_DEBUG CMAKE_CXX_FLAGS_MINSIZEREL "release minsize")
INCLUDE(CheckSymbolExists)
INCLUDE(MacroAddFileDependencies)
INCLUDE(MacroPushRequiredVars)
SET(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
SET( QT_DEFINITIONS "")
IF (WIN32)
SET(QT_DEFINITIONS -DQT_DLL)
ENDIF(WIN32)
SET(QT4_INSTALLED_VERSION_TOO_OLD FALSE)
# macro for asking qmake to process pro files
MACRO(QT_QUERY_QMAKE outvar invar)
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake/tmp.pro
"message(CMAKE_MESSAGE<$$${invar}>)")
# Invoke qmake with the tmp.pro program to get the desired
# information. Use the same variable for both stdout and stderr
# to make sure we get the output on all platforms.
EXECUTE_PROCESS(COMMAND ${QT_QMAKE_EXECUTABLE}
WORKING_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake
OUTPUT_VARIABLE _qmake_query_output
RESULT_VARIABLE _qmake_result
ERROR_VARIABLE _qmake_query_output )
FILE(REMOVE_RECURSE
"${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake")
IF(_qmake_result)
MESSAGE(WARNING " querying qmake for ${invar}. qmake reported:\n${_qmake_query_output}")
ELSE(_qmake_result)
STRING(REGEX REPLACE ".*CMAKE_MESSAGE<([^>]*).*" "\\1" ${outvar} "${_qmake_query_output}")
ENDIF(_qmake_result)
ENDMACRO(QT_QUERY_QMAKE)
GET_FILENAME_COMPONENT(qt_install_version "[HKEY_CURRENT_USER\\Software\\trolltech\\Versions;DefaultQtVersion]" NAME)
# check for qmake
FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 PATHS
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\${qt_install_version};InstallDir]/bin"
$ENV{QTDIR}/bin
)
IF (QT_QMAKE_EXECUTABLE)
SET(QT4_QMAKE_FOUND FALSE)
EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_VERSION" OUTPUT_VARIABLE QTVERSION)
# check for qt3 qmake and then try and find qmake4 or qmake-qt4 in the path
IF("${QTVERSION}" MATCHES "Unknown")
SET(QT_QMAKE_EXECUTABLE NOTFOUND CACHE FILEPATH "" FORCE)
FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake4 qmake-qt4 PATHS
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
$ENV{QTDIR}/bin
)
IF(QT_QMAKE_EXECUTABLE)
EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE}
ARGS "-query QT_VERSION" OUTPUT_VARIABLE QTVERSION)
ENDIF(QT_QMAKE_EXECUTABLE)
ENDIF("${QTVERSION}" MATCHES "Unknown")
# check that we found the Qt4 qmake, Qt3 qmake output won't match here
STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" qt_version_tmp "${QTVERSION}")
IF (qt_version_tmp)
# we need at least version 4.0.0
IF (NOT QT_MIN_VERSION)
SET(QT_MIN_VERSION "4.0.0")
ENDIF (NOT QT_MIN_VERSION)
#now parse the parts of the user given version string into variables
STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" req_qt_major_vers "${QT_MIN_VERSION}")
IF (NOT req_qt_major_vers)
MESSAGE( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", expected e.g. \"4.0.1\"")
ENDIF (NOT req_qt_major_vers)
# now parse the parts of the user given version string into variables
STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" req_qt_major_vers "${QT_MIN_VERSION}")
STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" req_qt_minor_vers "${QT_MIN_VERSION}")
STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" req_qt_patch_vers "${QT_MIN_VERSION}")
IF (NOT req_qt_major_vers EQUAL 4)
MESSAGE( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", major version 4 is required, e.g. \"4.0.1\"")
ENDIF (NOT req_qt_major_vers EQUAL 4)
# and now the version string given by qmake
STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" found_qt_major_vers "${QTVERSION}")
STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" found_qt_minor_vers "${QTVERSION}")
STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" found_qt_patch_vers "${QTVERSION}")
# compute an overall version number which can be compared at once
MATH(EXPR req_vers "${req_qt_major_vers}*10000 + ${req_qt_minor_vers}*100 + ${req_qt_patch_vers}")
MATH(EXPR found_vers "${found_qt_major_vers}*10000 + ${found_qt_minor_vers}*100 + ${found_qt_patch_vers}")
IF (found_vers LESS req_vers)
SET(QT4_QMAKE_FOUND FALSE)
SET(QT4_INSTALLED_VERSION_TOO_OLD TRUE)
ELSE (found_vers LESS req_vers)
SET(QT4_QMAKE_FOUND TRUE)
ENDIF (found_vers LESS req_vers)
ENDIF (qt_version_tmp)
ENDIF (QT_QMAKE_EXECUTABLE)
IF (QT4_QMAKE_FOUND)
if (WIN32)
# get qt install dir
get_filename_component(_DIR ${QT_QMAKE_EXECUTABLE} PATH )
get_filename_component(QT_INSTALL_DIR ${_DIR} PATH )
endif (WIN32)
# ask qmake for the library dir
# Set QT_LIBRARY_DIR
IF (NOT QT_LIBRARY_DIR)
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
ARGS "-query QT_INSTALL_LIBS"
OUTPUT_VARIABLE QT_LIBRARY_DIR_TMP )
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH "${QT_LIBRARY_DIR_TMP}" QT_LIBRARY_DIR_TMP)
IF(EXISTS "${QT_LIBRARY_DIR_TMP}")
SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE PATH "Qt library dir")
ELSE(EXISTS "${QT_LIBRARY_DIR_TMP}")
MESSAGE("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_LIBS as ${QT_LIBRARY_DIR_TMP}")
MESSAGE("Warning: ${QT_LIBRARY_DIR_TMP} does NOT exist, Qt must NOT be installed correctly.")
ENDIF(EXISTS "${QT_LIBRARY_DIR_TMP}")
ENDIF(NOT QT_LIBRARY_DIR)
IF (APPLE)
IF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
SET(QT_USE_FRAMEWORKS ON
CACHE BOOL "Set to ON if Qt build uses frameworks.")
ELSE (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
SET(QT_USE_FRAMEWORKS OFF
CACHE BOOL "Set to ON if Qt build uses frameworks.")
ENDIF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
MARK_AS_ADVANCED(QT_USE_FRAMEWORKS)
ENDIF (APPLE)
# ask qmake for the binary dir
IF (QT_LIBRARY_DIR AND NOT QT_BINARY_DIR)
EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE}
ARGS "-query QT_INSTALL_BINS"
OUTPUT_VARIABLE qt_bins )
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH "${qt_bins}" qt_bins)
SET(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "")
ENDIF (QT_LIBRARY_DIR AND NOT QT_BINARY_DIR)
# ask qmake for the include dir
IF (QT_LIBRARY_DIR AND NOT QT_HEADERS_DIR)
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
ARGS "-query QT_INSTALL_HEADERS"
OUTPUT_VARIABLE qt_headers )
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH "${qt_headers}" qt_headers)
SET(QT_HEADERS_DIR ${qt_headers} CACHE INTERNAL "")
ENDIF(QT_LIBRARY_DIR AND NOT QT_HEADERS_DIR)
# ask qmake for the documentation directory
IF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR)
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
ARGS "-query QT_INSTALL_DOCS"
OUTPUT_VARIABLE qt_doc_dir )
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH "${qt_doc_dir}" qt_doc_dir)
SET(QT_DOC_DIR ${qt_doc_dir} CACHE PATH "The location of the Qt docs")
ENDIF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR)
# ask qmake for the mkspecs directory
IF (QT_LIBRARY_DIR AND NOT QT_MKSPECS_DIR)
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
ARGS "-query QMAKE_MKSPECS"
OUTPUT_VARIABLE qt_mkspecs_dirs )
# do not replace : on windows as it might be a drive letter
# and windows should already use ; as a separator
IF(UNIX)
STRING(REPLACE ":" ";" qt_mkspecs_dirs "${qt_mkspecs_dirs}")
ENDIF(UNIX)
FIND_PATH(QT_MKSPECS_DIR qconfig.pri PATHS ${qt_mkspecs_dirs}
DOC "The location of the Qt mkspecs containing qconfig.pri"
NO_DEFAULT_PATH )
ENDIF (QT_LIBRARY_DIR AND NOT QT_MKSPECS_DIR)
# ask qmake for the plugins directory
IF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR)
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
ARGS "-query QT_INSTALL_PLUGINS"
OUTPUT_VARIABLE qt_plugins_dir )
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH "${qt_plugins_dir}" qt_plugins_dir)
SET(QT_PLUGINS_DIR ${qt_plugins_dir} CACHE PATH "The location of the Qt plugins")
ENDIF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR)
########################################
#
# Setting the INCLUDE-Variables
#
########################################
FIND_PATH(QT_QTCORE_INCLUDE_DIR QtGlobal
${QT_HEADERS_DIR}/QtCore
${QT_LIBRARY_DIR}/QtCore.framework/Headers
NO_DEFAULT_PATH
)
# Set QT_INCLUDE_DIR by removine "/QtCore" in the string ${QT_QTCORE_INCLUDE_DIR}
IF( QT_QTCORE_INCLUDE_DIR AND NOT QT_INCLUDE_DIR)
IF (QT_USE_FRAMEWORKS)
SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR})
ELSE (QT_USE_FRAMEWORKS)
STRING( REGEX REPLACE "/QtCore$" "" qt4_include_dir ${QT_QTCORE_INCLUDE_DIR})
SET( QT_INCLUDE_DIR ${qt4_include_dir} CACHE PATH "")
ENDIF (QT_USE_FRAMEWORKS)
ENDIF( QT_QTCORE_INCLUDE_DIR AND NOT QT_INCLUDE_DIR)
IF( NOT QT_INCLUDE_DIR)
IF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
MESSAGE( FATAL_ERROR "Could NOT find QtGlobal header")
ENDIF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
ENDIF( NOT QT_INCLUDE_DIR)
#############################################
#
# Find out what window system we're using
#
#############################################
# Save required includes and required_flags variables
macro_push_required_vars()
# Add QT_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES
SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}")
# On Mac OS X when Qt has framework support, also add the framework path
IF( QT_USE_FRAMEWORKS )
SET(CMAKE_REQUIRED_FLAGS "-F${QT_LIBRARY_DIR} ")
ENDIF( QT_USE_FRAMEWORKS )
# Check for Window system symbols (note: only one should end up being set)
CHECK_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11)
CHECK_SYMBOL_EXISTS(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN)
CHECK_SYMBOL_EXISTS(Q_WS_QWS "QtCore/qglobal.h" Q_WS_QWS)
CHECK_SYMBOL_EXISTS(Q_WS_MAC "QtCore/qglobal.h" Q_WS_MAC)
IF (QT_QTCOPY_REQUIRED)
CHECK_SYMBOL_EXISTS(QT_IS_QTCOPY "QtCore/qglobal.h" QT_KDE_QT_COPY)
IF (NOT QT_IS_QTCOPY)
MESSAGE(FATAL_ERROR "qt-copy is required, but hasn't been found")
ENDIF (NOT QT_IS_QTCOPY)
ENDIF (QT_QTCOPY_REQUIRED)
# Restore CMAKE_REQUIRED_INCLUDES+CMAKE_REQUIRED_FLAGS variables
macro_pop_required_vars()
#
#############################################
IF (QT_USE_FRAMEWORKS)
SET(QT_DEFINITIONS ${QT_DEFINITIONS} -F${QT_LIBRARY_DIR} -L${QT_LIBRARY_DIR} )
ENDIF (QT_USE_FRAMEWORKS)
# Set QT_QT3SUPPORT_INCLUDE_DIR
FIND_PATH(QT_QT3SUPPORT_INCLUDE_DIR Qt3Support
PATHS
${QT_INCLUDE_DIR}/Qt3Support
${QT_LIBRARY_DIR}/Qt3Support.framework/Headers
NO_DEFAULT_PATH
)
# Set QT_QT_INCLUDE_DIR
FIND_PATH(QT_QT_INCLUDE_DIR qglobal.h
PATHS
${QT_INCLUDE_DIR}/Qt
${QT_LIBRARY_DIR}/QtCore.framework/Headers
NO_DEFAULT_PATH
)
# Set QT_QTGUI_INCLUDE_DIR
FIND_PATH(QT_QTGUI_INCLUDE_DIR QtGui
PATHS
${QT_INCLUDE_DIR}/QtGui
${QT_LIBRARY_DIR}/QtGui.framework/Headers
NO_DEFAULT_PATH
)
# Set QT_QTSVG_INCLUDE_DIR
FIND_PATH(QT_QTSVG_INCLUDE_DIR QtSvg
PATHS
${QT_INCLUDE_DIR}/QtSvg
${QT_LIBRARY_DIR}/QtSvg.framework/Headers
NO_DEFAULT_PATH
)
# Set QT_QTSCRIPT_INCLUDE_DIR
FIND_PATH(QT_QTSCRIPT_INCLUDE_DIR QtScript
PATHS
${QT_INCLUDE_DIR}/QtScript
${QT_LIBRARY_DIR}/QtScript.framework/Headers
NO_DEFAULT_PATH
)
# Set QT_QTTEST_INCLUDE_DIR
FIND_PATH(QT_QTTEST_INCLUDE_DIR QtTest
PATHS
${QT_INCLUDE_DIR}/QtTest
${QT_LIBRARY_DIR}/QtTest.framework/Headers
NO_DEFAULT_PATH
)
# Set QT_QTUITOOLS_INCLUDE_DIR
FIND_PATH(QT_QTUITOOLS_INCLUDE_DIR QtUiTools
PATHS
${QT_INCLUDE_DIR}/QtUiTools
${QT_LIBRARY_DIR}/QtUiTools.framework/Headers
NO_DEFAULT_PATH
)
# Set QT_QTMOTIF_INCLUDE_DIR
IF(Q_WS_X11)
FIND_PATH(QT_QTMOTIF_INCLUDE_DIR QtMotif
PATHS
${QT_INCLUDE_DIR}/QtMotif
NO_DEFAULT_PATH )
ENDIF(Q_WS_X11)
# Set QT_QTNETWORK_INCLUDE_DIR
FIND_PATH(QT_QTNETWORK_INCLUDE_DIR QtNetwork
PATHS
${QT_INCLUDE_DIR}/QtNetwork
${QT_LIBRARY_DIR}/QtNetwork.framework/Headers
NO_DEFAULT_PATH
)
# Set QT_QTNSPLUGIN_INCLUDE_DIR
FIND_PATH(QT_QTNSPLUGIN_INCLUDE_DIR QtNsPlugin
PATHS
${QT_INCLUDE_DIR}/QtNsPlugin
${QT_LIBRARY_DIR}/QtNsPlugin.framework/Headers
NO_DEFAULT_PATH
)
# Set QT_QTOPENGL_INCLUDE_DIR
FIND_PATH(QT_QTOPENGL_INCLUDE_DIR QtOpenGL
PATHS
${QT_INCLUDE_DIR}/QtOpenGL
${QT_LIBRARY_DIR}/QtOpenGL.framework/Headers
NO_DEFAULT_PATH
)
# Set QT_QTSQL_INCLUDE_DIR
FIND_PATH(QT_QTSQL_INCLUDE_DIR QtSql
PATHS
${QT_INCLUDE_DIR}/QtSql
${QT_LIBRARY_DIR}/QtSql.framework/Headers
NO_DEFAULT_PATH
)
# Set QT_QTXML_INCLUDE_DIR
FIND_PATH(QT_QTXML_INCLUDE_DIR QtXml
PATHS
${QT_INCLUDE_DIR}/QtXml
${QT_LIBRARY_DIR}/QtXml.framework/Headers
NO_DEFAULT_PATH
)
# Set QT_QTASSISTANT_INCLUDE_DIR
FIND_PATH(QT_QTASSISTANT_INCLUDE_DIR QtAssistant
PATHS
${QT_INCLUDE_DIR}/QtAssistant
${QT_HEADERS_DIR}/QtAssistant
${QT_LIBRARY_DIR}/QtAssistant.framework/Headers
NO_DEFAULT_PATH
)
# Set QT_QTDESIGNER_INCLUDE_DIR
FIND_PATH(QT_QTDESIGNER_INCLUDE_DIR QDesignerComponents
PATHS
${QT_INCLUDE_DIR}/QtDesigner
${QT_HEADERS_DIR}/QtDesigner
${QT_LIBRARY_DIR}/QtDesigner.framework/Headers
NO_DEFAULT_PATH
)
# Set QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR
FIND_PATH(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR QDesignerComponents
PATHS
${QT_INCLUDE_DIR}/QtDesigner
${QT_HEADERS_DIR}/QtDesigner
NO_DEFAULT_PATH
)
# Set QT_QTDBUS_INCLUDE_DIR
FIND_PATH(QT_QTDBUS_INCLUDE_DIR QtDBus
PATHS
${QT_INCLUDE_DIR}/QtDBus
${QT_HEADERS_DIR}/QtDBus
${QT_LIBRARY_DIR}/QtDBus.framework/Headers
NO_DEFAULT_PATH
)
# Set QT_QTASSISTANTCLIENT_INCLUDE_DIR
FIND_PATH(QT_QTASSISTANTCLIENT_INCLUDE_DIR QAssistantClient
PATHS
${QT_INCLUDE_DIR}/QtAssistant
${QT_HEADERS_DIR}/QtAssistant
NO_DEFAULT_PATH
)
# Set QT_QTHELP_INCLUDE_DIR
FIND_PATH(QT_QTHELP_INCLUDE_DIR QtHelp
PATHS
${QT_INCLUDE_DIR}/QtHelp
${QT_HEADERS_DIR}/QtHelp
NO_DEFAULT_PATH
)
# Set QT_QTWEBKIT_INCLUDE_DIR
FIND_PATH(QT_QTWEBKIT_INCLUDE_DIR QtWebKit
PATHS
${QT_INCLUDE_DIR}/QtWebKit
${QT_HEADERS_DIR}/QtWebKit
NO_DEFAULT_PATH
)
# Set QT_QTXMLPATTERNS_INCLUDE_DIR
FIND_PATH(QT_QTXMLPATTERNS_INCLUDE_DIR QtXmlPatterns
PATHS
${QT_INCLUDE_DIR}/QtXmlPatterns
${QT_HEADERS_DIR}/QtXmlPatterns
NO_DEFAULT_PATH
)
# Set QT_PHONON_INCLUDE_DIR
FIND_PATH(QT_PHONON_INCLUDE_DIR phonon
PATHS
${QT_INCLUDE_DIR}/phonon
NO_DEFAULT_PATH
)
# Make variables changeble to the advanced user
MARK_AS_ADVANCED( QT_LIBRARY_DIR QT_INCLUDE_DIR QT_QT_INCLUDE_DIR QT_DOC_DIR QT_MKSPECS_DIR QT_PLUGINS_DIR)
# Set QT_INCLUDES
SET( QT_INCLUDES ${QT_QT_INCLUDE_DIR} ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} )
########################################
#
# Setting the LIBRARY-Variables
#
########################################
IF (QT_USE_FRAMEWORKS)
# If FIND_LIBRARY found libraries in Apple frameworks, we would NOT have
# to jump through these hoops.
IF(EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
SET(QT_QTCORE_FOUND TRUE)
SET(QT_QTCORE_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtCore" CACHE STRING "The QtCore library.")
ELSE(EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
SET(QT_QTCORE_FOUND FALSE)
ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
IF(EXISTS ${QT_LIBRARY_DIR}/QtGui.framework)
SET(QT_QTGUI_FOUND TRUE)
SET(QT_QTGUI_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtGui" CACHE STRING "The QtGui library.")
ELSE(EXISTS ${QT_LIBRARY_DIR}/QtGui.framework)
SET(QT_QTGUI_FOUND FALSE)
ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtGui.framework)
IF(EXISTS ${QT_LIBRARY_DIR}/Qt3Support.framework)
SET(QT_QT3SUPPORT_FOUND TRUE)
SET(QT_QT3SUPPORT_LIBRARY "-F${QT_LIBRARY_DIR} -framework Qt3Support" CACHE STRING "The Qt3Support library.")
ELSE(EXISTS ${QT_LIBRARY_DIR}/Qt3Support.framework)
SET(QT_QT3SUPPORT_FOUND FALSE)
ENDIF(EXISTS ${QT_LIBRARY_DIR}/Qt3Support.framework)
IF(EXISTS ${QT_LIBRARY_DIR}/QtNetwork.framework)
SET(QT_QTNETWORK_FOUND TRUE)
SET(QT_QTNETWORK_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtNetwork" CACHE STRING "The QtNetwork library.")
ELSE(EXISTS ${QT_LIBRARY_DIR}/QtNetwork.framework)
SET(QT_QTNETWORK_FOUND FALSE)
ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtNetwork.framework)
IF(EXISTS ${QT_LIBRARY_DIR}/QtOpenGL.framework)
SET(QT_QTOPENGL_FOUND TRUE)
SET(QT_QTOPENGL_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtOpenGL" CACHE STRING "The QtOpenGL library.")
ELSE(EXISTS ${QT_LIBRARY_DIR}/QtOpenGL.framework)
SET(QT_QTOPENGL_FOUND FALSE)
ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtOpenGL.framework)
IF(EXISTS ${QT_LIBRARY_DIR}/QtSql.framework)
SET(QT_QTSQL_FOUND TRUE)
SET(QT_QTSQL_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtSql" CACHE STRING "The QtSql library.")
ELSE(EXISTS ${QT_LIBRARY_DIR}/QtSql.framework)
SET(QT_QTSQL_FOUND FALSE)
ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtSql.framework)
IF(EXISTS ${QT_LIBRARY_DIR}/QtXml.framework)
SET(QT_QTXML_FOUND TRUE)
SET(QT_QTXML_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtXml" CACHE STRING "The QtXml library.")
ELSE(EXISTS ${QT_LIBRARY_DIR}/QtXml.framework)
SET(QT_QTXML_FOUND FALSE)
ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtXml.framework)
IF(EXISTS ${QT_LIBRARY_DIR}/QtSvg.framework)
SET(QT_QTSVG_FOUND TRUE)
SET(QT_QTSVG_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtSvg" CACHE STRING "The QtSvg library.")
ELSE(EXISTS ${QT_LIBRARY_DIR}/QtSvg.framework)
SET(QT_QTSVG_FOUND FALSE)
ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtSvg.framework)
IF(EXISTS ${QT_LIBRARY_DIR}/QtDBus.framework)
SET(QT_QTDBUS_FOUND TRUE)
SET(QT_QTDBUS_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtDBus" CACHE STRING "The QtDBus library.")
ELSE(EXISTS ${QT_LIBRARY_DIR}/QtDBus.framework)
SET(QT_QTDBUS_FOUND FALSE)
ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtDBus.framework)
IF(EXISTS ${QT_LIBRARY_DIR}/QtTest.framework)
SET(QT_QTTEST_FOUND TRUE)
SET(QT_QTTEST_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtTest" CACHE STRING "The QtTest library.")
ELSE(EXISTS ${QT_LIBRARY_DIR}/QtTest.framework)
SET(QT_QTTEST_FOUND FALSE)
ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtTest.framework)
IF(EXISTS ${QT_LIBRARY_DIR}/QtAssistantClient.framework)
SET(QT_QTASSISTANTCLIENT_FOUND TRUE)
SET(QT_QTASSISTANTCLIENT_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtAssistantClient" CACHE STRING "The QtAssistantClient library.")
ELSE(EXISTS ${QT_LIBRARY_DIR}/QtAssistantClient.framework)
SET(QT_QTASSISTANTCLIENT_FOUND FALSE)
ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtAssistantClient.framework)
IF(EXISTS ${QT_LIBRARY_DIR}/QtWebKit.framework)
SET(QT_QTWEBKIT_FOUND TRUE)
SET(QT_QTWEBKIT_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtWebKit" CACHE STRING "The QtWebKit library.")
ELSE(EXISTS ${QT_LIBRARY_DIR}/QtWebKit.framework)
SET(QT_QTWEBKIT_FOUND FALSE)
ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtWebKit.framework)
IF(EXISTS ${QT_LIBRARY_DIR}/QtXmlPatterns.framework)
SET(QT_QTXMLPATTERNS_FOUND TRUE)
SET(QT_QTXMLPATTERNS_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtXmlPatterns" CACHE STRING "The QtXmlPatterns library.")
ELSE(EXISTS ${QT_LIBRARY_DIR}/QtXmlPatterns.framework)
SET(QT_QTXMLPATTERNS_FOUND FALSE)
ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtXmlPatterns.framework)
# WTF? why don't we have frameworks? :P
# Set QT_QTUITOOLS_LIBRARY
FIND_LIBRARY(QT_QTUITOOLS_LIBRARY NAMES QtUiTools QtUiTools4 PATHS ${QT_LIBRARY_DIR} )
# Set QT_QTSCRIPT_LIBRARY
FIND_LIBRARY(QT_QTSCRIPT_LIBRARY NAMES QtScript QtScript4 PATHS ${QT_LIBRARY_DIR} )
ELSE (QT_USE_FRAMEWORKS)
# Set QT_QTCORE_LIBRARY by searching for a lib with "QtCore." as part of the filename
FIND_LIBRARY(QT_QTCORE_LIBRARY NAMES QtCore QtCore4 QtCored4 QtCore_debug PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH )
# Set QT_QT3SUPPORT_LIBRARY
FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY NAMES Qt3Support Qt3Support_debug Qt3Support4 Qt3Supportd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTGUI_LIBRARY
FIND_LIBRARY(QT_QTGUI_LIBRARY NAMES QtGui QtGui_debug QtGui_debug QtGui4 QtGuid4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTMOTIF_LIBRARY
IF(Q_WS_X11)
FIND_LIBRARY(QT_QTMOTIF_LIBRARY NAMES QtMotif QtMotif_debug PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
ENDIF(Q_WS_X11)
# Set QT_QTNETWORK_LIBRARY
FIND_LIBRARY(QT_QTNETWORK_LIBRARY NAMES QtNetwork QtNetwork_debug QtNetwork4 QtNetworkd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTNSPLUGIN_LIBRARY
FIND_LIBRARY(QT_QTNSPLUGIN_LIBRARY NAMES QtNsPlugin QtNsPlugin_debug PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTOPENGL_LIBRARY
FIND_LIBRARY(QT_QTOPENGL_LIBRARY NAMES QtOpenGL QtOpenGL_debug QtOpenGL4 QtOpenGLd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTSQL_LIBRARY
FIND_LIBRARY(QT_QTSQL_LIBRARY NAMES QtSql QtSql_debug QtSql4 QtSqld4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTXML_LIBRARY
FIND_LIBRARY(QT_QTXML_LIBRARY NAMES QtXml QtXml_debug QtXml4 QtXmld4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTSVG_LIBRARY
FIND_LIBRARY(QT_QTSVG_LIBRARY NAMES QtSvg QtSvg_debug QtSvg4 QtSvgd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTSCRIPT_LIBRARY
FIND_LIBRARY(QT_QTSCRIPT_LIBRARY NAMES QtScript QtScript_debug QtScript4 QtScriptd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTUITOOLS_LIBRARY
FIND_LIBRARY(QT_QTUITOOLS_LIBRARY NAMES QtUiTools QtUiTools_debug QtUiTools4 QtUiToolsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTTEST_LIBRARY
FIND_LIBRARY(QT_QTTEST_LIBRARY NAMES QtTest QtTest_debug QtTest4 QtTestd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTDBUS_LIBRARY NAMES QtDBus QtDBus_debug QtDBus4 QtDBusd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY NAMES QtAssistantClient QtAssistantClient_debug QtAssistantClient4 QtAssistantClientd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTHELP_LIBRARY NAMES QtHelp QtHelp_debug QtHelp4 QtHelpd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTWEBKIT_LIBRARY NAMES QtWebKit QtWebKit_debug QtWebKit4 QtWebKitd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTXMLPATTERNS_LIBRARY NAMES QtXmlPatterns QtXmlPatterns_debug QtXmlPatterns4 QtXmlPatternsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_PHONON_LIBRARY NAMES phonon phonon4 phonon_debug phonond4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
IF(MSVC)
FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE NAMES QtCore4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG NAMES QtCored4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY_RELEASE NAMES Qt3Support4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY_DEBUG NAMES Qt3Supportd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTGUI_LIBRARY_RELEASE NAMES QtGui4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTGUI_LIBRARY_DEBUG NAMES QtGuid4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTNETWORK_LIBRARY_RELEASE NAMES QtNetwork4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTNETWORK_LIBRARY_DEBUG NAMES QtNetworkd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTOPENGL_LIBRARY_RELEASE NAMES QtOpenGL4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTOPENGL_LIBRARY_DEBUG NAMES QtOpenGLd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTSQL_LIBRARY_RELEASE NAMES QtSql4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTSQL_LIBRARY_DEBUG NAMES QtSqld4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTXML_LIBRARY_RELEASE NAMES QtXml4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTXML_LIBRARY_DEBUG NAMES QtXmld4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTSVG_LIBRARY_RELEASE NAMES QtSvg4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTSVG_LIBRARY_DEBUG NAMES QtSvgd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTSCRIPT_LIBRARY_RELEASE NAMES QtScript4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTSCRIPT_LIBRARY_DEBUG NAMES QtScriptd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_RELEASE NAMES QtUiTools QtUiTools4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_DEBUG NAMES QtUiToolsd QtUiToolsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTTEST_LIBRARY_RELEASE NAMES QtTest4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTTEST_LIBRARY_DEBUG NAMES QtTestd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTDBUS_LIBRARY_RELEASE NAMES QtDBus4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTDBUS_LIBRARY_DEBUG NAMES QtDBusd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_DEBUG NAMES QtAssistantClientd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTDESIGNER_LIBRARY_RELEASE NAMES QtDesigner4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTDESIGNER_LIBRARY_DEBUG NAMES QtDesignerd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NAMES QtDesignerComponentsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmaind PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
ENDIF(MSVC)
ENDIF (QT_USE_FRAMEWORKS)
IF( NOT QT_QTCORE_LIBRARY )
IF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
ENDIF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
ENDIF( NOT QT_QTCORE_LIBRARY )
# Set QT_QTASSISTANT_LIBRARY
FIND_LIBRARY(QT_QTASSISTANT_LIBRARY NAMES QtAssistantClient QtAssistantClient4 QtAssistant QtAssistant4 QtAssistantd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTDESIGNER_LIBRARY
FIND_LIBRARY(QT_QTDESIGNER_LIBRARY NAMES QtDesigner QtDesigner_debug QtDesigner4 QtDesignerd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTDESIGNERCOMPONENTS_LIBRARY
FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY NAMES QtDesignerComponents QtDesignerComponents_debug QtDesignerComponents4 QtDesignerComponentsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTMAIN_LIBRARY
IF(WIN32)
FIND_LIBRARY(QT_QTMAIN_LIBRARY NAMES qtmain qtmaind PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
ENDIF(WIN32)
############################################
#
# Check the existence of the libraries.
#
############################################
MACRO (_QT4_ADJUST_LIB_VARS basename)
IF (QT_${basename}_LIBRARY OR QT_${basename}_LIBRARY_DEBUG)
IF(MSVC)
# Both set
IF (QT_${basename}_LIBRARY_RELEASE AND QT_${basename}_LIBRARY_DEBUG)
SET(QT_${basename}_LIBRARY optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
ENDIF (QT_${basename}_LIBRARY_RELEASE AND QT_${basename}_LIBRARY_DEBUG)
# Only debug was found
IF (NOT QT_${basename}_LIBRARY_RELEASE AND QT_${basename}_LIBRARY_DEBUG)
SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_DEBUG})
ENDIF (NOT QT_${basename}_LIBRARY_RELEASE AND QT_${basename}_LIBRARY_DEBUG)
# Only release was found
IF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE})
ENDIF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
# Hmm, is this used anywhere ? Yes, in UseQt4.cmake. We are currently incompatible :-(
SET(QT_${basename}_LIBRARIES optimized ${QT_${basename}_LIBRARY} debug ${QT_${basename}_LIBRARY_DEBUG})
ENDIF(MSVC)
SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE FILEPATH "The Qt ${basename} library")
IF (QT_${basename}_LIBRARY)
SET(QT_${basename}_FOUND 1)
ENDIF (QT_${basename}_LIBRARY)
ENDIF (QT_${basename}_LIBRARY OR QT_${basename}_LIBRARY_DEBUG)
IF (QT_${basename}_INCLUDE_DIR)
#add the include directory to QT_INCLUDES
SET(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES})
ENDIF (QT_${basename}_INCLUDE_DIR)
# Make variables changeble to the advanced user
MARK_AS_ADVANCED(QT_${basename}_LIBRARY QT_${basename}_INCLUDE_DIR)
ENDMACRO (_QT4_ADJUST_LIB_VARS)
# Set QT_xyz_LIBRARY variable and add
# library include path to QT_INCLUDES
_QT4_ADJUST_LIB_VARS(QTCORE)
_QT4_ADJUST_LIB_VARS(QTGUI)
_QT4_ADJUST_LIB_VARS(QT3SUPPORT)
_QT4_ADJUST_LIB_VARS(QTASSISTANT)
_QT4_ADJUST_LIB_VARS(QTDESIGNER)
_QT4_ADJUST_LIB_VARS(QTDESIGNERCOMPONENTS)
_QT4_ADJUST_LIB_VARS(QTNETWORK)
_QT4_ADJUST_LIB_VARS(QTNSPLUGIN)
_QT4_ADJUST_LIB_VARS(QTOPENGL)
_QT4_ADJUST_LIB_VARS(QTSQL)
_QT4_ADJUST_LIB_VARS(QTXML)
_QT4_ADJUST_LIB_VARS(QTSVG)
_QT4_ADJUST_LIB_VARS(QTSCRIPT)
_QT4_ADJUST_LIB_VARS(QTUITOOLS)
_QT4_ADJUST_LIB_VARS(QTTEST)
_QT4_ADJUST_LIB_VARS(QTDBUS)
_QT4_ADJUST_LIB_VARS(QTASSISTANTCLIENT)
_QT4_ADJUST_LIB_VARS(QTHELP)
_QT4_ADJUST_LIB_VARS(QTWEBKIT)
_QT4_ADJUST_LIB_VARS(QTXMLPATTERNS)
_QT4_ADJUST_LIB_VARS(PHONON)
# platform dependent libraries
IF(Q_WS_X11)
_QT4_ADJUST_LIB_VARS(QTMOTIF)
ENDIF(Q_WS_X11)
IF(WIN32)
_QT4_ADJUST_LIB_VARS(QTMAIN)
ENDIF(WIN32)
#######################################
#
# Check the executables of Qt
# ( moc, uic, rcc )
#
#######################################
# find moc and uic using qmake
QT_QUERY_QMAKE(QT_MOC_EXECUTABLE_INTERNAL "QMAKE_MOC")
QT_QUERY_QMAKE(QT_UIC_EXECUTABLE_INTERNAL "QMAKE_UIC")
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH
"${QT_MOC_EXECUTABLE_INTERNAL}" QT_MOC_EXECUTABLE_INTERNAL)
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH
"${QT_UIC_EXECUTABLE_INTERNAL}" QT_UIC_EXECUTABLE_INTERNAL)
SET(QT_MOC_EXECUTABLE
${QT_MOC_EXECUTABLE_INTERNAL} CACHE FILEPATH "The moc executable")
SET(QT_UIC_EXECUTABLE
${QT_UIC_EXECUTABLE_INTERNAL} CACHE FILEPATH "The uic executable")
FIND_PROGRAM(QT_UIC3_EXECUTABLE
NAMES uic3
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)
FIND_PROGRAM(QT_RCC_EXECUTABLE
NAMES rcc
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)
FIND_PROGRAM(QT_DBUSCPP2XML_EXECUTABLE
NAMES qdbuscpp2xml
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)
FIND_PROGRAM(QT_DBUSXML2CPP_EXECUTABLE
NAMES qdbusxml2cpp
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)
FIND_PROGRAM(QT_LUPDATE_EXECUTABLE
NAMES lupdate
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)
FIND_PROGRAM(QT_LRELEASE_EXECUTABLE
NAMES lrelease
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)
IF (QT_MOC_EXECUTABLE)
SET(QT_WRAP_CPP "YES")
ENDIF (QT_MOC_EXECUTABLE)
IF (QT_UIC_EXECUTABLE)
SET(QT_WRAP_UI "YES")
ENDIF (QT_UIC_EXECUTABLE)
MARK_AS_ADVANCED( QT_UIC_EXECUTABLE QT_UIC3_EXECUTABLE QT_MOC_EXECUTABLE
QT_RCC_EXECUTABLE QT_DBUSXML2CPP_EXECUTABLE QT_DBUSCPP2XML_EXECUTABLE
QT_LUPDATE_EXECUTABLE QT_LRELEASE_EXECUTABLE)
######################################
#
# Macros for building Qt files
#
######################################
MACRO (QT4_EXTRACT_OPTIONS _qt4_files _qt4_options)
SET(${_qt4_files})
SET(${_qt4_options})
SET(_QT4_DOING_OPTIONS FALSE)
FOREACH(_currentArg ${ARGN})
IF ("${_currentArg}" STREQUAL "OPTIONS")
SET(_QT4_DOING_OPTIONS TRUE)
ELSE ("${_currentArg}" STREQUAL "OPTIONS")
IF(_QT4_DOING_OPTIONS)
LIST(APPEND ${_qt4_options} "${_currentArg}")
ELSE(_QT4_DOING_OPTIONS)
LIST(APPEND ${_qt4_files} "${_currentArg}")
ENDIF(_QT4_DOING_OPTIONS)
ENDIF ("${_currentArg}" STREQUAL "OPTIONS")
ENDFOREACH(_currentArg)
ENDMACRO (QT4_EXTRACT_OPTIONS)
MACRO (QT4_GET_MOC_INC_DIRS _moc_INC_DIRS)
SET(${_moc_INC_DIRS})
GET_DIRECTORY_PROPERTY(_inc_DIRS INCLUDE_DIRECTORIES)
FOREACH(_current ${_inc_DIRS})
SET(${_moc_INC_DIRS} ${${_moc_INC_DIRS}} "-I" ${_current})
ENDFOREACH(_current ${_inc_DIRS})
# if Qt is installed only as framework, add -F /library/Frameworks to the moc arguments
# otherwise moc can't find the headers in the framework include dirs
IF(APPLE AND "${QT_QTCORE_INCLUDE_DIR}" MATCHES "/Library/Frameworks/")
SET(${_moc_INC_DIRS} ${${_moc_INC_DIRS}} "-F/Library/Frameworks")
ENDIF(APPLE AND "${QT_QTCORE_INCLUDE_DIR}" MATCHES "/Library/Frameworks/")
ENDMACRO(QT4_GET_MOC_INC_DIRS)
MACRO (QT4_GENERATE_MOC infile outfile )
# get include dirs
QT4_GET_MOC_INC_DIRS(moc_includes)
GET_FILENAME_COMPONENT(abs_infile ${infile} ABSOLUTE)
IF (MSVC_IDE)
SET (_moc_parameter_file ${outfile}_parameters)
SET (_moc_param "${moc_includes} \n-o${outfile} \n${abs_infile}")
STRING(REGEX REPLACE ";-I;" "\\n-I" _moc_param "${_moc_param}")
FILE (WRITE ${_moc_parameter_file} "${_moc_param}")
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
COMMAND ${QT_MOC_EXECUTABLE}
ARGS @"${_moc_parameter_file}"
DEPENDS ${abs_infile})
ELSE (MSVC_IDE)
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
COMMAND ${QT_MOC_EXECUTABLE}
ARGS ${moc_includes} -o ${outfile} ${abs_infile}
DEPENDS ${abs_infile})
ENDIF (MSVC_IDE)
SET_SOURCE_FILES_PROPERTIES(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # dont run automoc on this file
MACRO_ADD_FILE_DEPENDENCIES(${abs_infile} ${outfile})
ENDMACRO (QT4_GENERATE_MOC)
# QT4_WRAP_CPP(outfiles inputfile ... )
MACRO (QT4_WRAP_CPP outfiles )
# get include dirs
QT4_GET_MOC_INC_DIRS(moc_includes)
QT4_EXTRACT_OPTIONS(moc_files moc_options ${ARGN})
FOREACH (it ${moc_files})
GET_FILENAME_COMPONENT(it ${it} ABSOLUTE)
GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/moc_${outfile}.cxx)
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
COMMAND ${QT_MOC_EXECUTABLE}
ARGS ${moc_includes} ${moc_options} -o ${outfile} ${it}
DEPENDS ${it})
SET(${outfiles} ${${outfiles}} ${outfile})
ENDFOREACH(it)
ENDMACRO (QT4_WRAP_CPP)
# QT4_WRAP_UI(outfiles inputfile ... )
MACRO (QT4_WRAP_UI outfiles )
QT4_EXTRACT_OPTIONS(ui_files ui_options ${ARGN})
FOREACH (it ${ui_files})
GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
COMMAND ${QT_UIC_EXECUTABLE}
ARGS ${ui_options} -o ${outfile} ${infile}
MAIN_DEPENDENCY ${infile})
SET(${outfiles} ${${outfiles}} ${outfile})
ENDFOREACH (it)
ENDMACRO (QT4_WRAP_UI)
# QT4_ADD_RESOURCES(outfiles inputfile ... )
MACRO (QT4_ADD_RESOURCES outfiles )
QT4_EXTRACT_OPTIONS(rcc_files rcc_options ${ARGN})
FOREACH (it ${rcc_files})
GET_FILENAME_COMPONENT(outfilename ${it} NAME_WE)
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
GET_FILENAME_COMPONENT(rc_path ${infile} PATH)
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx)
# parse file for dependencies
# all files are absolute paths or relative to the location of the qrc file
FILE(READ "${infile}" _RC_FILE_CONTENTS)
STRING(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
SET(_RC_DEPENDS)
FOREACH(_RC_FILE ${_RC_FILES})
STRING(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
STRING(REGEX MATCH "^/|([A-Za-z]:/)" _ABS_PATH_INDICATOR "${_RC_FILE}")
IF(NOT _ABS_PATH_INDICATOR)
SET(_RC_FILE "${rc_path}/${_RC_FILE}")
ENDIF(NOT _ABS_PATH_INDICATOR)
SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
ENDFOREACH(_RC_FILE)
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
COMMAND ${QT_RCC_EXECUTABLE}
ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile}
MAIN_DEPENDENCY ${infile}
DEPENDS ${_RC_DEPENDS})
SET(${outfiles} ${${outfiles}} ${outfile})
ENDFOREACH (it)
ENDMACRO (QT4_ADD_RESOURCES)
MACRO(QT4_ADD_DBUS_INTERFACE _sources _interface _basename)
GET_FILENAME_COMPONENT(_infile ${_interface} ABSOLUTE)
SET(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
SET(_impl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc)
GET_SOURCE_FILE_PROPERTY(_nonamespace ${_interface} NO_NAMESPACE)
IF ( _nonamespace )
SET(_params -N -m)
ELSE ( _nonamespace )
SET(_params -m)
ENDIF ( _nonamespace )
GET_SOURCE_FILE_PROPERTY(_include ${_interface} INCLUDE)
IF ( _include )
SET(_params ${_params} -i ${_include})
ENDIF ( _include )
ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header}
COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} ${_params} -p ${_basename} ${_infile}
DEPENDS ${_infile})
SET_SOURCE_FILES_PROPERTIES(${_impl} PROPERTIES SKIP_AUTOMOC TRUE)
QT4_GENERATE_MOC(${_header} ${_moc})
SET(${_sources} ${${_sources}} ${_impl} ${_header} ${_moc})
MACRO_ADD_FILE_DEPENDENCIES(${_impl} ${_moc})
ENDMACRO(QT4_ADD_DBUS_INTERFACE)
MACRO(QT4_ADD_DBUS_INTERFACES _sources)
FOREACH (_current_FILE ${ARGN})
GET_FILENAME_COMPONENT(_infile ${_current_FILE} ABSOLUTE)
# get the part before the ".xml" suffix
STRING(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2" _basename ${_current_FILE})
STRING(TOLOWER ${_basename} _basename)
QT4_ADD_DBUS_INTERFACE(${_sources} ${_infile} ${_basename}interface)
ENDFOREACH (_current_FILE)
ENDMACRO(QT4_ADD_DBUS_INTERFACES)
MACRO(QT4_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -options )
QT4_EXTRACT_OPTIONS(_customName _qt4_dbus_options ${ARGN})
GET_FILENAME_COMPONENT(_in_file ${_header} ABSOLUTE)
GET_FILENAME_COMPONENT(_basename ${_header} NAME_WE)
IF (_customName)
SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_customName})
ELSE (_customName)
SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.xml)
ENDIF (_customName)
ADD_CUSTOM_COMMAND(OUTPUT ${_target}
COMMAND ${QT_DBUSCPP2XML_EXECUTABLE} ${_qt4_dbus_options} ${_in_file} > ${_target}
DEPENDS ${_in_file}
)
ENDMACRO(QT4_GENERATE_DBUS_INTERFACE)
MACRO(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optionalBasename _optionalClassName)
GET_FILENAME_COMPONENT(_infile ${_xml_file} ABSOLUTE)
SET(_optionalBasename "${ARGV4}")
IF (_optionalBasename)
SET(_basename ${_optionalBasename} )
ELSE (_optionalBasename)
STRING(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2adaptor" _basename ${_infile})
STRING(TOLOWER ${_basename} _basename)
ENDIF (_optionalBasename)
SET(_optionalClassName "${ARGV5}")
SET(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
SET(_impl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc)
IF(_optionalClassName)
ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header}
COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -c ${_optionalClassName} -i ${_include} -l ${_parentClass} ${_infile}
DEPENDS ${_infile}
)
ELSE(_optionalClassName)
ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header}
COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -i ${_include} -l ${_parentClass} ${_infile}
DEPENDS ${_infile}
)
ENDIF(_optionalClassName)
QT4_GENERATE_MOC(${_header} ${_moc})
SET_SOURCE_FILES_PROPERTIES(${_impl} PROPERTIES SKIP_AUTOMOC TRUE)
MACRO_ADD_FILE_DEPENDENCIES(${_impl} ${_moc})
SET(${_sources} ${${_sources}} ${_impl} ${_header} ${_moc})
ENDMACRO(QT4_ADD_DBUS_ADAPTOR)
MACRO(QT4_AUTOMOC)
QT4_GET_MOC_INC_DIRS(_moc_INCS)
SET(_matching_FILES )
FOREACH (_current_FILE ${ARGN})
GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
# if "SKIP_AUTOMOC" is set to true, we will not handle this file here.
# This is required to make uic work correctly:
# we need to add generated .cpp files to the sources (to compile them),
# but we cannot let automoc handle them, as the .cpp files don't exist yet when
# cmake is run for the very first time on them -> however the .cpp files might
# exist at a later run. at that time we need to skip them, so that we don't add two
# different rules for the same moc file
GET_SOURCE_FILE_PROPERTY(_skip ${_abs_FILE} SKIP_AUTOMOC)
IF ( NOT _skip AND EXISTS ${_abs_FILE} )
FILE(READ ${_abs_FILE} _contents)
GET_FILENAME_COMPONENT(_abs_PATH ${_abs_FILE} PATH)
STRING(REGEX MATCHALL "#include +[^ ]+\\.moc[\">]" _match "${_contents}")
IF(_match)
FOREACH (_current_MOC_INC ${_match})
STRING(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
GET_filename_component(_basename ${_current_MOC} NAME_WE)
# SET(_header ${CMAKE_CURRENT_SOURCE_DIR}/${_basename}.h)
SET(_header ${_abs_PATH}/${_basename}.h)
SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
ADD_CUSTOM_COMMAND(OUTPUT ${_moc}
COMMAND ${QT_MOC_EXECUTABLE}
ARGS ${_moc_INCS} ${_header} -o ${_moc}
DEPENDS ${_header}
)
MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
ENDFOREACH (_current_MOC_INC)
ENDIF(_match)
ENDIF ( NOT _skip AND EXISTS ${_abs_FILE} )
ENDFOREACH (_current_FILE)
ENDMACRO(QT4_AUTOMOC)
######################################
#
# decide if Qt got found
#
######################################
# if the includes,libraries,moc,uic and rcc are found then we have it
IF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE)
SET( QT4_FOUND "YES" )
IF( NOT Qt4_FIND_QUIETLY)
MESSAGE(STATUS "Found Qt-Version ${QTVERSION} (using ${QT_QMAKE_EXECUTABLE})")
ENDIF( NOT Qt4_FIND_QUIETLY)
ELSE( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE)
SET( QT4_FOUND "NO")
SET(QT_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}-NOTFOUND" CACHE FILEPATH "Invalid qmake found" FORCE)
IF( Qt4_FIND_REQUIRED)
IF ( NOT QT_LIBRARY_DIR )
MESSAGE(STATUS "Qt libraries NOT found!")
ENDIF(NOT QT_LIBRARY_DIR )
IF ( NOT QT_INCLUDE_DIR )
MESSAGE(STATUS "Qt includes NOT found!")
ENDIF( NOT QT_INCLUDE_DIR )
IF ( NOT QT_MOC_EXECUTABLE )
MESSAGE(STATUS "Qt's moc NOT found!")
ENDIF( NOT QT_MOC_EXECUTABLE )
IF ( NOT QT_UIC_EXECUTABLE )
MESSAGE(STATUS "Qt's uic NOT found!")
ENDIF( NOT QT_UIC_EXECUTABLE )
IF ( NOT QT_RCC_EXECUTABLE )
MESSAGE(STATUS "Qt's rcc NOT found!")
ENDIF( NOT QT_RCC_EXECUTABLE )
MESSAGE( FATAL_ERROR "Qt libraries, includes, moc, uic or/and rcc NOT found!")
ENDIF( Qt4_FIND_REQUIRED)
ENDIF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE)
SET(QT_FOUND ${QT4_FOUND})
#######################################
#
# System dependent settings
#
#######################################
# for unix add X11 stuff
IF(UNIX)
# on OS X X11 may not be required
IF (Q_WS_X11)
FIND_PACKAGE(X11 REQUIRED)
ENDIF (Q_WS_X11)
FIND_PACKAGE(Threads)
SET(QT_QTCORE_LIBRARY ${QT_QTCORE_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
ENDIF(UNIX)
#######################################
#
# compatibility settings
#
#######################################
# Backwards compatibility for CMake1.4 and 1.2
SET (QT_MOC_EXE ${QT_MOC_EXECUTABLE} )
SET (QT_UIC_EXE ${QT_UIC_EXECUTABLE} )
SET( QT_QT_LIBRARY "")
ELSE(QT4_QMAKE_FOUND)
SET(QT_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}-NOTFOUND" CACHE FILEPATH "Invalid qmake found" FORCE)
IF(Qt4_FIND_REQUIRED)
IF(QT4_INSTALLED_VERSION_TOO_OLD)
MESSAGE(FATAL_ERROR "The installed Qt version ${QTVERSION} is too old, at least version ${QT_MIN_VERSION} is required")
ELSE(QT4_INSTALLED_VERSION_TOO_OLD)
MESSAGE( FATAL_ERROR "Qt qmake not found!")
ENDIF(QT4_INSTALLED_VERSION_TOO_OLD)
ELSE(Qt4_FIND_REQUIRED)
IF(QT4_INSTALLED_VERSION_TOO_OLD AND NOT Qt4_FIND_QUIETLY)
MESSAGE(STATUS "The installed Qt version ${QTVERSION} is too old, at least version ${QT_MIN_VERSION} is required")
ENDIF(QT4_INSTALLED_VERSION_TOO_OLD AND NOT Qt4_FIND_QUIETLY)
ENDIF(Qt4_FIND_REQUIRED)
ENDIF (QT4_QMAKE_FOUND)
ENDIF (QT4_QMAKE_FOUND)
| Muzikatoshi/omega | vendor/github.com/libwbxml/libwbxml/cmake/modules/FindQt4.cmake | CMake | gpl-3.0 | 59,525 | [
30522,
1001,
1011,
2424,
1053,
2102,
1018,
1001,
2023,
11336,
2064,
2022,
2109,
2000,
2424,
1053,
2102,
2549,
1012,
1001,
1996,
2087,
2590,
3277,
2003,
2008,
1996,
1053,
2102,
2549,
1053,
2863,
3489,
2003,
2800,
3081,
1996,
2291,
4130,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project
* -----------------------------------------------------------
* LICENSE: http://git.io/vki47 | TERMS: http://git.io/vki4o
* -----------------------------------------------------------
*/
package com.secupwn.aimsicd.ui.drawer;
import android.support.annotation.DrawableRes;
public interface NavDrawerItem {
int getId();
String getLabel();
void setLabel(String label);
void setIconId(@DrawableRes int icon);
int getType();
boolean isEnabled();
boolean updateActionBarTitle();
}
| CellularPrivacy/Android-IMSI-Catcher-Detector | AIMSICD/src/main/java/com/secupwn/aimsicd/ui/drawer/NavDrawerItem.java | Java | gpl-3.0 | 575 | [
30522,
1013,
1008,
11924,
10047,
5332,
1011,
13795,
19034,
1064,
1006,
1039,
1007,
8704,
2594,
2094,
9394,
2622,
1008,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
require 'spec_helper'
FakeWeb.allow_net_connect = true
unless File.exists?(File.join(File.dirname(__FILE__), 'remote.yml'))
STDERR.puts "\nERROR: Make sure a remote.yml file exists at ./spec/remote/remote.yml\n\n"
abort
end
RSpec.configure do |config|
config.before(:all) do
Chargify.configure do |c|
c.api_key = remote_configuration['api_key']
c.site = remote_configuration['site']
end
end
end
private
def remote_configuration
@remote_configuration ||= YAML.load_file(File.expand_path(File.join(File.dirname(__FILE__), 'remote.yml')))
end
| chase439/chargify_api_ares | spec/remote/remote_helper.rb | Ruby | mit | 575 | [
30522,
5478,
1005,
28699,
1035,
2393,
2121,
1005,
8275,
8545,
2497,
1012,
3499,
1035,
5658,
1035,
7532,
1027,
2995,
4983,
5371,
1012,
6526,
1029,
1006,
5371,
1012,
3693,
1006,
5371,
1012,
16101,
18442,
1006,
1035,
1035,
5371,
1035,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
*
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef GRPC_SUPPORT_LOG_WIN32_H
#define GRPC_SUPPORT_LOG_WIN32_H
#ifdef __cplusplus
extern "C" {
#endif
/* Returns a string allocated with gpr_malloc that contains a UTF-8
* formatted error message, corresponding to the error messageid.
* Use in conjunction with GetLastError() et al.
*/
GPR_API char *gpr_format_message(int messageid);
#ifdef __cplusplus
}
#endif
#endif /* GRPC_SUPPORT_LOG_WIN32_H */
| juhalindfors/bazel-patches | third_party/grpc/include/grpc/support/log_win32.h | C | apache-2.0 | 1,986 | [
30522,
1013,
1008,
1008,
1008,
9385,
2325,
1011,
2355,
1010,
8224,
4297,
1012,
1008,
2035,
2916,
9235,
1012,
1008,
1008,
25707,
1998,
2224,
1999,
3120,
1998,
12441,
3596,
1010,
2007,
2030,
2302,
1008,
14080,
1010,
2024,
7936,
3024,
2008,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<pr-stack-widget options="widget.options" params="widget.params" filters="filters"></pr-stack-widget> | pulsarIO/pulsar-reporting-ui | app/src/prReporting/prDashboardWidgets/stack/view.html | HTML | apache-2.0 | 101 | [
30522,
1026,
10975,
1011,
9991,
1011,
15536,
24291,
7047,
1027,
1000,
15536,
24291,
1012,
7047,
1000,
11498,
5244,
1027,
1000,
15536,
24291,
1012,
11498,
5244,
1000,
17736,
1027,
1000,
17736,
1000,
1028,
1026,
1013,
10975,
1011,
9991,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/**
* Copyright (c) <2016> Protobile contributors and Addvilz <mrtreinis@gmail.com>.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace Protobile\Framework\CompilerPass;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class RegisterOutputPass implements CompilerPassInterface
{
/**
* @param ContainerBuilder $container
*/
public function process(ContainerBuilder $container)
{
$container->register('app.output', ConsoleOutput::class);
}
}
| protobile/framework | src/Protobile/Framework/CompilerPass/RegisterOutputPass.php | PHP | apache-2.0 | 1,123 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
9385,
1006,
1039,
1007,
1026,
2355,
1028,
15053,
14454,
2063,
16884,
1998,
5587,
14762,
2480,
1026,
2720,
7913,
5498,
2015,
1030,
20917,
4014,
1012,
4012,
1028,
1012,
1008,
1008,
7000,
2104,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import React from "react";
import { TRANSACTION_STATUSES } from "../enums/transactions";
const { AWAITING_PROCESS, PROCESSING, PROCESSED } = TRANSACTION_STATUSES;
const STATUS_MAP = {
"Awaiting Process": AWAITING_PROCESS,
Processing: PROCESSING,
Processed: PROCESSED
};
export default class TransactionStatusDropdown extends React.Component {
constructor(props) {
super(props);
this.handleChange = this.handleChange.bind(this);
}
handleChange(event) {
this.props.onChange(event.target.value);
}
render() {
return (
<div className="bp3-select bp3-fill">
<select
disabled={this.props.disabled}
value={this.props.status}
onChange={this.handleChange}>
<option value="">Select a status</option>
{Object.entries(STATUS_MAP).map(([key, value]) => {
return (
<option key={value} value={value}>
{key}
</option>
);
})}
</select>
</div>
);
}
}
| umnretirees/membership-platform | assets/js/batch-transaction-form/transaction-status-dropdown.js | JavaScript | apache-2.0 | 1,033 | [
30522,
12324,
10509,
2013,
1000,
10509,
1000,
1025,
12324,
1063,
12598,
1035,
3570,
2229,
1065,
2013,
1000,
1012,
1012,
1013,
4372,
18163,
1013,
11817,
1000,
1025,
9530,
3367,
1063,
15497,
1035,
2832,
1010,
6364,
1010,
13995,
1065,
1027,
12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<div class="container">
<h1><span style="margin-right: 15px;">{{current.name}}</span> <small>Universe</small></h1>
<h3>Properties</h3>
<property-grid noun-type="universe" noun="current" noun-details="details"></property-grid>
</div>
| moatra/stagert | app/assets/javascripts/universe/templates/edit.html | HTML | mit | 246 | [
30522,
1026,
4487,
2615,
2465,
1027,
1000,
11661,
1000,
1028,
1026,
1044,
2487,
1028,
1026,
8487,
2806,
1027,
1000,
7785,
1011,
2157,
1024,
2321,
2361,
2595,
1025,
1000,
1028,
1063,
1063,
2783,
1012,
2171,
1065,
1065,
1026,
1013,
8487,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
\begin{tikzpicture}
\begin{axis}[
width=9cm,height=6cm,
ymin=0,
ytick align=outside,
axis x line*=bottom,axis y line*=left,
tick label style={
/pgf/number format/assume math mode=true,
/pgf/number format/1000 sep={}
},
ylabel={\# citations},
% enlargelimits=0.15,
ybar,
bar width=12pt,
]
\addplot[
fill=lightgray,
nodes near coords,
every node near coord/.append style={
/pgf/number format/assume math mode=true,
font=\small
}
]
coordinates{
(2010,2)
(2011,7)
(2012,22)
(2013,51)
(2014,73)
(2015,92)
(2016,123)
(2017,141)
};
\end{axis}
\end{tikzpicture}
| jdferreira/vitae | images/histogram-citations.tex | TeX | mit | 715 | [
30522,
1032,
4088,
1063,
14841,
2243,
2480,
24330,
11244,
1065,
1032,
4088,
1063,
8123,
1065,
1031,
9381,
1027,
1023,
27487,
1010,
4578,
1027,
1020,
27487,
1010,
1061,
10020,
1027,
1014,
1010,
1061,
26348,
25705,
1027,
2648,
1010,
8123,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
---------------------------------------------------------------------------------------------------
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0014-adding-audio-file-playback-to-ttschunk.md
-- User story:TBD
-- Use case:TBD
--
-- Requirement summary:
-- TBD
--
-- Description:
-- In case:
-- 1) HMI provides ‘FILE’ item in ‘speechCapabilities’ parameter of ‘TTS.GetCapabilities’ response
-- 2) New app registers and send ChangeRegistration with ‘FILE’ item in ‘ttsName’ parameter
-- SDL does:
-- 1) Send TTS.ChangeRegistration request to HMI with ‘FILE’ item in ‘ttsName’ parameter
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local runner = require('user_modules/script_runner')
local common = require('test_scripts/SDL5_0/TTSChunks/common')
--[[ Local Variables ]]
local putFileParams = {
requestParams = {
syncFileName = 'pathToFile',
fileType = "GRAPHIC_PNG",
persistentFile = false,
systemFile = false
},
filePath = "files/icon.png"
}
local params = {
language = "EN-US",
hmiDisplayLanguage = "EN-US",
ttsName = {
{ type = common.type, text = "pathToFile" }
}
}
local hmiParams = {
ttsName = {
{ type = common.type, text = common.getPathToFileInStorage("pathToFile") }
}
}
--[[ Test Configuration ]]
runner.testSettings.isSelfIncluded = false
--[[ Local Functions ]]
local function sendChangeRegistration_FILE_NOT_FOUND()
local corId = common.getMobileSession():SendRPC("ChangeRegistration", params)
common.getMobileSession():ExpectResponse(corId, { success = false, resultCode = "FILE_NOT_FOUND" })
end
local function sendChangeRegistration_SUCCESS()
local corId = common.getMobileSession():SendRPC("ChangeRegistration", params)
common.getHMIConnection():ExpectRequest("UI.ChangeRegistration")
:Do(function(_, data)
common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {})
end)
common.getHMIConnection():ExpectRequest("VR.ChangeRegistration")
:Do(function(_, data)
common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {})
end)
common.getHMIConnection():ExpectRequest("TTS.ChangeRegistration", { ttsName = hmiParams.ttsName })
:Do(function(_, data)
common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {})
end)
common.getMobileSession():ExpectResponse(corId, { success = true, resultCode = "SUCCESS" })
end
--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, init HMI, connect Mobile", common.start)
runner.Step("Register App", common.registerApp)
runner.Step("Activate App", common.activateApp)
runner.Title("Test")
runner.Step("Send ChangeRegistration FILE_NOT_FOUND response", sendChangeRegistration_FILE_NOT_FOUND)
runner.Step("Upload icon file", common.putFile, { putFileParams })
runner.Step("Send ChangeRegistration SUCCESS response", sendChangeRegistration_SUCCESS)
runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
| smartdevicelink/sdl_atf_test_scripts | test_scripts/SDL5_0/TTSChunks/005_ChangeRegistration.lua | Lua | bsd-3-clause | 3,147 | [
30522,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package de.undercouch.citeproc.tool.shell;
import de.undercouch.citeproc.BibliographyFileReader;
import de.undercouch.citeproc.BibliographyFileReader.FileFormat;
import de.undercouch.citeproc.tool.AbstractCSLToolCommand;
import de.undercouch.citeproc.tool.CSLToolContext;
import de.undercouch.underline.InputReader;
import de.undercouch.underline.OptionParserException;
import de.undercouch.underline.UnknownAttributes;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
/**
* Load an input bibliography
* @author Michel Kraemer
*/
public class ShellLoadCommand extends AbstractCSLToolCommand {
/**
* The current files
*/
private List<String> files;
@Override
public String getUsageName() {
return "load";
}
@Override
public String getUsageDescription() {
return "Load an input bibliography from a file";
}
/**
* Sets the current files
* @param files the files
*/
@UnknownAttributes("FILE")
public void setFiles(List<String> files) {
this.files = files;
}
@Override
public boolean checkArguments() {
if (files == null || files.isEmpty()) {
error("no file specified");
return false;
}
if (files.size() > 1) {
error("you can only specify one file");
return false;
}
File f = new File(files.get(0));
// check file format
BibliographyFileReader reader =
CSLToolContext.current().getBibliographyFileReader();
FileFormat ff;
try {
ff = reader.determineFileFormat(f);
} catch (FileNotFoundException e) {
error("file not found");
return false;
} catch (IOException e) {
error("could not determine file format");
return false;
}
if (ff == FileFormat.UNKNOWN) {
error("Unsupported file format");
return false;
}
return true;
}
@Override
public int doRun(String[] remainingArgs, InputReader in, PrintWriter out)
throws OptionParserException, IOException {
// load the bibliography file now. use the common instance of
// BibliographyFileReader in order to enable caching
String fn = files.get(0);
File f = new File(fn);
BibliographyFileReader reader =
CSLToolContext.current().getBibliographyFileReader();
try {
reader.readBibliographyFile(f);
} catch (IOException e) {
error("could not read input file");
return 1;
}
ShellContext.current().setInputFile(fn);
return 0;
}
}
| michel-kraemer/citeproc-java | citeproc-java-tool/src/main/java/de/undercouch/citeproc/tool/shell/ShellLoadCommand.java | Java | apache-2.0 | 2,799 | [
30522,
7427,
2139,
1012,
2104,
3597,
10875,
1012,
21893,
21572,
2278,
1012,
6994,
1012,
5806,
1025,
12324,
2139,
1012,
2104,
3597,
10875,
1012,
21893,
21572,
2278,
1012,
24751,
8873,
3917,
13775,
2121,
1025,
12324,
2139,
1012,
2104,
3597,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jsonp({"cep":"40713590","logradouro":"Rua Daniel Ferreira","bairro":"Itacaranha","cidade":"Salvador","uf":"BA","estado":"Bahia"});
| lfreneda/cepdb | api/v1/40713590.jsonp.js | JavaScript | cc0-1.0 | 131 | [
30522,
1046,
3385,
2361,
1006,
1063,
1000,
8292,
2361,
1000,
1024,
1000,
28941,
17134,
28154,
2692,
1000,
1010,
1000,
8833,
12173,
8162,
2080,
1000,
1024,
1000,
21766,
2050,
3817,
26135,
1000,
1010,
1000,
21790,
18933,
1000,
1024,
1000,
200... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
require 'spec_helper'
describe API::Templates do
context 'the Template Entity' do
before { get api('/templates/gitignores/Ruby') }
it { expect(json_response['name']).to eq('Ruby') }
it { expect(json_response['content']).to include('*.gem') }
end
context 'the TemplateList Entity' do
before { get api('/templates/gitignores') }
it { expect(json_response.first['name']).not_to be_nil }
it { expect(json_response.first['content']).to be_nil }
end
context 'requesting gitignores' do
it 'returns a list of available gitignore templates' do
get api('/templates/gitignores')
expect(response).to have_http_status(200)
expect(response).to include_pagination_headers
expect(json_response).to be_an Array
expect(json_response.size).to be > 15
end
end
context 'requesting gitlab-ci-ymls' do
it 'returns a list of available gitlab_ci_ymls' do
get api('/templates/gitlab_ci_ymls')
expect(response).to have_http_status(200)
expect(response).to include_pagination_headers
expect(json_response).to be_an Array
expect(json_response.first['name']).not_to be_nil
end
end
context 'requesting gitlab-ci-yml for Ruby' do
it 'adds a disclaimer on the top' do
get api('/templates/gitlab_ci_ymls/Ruby')
expect(response).to have_http_status(200)
expect(json_response['content']).to start_with("# This file is a template,")
end
end
context 'the License Template Entity' do
before { get api('/templates/licenses/mit') }
it 'returns a license template' do
expect(json_response['key']).to eq('mit')
expect(json_response['name']).to eq('MIT License')
expect(json_response['nickname']).to be_nil
expect(json_response['popular']).to be true
expect(json_response['html_url']).to eq('http://choosealicense.com/licenses/mit/')
expect(json_response['source_url']).to eq('https://opensource.org/licenses/MIT')
expect(json_response['description']).to include('A short and simple permissive license with conditions')
expect(json_response['conditions']).to eq(%w[include-copyright])
expect(json_response['permissions']).to eq(%w[commercial-use modifications distribution private-use])
expect(json_response['limitations']).to eq(%w[no-liability])
expect(json_response['content']).to include('MIT License')
end
end
context 'GET templates/licenses' do
it 'returns a list of available license templates' do
get api('/templates/licenses')
expect(response).to have_http_status(200)
expect(response).to include_pagination_headers
expect(json_response).to be_an Array
expect(json_response.size).to eq(12)
expect(json_response.map { |l| l['key'] }).to include('agpl-3.0')
end
describe 'the popular parameter' do
context 'with popular=1' do
it 'returns a list of available popular license templates' do
get api('/templates/licenses?popular=1')
expect(response).to have_http_status(200)
expect(response).to include_pagination_headers
expect(json_response).to be_an Array
expect(json_response.size).to eq(3)
expect(json_response.map { |l| l['key'] }).to include('apache-2.0')
end
end
end
end
context 'GET templates/licenses/:name' do
context 'with :project and :fullname given' do
before do
get api("/templates/licenses/#{license_type}?project=My+Awesome+Project&fullname=Anton+#{license_type.upcase}")
end
context 'for the mit license' do
let(:license_type) { 'mit' }
it 'returns the license text' do
expect(json_response['content']).to include('MIT License')
end
it 'replaces placeholder values' do
expect(json_response['content']).to include("Copyright (c) #{Time.now.year} Anton")
end
end
context 'for the agpl-3.0 license' do
let(:license_type) { 'agpl-3.0' }
it 'returns the license text' do
expect(json_response['content']).to include('GNU AFFERO GENERAL PUBLIC LICENSE')
end
it 'replaces placeholder values' do
expect(json_response['content']).to include('My Awesome Project')
expect(json_response['content']).to include("Copyright (C) #{Time.now.year} Anton")
end
end
context 'for the gpl-3.0 license' do
let(:license_type) { 'gpl-3.0' }
it 'returns the license text' do
expect(json_response['content']).to include('GNU GENERAL PUBLIC LICENSE')
end
it 'replaces placeholder values' do
expect(json_response['content']).to include('My Awesome Project')
expect(json_response['content']).to include("Copyright (C) #{Time.now.year} Anton")
end
end
context 'for the gpl-2.0 license' do
let(:license_type) { 'gpl-2.0' }
it 'returns the license text' do
expect(json_response['content']).to include('GNU GENERAL PUBLIC LICENSE')
end
it 'replaces placeholder values' do
expect(json_response['content']).to include('My Awesome Project')
expect(json_response['content']).to include("Copyright (C) #{Time.now.year} Anton")
end
end
context 'for the apache-2.0 license' do
let(:license_type) { 'apache-2.0' }
it 'returns the license text' do
expect(json_response['content']).to include('Apache License')
end
it 'replaces placeholder values' do
expect(json_response['content']).to include("Copyright #{Time.now.year} Anton")
end
end
context 'for an uknown license' do
let(:license_type) { 'muth-over9000' }
it 'returns a 404' do
expect(response).to have_http_status(404)
end
end
end
context 'with no :fullname given' do
context 'with an authenticated user' do
let(:user) { create(:user) }
it 'replaces the copyright owner placeholder with the name of the current user' do
get api('/templates/licenses/mit', user)
expect(json_response['content']).to include("Copyright (c) #{Time.now.year} #{user.name}")
end
end
end
end
end
| htve/GitlabForChinese | spec/requests/api/templates_spec.rb | Ruby | mit | 6,307 | [
30522,
5478,
1005,
28699,
1035,
2393,
2121,
1005,
6235,
17928,
1024,
1024,
23561,
2015,
2079,
6123,
1005,
1996,
23561,
9178,
1005,
2079,
2077,
1063,
2131,
17928,
1006,
1005,
1013,
23561,
2015,
1013,
21025,
3775,
26745,
6072,
1013,
10090,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright 2012 StackMob
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
Category on `NSDictionary` for atomic counter functionality.
*/
@interface NSDictionary (AtomicCounter)
/**
Returns a new dictionary with a new entry representing an atomic counter update for a field.
Updating an atomic counter means incrementing or decrementing a value atomically such that you don't need to worry about concurrency issues. This might power a thumbs-up button counter or the score in a game. The dictionary you get from this method can then be passed into <SMDataStore> methods.
@param field The field to increment.
@param value The amount to increment by. Can be positive or negative.
*/
- (NSDictionary *)dictionaryByAppendingCounterUpdateForField:(NSString *)field by:(int)value;
@end
/**
Category on `NSMutableDictionary` for atomic counter functionality.
*/
@interface NSMutableDictionary (AtomicCounter)
/**
Set a new entry in the dictionary representing an atomic counter update for a field.
Updating an atomic counter means incrementing or decrementing a value atomically such that you don't need to worry about concurrency issues. This might power a thumbs-up button counter or the score in a game. After you call this method, the dictionary can be passed into <SMDataStore> methods.
@param field The field to increment.
@param value The amount to increment by. Can be positive or negative.
*/
- (void)updateCounterForField:(NSString *)field by:(int)value;
@end
| pb-pravin/StackMobForm | StackMob-v1.2.0/Headers/NSDictionary+AtomicCounter.h | C | mit | 2,008 | [
30522,
1013,
1008,
1008,
9385,
2262,
9991,
5302,
2497,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1008,
2017,
2089,
2025,
2224,
2023,
5371,
3272,
1999,
12646,
2007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Copyright 2019 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package cache
import (
"github.com/juju/errors"
"github.com/juju/juju/core/settings"
"github.com/juju/names/v4"
jc "github.com/juju/testing/checkers"
"github.com/prometheus/client_golang/prometheus/testutil"
gc "gopkg.in/check.v1"
)
const (
branchName = "test-branch"
defaultPassword = "default-pass"
defaultCharmURL = "default-charm-url"
defaultUnitName = "redis/0"
)
type charmConfigWatcherSuite struct {
EntitySuite
}
var _ = gc.Suite(&charmConfigWatcherSuite{})
func (s *charmConfigWatcherSuite) TestTrackingBranchChangedNotified(c *gc.C) {
// After initializing we expect not miss
c.Check(testutil.ToFloat64(s.Gauges.CharmConfigHashCacheMiss), gc.Equals, float64(0))
w := s.newWatcher(c, defaultUnitName, defaultCharmURL)
// After initializing the first watcher we expect one change and one miss
c.Check(testutil.ToFloat64(s.Gauges.CharmConfigHashCacheMiss), gc.Equals, float64(1))
s.assertOneChange(c, w, map[string]interface{}{"password": defaultPassword}, defaultCharmURL)
// Publish a tracked branch change with altered config.
b := Branch{
details: BranchChange{
Name: branchName,
Config: map[string]settings.ItemChanges{"redis": {settings.MakeAddition("password", "new-pass")}},
},
}
// publish the second change.
s.Hub.Publish(branchChange, b)
s.assertOneChange(c, w, map[string]interface{}{"password": "new-pass"}, defaultCharmURL)
// After the branchChange we expect another change and hence inc again.
c.Check(testutil.ToFloat64(s.Gauges.CharmConfigHashCacheMiss), gc.Equals, float64(2))
c.Check(testutil.ToFloat64(s.Gauges.CharmConfigHashCacheHit), gc.Equals, float64(0))
w.AssertStops()
}
func (s *charmConfigWatcherSuite) TestNotTrackingBranchChangedNotNotified(c *gc.C) {
// This will initialise the watcher without branch info.
w := s.newWatcher(c, "redis/9", defaultCharmURL)
s.assertOneChange(c, w, map[string]interface{}{}, defaultCharmURL)
// Publish a branch change with altered config.
b := Branch{
details: BranchChange{
Name: branchName,
Config: map[string]settings.ItemChanges{"redis": {settings.MakeAddition("password", "new-pass")}},
},
}
s.Hub.Publish(branchChange, b)
// Nothing should change.
w.AssertNoChange()
w.AssertStops()
}
func (s *charmConfigWatcherSuite) TestDifferentBranchChangedNotNotified(c *gc.C) {
w := s.newWatcher(c, defaultUnitName, defaultCharmURL)
s.assertOneChange(c, w, map[string]interface{}{"password": defaultPassword}, defaultCharmURL)
// Publish a branch change with a different name to the tracked one.
b := Branch{
details: BranchChange{
Name: "some-other-branch",
Config: map[string]settings.ItemChanges{"redis": {settings.MakeAddition("password", "new-pass")}},
},
}
s.Hub.Publish(branchChange, b)
w.AssertNoChange()
w.AssertStops()
}
func (s *charmConfigWatcherSuite) TestTrackingBranchMasterChangedNotified(c *gc.C) {
w := s.newWatcher(c, defaultUnitName, defaultCharmURL)
s.assertOneChange(c, w, map[string]interface{}{"password": defaultPassword}, defaultCharmURL)
// Publish a change to master configuration.
hc, _ := newHashCache(map[string]interface{}{"databases": 4}, nil, nil)
s.Hub.Publish(applicationConfigChange, hc)
s.assertOneChange(c, w, map[string]interface{}{"password": defaultPassword, "databases": 4}, defaultCharmURL)
w.AssertStops()
}
func (s *charmConfigWatcherSuite) TestTrackingBranchCommittedNotNotified(c *gc.C) {
w := s.newWatcher(c, "redis/0", defaultCharmURL)
s.assertOneChange(c, w, map[string]interface{}{"password": defaultPassword}, defaultCharmURL)
// Publish a branch removal.
s.Hub.Publish(modelBranchRemove, branchName)
w.AssertNoChange()
w.AssertStops()
}
func (s *charmConfigWatcherSuite) TestNotTrackedBranchSeesMasterConfig(c *gc.C) {
// Watcher is for a unit not tracking the branch.
w := s.newWatcher(c, "redis/9", defaultCharmURL)
s.assertOneChange(c, w, map[string]interface{}{}, defaultCharmURL)
w.AssertStops()
}
func (s *charmConfigWatcherSuite) TestSameUnitDifferentCharmURLYieldsDifferentHash(c *gc.C) {
w := s.newWatcher(c, defaultUnitName, defaultCharmURL)
s.assertOneChange(c, w, map[string]interface{}{"password": defaultPassword}, defaultCharmURL)
h1 := w.Watcher.(*CharmConfigWatcher).configHash
w.AssertStops()
w = s.newWatcher(c, defaultUnitName, "different-charm-url")
s.assertOneChange(c, w, map[string]interface{}{"password": defaultPassword}, "different-charm-url")
h2 := w.Watcher.(*CharmConfigWatcher).configHash
w.AssertStops()
c.Check(h1, gc.Not(gc.Equals), h2)
}
func (s *charmConfigWatcherSuite) newWatcher(c *gc.C, unitName string, charmURL string) StringsWatcherC {
appName, err := names.UnitApplication(unitName)
c.Assert(err, jc.ErrorIsNil)
// The topics can be arbitrary here;
// these tests are isolated from actual cache behaviour.
cfg := charmConfigWatcherConfig{
model: s.newStubModel(),
unitName: unitName,
appName: appName,
charmURL: charmURL,
appConfigChangeTopic: applicationConfigChange,
branchChangeTopic: branchChange,
branchRemoveTopic: modelBranchRemove,
hub: s.Hub,
res: s.NewResident(),
}
w, err := newCharmConfigWatcher(cfg)
c.Assert(err, jc.ErrorIsNil)
// Wrap the watcher and ensure we get the default notification.
wc := NewStringsWatcherC(c, w)
return wc
}
// newStub model sets up a cached model containing a redis application
// and a branch with 2 redis units tracking it.
func (s *charmConfigWatcherSuite) newStubModel() *stubCharmConfigModel {
app := newApplication(nil, s.Gauges, s.Hub, s.NewResident())
app.setDetails(ApplicationChange{
Name: "redis",
Config: map[string]interface{}{}},
)
branch := newBranch(s.Gauges, s.Hub, s.NewResident())
branch.setDetails(BranchChange{
Name: branchName,
AssignedUnits: map[string][]string{"redis": {"redis/0", "redis/1"}},
Config: map[string]settings.ItemChanges{"redis": {settings.MakeAddition("password", defaultPassword)}},
})
return &stubCharmConfigModel{
app: *app,
branches: map[string]Branch{"0": *branch},
metrics: s.Gauges,
}
}
// assertWatcherConfig unwraps the charm config watcher and ensures that its
// configuration hash matches that of the input configuration map.
func (s *charmConfigWatcherSuite) assertOneChange(
c *gc.C, wc StringsWatcherC, cfg map[string]interface{}, extra ...string,
) {
h, err := hashSettings(cfg, extra...)
c.Assert(err, jc.ErrorIsNil)
wc.AssertOneChange([]string{h})
}
type stubCharmConfigModel struct {
app Application
branches map[string]Branch
metrics *ControllerGauges
}
func (m *stubCharmConfigModel) Application(name string) (Application, error) {
if name == m.app.details.Name {
return m.app, nil
}
return Application{}, errors.NotFoundf("application %q", name)
}
func (m *stubCharmConfigModel) Branches() []Branch {
branches := make([]Branch, len(m.branches))
i := 0
for _, b := range m.branches {
branches[i] = b.copy()
i += 1
}
return branches
}
func (m *stubCharmConfigModel) Metrics() *ControllerGauges {
return m.metrics
}
| freyes/juju | core/cache/charmconfigwatcher_test.go | GO | agpl-3.0 | 7,224 | [
30522,
1013,
1013,
9385,
10476,
18562,
5183,
1012,
1013,
1013,
7000,
2104,
1996,
12943,
24759,
2615,
2509,
1010,
2156,
11172,
5371,
2005,
4751,
1012,
7427,
17053,
12324,
1006,
1000,
21025,
2705,
12083,
1012,
4012,
1013,
18414,
9103,
1013,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# CentOS
CentOS Linux is a community-supported distribution derived from sources freely provided to the public by [Red Hat](ftp://ftp.redhat.com/pub/redhat/linux/enterprise/) for Red Hat Enterprise Linux (RHEL). As such, CentOS Linux aims to be functionally compatible with RHEL. The CentOS Project mainly changes packages to remove upstream vendor branding and artwork. CentOS Linux is no-cost and free to redistribute. Each CentOS Linux version is maintained for up to 10 years (by means of security updates -- the duration of the support interval by Red Hat has varied over time with respect to Sources released). A new CentOS Linux version is released approximately every 2 years and each CentOS Linux version is periodically updated (roughly every 6 months) to support newer hardware. This results in a secure, low-maintenance, reliable, predictable, and reproducible Linux environment.
> [wiki.centos.org](https://wiki.centos.org/FrontPage)
%%LOGO%%
# CentOS image documentation
The `%%IMAGE%%:latest` tag is always the most recent version currently available.
## Rolling builds
The CentOS Project offers regularly updated images for all active releases. These images will be updated monthly or as needed for emergency fixes. These rolling updates are tagged with the major version number only. For example: `docker pull %%IMAGE%%:6` or `docker pull %%IMAGE%%:7`
## Minor tags
Additionally, images with minor version tags that correspond to install media are also offered. **These images DO NOT receive updates** as they are intended to match installation iso contents. If you choose to use these images it is highly recommended that you include `RUN yum -y update && yum clean all` in your Dockerfile, or otherwise address any potential security concerns. To use these images, please specify the minor version tag:
For example: `docker pull %%IMAGE%%:5.11` or `docker pull %%IMAGE%%:6.6`
## Overlayfs and yum
Recent Docker versions support the [overlayfs](https://docs.docker.com/engine/userguide/storagedriver/overlayfs-driver/) backend, which is enabled by default on most distros supporting it from Docker 1.13 onwards. On Centos 6 and 7, **that backend requires yum-plugin-ovl to be installed and enabled**; while it is installed by default in recent %%IMAGE%% images, make it sure you retain the `plugins=1` option in `/etc/yum.conf` if you update that file; otherwise, you may encounter errors related to rpmdb checksum failure - see [Docker ticket 10180](https://github.com/docker/docker/issues/10180) for more details.
# Package documentation
By default, the CentOS containers are built using yum's `nodocs` option, which helps reduce the size of the image. If you install a package and discover files missing, please comment out the line `tsflags=nodocs` in `/etc/yum.conf` and reinstall your package.
# Systemd integration
Systemd is now included in both the %%IMAGE%%:7 and %%IMAGE%%:latest base containers, but it is not active by default. In order to use systemd, you will need to include text similar to the example Dockerfile below:
## Dockerfile for systemd base image
```dockerfile
FROM %%IMAGE%%:7
ENV container docker
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \
systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /etc/systemd/system/*.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*;
VOLUME [ "/sys/fs/cgroup" ]
CMD ["/usr/sbin/init"]
```
This Dockerfile deletes a number of unit files which might cause issues. From here, you are ready to build your base image.
```console
$ docker build --rm -t local/c7-systemd .
```
## Example systemd enabled app container
In order to use the systemd enabled base container created above, you will need to create your `Dockerfile` similar to the one below.
```dockerfile
FROM local/c7-systemd
RUN yum -y install httpd; yum clean all; systemctl enable httpd.service
EXPOSE 80
CMD ["/usr/sbin/init"]
```
Build this image:
```console
$ docker build --rm -t local/c7-systemd-httpd .
```
## Running a systemd enabled app container
In order to run a container with systemd, you will need to mount the cgroups volumes from the host. Below is an example command that will run the systemd enabled httpd container created earlier.
```console
$ docker run -ti -v /sys/fs/cgroup:/sys/fs/cgroup:ro -p 80:80 local/c7-systemd-httpd
```
This container is running with systemd in a limited context, with the cgroups filesystem mounted. There have been reports that if you're using an Ubuntu host, you will need to add `-v /tmp/$(mktemp -d):/run` in addition to the cgroups mount.
## A note about vsyscall
CentOS 6 binaries and/or libraries are built to expect some system calls to be accessed via `vsyscall` mappings. Some linux distributions have opted to disable `vsyscall` entirely (opting exclusively for more secure `vdso` mappings), causing segmentation faults.
If running `docker run --rm -it centos:centos6.7 bash` immediately exits with status code `139`, check to see if your system has disabled vsyscall:
```console
$ cat /proc/self/maps | egrep 'vdso|vsyscall'
7fffccfcc000-7fffccfce000 r-xp 00000000 00:00 0 [vdso]
$
```
vs
```console
$ cat /proc/self/maps | egrep 'vdso|vsyscall'
7fffe03fe000-7fffe0400000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
```
If you do not see a `vsyscall` mapping, and you need to run a CentOS 6 container, try adding `vsyscall=emulated` to the kernel options in your bootloader
Further reading : [lwn.net](https://lwn.net/Articles/446528/)
| crate/docker-docs | centos/content.md | Markdown | mit | 5,914 | [
30522,
1001,
9358,
2891,
9358,
2891,
11603,
2003,
1037,
2451,
1011,
3569,
4353,
5173,
2013,
4216,
10350,
3024,
2000,
1996,
2270,
2011,
1031,
2417,
6045,
1033,
1006,
3027,
2361,
1024,
1013,
1013,
3027,
2361,
1012,
2417,
12707,
1012,
4012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* This is the source code of Hermes for Android v. 1.3.x.
* It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE).
*
* Copyright Nikolai Kudashov, 2013-2014.
*/
package org.hermes.ui.Components;
import android.graphics.Canvas;
import android.graphics.Paint;
import org.hermes.android.AndroidUtilities;
public class ProgressView {
private Paint innerPaint;
private Paint outerPaint;
public float currentProgress = 0;
public int width;
public int height;
public float progressHeight = AndroidUtilities.dp(2.0f);
public ProgressView() {
innerPaint = new Paint();
outerPaint = new Paint();
}
public void setProgressColors(int innerColor, int outerColor) {
innerPaint.setColor(innerColor);
outerPaint.setColor(outerColor);
}
public void setProgress(float progress) {
currentProgress = progress;
if (currentProgress < 0) {
currentProgress = 0;
} else if (currentProgress > 1) {
currentProgress = 1;
}
}
public void draw(Canvas canvas) {
canvas.drawRect(0, height / 2 - progressHeight / 2.0f, width, height / 2 + progressHeight / 2.0f, innerPaint);
canvas.drawRect(0, height / 2 - progressHeight / 2.0f, width * currentProgress, height / 2 + progressHeight / 2.0f, outerPaint);
}
}
| ur0/hermes | TMessagesProj/src/main/java/org/hermes/ui/Components/ProgressView.java | Java | gpl-2.0 | 1,427 | [
30522,
1013,
1008,
1008,
2023,
2003,
1996,
3120,
3642,
1997,
24127,
2005,
11924,
1058,
1012,
1015,
1012,
1017,
1012,
1060,
1012,
1008,
2009,
2003,
7000,
2104,
27004,
14246,
2140,
1058,
1012,
1016,
2030,
2101,
1012,
1008,
2017,
2323,
2031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
//-----------------------------------------------------------------------------
/**
* The sprite which covers the entire game screen.
*
* @class ScreenSprite
* @constructor
*/
function ScreenSprite() {
this.initialize.apply(this, arguments);
}
ScreenSprite.prototype = Object.create(PIXI.Container.prototype);
ScreenSprite.prototype.constructor = ScreenSprite;
ScreenSprite.prototype.initialize = function () {
PIXI.Container.call(this);
this._graphics = new PIXI.Graphics();
this.addChild(this._graphics);
this.opacity = 0;
this._red = -1;
this._green = -1;
this._blue = -1;
this._colorText = '';
this.setBlack();
};
/**
* The opacity of the sprite (0 to 255).
*
* @property opacity
* @type Number
*/
Object.defineProperty(ScreenSprite.prototype, 'opacity', {
get: function () {
return this.alpha * 255;
},
set: function (value) {
this.alpha = value.clamp(0, 255) / 255;
},
configurable: true
});
ScreenSprite.YEPWarned = false;
ScreenSprite.warnYep = function () {
if (!ScreenSprite.YEPWarned) {
console.log("Deprecation warning. Please update YEP_CoreEngine. ScreenSprite is not a sprite, it has graphics inside.");
ScreenSprite.YEPWarned = true;
}
};
Object.defineProperty(ScreenSprite.prototype, 'anchor', {
get: function () {
ScreenSprite.warnYep();
this.scale.x = 1;
this.scale.y = 1;
return {x: 0, y: 0};
},
set: function (value) {
this.alpha = value.clamp(0, 255) / 255;
},
configurable: true
});
Object.defineProperty(ScreenSprite.prototype, 'blendMode', {
get: function () {
return this._graphics.blendMode;
},
set: function (value) {
this._graphics.blendMode = value;
},
configurable: true
});
/**
* Sets black to the color of the screen sprite.
*
* @method setBlack
*/
ScreenSprite.prototype.setBlack = function () {
this.setColor(0, 0, 0);
};
/**
* Sets white to the color of the screen sprite.
*
* @method setWhite
*/
ScreenSprite.prototype.setWhite = function () {
this.setColor(255, 255, 255);
};
/**
* Sets the color of the screen sprite by values.
*
* @method setColor
* @param {Number} r The red value in the range (0, 255)
* @param {Number} g The green value in the range (0, 255)
* @param {Number} b The blue value in the range (0, 255)
*/
ScreenSprite.prototype.setColor = function (r, g, b) {
if (this._red !== r || this._green !== g || this._blue !== b) {
r = Math.round(r || 0).clamp(0, 255);
g = Math.round(g || 0).clamp(0, 255);
b = Math.round(b || 0).clamp(0, 255);
this._red = r;
this._green = g;
this._blue = b;
this._colorText = Utils.rgbToCssColor(r, g, b);
var graphics = this._graphics;
graphics.clear();
var intColor = (r << 16) | (g << 8) | b;
graphics.beginFill(intColor, 1);
//whole screen with zoom. BWAHAHAHAHA
graphics.drawRect(-Graphics.width * 5, -Graphics.height * 5, Graphics.width * 10, Graphics.height * 10);
}
};
| rpgtkoolmv/corescript | js/rpg_core/ScreenSprite.js | JavaScript | mit | 3,115 | [
30522,
1013,
1013,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
---
title: Course Report - Where Are They Now?
date: 2018-10-04
description: Featured in a blog post catching up with four bootcamp alumni to see how our careers have grown. 🤔
image: https://i.imgur.com/vOkUdeS.png
link: https://www.coursereport.com/blog/where-are-they-now-bootcamp-alumni
categories:
- press
---
| fvcproductions/fvcproductions.github.io | content/posts/2018-10-04-course-report-where-are-they-now.md | Markdown | mit | 319 | [
30522,
1011,
1011,
1011,
2516,
1024,
2607,
3189,
1011,
2073,
2024,
2027,
2085,
1029,
3058,
1024,
2760,
1011,
2184,
1011,
5840,
6412,
1024,
2956,
1999,
1037,
9927,
2695,
9105,
2039,
2007,
2176,
9573,
26468,
9441,
2000,
2156,
2129,
2256,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright (C) 2009-2011 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Authors:
* Stefan Berger <stefanb@us.ibm.com>
* Daniel P. Berrange <berrange@redhat.com>
*/
#include <config.h>
#include "netdev_vport_profile_conf.h"
#include "virterror_internal.h"
#include "memory.h"
#define VIR_FROM_THIS VIR_FROM_NONE
#define virNetDevError(code, ...) \
virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__)
VIR_ENUM_IMPL(virNetDevVPort, VIR_NETDEV_VPORT_PROFILE_LAST,
"none",
"802.1Qbg",
"802.1Qbh",
"openvswitch")
virNetDevVPortProfilePtr
virNetDevVPortProfileParse(xmlNodePtr node)
{
char *virtPortType;
char *virtPortManagerID = NULL;
char *virtPortTypeID = NULL;
char *virtPortTypeIDVersion = NULL;
char *virtPortInstanceID = NULL;
char *virtPortProfileID = NULL;
char *virtPortInterfaceID = NULL;
virNetDevVPortProfilePtr virtPort = NULL;
xmlNodePtr cur = node->children;
if (VIR_ALLOC(virtPort) < 0) {
virReportOOMError();
return NULL;
}
virtPortType = virXMLPropString(node, "type");
if (!virtPortType) {
virNetDevError(VIR_ERR_XML_ERROR, "%s",
_("missing virtualportprofile type"));
goto error;
}
if ((virtPort->virtPortType = virNetDevVPortTypeFromString(virtPortType)) <= 0) {
virNetDevError(VIR_ERR_XML_ERROR,
_("unknown virtualportprofile type %s"), virtPortType);
goto error;
}
while (cur != NULL) {
if (xmlStrEqual(cur->name, BAD_CAST "parameters")) {
virtPortManagerID = virXMLPropString(cur, "managerid");
virtPortTypeID = virXMLPropString(cur, "typeid");
virtPortTypeIDVersion = virXMLPropString(cur, "typeidversion");
virtPortInstanceID = virXMLPropString(cur, "instanceid");
virtPortProfileID = virXMLPropString(cur, "profileid");
virtPortInterfaceID = virXMLPropString(cur, "interfaceid");
break;
}
cur = cur->next;
}
switch (virtPort->virtPortType) {
case VIR_NETDEV_VPORT_PROFILE_8021QBG:
if (virtPortManagerID != NULL && virtPortTypeID != NULL &&
virtPortTypeIDVersion != NULL) {
unsigned int val;
if (virStrToLong_ui(virtPortManagerID, NULL, 0, &val)) {
virNetDevError(VIR_ERR_XML_ERROR, "%s",
_("cannot parse value of managerid parameter"));
goto error;
}
if (val > 0xff) {
virNetDevError(VIR_ERR_XML_ERROR, "%s",
_("value of managerid out of range"));
goto error;
}
virtPort->u.virtPort8021Qbg.managerID = (uint8_t)val;
if (virStrToLong_ui(virtPortTypeID, NULL, 0, &val)) {
virNetDevError(VIR_ERR_XML_ERROR, "%s",
_("cannot parse value of typeid parameter"));
goto error;
}
if (val > 0xffffff) {
virNetDevError(VIR_ERR_XML_ERROR, "%s",
_("value for typeid out of range"));
goto error;
}
virtPort->u.virtPort8021Qbg.typeID = (uint32_t)val;
if (virStrToLong_ui(virtPortTypeIDVersion, NULL, 0, &val)) {
virNetDevError(VIR_ERR_XML_ERROR, "%s",
_("cannot parse value of typeidversion parameter"));
goto error;
}
if (val > 0xff) {
virNetDevError(VIR_ERR_XML_ERROR, "%s",
_("value of typeidversion out of range"));
goto error;
}
virtPort->u.virtPort8021Qbg.typeIDVersion = (uint8_t)val;
if (virtPortInstanceID != NULL) {
if (virUUIDParse(virtPortInstanceID,
virtPort->u.virtPort8021Qbg.instanceID)) {
virNetDevError(VIR_ERR_XML_ERROR, "%s",
_("cannot parse instanceid parameter as a uuid"));
goto error;
}
} else {
if (virUUIDGenerate(virtPort->u.virtPort8021Qbg.instanceID)) {
virNetDevError(VIR_ERR_XML_ERROR, "%s",
_("cannot generate a random uuid for instanceid"));
goto error;
}
}
virtPort->virtPortType = VIR_NETDEV_VPORT_PROFILE_8021QBG;
} else {
virNetDevError(VIR_ERR_XML_ERROR, "%s",
_("a parameter is missing for 802.1Qbg description"));
goto error;
}
break;
case VIR_NETDEV_VPORT_PROFILE_8021QBH:
if (virtPortProfileID != NULL) {
if (virStrcpyStatic(virtPort->u.virtPort8021Qbh.profileID,
virtPortProfileID) != NULL) {
virtPort->virtPortType = VIR_NETDEV_VPORT_PROFILE_8021QBH;
} else {
virNetDevError(VIR_ERR_XML_ERROR, "%s",
_("profileid parameter too long"));
goto error;
}
} else {
virNetDevError(VIR_ERR_XML_ERROR, "%s",
_("profileid parameter is missing for 802.1Qbh description"));
goto error;
}
break;
case VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH:
if (virtPortInterfaceID != NULL) {
if (virUUIDParse(virtPortInterfaceID,
virtPort->u.openvswitch.interfaceID)) {
virNetDevError(VIR_ERR_XML_ERROR, "%s",
_("cannot parse interfaceid parameter as a uuid"));
goto error;
}
} else {
if (virUUIDGenerate(virtPort->u.openvswitch.interfaceID)) {
virNetDevError(VIR_ERR_XML_ERROR, "%s",
_("cannot generate a random uuid for interfaceid"));
goto error;
}
}
/* profileid is not mandatory for Open vSwitch */
if (virtPortProfileID != NULL) {
if (virStrcpyStatic(virtPort->u.openvswitch.profileID,
virtPortProfileID) == NULL) {
virNetDevError(VIR_ERR_XML_ERROR, "%s",
_("profileid parameter too long"));
goto error;
}
} else {
virtPort->u.openvswitch.profileID[0] = '\0';
}
break;
default:
virNetDevError(VIR_ERR_XML_ERROR,
_("unexpected virtualport type %d"), virtPort->virtPortType);
goto error;
}
cleanup:
VIR_FREE(virtPortManagerID);
VIR_FREE(virtPortTypeID);
VIR_FREE(virtPortTypeIDVersion);
VIR_FREE(virtPortInstanceID);
VIR_FREE(virtPortProfileID);
VIR_FREE(virtPortType);
return virtPort;
error:
VIR_FREE(virtPort);
goto cleanup;
}
int
virNetDevVPortProfileFormat(virNetDevVPortProfilePtr virtPort,
virBufferPtr buf)
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
if (!virtPort || virtPort->virtPortType == VIR_NETDEV_VPORT_PROFILE_NONE)
return 0;
virBufferAsprintf(buf, "<virtualport type='%s'>\n",
virNetDevVPortTypeToString(virtPort->virtPortType));
switch (virtPort->virtPortType) {
case VIR_NETDEV_VPORT_PROFILE_8021QBG:
virUUIDFormat(virtPort->u.virtPort8021Qbg.instanceID,
uuidstr);
virBufferAsprintf(buf,
" <parameters managerid='%d' typeid='%d' "
"typeidversion='%d' instanceid='%s'/>\n",
virtPort->u.virtPort8021Qbg.managerID,
virtPort->u.virtPort8021Qbg.typeID,
virtPort->u.virtPort8021Qbg.typeIDVersion,
uuidstr);
break;
case VIR_NETDEV_VPORT_PROFILE_8021QBH:
virBufferAsprintf(buf,
" <parameters profileid='%s'/>\n",
virtPort->u.virtPort8021Qbh.profileID);
break;
case VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH:
virUUIDFormat(virtPort->u.openvswitch.interfaceID,
uuidstr);
if (virtPort->u.openvswitch.profileID[0] == '\0') {
virBufferAsprintf(buf, " <parameters interfaceid='%s'/>\n",
uuidstr);
} else {
virBufferAsprintf(buf, " <parameters interfaceid='%s' "
"profileid='%s'/>\n", uuidstr,
virtPort->u.openvswitch.profileID);
}
break;
default:
virNetDevError(VIR_ERR_XML_ERROR,
_("unexpected virtualport type %d"), virtPort->virtPortType);
return -1;
}
virBufferAddLit(buf, "</virtualport>\n");
return 0;
}
| rmarwaha/libvirt1 | src/conf/netdev_vport_profile_conf.c | C | lgpl-2.1 | 10,018 | [
30522,
1013,
1008,
1008,
9385,
1006,
1039,
1007,
2268,
1011,
2249,
2417,
6045,
1010,
4297,
1012,
1008,
1008,
2023,
3075,
2003,
2489,
4007,
1025,
2017,
2064,
2417,
2923,
3089,
8569,
2618,
2009,
1998,
1013,
2030,
1008,
19933,
2009,
2104,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_67) on Wed Aug 05 09:09:19 CEST 2015 -->
<title>BSPredictor (Genius GUI Documentation)</title>
<meta name="date" content="2015-08-05">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="BSPredictor (Genius GUI Documentation)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/BSPredictor.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class</li>
<li><a href="../../../../../negotiator/boaframework/offeringstrategy/anac2012/TheNegotiatorReloaded/DomainAnalyzer.html" title="class in negotiator.boaframework.offeringstrategy.anac2012.TheNegotiatorReloaded"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?negotiator/boaframework/offeringstrategy/anac2012/TheNegotiatorReloaded/BSPredictor.html" target="_top">Frames</a></li>
<li><a href="BSPredictor.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">negotiator.boaframework.offeringstrategy.anac2012.TheNegotiatorReloaded</div>
<h2 title="Class BSPredictor" class="title">Class BSPredictor</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>negotiator.boaframework.offeringstrategy.anac2012.TheNegotiatorReloaded.BSPredictor</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">BSPredictor</span>
extends java.lang.Object</pre>
<div class="block">An analyzer which returns the type of bidding strategy employed by the opponent.</div>
<dl><dt><span class="strong">Author:</span></dt>
<dd>Alex Dirkzwager, Mark Hendrikx</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../negotiator/boaframework/offeringstrategy/anac2012/TheNegotiatorReloaded/BSPredictor.html#BSPredictor(negotiator.boaframework.NegotiationSession,%20int)">BSPredictor</a></strong>(<a href="../../../../../negotiator/boaframework/NegotiationSession.html" title="class in negotiator.boaframework">NegotiationSession</a> negoSession,
int numberOfWindows)</code>
<div class="block">Initializes the amount of windows and sets the negotiation session.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../negotiator/boaframework/offeringstrategy/anac2012/TheNegotiatorReloaded/StrategyTypes.html" title="enum in negotiator.boaframework.offeringstrategy.anac2012.TheNegotiatorReloaded">StrategyTypes</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../negotiator/boaframework/offeringstrategy/anac2012/TheNegotiatorReloaded/BSPredictor.html#calculateOpponentStrategy()">calculateOpponentStrategy</a></strong>()</code>
<div class="block">Predict the strategy of the opponent.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="BSPredictor(negotiator.boaframework.NegotiationSession, int)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>BSPredictor</h4>
<pre>public BSPredictor(<a href="../../../../../negotiator/boaframework/NegotiationSession.html" title="class in negotiator.boaframework">NegotiationSession</a> negoSession,
int numberOfWindows)</pre>
<div class="block">Initializes the amount of windows and sets the negotiation session.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>negoSession</code> - the negotiation environment</dd><dd><code>numberOfWindows</code> - the total amount of window</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="calculateOpponentStrategy()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>calculateOpponentStrategy</h4>
<pre>public <a href="../../../../../negotiator/boaframework/offeringstrategy/anac2012/TheNegotiatorReloaded/StrategyTypes.html" title="enum in negotiator.boaframework.offeringstrategy.anac2012.TheNegotiatorReloaded">StrategyTypes</a> calculateOpponentStrategy()</pre>
<div class="block">Predict the strategy of the opponent.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the strategy of the opponent</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/BSPredictor.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class</li>
<li><a href="../../../../../negotiator/boaframework/offeringstrategy/anac2012/TheNegotiatorReloaded/DomainAnalyzer.html" title="class in negotiator.boaframework.offeringstrategy.anac2012.TheNegotiatorReloaded"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?negotiator/boaframework/offeringstrategy/anac2012/TheNegotiatorReloaded/BSPredictor.html" target="_top">Frames</a></li>
<li><a href="BSPredictor.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| hendrahc/nego11 | AI2015Group11assignment/javadoc/negotiator/boaframework/offeringstrategy/anac2012/TheNegotiatorReloaded/BSPredictor.html | HTML | gpl-2.0 | 10,261 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
16129,
1018,
1012,
5890,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
8917,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#Upselling
2016-06-01
Upselling is a sales technique whereby a seller induces the customer to purchase more expensive items, upgrades or other add-ons in an attempt to make a more profitable sale. While it usually involves marketing more profitable services or products, it can be simply exposing the customer to other options that were perhaps not considered. (A different technique is cross-selling in which a seller tries to sell something else.) In practice, large businesses usually combine upselling and cross-selling to maximize profit. In doing so, an organization must ensure that its relationship with the client is not disrupted.
Business models as freemium or premium could enter in this techniques.
***Tags***: Marketing, Business
#### See also
[Business Intelligence](/business_intelligence), [Business models](/business_models), [Cross-selling](/cross-selling)
| tgquintela/temporal_tasks | Notes_md/upselling.md | Markdown | mit | 882 | [
30522,
1001,
11139,
23918,
2355,
1011,
5757,
1011,
5890,
11139,
23918,
2003,
1037,
4341,
6028,
13557,
1037,
14939,
19653,
2015,
1996,
8013,
2000,
5309,
2062,
6450,
5167,
1010,
18739,
2030,
2060,
5587,
1011,
2006,
2015,
1999,
2019,
3535,
200... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
module PrintSquare
class CommandRunner
class << self
def run(args)
validate_args(args)
print_square(args[0].to_i)
end
def print_square(number)
size = Math.sqrt(number).to_i
n = number
x = PrintSquare::Vector.new size.even? ? 1 : -1, size, size.even? ? 1 : 0
y = PrintSquare::Vector.new 0, size
print = PrintSquare::Printer.new size
x.turn = proc do
y.offset += 1 if x.direction == 1
y.direction = x.direction
x.direction = 0
end
y.turn = proc do
if y.direction == -1
x.size -= 1
y.size -= 1
x.offset += 1
end
x.direction = y.direction * -1
y.direction = 0
end
until n == 0
print.set x, y, n
y.direction == 0 ? x.next : y.next
n -= 1
end
print.out
end
def validate_args(args)
usage(:no_args) if args.count == 0
usage(:too_many_args) if args.count > 1
usage(:invalid_arg) unless (Integer(args[0]) rescue false)
usage(:not_square) unless is_square?(args[0].to_i)
end
def is_square?(number)
return true if number == 1
position = 2
spread = 1
until spread == 0
current_square = position*position
return true if current_square == number
if number < current_square
spread >>= 1
position -= spread
else
spread <<= 1
position += spread
end
end
false
end
def usage(error_type)
error = case error_type
when :no_args then 'Missing argument'
when :invalid_arg then 'Argument must be a number'
when :too_many_args then 'Too many arguments'
when :not_square then "Argument is not a square number"
end
puts <<-USAGE
#{error}
print_square [square_number]
USAGE
exit(-1)
end
end
end
end
| AktionLab/print_square | lib/print_square/command_runner.rb | Ruby | mit | 2,057 | [
30522,
11336,
11204,
16211,
2890,
2465,
3094,
23195,
2465,
1026,
1026,
2969,
13366,
2448,
1006,
12098,
5620,
1007,
9398,
3686,
1035,
12098,
5620,
1006,
12098,
5620,
1007,
6140,
1035,
2675,
1006,
12098,
5620,
1031,
1014,
1033,
1012,
2000,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import re
WHITE_LIST = {
'names': {
'eno': {},
'evo': {},
'ii': {},
'li': {'alias': 'Ii'},
'utö': {},
'usa': {}
},
'patterns': [
{
'find': re.compile('([A-ZÄÖa-zäö-]*)(mlk)'),
'replace': r'\1 mlk'
}
]
} | Learning-from-our-past/Kaira | names/location_name_white_list.py | Python | gpl-2.0 | 260 | [
30522,
12324,
2128,
2317,
1035,
2862,
1027,
1063,
1005,
3415,
1005,
1024,
1063,
1005,
4372,
2080,
1005,
1024,
1063,
1065,
1010,
1005,
23408,
2080,
1005,
1024,
1063,
1065,
1010,
1005,
2462,
1005,
1024,
1063,
1065,
1010,
1005,
5622,
1005,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.mediatek.engineermode.hqanfc;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.Toast;
import com.mediatek.engineermode.Elog;
import com.mediatek.engineermode.R;
import com.mediatek.engineermode.hqanfc.NfcCommand.BitMapValue;
import com.mediatek.engineermode.hqanfc.NfcCommand.CommandType;
import com.mediatek.engineermode.hqanfc.NfcCommand.EmAction;
import com.mediatek.engineermode.hqanfc.NfcCommand.P2pDisableCardM;
import com.mediatek.engineermode.hqanfc.NfcCommand.RspResult;
import com.mediatek.engineermode.hqanfc.NfcEmReqRsp.NfcEmAlsP2pNtf;
import com.mediatek.engineermode.hqanfc.NfcEmReqRsp.NfcEmAlsP2pReq;
import com.mediatek.engineermode.hqanfc.NfcEmReqRsp.NfcEmAlsP2pRsp;
import java.nio.ByteBuffer;
public class PeerToPeerMode extends Activity {
protected static final String KEY_P2P_RSP_ARRAY = "p2p_rsp_array";
private static final int HANDLER_MSG_GET_RSP = 200;
private static final int HANDLER_MSG_GET_NTF = 201;
private static final int DIALOG_ID_RESULT = 0;
private static final int DIALOG_ID_WAIT = 1;
private static final int CHECKBOX_TYPEA = 0;
private static final int CHECKBOX_TYPEA_106 = 1;
private static final int CHECKBOX_TYPEA_212 = 2;
private static final int CHECKBOX_TYPEA_424 = 3;
private static final int CHECKBOX_TYPEA_848 = 4;
private static final int CHECKBOX_TYPEF = 5;
private static final int CHECKBOX_TYPEF_212 = 6;
private static final int CHECKBOX_TYPEF_424 = 7;
private static final int CHECKBOX_PASSIVE_MODE = 8;
private static final int CHECKBOX_ACTIVE_MODE = 9;
private static final int CHECKBOX_INITIATOR = 10;
private static final int CHECKBOX_TARGET = 11;
private static final int CHECKBOX_DISABLE_CARD = 12;
private static final int CHECKBOX_NUMBER = 13;
private CheckBox[] mSettingsCkBoxs = new CheckBox[CHECKBOX_NUMBER];
private Button mBtnSelectAll;
private Button mBtnClearAll;
private Button mBtnStart;
private Button mBtnReturn;
private Button mBtnRunInBack;
private NfcEmAlsP2pNtf mP2pNtf;
private NfcEmAlsP2pRsp mP2pRsp;
private byte[] mRspArray;
private String mNtfContent;
private boolean mEnableBackKey = true;
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
Elog.v(NfcMainPage.TAG, "[PeerToPeerMode]mReceiver onReceive: " + action);
mRspArray = intent.getExtras().getByteArray(NfcCommand.MESSAGE_CONTENT_KEY);
if ((NfcCommand.ACTION_PRE + CommandType.MTK_NFC_EM_ALS_P2P_MODE_NTF).equals(action)) {
if (null != mRspArray) {
ByteBuffer buffer = ByteBuffer.wrap(mRspArray);
mP2pNtf = new NfcEmAlsP2pNtf();
mP2pNtf.readRaw(buffer);
mHandler.sendEmptyMessage(HANDLER_MSG_GET_NTF);
}
} else if ((NfcCommand.ACTION_PRE + CommandType.MTK_NFC_EM_ALS_P2P_MODE_RSP).equals(action)) {
if (null != mRspArray) {
ByteBuffer buffer = ByteBuffer.wrap(mRspArray);
mP2pRsp = new NfcEmAlsP2pRsp();
mP2pRsp.readRaw(buffer);
mHandler.sendEmptyMessage(HANDLER_MSG_GET_RSP);
}
} else {
Elog.v(NfcMainPage.TAG, "[PeerToPeerMode]Other response");
}
}
};
private final Handler mHandler = new Handler() {
public void handleMessage(Message msg) {
super.handleMessage(msg);
String toastMsg = null;
if (HANDLER_MSG_GET_NTF == msg.what) {
switch (mP2pNtf.mResult) {
case RspResult.SUCCESS:
toastMsg = "P2P Data Exchange is terminated";
// mNtfContent = new String(mP2pNtf.mData);
// showDialog(DIALOG_ID_RESULT);
break;
case RspResult.FAIL:
toastMsg = "P2P Data Exchange is On-going";
break;
default:
toastMsg = "P2P Data Exchange is ERROR";
break;
}
} else if (HANDLER_MSG_GET_RSP == msg.what) {
dismissDialog(DIALOG_ID_WAIT);
switch (mP2pRsp.mResult) {
case RspResult.SUCCESS:
toastMsg = "P2P Mode Rsp Result: SUCCESS";
if (mBtnStart.getText().equals(PeerToPeerMode.this.getString(R.string.hqa_nfc_start))) {
setButtonsStatus(false);
} else {
setButtonsStatus(true);
}
break;
case RspResult.FAIL:
toastMsg = "P2P Mode Rsp Result: FAIL";
break;
default:
toastMsg = "P2P Mode Rsp Result: ERROR";
break;
}
}
Toast.makeText(PeerToPeerMode.this, toastMsg, Toast.LENGTH_SHORT).show();
}
};
private final CheckBox.OnCheckedChangeListener mCheckedListener = new CheckBox.OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean checked) {
Elog.v(NfcMainPage.TAG, "[PeerToPeerMode]onCheckedChanged view is " + buttonView.getText() + " value is "
+ checked);
if (buttonView.equals(mSettingsCkBoxs[CHECKBOX_TYPEA])) {
for (int i = CHECKBOX_TYPEA_106; i < CHECKBOX_TYPEF; i++) {
mSettingsCkBoxs[i].setChecked(checked);
}
} else if (buttonView.equals(mSettingsCkBoxs[CHECKBOX_TYPEF])) {
for (int i = CHECKBOX_TYPEF_212; i < CHECKBOX_PASSIVE_MODE; i++) {
mSettingsCkBoxs[i].setChecked(checked);
}
}
}
};
private final Button.OnClickListener mClickListener = new Button.OnClickListener() {
@Override
public void onClick(View arg0) {
Elog.v(NfcMainPage.TAG, "[PeerToPeerMode]onClick button view is " + ((Button) arg0).getText());
if (arg0.equals(mBtnStart)) {
if (!checkRoleSelect()) {
Toast.makeText(PeerToPeerMode.this, R.string.hqa_nfc_p2p_role_tip, Toast.LENGTH_LONG).show();
} else {
showDialog(DIALOG_ID_WAIT);
doTestAction(mBtnStart.getText().equals(PeerToPeerMode.this.getString(R.string.hqa_nfc_start)));
}
} else if (arg0.equals(mBtnSelectAll)) {
changeAllSelect(true);
} else if (arg0.equals(mBtnClearAll)) {
changeAllSelect(false);
} else if (arg0.equals(mBtnReturn)) {
PeerToPeerMode.this.onBackPressed();
} else if (arg0.equals(mBtnRunInBack)) {
doTestAction(null);
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addCategory(Intent.CATEGORY_HOME);
startActivity(intent);
}
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.hqa_nfc_p2p_mode);
initComponents();
changeAllSelect(true);
IntentFilter filter = new IntentFilter();
filter.addAction(NfcCommand.ACTION_PRE + CommandType.MTK_NFC_EM_ALS_P2P_MODE_RSP);
filter.addAction(NfcCommand.ACTION_PRE + CommandType.MTK_NFC_EM_ALS_P2P_MODE_NTF);
registerReceiver(mReceiver, filter);
}
@Override
protected void onDestroy() {
unregisterReceiver(mReceiver);
super.onDestroy();
}
@Override
public void onBackPressed() {
if (!mEnableBackKey) {
return;
}
super.onBackPressed();
}
private void initComponents() {
Elog.v(NfcMainPage.TAG, "[PeerToPeerMode]initComponents");
mSettingsCkBoxs[CHECKBOX_TYPEA] = (CheckBox) findViewById(R.id.hqa_p2pmode_cb_typea);
mSettingsCkBoxs[CHECKBOX_TYPEA].setOnCheckedChangeListener(mCheckedListener);
mSettingsCkBoxs[CHECKBOX_TYPEA_106] = (CheckBox) findViewById(R.id.hqa_p2pmode_cb_typea_106);
mSettingsCkBoxs[CHECKBOX_TYPEA_212] = (CheckBox) findViewById(R.id.hqa_p2pmode_cb_typea_212);
mSettingsCkBoxs[CHECKBOX_TYPEA_424] = (CheckBox) findViewById(R.id.hqa_p2pmode_cb_typea_424);
mSettingsCkBoxs[CHECKBOX_TYPEA_848] = (CheckBox) findViewById(R.id.hqa_p2pmode_cb_typea_848);
mSettingsCkBoxs[CHECKBOX_TYPEF] = (CheckBox) findViewById(R.id.hqa_p2pmode_cb_typef);
mSettingsCkBoxs[CHECKBOX_TYPEF].setOnCheckedChangeListener(mCheckedListener);
mSettingsCkBoxs[CHECKBOX_TYPEF_212] = (CheckBox) findViewById(R.id.hqa_p2pmode_cb_typef_212);
mSettingsCkBoxs[CHECKBOX_TYPEF_424] = (CheckBox) findViewById(R.id.hqa_p2pmode_cb_typef_424);
mSettingsCkBoxs[CHECKBOX_PASSIVE_MODE] = (CheckBox) findViewById(R.id.hqa_p2pmode_cb_passive_mode);
mSettingsCkBoxs[CHECKBOX_ACTIVE_MODE] = (CheckBox) findViewById(R.id.hqa_p2pmode_cb_active_mode);
mSettingsCkBoxs[CHECKBOX_INITIATOR] = (CheckBox) findViewById(R.id.hqa_p2pmode_cb_initiator);
mSettingsCkBoxs[CHECKBOX_TARGET] = (CheckBox) findViewById(R.id.hqa_p2pmode_cb_target);
mSettingsCkBoxs[CHECKBOX_DISABLE_CARD] = (CheckBox) findViewById(R.id.hqa_p2pmode_cb_disable_card_emul);
mBtnSelectAll = (Button) findViewById(R.id.hqa_p2pmode_btn_select_all);
mBtnSelectAll.setOnClickListener(mClickListener);
mBtnClearAll = (Button) findViewById(R.id.hqa_p2pmode_btn_clear_all);
mBtnClearAll.setOnClickListener(mClickListener);
mBtnStart = (Button) findViewById(R.id.hqa_p2pmode_btn_start_stop);
mBtnStart.setOnClickListener(mClickListener);
mBtnReturn = (Button) findViewById(R.id.hqa_p2pmode_btn_return);
mBtnReturn.setOnClickListener(mClickListener);
mBtnRunInBack = (Button) findViewById(R.id.hqa_p2pmode_btn_run_back);
mBtnRunInBack.setOnClickListener(mClickListener);
mBtnRunInBack.setEnabled(false);
}
private void setButtonsStatus(boolean b) {
if (b) {
mBtnStart.setText(R.string.hqa_nfc_start);
} else {
mBtnStart.setText(R.string.hqa_nfc_stop);
}
mBtnRunInBack.setEnabled(!b);
mEnableBackKey = b;
mBtnReturn.setEnabled(b);
mBtnSelectAll.setEnabled(b);
mBtnClearAll.setEnabled(b);
}
private void changeAllSelect(boolean checked) {
Elog.v(NfcMainPage.TAG, "[PeerToPeerMode]changeAllSelect status is " + checked);
for (int i = CHECKBOX_TYPEA; i < mSettingsCkBoxs.length; i++) {
mSettingsCkBoxs[i].setChecked(checked);
}
}
private void doTestAction(Boolean bStart) {
sendCommand(bStart);
}
private void sendCommand(Boolean bStart) {
NfcEmAlsP2pReq requestCmd = new NfcEmAlsP2pReq();
fillRequest(bStart, requestCmd);
NfcClient.getInstance().sendCommand(CommandType.MTK_NFC_EM_ALS_P2P_MODE_REQ, requestCmd);
}
private void fillRequest(Boolean bStart, NfcEmAlsP2pReq requestCmd) {
if (null == bStart) {
requestCmd.mAction = EmAction.ACTION_RUNINBG;
} else if (bStart.booleanValue()) {
requestCmd.mAction = EmAction.ACTION_START;
} else {
requestCmd.mAction = EmAction.ACTION_STOP;
}
int temp = 0;
temp |= mSettingsCkBoxs[CHECKBOX_TYPEA].isChecked() ? NfcCommand.EM_ALS_READER_M_TYPE_A : 0;
temp |= mSettingsCkBoxs[CHECKBOX_TYPEF].isChecked() ? NfcCommand.EM_ALS_READER_M_TYPE_F : 0;
requestCmd.mSupportType = temp;
CheckBox[] typeADateRateBoxs = { mSettingsCkBoxs[CHECKBOX_TYPEA_106], mSettingsCkBoxs[CHECKBOX_TYPEA_212],
mSettingsCkBoxs[CHECKBOX_TYPEA_424], mSettingsCkBoxs[CHECKBOX_TYPEA_848] };
requestCmd.mTypeADataRate = BitMapValue.getTypeAbDataRateValue(typeADateRateBoxs);
CheckBox[] typeFDateRateBoxs = { mSettingsCkBoxs[CHECKBOX_TYPEF_212], mSettingsCkBoxs[CHECKBOX_TYPEF_424] };
requestCmd.mTypeFDataRate = BitMapValue.getTypeFDataRateValue(typeFDateRateBoxs);
requestCmd.mIsDisableCardM = mSettingsCkBoxs[CHECKBOX_DISABLE_CARD].isChecked() ? P2pDisableCardM.DISABLE
: P2pDisableCardM.NOT_DISABLE;
temp = 0;
temp |= mSettingsCkBoxs[CHECKBOX_INITIATOR].isChecked() ? NfcCommand.EM_P2P_ROLE_INITIATOR_MODE : 0;
temp |= mSettingsCkBoxs[CHECKBOX_TARGET].isChecked() ? NfcCommand.EM_P2P_ROLE_TARGET_MODE : 0;
requestCmd.mRole = temp;
temp = 0;
temp |= mSettingsCkBoxs[CHECKBOX_PASSIVE_MODE].isChecked() ? NfcCommand.EM_P2P_MODE_PASSIVE_MODE : 0;
temp |= mSettingsCkBoxs[CHECKBOX_ACTIVE_MODE].isChecked() ? NfcCommand.EM_P2P_MODE_ACTIVE_MODE : 0;
requestCmd.mMode = temp;
}
@Override
protected Dialog onCreateDialog(int id) {
if (DIALOG_ID_WAIT == id) {
ProgressDialog dialog = null;
dialog = new ProgressDialog(this);
dialog.setMessage(getString(R.string.hqa_nfc_dialog_wait_message));
dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
dialog.setCancelable(false);
return dialog;
} else if (DIALOG_ID_RESULT == id) {
AlertDialog alertDialog = null;
alertDialog = new AlertDialog.Builder(PeerToPeerMode.this).setTitle(R.string.hqa_nfc_p2p_mode_ntf_title)
.setMessage(mNtfContent).setPositiveButton(android.R.string.ok, null).create();
return alertDialog;
}
return null;
}
private boolean checkRoleSelect() {
boolean result = true;
if (!mSettingsCkBoxs[CHECKBOX_INITIATOR].isChecked() && !mSettingsCkBoxs[CHECKBOX_TARGET].isChecked()) {
result = false;
}
if (!mSettingsCkBoxs[CHECKBOX_PASSIVE_MODE].isChecked() && !mSettingsCkBoxs[CHECKBOX_ACTIVE_MODE].isChecked()) {
result = false;
}
return result;
}
}
| rex-xxx/mt6572_x201 | mediatek/packages/apps/EngineerMode/src/com/mediatek/engineermode/hqanfc/PeerToPeerMode.java | Java | gpl-2.0 | 14,964 | [
30522,
7427,
4012,
1012,
2865,
23125,
1012,
3992,
5302,
3207,
1012,
16260,
2319,
11329,
1025,
12324,
11924,
1012,
10439,
1012,
4023,
1025,
12324,
11924,
1012,
10439,
1012,
9499,
27184,
8649,
1025,
12324,
11924,
1012,
10439,
1012,
13764,
8649,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>three-gap: Not compatible</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.10.0 / three-gap - 8.8.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
three-gap
<small>
8.8.0
<span class="label label-info">Not compatible</span>
</small>
</h1>
<p><em><script>document.write(moment("2020-07-16 08:04:26 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-07-16 08:04:26 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-m4 1 Virtual package relying on m4
coq 8.10.0 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.05.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.05.0 Official 4.05.0 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.8.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/three-gap"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/ThreeGap"]
depends: [
"ocaml"
"coq" {>= "8.8" & < "8.9~"}
]
tags: [ "keyword: Real Numbers" "keyword: Steinhaus" "keyword: Three Gap Theorem" "category: Mathematics/Geometry/See also" "category: Mathematics/Arithmetic and Number Theory/Miscellaneous" ]
authors: [ "Micaela Mayero" ]
bug-reports: "https://github.com/coq-contribs/three-gap/issues"
dev-repo: "git+https://github.com/coq-contribs/three-gap.git"
synopsis: "A Proof of the Three Gap Theorem (Steinhaus Conjecture)"
description: "This proof uses the real numbers. It is a classical proof."
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/three-gap/archive/v8.8.0.tar.gz"
checksum: "md5=9c01c608ed72ce065721d5de76f4cffb"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-three-gap.8.8.0 coq.8.10.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.10.0).
The following dependencies couldn't be met:
- coq-three-gap -> coq < 8.9~ -> ocaml < 4.03.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-three-gap.8.8.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
<small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small>
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| coq-bench/coq-bench.github.io | clean/Linux-x86_64-4.05.0-2.0.6/released/8.10.0/three-gap/8.8.0.html | HTML | mit | 6,969 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
11374,
1027,
1000,
4372,
1000,
1028,
1026,
2132,
1028,
1026,
18804,
25869,
13462,
1027,
30524,
1026,
18804,
2171,
1027,
1000,
3193,
6442,
1000,
4180,
1027,
1000,
9381,
1027,
5080,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
Theme Name: One Page
Theme URI: http://www.inkthemes.com/one-page-wordpress-org/
Description: One Page is a single-page theme that displays all the essential features of your website on the home page. It makes easy for the users to get all the required information within a single page. One Page is a professional and outstanding responsive business WordPress Theme. One Page was built keeping the simplicity of design in mind. The whole interface of the One Page Theme is clutter free and the place for the most important business content is provided.
You just need to create your pages that will automatically appear on the home page. All page names will be displayed on menu bar. When users click on the particular menu option, they will get redirected to that particular section on the home page. No page browsing. No page loading. It's quick, easy and simple.
Author: InkThemes.com
Author URI: http://www.inkthemes.com
Version: 1.0.8
License: GNU General Public License
License URI: license.txt
Tags: blue, two-columns, responsive-layout, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, editor-style, custom-menu
*/
/*
WARNING! DO NOT EDIT THIS FILE!
To make it easy to update your theme, you should not edit the styles in this file. Instead use
the custom.css file to add your styles. You can copy a style from this file and paste it in
custom.css and it will override the style in this file. You have been warned! :)
*/
@import url(css/reset.css);
@import url(css/fluid_grid_1140.css);
@font-face {
font-family: 'robotoregular';
src: url('fonts/roboto-regular-webfont.eot');
src: url('fonts/roboto-regular-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/roboto-regular-webfont.woff') format('woff'),
url('fonts/roboto-regular-webfont.ttf') format('truetype'),
url('fonts/roboto-regular-webfont.svg#robotoregular') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'robotolight';
src: url('fonts/roboto-light-webfont.eot');
src: url('fonts/roboto-light-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/roboto-light-webfont.woff') format('woff'),
url('fonts/roboto-light-webfont.ttf') format('truetype'),
url('fonts/roboto-light-webfont.svg#robotolight') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'robotomedium';
src: url('fonts/roboto-medium-webfont.eot');
src: url('fonts/roboto-medium-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/roboto-medium-webfont.woff') format('woff'),
url('fonts/roboto-medium-webfont.ttf') format('truetype'),
url('fonts/roboto-medium-webfont.svg#robotomedium') format('svg');
font-weight: normal;
font-style: normal;
}
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video {
margin:0;
padding:0;
border:0;
outline:0;
font-size:100%;
vertical-align:baseline;
background:transparent;
}
body {
line-height:1.47;
font-family: 'robotolight', sans-serif;
font-size:17px;
}
article,aside,details,figcaption,figure,
footer,header,hgroup,menu,nav,section {
display:block;
}
nav ul {
list-style:none;
}
blockquote, q {
quotes:none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content:'';
content:none;
}
a {
margin:0;
padding:0;
font-size:100%;
vertical-align:baseline;
background:transparent;
color:#444;
}
/* change colours to suit your needs */
ins {
background-color:#ff9;
color:#000;
text-decoration:none;
}
/* change colours to suit your needs */
mark {
background-color:#ff9;
color:#000;
font-style:italic;
font-weight:bold;
}
del {
text-decoration: line-through;
}
abbr[title], dfn[title] {
border-bottom:1px dotted;
cursor:help;
}
table {
border-collapse:collapse;
border-spacing:0;
}
/* change border colour to suit your needs */
hr {
display:block;
height:1px;
border:0;
border-top:1px solid #cccccc;
margin:1em 0;
padding:0;
}
input, select {
vertical-align:middle;
}
.sticky{
}
.gallery-caption{
}
/*-----------------------------------------------------------------------------------*/
/* 1. #Common Styles
/*-----------------------------------------------------------------------------------*/
h1,h2,h3,h4,h5,h6 {
font-family: 'robotoregular', serif;
margin:17px 0;
line-height: 31px;
}
h1 {
font-size: 1.412em;
}
h2 {
font-size: 1.294em;
}
h3 {
font-size: 1.176em;
}
h4 {
font-size: 1.059em;
}
h5 {
font-size: 0.941em;
}
h6 {
font-size: 0.824em;
}
textarea:focus, input:focus{
outline: 0;
}
blockquote {
margin-top: 40px;
margin-bottom: 40px;
padding-left: 60px;
min-height: 40px;
background: url(images/blockqoute.png) no-repeat;
}
p {
color: #1d1d1d;
padding-bottom:15px;
line-height: 24px;
}
ul, ol {
padding: 0 0 0 20px;
}
ul {
list-style: disc;
}
ol {
list-style: decimal;
}
table {
width: 100%;
background: #fff;
}
table td, table th {
padding: 8px;
border: 1px solid #d5d6d7;
text-align: left;
}
table th {
background: #49cae6;
font-weight: normal;
color: #fff;
}
table caption {
padding: 1em 0;
text-align: center;
}
dt {
font-weight: bold;
}
dd {
line-height: 1.4;
margin: 4px 0 0;
padding: 0 0 .5em 0;
}
/* select styling */
select {
padding:7px;
margin: 0;
-webkit-border-radius:4px;
-moz-border-radius:4px;
border-radius:4px;
-webkit-box-shadow: 0 3px 0 #075f72, 0 -1px #075f72 inset;
-moz-box-shadow: 0 3px 0 #075f72, 0 -1px #075f72 inset;
box-shadow: 0 3px 0 #075f72, 0 -1px #075f72 inset;
background: url(images/down_arrow_select.jpg) right no-repeat #22b0cf;
color:#fff;
border:none;
outline:none;
display: inline-block;
-webkit-appearance:none;
-moz-appearance:none;
appearance:none;
cursor:pointer;
width: 100%;
}
option {
background: #fff;
width:100%;
color:#000;
}
/* Targetting Webkit browsers only. FF will show the dropdown arrow with so much padding. */
@media screen and (-webkit-min-device-pixel-ratio:0) {
select {padding-right:18px}
}
/* select styling ends*/
.index_titles{
font-size: 2.353em;
text-align:center;
padding-top:27px;
padding-bottom:27px;
border-top:1px solid #18879f;
border-bottom:1px solid #18879f;
line-height:41px;
color: #fff;
}
.index_titles.blog {
text-align:left;
color: #fff;
}
h1.index_titles {
margin-top: 0;
margin-bottom: 0;
}
#crumbs a{
color: #fff;
}
.homepage_nav_title {
background:#087f99;
color:#fff;
}
.font_champagne{
font-family: 'robotolight', serif;
}
:-ms-input-placeholder {
font-size: 1.176em;
font-weight:normal;
color: #000;
}
:-moz-placeholder {
font-size: 1.176em;
font-weight:normal;
color: #000;
}
::-moz-placeholder {
font-size: 1.176em;
font-weight:normal;
color: #000;
}
:-ms-input-placeholder {
font-size: 1.176em;
font-weight:normal;
color: #000;
}
input,textarea
{
padding:18px 10px 13px 10px;
border:2px solid #58abbd;
-webkit-border-radius:2px;
-moz-border-radius:2px;
border-radius:2px;
box-shadow: inset 0px 4px 6px #BDB4B4;
-webkit-box-shadow: inset 0px 4px 6px #BDB4B4;
-moz-box-shadow: inset 0px 4px 6px #BDB4B4;
width:auto;
line-height: 16px;
}
textarea{
height:auto;
}
input[type="submit"]{
border:none;
-webkit-border-radius:7px;
-moz-border-radius:7px;
border-radius:7px;
border-bottom:4px solid #075f72;
border-bottom-width:5px;
background:#22b0cf;
box-shadow: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
font-family: 'robotoregular', serif;
font-size: 1.176em;
font-weight:bold;
color:#fff;
width:auto;
transition: background-color 0.2s ease-in;
cursor:pointer;
}
input[type="submit"]:hover{
background:#1c9ab5;
}
.input_shadow {
box-shadow: 0px -2px 3px #7cd0e3;
}
.default_bg {
background:url('images/featured_bg.png');
overflow:hidden;
}
/* *****search form*****/
.search-box {
position: relative;
width: 100%;
margin: 0;
margin-top:30px;
}
input.search-text {
font-size: 0.824em;
color: #000;
border-width: 0;
background: #ffffff;
padding:7px 9px 8px 9px;
-webkit-border-radius:0;
-moz-border-radius:0;
border-radius:0;
box-shadow: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
width:218px;
line-height: 22px;
}
input[type="submit"].search-button {
position: absolute;
top: 5px;
left: 201px;
background:#20b9da url('images/search_icon.png') no-repeat center;
-webkit-border-radius:0;
-moz-border-radius:0;
border-radius:0;
border:none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow:none;
font-family: 'robotoregular', serif;
font-size: 1.176em;
font-weight:bold;
color:#fff;
width:32px;
height:25px;
transition: background-color 0.2s ease-in;
}
input[type="submit"].search-button:hover {
background:#1c9ab5 url('images/search_icon.png') no-repeat center;
}
/*-----------------------------------------------------------------------------------*/
/* 2. # Top Social Header Styles
/*-----------------------------------------------------------------------------------*/
.social_wrapper{
background:#3b4043;
color:#fff;
height:auto;
height: 39px;
}
.social_icons {
margin-top:10px;
margin-bottom:11px;
float:right;
}
.social_icons .social_logos li.tw a {
background: url(images/twitter.png) no-repeat 0 0;
width: 16px;
height: 16px;
}
.social_icons .social_logos li.tw a:hover {
background: url(images/twitter.png) no-repeat 0 0;
width: 16px;
height: 16px;
}
.social_icons .social_logos li.fb a {
background: url('images/facebook.png') no-repeat 0 0;
width: 16px;
height: 16px;
}
.social_icons .social_logos li.fb a:hover {
background: url('images/facebook.png') no-repeat 0 0;
width: 16px;
height: 16px;
}
.social_icons .social_logos li.gp a {
background: url(images/google.png) no-repeat 0 0;
width: 16px;
height: 16px;
}
.social_icons .social_logos li.gp a:hover {
background: url('images/google.png') no-repeat 0 0;
width: 16px;
height: 16px;
}
.social_icons .social_logos li.rss a {
background: url(images/rss.png) no-repeat 0 0;
width: 16px;
height: 16px;
}
.social_icons .social_logos li.rss a:hover {
background: url('images/rss.png') no-repeat 0 0;
width: 16px;
height: 16px;
}
.social_icons .social_logos li.yt a {
background: url(images/youtube.png) no-repeat 0 0;
width: 16px;
height: 16px;
}
.social_icons .social_logos li.yt a:hover {
background: url('images/youtube.png') no-repeat 0 0;
width: 16px;
height: 16px;
}
.social_icons .social_logos li.pn a {
background: url(images/pinterest.png) no-repeat 0 0;
width: 16px;
height: 16px;
}
.social_icons .social_logos li.pn a:hover {
background: url('images/pinterest.png') no-repeat 0 0;
width: 16px;
height: 16px;
}
#call_us{
float:left;
font-size: 0.765em;
height:auto;
overflow:hidden;
}
#call_us div{
float:left;
}
#call_us img{
padding-top:10px;
padding-bottom:11px;
}
#call_us p {
padding-top: 10px;
padding-bottom: 10px;
padding-left: 10px;
color: #fff;
line-height: 12px;
}
/*-----------------------------------------------------------------------------------*/
/* 3. #Header logo and menu Styles
/*-----------------------------------------------------------------------------------*/
.header_wrapper {
box-shadow: 0px 2px 2px rgba(82, 82, 82, 0.4);
-moz-box-shadow: 0px 2px 2px rgba(82, 82, 82, 0.4);
-webkit-box-shadow: 0px 2px 2px rgba(82, 82, 82, 0.4);
z-index: 1000;
width: 100%;
background: #fff;
font-family: 'robotoregular', serif;
}
#logo {
padding-top:24px;
height: 73px;
}
#logo img {
max-height: 73px;
height: auto;
max-width: 100%;
width: auto;
}
/* ************* */
/* Menu Style
========================================================*/
.wrapper_menu {
margin: 0;
float: right;
}
.menu_container {
margin: 0;
padding: 0;
max-width: 100%;
}
.menu_bar {
display: inline-block;
width: 100%;
margin-left: 0;
padding-bottom: 0px;
padding-top: 20px;
}
#menu {
position: relative;
}
.subMenu{
position: absolute;
}
#menu ul {
list-style-type: none;
}
/*** ESSENTIAL MENU STYLES ***/
.sf-menu, .sf-menu * {
margin: 0;
padding: 0;
list-style: none;
}
.sf-menu li {
position: relative;
}
.sf-menu ul {
position: absolute;
display: none;
top: 100%;
left: 0;
z-index: 99;
}
.sf-menu > li {
float: left;
}
.sf-menu li:hover > ul,
.sf-menu li.sfHover > ul {
display: block;
}
.sf-menu a {
display: block;
position: relative;
}
.sf-menu ul ul {
top: 0;
left: 100%;
}
/*** MENU SKIN STYLES ***/
#menu .sf-menu {
float: right;
list-style: none;
position: relative;
z-index: 100;
margin: 0;
z-index: 99;
text-align: right;
vertical-align: top;
}
#menu .sf-menu li {
height: 97px;
margin: 0;
position: relative;
display: inline-block;
text-align: right;
margin-bottom: 0;
margin-left: 4px;
margin-right: 0;
}
#menu .sf-menu ul {
padding-top: 0px;
-moz-box-shadow: 0px 2px 8px #bbb;
-webkit-box-shadow: 0px 2px 8px #bbb;
box-shadow: 0px 2px 8px #bbb;
padding: 0 0 0 0px;
}
#menu .sf-menu li:first-child {
/*background-image:none;*/
}
#menu .sf-menu li:last-child {
border-bottom: none;
}
#menu .sf-menu li a {
color: #333;
text-decoration: none;
padding: 36px 14px 30px 16px;
line-height: 28px;
text-transform: uppercase;
-webkit-transition: all .3s ease;
-moz-transition: all .3s ease;
transition: all .3s ease;
}
#menu li.current-menu-item a, #menu li.current-menu-parent a, #menu li.current_page_parent a, #menu li a.selected, #menu li.current_page_item a {
color: #333;
text-shadow: 0 1px 0 #fff;
background: url(images/menubg.png) top repeat-x;
border-bottom: 3px solid #1193de;
-webkit-animation: all 0.7s ease-in-out;
}
#menu li a.selected, #menu li.current_page_item a {
color: #333;
text-shadow: 0 1px 0 #fff;
}
#menu li a:hover {
color: #333;
text-shadow: 0 1px 0 #fff;
background: url(images/menubg.png) top repeat-x;
border-bottom: 3px solid #1193de;
-webkit-animation: all 0.7s ease-in-out;
}
#menu li li a, #menu li li a.selected, #menu li li a:hover {
border: none;
position: relative;
}
#menu li.current-menu-item a:hover, #menu li.current-menu-parent a:hover, #menu li.current_page_parent a:hover, #menu li a:hover.selected {
text-decoration: none;
color: #333;
}
#menu li a:hover.selected {
color: #333;
}
#menu .sf-menu li li {
background-color: #fff;
margin: 0;
padding: 0;
height: auto;
}
#menu .sf-menu li li a {
width: 216px;
height: auto;
float: none;
display: block;
text-align: left;
position: relative;
margin: 0;
padding: 7px 0;
/* background: url('images/arrow.png') no-repeat 0 14px;*/
padding-left: 15px;
/*padding-right:15px;*/
text-shadow: none;
border-left: none;
font-size: 0.824em;
line-height: 28px;
text-transform: capitalize;
color: #333;
font-weight: normal;
-webkit-transition: all 0.3s linear;
-moz-transition: all 0.3s linear;
-o-transition: all 0.3s linear;
}
#menu .sf-menu li li:last-child {
padding-bottom: 0px;
}
#menu .sf-menu li li a:after {
width: 100%;
content: '';
position: absolute;
left: 0;
top: 0;
}
#menu .sf-menu li li li li:last-child a, #menu .sf-menu li li li li:last-child a:after {
border-top: none;
}
#menu .sf-menu li li:last-child a:after {
width: 100%;
content: '';
position: absolute;
left: 0;
bottom: 0;
}
* html #menu .sf-menu li li a {
display: inline-block;
}
#menu .sf-menu li li a:link, #menu .sf-menu li li a:visited {
background-image: none;
}
#menu .sf-menu li li a.selected, #menu .sf-menu li li a:hover {
text-shadow: none;
background-color: #f7f6f6;
color: #1b95af;
}
#menu .sf-menu li ul {
position: absolute;
left: 0;
margin-top: 4px;
margin-left: 0px;
text-align: center;/*margin:0 auto;*/
}
#menu .sf-menu li ul li {
display: list-item;
float: none;
border-top: none;
background-color: #fff;
border-bottom: 1px solid #ececec;
border-left: 1px solid #ddd;
border-right: 1px solid #ddd;
width: 231px;
}
#menu .sf-menu li ul li ul {
padding-top: 0;
top: 0;
margin-top: 0;
left: -233px;
z-index: 333;
}
#menu .sf-menu li ul li ul li:first-child {
padding-top: 0;
}
* html .sf-menu {
height: 1%;
}
.downarrowclass {
position: absolute;
width: 11px;
height: 8px;
overflow: hidden;
top: 14px;
right: -15px;
background: url('images/up-arrow.png') no-repeat 0 0;
}
.rightarrowclass {
display: block;
width: 11px;
height: 8px;
position: absolute;
margin-top: -3px;
top: 50%;
right: 0;
background: url('images/up-arrow.png') no-repeat 0 0;
}
.ddshadow {
width: 0;
height: 0;
position: absolute;
left: 0;
top: 0;
display: none;
}
#menu .sf-menu li li a:hover {
color: #1b95af;
border: none;
}
#menu .sf-menu li li a {
border: none;
}
/*=======================================================*/
/* Responsive Dropdown Menu Style */
/*=======================================================*/
.it_mobile_menu li {
margin: 0;
display:block;
}
.it_mobile_menu li a {
font-size: 0.906em;
text-decoration: none;
text-transform: capitalize;
text-shadow: none;
border-bottom: 1px solid #e2e0e0;
margin: 0 !important;
}
.it_mobile_menu li:last-child a {
border-bottom: none;
padding-bottom: 15px;
}
.it_mobile_menu li a:hover {
color: #2565ac;
}
.it_mobile_menu > li.current_page_item > a {
color: #2565ac;
}
#mobile_menu {
width: 318px;
border: 1px solid #e2e0e0 !important;
left: -1px;
padding: 0;
background: #f8f8f8;
top: 30px !important;
z-index: 9999px;
list-style: none;
}
#mobile_menu ul {
list-style: none;
margin-bottom: 0;
}
.it_mobile_menu {
position: absolute;
top: 46px !important;
left: 3px;
z-index: 1000;
display: none;
text-align: left;
}
.it_mobile_menu ul {
display: block !important;
visibility: visible !important;
border-bottom: 1px solid #e2e0e0;
}
.it_mobile_menu ul li a {
margin-left: 12px !important;
padding-top: 12px !important;
padding-bottom: 4px !important;
}
.it_mobile_menu ul li:last-child a {
padding-bottom: 10px !important;
}
.it_mobile_menu ul a {
border-bottom: none;
}
.mobile_nav {
color: #3B3B3B;
display: none;
background: #f8f8f8;
border: 1px solid #e2e0e0;
position: relative;
padding: 10px 22px 8px 46px;
font-size: 0.706em;
text-transform: uppercase;
font-weight: bold;
width: 250px;
}
.mobile_nav:before, .mobile_nav:after {
content: '';
position: absolute;
top: 0;
width: 2px;
height: 100%;
}
.mobile_nav:before {
left: 0;
}
.mobile_nav:after {
right: 0;
}
.mobile_nav:hover {
text-decoration: none;
color: #3B3B3B;
}
.mobile_nav > span {
display: block;
width: 15px;
height: 10px;
background: url(images/responsive_arrow.png) no-repeat;
position: absolute;
top: 19px;
left: 63px;
-moz-transition: all 0.5s ease-in-out;
-webkit-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}
.mobile_nav.opened > span {
-moz-transform: rotate(-180deg);
-webkit-transform: rotate(-180deg);
-o-transform: rotate(-180deg);
transform: rotate(-180deg);
}
/*-----------------------------------------------------------------------------------*/
/* 4. #Full Screen Slider Style
/*-----------------------------------------------------------------------------------*/
/*slider text*/
.homepage_top_feature {
margin-top: 90px;
}
.homepage_top_feature img{
width: 100%;
}
.slider_img_container {
position: relative;
}
.slider_text_container {
position: absolute;
top: 31%;
width: 100%;
}
.slider_text_container h2 {
color: #fff;
font-size: 2.059em;
line-height: 40px;
margin-bottom: 10px;
max-height: 92px;
overflow: hidden;
text-shadow: 0px 2px 0px rgba(0,0,0,0.2);
font-family: 'robotomedium', serif;
}
.slider_text_container a {
color: #fff;
background: rgba(47,147,208,0.5);
padding: 15px;
line-height: 33px;
overflow: hidden;
text-shadow: 0px 2px 0px rgba(0,0,0,0.2);
}
.slider_text_container p{
overflow: hidden;
font-size: 1.588em;
width: 60%;
}
/*-----------------------------------------------------------------------------------*/
/* 5. #Featured Text Styles
/*-----------------------------------------------------------------------------------*/
.featured_text_area {
text-align: center;
line-height: 36px;
}
#fta_top{
padding-top: 38px;
font-size: 2.000em;
line-height: 39px;
}
#fta_bottom {
font-size: 1.412em;
padding-bottom:50px;
line-height: 26px;
}
/*-----------------------------------------------------------------------------------*/
/* 6. # Our Service Box Styles
/*-----------------------------------------------------------------------------------*/
.services_box_container {
margin-top:85px;
margin-bottom: 30px;
}
#services_box_container4{
margin-right:0px;
}
p.services_box_rect_head{
padding:157px 0px 10px 21px;
font-size: 1.235em;
font-family:'robotomedium', sans-serif;
overflow:hidden;
text-align:center;
width: 223px;
}
p.services_box_rect_para{
text-align:center;
padding-left:18px;
padding-right:18px;
overflow: hidden;
}
.rect_box {
overflow: hidden;
margin-top: -130px;
background: #085262;
width: 265px;
border-bottom:6px solid #0dabce;
}
.rect_box p, .rect_box p a{
color: white;
}
/*-----------------------------------------------------------------------------------*/
/* 7. #Featured Blog Styles
/*-----------------------------------------------------------------------------------*/
.featured_blog_content{
overflow:hidden;
padding-top:75px;
padding-bottom: 32px;
}
.featured_blog_content .post:nth-child(1){
padding-top:0px;
padding-right:0px;
}
.featured_blog_content .post .post_heading_wrapper img {
box-shadow: none;
}
.featured_blog_content .post:nth-child(3n){
float: none;
margin-right:0px;
}
.featured_blog_content .post{
width: 347px;
display: inline-table;
margin-right: 49px;
}
.featured_blog_content .post .post_content p{
overflow:hidden;
}
.featured_blog_content .post_heading_wrapper .thumb img {
height:100%;
transition: all .5s;
width:100%;
}
.featured_blog_content .post_heading_wrapper .thumb {
height: 197px;
overflow: hidden;
margin-bottom:29px;
width: 100%;
-moz-transform:scale(1,1);
-webkit-transform:scale(1,1);
-o-transform:scale(1,1);
-ms-transform:scale(1,1);
transform:scale(1,1);
-webkit-transition: all 0.2s ease-in;
-moz-transition: all 0.2s ease-in;
-o-transition: all 0.2s ease-in;
-ms-transition: all 0.2s ease-in;
transition: all 0.2s ease-in;
}
.featured_blog_content .post_heading_wrapper img:hover {
-moz-transform:scale(1.5,1.5);
-webkit-transform:scale(1.5,1.5);
-o-transform:scale(1.5,1.5);
-ms-transform:scale(1.5,1.5);
transform:scale(1.5,1.5);
}
.featured_blog_content .post .post_title {
overflow: hidden;
text-overflow: ellipsis;
}
/***********************************************/
/*-----------------------------------------------------------------------------------*/
/* 8. #Gallery Hexagon Styles
/*-----------------------------------------------------------------------------------*/
.gallery_wrapper {
margin-bottom:0px;
padding-top: 65px;
overflow:hidden;
}
.gallery_tabs {
font-size: 1.118em;
margin-left:auto;
margin-right:auto;
width:100%;
text-align: center;
}
.gallery_tabs ul, li, a{
text-decoration:none;
display:inline-block;
}
.gallery_tabs a{
background:#20b9da;
padding: 10px 10px 10px 8px;
border-bottom:2px solid #022128;
color:#fff;
margin-left: 16px;
transition: background-color 0.2s ease-in;
text-transform:capitalize;
}
.gallery_tabs a:hover{
background:#085262;
}
.gallery_tabs li.active a {
background:#085262;
}
/*-----------------------------------------------------------------------------------*/
/* 9. #Contact page Styles
/*-----------------------------------------------------------------------------------*/
.contact_wrapper {
overflow: hidden;
padding-top: 70px;
padding-bottom: 70px;
text-align: center;
}
.contact_container {
overflow: hidden;
}
.contact_input p{
margin-bottom:36px;
margin-left:110px;
}
.contact_input h1 a {
color: #a8a8a8;
}
.contact_input h1 {
margin-bottom: 0;
}
.contact_input textarea , .contact_input input{
width:394px;
}
.contact_input textarea{
width:394px;
height:208px;
}
/* *** address and map*** */
.add_n_map p{
display:inline;
padding-left:16px;
}
.add_n_map h1 {
padding-bottom:16px;
border-bottom:1px solid #edebf0;
margin-bottom:19px;
}
.contact-image-mail-icon{
background: url(images/mail_icon.png) no-repeat 0 0;
width: 16px;
height: 11px;
display:inline-block;
}
.contact-image-tele-icon{
background: url(images/tele_icon.png) no-repeat 0 0;
width: 16px;
height: 16px;
display:inline-block;
}
.contact-image-bookmark-icon{
background: url(images/bookmark_icon.png) no-repeat 0 0;
width: 16px;
height: 18px;
display:inline-block;
}
.contact-image-globe-icon{
background: url(images/globe_icon.png) no-repeat 0 0;
width: 16px;
height: 16px;
display:inline-block;
}
.anchor_bordera h1 {
margin-top: 0px;
}
/*-----------------------------------------------------------------------------------*/
/* 10. #Footer Styles
/*-----------------------------------------------------------------------------------*/
.footer {
padding-top:52px;
background:#111;
overflow:hidden;
color: #d8d4d4;
padding-bottom:50px;
}
.footer ul {
padding: 0 0 0 0;
}
.footer ul li {
background: url(images/footer-li-col.png) no-repeat 0 6px;
padding-left:28px;
}
.footer ul li a{
border-bottom:1px dotted #4b4a4a;
padding-bottom:6px;
display:block;
}
.footer ol li{
display: list-item;
padding-left: 3px;
margin-left: 5px;
list-style-type: decimal;
}
.footer h1 {
font-family: 'robotoregular', serif;
}
.footer p{
line-height: 25px;
color: #fff;
}
.footer li{
display:block;
padding-bottom: 13px;
}
.footer_columns.second {
margin-right:16px;
margin-left:5px;
}
.footer_columns.third {
margin-right:11px;
margin-left:10px;
}
.footer_columns a{
color: #fff;
}
.footer_columns.last{
margin-right:0px;
margin-left:21px;
}
.footer_columns.first {
margin-right:21px;
margin-left:0px;
}
.gallery_widgets{
overflow:hidden;
}
.gallery_widgets ul li {
background: none;
padding-left: 0px;
}
.gallery_widgets img{
width:auto;
height:auto;
min-width:58px;
min-height:63px;
max-width:58px;
max-height:63px;
margin-right:3px;
margin-bottom:3px;
}
.gallery_widgets img:hover {
}
.gallery_widgets li{
display:inline;
border-bottom: none;
}
/* footer calender */
.footer #wp-calendar tbody td {
padding: 6px;
}
/* footer calender */
/* footer img */
.footer img{
width:100%;
}
.footer .wp-caption-text {
color: #000;
}
.footer .wp-smiley {
width:15px;
}
/* footer img */
/* footer widget search */
.footer .searchform {
padding: 0px;
border:none;
}
/* footer widget search */
.footer .tagcloud {
padding: 0px;
border:none;
display: inline-block;
}
.footer .textwidget {
padding: 0px;
border:none;
line-height: 24px;
}
.footer option {
background: #fff;
width:100%;
color:#000;
}
/* rss widget */
.footer .rsswidget{
padding-bottom: 10px;
display:inline-block;
}
.footer .rsswidget img{
width: auto;
}
.footer .rssSummary {
padding-top:10px;
padding-bottom: 10px;
line-height: 18px;
font-size: 0.941em;
}
.footer .rss-date {
display:block;
}
.footer cite {
margin-bottom:10px;
border-bottom:1px solid #d5d6d7;
}
/* rss widget */
/* footer search widget */
.footer .searchform {
position:relative;
}
.footer #searchsubmit {
width: 35px;
height: 31px;
margin-left: -4px;
background: #20b9da url('images/search_icon.png') no-repeat center;
border: 3px solid #fff;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
font-family: 'robotoregular', serif;
font-size: 1.176em;
font-weight: bold;
color: #000;
transition: background-color 0.2s ease-in;
}
.footer #searchsubmit input{
color:#fff;
}
.footer #search {
width:78%;
padding: 11px 10px 10px 10px;
border: none;
box-shadow: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
line-height: 16px;
color: #000;
}
.footer input[type="submit"]{
border-radius:0;
-webkit-border-radius:0;
-moz-border-radius:0;
}
.footer input[type="text"]{
border-radius:0;
-webkit-border-radius:0;
-moz-border-radius:0;
}
/* search widgets */
/*-----------------------------------------------------------------------------------*/
/* 11. #Copyright Footer Styles
/*-----------------------------------------------------------------------------------*/
.copyright_text{
width:100%;
}
.copyright_text p{
font-size: 1.235em;
padding-top:29px;
padding-bottom:22px;
color: #1d1d1d;
}
.copyright_text p a{
color: #1d1d1d;
}
.footer_social_icons {
float:right;
}
.footer_social_icons div{
display:inline-block;
margin-left: 7px;
}
.footer_social_icons .social_logos li.tw a {
background: url(images/social-icons.png) no-repeat -94px 0;
width: 45px;
height: 66px;
}
.footer_social_icons .social_logos li.tw a:hover {
background: url(images/social-icons.png) no-repeat -94px -68px;
width: 45px;
height: 66px;
}
.footer_social_icons .social_logos li.fb a {
background: url('images/social-icons.png') no-repeat -47px 0;
width: 45px;
height: 66px;
}
.footer_social_icons .social_logos li.fb a:hover {
background: url('images/social-icons.png') no-repeat -47px -68px;
width: 45px;
height: 66px;
}
.footer_social_icons .social_logos li.gp a {
background: url(images/social-icons.png) no-repeat -188px 0;
width: 45px;
height: 66px;
}
.footer_social_icons .social_logos li.gp a:hover {
background: url('images/social-icons.png') no-repeat -188px -68px;
width: 45px;
height: 66px;
}
.footer_social_icons .social_logos li.ln a {
background: url(images/social-icons.png) no-repeat -282px 0;
width: 45px;
height: 66px;
}
.footer_social_icons .social_logos li.ln a:hover {
background: url('images/social-icons.png') no-repeat -282px -68px;
width: 45px;
height: 66px;
}
.footer_social_icons .social_logos li.yt a {
background: url(images/social-icons.png) no-repeat 0 0;
width: 45px;
height: 66px;
}
.footer_social_icons .social_logos li.yt a:hover {
background: url('images/social-icons.png') no-repeat 0 -68px;
width: 45px;
height: 66px;
}
.footer_social_icons .social_logos li.pn a {
background: url(images/social-icons.png) no-repeat -235px 0;
width: 45px;
height: 66px;
}
.footer_social_icons .social_logos li.pn a:hover {
background: url('images/social-icons.png') no-repeat -235px -68px;
width: 45px;
height: 66px;
}
/*-----------------------------------------------------------------------------------*/
/* 12. #Services Styles
/*-----------------------------------------------------------------------------------*/
.ch-grid {
margin: 0px 0 0 0;
padding: 0;
list-style: none;
display: block;
text-align: center;
width: 100%;
z-index:1000;
}
.ch-grid:after,
.ch-item:before {
content: '';
display: table;
}
.ch-grid:after {
clear: both;
}
.ch-grid li {
width: 220px;
display: inline-block;
margin-bottom:40px;
position:relative;
float: left;
margin-left: auto ;
margin-right: 75px ;
display: table-cell;
}
.ch-grid ul {
display: table;
}
/****style5****/
.ch-item {
width: 118%;
height: 118%;
border-radius: 50%;
border: solid #1B4046;
position: relative;
cursor: default;
box-shadow:
inset 0 0 0 0 rgba(200,95,66, 0.4),
inset 0 0 0 16px rgba(255,255,255,0.6),
0 1px 2px rgba(0,0,0,0.1);
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
}
.ch-img-1 {
background-size:260px 260px;
border-radius:50%;
height: 260px;
}
.ch-img-1 img{
border-radius: 50%;
width: 260px;
height: 260px;
text-align: center;
}
.ch-img-2 {
background-size:260px 260px;
border-radius:50%;
height: 260px;
}
.ch-img-2 img{
border-radius: 50%;
width: 260px;
height: 260px;
text-align: center;
}
.ch-img-3 {
background-size:260px 260px;
border-radius:50%;
height: 260px;
}
.ch-img-3 img{
border-radius: 50%;
width: 260px;
height: 260px;
text-align: center;
}
.ch-img-4 {
background-size:260px 260px;
border-radius:50%;
height: 260px;
}
.ch-img-4 img{
border-radius: 50%;
width: 260px;
height: 260px;
text-align: center;
}
.ch-info {
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
opacity: 0;
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
-webkit-transform: scale(0);
-moz-transform: scale(0);
-o-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
-webkit-backface-visibility: hidden; /*for a smooth font */
}
.ch-item:hover {
box-shadow:
inset 0 0 0 110px rgba(200,95,66, 0.4),
inset 0 0 0 16px rgba(255,255,255,0.8),
0 1px 2px rgba(0,0,0,0.1);
}
.ch-item:hover .ch-info {
opacity: 1;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
/*-----------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------*/
/* 13. #Wookmark Gallery Styles
/*-----------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------*/
#main {
overflow: hidden;
}
/**
* Grid items animation
*/
#tiles li {
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
.wookmark-placeholder {
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
/**
* Filters
*/
#filters {
list-style-type: none;
text-align: center;
margin: 0 5% 0 5%;
}
#filters li {
font-size: 1.059em;
font-family: 'robotoregular', serif;
-webkit-transition: all 0.15s ease-out;
-moz-transition: all 0.15s ease-out;
-o-transition: all 0.15s ease-out;
transition: all 0.15s ease-out;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
padding-top: 10px;
text-shadow: 0 1px 0 rgba(0,0,0,0.4);
}
#filters li:hover {
cursor: pointer;
}
#filters li.active {
color: #ffffff;
}
/* main css */
#main {
margin: 30px 0 70px 0;
position: relative;
}
/**
* Grid container
*/
#tiles {
list-style-type: none;
position: relative; /** Needed to ensure items are laid out relative to this container **/
margin: 0;
padding: 0;
}
/**
* Grid items
*/
#tiles li {
width: 200px;
display: none; /** Hide items initially to avoid a flicker effect **/
cursor: pointer;
padding: 4px;
}
#tiles li.inactive {
visibility: hidden;
opacity: 0;
}
#tiles li img {
display: block;
position: absolute;
left: 42%;
top: 46%;
}
/**
* Grid item text
*/
#tiles li p {
color: #666;
font-size: 0.706em;
margin: 7px 0 0 7px;
}
/**
* Placerholder css
*/
.wookmark-placeholder {
z-index: -1;
}
/*-----------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------*/
/* 13. #Hex gallery Styles
/*-----------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------*/
/* 14. #Post page Styles
/*-----------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------*/
.post:nth-child(1){
padding-top:70px;
}
.page:nth-child(1) {
padding-top: 70px;
}
.post{
overflow: hidden;
}
p.post a {
color: #989696;
}
.post a{
color:#000;
display:inline-block;
}
.post .post_content ul li{
display: list-item;
padding-left: 3px;
margin-left: 5px;
list-style-type: disc;
}
.post .post_content ol li{
display: list-item;
padding-left: 3px;
margin-left: 5px;
list-style-type: decimal;
}
.post_content {
border-bottom:1px #eae7e7 solid;
position: relative;
}
.post_content a{
color: #989696;
padding-bottom: 1px;
}
.post_content a:hover{
-webkit-transition: color 0.5s;
-moz-transition: color 0.5s;
transition: color 0.5s;
color: #087F99;
}
.post_heading_wrapper img {
border: 1px solid #d5d6d7;
box-shadow: 1px 0px 5px #A29C9C;
height: auto;
max-height:363px;
width: 100%;
margin-bottom:29px;
}
.page_heading h1,h1.post_title {
margin-top:0;
line-height: 27px;
margin-bottom: 25px;
}
.postimage_container {
position:relative;
overflow:hidden;
}
.post_category{
top: 43px;
left: 1px;
position: absolute;
background: #02404e;
opacity: 0.59;
white-space: nowrap;
text-align:center;
font-family: 'robotoregular', serif;
font-size: 1.235em;
font-weight: 600;
padding: 10px;
box-shadow: 0px 2px 2px #C5CFD1;
}
a.post_category {
color: #fff;
}
ul.post_meta {
font-size: 0.824em;
padding-bottom: 26px;
padding-left: 0;
}
.post_meta span {
line-height: 24px;
}
.posted_by a{
color: #989696;
transition: all .5s;
}
.posted_by a:hover{
color: #22b0cf;
}
.post_comment {
float:right;
color: #989696;
}
.post_comment a {
padding-left: 4px;
color: #989696;
transition: all .5s;
}
.post_comment a:hover {
color: #22b0cf;
}
.post_title h1 {
font-size: 1.294em;
margin-top: 0;
}
.post_content{
line-height: 30px;
}
.post_content{
padding-bottom: 27px;
margin-bottom: 38px;
}
.post_content img {
max-width: 100%;
height: auto;
width: auto;
}
.post_content table th a{
color: #fff;
}
.post iframe, .page iframe {
width: 100%;
}
.single.index_titles {
font-size: 1.176em;
padding-top: 15px;
padding-bottom: 15px;
text-shadow: 0px 1px 0px rgb(151, 151, 151);
}
.read-more {
padding-top: 8px;
font-family: 'robotoregular', serif;
color: #096c82;
font-weight:600;
line-height: 15px;
}
a.read-more {
color:#096c82;
}
.thumb span {
position: absolute;
background: rgba(2,64,78,0.49);
top: 1px;
left: 1px;
white-space: nowrap;
text-align:center;
color: #fff;
font-family: 'robotoregular', serif;
padding-left: 10px;
padding-right: 10px;
padding-top: 10px;
padding-bottom: 10px;
border-bottom: 2px solid rgba(0,0,0,0.3);
text-shadow: 0px 1px 0px rgb(0,0,0);
}
.thumb span a {
color: #fff;
}
.thumb {
float:left;
position:relative;
overflow:hidden;
}
/* paging */
.paging li a {
padding: 7px;
color: white;
border: none;
margin-right:7px;
margin-bottom:42px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
border-bottom: solid #075f72;
border-bottom-width: 3px;
background: #22b0cf;
box-shadow: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
font-family: 'robotoregular', serif;
font-size: 1.176em;
font-weight: bold;
color: #fff;
transition: background-color 0.2s ease-in;
cursor: pointer;
display: inline-block;
float:left;
}
.paging li a:hover{
background: #087f99;
}
.paging .current{
background: #087f99;
}
.nav-next {
float: right;
}
#nav-single {
margin-bottom: 38px;
}
#nav-single a{
color: #989696;
transition: all .3s;
}
#nav-single a:hover{
color: #000;
}
/*404 style starts
**************** */
.error input {
width: 92%;
}
.searchform {
position:relative;
}
.error #s {
color: #FFF;
border-width: 0;
background: #08768e;
overflow:hidden;
border-radius:4px;
width: 93%;
box-shadow: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
}
.error .tagcloud, .textwidget {
padding: 20px;
border:1px solid #d5d6d7;
}
.error #searchsubmit {
width: 35px;
height: 33px;
margin-left: -9px;
border-top-right-radius:4px;
border-bottom-right-radius:4px;
border-top-left-radius:0px;
border-bottom-left-radius:0px;
background: #20b9da url('images/search_icon.png') no-repeat center;
border: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
font-family: 'robotoregular', serif;
font-size: 1.176em;
font-weight: bold;
color: #fff;
transition: background-color 0.2s ease-in;
}
#searchsubmit input{
color:#fff;
}
.error.sidebar .searchform {
padding: 0px;
border: none;
text-align: center;
}
.error.sidebar #search {
width:41%;
padding-bottom: 9px;
padding-top: 8px;
padding-left: 10px;
padding-right:9px;
border: none;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
box-shadow: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
line-height: 16px;
color: #fff;
}
.fourzerofourerror {
text-align: center;
font-size: 2.824em;
line-height: 37px;
}
.fourzerofourerror.somewhat {
font-size: 1.000em;
border-bottom: 1px solid #000;
padding-bottom: 50px;
}
.error.sidebar .itseems {
text-align: center;
padding-top: 30px;
padding-bottom: 20px;
}
/********************************/
/*********** sidebar ************/
/********************************/
.sidebar {
margin-top:70px;
margin-left:39px;
margin-bottom:42px;
overflow: hidden;
}
.sidebar h3:nth-child(1) {
margin-top:0px;
}
.sidebar h3 {
font-size: 1.235em;
font-family: 'robotoregular', serif;
font-weight: 600;
}
.searchform {
padding: 20px;
border:1px solid #d5d6d7;
}
.sidebar > ul {
border:1px solid #d5d6d7;
padding: 1.176em;
margin-bottom: 17px;
}
.sidebar a{
color: #989696;
transition:all .3s;
}
.sidebar li a:hover{
color: #22b0cf;
padding-left:17px;
}
.sidebar p {
padding:15px 0;
line-height:26px;
}
.sidebar ul li {
padding: 9px 0;
margin-left: 0px;
display: block;
line-height: 24px;
border-bottom: 1px dotted #d3d3d3;
}
.sidebar ul li:last-child{
border-bottom:none;
}
.sidebar .ngg-widget img{
margin: 0pt 12px 12px 0px;
}
.sidebar img {
max-width:100%;
}
.sidebar input {
width: 92%;
}
.searchform {
position:relative;
}
.sidebar #s {
color: #FFF;
border-width: 0;
background: #08768e;
overflow:hidden;
border-radius:4px;
width: 93%;
box-shadow: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
}
.sidebar .tagcloud, .textwidget {
padding: 20px;
border:1px solid #d5d6d7;
}
.sidebar #searchsubmit {
width: 35px;
height: 33px;
margin-left: -9px;
border-top-right-radius:4px;
border-bottom-right-radius:4px;
border-top-left-radius:0px;
border-bottom-left-radius:0px;
background: #20b9da url('images/search_icon.png') no-repeat center;
border: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
font-family: 'robotoregular', serif;
font-size: 1.176em;
font-weight: bold;
color: #fff;
transition: background-color 0.2s ease-in;
}
#searchsubmit input{
color:#fff;
}
.sidebar #search {
width:82%;
padding-bottom: 9px;
padding-top: 8px;
padding-left: 10px;
padding-right:9px;
border: none;
background: #08768e;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
box-shadow: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
line-height: 16px;
color: #fff;
}
/* search widgets */
/* rss widget */
.sidebar .rsswidget{
padding-bottom: 10px;
}
.sidebar .rssSummary {
padding-top:10px;
padding-bottom: 10px;
line-height: 18px;
}
.sidebar .rss-date {
display:block;
}
.sidebar cite {
margin-bottom:10px;
border-bottom:1px solid #d5d6d7;
}
.sidebar .tagcloud a{
transition: color .7s ease-in-out;
color: #989696;
padding-bottom: 1px;
border-bottom: none;
}
.sidebar .tagcloud a:hover{
color: #22b0cf;
padding-bottom: 0px;
border-bottom: 1px solid #22b0cf;
}
/********************************************/
.sidebar_headings {
font-size: 1.235em;
font-family: 'robotoregular', serif;
font-weight:600;
}
.sidebar_container {
padding-top:25px;
margin-left:39px;
}
.sidebar_widget {
padding-top:45px;
overflow: hidden;
}
/* search box */
.sidebar_widget input.search-text {
color: #FFF;
border-width: 0;
background: #08768e;
overflow:hidden;
border-radius:4px;
width: 93%;
}
.sidebar_widget input[type="submit"].search-button {
width: 35px;
height: 37px;
top: 2px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
left: 88%;
}
.search-border .search-box {
margin-top:0px;
}
.search-border{
border: 1px solid #d5d6d7;
padding: 20px;
margin-top: 24px;
width: 87%;
}
/* search box ends */
/* ** blog posts */
.sidebar_blog_posts {
background: #ffffff;
border: 1px solid #d5d6d7;
width: 90%;
height: auto;
padding: 15px;
margin-top: 20px;
overflow: hidden;
}
.popular_tab{
position: absolute;
top: -40px;
left: -1px;
}
.popular_tab a{
background: #02ab68;
color: #ffffff;
padding: 13px 14px 11px 14px;
cursor: pointer;
}
.popular_tab p{
font-family: 'Chaparral Pro';
font-size: 0.882em;
}
.popular_content {
border: 1px solid #ededed;
position: relative;
margin-top: 39px;
padding-top: 17px;
}
.popular_tab_content_wrapper div{
float: left;
display: inline-block;
}
.popular_tab_content_wrapper{
font-size: 0.824em;
overflow: hidden;
padding: 0px 17px 17px 17px;
}
.popular_content img{
height: 54px;
width: 54px;
}
.popular_tab_content {
width: 76%;
padding-left: 8px;
height: 54px;
overflow: hidden;
text-overflow: ellipsis;
font-size: 0.765em;
}
.popular_tab_content a {
color:#218ABC;
padding-bottom:5px;
}
.popular_tab.recent a{
background:#eaeaea;
color:#000000;
cursor:pointer;
}
.popular_tab.recent {
left: 96px;
}
.popular_tab.comments {
left: 184px;
}
.popular_tab.comments a{
background:#eaeaea;
color:#000000;
}
#recent {
display:none;
}
#popular {
display:block;
}
/* ** blog posts ends*/
/* *****************calender widgets*********** */
#calendar_wrap{
padding: 18px 17px 18px 16px;
border:1px solid #d5d6d7;
background:#fff;
margin-top: 20px;
}
#wp-calendar {
color: #666;
font-size: 0.706em;
}
#wp-calendar a { color: #467b89 }
#wp-calendar caption {
background: #08768e;
color: #fff;
font-size: 0.941em;
padding: 10px 0;
text-align: center;
border: 1px solid #d5d6d7;
border-bottom:none;
z-index: -99;
}
#wp-calendar thead th {
font-size: 0.824em;
text-align: center;
padding: 5px 0;
color: #fff;
text-transform: uppercase;
text-shadow: 0 1px 0 rgba(255,255,255,0.5);
border-bottom: 1px solid #d5d6d7;
background: #333333;
}
#wp-calendar tbody td {
color: #666;
text-shadow: 0 1px 0 rgba(255,255,255,0.5);
padding: 13px;
text-align: center;
font-weight: bold;
border: 1px solid #d5d6d7;
background: #fff;
font-size: 0.824em;
}
#wp-calendar tbody td:hover {
color: #fff;
border: 1px solid #467b89;
text-shadow: 0 1px 0 rgba(0,0,0,0.3);
background: #6eafbf;
background: -moz-radial-gradient(50% 50% 0deg,ellipse cover, #6eafbf, #569EB1);
background: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 20, from(#6eafbf), to(#569EB1));
transition: all .5s;
}
#wp-calendar tbody td.pad {
background: #f5f5f5;
background: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#ececec));
background: -moz-linear-gradient(top, #f5f5f5, #ececec);
}
#wp-calendar tfoot {
color: #e0e0e0;
font-size: 0.824em;
text-align: center;
}
#wp-calendar tfoot tr {
border:1px solid #efefef;
}
#wp-calendar tfoot td { padding: 10px 10px }
#wp-calendar tfoot a {
color: #666;
text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}
#wp-calendar tfoot td#prev { text-align: left }
#wp-calendar tfoot td#next { text-align: right; border-right: 1px solid #d5d6d7; }
#wp-calendar #today {
color: #fff;
border: 1px solid #467b89;
text-shadow: 0 1px 0 rgba(0,0,0,0.3);
background: #6eafbf;
background: -moz-radial-gradient(50% 50% 0deg,ellipse cover, #6eafbf, #569EB1);
background: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 20, from(#6eafbf), to(#569EB1));
}
/* *****************calender widgets ends*********** */
/****** widget featured project 4 ********/
.featured_project {
padding:15px;
border: 1px solid #d5d6d7;
margin-top:20px;
background:#fff;
}
.futured_project_container {
background: #08768e;
height:200px;
}
/****** widget featured project 4 ends********/
/**** widget 5 text **/
.widget_text p{
line-height:26px;
padding-top:11px;
}
/**** widget 5 text ends **/
/**** widget 6 project topics **/
.project_topics {
padding: 22px 20px 22px 20px;
border: 1px solid #d5d6d7;
margin-top: 20px;
background: #fff;
font-size: 0.824em;
}
.project_topics li{
display:block;
padding-bottom:26px;
}
.project_topics ul li{
background-image:url(images/widget-li-bullet.png);
background-repeat:no-repeat;
background-position: 0px 3px;
padding-left: 23px;
}
/**** widget 6 project topics ends **/
/**** widget 7 widget gallery **/
.widget_gallery {
padding: 14px 0px 14px 14px;
border: 1px solid #d5d6d7;
margin-top:20px;
background:#fff;
font-size: 1.118em;
}
.gallery_widgets.sidebar img{
padding:4px;
margin-right: 19px;
margin-bottom: 19px;
border:1px solid #f0f0f0;
max-height:75px;
max-width:75px;
min-height:75px;
min-width:75px;
}
/**** widget 7 widget gallery ends **/
/********************************/
/**** sidebar ends ************/
/********************************/
/* Commentlist Style
========================================================*/
/*Comment Output*/
.comment_section ul, .comment_section ol {
padding-left: 0;
}
.commentlist .reply a {
position:absolute;
top: 40px;
right: 20px;
background:url(images/reply.png) no-repeat;
width:40px;
height:30px;
}
.commentlist .reply a {
font-size:0;
}
.commentlist .depth-1{margin-left:0; width: 100%;}
.commentlist .depth-2{margin-left:6%; width: 94%;}
.commentlist .depth-3{margin-left:6%; width: 94%;}
.commentlist .depth-4{margin-left:6%; width: 94%;}
.commentlist .depth-5{margin-left:6%; width: 94%;}
.commentlist .alt {}
.commentlist .odd {}
.commentlist .even {}
.commentlist .thread-alt {
width: 100%;
}
.commentlist .thread-odd {
width: 100%;
}
.commentlist .thread-even {
width:100%
}
.commentlist li ul.children .alt {}
.commentlist li ul.children .odd {}
.commentlist li ul.children .even {}
.commentlist .comment-body{
padding: 20px;
background: #ffffff;
border: solid 1px #e1e1e1;
margin-bottom: 42px;
position: relative;
-webkit-box-shadow: 0 0 5px 2px #f5f5f5;
-moz-box-shadow: 0 0 5px 2px #f5f5f5;
box-shadow: 0 0 5px 2px #f5f5f5;
border-radius:5px;
}
.commentlist .comment-body p{
line-height:24px;
padding:10px 0;
position:relative;
}
.commentlist .vcard {
position:relative;
display:inline;
}
.commentlist .vcard cite.fn {
font-style: normal;
padding-top:20px;
display: inline;
float: left;
padding-left:20px;
}
.commentlist .vcard span.says {
display:none;
}
.commentlist .vcard img.photo {}
.commentlist .vcard img.avatar {
border-radius:50%;
width:83px;
height:83px;
}
.commentlist .vcard cite.fn a.url {
color: #000000;
padding-left:0px;
padding-right:15px;
}
.comment-awaiting-moderation {
position: absolute;
left: 16.3%;
}
.commentlist br {
display: none;
}
.commentlist .comment-meta {
padding-top: 38px;
}
.commentlist .comment-meta a:nth-child(2){
padding-left:0px;
}
.commentlist .comment-meta a {
font-size: 90%;
padding-left:20px;
}
.commentlist .commentmetadata {
padding-bottom: 28px;
}
.commentlist .commentmetadata a {
padding-top:3px;
color:#7f7e7e;
}
.commentlist .parent {}
.commentlist .comment {}
.commentlist .children {}
.commentlist .pingback {}
.commentlist .bypostauthor {}
.commentlist .comment-author {}
.commentlist .comment-author .avatar {
display:inline;
float: left;
margin-bottom: 10px;
padding: 0px 7px 1px 0;
background-color: #f5f3f3;
padding: 0;
}
.commentlist .comment-author-admin {}
.commentlist {}
.commentlist li {}
.commentlist li p {}
.commentlist li ul {}
.commentlist li ul.children li {}
.commentlist li ul.children li.alt {}
.commentlist li ul.children li.byuser {}
.commentlist li ul.children li.comment {}
.commentlist li ul.children li.depth-id{}
.commentlist li ul.children li.bypostauthor {}
.commentlist li ul.children li.comment-author-admin {}
#cancel-comment-reply {}
#cancel-comment-reply a {}
#commentform p {
padding: 10px 0;
}
.comment-meta a, #commentform p a{
padding-left: 4px;
color: #989696;
transition: all .5s;
}
.comment-meta a:hover, #commentform p a:hover {
color: #22b0cf;
}
.comment-form-comment textarea {
margin-top:20px;
margin-bottom:20px;
float:left;
clear:both;
width:95%;
}
.comment-form-comment label{
float:left;
}
.comment-form label{
display: block;
}
#comment-form input {
width: 58%;
}
#comment-form .form-submit input {
width: 100%;
}
.submit input#submit {
width: auto;
padding: 13px 10px 13px 10px;
}
.form-allowed-tags {
float:left;
}
.form-submit {
float:left;
}
.form-submit input{
margin-top:20px;
margin-bottom:20px;
}
.comment-reply-title{}
.post-info{
padding:0 0 10px 0;
}
.logged-in-as {
padding:20px 0;
}
.logged-in-as a{
padding-left:5px;
text-decoration:none;
color:#E85805;
display:inline;
}
.nocomments {
margin-bottom:42px;
}
/* Commentlist Style Ends
========================================================*/
/* =Page style
-------------------------------------------------------------- */
.content-bar {
padding-top: 70px;
line-height: 30px;
}
.page-title {
margin-top: 0;
}
.content-bar ul li{
display: list-item;
padding-left: 3px;
margin-left: 5px;
list-style-type: disc;
}
.content-bar ol li{
display: list-item;
padding-left: 3px;
margin-left: 5px;
list-style-type: decimal;
}
.post input {
width: 92%;
}
.post .post-password-form input{
width: 26%;
}
.post-password-form
.post .searchform {
position:relative;
}
.post #s {
color: #FFF;
border-width: 0;
background: #08768e;
overflow:hidden;
border-radius:4px;
width: 93%;
box-shadow: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
}
.post #searchsubmit {
width: 35px;
height: 33px;
margin-left: -9px;
border-top-right-radius:4px;
border-bottom-right-radius:4px;
border-top-left-radius:0px;
border-bottom-left-radius:0px;
background: #20b9da url('images/search_icon.png') no-repeat center;
border: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
font-family: 'robotoregular', serif;
font-size: 1.176em;
font-weight: bold;
color: #fff;
transition: background-color 0.2s ease-in;
}
.post #searchsubmit input{
color:#fff;
}
.post .searchform {
padding: 0px;
border: none;
text-align: center;
}
.post #search {
width:41%;
padding-bottom: 9px;
padding-top: 8px;
padding-left: 10px;
padding-right:9px;
border: none;
background: #08768e;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
box-shadow: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
line-height: 16px;
color: #fff;
}
/* =WordPress Core
-------------------------------------------------------------- */
.alignnone {
margin: 5px 20px 20px 0;
width: 100%;
height: auto;
}
.aligncenter,
div.aligncenter {
display: block;
margin: 5px auto 5px auto;
}
.alignright {
float:right;
margin: 5px 0 20px 20px;
}
.alignleft {
float: left;
margin: 5px 20px 20px 0;
}
.aligncenter {
display: block;
margin: 5px auto 5px auto;
}
a img.alignright {
float: right;
margin: 5px 0 20px 20px;
}
a img.alignnone {
margin: 5px 20px 20px 0;
}
a img.alignleft {
float: left;
margin: 5px 20px 20px 0;
}
a img.aligncenter {
display: block;
margin-left: auto;
margin-right: auto;
}
.wp-caption {
background: #fff;
border: 1px solid #f0f0f0;
max-width: 96%; /* Image does not overflow the content area */
padding: 5px 3px 10px;
text-align: center;
}
.wp-caption.alignnone {
margin: 5px 20px 20px 0;
}
.wp-caption.alignleft {
margin: 5px 20px 20px 0;
}
.wp-caption.alignright {
margin: 5px 0 20px 20px;
}
.wp-caption img {
border: 0 none;
height: auto;
margin: 0;
max-width: 98.5%;
padding: 0;
width: 100%;
}
.wp-caption p.wp-caption-text {
font-size: 0.765em;
line-height: 17px;
margin: 0;
padding: 0 4px 5px;
}
.wp-caption p.wp-caption-text img {
width: auto;
}
/* media queries for different screen sizes
========================================================*/
/************************************************************************************
between 960px and 1140px
*************************************************************************************/
@media only screen and (min-width: 960px) and (max-width: 1140px) {
.blog_featured_img {
height: 170px;
}
.featured_blog_content .post{
width:343px;
}
.gallery_tabs {
width:57%;
}
/* contact */
.contact_input p{
margin-bottom:36px;
margin-left:0px;
}
.contact_input textarea, input{
width:394px;
}
.contact_input textarea{
width:394px;
height:208px;
}
#recaptcha_widget_div {
margin-left:0px;
}
.add_n_map {
margin-left:0px;
}
/* gallery */
#lab article {
padding-top: 3.813em;
width: 86%;
}
/* services box */
#services_box_container1 {
margin-left:20%;
}
#services_box_container4, #services_box_container3 {
margin-top:5%;
}
#services_box_container3{
margin-left:20%;
}
/* services box ends */
/* Footer column */
input[type="submit"].search-button {
left: 152px;
}
input.search-text {
width:170px;
}
.footer #search{
width: 73%;
}
/* Footer column ends */
/* ************************************ */
/* *********sidebar widgets************ */
/* ************************************ */
/* sidebar widgets search box */
.sidebar #search {
width: 78%;
}
/* sidebar widgets search box */
/* sidebar widgets blog post */
.popular_tab a {
padding: 8px 8px 6px 8px;
}
.popular_tab.recent {
left: 76px;
}
.popular_tab.comments {
left: 145px;
}
.popular_tab_content {
width: 69%;
}
.sidebar_blog_posts {
width: 88%;
}
.popular_tab p {
font-size: 0.824em;
}
.popular_tab {
top: -29px;
}
.popular_content {
margin-top: 28px;
}
/* sidebar widgets blog post ends */
/* sidebar widgets calendar */
#wp-calendar tbody td {
padding: 8px;
}
.calender_wrapper {
padding: 0px 19px 20px 19px;
}
/* sidebar widgets calendar ends */
/* sidebar widgets gallery widget */
.gallery_widgets.sidebar img {
padding: 2px;
margin-right: -5px;
margin-bottom: -5px;
}
/* sidebar widgets gallery widget ends */
/* sidebar widgets calendar ends */
.footer #wp-calendar tbody td {
padding: 3px;
}
/* sidebar widgets calendar ends */
/* comments */
.comment-awaiting-moderation {
position: absolute;
top: 29%;
left: 19.7%;
}
/* comments ends*/
/* hex gallery 4 column */
.post_content #lab article {
padding-top: 3.813em;
width: 104%;
}
.post_content .lab_item {
width: 161px;
height: 193px;
}
.post_content .hexagon2 {
width: 151px;
height: 215px;
top: -80px;
}
.post_content .lab_item:nth-child(7n-2) {
margin-left: 81px;
}
/* hex gallery 4column*/
/* recent blogs */
.featured_blog_content .post:nth-child(3n) {
float: none;
}
.featured_blog_content .post:nth-child(2n-1) {
margin-left: 11%;
margin-right: 53px;
}
.featured_blog_content .post:nth-child(3n){
float:none;
}
/* recent blogs ends */
}
/************************************************************************************
between 767px and 960px
*************************************************************************************/
@media only screen and (min-width: 767px) and (max-width: 960px) {
#slider_floating_text {
left: 12.7%;
}
/* blog */
.featured_blog_content .post:nth-child(2){
margin-left:60px;
}
.featured_blog_content .post:nth-child(5) {
float:left;
}
.featured_blog_content .post:nth-child(6) {
margin-left: 62px;
float:left;
}
.featured_blog_content .post {
margin-right: 0px;
}
.featured_blog_content .post:nth-child(3) {
float: none;
margin-right: 60px;
}
/* main nav */
.sf-menu {
text-align: center;
}
li.depth-4 ul.children {
padding-left: 0;
}
#menu li {
float: none !important;
}
#MainNav {
text-align: center;
margin-left: 0px;
}
.mobile_nav > span {
position: absolute;
top: 19px;
left: 45px;
}
#logo img {
max-height: 32px;
}
#logo {
padding-top: 14px;
height: 30px;
}
#slider_floating_text {
top: 39%;
}
/* services box */
#services_box_container1, #services_box_container3 {
margin-left:14%;
}
#services_box_container4, #services_box_container3 {
margin-top:5%;
}
/* services box ends */
/* gallery */
.gallery_tabs {
width:100%;
}
.lab_item:nth-child(5n-1) {
margin-left: 102px;
}
.lab_item:nth-child(n+4) {
margin-top: -62px;
}
.lab_item:nth-child(7n-2) {
margin-left: 0px;
}
.lab_item:nth-child(n+5) {
margin-top: -56px;
}
#lab article {
width: 610px;
}
/* gallery */
/* contact */
.contact_input p {
margin-bottom: 36px;
margin-left: 0px;
}
.contact_input input{
width: 320px;
}
.contact_input textarea {
width: 320px;
height: 160px;
}
/* contact */
/* comments */
.comment-awaiting-moderation {
position: absolute;
top: 29%;
left: 24.5%;
}
/* comments ends*/
/* Footer column */
input[type="submit"].search-button {
left: 106px;
}
input.search-text {
width:123px;
}
.footer #search {
width: 65%;
}
/* footer calender */
.footer #wp-calendar tbody td {
padding: 0px;
}
#calendar_wrap {
padding: 10px;
}
.footer li {
font-size: 0.941em;
}
/* footer calender */
/* Footer column ends */
/* ************************************ */
/* *********sidebar widgets************ */
/* ************************************ */
/* sidebar widgets blog post */
.popular_tab a {
padding: 4px 4px 2px 4px;
}
.popular_tab.recent {
left: 59px;
}
.popular_tab.comments {
left: 112px;
}
.sidebar_blog_posts {
padding: 9px;
}
.popular_tab p {
font-size: 0.706em;
}
.popular_tab {
top: -19px;
}
.popular_content {
margin-top: 28px;
}
.popular_tab_content {
width: 58%;
height: 53px;
}
.popular_tab_content_header_para {
display:none;
}
/* sidebar widgets blog posts ends */
/* sidebar widgets search box */
.sidebar #searchsubmit {
left: 73%;
}
.sidebar #search {
width: 69%;
}
/* sidebar widgets search box */
/* sidebar widgets calendar */
#wp-calendar tbody td {
padding: 4px;
}
.calender_wrapper {
padding: 0px 13px 20px 14px;
}
/* sidebar widgets calendar ends */
/* sidebar widgets gallery widget */
.gallery_widgets.sidebar img {
padding: 3px;
margin-right: 7px;
margin-bottom: 9px;
}
/* sidebar widgets gallery widget ends */
}
/************************************************************************************
between 480px and 767px
*************************************************************************************/
@media only screen and (min-width: 480px) and (max-width: 767px) {
/* embedded videos */
.video embed,
.video object,
.video iframe {
min-height: 250px;
}
/* header */
.header_wrapper {
box-shadow: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
}
.header_wrapper.scroller{
position: static !important;
}
/* logo */
#logo {
text-align: center;
}
/* logo */
textarea {
width: 100%;
}
/* menu */
.call-us a.btn{
background: url(images/tap-to-call.png) no-repeat;
display: inline-block;
visibility: visible;
font-size: 0;
width: 210px;
height: 59px;
margin: 0 auto;
text-align: center;
cursor: pointer;
text-indent: 99999px;
margin-left: 156px;
margin-top: 15px;
}
#mobile_menu {
width: 276px;
text-align: center;
margin-left: 0;
}
#mobile_menu {
width: 318px;
text-align: center;
margin-left: 0;
}
ul.sf-menu {
display: none;
}
.it_mobile_menu a {
display: block;
padding-left: 0px;
color: #3B3B3B;
padding-top: 7px;
padding-bottom: 7px;
}
.header .logo {
text-align: center;
margin: 20px 0 0px 0px;
}
#logo img {
max-height: 33px;
}
#logo {
padding-top: 20px;
height: 30px;
}
.sf-menu .sub-menu {
margin-left: 100px !important;
visibility: hidden;
}
.sf-menu .sub-menu li {
margin: 0 !important;
padding: 0 !important;
margin-left: 200px !important;
clear: both;
left: 20px;
}
.mobile_nav {
display: inline-block;
text-shadow: 1px 1px 0 #fff;
margin: 13px 0 20px 0;
width: 227px;
}
.sf-menu {
text-align: center;
}
li.depth-4 ul.children {
padding-left: 0;
}
#menu li {
float: none !important;
}
#MainNav {
text-align: center;
height: 58px;
}
.mobile_nav > span {
position: absolute;
top: 10px;
left: 45px;
}
/* slider */
.slider_text_container {
display: none;
}
/* blogs */
.featured_blog_content .post {
width: 100%;
}
.featured_blog_content .post_heading_wrapper .thumb img {
height: 340px;
width: 480px;
}
.featured_blog_content .post_heading_wrapper .thumb img:hover {
height: 340px;
width: 480px;
}
/*******************/
.blog_featured_img {
width:442px;
height:242px;
}
.featured_blog_container_last {
margin-left: 0px;
}
.featured_blog_container_second {
margin-left: 0px;
}
.blog_featured_img img{
width:100%;
height:auto;
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
}
.blog_featured_img img:hover {
width:125%;
height:auto;
}
/* blog ends */
/* services box */
#services_box_container1, #services_box_container2, #services_box_container4, #services_box_container3 {
margin-left:22%;
}
#services_box_container2 , #services_box_container4, #services_box_container3 {
margin-top:10%;
}
/* services box ends */
/* gallery */
.gallery_tabs {
width:100%;
}
.gallery_tabs a{
margin-top: 5px;
margin-left:5px;
}
#lab article {
width: 405px;
}
.lab_item:nth-child(5n-1) {
margin-left: 0px;
}
.lab_item:nth-child(3n) {
margin-left: 102px;
}
.lab_item:nth-child(n+3) {
margin-top: -56px;
}
/* gallery */
/* contact */
.contact_input p {
margin-bottom: 36px;
margin-left: 0px;
}
.contact_input input{
width: 320px;
}
.contact_input textarea {
width: 320px;
height: 160px;
}
.add_n_map {
margin-left: 0px;
padding-bottom:20px;
}
.map {
max-width: 98%;
}
/* contact ends */
/* footer 4 column */
.footer_columns {
margin-bottom:32px;
margin-right: 0px;
margin-left: 0px;
}
.footer {
padding-bottom: 18px;
}
.footer .last {
margin-left:0px;
}
.footer_columns.third {
margin-right: 0px;
margin-left: 0px;
}
/* footer 4 column ends */
/* footer search */
.footer #searchsubmit {
left: 89.7%;
}
/* footer search widget ends */
/* copyright */
.copyright_wrapper{
text-align: center;
}
.footer_social_icons {
float: none;
}
/* comments */
.comment-awaiting-moderation {
position: absolute;
top: 29%;
left: 26%;
}
.commentlist .depth-1{margin-left:0; width: 100%;}
.commentlist .depth-2{margin-left:0; width: 100%;}
.commentlist .depth-3{margin-left:0; width: 100%;}
.commentlist .depth-4{margin-left:0; width: 100%;}
.commentlist .depth-5{margin-left:0; width: 100%; float: right;}
/* comments */
/* ************************************ */
/* *********sidebar widgets************ */
/* ************************************ */
.sidebar_container {
margin-left: 0%;
}
/* sidebar widgets search box */
.sidebar #search {
width: 88%;
}
/* sidebar widgets search box */
/* sidebar widgets blog post */
.sidebar_blog_posts {
width: 92%;
padding: 18px;
}
/* sidebar widgets blog post ends */
/* sidebar widgets calendar */
#wp-calendar tbody td {
padding: 22px;
}
.calender_wrapper {
padding: 0px 20px 20px 20px;
}
/* sidebar widgets calendar ends */
.widget_gallery {
padding: 17px 0px 0px 29px;
}
.sidebar {
margin-top: 0px;
margin-left: 0px;
}
/* sidebar widgets gallery widget ends */
#commentform small {
display:block;
padding-top: 5px;
}
}
/************************************************************************************
smaller than 480px
*************************************************************************************/
@media only screen and (max-width: 480px) {
/* disable webkit text size adjust (for iPhone) */
html {
-webkit-text-size-adjust: none;
}
textarea {
width: 96%;
}
.homepage_top_feature {
margin-top: 106px;
}
#comment-form input {
width: 96%;
}
#commentform small {
display:block;
padding-top: 5px;
}
/* logo */
#logo {
text-align: center;
}
#logo img {
max-height: 28px;
}
#logo {
padding-top: 20px;
height: 30px;
}
/* logo */
/* menu */
.header_wrapper {
box-shadow: none !important;
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
}
.header_wrapper.scroller{
position: static !important;
}
.call-us a.btn{
background:url(images/tap-to-call.png) no-repeat;
display:inline-block;
visibility:visible;
font-size:0px;
width:210px;
height:59px;
margin:0 auto;
text-align:center;
cursor:pointer;
text-indent:99999px;
margin-left:60px;
margin-top:15px;
}
#mobile_menu {
width: 276px;
text-align:center;
margin-left:0;
}
#mobile_menu {
width: 100%;
text-align: center;
margin-left: 0;
}
ul.sf-menu {
display: none;
}
.it_mobile_menu a {
display: block;
padding-left: 0px;
color: #3B3B3B;
padding-top: 7px;
padding-bottom: 7px;
}
.sf-menu .sub-menu {
margin-left: 100px !important;
visibility: hidden;
}
.sf-menu .sub-menu li {
margin: 0 !important;
padding: 0 !important;
margin-left: 200px !important;
clear: both;
left: 20px;
}
.mobile_nav {
display: inline-block;
text-shadow: 1px 1px 0 #fff;
margin: 5px 0 20px 0;
margin-top: 0;
margin-bottom:0;
width: 63%;
}
.mobile_nav > span {
position: absolute;
top: 11px;
left: 30px;
}
.sf-menu {
text-align: center;
}
li.depth-4 ul.children {
padding-left: 0;
}
#menu li {
float: none !important;
}
#MainNav {
text-align: center;
height: 50px;
margin-top: 8px;
}
/* slider */
/* blogs */
.featured_blog_content .post{
width: 100%;
}
.featured_blog_content .post:nth-child(3n) {
float: none;
}
.featured_blog_floating_img {
font-size: 1.118em;
padding: 6px;
}
.blog_featured_img {
width:300px;
height:162px;
}
.blog_featured_img img{
width:100%;
height:auto;
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
}
.blog_featured_img img:hover{
width:100%;
height:auto;
}
.featured_blog_container_last {
margin-left: auto;
margin-right:auto;
}
.featured_blog_container_second {
margin-left: auto;
margin-right:auto;
}
.featured_blog_content .post_heading_wrapper img:hover {
height: 100%;
width: 100%;
}
.featured_blog_content .post_heading_wrapper img {
height: 100%;
width: 100%;
}
/* blog ends */
#social_icons {
float:left;
}
.social_wrapper {
height:auto;
}
/*slider */
.slider_text_container{
display: none;
}
/* slider ends */
/* services box */
#services_box_container1, #services_box_container2 , #services_box_container4, #services_box_container3 {
margin-left:0;
}
#services_box_container2 , #services_box_container4, #services_box_container3 {
margin-top:10%;
}
.services_box_container {
margin-left: auto;
width: 265px;
margin-right: auto;
}
/* services box ends */
/* gallery */
.container {
width:95%;
}
.gallery_tabs {
font-size: 0.882em;
width:100%;
}
.gallery_tabs ul, li, a {
display: block;
}
.gallery_tabs a{
margin-top: 5px;
padding: 10px 10px 10px 8px;
margin-left: 0px;
}
#lab {
margin-bottom: 0;
}
#lab article {
width: 336px;
}
.lab_item {
width: 160px;
height: 199px;
}
.hexagon2 {
width: 171px;
height: 351px;
top: -68px;
}
.lab_item:nth-child(n+3) {
margin-top: -67px;
}
.lab_item:nth-child(3n) {
margin-left: 82px;
}
ul#filters{
margin:0;
padding: 0px;
}
ul#filters li{
display: block;
width: 100%
}
ul#filters li a{
width: 95%
}
/* gallery */
/* copyright */
/* contact */
.contact_input textarea, input {
width: 91%;
}
.contact_input p {
margin-bottom: 36px;
margin-left: 0px;
}
.contact_input input{
width: 91%;
}
.contact_input textarea {
width: 91%;
height: 160px;
}
.add_n_map {
margin-left: 0px;
padding-bottom:20px;
}
/* contact ends */
/* footer 4 column */
div.footer_columns {
margin-bottom:0px;
margin-right: 0px;
margin-left: 0px;
}
.footer {
padding-bottom: 18px;
}
/* footer search */
.footer #searchsubmit {
left: 87.3%;
}
/* footer search widget ends */
.footer ul, li, a {
display: inline-block;
}
.footer_columns.last {
margin-left: 0px;
}
.footer_columns.second {
margin-right: 0px;
margin-left: 0px;
}
.footer_columns.third {
margin-right: 0px;
margin-left: 0px;
}
/* footer 4 column ends */
/* comment */
.commentlist .depth-1{margin-left:0; width: 100%;}
.commentlist .depth-2{margin-left:0; width: 100%;}
.commentlist .depth-3{margin-left:0; width: 100%;}
.commentlist .depth-4{margin-left:0; width: 100%;}
.commentlist .depth-5{margin-left:0; width: 100%; float: right;}
/**** post ****/
.post_meta li {
display:inline-block;
}
/**** post ****/
/* ************************************ */
/* *********sidebar widgets************ */
/* ************************************ */
.sidebar_container {
padding-top: 25px;
margin-left: 0px;
}
.sidebar a {
display: inline-block;
}
/* sidebar widgets search box */
.sidebar_widget input[type="submit"].search-button {
left: 83%;
}
.search-border {
width:82%;
}
.sidebar_widget input.search-text {
width: 91%;
}
/* sidebar widgets blog post */
.popular_tab a {
padding: 8px 8px 6px 8px;
}
.popular_tab.recent {
left: 76px;
}
.popular_tab.comments {
left: 145px;
}
.popular_tab_content {
width: 69%;
}
.sidebar_blog_posts {
width: 88%;
}
.popular_tab p {
font-size: 0.824em;
}
.popular_tab {
top: -29px;
}
.popular_content {
margin-top: 28px;
}
/* sidebar widgets blog post ends */
/* sidebar widgets calendar */
#wp-calendar tbody td {
padding: 9px;
}
.calender_wrapper {
padding: 0px 13px 20px 16px;
}
/* sidebar widgets calendar ends */
/* sidebar gallery widget */
.gallery_widgets.sidebar img {
padding: 4px;
margin-right: -5px;
margin-bottom: -5px;
}
/* sidebar widgets search box */
.sidebar #searchsubmit {
left: 78%;
}
.sidebar {
margin-top: 0px;
margin-left: 0px;
}
.sidebar #search {
width: 77%;
}
/* sidebar widgets search box */
/* sidebar gallery widget ends */
/* comments */
.commentlist .reply {
top: 6px;
right: 6px;
}
.commentlist .comment-meta a {
padding-left: 8px;
}
.comment-awaiting-moderation {
position: absolute;
top: -7%;
left: 19px;
text-align: center;
}
/* comments */
}
/************************************************************************************
smaller than 320px
*************************************************************************************/
@media only screen and (max-width: 320px) {
/* disable webkit text size adjust (for iPhone) */
html {
-webkit-text-size-adjust: none;
}
/* social header */
/* social header */
/* logo */
#logo {
text-align: center;
}
.social_icons {
margin-top: 5px;
margin-bottom: 10px;
float: left;
text-align: center;
}
.social_icons ul{
padding: 0 0 0 0;
}
/* logo */
.mobile_nav {
width: 54%;
}
/* blogs */
.featured_blog_container_last {
margin-left: auto;
margin-right:auto;
}
.featured_blog_container_second {
margin-left: auto;
margin-right:auto;
}
/* blogs */
#slider_floating_text {
display:none;
}
.featured_blog_content .post_heading_wrapper .thumb {
height: 143px;
}
/* copyright block */
.footer_social_icons {
float:none;
width:100%;
}
.footer_social_icons div {
display:inline-block;
margin-left: 1px;
}
/* copyright block ends */
/* services box */
#services_box_container1, #services_box_container2 , #services_box_container4, #services_box_container3 {
margin-left:0;
}
.services_box_container {
width: 224px;
}
/* gallery */
#lab article {
width: 233px;
}
.lab_item:nth-child(3n) {
margin-left: 0px;
}
.lab_item:nth-child(2n) {
margin-left: 102px;
}
.lab_item:nth-child(n+2) {
margin-top: -56px;
}
/* gallery ends */
/* contact */
.contact_input textarea, input {
width: 91%;
}
.contact_input p {
margin-bottom: 36px;
margin-left: 0px;
}
.contact_input input{
width: 91%;
}
.contact_input textarea {
width: 91%;
height: 160px;
}
.add_n_map {
margin-left: 0px;
padding-bottom:20px;
}
/* contact ends */
/* footer 4 column */
.footer_columns {
margin-bottom:32px;
margin-right: 0px;
margin-left: 0px;
}
.footer_columns.first {
margin-right: 0px;
margin-left: 0px;
}
.footer {
padding-bottom: 18px;
}
.footer #search {
width: 64%;
}
.footer_columns.third {
margin-right: 0px;
margin-left: 0px;
}
/* footer 4 column ends */
/* comment */
.commentlist .reply a {
top: 3px;
right: 3px;
}
/* circle hover */
.ch-item {
width: 100%;
height: 100%;
left: -1px;
}
.ch-img-1 {
background-size:220px 220px;
height: 220px;
}
.ch-img-1 img{
width: 220px;
height: 220px;
}
.ch-img-2 {
background-size:220px 220px;
height: 220px;
}
.ch-img-2 img{
width: 220px;
height: 220px;
}
.ch-img-3 {
background-size:220px 220px;
height: 220px;
}
.ch-img-3 img{
width: 220px;
height: 220px;
}
.ch-img-4 {
background-size:220px 220px;
border-radius:50%;
height: 220px;
}
.ch-img-4 img{
border-radius: 50%;
width: 220px;
height: 220px;
}
.rect_box {
width: 224px;
}
p.services_box_rect_head {
width: 182px;
}
/* 404 page */
p.fourzerofourerror{
line-height: 41px;
}
} | hussy786/The-Cake-King | wp-content/themes/one-page/style.css | CSS | gpl-2.0 | 86,989 | [
30522,
1013,
1008,
4323,
2171,
1024,
2028,
3931,
4323,
24471,
2072,
1024,
8299,
1024,
1013,
1013,
7479,
1012,
10710,
10760,
7834,
1012,
4012,
1013,
2028,
1011,
3931,
1011,
2773,
20110,
1011,
8917,
1013,
6412,
1024,
2028,
3931,
2003,
1037,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
declare(strict_types=1);
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @link http://phpdoc.org
*/
namespace phpDocumentor\Descriptor;
use Mockery\Adapter\Phpunit\MockeryTestCase;
use stdClass;
/**
* Tests the functionality for the Collection class.
*
* @coversDefaultClass \phpDocumentor\Descriptor\Collection
*/
final class CollectionTest extends MockeryTestCase
{
/** @var Collection $fixture */
private $fixture;
/**
* Creates a new (empty) fixture object.
*/
protected function setUp() : void
{
$this->fixture = new Collection();
}
/**
* @covers ::__construct
*/
public function testInitialize() : void
{
$fixture = new Collection();
$this->assertEmpty($fixture->getAll());
}
/**
* @covers ::__construct
*/
public function testInitializeWithExistingArray() : void
{
$expected = [1, 2];
$fixture = new Collection($expected);
$this->assertEquals($expected, $fixture->getAll());
}
/**
* @covers ::add
*/
public function testAddNewItem() : void
{
$expected = ['abc'];
$expectedSecondRun = ['abc', 'def'];
$this->fixture->add('abc');
$this->assertEquals($expected, $this->fixture->getAll());
$this->fixture->add('def');
$this->assertEquals($expectedSecondRun, $this->fixture->getAll());
}
/**
* @covers ::set
* @covers ::offsetSet
*/
public function testSetItemsWithKey() : void
{
$expected = ['z' => 'abc'];
$expectedSecondRun = ['z' => 'abc', 'y' => 'def'];
$this->assertEquals([], $this->fixture->getAll());
$this->fixture->set('z', 'abc');
$this->assertEquals($expected, $this->fixture->getAll());
$this->fixture->set('y', 'def');
$this->assertEquals($expectedSecondRun, $this->fixture->getAll());
}
/**
* @covers ::set
*/
public function testSetItemsWithEmptyKeyShouldThrowException() : void
{
$this->expectException('InvalidArgumentException');
$this->fixture->set('', 'abc');
}
/**
* @covers ::offsetSet
*/
public function testSetItemsUsingOffsetSetWithEmptyKeyShouldThrowException() : void
{
$this->expectException('InvalidArgumentException');
$this->fixture->offsetSet('', 'abc');
}
/**
* @covers ::get
* @covers ::__get
* @covers ::offsetGet
*/
public function testRetrievalOfItems() : void
{
$this->fixture['a'] = 'abc';
$this->assertEquals('abc', $this->fixture->__get('a'));
$this->assertEquals('abc', $this->fixture['a']);
$this->assertEquals('abc', $this->fixture->get('a'));
$this->assertCount(1, $this->fixture);
$this->assertEquals('def', $this->fixture->fetch(1, 'def'));
$this->assertCount(2, $this->fixture);
}
/**
* @covers ::getAll
*/
public function testRetrieveAllItems() : void
{
$this->fixture['a'] = 'abc';
$this->assertSame(['a' => 'abc'], $this->fixture->getAll());
}
/**
* @covers ::getIterator
*/
public function testGetIterator() : void
{
$this->fixture['a'] = 'abc';
$this->assertInstanceOf('ArrayIterator', $this->fixture->getIterator());
$this->assertSame(['a' => 'abc'], $this->fixture->getIterator()->getArrayCopy());
}
/**
* @covers ::count
* @covers ::offsetUnset
*/
public function testCountReturnsTheNumberOfElements() : void
{
$this->assertCount(0, $this->fixture);
$this->assertEquals(0, $this->fixture->count());
$this->fixture[0] = 'abc';
$this->assertCount(1, $this->fixture);
$this->assertEquals(1, $this->fixture->count());
$this->fixture[1] = 'def';
$this->assertCount(2, $this->fixture);
$this->assertEquals(2, $this->fixture->count());
unset($this->fixture[0]);
$this->assertCount(1, $this->fixture);
$this->assertEquals(1, $this->fixture->count());
}
/**
* @covers ::clear
*/
public function testClearingTheCollection() : void
{
$this->fixture[1] = 'a';
$this->fixture[2] = 'b';
$this->assertCount(2, $this->fixture);
$this->fixture->clear();
$this->assertCount(0, $this->fixture);
}
/**
* @covers ::offsetExists
*/
public function testIfExistingElementsAreDetected() : void
{
$this->assertArrayNotHasKey(0, $this->fixture);
$this->assertFalse($this->fixture->offsetExists(0));
$this->fixture[0] = 'abc';
$this->assertArrayHasKey(0, $this->fixture);
$this->assertTrue($this->fixture->offsetExists(0));
}
/**
* @covers ::merge
*/
public function testIfAfterMergeCollectionContainsAllItems() : void
{
$expected = [0 => 'a', 1 => 'b', 2 => 'c'];
$this->fixture[1] = 'a';
$this->fixture[2] = 'b';
$collection2 = new Collection();
$collection2[4] = 'c';
$result = $this->fixture->merge($collection2);
$this->assertSame($expected, $result->getAll());
}
/**
* @covers ::filter
*/
public function testFilterReturnsOnlyInstancesOfCertainType() : void
{
$expected = [0 => new stdClass()];
$this->fixture[0] = new stdClass();
$this->fixture[1] = false;
$this->fixture[2] = 'string';
$result = $this->fixture->filter(stdClass::class)->getAll();
$this->assertEquals($expected, $result);
}
}
| rgeraads/phpDocumentor2 | tests/unit/phpDocumentor/Descriptor/CollectionTest.php | PHP | mit | 5,793 | [
30522,
1026,
1029,
25718,
13520,
1006,
9384,
1035,
4127,
1027,
1015,
1007,
1025,
1013,
1008,
1008,
1008,
2023,
5371,
2003,
2112,
1997,
25718,
3527,
24894,
4765,
2953,
1012,
1008,
1008,
2005,
1996,
2440,
9385,
1998,
6105,
2592,
1010,
3531,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.lothrazar.cyclic.block.crusher;
import com.lothrazar.cyclic.gui.ButtonMachineField;
import com.lothrazar.cyclic.gui.EnergyBar;
import com.lothrazar.cyclic.gui.ScreenBase;
import com.lothrazar.cyclic.gui.TexturedProgress;
import com.lothrazar.cyclic.registry.TextureRegistry;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.player.Inventory;
public class ScreenCrusher extends ScreenBase<ContainerCrusher> {
private ButtonMachineField btnRedstone;
private EnergyBar energy;
private TexturedProgress progress;
public ScreenCrusher(ContainerCrusher screenContainer, Inventory inv, Component titleIn) {
super(screenContainer, inv, titleIn);
this.energy = new EnergyBar(this, TileCrusher.MAX);
this.progress = new TexturedProgress(this, 78, 40, TextureRegistry.SAW);
}
@Override
public void init() {
super.init();
progress.guiLeft = energy.guiLeft = leftPos;
progress.guiTop = energy.guiTop = topPos;
int x, y;
x = leftPos + 6;
y = topPos + 6;
btnRedstone = addRenderableWidget(new ButtonMachineField(x, y, TileCrusher.Fields.REDSTONE.ordinal(), menu.tile.getBlockPos()));
}
@Override
public void render(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
this.renderBackground(ms);
super.render(ms, mouseX, mouseY, partialTicks);
this.renderTooltip(ms, mouseX, mouseY);
energy.renderHoveredToolTip(ms, mouseX, mouseY, menu.tile.getEnergy());
btnRedstone.onValueUpdate(menu.tile);
}
@Override
protected void renderLabels(PoseStack ms, int mouseX, int mouseY) {
this.drawButtonTooltips(ms, mouseX, mouseY);
this.drawName(ms, this.title.getString());
}
@Override
protected void renderBg(PoseStack ms, float partialTicks, int mouseX, int mouseY) {
this.drawBackground(ms, TextureRegistry.INVENTORY);
this.drawSlot(ms, 52, 34);
this.drawSlotLarge(ms, 104, 20);
this.drawSlot(ms, 108, 54);
energy.draw(ms, menu.tile.getEnergy());
final int max = menu.tile.getField(TileCrusher.Fields.TIMERMAX.ordinal());
progress.max = max;
progress.draw(ms, max - menu.tile.getField(TileCrusher.Fields.TIMER.ordinal()));
}
}
| PrinceOfAmber/CyclicMagic | src/main/java/com/lothrazar/cyclic/block/crusher/ScreenCrusher.java | Java | mit | 2,237 | [
30522,
7427,
4012,
1012,
2843,
13492,
9057,
1012,
23750,
1012,
3796,
1012,
10188,
2121,
1025,
12324,
4012,
1012,
2843,
13492,
9057,
1012,
23750,
1012,
26458,
1012,
6462,
22911,
14014,
3790,
1025,
12324,
4012,
1012,
2843,
13492,
9057,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/highgui/highgui_c.h"
#include <stdio.h>
static void help(void)
{
printf("\nThis program creates an image to demonstrate the use of the \"c\" contour\n"
"functions: cvFindContours() and cvApproxPoly() along with the storage\n"
"functions cvCreateMemStorage() and cvDrawContours().\n"
"It also shows the use of a trackbar to control contour retrieval.\n"
"\n"
"Usage :\n"
"./contours\n");
}
#define w 500
int levels = 3;
CvSeq* contours = 0;
static void on_trackbar(int pos)
{
IplImage* cnt_img = cvCreateImage( cvSize(w,w), 8, 3 );
CvSeq* _contours = contours;
int _levels = levels - 3;
(void)pos;
if( _levels <= 0 ) // get to the nearest face to make it look more funny
_contours = _contours->h_next->h_next->h_next;
cvZero( cnt_img );
cvDrawContours( cnt_img, _contours, CV_RGB(255,0,0), CV_RGB(0,255,0), _levels, 3, CV_AA, cvPoint(0,0) );
cvShowImage( "contours", cnt_img );
cvReleaseImage( &cnt_img );
}
static void findCComp( IplImage* img )
{
int x, y, cidx = 1;
IplImage* mask = cvCreateImage( cvSize(img->width+2, img->height+2), 8, 1 );
cvZero(mask);
cvRectangle( mask, cvPoint(0, 0), cvPoint(mask->width-1, mask->height-1),
cvScalarAll(1), 1, 8, 0 );
for( y = 0; y < img->height; y++ )
for( x = 0; x < img->width; x++ )
{
if( CV_IMAGE_ELEM(mask, uchar, y+1, x+1) != 0 )
continue;
cvFloodFill(img, cvPoint(x,y), cvScalarAll(cidx),
cvScalarAll(0), cvScalarAll(0), 0, 4, mask);
cidx++;
}
}
int main(int argc, char* argv[])
{
int i, j;
CvMemStorage* storage = cvCreateMemStorage(0);
IplImage* img = cvCreateImage( cvSize(w,w), 8, 1 );
IplImage* img32f = cvCreateImage( cvSize(w,w), IPL_DEPTH_32F, 1 );
IplImage* img32s = cvCreateImage( cvSize(w,w), IPL_DEPTH_32S, 1 );
IplImage* img3 = cvCreateImage( cvSize(w,w), 8, 3 );
(void)argc; (void)argv;
help();
cvZero( img );
for( i=0; i < 6; i++ )
{
int dx = (i%2)*250 - 30;
int dy = (i/2)*150;
CvScalar white = cvRealScalar(255);
CvScalar black = cvRealScalar(0);
if( i == 0 )
{
for( j = 0; j <= 10; j++ )
{
double angle = (j+5)*CV_PI/21;
cvLine(img, cvPoint(cvRound(dx+100+j*10-80*cos(angle)),
cvRound(dy+100-90*sin(angle))),
cvPoint(cvRound(dx+100+j*10-30*cos(angle)),
cvRound(dy+100-30*sin(angle))), white, 3, 8, 0);
}
}
cvEllipse( img, cvPoint(dx+150, dy+100), cvSize(100,70), 0, 0, 360, white, -1, 8, 0 );
cvEllipse( img, cvPoint(dx+115, dy+70), cvSize(30,20), 0, 0, 360, black, -1, 8, 0 );
cvEllipse( img, cvPoint(dx+185, dy+70), cvSize(30,20), 0, 0, 360, black, -1, 8, 0 );
cvEllipse( img, cvPoint(dx+115, dy+70), cvSize(15,15), 0, 0, 360, white, -1, 8, 0 );
cvEllipse( img, cvPoint(dx+185, dy+70), cvSize(15,15), 0, 0, 360, white, -1, 8, 0 );
cvEllipse( img, cvPoint(dx+115, dy+70), cvSize(5,5), 0, 0, 360, black, -1, 8, 0 );
cvEllipse( img, cvPoint(dx+185, dy+70), cvSize(5,5), 0, 0, 360, black, -1, 8, 0 );
cvEllipse( img, cvPoint(dx+150, dy+100), cvSize(10,5), 0, 0, 360, black, -1, 8, 0 );
cvEllipse( img, cvPoint(dx+150, dy+150), cvSize(40,10), 0, 0, 360, black, -1, 8, 0 );
cvEllipse( img, cvPoint(dx+27, dy+100), cvSize(20,35), 0, 0, 360, white, -1, 8, 0 );
cvEllipse( img, cvPoint(dx+273, dy+100), cvSize(20,35), 0, 0, 360, white, -1, 8, 0 );
}
cvNamedWindow( "image", 1 );
cvShowImage( "image", img );
cvConvert( img, img32f );
findCComp( img32f );
cvConvert( img32f, img32s );
cvFindContours( img32s, storage, &contours, sizeof(CvContour),
CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE, cvPoint(0,0) );
//cvFindContours( img, storage, &contours, sizeof(CvContour),
// CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, cvPoint(0,0) );
{
const char* attrs[] = {"recursive", "1", 0};
cvSave("contours.xml", contours, 0, 0, cvAttrList(attrs, 0));
contours = (CvSeq*)cvLoad("contours.xml", storage, 0, 0);
}
// comment this out if you do not want approximation
contours = cvApproxPoly( contours, sizeof(CvContour), storage, CV_POLY_APPROX_DP, 3, 1 );
cvNamedWindow( "contours", 1 );
cvCreateTrackbar( "levels+3", "contours", &levels, 7, on_trackbar );
{
CvRNG rng = cvRNG(-1);
CvSeq* tcontours = contours;
cvCvtColor( img, img3, CV_GRAY2BGR );
while( tcontours->h_next )
tcontours = tcontours->h_next;
for( ; tcontours != 0; tcontours = tcontours->h_prev )
{
CvScalar color;
color.val[0] = cvRandInt(&rng) % 256;
color.val[1] = cvRandInt(&rng) % 256;
color.val[2] = cvRandInt(&rng) % 256;
color.val[3] = cvRandInt(&rng) % 256;
cvDrawContours(img3, tcontours, color, color, 0, -1, 8, cvPoint(0,0));
if( tcontours->v_next )
{
color.val[0] = cvRandInt(&rng) % 256;
color.val[1] = cvRandInt(&rng) % 256;
color.val[2] = cvRandInt(&rng) % 256;
color.val[3] = cvRandInt(&rng) % 256;
cvDrawContours(img3, tcontours->v_next, color, color, 1, -1, 8, cvPoint(0,0));
}
}
}
cvShowImage( "colored", img3 );
on_trackbar(0);
cvWaitKey(0);
cvReleaseMemStorage( &storage );
cvReleaseImage( &img );
cvReleaseImage( &img32f );
cvReleaseImage( &img32s );
cvReleaseImage( &img3 );
return 0;
}
#ifdef _EiC
main(1,"");
#endif
| grace-/opencv-3.0.0-cvpr | opencv/samples/c/contours.c | C | bsd-3-clause | 5,908 | [
30522,
1001,
2421,
1000,
2330,
2278,
2615,
2475,
1013,
10047,
21600,
3217,
2278,
1013,
10047,
21600,
3217,
2278,
1035,
1039,
1012,
1044,
1000,
1001,
2421,
1000,
2330,
2278,
2615,
2475,
1013,
2152,
25698,
1013,
2152,
25698,
1035,
1039,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*!
@file
@author Albert Semenov
@date 10/2008
*/
#ifndef MIRROR_MULTI_LIST_H_
#define MIRROR_MULTI_LIST_H_
#include "MyGUI.h"
#include "Mirror_List.h"
namespace unittest
{
class Mirror_MultiList
{
private:
struct ColumnInfo
{
Mirror_List* list;
MyGUI::UString name;
MyGUI::Any data;
};
typedef std::vector<ColumnInfo> VectorColumnInfo;
VectorColumnInfo mVectorColumnInfo;
public:
~Mirror_MultiList()
{
removeAllColumns();
}
//------------------------------------------------------------------------------//
// ìàíèïóëÿöèè àéòåìàìè
//! Get number of columns
size_t getColumnCount() const
{
return mVectorColumnInfo.size();
}
/** Insert new column
@param _column New column will be inserted before _column
@param _name Name of new column
@param _width Width of new column
*/
void insertColumnAt(size_t _column, const MyGUI::UString& _name, int _width, MyGUI::Any _data = MyGUI::Any::Null)
{
MYGUI_ASSERT_RANGE_INSERT(_column, mVectorColumnInfo.size(), "MultiListBox::insertColumnAt");
if (_column == MyGUI::ITEM_NONE) _column = mVectorColumnInfo.size();
ColumnInfo column;
column.list = new Mirror_List();
column.name = _name;
column.data = _data;
// åñëè óæå áûëè ñòîëáèêè, òî äåëàåì òî æå êîëëè÷åñòâî ïîëåé
if (false == mVectorColumnInfo.empty())
{
size_t count = mVectorColumnInfo.front().list->getItemCount();
for (size_t pos = 0; pos < count; ++pos)
column.list->addItem("");
}
mVectorColumnInfo.insert(mVectorColumnInfo.begin() + _column, column);
}
/** Add new column at last position
@param _width Width of new column
@param _name Name of new column
*/
void addColumn(const MyGUI::UString& _name, int _width = 0, MyGUI::Any _data = MyGUI::Any::Null)
{
insertColumnAt(MyGUI::ITEM_NONE, _name, _width, _data);
}
/** Delete column */
void removeColumnAt(size_t _column)
{
MYGUI_ASSERT_RANGE(_column, mVectorColumnInfo.size(), "MultiListBox::removeColumnAt");
delete mVectorColumnInfo[_column].list;
mVectorColumnInfo.erase(mVectorColumnInfo.begin() + _column);
}
/** Delete all columns */
void removeAllColumns()
{
while (getColumnCount() > 0) removeColumnAt(0);
}
//------------------------------------------------------------------------------//
// ìàíèïóëÿöèè îòîáðàæåíèåì
/** Set column name
@param _column Index of column
@param _name New name of column
*/
void setColumnNameAt(size_t _column, const MyGUI::UString& _name)
{
MYGUI_ASSERT_RANGE(_column, mVectorColumnInfo.size(), "MultiListBox::setColumnNameAt");
mVectorColumnInfo[_column].name = _name;
}
/** Get _column name */
const MyGUI::UString& getColumnNameAt(size_t _column)
{
MYGUI_ASSERT_RANGE(_column, mVectorColumnInfo.size(), "MultiListBox::getColumnNameAt");
return mVectorColumnInfo[_column].name;
}
//------------------------------------------------------------------------------//
// ìàíèïóëÿöèè äàííûìè
//! Replace an item data at a specified position
void setColumnDataAt(size_t _index, MyGUI::Any _data)
{
MYGUI_ASSERT_RANGE(_index, mVectorColumnInfo.size(), "MultiListBox::setColumnDataAt");
mVectorColumnInfo[_index].data = _data;
}
//! Clear an item data at a specified position
void clearColumnDataAt(size_t _index)
{
setColumnDataAt(_index, MyGUI::Any::Null);
}
//! Get item data from specified position
template <typename ValueType>
ValueType* getColumnDataAt(size_t _index, bool _throw = true)
{
MYGUI_ASSERT_RANGE(_index, mVectorColumnInfo.size(), "MultiListBox::getItemDataAt");
return mVectorColumnInfo[_index].data.castType<ValueType>(_throw);
}
//------------------------------------------------------------------------------//
// Methods for work with lines (RU:ìåòîäû äëÿ ðàáîòû ñî ñòðîêàìè)
/** @note
All indexes used here is indexes of unsorted Multilist. Even if you sorted
it - all items indexes will be same as before sort.*/
//------------------------------------------------------------------------------//
// ìàíèïóëÿöèè àéòåìàìè
/** Get number of items (lines) */
size_t getItemCount() const
{
if (mVectorColumnInfo.empty()) return 0;
return mVectorColumnInfo.front().list->getItemCount();
}
/** Insert new item before _index line */
void insertItemAt(size_t _index, const MyGUI::UString& _name, MyGUI::Any _data = MyGUI::Any::Null)
{
MYGUI_ASSERT(!mVectorColumnInfo.empty(), "MultiListBox::insertItemAt");
MYGUI_ASSERT_RANGE_INSERT(_index, mVectorColumnInfo.front().list->getItemCount(), "MultiListBox::insertItemAt");
if (MyGUI::ITEM_NONE == _index) _index = mVectorColumnInfo.front().list->getItemCount();
// âñòàâëÿåì âî âñå ïîëÿ ïóñòûå, à ïîòîì ïðèñâàèâàåì ïåðâîìó
for (VectorColumnInfo::iterator iter = mVectorColumnInfo.begin(); iter != mVectorColumnInfo.end(); ++iter)
{
(*iter).list->insertItemAt(_index, "");
}
mVectorColumnInfo.front().list->setItemNameAt(_index, _name);
mVectorColumnInfo.front().list->setItemDataAt(_index, _data);
}
/** Add new item at the end */
void addItem(const MyGUI::UString& _name, MyGUI::Any _data = MyGUI::Any::Null)
{
insertItemAt(MyGUI::ITEM_NONE, _name, _data);
}
void removeItemAt(size_t _index)
{
MYGUI_ASSERT(!mVectorColumnInfo.empty(), "MultiListBox::removeItemAt");
MYGUI_ASSERT_RANGE(_index, mVectorColumnInfo.begin()->list->getItemCount(), "MultiListBox::removeItemAt");
for (VectorColumnInfo::iterator iter = mVectorColumnInfo.begin(); iter != mVectorColumnInfo.end(); ++iter)
{
(*iter).list->removeItemAt(_index);
}
}
/** Delete all items */
void removeAllItems()
{
while (getItemCount() > 0) removeItemAt(0);
}
void swapItemsAt(size_t _index1, size_t _index2)
{
MYGUI_ASSERT(!mVectorColumnInfo.empty(), "MultiListBox::swapItemsAt");
MYGUI_ASSERT_RANGE(_index1, mVectorColumnInfo.begin()->list->getItemCount(), "MultiListBox::swapItemsAt");
MYGUI_ASSERT_RANGE(_index2, mVectorColumnInfo.begin()->list->getItemCount(), "MultiListBox::swapItemsAt");
for (VectorColumnInfo::iterator iter = mVectorColumnInfo.begin(); iter != mVectorColumnInfo.end(); ++iter)
{
(*iter).list->swapItemsAt(_index1, _index2);
}
}
//------------------------------------------------------------------------------//
// ìàíèïóëÿöèè îòîáðàæåíèåì
/** Set item string */
void setItemNameAt(size_t _index, const MyGUI::UString& _name)
{
setSubItemNameAt(0, _index, _name);
}
const MyGUI::UString& getItemNameAt(size_t _index)
{
return getSubItemNameAt(0, _index);
}
//------------------------------------------------------------------------------//
// ìàíèïóëÿöèè äàííûìè
//! Replace an item data at a specified position
void setItemDataAt(size_t _index, MyGUI::Any _data)
{
setSubItemDataAt(0, _index, _data);
}
//! Clear an item data at a specified position
void clearItemDataAt(size_t _index)
{
setItemDataAt(_index, MyGUI::Any::Null);
}
//! Get item data from specified position
template <typename ValueType>
ValueType* getItemDataAt(size_t _index, bool _throw = true)
{
return getSubItemDataAt<ValueType>(0, _index, _throw);
}
//------------------------------------------------------------------------------//
// Methods for work with sub lines (RU:ìåòîäû äëÿ ðàáîòû ñî ñàá ñòðîêàìè)
//------------------------------------------------------------------------------//
// ìàíèïóëÿöèè äàííûìè
/** Set sub item
@param _column Index of column
@param _index Index of line
@param _item New sub item value
*/
void setSubItemNameAt(size_t _column, size_t _index, const MyGUI::UString& _name)
{
MYGUI_ASSERT_RANGE(_column, mVectorColumnInfo.size(), "MultiListBox::setSubItemAt");
MYGUI_ASSERT_RANGE(_index, mVectorColumnInfo.begin()->list->getItemCount(), "MultiListBox::setSubItemAt");
mVectorColumnInfo[_column].list->setItemNameAt(_index, _name);
}
/** Get sub item name*/
const MyGUI::UString& getSubItemNameAt(size_t _column, size_t _index)
{
MYGUI_ASSERT_RANGE(_column, mVectorColumnInfo.size(), "MultiListBox::getSubItemNameAt");
MYGUI_ASSERT_RANGE(_index, mVectorColumnInfo.begin()->list->getItemCount(), "MultiListBox::getSubItemNameAt");
return mVectorColumnInfo[_column].list->getItemNameAt(_index);
}
/** Search item in specified _column, returns index of the first occurrence in column or ITEM_NONE if item not found */
size_t findSubItemWith(size_t _column, const MyGUI::UString& _item)
{
MYGUI_ASSERT_RANGE(_column, mVectorColumnInfo.size(), "MultiListBox::findSubItemWith");
return mVectorColumnInfo[_column].list->findItemIndexWith(_item);
}
//------------------------------------------------------------------------------//
// ìàíèïóëÿöèè äàííûìè
//! Replace an item data at a specified position
void setSubItemDataAt(size_t _column, size_t _index, MyGUI::Any _data)
{
MYGUI_ASSERT_RANGE(_column, mVectorColumnInfo.size(), "MultiListBox::setSubItemDataAt");
MYGUI_ASSERT_RANGE(_index, mVectorColumnInfo.begin()->list->getItemCount(), "MultiListBox::setSubItemDataAt");
mVectorColumnInfo[_column].list->setItemDataAt(_index, _data);
}
//! Clear an item data at a specified position
void clearSubItemDataAt(size_t _column, size_t _index)
{
setSubItemDataAt(_column, _index, MyGUI::Any::Null);
}
//! Get item data from specified position
template <typename ValueType>
ValueType* getSubItemDataAt(size_t _column, size_t _index, bool _throw = true)
{
MYGUI_ASSERT_RANGE(_column, mVectorColumnInfo.size(), "MultiListBox::getSubItemDataAt");
MYGUI_ASSERT_RANGE(_index, mVectorColumnInfo.begin()->list->getItemCount(), "MultiListBox::getSubItemDataAt");
return mVectorColumnInfo[_column].list->getItemDataAt<ValueType>(_index, _throw);
}
};
}
#endif // MIRROR_MULTILIST_H_
| al2950/mygui | UnitTests/UnitTest_MultiList/Mirror_MultiList.h | C | mit | 9,939 | [
30522,
1013,
1008,
999,
1030,
5371,
1030,
3166,
4789,
7367,
3549,
4492,
1030,
3058,
2184,
1013,
2263,
1008,
1013,
1001,
2065,
13629,
2546,
5259,
1035,
4800,
1035,
2862,
1035,
1044,
1035,
1001,
9375,
5259,
1035,
4800,
1035,
2862,
1035,
104... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
require 'rails_helper'
describe Api::V1::ArticlesController, type: :routing do
it 'routes to #index' do
expect(get: '/api/articles').to route_to(controller: 'api/v1/articles', action: 'index', format: :json)
end
it 'routes to #show' do
expect(get: '/api/articles/1').to route_to(controller: 'api/v1/articles', action: 'show', id: '1', format: :json)
end
it 'routes to #create' do
expect(post: '/api/articles').to route_to(controller: 'api/v1/articles', action: 'create', format: :json)
end
it 'routes to #update via PUT' do
expect(put: '/api/articles/1').to route_to(controller: 'api/v1/articles', action: 'update', id: '1', format: :json)
end
it 'routes to #update via PATCH' do
expect(patch: '/api/articles/1').to route_to(controller: 'api/v1/articles', action: 'update', id: '1', format: :json)
end
it 'routes to #destroy' do
expect(delete: '/api/articles/1').to route_to(controller: 'api/v1/articles', action: 'destroy', id: '1', format: :json)
end
end
| lascar/lockstockbarril | spec/routing/api/v1/articles_routing_spec.rb | Ruby | mit | 1,013 | [
30522,
5478,
1005,
15168,
1035,
2393,
2121,
1005,
6235,
17928,
1024,
1024,
1058,
2487,
1024,
1024,
4790,
8663,
13181,
10820,
1010,
2828,
1024,
1024,
16972,
2079,
2009,
1005,
5847,
2000,
1001,
5950,
1005,
2079,
5987,
1006,
2131,
1024,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!doctype html>
<script>
var searchParams = new URL(location).searchParams;
var test = searchParams.get("test");
window.onportalactivate = function(e) {
if (test == "adopt-once") {
var portal = e.adoptPredecessor();
document.body.appendChild(portal);
if (portal instanceof HTMLPortalElement) {
portal.postMessage("adopted", "*");
}
}
if (test == "adopt-twice") {
var portal = e.adoptPredecessor();
document.body.appendChild(portal);
try {
e.adoptPredecessor();
} catch(e) {
if (e.name == "InvalidStateError") {
portal.postMessage("passed", "*");
}
}
}
if (test == "adopt-after-event") {
setTimeout(function() {
try {
e.adoptPredecessor();
} catch(e) {
if (e.name == "InvalidStateError") {
var bc_test = new BroadcastChannel(`test-${test}`);
bc_test.postMessage("passed");
bc_test.close();
}
}
});
}
}
</script>
| pyfisch/servo | tests/wpt/web-platform-tests/portals/resources/portals-adopt-predecessor-portal.html | HTML | mpl-2.0 | 1,044 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
5896,
1028,
13075,
3945,
30524,
1025,
13075,
3231,
1027,
3945,
28689,
5244,
1012,
2131,
1006,
1000,
3231,
1000,
1007,
1025,
3332,
1012,
2006,
6442,
7911,
6593,
21466,
1027,
3853,
1006,
1041,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using System;
using Xunit;
namespace HealthMonitoring.AcceptanceTests.Helpers
{
static class CustomAssertions
{
public static void EqualNotStrict(string first, string second)
{
bool equal = string.Equals(first, second, StringComparison.CurrentCultureIgnoreCase);
Assert.True(equal, $"{first} != {second}");
}
}
}
| wongatech/HealthMonitoring | HealthMonitoring.AcceptanceTests/Helpers/CusomAssertions.cs | C# | mit | 377 | [
30522,
2478,
2291,
1025,
2478,
15990,
3490,
2102,
1025,
3415,
15327,
2740,
8202,
15660,
2075,
1012,
9920,
22199,
2015,
1012,
2393,
2545,
1063,
10763,
2465,
7661,
27241,
28228,
5644,
1063,
2270,
10763,
11675,
5020,
17048,
3367,
7277,
2102,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<html>
<META HTTP-EQUIV=Content-Type Content="text/html; charset=utf8">
<!-- Mirrored from lis.ly.gov.tw/lghtml/lawstat/version2/02574/02574100052700.htm by HTTrack Website Copier/3.x [XR&CO'2010], Sun, 24 Mar 2013 09:20:15 GMT -->
<head><title>法編號:02574 版本:100052700</title>
<link rel="stylesheet" type="text/css" href="../../version.css" >
</HEAD>
<body><left>
<table><tr><td><FONT COLOR=blue SIZE=5>呼吸治療師法(02574)</font>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td>
<tr><td align=left valign=top>
<a href=0257490122100.html target=law02574><nobr><font size=2>中華民國 90 年 12 月 21 日</font></nobr></a>
</td>
<td valign=top><font size=2>制定43條</font></td>
<tr><td align=left valign=top><nobr><font size=2>中華民國 91 年 1 月 16 日公布</font></nobr></td>
<tr><td align=left valign=top>
<a href=02574100052700.html target=law02574><nobr><font size=2>中華民國 100 年 5 月 27 日</font></nobr></a>
</td>
<td valign=top><font size=2>修正第14, 18, 23條<br>
增訂第16之1至16之14, 23之1, 23之2, 24之1, 24之2條<br>
刪除第40條<br>增訂第2章之1章名
</font></td>
<tr><td align=left valign=top><nobr><font size=2>中華民國 100 年 6 月 15 日公布</font></nobr></td>
</table></table></table></table>
<p><table><tr><td><font color=blue size=4>民國100年5月27日</font></td>
<td><a href=http://lis.ly.gov.tw/lghtml/lawstat/reason2/02574100052700.htm target=reason><font size=2>立法理由</font></a></td>
<td><a href=http://lis.ly.gov.tw/lgcgi/lglawproc?02574100052700 target=proc><font size=2>立法紀錄</font></a></td>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4>第一章 總則</font>
<table><tr><td> </td><td><font color=8000ff>第一條</font>
<font size=2>(呼吸治療師取得之要件)</font>
<table><tr><td> </td>
<td>
中華民國國民經呼吸治療師考試及格,並依本法領有呼吸治療師證書者,得充任呼吸治療師。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第二條</font>
<font size=2>(應考資格)</font>
<table><tr><td> </td>
<td>
公立或立案之私立大學、獨立學院或符合教育部採認規定之國外大學、獨立學院呼吸照護(治療)系、所、組,並經實習期滿成績及格,領有畢業證書者,得應呼吸治療師考試。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第三條</font>
<font size=2>(主管機關)</font>
<table><tr><td> </td>
<td>
本法所稱主管機關:在中央為行政院衛生署;在直轄市為直轄市政府;在縣(市)為縣(市)政府。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第四條</font>
<font size=2>(請領證書之要件及發證機關)</font>
<table><tr><td> </td>
<td>
請領呼吸治療師證書,應檢具申請書及資格證明文件,送請中央主管機關核發之。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第五條</font>
<font size=2>(名稱之專用)</font>
<table><tr><td> </td>
<td>
非領有呼吸治療師證書者,不得使用呼吸治療師名稱。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第六條</font>
<font size=2>(呼吸治療師之消極資格)</font>
<table><tr><td> </td>
<td>
曾受本法所定撤銷或廢止呼吸治療師證書處分者,不得充任呼吸治療師;其已充任者,撤銷或廢止其呼吸治療師證書。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4>第二章 執業</font>
<table><tr><td> </td><td><font color=8000ff>第七條</font>
<font size=2>(執業登記程序)</font>
<table><tr><td> </td>
<td>
呼吸治療師執業,應向所在地直轄市、縣(市)主管機關申請執業登記,領有執業執照,始得執業。<br>
前項申請執業登記之資格、條件、應檢附文件、執業執照發給、換發、補發與其他應遵行事項之辦法,由中央主管機關定之。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第八條</font>
<font size=2>(繼續教育)</font>
<table><tr><td> </td>
<td>
呼吸治療師執業,應接受繼續教育,並每六年提出完成繼續教育證明文件,辦理執業執照更新。<br>
前項呼吸治療師接受繼續教育之課程內容、積分、實施方式、完成繼續教育證明文件、執業執照更新與其他應遵行事項之辦法,由中央主管機關定之。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第九條</font>
<font size=2>(呼吸治療師之消極資格)</font>
<table><tr><td> </td>
<td>
有下列情形之一者,不得發給執業執照;已領照者,廢止之:<br>
一、經撤銷或廢止呼吸治療師證書者。<br>
二、經廢止呼吸治療師執業執照,未滿一年者。<br>
三、罹患精神疾病或身體狀況違常,經主管機關認定不能執行業務者。<br>
前項第三款原因消滅後,仍得依本法規定申請執業執照。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十條</font>
<font size=2>(執業處所)</font>
<table><tr><td> </td>
<td>
呼吸治療師執業以一處為限,並應在所在地主管機關核准登記之醫療機構或其他經主管機關認可必須聘請呼吸治療師之機構為之。但機構間之支援或經事先報准者,不在此限。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十一條</font>
<font size=2>(歇業停業或死亡之報請備查)</font>
<table><tr><td> </td>
<td>
呼吸治療師歇業或停業時,應自事實發生之日起三十日內報請原發執業執照機關備查。<br>
呼吸治療師變更執業處所或復業者,準用關於執業之規定。<br>
呼吸治療師死亡者,由原發執業執照機關註銷其執業執照。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十二條</font>
<font size=2>(強制入會)</font>
<table><tr><td> </td>
<td>
呼吸治療師執業,應加入所在地呼吸治療師公會。<br>
呼吸治療師公會不得拒絕具有會員資格者入會。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十三條</font>
<font size=2>(業務範圍)</font>
<table><tr><td> </td>
<td>
呼吸治療師之業務範圍如下:<br>
一、呼吸治療之評估及測試。<br>
二、機械通氣治療。<br>
三、氣體治療。<br>
四、呼吸功能改善治療。<br>
五、其他經中央主管機關認可之呼吸治療業務。<br>
呼吸治療師執行業務,應在醫師指示下行之。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十四條</font>
<font size=2>(執業紀錄之製作、載明事項及保存期限)</font>
<table><tr><td> </td>
<td>
呼吸治療師執行業務時,應製作紀錄,並於紀錄上簽名或蓋章,並載明下列事項:<br>
一、病人之姓名、性別、出生年月日及地址。<br>
二、執行呼吸治療之方法及時間。<br>
三、醫師指示之內容。<br>
前項業務紀錄應由呼吸治療師之執業機構保管,並至少保存七年。但個案當事人為未成年人,應保存至其成年後至少七年。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十五條</font>
<font size=2>(誠實陳述及報告義務)</font>
<table><tr><td> </td>
<td>
呼吸治療師受衛生、司法或司法警察機關詢問時,不得為虛偽之陳述或報告。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十六條</font>
<font size=2>(保守秘密義務)</font>
<table><tr><td> </td>
<td>
呼吸治療師對於因業務而知悉或持有他人之秘密,不得無故洩漏。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4>第二章之一 居家呼吸照護所</font>
<table><tr><td> </td><td><font color=8000ff>第十六條之一</font>
<font size=2>(居家呼吸照護所之設立及申請)</font>
<table><tr><td> </td>
<td>
居家呼吸照護所之設立,應以呼吸治療師為申請人,向所在地直轄市或縣(市)主管機關申請核准登記,發給開業執照,始得為之。但醫療法人所設之居家呼吸照護所,以醫療法人為申請人。<br>
前項申請設立居家呼吸照護所之呼吸治療師,須在中央主管機關指定之醫療機構執行業務五年以上,始得為之。<br>
前項執行業務年資之採計,以領有呼吸治療師證書並依法向直轄市、縣(市)主管機關辦理執業登記者為限。但於本法公布施行前已執行業務者,其實際服務年資得併予採計。<br>
居家呼吸照護所服務項目、人員條件、設施、設備及其他應遵行事項之設置標準,由中央主管機關定之。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十六條之二</font>
<font size=2>(居家呼吸照護所之負責人)</font>
<table><tr><td> </td>
<td>
居家呼吸照護所應以其申請人為負責人,對其業務負督導責任。但醫療法人所設之居家呼吸照護所,應由醫療法人指定符合前條第二項規定之呼吸治療師為負責人。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十六條之三</font>
<font size=2>(居家呼吸照護所負責人之代理及期限)</font>
<table><tr><td> </td>
<td>
居家呼吸照護所負責人因故不能執行業務,應指定合於負責呼吸治療師資格者代理之。代理期間超過一個月者,應報請原發開業執照機關備查。<br>
前項代理期間,最長不得逾一年。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十六條之四</font>
<font size=2>(名稱專用及變更)</font>
<table><tr><td> </td>
<td>
居家呼吸照護所名稱之使用或變更,應經衛生主管機關核准。<br>
非居家呼吸照護所不得使用居家呼吸照護所或類似之名稱。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十六條之五</font>
<font size=2>(名稱專用之禁止)</font>
<table><tr><td> </td>
<td>
居家呼吸照護所不得使用下列名稱:<br>
一、在同一直轄市或縣(市)區域內,他人已登記使用之居家呼吸照護所名稱。<br>
二、在同一直轄市或縣(市)區域內,與被廢止開業執照未滿一年或受停業處分之居家呼吸照護所相同或類似之名稱。<br>
三、易使人誤認其與政府機關、公益團體有關或有妨害公共秩序或善良風俗之名稱。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十六條之六</font>
<font size=2>(與醫院合作契約之規定)</font>
<table><tr><td> </td>
<td>
居家呼吸照護所應與鄰近醫院訂定合作關係之契約。<br>
前項醫院以經中央主管機關評鑑合格者為限。<br>
第一項契約終止、解除或內容有變更時,應另訂新約,並於契約終止、解除或內容變更之日起十五日內,檢具新約,向直轄市、縣(市)主管機關報備。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十六條之七</font>
<font size=2>(開業情況異動之處理)</font>
<table><tr><td> </td>
<td>
居家呼吸照護所停業、歇業或其登記事項變更時,應於事實發生之日起三十日內,報請原發開業執照機關備查。<br>
居家呼吸照護所遷移或復業者,準用關於設立之規定。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十六條之八</font>
<font size=2>(相關證照及收費標準之懸掛)</font>
<table><tr><td> </td>
<td>
居家呼吸照護所應將其開業執照、收費標準及其呼吸治療師證書,懸掛於明顯處所。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十六條之九</font>
<font size=2>(收費標準)</font>
<table><tr><td> </td>
<td>
居家呼吸照護所收取費用之標準及項目,由直轄市、縣(市)主管機關核定之。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十六條之十</font>
<font size=2>(收費明細表及收據)</font>
<table><tr><td> </td>
<td>
居家呼吸照護所收取費用,應掣給收費明細表及收據。<br>
居家呼吸照護所不得違反收費標準、超額或擅立收費項目收費。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十六條之十一</font>
<font size=2>(廣告內容及業務招攬之規範)</font>
<table><tr><td> </td>
<td>
居家呼吸照護所之廣告,其內容以下列事項為限:<br>
一、居家呼吸照護所之名稱、開業執照字號、地址、電話及交通路線。<br>
二、呼吸治療師之姓名及其證書字號。<br>
三、其他經中央主管機關公告容許登載或宣播事項。<br>
非居家呼吸照護所不得為居家呼吸照護業務之廣告。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十六條之十二</font>
<font size=2>(不當招攬業務之禁止)</font>
<table><tr><td> </td>
<td>
居家呼吸照護所不得以不正當方法招攬業務。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十六條之十三</font>
<font size=2>(報告及檢查之義務)</font>
<table><tr><td> </td>
<td>
居家呼吸照護所應依法令或依主管機關之通知,提出報告;並接受主管機關對其人員、設備、衛生、安全、收費情形、作業等之檢查及資料蒐集。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十六條之十四</font>
<font size=2>(保密責任)</font>
<table><tr><td> </td>
<td>
居家呼吸照護所之人員,對於因業務而知悉或持有他人之秘密,不得無故洩漏。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4>第三章 獎懲</font>
<table><tr><td> </td><td><font color=8000ff>第十七條</font>
<font size=2>(獎勵辦法)</font>
<table><tr><td> </td>
<td>
呼吸治療師之獎勵辦法,由中央主管機關定之。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十八條</font>
<font size=2>(限縮未取得呼吸治療師資格之執業許可)</font>
<table><tr><td> </td>
<td>
未取得呼吸治療師資格,擅自執行呼吸治療業務者,處二年以下有期徒刑,得併科新臺幣三萬元以上十五萬元以下罰金,其所使用藥械沒收之。但在呼吸治療師指導下實習之各相關系、所、組學生或第二條所定之系、所、組自取得學位日起一年內之畢業生,不在此限。<br>
護理人員、物理治療師、醫事檢驗師或其他專門職業及技術人員等依其專門職業法律規定執行業務,涉及本法所定業務時,不視為違反前項規定。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第十九條</font>
<font size=2>(違反業務範圍規定之處罰)</font>
<table><tr><td> </td>
<td>
呼吸治療師違反第十三條第二項規定者,處一年以下有期徒刑,得併科新臺幣三萬元以上十五萬元以下罰金。<br>
犯前項之罪者,並處一個月以上一年以下停業處分;其情節重大者,並得廢止其執業執照或其呼吸治療師證書。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第二十條</font>
<font size=2>(租借證照之處罰)</font>
<table><tr><td> </td>
<td>
呼吸治療師將其證照租借他人使用者,廢止其呼吸治療師證書。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第二十一條</font>
<font size=2>(虛偽報告或陳述之處罰)</font>
<table><tr><td> </td>
<td>
呼吸治療師有下列各款情形之一者,處新臺幣一萬元以上五萬元以下罰鍰,其情節重大者,並處一個月以上一年以下停業處分或廢止其執業執照:<br>
一、違反第十五條規定者。<br>
二、於業務上有違法或不正當行為者。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第二十二條</font>
<font size=2>(違反執業規定之處罰)</font>
<table><tr><td> </td>
<td>
違反第七條第一項、第八條第一項、第十條、第十一條第一項、第二項、第十二條第一項或第十四條規定者,處新臺幣一萬元以上五萬元以下罰鍰。<br>
違反第七條第一項、第八條第一項、第十一條第一項、第二項、第十二條第一項規定者,除依前項規定處罰外,並令其限期改善;經處罰及令其限期改善三次仍未遵循者,處一個月以上一年以下之停業處分。<br>
呼吸治療師公會違反第十二條第二項規定者,由人民團體主管機關處新臺幣一萬元以上五萬元以下罰鍰,並令其限期改善;屆期未改善者,按日連續處罰。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第二十三條</font>
<font size=2>(罰則)</font>
<table><tr><td> </td>
<td>
違反第五條、第十六條、第十六條之一第一項、第十六條之四第二項、第十六條之七第二項、第十六條之十第二項、第十六條之十一、第十六條之十二或第十六條之十四規定者,處新臺幣二萬元以上十萬元以下罰鍰。<br>
違反第十六條之十第二項規定者,除依前項規定處罰外,並限期令其將超收部分退還;屆期未退還者,按次處罰。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第二十三條之一</font>
<font size=2>(罰則)</font>
<table><tr><td> </td>
<td>
居家呼吸照護所有下列各款情形之一者,處新臺幣二萬元以上十萬元以下罰鍰;其情節重大者,並得廢止其開業執照:<br>
一、容留未具呼吸治療師資格人員擅自執行呼吸治療業務。<br>
二、受停業處分而不停業。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第二十三條之二</font>
<font size=2>(罰則)</font>
<table><tr><td> </td>
<td>
違反第十六條之三第一項、第十六條之四第一項、第十六條之六第三項、第十六條之七第一項、第十六條之八、第十六條之十第一項、第十六條之十三規定者,處新臺幣一萬元以上五萬元以下罰鍰。<br>
違反第十六條之三第一項、第十六條之四第一項、第十六條之八規定者,或未符合依第十六條之一第四項所定之標準者,除依前項規定處罰外,並限期令其改善;屆期未改善者,處一個月以上一年以下停業處分。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第二十四條</font>
<font size=2>(受廢止開業執照處分仍繼續執業之處罰)</font>
<table><tr><td> </td>
<td>
呼吸治療師受停業處分仍執行業務者,廢止其執業執照;受廢止執業執照處分仍執行業務者,廢止其呼吸治療師證書。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第二十四條之一</font>
<font size=2>(罰則)</font>
<table><tr><td> </td>
<td>
居家呼吸照護所之負責呼吸治療師受停業處分或廢止執業執照時,應同時對其居家呼吸照護所予以停業處分或廢止其開業執照。<br>
居家呼吸照護所受停業處分或廢止開業執照者,應同時對其負責呼吸治療師予以停業處分或廢止其開業執照。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第二十四條之二</font>
<font size=2>(罰則)</font>
<table><tr><td> </td>
<td>
本法所定之罰鍰,於居家呼吸照護所,除醫療法人設立者外,處罰其負責呼吸治療師。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第二十五條</font>
<font size=2>(懲處之執行機關)</font>
<table><tr><td> </td>
<td>
本法所定之罰鍰、停業或廢止執業執照,除本法另有規定外,由直轄市、縣(市)主管機關為之;撤銷或廢止呼吸治療師證書,由中央主管機關為之。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第二十六條</font>
<font size=2>(強制執行)</font>
<table><tr><td> </td>
<td>
依本法所處之罰鍰,經通知限期繳納,逾期仍未繳納者,依法移送強制執行。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4>第四章 公會</font>
<table><tr><td> </td><td><font color=8000ff>第二十七條</font>
<font size=2>(公會之主管機關)</font>
<table><tr><td> </td>
<td>
呼吸治療師公會之主管機關為人民團體主管機關。但其目的事業,應受主管機關之指導、監督。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第二十八條</font>
<font size=2>(公會組織體系)</font>
<table><tr><td> </td>
<td>
呼吸治療師公會分直轄市及縣(市)公會,並得設呼吸治療師公會全國聯合會。<br>
呼吸治療師公會會址應設於各該公會主管機關所在地。但經各該主管機關核准者,不在此限。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第二十九條</font>
<font size=2>(公會區域及數量之限定)</font>
<table><tr><td> </td>
<td>
呼吸治療師公會之區域,依現有之行政區域;在同一區域內,同級之公會以一個為限。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第三十條</font>
<font size=2>(公會發起組織之要件)</font>
<table><tr><td> </td>
<td>
直轄市、縣(市)呼吸治療師公會,由該轄區域內呼吸治療師二十一人以上發起組織之;其未滿二十一人者,得加入鄰近區域之公會。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第三十一條</font>
<font size=2>(全國聯合會發起組織之要件)</font>
<table><tr><td> </td>
<td>
呼吸治療師公會全國聯合會之設立,應由直轄市及七個以上之縣(市)呼吸治療師公會完成組織後,始得發起組織。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第三十二條</font>
<font size=2>(理、監事、候補理監事、常務理監事之名額及選舉程序)</font>
<table><tr><td> </td>
<td>
呼吸治療師公會置理事、監事,均於召開會員(會員代表)大會時,由會員(會員代表)選舉之,並分別成立理事會、監事會,其名額如下:<br>
一、縣(市)呼吸治療師公會之理事不得超過十五人。<br>
二、直轄市呼吸治療師公會之理事不得超過二十五人。<br>
三、呼吸治療師公會全國聯合會之理事不得超過三十五人。<br>
四、各級呼吸治療師公會之理事名額不得超過全體會員(會員代表)人數二分之一。<br>
五、各級呼吸治療師公會之監事名額不得超過各該公會理事名額三分之一。<br>
各級呼吸治療師公會得置候補理事、候補監事,其名額不得超過各該公會理事、監事名額三分之一。<br>
理事、監事名額在三人以上時,得分別互選常務理事及常務監事;其名額不得超過理事或監事總額三分之一,並應由理事就常務理事中選舉一人為理事長;其不置常務理事者,就理事中互選之。常務監事在三人以上時,應互選一人為監事會召集人。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第三十三條</font>
<font size=2>(理監事之任期及連任)</font>
<table><tr><td> </td>
<td>
理、監事任期均為三年,其連選連任者不得超過二分之一;理事長之連任,以一次為限。<br>
呼吸治療師公會全國聯合會理事、監事之當選,不以直轄市、縣(市)呼吸治療師公會選派參加之會員代表為限。<br>
直轄市、縣(市)呼吸治療師公會選派參加其全國聯合會之會員代表,不以其理事、監事為限。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第三十四條</font>
<font size=2>(會員大會及臨時大會)</font>
<table><tr><td> </td>
<td>
呼吸治療師公會每年召開會員(會員代表)大會一次,必要時得召集臨時大會。<br>
呼吸治療師公會會員人數超過三百人以上時,得依章程之規定就會員分布狀況劃定區域,按其會員人數比率選出代表,召開會員代表大會,行使會員大會之職權。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第三十五條</font>
<font size=2>(章程名冊及倫理規範之備查)</font>
<table><tr><td> </td>
<td>
呼吸治療師公會應訂立章程,造具會員名冊及選任職員簡歷冊,送請所在地人民團體主管機關立案,並分送中央及直轄市、縣(市)主管機關備查。<br>
呼吸治療師公會全國聯合會應訂定呼吸治療師倫理規範,提經會員(會員代表)大會通過後,報請中央主管機關備查。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第三十六條</font>
<font size=2>(章程之應載事項)</font>
<table><tr><td> </td>
<td>
各級呼吸治療師公會之章程應載明下列事項:<br>
一、名稱、區域及會所所在地。<br>
二、宗旨、組織及任務。<br>
三、會員之入會及出會。<br>
四、會員代表之產生及其任期。<br>
五、理事、監事名額、權限、任期及其選任、解任。<br>
六、會員(會員代表)大會及理事會、監事會會議之規定。<br>
七、會員應遵守之公約。<br>
八、經費及會計。<br>
九、章程之修改。<br>
十、其他依法令規定應載明或處理會務之必要事項。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第三十七條</font>
<font size=2>(公會違反章程之處分)</font>
<table><tr><td> </td>
<td>
直轄市、縣(市)呼吸治療師公會對呼吸治療師公會全國聯合會之章程及決議,有遵守義務。<br>
呼吸治療師公會有違反法令、章程或其全國聯合會章程、決議者,人民團體主管機關得為下列處分:<br>
一、警告。<br>
二、撤銷其決議。<br>
三、撤免其理事、監事。<br>
四、限期整理。<br>
前項第一款、第二款處分,亦得由主管機關為之。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第三十八條</font>
<font size=2>(會員違反法令章程之處分)</font>
<table><tr><td> </td>
<td>
呼吸治療師公會會員有違反法令或章程之行為者,公會得依章程、理事會、監事會或會員(會員代表)大會決議予以處分。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4>第五章 附則</font>
<table><tr><td> </td><td><font color=8000ff>第三十九條</font>
<font size=2>(外國人應考執業等規定)</font>
<table><tr><td> </td>
<td>
外國人及華僑得依中華民國法律,應呼吸治療師考試。<br>
前項考試及格,領有呼吸治療師證書之外國人及華僑,在中華民國執行呼吸治療業務,應經中央主管機關許可,並應遵守中華民國關於呼吸治療及醫療之相關法令及呼吸治療師公會章程;其執業之許可及管理辦法,由中央主管機關定之。<br>
違反前項規定者,除依法處罰外,中央主管機關並得廢止其許可。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第四十條</font>
</font>
<table><tr><td> </td>
<td>
(刪除)<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第四十一條</font>
<font size=2>(證書及執照費)</font>
<table><tr><td> </td>
<td>
中央或直轄市、縣(市)主管機關依本法核發證書或執照時,得收取證書費或執照費;其費額由中央主管機關定之。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第四十二條</font>
<font size=2>(施行細則)</font>
<table><tr><td> </td>
<td>
本法施行細則,由中央主管機關定之。<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff>第四十三條</font>
<font size=2>(施行日)</font>
<table><tr><td> </td>
<td>
本法自公布日施行。<br>
</td>
</table>
</table>
</table>
</left>
</body>
<!-- Mirrored from lis.ly.gov.tw/lghtml/lawstat/version2/02574/02574100052700.htm by HTTrack Website Copier/3.x [XR&CO'2010], Sun, 24 Mar 2013 09:20:15 GMT -->
</html>
| czchen/laweasyread-data | rawdata/utf8_lawstat/version2/02574/02574100052700.html | HTML | mit | 35,619 | [
30522,
1026,
16129,
1028,
1026,
18804,
8299,
1011,
1041,
15549,
2615,
1027,
4180,
1011,
2828,
4180,
1027,
1000,
3793,
1013,
16129,
1025,
25869,
13462,
1027,
21183,
2546,
2620,
1000,
1028,
1026,
999,
1011,
1011,
22243,
2013,
5622,
2015,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright (C) 2016 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.api.tools.framework.aspects.documentation.source;
import com.google.api.tools.framework.model.DiagReporter;
import com.google.api.tools.framework.model.DiagReporter.LocationContext;
import com.google.api.tools.framework.model.Model;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/** Parser that parses given Markdown source into {@link SourceElement} structure. */
public class SourceParser {
/**
*
*
* <pre>Setext-style headers:
* Header 1
* ========
*
* Header 2
* -------- </pre>
*
* Based on standard Markdown.pl
*/
private static final Pattern SETEXT_HEADING =
Pattern.compile(
"(?<=^|\\n)(.+)" // Header text
+ "[ \\t]*"
+ "\\n(=+|-+)" // Header level
+ "[ \\t]*"
+ "\\n+");
/**
*
*
* <pre>atx-style headers:
* # Header 1
* ## Header 2
* ## Header 2 with closing hashes ##
* ...
* ###### Header 6 </pre>
*
* We will match any number of '#'s for normalized subsections.
*/
private static final Pattern ATX_HEADING =
Pattern.compile(
"(?<=^|\\n)(#+)" // Header level
+ "[ \\t]*"
+ "(.+?)" // Header text
+ "[ \\t]*"
+ "#*"
+ "\\n+");
private static final Pattern HEADING =
Pattern.compile(String.format("%s|%s", SETEXT_HEADING, ATX_HEADING));
private static final int SEXEXT_HEADING_TEXT = 1;
private static final int SEXEXT_HEADING_LEVEL = 2;
private static final int ATX_HEADING_LEVEL = 3;
private static final int ATX_HEADING_TEXT = 4;
/**
* Instruction. Syntax:
* (== code arg ==)
*/
private static final Pattern INSTRUCTION = Pattern.compile(
"(?<!\\\\)\\(==" // Begin tag
+ "\\s*"
+ "(?<instrcode>[\\w-]+)" // Instruction code
+ "\\s+"
+ "(?<instrarg>[\\S\\s]*?)" // Instruction arg
+ "\\s*"
+ "(?<!\\\\)==\\)(?:\n|\\Z)?"); // End tag
private static final Pattern CODE_BLOCK =
Pattern.compile(
"(?<=\\n\\n|\\A)"
+ "(?<codeblocksource>" // The code block -- one or more lines, starting with a
// space/tab
+ "(?:"
+ "(?:\\s{4}|\\t)" // # Lines must start with a tab or a tab-width of spaces
+ ".*\n*"
+ ")+"
+ ")"
+ "((?=\\s{0,3}\\S)|\\Z)"); // Lookahead for non-space at line-start, or end of doc
private static final Pattern HTML_CODE_BLOCK =
Pattern.compile(
// If the HTML code block is preceeded by two newlines, we strip one. This does not affect
// DocGen's final, rendered HTML output. But it ensures that G3doc, which adds an extra
// newline around code blocks, does not end up surrounding codeblocks with three newlines
// rather than the expected two.
"((?<=\\n)(?:(\\s*\\n\\s*)?)|)"
+ "(?<htmlcodeblocksource>"
+ "<(?<tag>pre|code)(|\\s.*)>[\\S\\s]*?"
+ "</\\k<tag>>)"
+ "((?:\\s*\\n)?(?=\\s*\\n)|)"); // Ignore possible following newline to prevent
//duplication by G3doc; see preceeding comment.
private static final Pattern FENCED_CODE_BLOCK =
Pattern.compile("(?<fencedcodeblocksource>```.*\\n[\\S\\s]*?```)");
private static final Pattern CONTENT_PARSING_PATTERNS =
Pattern.compile(
String.format(
"(?<instr>%s)|(?<codeblock>%s)|(?<htmlcodeblock>%s)|(?<fencedcodeblock>%s)",
INSTRUCTION, CODE_BLOCK, HTML_CODE_BLOCK, FENCED_CODE_BLOCK));
private static final String INSTRUCTION_GROUP = "instr";
private static final String INSTRUCTION_CODE = "instrcode";
private static final String INSTRUCTION_ARG = "instrarg";
private static final String CODE_BLOCK_SOURCE_GROUP = "codeblocksource";
private static final String HTML_CODE_BLOCK_SOURCE_GROUP = "htmlcodeblocksource";
private static final String FENCED_CODE_BLOCK_SOURCE_GROUP = "fencedcodeblocksource";
private static final String INCLUSION_CODE = "include";
private static final String PLAIN_CODE_TAG = "disable-markdown-code-block";
private final DiagReporter diagReporter;
private final LocationContext sourceLocation;
private final String source;
private final String docPath;
private final Model model;
public SourceParser(
String source,
LocationContext sourceLocation,
DiagReporter diagReporter,
String docPath,
Model model) {
this.source = source;
this.sourceLocation = sourceLocation;
this.diagReporter = diagReporter;
this.docPath = docPath;
this.model = model;
}
public SourceParser(
String source, LocationContext sourceLocation, DiagReporter diagReporter, String docPath) {
this(source, sourceLocation, diagReporter, docPath, null);
}
/**
* Parses given Markdown source and generates model of {@link SourceRoot}. The generated model is
* based on Markdown header sections.
*/
public SourceRoot parse() {
SourceRoot root = new SourceRoot(0, source.length());
SectionHeader curHeader = null;
Matcher headerMatcher = HEADING.matcher(source);
while (headerMatcher.find()) {
SectionHeader nextHeader = createHeader(headerMatcher);
fillContents(source, root, curHeader, nextHeader);
curHeader = nextHeader;
}
fillContents(source, root, curHeader, null);
return root;
}
/**
* Fills {@link ContentElement}s into model from region between given header boundaries in the
* source. If content elements are top level, they will be filled into {@link SourceRoot}
* directly. Otherwise a {@link SourceSection} will be created and filled with those content
* elements.
*/
private void fillContents(
String source, SourceRoot root, SectionHeader curHeader, SectionHeader nextHeader) {
List<ContentElement> contents = parseContents(source, curHeader, nextHeader);
if (curHeader == null) {
// Add top level contents to source root.
root.addTopLevelContents(contents);
} else {
// Create a section with curHeader as header and fill parsed content elements into
// the section
int sectionEnd = nextHeader == null ? source.length() : nextHeader.getStartIndex();
SourceSection section = new SourceSection(curHeader, curHeader.getStartIndex(), sectionEnd);
section.addContents(contents);
root.addSection(section);
}
}
/**
* Parse the source region between given section headers boundary to generate {@link
* ContentElement}s.
*/
private List<ContentElement> parseContents(
String source, SectionHeader curHeader, SectionHeader nextHeader) {
List<ContentElement> contents = Lists.newArrayList();
// Decide the source region for the content based on two header boundaries.
int curIndex = curHeader == null ? 0 : curHeader.getEndIndex();
int end = nextHeader == null ? source.length() : nextHeader.getStartIndex();
if (curIndex >= end) {
return contents;
}
Matcher matcher = CONTENT_PARSING_PATTERNS.matcher(source).region(curIndex, end);
while (matcher.find()) {
if (matcher.start() > curIndex) {
// Extract text content between current index and start of found inclusion instruction.
String text = source.substring(curIndex, matcher.start());
contents.add(new Text(unescapeInstructions(text), curIndex, matcher.start()));
}
ContentElement newElement;
if (matcher.group(INSTRUCTION_GROUP) != null) {
int headingLevel = curHeader == null ? 0 : curHeader.getLevel();
String code = matcher.group(INSTRUCTION_CODE);
if (INCLUSION_CODE.equals(code)) {
// Create content element for found file inclusion instruction.
newElement =
new FileInclusion(
docPath,
unescapeInstructions(matcher.group(INSTRUCTION_ARG).trim()),
headingLevel,
matcher.start(),
matcher.end(),
diagReporter,
sourceLocation);
} else {
// Create content element for other instruction.
newElement =
new Instruction(
code,
unescapeInstructions(matcher.group(INSTRUCTION_ARG)),
matcher.start(),
matcher.end());
}
} else if (matcher.group(CODE_BLOCK_SOURCE_GROUP) != null) {
// Create content element for code block.
newElement =
new CodeBlock(
unescapeInstructions(matcher.group(CODE_BLOCK_SOURCE_GROUP)),
matcher.start(),
matcher.end());
} else if (matcher.group(HTML_CODE_BLOCK_SOURCE_GROUP) != null) {
newElement =
new CodeBlock(
unescapeInstructions(matcher.group(HTML_CODE_BLOCK_SOURCE_GROUP)),
matcher.start(),
matcher.end());
} else if (matcher.group(FENCED_CODE_BLOCK_SOURCE_GROUP) != null) {
newElement =
new CodeBlock(
unescapeInstructions(matcher.group(FENCED_CODE_BLOCK_SOURCE_GROUP)),
matcher.start(),
matcher.end());
} else {
// If the matcher matched, we should have been in one of the cases handled above;
// this line should never be reached.
throw new IllegalStateException("Internal error: no valid regex subgroup found");
}
contents.add(newElement);
curIndex = matcher.end();
}
String text = source.substring(curIndex, end);
// Extract trailing text content.
if (!text.isEmpty()) {
end = curIndex + text.length();
contents.add(new Text(text, curIndex, end));
}
return contents;
}
/** Create {@link SectionHeader} instance based on matching result. */
private SectionHeader createHeader(Matcher matcher) {
int level;
String text;
if (!Strings.isNullOrEmpty(matcher.group(ATX_HEADING_LEVEL))) {
level = matcher.group(ATX_HEADING_LEVEL).length();
text = matcher.group(ATX_HEADING_TEXT);
} else {
level = matcher.group(SEXEXT_HEADING_LEVEL).startsWith("=") ? 1 : 2;
text = matcher.group(SEXEXT_HEADING_TEXT);
}
return new SectionHeader(level, text, matcher.start(), matcher.end());
}
private String unescapeInstructions(String string) {
return string.replace("\\(==", "(==").replace("\\==)", "==)");
}
}
| googleapis/api-compiler | src/main/java/com/google/api/tools/framework/aspects/documentation/source/SourceParser.java | Java | apache-2.0 | 11,277 | [
30522,
1013,
1008,
1008,
9385,
1006,
1039,
1007,
2355,
8224,
4297,
1012,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1008,
2017,
2089,
2025,
2224,
2023,
5371,
3272,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
HorseRanch
==========
This is a game made by my 8 year old daughter using Construct 2.
It is a work in progress. There is nothing to play yet, only the scene composition can be viewed.
Star the repo to stay up to date on the progress.
[Play it in a browser](https://dl.dropboxusercontent.com/u/33122639/HorseRanch/index.html)
| edbartley/HorseRanch | README.md | Markdown | mit | 329 | [
30522,
3586,
5521,
2818,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
2023,
2003,
1037,
2208,
2081,
2011,
2026,
1022,
2095,
2214,
2684,
2478,
9570,
1016,
1012,
2009,
2003,
1037,
2147,
1999,
5082,
1012,
2045,
2003,
2498,
200... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// +build integration
package storage
import (
"bytes"
"encoding/base64"
"errors"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"strings"
"testing"
"golang.org/x/net/context"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
"google.golang.org/api/googleapi"
storage "google.golang.org/api/storage/v1"
)
type object struct {
name, contents string
}
var (
projectID string
bucket string
objects = []object{
{"obj1", testContents},
{"obj2", testContents},
{"obj/with/slashes", testContents},
{"resumable", testContents},
{"large", strings.Repeat("a", 514)}, // larger than the first section of content that is sniffed by ContentSniffer.
}
aclObjects = []string{"acl1", "acl2"}
copyObj = "copy-object"
)
const (
envProject = "GCLOUD_TESTS_GOLANG_PROJECT_ID"
envPrivateKey = "GCLOUD_TESTS_GOLANG_KEY"
// NOTE that running this test on a bucket deletes ALL contents of the bucket!
envBucket = "GCLOUD_TESTS_GOLANG_DESTRUCTIVE_TEST_BUCKET_NAME"
testContents = "some text that will be saved to a bucket object"
)
func verifyAcls(obj *storage.Object, wantDomainRole, wantAllUsersRole string) (err error) {
var gotDomainRole, gotAllUsersRole string
for _, acl := range obj.Acl {
if acl.Entity == "domain-google.com" {
gotDomainRole = acl.Role
}
if acl.Entity == "allUsers" {
gotAllUsersRole = acl.Role
}
}
if gotDomainRole != wantDomainRole {
err = fmt.Errorf("domain-google.com role = %q; want %q", gotDomainRole, wantDomainRole)
}
if gotAllUsersRole != wantAllUsersRole {
err = fmt.Errorf("allUsers role = %q; want %q; %v", gotAllUsersRole, wantAllUsersRole, err)
}
return err
}
// TODO(gmlewis): Move this to a common location.
func tokenSource(ctx context.Context, scopes ...string) (oauth2.TokenSource, error) {
keyFile := os.Getenv(envPrivateKey)
if keyFile == "" {
return nil, errors.New(envPrivateKey + " not set")
}
jsonKey, err := ioutil.ReadFile(keyFile)
if err != nil {
return nil, fmt.Errorf("unable to read %q: %v", keyFile, err)
}
conf, err := google.JWTConfigFromJSON(jsonKey, scopes...)
if err != nil {
return nil, fmt.Errorf("google.JWTConfigFromJSON: %v", err)
}
return conf.TokenSource(ctx), nil
}
const defaultType = "text/plain; charset=utf-8"
// writeObject writes some data and default metadata to the specified object.
// Resumable upload is used if resumable is true.
// The written data is returned.
func writeObject(s *storage.Service, bucket, obj string, resumable bool, contents string) error {
o := &storage.Object{
Bucket: bucket,
Name: obj,
ContentType: defaultType,
ContentEncoding: "utf-8",
ContentLanguage: "en",
Metadata: map[string]string{"foo": "bar"},
}
f := strings.NewReader(contents)
insert := s.Objects.Insert(bucket, o)
if resumable {
insert.ResumableMedia(context.Background(), f, int64(len(contents)), defaultType)
} else {
insert.Media(f)
}
_, err := insert.Do()
return err
}
func checkMetadata(t *testing.T, s *storage.Service, bucket, obj string) {
o, err := s.Objects.Get(bucket, obj).Do()
if err != nil {
t.Error(err)
}
if got, want := o.Name, obj; got != want {
t.Errorf("name of %q = %q; want %q", obj, got, want)
}
if got, want := o.ContentType, defaultType; got != want {
t.Errorf("contentType of %q = %q; want %q", obj, got, want)
}
if got, want := o.Metadata["foo"], "bar"; got != want {
t.Errorf("metadata entry foo of %q = %q; want %q", obj, got, want)
}
}
func createService() *storage.Service {
if projectID = os.Getenv(envProject); projectID == "" {
log.Print("no project ID specified")
return nil
}
if bucket = os.Getenv(envBucket); bucket == "" {
log.Print("no project ID specified")
return nil
}
ctx := context.Background()
ts, err := tokenSource(ctx, storage.DevstorageFullControlScope)
if err != nil {
log.Print("createService: %v", err)
return nil
}
client := oauth2.NewClient(ctx, ts)
s, err := storage.New(client)
if err != nil {
log.Print("unable to create service: %v", err)
return nil
}
return s
}
func TestMain(m *testing.M) {
if err := cleanup(); err != nil {
log.Fatalf("Pre-test cleanup failed: %v", err)
}
exit := m.Run()
if err := cleanup(); err != nil {
log.Fatalf("Post-test cleanup failed: %v", err)
}
os.Exit(exit)
}
func TestContentType(t *testing.T) {
s := createService()
if s == nil {
t.Fatal("Could not create service")
}
type testCase struct {
objectContentType string
useOptionContentType bool
optionContentType string
wantContentType string
}
// The Media method will use resumable upload if the supplied data is
// larger than googleapi.DefaultUploadChunkSize We run the following
// tests with two different file contents: one that will trigger
// resumable upload, and one that won't.
forceResumableData := bytes.Repeat([]byte("a"), googleapi.DefaultUploadChunkSize+1)
smallData := bytes.Repeat([]byte("a"), 2)
// In the following test, the content type, if any, in the Object struct is always "text/plain".
// The content type configured via googleapi.ContentType, if any, is always "text/html".
for _, tc := range []testCase{
// With content type specified in the object struct
{
objectContentType: "text/plain",
useOptionContentType: true,
optionContentType: "text/html",
wantContentType: "text/html",
},
{
objectContentType: "text/plain",
useOptionContentType: true,
optionContentType: "",
wantContentType: "text/plain",
},
{
objectContentType: "text/plain",
useOptionContentType: false,
wantContentType: "text/plain; charset=utf-8", // sniffed.
},
// Without content type specified in the object struct
{
useOptionContentType: true,
optionContentType: "text/html",
wantContentType: "text/html",
},
{
useOptionContentType: true,
optionContentType: "",
wantContentType: "", // Result is an object without a content type.
},
{
useOptionContentType: false,
wantContentType: "text/plain; charset=utf-8", // sniffed.
},
} {
// The behavior should be the same, regardless of whether resumable upload is used or not.
for _, data := range [][]byte{smallData, forceResumableData} {
o := &storage.Object{
Bucket: bucket,
Name: "test-content-type",
ContentType: tc.objectContentType,
}
call := s.Objects.Insert(bucket, o)
var opts []googleapi.MediaOption
if tc.useOptionContentType {
opts = append(opts, googleapi.ContentType(tc.optionContentType))
}
call.Media(bytes.NewReader(data), opts...)
_, err := call.Do()
if err != nil {
t.Fatalf("unable to insert object %q: %v", o.Name, err)
}
readObj, err := s.Objects.Get(bucket, o.Name).Do()
if err != nil {
t.Error(err)
}
if got, want := readObj.ContentType, tc.wantContentType; got != want {
t.Errorf("contentType of %q; got %q; want %q", o.Name, got, want)
}
}
}
}
func TestFunctions(t *testing.T) {
s := createService()
if s == nil {
t.Fatal("Could not create service")
}
t.Logf("Listing buckets for project %q", projectID)
var numBuckets int
pageToken := ""
for {
call := s.Buckets.List(projectID)
if pageToken != "" {
call.PageToken(pageToken)
}
resp, err := call.Do()
if err != nil {
t.Fatalf("unable to list buckets for project %q: %v", projectID, err)
}
numBuckets += len(resp.Items)
if pageToken = resp.NextPageToken; pageToken == "" {
break
}
}
if numBuckets == 0 {
t.Fatalf("no buckets found for project %q", projectID)
}
for _, obj := range objects {
t.Logf("Writing %q", obj.name)
// TODO(mcgreevy): stop relying on "resumable" name to determine whether to
// do a resumable upload.
err := writeObject(s, bucket, obj.name, obj.name == "resumable", obj.contents)
if err != nil {
t.Fatalf("unable to insert object %q: %v", obj.name, err)
}
}
for _, obj := range objects {
t.Logf("Reading %q", obj.name)
resp, err := s.Objects.Get(bucket, obj.name).Download()
if err != nil {
t.Fatalf("unable to get object %q: %v", obj.name, err)
}
slurp, err := ioutil.ReadAll(resp.Body)
if err != nil {
t.Errorf("unable to read response body %q: %v", obj.name, err)
}
resp.Body.Close()
if got, want := string(slurp), obj.contents; got != want {
t.Errorf("contents of %q = %q; want %q", obj.name, got, want)
}
}
name := "obj-not-exists"
if _, err := s.Objects.Get(bucket, name).Download(); !isError(err, http.StatusNotFound) {
t.Errorf("object %q should not exist, err = %v", name, err)
} else {
t.Log("Successfully tested StatusNotFound.")
}
for _, obj := range objects {
t.Logf("Checking %q metadata", obj.name)
checkMetadata(t, s, bucket, obj.name)
}
name = objects[0].name
t.Logf("Rewriting %q to %q", name, copyObj)
copy, err := s.Objects.Rewrite(bucket, name, bucket, copyObj, nil).Do()
if err != nil {
t.Errorf("unable to rewrite object %q to %q: %v", name, copyObj, err)
}
if copy.Resource.Name != copyObj {
t.Errorf("copy object's name = %q; want %q", copy.Resource.Name, copyObj)
}
if copy.Resource.Bucket != bucket {
t.Errorf("copy object's bucket = %q; want %q", copy.Resource.Bucket, bucket)
}
// Note that arrays such as ACLs below are completely overwritten using Patch
// semantics, so these must be updated in a read-modify-write sequence of operations.
// See https://cloud.google.com/storage/docs/json_api/v1/how-tos/performance#patch-semantics
// for more details.
t.Logf("Updating attributes of %q", name)
obj, err := s.Objects.Get(bucket, name).Projection("full").Fields("acl").Do()
if err != nil {
t.Errorf("Objects.Get(%q, %q): %v", bucket, name, err)
}
if err := verifyAcls(obj, "", ""); err != nil {
t.Errorf("before update ACLs: %v", err)
}
obj.ContentType = "text/html"
for _, entity := range []string{"domain-google.com", "allUsers"} {
obj.Acl = append(obj.Acl, &storage.ObjectAccessControl{Entity: entity, Role: "READER"})
}
updated, err := s.Objects.Patch(bucket, name, obj).Projection("full").Fields("contentType", "acl").Do()
if err != nil {
t.Errorf("Objects.Patch(%q, %q, %#v) failed with %v", bucket, name, obj, err)
}
if want := "text/html"; updated.ContentType != want {
t.Errorf("updated.ContentType == %q; want %q", updated.ContentType, want)
}
if err := verifyAcls(updated, "READER", "READER"); err != nil {
t.Errorf("after update ACLs: %v", err)
}
t.Log("Testing checksums")
checksumCases := []struct {
name string
contents string
size uint64
md5 string
crc32c uint32
}{
{
name: "checksum-object",
contents: "helloworld",
size: 10,
md5: "fc5e038d38a57032085441e7fe7010b0",
crc32c: 1456190592,
},
{
name: "zero-object",
contents: "",
size: 0,
md5: "d41d8cd98f00b204e9800998ecf8427e",
crc32c: 0,
},
}
for _, c := range checksumCases {
f := strings.NewReader(c.contents)
o := &storage.Object{
Bucket: bucket,
Name: c.name,
ContentType: defaultType,
ContentEncoding: "utf-8",
ContentLanguage: "en",
}
obj, err := s.Objects.Insert(bucket, o).Media(f).Do()
if err != nil {
t.Fatalf("unable to insert object %q: %v", obj, err)
}
if got, want := obj.Size, c.size; got != want {
t.Errorf("object %q size = %v; want %v", c.name, got, want)
}
md5, err := base64.StdEncoding.DecodeString(obj.Md5Hash)
if err != nil {
t.Errorf("object %q base64 decode of MD5 %q: %v", c.name, obj.Md5Hash, err)
}
if got, want := fmt.Sprintf("%x", md5), c.md5; got != want {
t.Errorf("object %q MD5 = %q; want %q", c.name, got, want)
}
var crc32c uint32
d, err := base64.StdEncoding.DecodeString(obj.Crc32c)
if err != nil {
t.Errorf("object %q base64 decode of CRC32 %q: %v", c.name, obj.Crc32c, err)
}
if err == nil && len(d) == 4 {
crc32c = uint32(d[0])<<24 + uint32(d[1])<<16 + uint32(d[2])<<8 + uint32(d[3])
}
if got, want := crc32c, c.crc32c; got != want {
t.Errorf("object %q CRC32C = %v; want %v", c.name, got, want)
}
}
}
// cleanup destroys ALL objects in the bucket!
func cleanup() error {
s := createService()
if s == nil {
return errors.New("Could not create service")
}
var pageToken string
var failed bool
for {
call := s.Objects.List(bucket)
if pageToken != "" {
call.PageToken(pageToken)
}
resp, err := call.Do()
if err != nil {
return fmt.Errorf("cleanup list failed: %v", err)
}
for _, obj := range resp.Items {
log.Printf("Cleanup deletion of %q", obj.Name)
if err := s.Objects.Delete(bucket, obj.Name).Do(); err != nil {
// Print the error out, but keep going.
log.Printf("Cleanup deletion of %q failed: %v", obj.Name, err)
failed = true
}
if _, err := s.Objects.Get(bucket, obj.Name).Download(); !isError(err, http.StatusNotFound) {
log.Printf("object %q should not exist, err = %v", obj.Name, err)
failed = true
} else {
log.Printf("Successfully deleted %q.", obj.Name)
}
}
if pageToken = resp.NextPageToken; pageToken == "" {
break
}
}
if failed {
return errors.New("Failed to delete at least one object")
}
return nil
}
func isError(err error, code int) bool {
if err == nil {
return false
}
ae, ok := err.(*googleapi.Error)
return ok && ae.Code == code
}
| jnewland/kops | vendor/google.golang.org/api/integration-tests/storage/integration_test.go | GO | apache-2.0 | 13,349 | [
30522,
1013,
1013,
1009,
3857,
8346,
7427,
5527,
12324,
1006,
1000,
27507,
1000,
1000,
17181,
1013,
2918,
21084,
1000,
1000,
10697,
1000,
1000,
4718,
2102,
1000,
1000,
22834,
1013,
22834,
21823,
2140,
1000,
1000,
8833,
1000,
1000,
5658,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#include "cmd-run.h"
char** cmd_run_mkcl(int argc,char** argv,struct sub_command* cmd) {
char* home=configdir();
char* arch=uname_m();
char* os=uname_s();
char* impl=(char*)cmd->name;
char* version=(char*)cmd->short_name;
/*[binpath for mkcl] -norc -q -eval init.lisp
[terminating NULL] that total 6 are default. */
int i;
char* impl_path=impldir(arch,os,impl,version);
char* help=get_opt("help",0);
char* script=get_opt("script",0);
char* image=get_opt("image",0);
char* program=get_opt("program",0);
char* lisp_temp_stack_limit=get_opt("lisp-temp-stack-limit",0);
char* frame_stack_limit=get_opt("frame-stack-limit",0);
char* binding_stack_limit=get_opt("binding-stack-limit",0);
char* heap_size_limit=get_opt("heap-size-limit",0);
LVal ret=0;
ret=conss((strcmp("system",version)==0)?truename(which("mkcl")):cat(home,impl_path,DIRSEP,"bin",DIRSEP,"mkcl",EXE_EXTENTION,NULL),ret);
s(arch),s(os),s(impl_path);
if(get_opt("version",0))
ret=conss(q("--version"),ret);
/* runtime options from here */
ret=conss(q("-norc"),ret);
if(lisp_temp_stack_limit)
ret=conss(q(lisp_temp_stack_limit),conss(q("--lisp-temp-stack-limit"),ret));
if(frame_stack_limit)
ret=conss(q(frame_stack_limit),conss(q("--frame-stack-limit"),ret));
if(binding_stack_limit)
ret=conss(q(binding_stack_limit),conss(q("--binding-stack-limit"),ret));
if(heap_size_limit)
ret=conss(q(heap_size_limit),conss(q("--heap-size-limit"),ret));
ret=conss(q("-q"),ret);
if(get_opt("version",0))
ret=conss(q("--version"),ret);
ret=conss(q("-eval"),ret);
ret=conss(s_cat(q("(progn(setq *load-verbose*()*compile-verbose*())#-ros.init(cl:load \""),
s_escape_string(lispdir()),q("init.lisp"),q("\"))"),NULL),ret);
ret=conss(q("-eval"),ret);
ret=conss(s_cat(q("(ros:run '("),q(program?program:""),
script?cat("(:script ",script,")(:quit ())",NULL):q(""),
q("))"),NULL),ret);
for(i=1;i<argc;++i)
ret=conss(q(argv[i]),ret);
cond_printf(1,"\nhelp=%s script=%s\n",help?"t":"nil",script?script:"nil");
return stringlist_array(nreverse(ret));
}
| roswell/roswell | src/cmd-run-mkcl.c | C | mit | 2,150 | [
30522,
1001,
2421,
1000,
4642,
2094,
1011,
2448,
1012,
1044,
1000,
25869,
1008,
1008,
4642,
2094,
1035,
2448,
1035,
12395,
20464,
1006,
20014,
12098,
18195,
1010,
25869,
1008,
1008,
12098,
2290,
2615,
1010,
2358,
6820,
6593,
4942,
1035,
309... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package fr.ironcraft.nowel.entity.model.stuff;
import fr.ironcraft.nowel.Nowel;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.util.ResourceLocation;
public class ModelSantaHat extends ModelBase
{
public ModelRenderer h0;
public ModelRenderer h1;
public ModelRenderer h2;
public ModelRenderer h3;
public ModelRenderer h4;
ResourceLocation texture;
public ModelSantaHat()
{
textureWidth = 32;
textureHeight = 32;
texture = new ResourceLocation(Nowel.MODID, "textures/entity/hat/santa.png");
h0 = createModelRenderer(0, 0, -5F, -7F, -5F, 10, 1, 10);
h1 = createModelRenderer(0, 16, -4F, -9F, -4F, 8, 2, 8);
h2 = createModelRenderer(0, 16, -3F, -11F, -3F, 6, 2, 6);
h3 = createModelRenderer(0, 16, -2F, -12F, -2F, 4, 1, 4);
h4 = createModelRenderer(0, 16, -1F, -13F, -1F, 2, 1, 2);
}
private ModelRenderer createModelRenderer(int offsetX, int offsetY, float posX, float posY, float posZ, int sizeX, int sizeY, int sizeZ) {
float f = -1F;
ModelRenderer part = new ModelRenderer(this, offsetX, offsetY);
part.addBox(posX, posY, posZ, sizeX, sizeY, sizeZ);
part.setRotationPoint(0F, -22.5F, 0F);
part.setTextureSize(textureWidth, textureHeight);
return (part);
}
public void setRotationAngles(float angleX, float angleY)
{
h0.rotateAngleX = angleX;
h0.rotateAngleY = angleY;
this.copyModelAngles(h0, h1);
this.copyModelAngles(h0, h2);
this.copyModelAngles(h0, h3);
this.copyModelAngles(h0, h4);
}
public void render(float angleX, float angleY, float par2)
{
setRotationAngles(angleX, angleY);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
h0.render(par2);
h1.render(par2);
h2.render(par2);
h3.render(par2);
h4.render(par2);
}
} | wascar10/nowel | src/main/java/fr/ironcraft/nowel/entity/model/stuff/ModelSantaHat.java | Java | mit | 1,832 | [
30522,
7427,
10424,
1012,
3707,
10419,
1012,
2085,
2884,
1012,
9178,
1012,
2944,
1012,
4933,
1025,
12324,
10424,
1012,
3707,
10419,
1012,
2085,
2884,
1012,
2085,
2884,
1025,
12324,
5658,
1012,
3067,
10419,
1012,
7396,
1012,
3067,
10419,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.