repo_name
stringlengths
4
116
path
stringlengths
4
379
size
stringlengths
1
7
content
stringlengths
3
1.05M
license
stringclasses
15 values
aleib/reddit-sentiment-ra
src/components/Search/children/LimitDropDown.js
1369
import DropDownMenu from 'material-ui/lib/DropDownMenu'; import MenuItem from 'material-ui/lib/menus/menu-item'; import SearchTermStore from '../../../stores/SearchTermStore'; import Actions from '../../../actions'; import connectToStores from 'alt-utils/lib/connectToStores'; class LimitDropDown extends React.Component { constructor(props) { super(props); } static getStores(){ return [SearchTermStore]; } static getPropsFromStores(){ return SearchTermStore.getState(); } updateOption(event, index, value){ Actions.updateOptions({limitCount: value}); } render() { return ( <div> <span style={styles.dropDownMenuText}>No. of Comments: </span> <DropDownMenu value={this.props.limitCount} openImmediately={false} onChange={this.updateOption} style={styles.dropDownMenu} > <MenuItem value={10} primaryText="10"/> <MenuItem value={50} primaryText="50"/> <MenuItem value={100} primaryText="100"/> <MenuItem value={200} primaryText="200"/> </DropDownMenu> </div> ); } } export default connectToStores(LimitDropDown); var styles = { dropDownMenuText: { width: 150, display: 'inline-block' }, dropDownMenu: { position: 'absolute', overflow: 'visible', top: -6, right: 14 } };
mit
balderdashy/sails
test/integration/generate.test.js
5449
describe('API and adapter generators', function() { var assert = require('assert'); var fs = require('fs-extra'); var exec = require('child_process').exec; var path = require('path'); // Make existsSync not crash on older versions of Node fs.existsSync = fs.existsSync || require('path').existsSync; function capitalize(string) { return string.charAt(0).toUpperCase() + string.slice(1); } var sailsBin = path.resolve('./bin/sails.js'); var appName = 'testApp'; this.slow(1000); before(function(done) { if (fs.existsSync(appName)) { fs.removeSync(appName); } exec('node ' + sailsBin + ' new ' + appName + ' --fast --traditional --without=lodash,async', function(err) { if (err) { return done(new Error(err)); } // Move into app directory and update sailsBin relative path process.chdir(appName); sailsBin = path.resolve('..', sailsBin); done(); }); }); //</before> after(function(done) { // return to test directory process.chdir('../'); if (fs.existsSync(appName)) { fs.removeSync(appName); } done(); }); describe('sails generate model <modelname>', function() { var modelName = 'user'; it('should throw an error if no model name is specified', function(done) { exec('node ' + sailsBin + ' generate model', function(err) { assert.equal(err.code, 1); done(); }); }); it('should create a model file in models folder', function(done) { exec('node ' + sailsBin + ' generate model ' + modelName, function(err) { if (err) done(new Error(err)); assert.doesNotThrow(function() { fs.readFileSync('./api/models/' + capitalize(modelName) + '.js', 'utf8'); }); done(); }); }); it('should throw an error if a model with the same name exists', function(done) { exec('node ' + sailsBin + ' generate model ' + modelName, function(err) { assert.equal(err.code, 1); done(); }); }); }); describe('sails generate controller <controllerName>', function() { var controllerName = 'user'; it('should throw an error if no controller name is specified', function(done) { exec('node ' + sailsBin + ' generate controller', function(err) { assert.equal(err.code, 1); done(); }); }); it('should create a controller file in controllers folder', function(done) { exec('node ' + sailsBin + ' generate controller ' + controllerName, function(err) { if (err) { return done(new Error(err)); } assert.doesNotThrow(function() { fs.readFileSync('./api/controllers/' + capitalize(controllerName) + 'Controller.js', 'utf8'); }); done(); }); }); it('should throw an error if a controller with the same name exists', function(done) { exec('node ' + sailsBin + ' generate controller ' + controllerName, function(err) { assert.equal(err.code, 1); done(); }); }); }); describe('sails generate adapter <modelname>', function() { var adapterName = 'mongo'; it('should throw an error if no adapter name is specified', function(done) { exec('node ' + sailsBin + ' generate adapter', function(err) { assert.equal(err.code, 1); done(); }); }); it('should create a adapter file in adapters folder', function(done) { exec('node ' + sailsBin + ' generate adapter ' + adapterName, function(err) { if (err) { return done(err); } assert.doesNotThrow(function() { fs.readFileSync('./api/adapters/' + adapterName + '/index.js', 'utf8'); }); done(); }); }); it('should throw an error if an adapter with the same name exists', function(done) { exec('node ' + sailsBin + ' generate adapter ' + adapterName, function(err) { assert.equal(err.code, 1); done(); }); }); }); describe('sails generate', function() { var modelName = 'post'; it('should display usage if no generator type is specified', function(done) { exec('node ' + sailsBin + ' generate', function(err, msg) { if (err) { return done(err); } assert.notEqual(msg.indexOf('Usage'), -1); done(); }); }); }); describe('sails generate api <apiname>', function() { var apiName = 'foo'; it('should display usage if no api name is specified', function(done) { exec('node ' + sailsBin + ' generate api', function(err, dumb, response) { assert.notEqual(response.indexOf('Usage'), -1); done(); }); }); it('should create a controller and a model file', function(done) { exec('node ' + sailsBin + ' generate api ' + apiName, function(err) { if (err) { return done(err); } assert.doesNotThrow(function() { fs.readFileSync('./api/models/' + capitalize(apiName) + '.js', 'utf8'); }); assert.doesNotThrow(function() { fs.readFileSync('./api/controllers/' + capitalize(apiName) + 'Controller.js', 'utf8'); }); done(); }); }); it('should throw an error if a controller file and model file with the same name exists', function(done) { exec('node ' + sailsBin + ' generate api ' + apiName, function(err) { assert.equal(err.code, 1); done(); }); }); }); });
mit
sovaa/avoid
config/env/production.js
2051
'use strict'; module.exports = { db: process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || 'mongodb://' + (process.env.DB_1_PORT_27017_TCP_ADDR || 'localhost') + '/avoid', assets: { lib: { css: [ 'public/lib/bootstrap/dist/css/bootstrap.min.css', 'public/lib/bootstrap/dist/css/bootstrap-theme.min.css', ], js: [ 'public/lib/angular/angular.min.js', 'public/lib/angular-resource/angular-resource.js', 'public/lib/angular-cookies/angular-cookies.js', 'public/lib/angular-animate/angular-animate.js', 'public/lib/angular-touch/angular-touch.js', 'public/lib/angular-sanitize/angular-sanitize.js', 'public/lib/angular-ui-router/release/angular-ui-router.min.js', 'public/lib/angular-ui-utils/ui-utils.min.js', 'public/lib/angular-bootstrap/ui-bootstrap-tpls.min.js' ] }, css: 'public/dist/application.min.css', js: 'public/dist/application.min.js' }, facebook: { clientID: process.env.FACEBOOK_ID || 'APP_ID', clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET', callbackURL: '/auth/facebook/callback' }, twitter: { clientID: process.env.TWITTER_KEY || 'CONSUMER_KEY', clientSecret: process.env.TWITTER_SECRET || 'CONSUMER_SECRET', callbackURL: '/auth/twitter/callback' }, google: { clientID: process.env.GOOGLE_ID || 'APP_ID', clientSecret: process.env.GOOGLE_SECRET || 'APP_SECRET', callbackURL: '/auth/google/callback' }, linkedin: { clientID: process.env.LINKEDIN_ID || 'APP_ID', clientSecret: process.env.LINKEDIN_SECRET || 'APP_SECRET', callbackURL: '/auth/linkedin/callback' }, github: { clientID: process.env.GITHUB_ID || 'APP_ID', clientSecret: process.env.GITHUB_SECRET || 'APP_SECRET', callbackURL: '/auth/github/callback' }, mailer: { from: process.env.MAILER_FROM || 'MAILER_FROM', options: { service: process.env.MAILER_SERVICE_PROVIDER || 'MAILER_SERVICE_PROVIDER', auth: { user: process.env.MAILER_EMAIL_ID || 'MAILER_EMAIL_ID', pass: process.env.MAILER_PASSWORD || 'MAILER_PASSWORD' } } } };
mit
honest/active_shipping
lib/active_shipping/shipping/carriers.rb
900
require 'active_shipping/shipping/carriers/bogus_carrier' require 'active_shipping/shipping/carriers/ups' require 'active_shipping/shipping/carriers/usps' require 'active_shipping/shipping/carriers/fedex' require 'active_shipping/shipping/carriers/shipwire' require 'active_shipping/shipping/carriers/kunaki' require 'active_shipping/shipping/carriers/canada_post' require 'active_shipping/shipping/carriers/new_zealand_post' require 'active_shipping/shipping/carriers/canada_post_pws' require 'active_shipping/shipping/carriers/on_trac' require 'active_shipping/shipping/carriers/landmark' require 'active_shipping/shipping/carriers/dhl' module ActiveMerchant module Shipping module Carriers class <<self def all [BogusCarrier, UPS, USPS, FedEx, Shipwire, Kunaki, CanadaPost, NewZealandPost, CanadaPostPWS, OnTrac, Landmark, DHL] end end end end end
mit
acasolla/common-widgets-gwt
src/main/java/it/softphone/rd/gwt/client/widget/base/filter/FilterPopupPanel.java
1737
package it.softphone.rd.gwt.client.widget.base.filter; import it.softphone.rd.gwt.client.CommonWidgetsStyle; import it.softphone.rd.gwt.client.resources.base.FilterPopupPanelCss; import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.event.dom.client.KeyDownHandler; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.Event.NativePreviewEvent; import com.google.gwt.user.client.ui.PopupPanel; /** * <h1>A popup</h1> * * This popup is used as base element of the following classes: * * {@link FilterCalendarViewImpl} * {@link FilterTextBox} * {@link FilterEnum} * * Manages the following {@link KeyDownHandler}: * <ul> * <li>KEY_ESCAPE : hides the popup</li> * <li>KEY_ENTER : starts the processEnterKeyDown() method</li> * </ul> * @author Alessandro Casolla * */ public abstract class FilterPopupPanel extends PopupPanel { public FilterPopupPanel( ) { this(CommonWidgetsStyle.getTheme().getCommonsWidgetClientBundle().filterDialog()); } public FilterPopupPanel(FilterPopupPanelCss css) { css.ensureInjected(); setStylePrimaryName(css.filterDialog()); setAutoHideEnabled(true); } public abstract void processEnterKeyDown(); @Override protected void onPreviewNativeEvent(final NativePreviewEvent event) { super.onPreviewNativeEvent(event); switch (event.getTypeInt()) { case Event.ONKEYDOWN: if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ESCAPE) { hide(); } if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) { processEnterKeyDown(); hide(); } break; } } }
mit
ericnishio/express-boilerplate
src/modules/auth/handlers/refresh.ts
710
import {Request, Response} from 'express' import jwt from 'jsonwebtoken' import {findUserById} from '../../../db/repositories/userRepository' import {generateAccessToken, extractAccessToken} from '../helpers' import {AccessToken} from '../types' export default async (req: Request, res: Response) => { try { // @ts-ignore const accessToken: AccessToken = await jwt.decode(extractAccessToken(req)) const user = await findUserById(accessToken.user._id) if (accessToken.refresh !== user.password) { res.sendStatus(401) return } const json = { jwt: await generateAccessToken(user), } res.status(201).json(json) } catch (e) { res.sendStatus(401) } }
mit
Royal-Society-of-New-Zealand/NZ-ORCID-Hub
orcid_api_v3/models/organization_v30.py
5232
# coding: utf-8 """ ORCID Member No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: Latest Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six from orcid_api_v3.models.disambiguated_organization_v30 import DisambiguatedOrganizationV30 # noqa: F401,E501 from orcid_api_v3.models.organization_address_v30 import OrganizationAddressV30 # noqa: F401,E501 class OrganizationV30(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ """ Attributes: swagger_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition. """ swagger_types = { 'name': 'str', 'address': 'OrganizationAddressV30', 'disambiguated_organization': 'DisambiguatedOrganizationV30' } attribute_map = { 'name': 'name', 'address': 'address', 'disambiguated_organization': 'disambiguated-organization' } def __init__(self, name=None, address=None, disambiguated_organization=None): # noqa: E501 """OrganizationV30 - a model defined in Swagger""" # noqa: E501 self._name = None self._address = None self._disambiguated_organization = None self.discriminator = None self.name = name self.address = address if disambiguated_organization is not None: self.disambiguated_organization = disambiguated_organization @property def name(self): """Gets the name of this OrganizationV30. # noqa: E501 :return: The name of this OrganizationV30. # noqa: E501 :rtype: str """ return self._name @name.setter def name(self, name): """Sets the name of this OrganizationV30. :param name: The name of this OrganizationV30. # noqa: E501 :type: str """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @property def address(self): """Gets the address of this OrganizationV30. # noqa: E501 :return: The address of this OrganizationV30. # noqa: E501 :rtype: OrganizationAddressV30 """ return self._address @address.setter def address(self, address): """Sets the address of this OrganizationV30. :param address: The address of this OrganizationV30. # noqa: E501 :type: OrganizationAddressV30 """ if address is None: raise ValueError("Invalid value for `address`, must not be `None`") # noqa: E501 self._address = address @property def disambiguated_organization(self): """Gets the disambiguated_organization of this OrganizationV30. # noqa: E501 :return: The disambiguated_organization of this OrganizationV30. # noqa: E501 :rtype: DisambiguatedOrganizationV30 """ return self._disambiguated_organization @disambiguated_organization.setter def disambiguated_organization(self, disambiguated_organization): """Sets the disambiguated_organization of this OrganizationV30. :param disambiguated_organization: The disambiguated_organization of this OrganizationV30. # noqa: E501 :type: DisambiguatedOrganizationV30 """ self._disambiguated_organization = disambiguated_organization def to_dict(self): """Returns the model properties as a dict""" result = {} for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, value.items() )) else: result[attr] = value if issubclass(OrganizationV30, dict): for key, value in self.items(): result[key] = value return result def to_str(self): """Returns the string representation of the model""" return pprint.pformat(self.to_dict()) def __repr__(self): """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): """Returns true if both objects are equal""" if not isinstance(other, OrganizationV30): return False return self.__dict__ == other.__dict__ def __ne__(self, other): """Returns true if both objects are not equal""" return not self == other
mit
parentnode/janitor
src/templates/janitor/member/list.php
3462
<?php global $action; global $model; $IC = new Items(); $SC = new Shop(); include_once("classes/users/supermember.class.php"); $MC = new SuperMember(); include_once("classes/users/superuser.class.php"); $UC = new SuperUser(); $memberships = $IC->getItems(array("itemtype" => "membership", "extend" => true)); //print_r($memberships); $options = false; $membership_id = 0; // show specific membership tab? if(count($action) > 1 && $action[1]) { $membership_id = $action[1]; $options = array("item_id" => $membership_id); } // no membership type passed - default to first membership else if(count($action) == 1 && $memberships) { $membership_id = $memberships[0]["id"]; $options = array("item_id" => $membership_id); } // remember memberlist to return to (from new view) // session()->value("return_to_memberlist", $membership_id); $members = $MC->getMembers($options); //print_r($members); ?> <div class="scene i:scene defaultList memberList"> <h1>Members</h1> <ul class="actions"> <?= $HTML->link("Users", "/janitor/admin/user/list", array("class" => "button", "wrapper" => "li.users")) ?> <?= $HTML->link("Orders", "/janitor/admin/shop/order/list", array("class" => "button", "wrapper" => "li.orders")) ?> </ul> <? if($memberships): ?> <ul class="tabs"> <? foreach($memberships as $membership): ?> <?= $HTML->link($membership["name"]. " (".$MC->getMemberCount(array("item_id" => $membership["id"])).")", "/janitor/admin/member/list/".$membership["id"], array("wrapper" => "li.".($membership["id"] == $membership_id ? "selected" : ""))) ?> <? endforeach; ?> <?= $HTML->link("All (".$MC->getMemberCount().")", "/janitor/admin/member/list/0", array("wrapper" => "li.".($options === false ? "selected" : ""))) ?> </ul> <? endif; ?> <div class="all_items i:defaultList filters"> <? if($members): ?> <ul class="items"> <? foreach($members as $member): $username_email = $UC->getUsernames(["user_id" => $member["user"]["id"], "type" => "email"]); if ($username_email) { $email = $username_email["username"]; } else { $email = "Not available"; } ?> <li class="item item_id:<?= $member["id"] ?><?= !$member["subscription_id"] ? " cancelled" : "" ?>"> <h3><span>#<?= $member["id"] ?></span> <?= $email . ($member["user"]["nickname"] != $email ? (", " . $member["user"]["nickname"]) : "") ?><?= $member["user"]["id"] == session()->value("user_id") ? " (YOU)" : "" ?></h3> <dl class="info"> <? // only on "wiew all", display membership type if($membership_id === 0): ?> <dt class="membership">Membership</dt> <dd class="membership"><?= $member["item"] ? $member["item"]["name"] : "Cancelled" ?></dd> <? endif; ?> <? if($member["order"]): ?> <dt class="payment_status">Payment status</dt> <dd class="payment_status <?= ["unpaid", "partial", "paid"][$member["order"]["payment_status"]] ?>"><?= $SC->payment_statuses[$member["order"]["payment_status"]] ?></dd> <? endif; ?> <? if($member["expires_at"]): ?> <dt class="expires_at">Expires at</dt> <dd class="expires_at"><?= date("d. F, Y", strtotime($member["expires_at"])) ?></dd> <? endif; ?> </dl> <ul class="actions"> <?= $HTML->link("Edit", "/janitor/admin/member/view/".$member["user_id"], array("class" => "button", "wrapper" => "li.edit")) ?> </ul> </li> <? endforeach; ?> </ul> <? else: ?> <p>No members.</p> <? endif; ?> </div> </div>
mit
bodji/test4
server/Godeps/_workspace/src/github.com/root-gg/logger/logger_test.go
14914
package logger import ( "bytes" "fmt" "github.com/root-gg/plik/server/Godeps/_workspace/src/github.com/root-gg/utils" "io/ioutil" "os" "path" "testing" "time" ) var logMessage string = "This is a log message\n" func TestNew(t *testing.T) { logger := NewLogger() if logger.MinLevel != MinLevel { t.Errorf("Invalid timer default level %s instead of %s", logger.MinLevel, MinLevel) } logger.Log(INFO, logMessage) } func TestLogger(t *testing.T) { buffer := bytes.NewBuffer([]byte{}) logger := NewLogger().SetOutput(buffer).SetFlags(0) logger.Log(INFO, logMessage) output, err := ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != logMessage { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), logMessage) } } func TestAutoNewLine(t *testing.T) { buffer := bytes.NewBuffer([]byte{}) logger := NewLogger().SetOutput(buffer).SetFlags(0) logger.Log(INFO, "This is a log message") output, err := ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != logMessage { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), logMessage) } } func TestPrefix(t *testing.T) { buffer := bytes.NewBuffer([]byte{}) prefix := "prefix" logger := NewLogger().SetOutput(buffer).SetFlags(0).SetPrefix(prefix) expected := fmt.Sprintf("[%s] %s", prefix, logMessage) logger.Info(logMessage) output, err := ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != expected { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), expected) } } func TestDateFormat(t *testing.T) { buffer := bytes.NewBuffer([]byte{}) logger := NewLogger().SetOutput(buffer).SetFlags(Fdate).SetDateFormat("01/02/2006") expected := fmt.Sprintf("[%s] %s", time.Now().Format("01/02/2006"), logMessage) logger.Info(logMessage) output, err := ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != expected { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), expected) } } func TestShortFile(t *testing.T) { buffer := bytes.NewBuffer([]byte{}) logger := NewLogger().SetOutput(buffer).SetFlags(FshortFile) file, line, _ := utils.GetCaller(1) expected := fmt.Sprintf("[%s:%d] %s", path.Base(file), line+2, logMessage) logger.Info(logMessage) output, err := ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != expected { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), expected) } } func TestLongFile(t *testing.T) { buffer := bytes.NewBuffer([]byte{}) logger := NewLogger().SetOutput(buffer).SetFlags(FlongFile) file, line, _ := utils.GetCaller(1) expected := fmt.Sprintf("[%s:%d] %s", file, line+2, logMessage) logger.Info(logMessage) output, err := ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != expected { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), expected) } } func TestShortFunction(t *testing.T) { buffer := bytes.NewBuffer([]byte{}) logger := NewLogger().SetOutput(buffer).SetFlags(FshortFunction) expected := fmt.Sprintf("[%s] %s", "TestShortFunction", logMessage) logger.Info(logMessage) output, err := ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != expected { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), expected) } } func TestLongFunction(t *testing.T) { buffer := bytes.NewBuffer([]byte{}) logger := NewLogger().SetOutput(buffer).SetFlags(FlongFunction) expected := fmt.Sprintf("[%s] %s", "github.com/root-gg/logger.TestLongFunction", logMessage) logger.Info(logMessage) output, err := ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != expected { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), expected) } } func TestFileAndFunction(t *testing.T) { buffer := bytes.NewBuffer([]byte{}) logger := NewLogger().SetOutput(buffer).SetFlags(FshortFile | FshortFunction) file, line, _ := utils.GetCaller(1) expected := fmt.Sprintf("[%s:%d TestFileAndFunction] %s", path.Base(file), line+2, logMessage) logger.Info(logMessage) output, err := ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != expected { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), expected) } } func TestCallDepth(t *testing.T) { buffer := bytes.NewBuffer([]byte{}) logger := NewLogger().SetOutput(buffer).SetFlags(FshortFunction).SetCallDepth(1) expected := fmt.Sprintf("[%s] %s", "Log", logMessage) logger.Info(logMessage) output, err := ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != expected { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), expected) } } func TestDebug(t *testing.T) { buffer := bytes.NewBuffer([]byte{}) logger := NewLogger().SetOutput(buffer).SetFlags(Flevel).SetMinLevel(DEBUG) expected := fmt.Sprintf("[%s] %s", levels[DEBUG], logMessage) logger.Debug(logMessage) output, err := ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != expected { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), expected) } buffer.Reset() logger.Debugf("%s", logMessage) output, err = ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != expected { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), expected) } logIf := logger.LogIf(DEBUG) if logIf != true { t.Errorf("Invalid LogIf %t instead of %t", logIf, true) } } func TestInfo(t *testing.T) { buffer := bytes.NewBuffer([]byte{}) logger := NewLogger().SetOutput(buffer).SetFlags(Flevel).SetMinLevel(INFO) expected := fmt.Sprintf("[%s] %s", levels[INFO], logMessage) logger.Info(logMessage) output, err := ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != expected { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), expected) } buffer.Reset() logger.Infof("%s", logMessage) output, err = ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != expected { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), expected) } logIf := logger.LogIf(INFO) if logIf != true { t.Errorf("Invalid LogIf %t instead of %t", logIf, true) } } func TestWarning(t *testing.T) { buffer := bytes.NewBuffer([]byte{}) logger := NewLogger().SetOutput(buffer).SetFlags(Flevel).SetMinLevel(WARNING) expected := fmt.Sprintf("[%s] %s", levels[WARNING], logMessage) logger.Warning(logMessage) output, err := ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != expected { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), expected) } buffer.Reset() logger.Warningf("%s", logMessage) output, err = ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != expected { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), expected) } logIf := logger.LogIf(WARNING) if logIf != true { t.Errorf("Invalid LogIf %t instead of %t", logIf, true) } } func TestCritical(t *testing.T) { buffer := bytes.NewBuffer([]byte{}) logger := NewLogger().SetOutput(buffer).SetFlags(Flevel).SetMinLevel(CRITICAL) expected := fmt.Sprintf("[%s] %s", levels[CRITICAL], logMessage) logger.Critical(logMessage) output, err := ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != expected { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), expected) } buffer.Reset() logger.Criticalf("%s", logMessage) output, err = ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != expected { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), expected) } logIf := logger.LogIf(CRITICAL) if logIf != true { t.Errorf("Invalid LogIf %t instead of %t", logIf, true) } } func TestFatal(t *testing.T) { buffer := bytes.NewBuffer([]byte{}) logger := NewLogger().SetOutput(buffer).SetFlags(Flevel).SetMinLevel(FATAL) expected := fmt.Sprintf("[%s] %s", levels[FATAL], logMessage) var exitcode int = 0 exiter = func(code int) { exitcode = code } logger.Fatal(logMessage) output, err := ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != expected { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), expected) } if exitcode != 1 { t.Errorf("Invalid exit code %d instead %d", exitcode, 1) } exitcode = 0 buffer.Reset() logger.Fatalf("%s", logMessage) output, err = ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != expected { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), expected) } if exitcode != 1 { t.Errorf("Invalid exit code %d instead %d", exitcode, 1) } logIf := logger.LogIf(FATAL) if logIf != true { t.Errorf("Invalid LogIf %t instead of %t", logIf, true) } } func TestFixedSizeLevel(t *testing.T) { buffer := bytes.NewBuffer([]byte{}) logger := NewLogger().SetOutput(buffer).SetFlags(Flevel | FfixedSizeLevel) expected := fmt.Sprintf("[%-8s] %s", levels[INFO], logMessage) logger.Info(logMessage) output, err := ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != expected { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), expected) } } func TestMinLevel(t *testing.T) { buffer := bytes.NewBuffer([]byte{}) logger := NewLogger().SetOutput(buffer).SetMinLevel(FATAL) buffer.Reset() logger.Debug(logMessage) output, err := ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if len(output) > 0 { t.Errorf("Invalid logger output when level < MinLevel") } logIf := logger.LogIf(DEBUG) if logIf != false { t.Errorf("Invalid LogIf %t instead of %t", logIf, false) } buffer.Reset() logger.Info(logMessage) output, err = ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if len(output) > 0 { t.Errorf("Invalid logger output when level < MinLevel") } logIf = logger.LogIf(INFO) if logIf != false { t.Errorf("Invalid LogIf %t instead of %t", logIf, false) } buffer.Reset() logger.Warning(logMessage) output, err = ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if len(output) > 0 { t.Errorf("Invalid logger output when level < MinLevel") } logIf = logger.LogIf(WARNING) if logIf != false { t.Errorf("Invalid LogIf %t instead of %t", logIf, false) } buffer.Reset() logger.Critical(logMessage) output, err = ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if len(output) > 0 { t.Errorf("Invalid logger output when level < MinLevel") } logIf = logger.LogIf(CRITICAL) if logIf != false { t.Errorf("Invalid LogIf %t instead of %t", logIf, false) } logIf = logger.LogIf(FATAL) if logIf != true { t.Errorf("Invalid LogIf %t instead of %t", logIf, true) } } func TestMinLevelFromString(t *testing.T) { logger := NewLogger() logger.SetMinLevelFromString("DEBUG") if logger.MinLevel != DEBUG { t.Errorf("Invalid min level %s instead of %s", logger.MinLevel, DEBUG) } logger.SetMinLevelFromString("INVALID") if logger.MinLevel != DEBUG { t.Errorf("Invalid min level %s instead of %s", logger.MinLevel, DEBUG) } logger.SetMinLevelFromString("INFO") if logger.MinLevel != INFO { t.Errorf("Invalid min level %s instead of %s", logger.MinLevel, INFO) } logger.SetMinLevelFromString("WARNING") if logger.MinLevel != WARNING { t.Errorf("Invalid min level %s instead of %s", logger.MinLevel, WARNING) } logger.SetMinLevelFromString("CRITICAL") if logger.MinLevel != CRITICAL { t.Errorf("Invalid min level %s instead of %s", logger.MinLevel, CRITICAL) } logger.SetMinLevelFromString("FATAL") if logger.MinLevel != FATAL { t.Errorf("Invalid min level %s instead of %s", logger.MinLevel, FATAL) } } func TestError(t *testing.T) { devNull, err := os.Open(os.DevNull) if err != nil { t.Errorf("Unable to open %s : %s", os.DevNull, err) } logger := NewLogger().SetOutput(devNull) err = logger.EWarning("Oops!") if err.Error() != "Oops!" { t.Errorf("Invalid error message \"%s\" instead of \"%s\"", err.Error(), "Oops!") } err = logger.EWarningf("Oops : %s", "it's broken") if err.Error() != "Oops : it's broken" { t.Errorf("Invalid error message \"%s\" instead of \"%s\"", err.Error(), "Oops : it's broken") } err = logger.ECritical("Oops!") if err.Error() != "Oops!" { t.Errorf("Invalid error message \"%s\" instead of \"%s\"", err.Error(), "Oops!") } err = logger.ECriticalf("Oops : %s", "it's broken") if err.Error() != "Oops : it's broken" { t.Errorf("Invalid error message \"%s\" instead of \"%s\"", err.Error(), "Oops : it's broken") } err = logger.Error(DEBUG, "Oops!") if err.Error() != "Oops!" { t.Errorf("Invalid error message \"%s\" instead of \"%s\"", err.Error(), "Oops!") } err = logger.Errorf(DEBUG, "Oops : %s", "it's broken") if err.Error() != "Oops : it's broken" { t.Errorf("Invalid error message \"%s\" instead of \"%s\"", err.Error(), "Oops : it's broken") } } func TestCopy(t *testing.T) { logger1 := NewLogger().SetPrefix("logger1") logger2 := logger1.Copy().SetPrefix("logger2") if logger1.Prefix != "logger1" { t.Errorf("Invalid logger prefix %t instead of %t", logger1.Prefix, "logger1") } if logger2.Prefix != "logger2" { t.Errorf("Invalid logger prefix %t instead of %t", logger2.Prefix, "logger2") } } type TestData struct { Foo string } func TestDump(t *testing.T) { buffer := bytes.NewBuffer([]byte{}) logger := NewLogger().SetOutput(buffer).SetFlags(0) logger.Dump(INFO, TestData{"bar"}) expected := "{\n \"Foo\": \"bar\"\n}\n" output, err := ioutil.ReadAll(buffer) if err != nil { t.Errorf("Unable to read logger output : %s", err) } if string(output) != expected { t.Errorf("Invalid log message \"%s\" instead of \"%s\"", string(output), expected) } }
mit
EdgarVarg/blog
application/views/header.php
5461
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>Blog</title> <!-- jQuery --> <script src="<?= base_url()?>application/plantilla/js/jquery.js"></script> <!-- Bootstrap Core JavaScript --> <script src="<?= base_url()?>application/plantilla/js/bootstrap.min.js"></script> <!-- Custom Theme JavaScript --> <script src="<?= base_url()?>application/plantilla/js/clean-blog.min.js"></script> <!-- Bootstrap Core CSS --> <link href="<?= base_url()?>application/plantilla/css/bootstrap.min.css" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="<?= base_url() ?>application/views/css/style.css"> <!-- Custom CSS --> <link href="<?= base_url()?>application/plantilla/css/clean-blog.min.css" rel="stylesheet"> <!-- Custom Fonts --> <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href='http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'> <script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.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/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <!-- Navigation --> <nav class="navbar navbar-default navbar-custom navbar-fixed-top"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header page-scroll"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="<?= base_url()?>Blog">Click It</a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-right"> <li> <?php if ($this->session->userdata('logged_in')) { echo "<a href='/Blog_actualizado/blog/nueva'>Nueva entrada</a>"; }else{ echo "<a href='/Blog_actualizado/blog/entradasno'>Ver entradas</a>"; } ?> </li> <li> <?php if ($this->session->userdata('logged_in')) { echo "<a href='/Blog_actualizado/blog/entradas'>Ver entradas</a>"; }else{ echo "<a href='/Blog_actualizado/Menu'>Registrate</a>"; } ?> </li> <?php if ($this->session->userdata('logged_in')) { echo"<li style='color:#000; text-shadow: 1px 4px 4px #FFFFFF;background: rgba(249, 249, 255, 0.33) none repeat scroll 0% 0%;'>Bienvenido <a href='/Blog_actualizado/blog/user_porfile'>"; echo $username.'</a>'; echo "</li>"; echo "<a style='color:#fff; text-shadow: 4px 4px 4px #000;' href='/Blog_actualizado/blog/logout'>Logout</a>"; }else{ echo "<li>"; echo "<a href='/Blog_actualizado/Verifylogin'>Iniciar Sesion</a>"; echo "</li"; } ?> </li> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container --> </nav> <!-- Page Header --> <!-- Set your background image for this header on the line below. --> <header class="intro-header" style="background-image: url('<?= base_url()?>application/plantilla/img/home-bg.jpg')"> <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1"> <div class="site-heading"> <h1>Codeigniter Blog</h1> <hr class="small"> <span class="subheading">Edgar Ramos Luna</span> </div> </div> </div> </div> </header> </body> </html>
mit
achacha/SomeWebCardGame
src/test/java/org/achacha/base/dbo/LoginDboTest.java
1335
package org.achacha.base.dbo; import org.achacha.base.global.Global; import org.achacha.test.BaseInitializedTest; import org.achacha.test.TestDataConstants; import org.junit.jupiter.api.Test; import java.sql.Connection; import java.sql.SQLException; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; class LoginDboTest extends BaseInitializedTest { private LoginUserDboFactory factory = Global.getInstance().getDatabaseManager().getFactory(LoginUserDbo.class); @Test void testDboRead() throws SQLException { try (Connection connection = Global.getInstance().getDatabaseManager().getConnection()) { LoginUserDbo loginById = factory.getById(connection, TestDataConstants.JUNIT_USER_LOGINID); assertNotNull(loginById); assertEquals(TestDataConstants.JUNIT_USER_LOGINID, loginById.getId()); assertEquals(TestDataConstants.JUNIT_USER_EMAIL, loginById.getEmail()); LoginUserDbo loginByEmail = factory.findByEmail(TestDataConstants.JUNIT_USER_EMAIL); assertNotNull(loginByEmail); assertEquals(TestDataConstants.JUNIT_USER_EMAIL, loginByEmail.getEmail()); assertEquals(TestDataConstants.JUNIT_USER_LOGINID, loginByEmail.getId()); } } }
mit
DoWhatILove/turtle
programming/csharp/Practice/PowerLib/Triple.cs
11337
namespace SAS.PowerLib { using System; using System.Collections.Generic; /// <summary> /// Stores a triple of objects within a single struct. This struct is useful to use as the /// T of a collection, or as the TKey or TValue of a dictionary. /// </summary> [Serializable] public struct Triple<TFirst, TSecond, TThird> : IComparable, IComparable<Triple<TFirst, TSecond, TThird>> { /// <summary> /// Comparers for the first and second type that are used to compare /// values. /// </summary> private static IComparer<TFirst> firstComparer = Comparer<TFirst>.Default; private static IComparer<TSecond> secondComparer = Comparer<TSecond>.Default; private static IComparer<TThird> thirdComparer = Comparer<TThird>.Default; private static IEqualityComparer<TFirst> firstEqualityComparer = EqualityComparer<TFirst>.Default; private static IEqualityComparer<TSecond> secondEqualityComparer = EqualityComparer<TSecond>.Default; private static IEqualityComparer<TThird> thirdEqualityComparer = EqualityComparer<TThird>.Default; /// <summary> /// The first element of the triple. /// </summary> public TFirst First; /// <summary> /// The second element of the triple. /// </summary> public TSecond Second; /// <summary> /// The thrid element of the triple. /// </summary> public TThird Third; /// <summary> /// Creates a new triple with given elements. /// </summary> /// <param name="first">The first element of the triple.</param> /// <param name="second">The second element of the triple.</param> /// <param name="third">The third element of the triple.</param> public Triple(TFirst first, TSecond second, TThird third) { this.First = first; this.Second = second; this.Third = third; } /// <summary> /// Determines if this triple is equal to another object. The triple is equal to another object /// if that object is a Triple, all element types are the same, and the all three elements /// compare equal using object.Equals. /// </summary> /// <param name="obj">Object to compare for equality.</param> /// <returns>True if the objects are equal. False if the objects are not equal.</returns> public override bool Equals(object obj) { if (obj != null && obj is Triple<TFirst, TSecond, TThird>) { Triple<TFirst, TSecond, TThird> other = (Triple<TFirst, TSecond, TThird>)obj; return Equals(other); } else { return false; } } /// <summary> /// Determines if this triple is equal to another triple. Two triples are equal if the all three elements /// compare equal using IComparable&lt;T&gt;.Equals or object.Equals. /// </summary> /// <param name="other">Triple to compare with for equality.</param> /// <returns>True if the triples are equal. False if the triples are not equal.</returns> public bool Equals(Triple<TFirst, TSecond, TThird> other) { return firstEqualityComparer.Equals(First, other.First) && secondEqualityComparer.Equals(Second, other.Second) && thirdEqualityComparer.Equals(Third, other.Third); } /// <summary> /// Returns a hash code for the triple, suitable for use in a hash-table or other hashed collection. /// Two triples that compare equal (using Equals) will have the same hash code. The hash code for /// the triple is derived by combining the hash codes for each of the two elements of the triple. /// </summary> /// <returns>The hash code.</returns> public override int GetHashCode() { // Build the hash code from the hash codes of First and Second. int hashFirst = (First == null) ? 0x61E04917 : First.GetHashCode(); int hashSecond = (Second == null) ? 0x198ED6A3 : Second.GetHashCode(); int hashThird = (Third == null) ? 0x40FC1877 : Third.GetHashCode(); return hashFirst ^ hashSecond ^ hashThird; } /// <summary> /// <para> Compares this triple to another triple of the some type. The triples are compared by using /// the IComparable&lt;T&gt; or IComparable interface on TFirst, TSecond, and TThird. The triples /// are compared by their first elements first, if their first elements are equal, then they /// are compared by their second elements. If their second elements are also equal, then they /// are compared by their third elements.</para> /// <para>If TFirst, TSecond, or TThird does not implement IComparable&lt;T&gt; or IComparable, then /// an NotSupportedException is thrown, because the triples cannot be compared.</para> /// </summary> /// <param name="other">The triple to compare to.</param> /// <returns>An integer indicating how this triple compares to <paramref name="other"/>. Less /// than zero indicates this triple is less than <paramref name="other"/>. Zero indicate this triple is /// equals to <paramref name="other"/>. Greater than zero indicates this triple is greater than /// <paramref name="other"/>.</returns> /// <exception cref="NotSupportedException">Either FirstSecond, TSecond, or TThird is not comparable /// via the IComparable&lt;T&gt; or IComparable interfaces.</exception> public int CompareTo(Triple<TFirst, TSecond, TThird> other) { try { int firstCompare = firstComparer.Compare(First, other.First); if (firstCompare != 0) return firstCompare; int secondCompare = secondComparer.Compare(Second, other.Second); if (secondCompare != 0) return secondCompare; else return thirdComparer.Compare(Third, other.Third); } catch (ArgumentException) { // Determine which type caused the problem for a better error message. if (!typeof(IComparable<TFirst>).IsAssignableFrom(typeof(TFirst)) && !typeof(System.IComparable).IsAssignableFrom(typeof(TFirst))) { throw new NotSupportedException(string.Format(Strings.UncomparableType, typeof(TFirst).FullName)); } else if (!typeof(IComparable<TSecond>).IsAssignableFrom(typeof(TSecond)) && !typeof(System.IComparable).IsAssignableFrom(typeof(TSecond))) { throw new NotSupportedException(string.Format(Strings.UncomparableType, typeof(TSecond).FullName)); } else if (!typeof(IComparable<TThird>).IsAssignableFrom(typeof(TThird)) && !typeof(System.IComparable).IsAssignableFrom(typeof(TThird))) { throw new NotSupportedException(string.Format(Strings.UncomparableType, typeof(TThird).FullName)); } else throw; // Hmmm. Unclear why we got the ArgumentException. } } /// <summary> /// <para> Compares this triple to another triple of the some type. The triples are compared by using /// the IComparable&lt;T&gt; or IComparable interface on TFirst, TSecond, and TThird. The triples /// are compared by their first elements first, if their first elements are equal, then they /// are compared by their second elements. If their second elements are also equal, then they /// are compared by their third elements.</para> /// <para>If TFirst, TSecond, or TThird does not implement IComparable&lt;T&gt; or IComparable, then /// an NotSupportedException is thrown, because the triples cannot be compared.</para> /// </summary> /// <param name="obj">The triple to compare to.</param> /// <returns>An integer indicating how this triple compares to <paramref name="obj"/>. Less /// than zero indicates this triple is less than <paramref name="obj"/>. Zero indicate this triple is /// equals to <paramref name="obj"/>. Greater than zero indicates this triple is greater than /// <paramref name="obj"/>.</returns> /// <exception cref="ArgumentException"><paramref name="obj"/> is not of the correct type.</exception> /// <exception cref="NotSupportedException">Either FirstSecond, TSecond, or TThird is not comparable /// via the IComparable&lt;T&gt; or IComparable interfaces.</exception> int IComparable.CompareTo(object obj) { if (obj is Triple<TFirst, TSecond, TThird>) return CompareTo((Triple<TFirst, TSecond, TThird>)obj); else throw new ArgumentException(Strings.BadComparandType, "obj"); } /// <summary> /// Returns a string representation of the triple. The string representation of the triple is /// of the form: /// <c>First: {0}, Second: {1}, Third: {2}</c> /// where {0} is the result of First.ToString(), {1} is the result of Second.ToString(), and /// {2} is the result of Third.ToString() (or "null" if they are null.) /// </summary> /// <returns> The string representation of the triple.</returns> public override string ToString() { return string.Format("First: {0}, Second: {1}, Third: {2}", (First == null) ? "null" : First.ToString(), (Second == null) ? "null" : Second.ToString(), (Third == null) ? "null" : Third.ToString()); } /// <summary> /// Determines if two triples are equal. Two triples are equal if the all three elements /// compare equal using IComparable&lt;T&gt;.Equals or object.Equals. /// </summary> /// <param name="pair1">First triple to compare.</param> /// <param name="pair2">Second triple to compare.</param> /// <returns>True if the triples are equal. False if the triples are not equal.</returns> public static bool operator ==(Triple<TFirst, TSecond, TThird> pair1, Triple<TFirst, TSecond, TThird> pair2) { return pair1.Equals(pair2); } /// <summary> /// Determines if two triples are not equal. Two triples are equal if the all three elements /// compare equal using IComparable&lt;T&gt;.Equals or object.Equals. /// </summary> /// <param name="pair1">First triple to compare.</param> /// <param name="pair2">Second triple to compare.</param> /// <returns>True if the triples are not equal. False if the triples are equal.</returns> public static bool operator !=(Triple<TFirst, TSecond, TThird> pair1, Triple<TFirst, TSecond, TThird> pair2) { return !pair1.Equals(pair2); } } }
mit
stephenlautier/ssv-angular-core
tools/build/tasks/scripts.js
2200
var gulp = require("gulp"); var runSeq = require("run-sequence"); var merge = require("merge2"); var typescript = require("typescript"); var dtsGen = require("dts-generator"); var Builder = require("systemjs-builder"); var tsc = require("gulp-typescript"); var sourcemaps = require("gulp-sourcemaps"); var plumber = require("gulp-plumber"); var ngAnnotate = require("gulp-ng-annotate"); var config = require("../config"); var tsProject = tsc.createProject("tsconfig.json", { sortOutput: true, typescript: typescript }); gulp.task("scripts", (cb) => { return runSeq( ["compile:ts", "compile:dts"], cb); }); gulp.task("scripts:rel", (cb) => { return runSeq( "build", "compile:bundle", "scripts:copy-dist", cb); }); gulp.task("compile:ts", () => { var tsResult = gulp.src([config.src.tsd, config.src.ts, `!${config.test.files}`]) .pipe(plumber()) //.pipe(changed(config.dist.appJs, { extension: ".js" })) .pipe(sourcemaps.init()) .pipe(tsc(tsProject)); return merge([ tsResult.js .pipe(ngAnnotate()) .pipe(sourcemaps.write(".")) .pipe(gulp.dest(`${config.artifact}/amd`)), // tsResult.dts // .pipe(gulp.dest(config.artifact)) ]); }); // d.ts generation using dts-generator gulp.task("compile:dts", () => { return dtsGen.generate({ name: `${config.packageName}`, baseDir: `${config.root}/`, files: ["./index.ts", `../${config.src.tsd}`], out: `${config.artifact}/${config.packageName}.d.ts`, main: `${config.packageName}/index`, //externs: ["../angularjs/angular.d.ts"] }, (msg) => { console.log(`Generating ${config.packageName}.d.ts: ${msg}`); }); }); gulp.task("compile:bundle", () => { var builder = new Builder(".", "system.config.js"); return builder .buildStatic(`${config.packageName} - angular`, `${config.output}/amd-bundle/${config.packageName}.js`, { format: "amd", sourceMaps: true }); // return builder // .bundle(`${config.packageName} - angular`, // `${config.output}/${config.packageName}.js`, // { format: "amd", sourceMaps: true }); }); gulp.task("scripts:copy-dist", () => { return gulp.src([`${config.artifact}/**/*`, `!${config.test.output}/**/*`]) .pipe(gulp.dest(config.output)); });
mit
alexandarnikita/wen
client/common/webpack/webpack.dev.config.js
2127
const webpack = require('webpack'); const config = require('../../../common/config.js'); module.exports = ({ entry, output, context }) => ({ entry, output, context, devtool: 'eval', module: { rules: [ { test: /\.css$/, use: [ 'style-loader', { loader: 'css-loader', query: { sourceMap: true } } ] }, { test: /\.scss$/, use: [ { loader: 'style-loader' }, { loader: 'css-loader', query: { sourceMap: true } }, { loader: 'sass-loader', query: { sourceMap: true } } ] }, { test: /\.(jsx|js)$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { presets: [['env', { modules: false }], 'react'], plugins: [ 'transform-runtime', 'transform-object-rest-spread', 'syntax-dynamic-import', 'react-hot-loader/babel' ], babelrc: false } } }, { test: /\.(graphql|gql)$/, exclude: /node_modules/, loader: 'graphql-tag/loader' }, { test: /\.(png|jpg|gif)$/, loader: 'url-loader', options: { limit: 10000, name: 'images/[name].[ext]' } }, { test: /\.(svg|eot|ttf|woff|woff2)$/, loader: 'file-loader', options: { limit: 10000, name: 'fonts/[name].[ext]' } } ] }, plugins: [ new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify(config.NODE_ENV), PREBUILD: false }), new webpack.HotModuleReplacementPlugin(), new webpack.NamedModulesPlugin(), new webpack.NoEmitOnErrorsPlugin() ], resolve: { extensions: [ '*', '.json', '.js', '.jsx', '.scss' ] } });
mit
SigPloiter/SigPloit
gtp/attacks/info/teid_sequence_predictability_index.py
4975
#!/usr/bin/env python # encoding: utf-8 # teid_sequence_predictability_index.py # # Copyright 2018 Rosalia d'Alessandro # # # 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 the 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. # import os import sys from optparse import OptionParser from gtp.gtp_v2_core.utilities.teid_predictability import TeidPredictabilityIndex,\ TeidFixedPart __all__ = [] __version__ = 0.1 DEFAULT_NUM_MSG = 6 DEBUG = 0 ## ## ATTACKING TOOL ## ## @brief Main file to execute the script. ## ## This file roughly estimates how difficult it would be to predict the next ## teid from the known sequence of six probe responses. ## ## Use the -h option to enter the help menu and determine what to do. ## ## Basic usage examples: ## * $ python teid_sequence_predictability_index.py -v -t <teids> def main(argv=None): '''Command line options.''' program_name = os.path.basename(sys.argv[0]) program_version = "v0.1" program_version_string = '%%prog %s' % (program_version) program_license = "Copyright 2018 Rosalia d'Alessandro\ Licensed under the Apache License 2.0\ nhttp://www.apache.org/licenses/LICENSE-2.0" if argv is None: argv = sys.argv[1:] lstn = None try: # setup option parser parser = OptionParser(version=program_version_string, description=program_license) parser.add_option("-v", "--verbose", dest="verbose", action="count", help="set verbosity level [default: %default]") parser.add_option("-t", "--teids", dest="teids_file", help="file " "containing list of at least six consecutives tests") # set defaults parser.set_defaults(teids_file="teids.cnf", verbose = False) # process options (opts, args) = parser.parse_args(argv) is_verbose = False # MAIN BODY # if opts.teids_file == "" : print "Error: missed file containing at least six consecutive teids" return ##read file teids = [] with open(opts.teids_file) as f: teids = f.readlines() teids = [int(t.strip(),16) for t in teids] if len(teids) < 6: print ("Error: File shall contain least six consecutive teids.", "provided %d")%(len(teids)) return tpi = TeidPredictabilityIndex() index, msg = tpi.teidPredictabilityIndex(teids) print ("%d, %s")%(index, msg) tcp = TeidFixedPart() teids_hex = [hex(t) for t in teids] common_prefixes = tcp.teidFixedPart(teids_hex) if common_prefixes != [] : print "The algorithm seems to use a number of bits less than 32 for",\ "TEID generation." print common_prefixes else : print ("The algorithm seems to use a all 32 bits for", "TEID generation.") except Exception, e: indent = len(program_name) * " " sys.stderr.write(program_name + ": " + repr(e) + "\n") sys.stderr.write(indent + " for help use --help") print "Exception %s"%str(e) return 2 if __name__ == "__main__": if DEBUG: sys.argv.append("-v") sys.exit(main())
mit
HornsAndHooves/flat_map
lib/flat_map/open_mapper.rb
3111
module FlatMap # Base Mapper that can be used for mounting other mappers, handling business logic, # etc. For the intentional usage of mappers, pleas see {ModelMapper} class OpenMapper # Raised when mapper is initialized with no target defined class NoTargetError < ArgumentError # Initializes exception with a name of mapper class. # # @param [Class] mapper_class class of mapper being initialized def initialize(mapper_class) super("Target object is required to initialize #{mapper_class.name}") end end extend ActiveSupport::Autoload autoload :Mapping autoload :Mounting autoload :Traits autoload :Factory autoload :AttributeMethods autoload :Persistence autoload :Skipping include Mapping include Mounting include Traits include AttributeMethods include ActiveModel::Validations include Persistence include Skipping attr_writer :host, :suffix attr_reader :target, :traits attr_accessor :owner, :name # Callback to dup mappings and mountings on inheritance. # The values are cloned from actual mappers (i.e. something # like CustomerAccountMapper, since it is useless to clone # empty values of FlatMap::Mapper). # # Note: those class attributes are defined in {Mapping} # and {Mounting} modules. def self.inherited(subclass) subclass.mappings = mappings.dup subclass.mountings = mountings.dup end # Initializes +mapper+ with +target+ and +traits+, which are # used to fetch proper list of mounted mappers. Raises error # if target is not specified. # # @param [Object] target Target of mapping # @param [*Symbol] traits List of traits # @raise [FlatMap::Mapper::NoTargetError] def initialize(target, *traits) raise NoTargetError.new(self.class) unless target @target, @traits = target, traits if block_given? singleton_class.trait :extension, &Proc.new end end # Return a simple string representation of +mapper+. Done so to # avoid really long inspection of internal objects (target - # usually AR model, mountings and mappings) # @return [String] def inspect to_s end # Return +true+ if +mapper+ is owned. This means that current # mapper is actually a trait. Thus, it is a part of an owner # mapper. # # @return [Boolean] def owned? owner.present? end # If mapper was mounted by another mapper, host is the one who # mounted +self+. # # @return [FlatMap::Mapper] def host owned? ? owner.host : @host end # Return +true+ if mapper is hosted, i.e. it is mounted by another # mapper. # # @return [Boolean] def hosted? host.present? end # +suffix+ reader. Delegated to owner for owned mappers. # # @return [String, nil] def suffix owned? ? owner.suffix : @suffix end # Return +true+ if +suffix+ is present. # # @return [Boolean] def suffixed? suffix.present? end end end
mit
paulocesar/harbor
src/helpers.js
597
var fs = require('fs'), path = require('path'), _ = require('lodash'), Q = require('q'), helpers = null; module.exports = helpers = {}; // load files from a specific folder // please try to always use path.resolve helpers.requireFiles = function (requirePath) { if (!requirePath) { return {}; } var required = {}; _.each(fs.readdirSync(requirePath), function (file) { var f = file.replace('.js', ''); // TODO: ignore file excludeFiles.indexOf(f) == -1 required[f] = require(path.resolve(requirePath, file)); }); return required; };
mit
iModels/simgen
tests/test_render.py
1492
import os from os.path import dirname from simgen.ghsync import Loader from simgen.astnode import AstNode from simgen.renderer import Renderer def test_ast(): # create a new offline loader with explicit github url to local directory association loader = Loader() loader.add_repo("https://github.com/imodels/simgen.git", os.path.split(os.path.dirname(__file__))[0]) ast_node = AstNode(file_name='prg', loader=loader, search_path=['https://github.com/imodels/simgen/res/ast_test']) assert ast_node is not None assert ast_node.nodetype_name == 'add' assert ast_node.mapping['add'] is not None assert ast_node.mapping['add']['expr1'] is not None assert ast_node.mapping['add']['expr2'] is not None ast_node.validate() def test_render_local(): # create a new offline loader with explicit github url to local directory association res_dir = os.path.join(dirname(__file__), '..', 'res', 'ast_test') loader = Loader() manifest = { 'title': 'adder', 'code_path': [os.path.join(res_dir, 'code')], 'concept_path': [os.path.join(res_dir, 'concepts')], 'template_path': [os.path.join(res_dir, 'templates')] } ast_node = AstNode(file_name='prg', loader=loader, **manifest) renderer = Renderer(loader, **manifest) rendered_code = renderer.render_ast(ast_node) assert rendered_code == '1 + 2 + 3' rendered_code = renderer.render_file('prg') assert rendered_code == '1 + 2 + 3'
mit
Ackara/Plaid.NET
src/Plaid/Management/UpdateAccessTokenVersionRequest.cs
971
using Newtonsoft.Json; namespace Acklann.Plaid.Management { /// <summary> /// Represents a request for plaid's '/item/access_token/update_version' endpoint. If you have an access_token from the legacy version of Plaid’s API, you can use the '/item/access_token/update_version' endpoint to generate an access_token for the Item that works with the current API. /// </summary> /// <seealso cref="Acklann.Plaid.RequestBase" /> /// <remarks> /// Calling this endpoint does not revoke the legacy API access_token. You can still use the legacy access_token in the legacy API environment to retrieve data. You can also begin using the new access_token with our current API immediately. /// </remarks> public class UpdateAccessTokenVersionRequest : RequestBase { /// <summary> /// Gets or sets the access token v1. /// </summary> /// <value>The access token v1.</value> [JsonProperty("access_token_v1")] public string AccessTokenV1 { get; set; } } }
mit
tbuehlmann/hots_api
lib/hots_api/repositories/hero_repository.rb
292
# frozen_string_literal: true module HotsApi module Repositories class HeroRepository < SimpleRepository private def instantiate_record_with(attributes) Models::Hero.new(attributes) end def collection_path 'heroes' end end end end
mit
EliasVansteenkiste/tpar
src/architecture/FourLutSanitizedDisjoint.java
1492
package architecture; public class FourLutSanitizedDisjoint extends FourLutSanitizedAbstract { public FourLutSanitizedDisjoint(int width, int height, int channelWidth, int K, int L) { super(width,height,channelWidth,K,L); } @Override protected void generateSwitchBlocks() { for (int x= 1; x<width+1; x++) { for (int y= 0; y<height+1; y++) { if (x!=1) RouteNode.connect(horizontalChannels[x][y],horizontalChannels[x-1][y]); if (x!=width)RouteNode.connect(horizontalChannels[x][y],horizontalChannels[x+1][y]); if (y!=0){ RouteNode.connect(horizontalChannels[x][y],verticalChannels[x][y]); RouteNode.connect(horizontalChannels[x][y],verticalChannels[x-1][y]); } if (y!=height) { RouteNode.connect(horizontalChannels[x][y],verticalChannels[x][y+1]); RouteNode.connect(horizontalChannels[x][y],verticalChannels[x-1][y+1]); } } } for (int x= 0; x<width+1; x++) { for (int y= 1; y<height+1; y++) { if (y!=1) RouteNode.connect(verticalChannels[x][y],verticalChannels[x][y-1]); if (y!=height)RouteNode.connect(verticalChannels[x][y],verticalChannels[x][y+1]); if (x!=0){ RouteNode.connect(verticalChannels[x][y],horizontalChannels[x][y]); RouteNode.connect(verticalChannels[x][y],horizontalChannels[x][y-1]); } if (x!=width) { RouteNode.connect(verticalChannels[x][y],horizontalChannels[x+1][y]); RouteNode.connect(verticalChannels[x][y],horizontalChannels[x+1][y-1]); } } } } }
mit
Mitali-Sodhi/CodeLingo
Dataset/cpp/NumbersToFile.cpp
1777
// NumbersToFile.cpp (c) Kari Laitinen // http://www.naturalprogramming.com // 2006-06-09 File created. // 2006-06-09 Last modification. // This is the C++ version of corresponding Java/C#/Python // programs. This program is not presented in the C++ book. #include <iostream.h> #include <fstream.h> // C++ classes for file handling. int main() { ofstream file_to_write( "NumbersToFile_output.data", ios::binary ) ; if ( file_to_write.fail() ) { cout << "\n Cannot open NumbersToFile_output.data" ; } else { int integer_to_file = 0x22 ; while ( integer_to_file < 0x77 ) { file_to_write.write( (char*) &integer_to_file, sizeof( int ) ) ; integer_to_file = integer_to_file + 0x11 ; } short short_integer_to_file = 0x1234 ; double double_value_to_file = 1.2345 ; bool boolean_true_to_file = true ; bool boolean_false_to_file = false ; file_to_write.write( (char*) &short_integer_to_file, sizeof( short ) ) ; file_to_write.write( (char*) &double_value_to_file, sizeof( double ) ) ; file_to_write.write( (char*) &boolean_true_to_file, sizeof( bool ) ) ; file_to_write.write( (char*) &boolean_false_to_file, sizeof( bool ) ) ; char c_style_string_to_file[] = "aaAAbbBB" ; int string_length_to_file = strlen( c_style_string_to_file ) ; file_to_write.write( (char*) &string_length_to_file, sizeof( int ) ) ; file_to_write.write( c_style_string_to_file, string_length_to_file ) ; char bytes_to_file[] = { 0x4B, 0x61, 0x72, 0x69 } ; file_to_write.write( bytes_to_file, 4 ) ; } }
mit
CaosSLL/MonopolyServer
src/Caos/MonopolyBundle/Tests/Controller/PosesionTarjetaControllerTest.php
1989
<?php namespace Caos\MonopolyBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class PosesionTarjetaControllerTest extends WebTestCase { /* public function testCompleteScenario() { // Create a new client to browse the application $client = static::createClient(); // Create a new entry in the database $crawler = $client->request('GET', '/posesiontarjeta/'); $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /posesiontarjeta/"); $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); // Fill in the form and submit it $form = $crawler->selectButton('Create')->form(array( 'caos_monopolybundle_posesiontarjetatype[field_name]' => 'Test', // ... other fields to fill )); $client->submit($form); $crawler = $client->followRedirect(); // Check data in the show view $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); // Edit the entity $crawler = $client->click($crawler->selectLink('Edit')->link()); $form = $crawler->selectButton('Edit')->form(array( 'caos_monopolybundle_posesiontarjetatype[field_name]' => 'Foo', // ... other fields to fill )); $client->submit($form); $crawler = $client->followRedirect(); // Check the element contains an attribute with value equals "Foo" $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); // Delete the entity $client->submit($crawler->selectButton('Delete')->form()); $crawler = $client->followRedirect(); // Check the entity has been delete on the list $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); } */ }
mit
ziaochina/mk-demo
apps/mk-app-forgot-password/action.js
5181
import React from 'react' import { action as MetaAction, AppLoader } from 'mk-meta-engine' import { List, fromJS } from 'immutable' import moment from 'moment' import config from './config' class action { constructor(option) { this.metaAction = option.metaAction this.config = config.current this.webapi = this.config.webapi } onInit = ({ component, injections }) => { this.component = component this.injections = injections if (this.component.props.setOkListener) this.component.props.setOkListener(this.onOk) injections.reduce('init') } onOk = async () => { return await this.save() } next = async () => { const form = this.metaAction.gf('data.form').toJS() const ok = await this.check([{ path: 'data.form.mobile', value: form.mobile }, { path: 'data.form.captcha', value: form.captcha }]) if (!ok) return await this.webapi.captcha.validate(form.captcha) this.metaAction.sf('data.other.step', 2) } prev = async () => { this.metaAction.sf('data.other.step', 1) } modify = async () => { const form = this.metaAction.gf('data.form').toJS() const ok = await this.check([{ path: 'data.form.password', value: form.password }, { path: 'data.form.confirmPassword', value: form.confirmPassword }]) if (!ok) return await this.webapi.user.resetPassword({mobile:form.mobile, password: form.password}) this.metaAction.toast('success', `重设密码成功`) this.goLogin() } getLogo = () => this.config.logo getCaptcha = async () => { const captcah = await this.webapi.captcha.fetch() this.metaAction.toast('success', `验证码已经发送到您的手机,请输入[模拟先输入:123456]`) } fieldChange = async (fieldPath, value) => { await this.check([{ path: fieldPath, value }]) } goLogin = () => { if (!this.config.apps['mk-app-login']) { throw '请将这个应用加入到带mk-app-root和mk-app-login的网站中,跳转功能才能正常使用' } if (this.component.props.onRedirect && this.config.goLogin) { this.component.props.onRedirect(this.config.goLogin) } } check = async (fieldPathAndValues) => { if (!fieldPathAndValues) return var checkResults = [] for (var o of fieldPathAndValues) { let r = { ...o } if (o.path == 'data.form.mobile') { Object.assign(r, await this.checkMobile(o.value)) } else if (o.path == 'data.form.captcha') { Object.assign(r, await this.checkCaptcha(o.value)) } else if (o.path == 'data.form.password') { Object.assign(r, await this.checkPassword(o.value)) const confirmPassword = this.metaAction.gf('data.form.confirmPassword') if(confirmPassword) checkResults.push(await this.checkConfirmPassword(confirmPassword, o.value)) } else if (o.path == 'data.form.confirmPassword') { Object.assign(r, await this.checkConfirmPassword(o.value, this.metaAction.gf('data.form.password'))) } checkResults.push(r) } var json = {} var hasError = true checkResults.forEach(o => { json[o.path] = o.value json[o.errorPath] = o.message if (o.message) hasError = false }) this.metaAction.sfs(json) return hasError } checkMobile = async (mobile) => { var message if (!mobile) message = '请录入手机号' else if (!/^1[3|4|5|8][0-9]\d{8}$/.test(mobile)) message = '请录入有效的手机号' else if (await this.webapi.user.existsMobile(mobile) == false) message = '该手机号未注册' return { errorPath: 'data.other.error.mobile', message } } checkCaptcha = async (captcha) => { var message if (!captcha) message = '请录入验证码' return { errorPath: 'data.other.error.captcha', message } } checkPassword = async (password) => { var message if (!password) message = '请录入密码' return { errorPath: 'data.other.error.password', message } } checkConfirmPassword = async (confirmPassword, password) => { var message if (!confirmPassword) message = '请录入确认密码' else if (password != confirmPassword) message = '两次密码输入不一致,请确认' return { errorPath: 'data.other.error.confirmPassword', message } } } export default function creator(option) { const metaAction = new MetaAction(option), o = new action({ ...option, metaAction }), ret = { ...metaAction, ...o } metaAction.config({ metaHandlers: ret }) return ret }
mit
digaoddc/mars-explorer
src/main/java/br/com/explorer/DirectionTest.java
1321
package br.com.explorer; import static org.junit.Assert.*; import org.junit.Test; import junit.framework.Assert; public class DirectionTest { @Test public void turnRightWithNorth() { Direction d = new Direction("N"); d.turnRight(); assertEquals(d.getDirection(), "E"); } @Test public void turnRightWithSouth() { Direction d = new Direction("S"); d.turnRight(); assertEquals(d.getDirection(), "W"); } @Test public void turnRightWithEast() { Direction d = new Direction("E"); d.turnRight(); assertEquals(d.getDirection(), "S"); } @Test public void turnRightWithWest() { Direction d = new Direction("W"); d.turnRight(); assertEquals(d.getDirection(), "N"); } @Test public void turnLeftWithNorth() { Direction d = new Direction("N"); d.TurnLeft(); assertEquals(d.getDirection(), "W"); } @Test public void turnLeftWithSouth() { Direction d = new Direction("S"); d.TurnLeft(); assertEquals(d.getDirection(), "E"); } @Test public void turnLeftWithEast() { Direction d = new Direction("W"); d.TurnLeft(); assertEquals(d.getDirection(), "S"); } @Test public void turnLeftWithWest() { Direction d = new Direction("E"); d.TurnLeft(); assertEquals(d.getDirection(), "N"); } }
mit
igolets/EgorkaGame
Egorka/EgorkaSettings.cs
1926
using System; using System.Configuration; using System.Globalization; namespace EgorkaGame.Egorka { public class EgorkaSettings : ConfigurationSection, IEgorkaSettings { #region Statics #region Properties public static EgorkaSettings Instance { get { // read http://csharpindepth.com/articles/general/singleton.aspx for more info return Lazy.Value; } } #endregion #region Fields private static readonly Lazy<EgorkaSettings> Lazy = new Lazy<EgorkaSettings>(() => (EgorkaSettings)ConfigurationManager.GetSection("egorkaSettings")); #endregion #endregion #region Constructors private EgorkaSettings() { } #endregion #region Public properties [ConfigurationProperty("culture")] public CultureInfo CultureInfo { get { return (CultureInfo)this["culture"]; } set { } } [ConfigurationProperty("IsSpeechEnabled")] public bool IsSpeechEnabled { get { return (bool)this["IsSpeechEnabled"]; } } [ConfigurationProperty("SpeechVolume")] public int SpeechVolume { get { return (int)this["SpeechVolume"]; } } [ConfigurationProperty("SpeechRate")] public int SpeechRate { get { return (int)this["SpeechRate"]; } } [ConfigurationProperty("SpeechIntro")] public string SpeechIntro { get { return (string)this["SpeechIntro"]; } } #endregion } }
mit
yogeshsaroya/new-cdnjs
ajax/libs/mediaelement/2.16.2/mediaelement-and-player.js
131
version https://git-lfs.github.com/spec/v1 oid sha256:2d7da35ecd76ff32118a9697db5103b24014e5ad6eb2efbbb3889651fbf8a3e7 size 155576
mit
mchrzanowski/ProjectEuler
src/python/Problem099.py
789
''' Created on Feb 18, 2012 @author: mchrzanowski ''' from math import log import os.path from time import time def main(): ''' just compare the logs of the numbers.''' start = time() numbersFile = open(os.path.join(os.curdir,'./requiredFiles/Problem099Numbers.txt'), 'r') row = 0 maxRow = 0 maxNumber = 0 # numbers come in rows as : base, exp for line in numbersFile: row += 1 base, exponent = [int(number) for number in line.strip().split(",")] if exponent * log(base) > maxNumber: maxNumber = exponent * log(base) maxRow = row print "Row with max value: ", maxRow end = time() print "Runtime: ", end - start, " seconds." if __name__ == '__main__': main()
mit
bollylu/BLTools
UnitTest2015/Data/TFixedLengthTestRecord.cs
2582
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using BLTools.Data; using BLTools.Data.FixedLength; namespace UnitTest2015 { public class TFixedLengthTestRecord : TFixedLengthRecord { #region Data fields [TDataField(StartPos = 0, Length = 3)] public string SupplierCode { get; set; } [TDataField(StartPos = 3, Length = 15)] public string Name { get; set; } [TDataField(StartPos = 18, Length = 50)] public string Customer { get; set; } [TDataField(StartPos = 68, Length = 6)] public long OrderNumber { get; set; } [TDataField(StartPos = 74, Length = 4)] public int Quantity { get; set; } [TDataField(StartPos = 78, Length = 4, IsSigned = true)] public int NegativeQuantity { get; set; } [TDataField(StartPos = 82, Length = 7, DecimalDigits = 2, DecimalIsVirtual = false, DecimalSeparator = '.')] public float FloatCost { get; set; } [TDataField(StartPos = 89, Length = 7, DecimalDigits = 2, DecimalIsVirtual = true)] public float FloatPrice { get; set; } [TDataField(StartPos = 96, Length = 7, DecimalDigits = 2, DecimalIsVirtual = false, DecimalSeparator = '.')] public double DoubleCost { get; set; } [TDataField(StartPos = 103, Length = 7, DecimalDigits = 2, DecimalIsVirtual = true)] public double DoublePrice { get; set; } [TDataField(StartPos = 110, Length = 7, DecimalDigits = 2, DecimalIsVirtual = false, DecimalSeparator = '.')] public decimal DecimalCost { get; set; } [TDataField(StartPos = 117, Length = 7, DecimalDigits = 2, DecimalIsVirtual = true)] public decimal DecimalPrice { get; set; } [TDataField(StartPos = 124, Length = 1, BoolFormat = EBoolFormat.YOrN)] public bool IsGoodRecord { get; set; } [TDataField(StartPos = 125, Length = 1, BoolFormat = EBoolFormat.TOrF)] public bool IsAuthentic { get; set; } [TDataField(StartPos = 126, Length = 4, BoolFormat = EBoolFormat.Custom, TrueValue = "Good", FalseValue = "Bad ")] public bool GoodOrBad { get; set; } [TDataField(StartPos = 130, Length = 8, DateTimeFormat = EDateTimeFormat.DateOnly)] public DateTime OrderDate { get; set; } [TDataField(StartPos = 138, Length = 8, DateTimeFormat = EDateTimeFormat.Custom, DateTimeFormatCustom = "ddMMyyyy")] public DateTime DeliveryDate { get; set; } [TDataField(StartPos = 146, Length = 2)] public string CRLF { get; private set; } #endregion Data fields public TFixedLengthTestRecord() { CRLF = "\r\n"; } } }
mit
venkatramanm/swf-all
swf-db/src/main/java/com/venky/swf/integration/api/HttpMethod.java
340
package com.venky.swf.integration.api; public enum HttpMethod { GET() { public String toString() { return "GET"; } }, POST(){ public String toString() { return "POST"; } }, PUT() { public String toString() { return "PUT" ; } } }
mit
mbauskar/Das_frappe
frappe/public/js/frappe/ui/field_group.js
2336
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors // MIT License. See license.txt frappe.provide('frappe.ui'); frappe.ui.FieldGroup = frappe.ui.form.Layout.extend({ init: function(opts) { $.extend(this, opts); this._super(); $.each(this.fields || [], function(i, f) { if(!f.fieldname && f.label) { f.fieldname = f.label.replace(/ /g, "_").toLowerCase(); } }) }, make: function() { if(this.fields) { this._super(); this.refresh(); // set default $.each(this.fields_list, function(i, f) { if(f.df["default"]) f.set_input(f.df["default"]); }) if(!this.no_submit_on_enter) { this.catch_enter_as_submit(); } } }, first_button: false, catch_enter_as_submit: function() { var me = this; $(this.body).find('input[type="text"], input[type="password"]').keypress(function(e) { if(e.which==13) { if(me.has_primary_action) { e.preventDefault(); me.get_primary_btn().trigger("click"); } } }); }, get_input: function(fieldname) { var field = this.fields_dict[fieldname]; return $(field.txt ? field.txt : field.input); }, get_field: function(fieldname) { return this.fields_dict[fieldname]; }, get_values: function() { var ret = {}; var errors = []; for(var key in this.fields_dict) { var f = this.fields_dict[key]; if(f.get_parsed_value) { var v = f.get_parsed_value(); if(f.df.reqd && !v) errors.push('- ' + __(f.df.label) + "<br>"); if(v) ret[f.df.fieldname] = v; } } if(errors.length) { msgprint($.format('<i class="icon-warning-sign"></i>\ <b>{0}</b>:\ <br/><br/>\ {1}', [__('Missing Values Required'), errors.join('\n')])); return null; } return ret; }, get_value: function(key) { var f = this.fields_dict[key]; return f && (f.get_parsed_value ? f.get_parsed_value() : null); }, set_value: function(key, val){ var f = this.fields_dict[key]; if(f) { f.set_input(val); } }, set_input: function(key, val) { return this.set_value(key, val); }, set_values: function(dict) { for(var key in dict) { if(this.fields_dict[key]) { this.set_value(key, dict[key]); } } }, clear: function() { for(key in this.fields_dict) { var f = this.fields_dict[key]; if(f) { f.set_input(f.df['default'] || ''); } } }, });
mit
globexdesigns/brackets-jsxhint
test/test.js
3281
/** @jsx React.DOM */ /* global require, module */ var React = require('react'); var classSet = require('./utils/classSet'); var cloneWithProps = require('./utils/cloneWithProps'); var createChainedFunction = require('./utils/createChainedFunction'); var BootstrapMixin = require('./BootstrapMixin'); var DropdownStateMixin = require('./DropdownStateMixin'); var Button = require('./Button'); var ButtonGroup = require('./ButtonGroup'); var DropdownMenu = require('./DropdownMenu'); var ValidComponentChildren = require('./utils/ValidComponentChildren'); var DropdownButton = React.createClass({ mixins: [BootstrapMixin, DropdownStateMixin], propTypes: { pullRight: React.PropTypes.bool, dropup: React.PropTypes.bool, title: React.PropTypes.renderable, href: React.PropTypes.string, onClick: React.PropTypes.func, onSelect: React.PropTypes.func, navItem: React.PropTypes.bool }, render: function () { var className = 'dropdown-toggle'; var renderMethod = this.props.navItem ? 'renderNavItem' : 'renderButtonGroup'; return this[renderMethod]([ this.transferPropsTo(<Button ref="dropdownButton" className={className} onClick={this.handleDropdownClick} key={0} navDropdown={this.props.navItem} navItem={null} title={null} pullRight={null} dropup={null}> {this.props.title}{' '} <span className="caret" /> </Button>), <DropdownMenu ref="menu" aria-labelledby={this.props.id} pullRight={this.props.pullRight} key={1}> {ValidComponentChildren.map(this.props.children, this.renderMenuItem)} </DropdownMenu> ]); }, renderButtonGroup: function (children) { var groupClasses = { 'open': this.state.open, 'dropup': this.props.dropup }; return ( <ButtonGroup bsSize={this.props.bsSize} className={classSet(groupClasses)}> {children} </ButtonGroup> ); }, renderNavItem: function (children) { var classes = { 'dropdown': true, 'open': this.state.open, 'dropup': this.props.dropup }; return ( <li className={classSet(classes)}> {children} </li> ); }, renderMenuItem: function (child) { // Only handle the option selection if an onSelect prop has been set on the // component or it's child, this allows a user not to pass an onSelect // handler and have the browser preform the default action. var handleOptionSelect = this.props.onSelect || child.props.onSelect ? this.handleOptionSelect : null; return cloneWithProps( child, { // Capture onSelect events onSelect: createChainedFunction(child.props.onSelect, handleOptionSelect), // Force special props to be transferred key: child.props.key, ref: child.props.ref } ); }, handleDropdownClick: function (e) { e.preventDefault(); this.setDropdownState(!this.state.open); }, handleOptionSelect: function (key) { if (this.props.onSelect) { this.props.onSelect(key); } this.setDropdownState(false); } }); module.exports = DropdownButton;
mit
yogijoshi/yj-perfect-gem-working
test/test_helper.rb
243
require 'rubygems' require 'test/unit' require 'shoulda' $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'yj-perfect-gem-working' class Test::Unit::TestCase end
mit
sasyomaru/advanced-javascript-training-material
module2/scripts/05-performance-tuning.js
1500
"use strict"; (function() { console.log('-------------------------Example on performance tuning-------------------------'); function A50square() { var totalCount = 50; for(var index = 0; index < totalCount; index++) { for(var index2 = 0; index2 < totalCount; index2++) { } } } function A10square() { var totalCount = 10; for(var index = 0; index < totalCount; index++) { for(var index2 = 0; index2 < totalCount; index2++) { } } } function A500square() { var totalCount = 500; for(var index = 0; index < totalCount; index++) { for(var index2 = 0; index2 < totalCount; index2++) { } } } function A5000square() { var totalCount = 5000; for(var index = 0; index < totalCount; index++) { for(var index2 = 0; index2 < totalCount; index2++) { } } } var functionArrays = [A500square, A10square, A50square, A5000square]; var functionTitles = ['500', '10', '50', '5000']; var totalFunctionRuns = 30; for(var index = 0; index < totalFunctionRuns; index++) { var funcIndex = Math.floor(Math.random() * functionArrays.length); console.log('Start function: ' + functionTitles[funcIndex]); functionArrays[funcIndex](); console.log('Finish function run: ' + (index + 1)); } console.log('All functions finish successfully!'); })();
mit
JeremyAnsel/helix-toolkit
Source/HelixToolkit.Wpf.SharpDX.Tests/Elements3D/CrossSectionMeshGeometryModel3DTests.cs
3534
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="MeshGeometryModel3DTests.cs" company="Helix Toolkit"> // Copyright (c) 2020 Helix Toolkit contributors // </copyright> // -------------------------------------------------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Threading; using NUnit.Framework; using SharpDX; namespace HelixToolkit.Wpf.SharpDX.Tests.Elements3D { [TestFixture] [Apartment(ApartmentState.STA)] class CrossSectionMeshGeometryModel3DTests { private readonly Viewport3DX viewport = new Viewport3DX(); private CrossSectionMeshGeometryModel3D GetGeometryModel3D() { var meshBuilder = new MeshBuilder(); meshBuilder.AddBox(new Vector3(0f), 1, 1, 1); return new CrossSectionMeshGeometryModel3D() { Geometry = meshBuilder.ToMesh(), }; } [Test] public void HitTestShouldReturnOnePointOnFrontOfCubeWithNoCuttingPlanes() { var ray = new Ray(new Vector3(2f, 0f, 0f), new Vector3(-1, 0, 0)); var hits = new List<HitTestResult>(); var geometryModel3D = GetGeometryModel3D(); geometryModel3D.HitTest(viewport.RenderContext, ray, ref hits); Assert.AreEqual(1,hits.Count); Assert.AreEqual(new Vector3(0.5f,0,0), hits[0].PointHit); } [TestCaseSource(nameof(GetPlanes))] public void HitTestShouldReturnOnePointOnBackOfCubeWithCuttingPlaneInXZero(Action<CrossSectionMeshGeometryModel3D, Plane> setupPlane) { var plane = new Plane(new Vector3(0f),new Vector3(-1,0,0)); var geometryModel3D = GetGeometryModel3D(); setupPlane(geometryModel3D, plane); var ray = new Ray(new Vector3(2f, 0f, 0f), new Vector3(-1, 0, 0)); var hits = new List<HitTestResult>(); geometryModel3D.HitTest(viewport.RenderContext, ray, ref hits); Assert.AreEqual(1, hits.Count); Assert.AreEqual(new Vector3(-0.5f, 0, 0), hits[0].PointHit); } /// <summary> /// Get all planes in the CrossSectionMeshGeometryModel3D with reflection so that if more planes are added tests will fail /// </summary> public static IEnumerable<object[]> GetPlanes() { var properties = typeof(CrossSectionMeshGeometryModel3D) .GetProperties(BindingFlags.Instance | BindingFlags.Public); var enables = properties .Where(p => p.Name.StartsWith("EnablePlane", StringComparison.InvariantCulture)) .ToArray(); var planes = properties .Where(p => p.Name.StartsWith("Plane", StringComparison.InvariantCulture)) .ToArray(); for (int i = 0; i < enables.Length; i++) { var planeProperty = planes[i]; var enableProperty = enables[i]; void Action(CrossSectionMeshGeometryModel3D model, Plane plane) { planeProperty.SetValue(model, plane); enableProperty.SetValue(model, true); } yield return new object[]{(Action<CrossSectionMeshGeometryModel3D, Plane>) Action}; } } } }
mit
nerdstrap/IncomePerspectives
app/components/bsHas/bsProcessValidator.service.js
616
'use strict'; function bsProcessValidator($timeout) { return function (scope, element, ngClass, bsClass) { $timeout(function () { var input = element.find('input'); if (!input.length) { input = element.find('select'); } if (!input.length) { input = element.find('textarea'); } if (input.length) { scope.$watch(function () { return input.hasClass(ngClass) && input.hasClass('ng-dirty'); }, function (isValid) { element.toggleClass(bsClass, isValid); }); } }); }; } var app = angular.module('ip.bsHas'); app.factory('bsProcessValidator', bsProcessValidator);
mit
axross/camelot
src/entities/mocks/blogPostMocks.js
2045
import BlogPost from '../BlogPost'; import { MOCK_JSON_1 as TAG_MOCK_JSON_1, MOCK_JSON_2 as TAG_MOCK_JSON_2, MOCK_JSON_3 as TAG_MOCK_JSON_3, } from './tagMocks'; export const MOCK_JSON_1 = { id: 1, slug: 'lorem-ipsum', title: 'Lorem Ipsum', markdown: 'Lorem Ipsum', thumbnailImageURL: 'http://i.imgur.com/RR0nk2L.jpg', isFeatured: false, publishedAt: '2016-06-17T12:34:56.789Z', tags: [ TAG_MOCK_JSON_1, TAG_MOCK_JSON_2, ], }; export const MOCK_JSON_2 = { id: 2, slug: 'dolor-sit-amet', title: 'Dolor sit amet', markdown: 'Dolor sit amet', thumbnailImageURL: 'http://i.imgur.com/PeE9fKb.gif', isFeatured: true, publishedAt: '2016-06-19T12:34:56.789Z', tags: [ TAG_MOCK_JSON_1, TAG_MOCK_JSON_3, ], }; export const MOCK_JSON_3 = { id: 1, slug: 'consectetur-adipiscing', title: 'Consectetur adipiscing', markdown: 'Consectetur adipiscing', thumbnailImageURL: 'http://i.imgur.com/FFf191F.gif', isFeatured: false, publishedAt: '2016-06-21T12:34:56.789Z', tags: [ TAG_MOCK_JSON_2, TAG_MOCK_JSON_3, ], }; export const MOCK_GHOST_API_JSON_1 = Object.assign({}, MOCK_JSON_1, { image: '/RR0nk2L.jpg', featured: MOCK_JSON_1.isFeatured, published_at: MOCK_JSON_1.publishedAt, thumbnailImageURL: undefined, isFeatured: undefined, publishedAt: undefined, }); export const MOCK_GHOST_API_JSON_2 = Object.assign({}, MOCK_JSON_2, { image: 'http://i.imgur.com/PeE9fKb.gif', featured: MOCK_JSON_2.isFeatured, published_at: MOCK_JSON_2.publishedAt, thumbnailImageURL: undefined, isFeatured: undefined, publishedAt: undefined, }); export const MOCK_GHOST_API_JSON_3 = Object.assign({}, MOCK_JSON_3, { image: 'FFf191F.gif', featured: MOCK_JSON_3.isFeatured, published_at: MOCK_JSON_3.publishedAt, thumbnailImageURL: undefined, isFeatured: undefined, publishedAt: undefined, }); export const MOCK_1 = BlogPost.fromJSON(MOCK_JSON_1); export const MOCK_2 = BlogPost.fromJSON(MOCK_JSON_2); export const MOCK_3 = BlogPost.fromJSON(MOCK_JSON_3);
mit
yriveiro/psr-7
src/Request.php
237
<?php namespace yriveiro\Psr7; use yriveiro\Psr7\Traits\MessageTrait; use yriveiro\Psr7\Headers; class Request { use MessageTrait; public function __construct(Headers $headers) { $this->headers = $headers; } }
mit
danibonilla1/SpaceInvaders
SpaceInvaders/src/com/dani/main/level/RandomLevel.java
2061
package com.dani.main.level; import java.util.ArrayList; import java.util.Random; import com.dani.main.Main; import com.dani.main.Sprite.Sprite; import com.dani.main.entity.mob.Player; import com.dani.main.entity.mob.Rock; import com.dani.main.gfx.Screen; public class RandomLevel extends Level { private int difficulty = 20; private double Counter = 0; public static final Random random = new Random(); private ArrayList<Rock> asteroid = new ArrayList<Rock>(); public int count = 0; public int life = 50; public RandomLevel(int width, int height) { super(width, height); } public void generate() { for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { tiles[x + y * width] = random.nextInt(4); } } } public void update(int xScroll, int yScroll, Player player) { Counter += Main.Delta; if (Counter > difficulty) { Counter = 0; asteroid.add(new Rock(xScroll + random.nextInt(Main.width) , yScroll)); } for(Rock r : asteroid){ if( r.y > Main.height + yScroll + Sprite.rock.SIZE){ if(r.y > Main.height + yScroll + Sprite.rock.SIZE) life--; asteroid.remove(r); break; } if(r.collision(player, r)){ asteroid.remove(r); count++; break; } r.update(); } //Check collision if(count%10 == 0 && count != 0){ difficulty--; count++; } } public void render(int xScroll, int yScroll, Screen screen) { screen.setOffset(xScroll, yScroll); int x0 = xScroll >> 4; int x1 = (xScroll + screen.width + Sprite.voidSprite.SIZE) >> 4; int y0 = yScroll >> 4; int y1 = (yScroll + screen.height + Sprite.voidSprite.SIZE) >> 4; for (int x = x0; x < x1; x++) { for (int y = y0; y < y1; y++) { getTile(x, y).render(x, y, screen); } } for(Rock r: asteroid){ if(r.x < xScroll-Sprite.rock.SIZE || r.x > screen.width + xScroll || r.y < yScroll || r.y > screen.height + yScroll) continue; else r.render(screen); } } public String getCount(){ return "" + count; } public String getLife() { return "" + life; } }
mit
justinfx/openimageigo
oiio.cpp
41
extern "C" { #include "_cgo_export.h" }
mit
AmbitiousOkie/microscope
client/templates/posts/posts.list.js
178
Template.postsList.helpers({ posts: function() { return Posts.find({}, { sort: { submitted: -1 } }); } });
mit
wudimeicom/WudimeiPHP
Config.php
997
<?php /** * @author yangqingrong@wudimei.com * @copyright yangqingrong@wudimei.com * @link http://www.wudimei.com * @license The MIT license(MIT) */ namespace Wudimei; class Config{ public $dir; public $data; public function setDir( $dir ){ $this->dir = $dir; } public function get( $keys ){ $arr = explode(".", $keys); $sectionName = $arr[0]; $this->load($sectionName); //print_r( $this->data); return ArrayHelper::fetch( $this->data, $keys); } public function load( $sectionName ){ if( !isset($this->data[ $sectionName] )){ $file = $this->dir . "/" . $sectionName . ".php"; $this->data[ $sectionName] = []; if( file_exists( $file)){ $this->data[ $sectionName] = include $file; } } } public function set( $keys , $value ){ $arr = explode(".", $keys); $sectionName = $arr[0]; $this->load($sectionName); ArrayHelper::set( $this->data, $keys, $value); //print_r( $this->data ); } }
mit
daniboomerang/daniboomerang
server/config/routes.js
155
'use strict'; //var path = require('path'); module.exports = function(app) { app.get('/*', function(req, res) { res.render('index.html'); }); }
mit
sda97ghb/LearnWords
app/src/main/java/com/divanoapps/learnwords/data/mappers/Mapper.java
232
package com.divanoapps.learnwords.data.mappers; /** * Created by dmitry on 29.04.18. */ public interface Mapper<TStorage, TApi> { TApi mapStorageToApi(TStorage storageObject); TStorage mapApiToStorage(TApi apiObject); }
mit
Highwinds/CDNWS-examples
modify_policies/modify_policies.py
1570
import getpass import requests import os import sys import json STRIKETRACKER_URL = os.environ['STRIKETRACKER_URL'] if 'STRIKETRACKER_URL' in os.environ else 'https://striketracker.highwinds.com' if len(sys.argv) != 4: print "Usage: python modify_policies.py [account_hash] [host_hash] [scope_id]" sys.exit() PARENT_ACCOUNT = sys.argv[1] HOST = sys.argv[2] # Host hash SCOPE_ID = sys.argv[3] # Scope id which you want to edit OAUTH_TOKEN = os.environ['STRIKETRACKER_TOKEN'] configuration = { "dynamicContent": { "queryParams": "start,end" }, "compression": { "gzip": "css,html" } } # Add policies host_response = requests.put( STRIKETRACKER_URL + "/api/accounts/{accountHash}/hosts/{host}/configuration/{scope}".format( accountHash=PARENT_ACCOUNT, host=HOST, scope=SCOPE_ID ), headers={"Authorization": "Bearer %s" % OAUTH_TOKEN, "Content-Type": "application/json"}, data=json.dumps(configuration)) host = host_response.json() json.dump(host, sys.stdout, indent=4, separators=(',', ': ')) print "" # Delete compression policy host_response = requests.put( STRIKETRACKER_URL + "/api/accounts/{accountHash}/hosts/{host}/configuration/{scope}".format( accountHash=PARENT_ACCOUNT, host=HOST, scope=SCOPE_ID ), headers={"Authorization": "Bearer %s" % OAUTH_TOKEN, "Content-Type": "application/json"}, data=json.dumps({ "compression": {} })) host = host_response.json() json.dump(host, sys.stdout, indent=4, separators=(',', ': ')) print ""
mit
Bareflank/hypervisor
example/nested_paging/x64/amd/nested_page_table_t.hpp
32292
/// @copyright /// Copyright (C) 2020 Assured Information Security, Inc. /// /// @copyright /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: /// /// @copyright /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. /// /// @copyright /// 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. #ifndef NESTED_PAGE_TABLE_T_HPP #define NESTED_PAGE_TABLE_T_HPP #include "npdpt_t.hpp" #include "npdpte_t.hpp" #include "npdt_t.hpp" #include "npdte_t.hpp" #include "npml4t_t.hpp" #include "npml4te_t.hpp" #include "npt_t.hpp" #include "npte_t.hpp" #include <lock_guard.hpp> #include <map_page_flags.hpp> #include <memory_type.hpp> #include <page_pool_t.hpp> #include <spinlock.hpp> #include <bsl/convert.hpp> #include <bsl/debug.hpp> #include <bsl/errc_type.hpp> #include <bsl/finally.hpp> #include <bsl/safe_integral.hpp> #include <bsl/touch.hpp> #include <bsl/unlikely.hpp> namespace example { /// <!-- description --> /// @brief Implements the nested pages tables used by the extension /// for mapping guest physical memory. /// class nested_page_table_t final { /// @brief stores true if initialized() has been executed bool m_initialized{}; /// @brief stores a reference to the page pool to use page_pool_t *m_page_pool{}; /// @brief stores a pointer to the npml4t npml4t_t *m_npml4t{}; /// @brief stores the physical address of the npml4t bsl::safe_umx m_npml4t_phys{bsl::safe_umx::failure()}; /// @brief safe guards operations on the NPT. mutable spinlock m_npt_lock{}; /// <!-- description --> /// @brief Returns the nested page-map level-4 (NPML4T) offset given /// a guest physical address. /// /// <!-- inputs/outputs --> /// @param gpa the guest physical address to get the NPML4T offset from. /// @return the NPML4T offset from the guest physical address /// [[nodiscard]] static constexpr auto npml4to(bsl::safe_umx const &gpa) noexcept -> bsl::safe_umx { constexpr bsl::safe_umx mask{bsl::to_umx(0x1FF)}; constexpr bsl::safe_umx shift{bsl::to_umx(39)}; return (gpa >> shift) & mask; } /// <!-- description --> /// @brief Adds a npdpt_t to the provided npml4te_t. /// /// <!-- inputs/outputs --> /// @param npml4te the npml4te_t to add a npdpt_t too /// @return Returns bsl::errc_success on success, bsl::errc_failure /// and friends otherwise /// [[nodiscard]] constexpr auto add_npdpt(npml4te_t *const npml4te) noexcept -> bsl::errc_type { auto const *const table{m_page_pool->template allocate<void>()}; if (bsl::unlikely(nullptr == table)) { bsl::print<bsl::V>() << bsl::here(); return bsl::errc_failure; } auto const table_phys{m_page_pool->virt_to_phys(table)}; if (bsl::unlikely(!table_phys)) { bsl::print<bsl::V>() << bsl::here(); return bsl::errc_failure; } npml4te->phys = (table_phys >> bsl::to_umx(HYPERVISOR_PAGE_SHIFT)).get(); npml4te->p = bsl::ONE_UMAX.get(); npml4te->rw = bsl::ONE_UMAX.get(); npml4te->us = bsl::ONE_UMAX.get(); return bsl::errc_success; } /// <!-- description --> /// @brief Adds a npdpt_t to the provided npml4te_t. /// /// <!-- inputs/outputs --> /// @param npml4te the npml4te_t to add a npdpt_t too /// constexpr void remove_npdpt(npml4te_t *const npml4te) noexcept { for (auto const elem : get_npdpt(npml4te)->entries) { if (elem.data->p != bsl::ZERO_UMAX) { this->remove_npdt(elem.data); } else { bsl::touch(); } } m_page_pool->deallocate(get_npdpt(npml4te)); } /// <!-- description --> /// @brief Returns the npdpt_t associated with the provided /// npml4te_t. /// /// <!-- inputs/outputs --> /// @param npml4te the npml4te_t to get the npdpt_t from /// @return A pointer to the requested npdpt_t /// [[nodiscard]] constexpr auto get_npdpt(npml4te_t *const npml4te) noexcept -> npdpt_t * { bsl::safe_umx entry_phys{npml4te->phys}; entry_phys <<= bsl::to_umx(HYPERVISOR_PAGE_SHIFT); return m_page_pool->template phys_to_virt<npdpt_t>(entry_phys); } /// <!-- description --> /// @brief Returns the npdpt_t associated with the provided /// npml4te_t. /// /// <!-- inputs/outputs --> /// @param npml4te the npml4te_t to get the npdpt_t from /// @return A pointer to the requested npdpt_t /// [[nodiscard]] constexpr auto get_npdpt(npml4te_t const *const npml4te) const noexcept -> npdpt_t const * { bsl::safe_umx entry_phys{npml4te->phys}; entry_phys <<= bsl::to_umx(HYPERVISOR_PAGE_SHIFT); return m_page_pool->template phys_to_virt<npdpt_t const>(entry_phys); } /// <!-- description --> /// @brief Returns the nested page-directory-pointer table (NPDPT) /// offset given a guest physical address. /// /// <!-- inputs/outputs --> /// @param gpa the guest physical address to get the NPDPT offset from. /// @return the NPDPT offset from the guest physical address /// [[nodiscard]] static constexpr auto npdpto(bsl::safe_umx const &gpa) noexcept -> bsl::safe_umx { constexpr bsl::safe_umx mask{bsl::to_umx(0x1FF)}; constexpr bsl::safe_umx shift{bsl::to_umx(30)}; return (gpa >> shift) & mask; } /// <!-- description --> /// @brief Adds a npdt_t to the provided npdpte_t. /// /// <!-- inputs/outputs --> /// @param npdpte the npdpte_t to add a npdt_t too /// @return Returns bsl::errc_success on success, bsl::errc_failure /// and friends otherwise /// [[nodiscard]] constexpr auto add_npdt(npdpte_t *const npdpte) noexcept -> bsl::errc_type { auto const *const table{m_page_pool->template allocate<void>()}; if (bsl::unlikely(nullptr == table)) { bsl::print<bsl::V>() << bsl::here(); return bsl::errc_failure; } auto const table_phys{m_page_pool->virt_to_phys(table)}; if (bsl::unlikely(!table_phys)) { bsl::print<bsl::V>() << bsl::here(); return bsl::errc_failure; } npdpte->phys = (table_phys >> bsl::to_umx(HYPERVISOR_PAGE_SHIFT)).get(); npdpte->p = bsl::ONE_UMAX.get(); npdpte->rw = bsl::ONE_UMAX.get(); npdpte->us = bsl::ONE_UMAX.get(); return bsl::errc_success; } /// <!-- description --> /// @brief Adds a npdt_t to the provided npdpte_t. /// /// <!-- inputs/outputs --> /// @param npdpte the npdpte_t to add a npdt_t too /// constexpr void remove_npdt(npdpte_t *const npdpte) noexcept { for (auto const elem : get_npdt(npdpte)->entries) { if (elem.data->p != bsl::ZERO_UMAX) { this->remove_npt(elem.data); } else { bsl::touch(); } } m_page_pool->deallocate(get_npdt(npdpte)); } /// <!-- description --> /// @brief Returns the npdt_t associated with the provided /// npdpte_t. /// /// <!-- inputs/outputs --> /// @param npdpte the npdpte_t to get the npdt_t from /// @return A pointer to the requested npdt_t /// [[nodiscard]] constexpr auto get_npdt(npdpte_t *const npdpte) noexcept -> npdt_t * { bsl::safe_umx entry_phys{npdpte->phys}; entry_phys <<= bsl::to_umx(HYPERVISOR_PAGE_SHIFT); return m_page_pool->template phys_to_virt<npdt_t>(entry_phys); } /// <!-- description --> /// @brief Returns the npdt_t associated with the provided /// npdpte_t. /// /// <!-- inputs/outputs --> /// @param npdpte the npdpte_t to get the npdt_t from /// @return A pointer to the requested npdt_t /// [[nodiscard]] constexpr auto get_npdt(npdpte_t const *const npdpte) const noexcept -> npdt_t const * { bsl::safe_umx entry_phys{npdpte->phys}; entry_phys <<= bsl::to_umx(HYPERVISOR_PAGE_SHIFT); return m_page_pool->template phys_to_virt<npdt_t const>(entry_phys); } /// <!-- description --> /// @brief Returns the nested page-directory table (NPDT) offset /// given a guest physical address. /// /// <!-- inputs/outputs --> /// @param gpa the guest physical address to get the NPDT offset from. /// @return the NPDT offset from the guest physical address. /// [[nodiscard]] static constexpr auto npdto(bsl::safe_umx const &gpa) noexcept -> bsl::safe_umx { constexpr bsl::safe_umx mask{bsl::to_umx(0x1FF)}; constexpr bsl::safe_umx shift{bsl::to_umx(21)}; return (gpa >> shift) & mask; } /// <!-- description --> /// @brief Adds a npt_t to the provided npdte_t. /// /// <!-- inputs/outputs --> /// @param npdte the npdte_t to add a npt_t too /// @return Returns bsl::errc_success on success, bsl::errc_failure /// and friends otherwise /// [[nodiscard]] constexpr auto add_npt(npdte_t *const npdte) noexcept -> bsl::errc_type { auto const *const table{m_page_pool->template allocate<void>()}; if (bsl::unlikely(nullptr == table)) { bsl::print<bsl::V>() << bsl::here(); return bsl::errc_failure; } auto const table_phys{m_page_pool->virt_to_phys(table)}; if (bsl::unlikely(!table_phys)) { bsl::print<bsl::V>() << bsl::here(); return bsl::errc_failure; } npdte->phys = (table_phys >> bsl::to_umx(HYPERVISOR_PAGE_SHIFT)).get(); npdte->p = bsl::ONE_UMAX.get(); npdte->rw = bsl::ONE_UMAX.get(); npdte->us = bsl::ONE_UMAX.get(); return bsl::errc_success; } /// <!-- description --> /// @brief Adds a npt_t to the provided npdte_t. /// /// <!-- inputs/outputs --> /// @param npdte the npdte_t to add a npt_t too /// constexpr void remove_npt(npdte_t *const npdte) noexcept { m_page_pool->deallocate(get_npt(npdte)); } /// <!-- description --> /// @brief Returns the npt_t associated with the provided /// npdte_t. /// /// <!-- inputs/outputs --> /// @param npdte the npdte_t to get the npt_t from /// @return A pointer to the requested npt_t /// [[nodiscard]] constexpr auto get_npt(npdte_t *const npdte) noexcept -> npt_t * { bsl::safe_umx entry_phys{npdte->phys}; entry_phys <<= bsl::to_umx(HYPERVISOR_PAGE_SHIFT); return m_page_pool->template phys_to_virt<npt_t>(entry_phys); } /// <!-- description --> /// @brief Returns the npt_t associated with the provided /// npdte_t. /// /// <!-- inputs/outputs --> /// @param npdte the npdte_t to get the npt_t from /// @return A pointer to the requested npt_t /// [[nodiscard]] constexpr auto get_npt(npdte_t const *const npdte) const noexcept -> npt_t const * { bsl::safe_umx entry_phys{npdte->phys}; entry_phys <<= bsl::to_umx(HYPERVISOR_PAGE_SHIFT); return m_page_pool->template phys_to_virt<npt_t const>(entry_phys); } /// <!-- description --> /// @brief Returns the page-table (NPT) offset given a /// guest physical address. /// /// <!-- inputs/outputs --> /// @param gpa the guest physical address to get the NPT offset from. /// @return the NPT offset from the guest physical address /// [[nodiscard]] static constexpr auto npto(bsl::safe_umx const &gpa) noexcept -> bsl::safe_umx { constexpr bsl::safe_umx mask{bsl::to_umx(0x1FF)}; constexpr bsl::safe_umx shift{bsl::to_umx(12)}; return (gpa >> shift) & mask; } /// <!-- description --> /// @brief Returns true if the provided address is page aligned /// /// <!-- inputs/outputs --> /// @param addr the address to query /// @return Returns true if the provided address is page aligned /// [[nodiscard]] static constexpr auto is_page_aligned(bsl::safe_umx const &addr) noexcept -> bool { return (addr & (bsl::to_umx(HYPERVISOR_PAGE_SIZE) - bsl::ONE_UMAX)) == bsl::ZERO_UMAX; } /// <!-- description --> /// @brief Releases the memory allocated in this root page table /// constexpr void auto_release() noexcept { if (bsl::unlikely(nullptr == m_npml4t)) { return; } if (bsl::unlikely(nullptr == m_page_pool)) { return; } for (auto const elem : m_npml4t->entries) { if (elem.data->p == bsl::ZERO_UMAX) { continue; } this->remove_npdpt(elem.data); } m_page_pool->deallocate(m_npml4t); m_npml4t = {}; m_npml4t_phys = bsl::safe_umx::failure(); } public: /// <!-- description --> /// @brief Initializes this nested_page_table_t /// /// <!-- inputs/outputs --> /// @param page_pool the page pool to use /// @return Returns bsl::errc_success on success, bsl::errc_failure /// and friends otherwise /// [[nodiscard]] constexpr auto initialize(page_pool_t *const page_pool) noexcept -> bsl::errc_type { if (bsl::unlikely(m_initialized)) { bsl::error() << "nested_page_table_t already initialized\n" << bsl::here(); return bsl::errc_failure; } bsl::finally release_on_error{[this]() noexcept -> void { this->release(); }}; m_page_pool = page_pool; if (bsl::unlikely(nullptr == page_pool)) { bsl::error() << "invalid page_pool\n" << bsl::here(); return bsl::errc_failure; } m_npml4t = m_page_pool->template allocate<npml4t_t>(); if (bsl::unlikely(nullptr == m_npml4t)) { bsl::print<bsl::V>() << bsl::here(); return bsl::errc_failure; } m_npml4t_phys = m_page_pool->virt_to_phys(m_npml4t); if (bsl::unlikely(!m_npml4t_phys)) { bsl::print<bsl::V>() << bsl::here(); return bsl::errc_failure; } release_on_error.ignore(); m_initialized = true; return bsl::errc_success; } /// <!-- description --> /// @brief Releases the memory allocated in this nested page tables /// constexpr void release() noexcept { this->auto_release(); m_page_pool = {}; m_initialized = false; } /// <!-- description --> /// @brief Returns the physical address of the PML4 /// /// <!-- inputs/outputs --> /// @return Returns the physical address of the PML4 /// [[nodiscard]] constexpr auto phys() const noexcept -> bsl::safe_umx const & { return m_npml4t_phys; } /// <!-- description --> /// @brief Maps a 4k page into the nested page tables being managed /// by this class. /// /// <!-- inputs/outputs --> /// @param page_gpa the guest physical address to map the system /// physical address to /// @param page_spa the system physical address to map. /// @param page_flags defines how memory should be mapped /// @param page_type defines the memory type for the mapping /// @return Returns bsl::errc_success on success, bsl::errc_failure /// and friends otherwise /// [[nodiscard]] constexpr auto map_4k_page( bsl::safe_umx const &page_gpa, bsl::safe_umx const &page_spa, bsl::safe_umx const &page_flags, bsl::safe_umx const &page_type) noexcept -> bsl::errc_type { lock_guard lock{m_npt_lock}; if (bsl::unlikely(!m_initialized)) { bsl::error() << "nested_page_table_t not initialized\n" << bsl::here(); return bsl::errc_failure; } if (bsl::unlikely(!page_gpa)) { bsl::error() << "guest physical address is invalid: " // -- << bsl::hex(page_gpa) // -- << bsl::endl // -- << bsl::here(); // -- return bsl::errc_failure; } if (bsl::unlikely(!this->is_page_aligned(page_gpa))) { bsl::error() << "guest physical address is not page aligned: " // -- << bsl::hex(page_gpa) // -- << bsl::endl // -- << bsl::here(); // -- return bsl::errc_failure; } if (bsl::unlikely(!page_spa)) { bsl::error() << "system physical address is invalid: " // -- << bsl::hex(page_spa) // -- << bsl::endl // -- << bsl::here(); // -- return bsl::errc_failure; } if (bsl::unlikely(!this->is_page_aligned(page_spa))) { bsl::error() << "system physical address is not page aligned: " // -- << bsl::hex(page_spa) // -- << bsl::endl // -- << bsl::here(); // -- return bsl::errc_failure; } if (bsl::unlikely(!page_flags)) { bsl::error() << "invalid flags: " // -- << bsl::hex(page_flags) // -- << bsl::endl // -- << bsl::here(); // -- return bsl::errc_failure; } if (bsl::unlikely(!page_type)) { bsl::error() << "invalid flags: " // -- << bsl::hex(page_type) // -- << bsl::endl // -- << bsl::here(); // -- return bsl::errc_failure; } if (bsl::unlikely(page_type == MEMORY_TYPE_WC)) { bsl::error() << "invalid flags: " // -- << bsl::hex(page_flags) // -- << bsl::endl // -- << bsl::here(); // -- return bsl::errc_failure; } if (bsl::unlikely(page_type == MEMORY_TYPE_WT)) { bsl::error() << "invalid flags: " // -- << bsl::hex(page_flags) // -- << bsl::endl // -- << bsl::here(); // -- return bsl::errc_failure; } if (bsl::unlikely(page_type == MEMORY_TYPE_WP)) { bsl::error() << "invalid flags: " // -- << bsl::hex(page_flags) // -- << bsl::endl // -- << bsl::here(); // -- return bsl::errc_failure; } auto *const npml4te{m_npml4t->entries.at_if(this->npml4to(page_gpa))}; if (npml4te->p == bsl::ZERO_UMAX) { if (bsl::unlikely(!this->add_npdpt(npml4te))) { bsl::print<bsl::V>() << bsl::here(); return bsl::errc_failure; } bsl::touch(); } else { bsl::touch(); } auto *const npdpt{this->get_npdpt(npml4te)}; auto *const npdpte{npdpt->entries.at_if(this->npdpto(page_gpa))}; if (npdpte->p == bsl::ZERO_UMAX) { if (bsl::unlikely(!this->add_npdt(npdpte))) { bsl::print<bsl::V>() << bsl::here(); return bsl::errc_failure; } bsl::touch(); } else { bsl::touch(); } auto *const npdt{this->get_npdt(npdpte)}; auto *const npdte{npdt->entries.at_if(this->npdto(page_gpa))}; if (npdte->p == bsl::ZERO_UMAX) { if (bsl::unlikely(!this->add_npt(npdte))) { bsl::print<bsl::V>() << bsl::here(); return bsl::errc_failure; } bsl::touch(); } else { bsl::touch(); } auto *const npt{this->get_npt(npdte)}; auto *const npte{npt->entries.at_if(this->npto(page_gpa))}; if (bsl::unlikely(npte->p != bsl::ZERO_UMAX)) { bsl::error() << "guest physical address " // -- << bsl::hex(page_gpa) // -- << " already mapped" // -- << bsl::endl // -- << bsl::here(); // -- return bsl::errc_failure; } npte->phys = (page_spa >> bsl::to_umx(HYPERVISOR_PAGE_SHIFT)).get(); npte->p = bsl::ONE_UMAX.get(); npte->us = bsl::ONE_UMAX.get(); if (!(page_flags & MAP_PAGE_WRITE).is_zero()) { npte->rw = bsl::ONE_UMAX.get(); } else { npte->rw = bsl::ZERO_UMAX.get(); } if (!(page_flags & MAP_PAGE_EXECUTE).is_zero()) { npte->nx = bsl::ZERO_UMAX.get(); } else { npte->nx = bsl::ONE_UMAX.get(); } if (page_type == MEMORY_TYPE_UC) { npte->pwt = bsl::ONE_UMAX.get(); npte->pcd = bsl::ONE_UMAX.get(); } else { bsl::touch(); } return bsl::errc_success; } /// <!-- description --> /// @brief Maps a 2m page into the nested page tables being managed /// by this class. /// /// <!-- inputs/outputs --> /// @param page_gpa the guest physical address to map the system /// physical address to /// @param page_spa the system physical address to map. /// @param page_flags defines how memory should be mapped /// @param page_type defines the memory type for the mapping /// @return Returns bsl::errc_success on success, bsl::errc_failure /// and friends otherwise /// [[nodiscard]] constexpr auto map_2m_page( bsl::safe_umx const &page_gpa, bsl::safe_umx const &page_spa, bsl::safe_umx const &page_flags, bsl::safe_umx const &page_type) noexcept -> bsl::errc_type { lock_guard lock{m_npt_lock}; if (bsl::unlikely(!m_initialized)) { bsl::error() << "nested_page_table_t not initialized\n" << bsl::here(); return bsl::errc_failure; } if (bsl::unlikely(!page_gpa)) { bsl::error() << "guest physical address is invalid: " // -- << bsl::hex(page_gpa) // -- << bsl::endl // -- << bsl::here(); // -- return bsl::errc_failure; } if (bsl::unlikely(!this->is_page_aligned(page_gpa))) { bsl::error() << "guest physical address is not page aligned: " // -- << bsl::hex(page_gpa) // -- << bsl::endl // -- << bsl::here(); // -- return bsl::errc_failure; } if (bsl::unlikely(!page_spa)) { bsl::error() << "system physical address is invalid: " // -- << bsl::hex(page_spa) // -- << bsl::endl // -- << bsl::here(); // -- return bsl::errc_failure; } if (bsl::unlikely(!this->is_page_aligned(page_spa))) { bsl::error() << "system physical address is not page aligned: " // -- << bsl::hex(page_spa) // -- << bsl::endl // -- << bsl::here(); // -- return bsl::errc_failure; } if (bsl::unlikely(!page_flags)) { bsl::error() << "invalid flags: " // -- << bsl::hex(page_flags) // -- << bsl::endl // -- << bsl::here(); // -- return bsl::errc_failure; } if (bsl::unlikely(!page_type)) { bsl::error() << "invalid flags: " // -- << bsl::hex(page_type) // -- << bsl::endl // -- << bsl::here(); // -- return bsl::errc_failure; } if (bsl::unlikely(page_type == MEMORY_TYPE_WC)) { bsl::error() << "invalid flags: " // -- << bsl::hex(page_flags) // -- << bsl::endl // -- << bsl::here(); // -- return bsl::errc_failure; } if (bsl::unlikely(page_type == MEMORY_TYPE_WT)) { bsl::error() << "invalid flags: " // -- << bsl::hex(page_flags) // -- << bsl::endl // -- << bsl::here(); // -- return bsl::errc_failure; } if (bsl::unlikely(page_type == MEMORY_TYPE_WP)) { bsl::error() << "invalid flags: " // -- << bsl::hex(page_flags) // -- << bsl::endl // -- << bsl::here(); // -- return bsl::errc_failure; } auto *const npml4te{m_npml4t->entries.at_if(this->npml4to(page_gpa))}; if (npml4te->p == bsl::ZERO_UMAX) { if (bsl::unlikely(!this->add_npdpt(npml4te))) { bsl::print<bsl::V>() << bsl::here(); return bsl::errc_failure; } bsl::touch(); } else { bsl::touch(); } auto *const npdpt{this->get_npdpt(npml4te)}; auto *const npdpte{npdpt->entries.at_if(this->npdpto(page_gpa))}; if (npdpte->p == bsl::ZERO_UMAX) { if (bsl::unlikely(!this->add_npdt(npdpte))) { bsl::print<bsl::V>() << bsl::here(); return bsl::errc_failure; } bsl::touch(); } else { bsl::touch(); } auto *const npdt{this->get_npdt(npdpte)}; auto *const npdte{npdt->entries.at_if(this->npdto(page_gpa))}; if (bsl::unlikely(npdte->p != bsl::ZERO_UMAX)) { bsl::error() << "guest physical address " // -- << bsl::hex(page_gpa) // -- << " already mapped" // -- << bsl::endl // -- << bsl::here(); // -- return bsl::errc_failure; } npdte->phys = (page_spa >> bsl::to_umx(HYPERVISOR_PAGE_SHIFT)).get(); npdte->p = bsl::ONE_UMAX.get(); npdte->us = bsl::ONE_UMAX.get(); npdte->ps = bsl::ONE_UMAX.get(); if (!(page_flags & MAP_PAGE_WRITE).is_zero()) { npdte->rw = bsl::ONE_UMAX.get(); } else { npdte->rw = bsl::ZERO_UMAX.get(); } if (!(page_flags & MAP_PAGE_EXECUTE).is_zero()) { npdte->nx = bsl::ZERO_UMAX.get(); } else { npdte->nx = bsl::ONE_UMAX.get(); } if (page_type == MEMORY_TYPE_UC) { npdte->pwt = bsl::ONE_UMAX.get(); npdte->pcd = bsl::ONE_UMAX.get(); } else { bsl::touch(); } return bsl::errc_success; } }; } #endif
mit
pbochynski/homestat
heat.js
594
var exec = require('child_process').exec; var ON = '1400588', OFF = '1400579'; var CODESEND = 'sudo /home/pi/433Utils/RPi_utils/codesend '; var current = null; function heatOn() { if (current !== ON) { codesend(ON); current = ON; } } function heatOff() { if (current !== OFF) { codesend(OFF); current = OFF; } } function codesend(code) { exec(CODESEND + code, function (error, stdout, stderr) { if (error !== null) { console.error('exec error: ' + error); } }); } setInterval(function(){current=null}, 600000); exports.on = heatOn; exports.off = heatOff;
mit
thoemel/veloboerse
application/views/auswertung/cashMgmt.php
2739
<?php include APPPATH . 'views/header.php'; echo heading('Cash Management', 1); echo heading('Prognosen', 2) . ' <table class="table table-striped table-bordered table-condensed"> <thead> <tr> <th scope="col">Was</th> <th scope="col">Wieviel</th> <th scope="col">Bemerkungen</th> </tr> </thead> <tbody> <tr> <th scope="row">Einnahmen bar bisher</th> <td>' . $newStatistics['einnahmenBisher'] . '</td> <td>Preis aller Velos, die bisher verkauft und bar bezahlt wurden.</td> </tr> <tr> <th scope="row">Ausbezahlt bisher</th> <td>' . $newStatistics['ausbezahlt'] . '</td> <td></td> </tr> <tr> <th scope="row">Berechneter Kassenstand</th> <td>' . ($newStatistics['einnahmenBisher'] - $newStatistics['ausbezahlt']) . '</td> <td>Ganz einfach Einnahmen bar bisher minus ausbezahlter Betrag bisher.</td> </tr> <tr> <th scope="row">Wahrscheinliche Auszahlung ab jetzt</th> <td>' . round($newStatistics['probAuszahlung']) . '</td> <td>Preis aller Privatvelos, die noch nicht ausbezahlt oder abgeholt wurden<br> (abzüglich der Provision), multipliziert mit dem statistischen Anteil verkaufte/total Privatvelos.</td> </tr> <tr> <th scope="row">Maximale Auszahlung ab jetzt</th> <td>' . $newStatistics['maxAuszahlung'] . '</td> <td>Preis aller Privatvelos, die noch nicht ausbezahlt oder abgeholt wurden,<br> abzüglich der Provision.</td> </tr> <tr> <th scope="row">Einnahmen bar ab jetzt</th> <td>' . round($newStatistics['einnahmenPrognoseAbJetzt']) . '</td> <td>Preis aller Velos auf Platz, <br> verrechnet mit Anteil Verkaufte/Angebotene<br> und Anteil AnzahlBarzahlung/AnzahlVerkauft<br> (Datengrundlage siehe unten)</td> </tr> </tbody> </table>'; echo heading('Annahmen', 2) . ' <table class="table table-striped table-bordered table-condensed"> <thead> <tr> <th scope="col">Was</th> <th scope="col">Wieviel</th> <th scope="col">Bemerkungen</th> </tr> </thead> <tbody> <tr> <th scope="row">Statistischer Anteil Verkaufte/Angebotene Total</th> <td>' . $newStatistics['statAnteilVerkaufteTotal'] . '</td> <td>(Herbst 2014)</td> </tr> <tr> <th scope="row">Statistischer Anteil Verkaufte/Angebotene Private</th> <td>' . $newStatistics['statAnteilVerkauftePrivat'] . '</td> <td>(Herbst 2014)</td> </tr> <tr> <th scope="row">Statistischer Anteil Barzahlung</th> <td>' . $newStatistics['statAnteilBarHeute'] . '</td> <td>Berechnet aus Daten von heute.<br> Zum Vergleich: Im Herbst 2014 war er 0.506, Frühling 2015 0.452.</td> </tr> </tbody> </table>'; include APPPATH . 'views/footer.php';
mit
kiloe/ui
src/icons/GamesIcon.js
321
import React from 'react'; import Icon from '../Icon'; export default class GamesIcon extends Icon { getSVG(){return <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M30 15V4H18v11l6 6 6-6zm-15 3H4v12h11l6-6-6-6zm3 15v11h12V33l-6-6-6 6zm15-15l-6 6 6 6h11V18H33z"/></svg>;} };
mit
kleientertainment/ds_mod_tools
pkg/win32/mod_tools/tools/scripts/pipelinetools.py
1276
import Image import sys import optparse import glob import os import string import tempfile import shutil import zipfile def TrimImage(imagename): im = Image.open(imagename) idx = 0 width = im.size[0] height = im.size[1] top = height bottom = 0 left = width right = 0 x = 0 y = 0 for pix in im.getdata(): if pix[3] != 0: if top > y: top = y if bottom < y: bottom = y if left > x: left = x if right < x: right = x x = x + 1 if x == width: x = 0 y = y +1 box = (left, top, right, bottom) cropped = im.crop(box) cropped.load() return (width, height), box, cropped def GetBaseDirectory(file, knowndir): fullpath = os.path.abspath(file) basedir = fullpath idx = string.find(basedir, knowndir) if idx == -1: raise Exception("File " + basedir + " not rooted under " + knowndir) return basedir[:idx] def VerifyDirectory(basedir, dir): outdir = os.path.join(basedir, dir) if not os.path.exists(outdir): os.mkdir(outdir) return outdir
mit
martin-helmich/php-gridfs
src/Stream/DownloadStreamInterface.php
369
<?php namespace Helmich\GridFS\Stream; use MongoDB\Model\BSONDocument; interface DownloadStreamInterface { public function read(int $n): string; public function readAll(): string; public function reset(); public function tell(): int; public function seek(int $n); public function eof(): bool; public function file(): BSONDocument; }
mit
timbjames/arthR
arthr.Web/Scripts/Services/Api/ItemApi.ts
176
const itemApi = { get: () => { return `api/item/` }, doSomething: () => { return `/api/item/dosomething` } } export { itemApi as ItemApi }
mit
djstearns/blabfeed-beta2
plugins/full_calendar/webroot/js/fullcalendar.min.js
48429
/* FullCalendar v1.4.11 http://arshaw.com/fullcalendar/ Use fullcalendar.css for basic styling. For event drag & drop, requires jQuery UI draggable. For event resizing, requires jQuery UI resizable. Copyright (c) 2010 Adam Shaw Dual licensed under the MIT and GPL licenses, located in MIT-LICENSE.txt and GPL-LICENSE.txt respectively. Date: Tue Feb 22 21:47:22 2011 -0800 */ (function(l,ga){function hb(a){l.extend(true,Oa,a)}function Db(a,b,f){function e(q){if(I){s();r();ka();N(q)}else g()}function g(){P=b.theme?"ui":"fc";a.addClass("fc");b.isRTL&&a.addClass("fc-rtl");b.theme&&a.addClass("ui-widget");I=l("<div class='fc-content "+P+"-widget-content' style='position:relative'/>").prependTo(a);L=new Eb(W,b);(D=L.render())&&a.prepend(D);z(b.defaultView);l(window).resize(ha);u()||h()}function h(){setTimeout(function(){!v.start&&u()&&N()},0)}function m(){l(window).unbind("resize", ha);L.destroy();I.remove();a.removeClass("fc fc-rtl fc-ui-widget")}function p(){return Q.offsetWidth!==0}function u(){return l("body")[0].offsetWidth!==0}function z(q){if(!v||q!=v.name){n++;A();var x=v,J;if(x){(x.beforeHide||ib)();Ra(I,I.height());x.element.hide()}else Ra(I,1);I.css("overflow","auto");if(v=i[q])v.element.show();else v=i[q]=new Fa[q](J=j=l("<div class='fc-view fc-view-"+q+"' style='position:absolute'/>").appendTo(I),W);x&&L.deactivateButton(x.name);L.activateButton(q);N();I.css("overflow", "");x&&Ra(I,1);J||(v.afterShow||ib)();n--}}function N(q){if(p()){n++;A();E===ga&&s();var x=false;if(!v.start||q||t<v.start||t>=v.end){v.render(t,q||0);Y(true);x=true}else if(v.sizeDirty){v.clearEvents();Y();x=true}else if(v.eventsDirty){v.clearEvents();x=true}v.sizeDirty=false;v.eventsDirty=false;da(x);k=a.outerWidth();L.updateTitle(v.title);q=new Date;q>=v.start&&q<v.end?L.disableButton("today"):L.enableButton("today");n--;v.trigger("viewDisplay",Q)}}function O(){r();if(p()){s();Y();A();v.clearEvents(); v.renderEvents(U);v.sizeDirty=false}}function r(){l.each(i,function(q,x){x.sizeDirty=true})}function s(){E=b.contentHeight?b.contentHeight:b.height?b.height-(D?D.height():0)-Sa(I[0]):Math.round(I.width()/Math.max(b.aspectRatio,0.5))}function Y(q){n++;v.setHeight(E,q);if(j){j.css("position","relative");j=null}v.setWidth(I.width(),q);n--}function ha(){if(!n)if(v.start){var q=++d;setTimeout(function(){if(q==d&&!n&&p())if(k!=(k=a.outerWidth())){n++;O();v.trigger("windowResize",Q);n--}},200)}else h()} function da(q){if(!b.lazyFetching||w(v.visStart,v.visEnd))X();else q&&aa()}function X(){K(v.visStart,v.visEnd)}function la(q){U=q;aa()}function oa(q){aa(q)}function aa(q){ka();if(p()){v.clearEvents();v.renderEvents(U,q);v.eventsDirty=false}}function ka(){l.each(i,function(q,x){x.eventsDirty=true})}function ca(q,x,J){v.select(q,x,J===ga?true:J)}function A(){v&&v.unselect()}function V(){N(-1)}function c(){N(1)}function B(){Ta(t,-1);N()}function F(){Ta(t,1);N()}function G(){t=new Date;N()}function fa(q, x,J){if(q instanceof Date)t=C(q);else jb(t,q,x,J);N()}function na(q,x,J){q!==ga&&Ta(t,q);x!==ga&&Ua(t,x);J!==ga&&S(t,J);N()}function ia(){return C(t)}function H(){return v}function T(q,x){if(x===ga)return b[q];if(q=="height"||q=="contentHeight"||q=="aspectRatio"){b[q]=x;O()}}function va(q,x){if(b[q])return b[q].apply(x||Q,Array.prototype.slice.call(arguments,2))}var W=this;W.options=b;W.render=e;W.destroy=m;W.refetchEvents=X;W.reportEvents=la;W.reportEventChange=oa;W.rerenderEvents=aa;W.changeView= z;W.select=ca;W.unselect=A;W.prev=V;W.next=c;W.prevYear=B;W.nextYear=F;W.today=G;W.gotoDate=fa;W.incrementDate=na;W.formatDate=function(q,x){return Ha(q,x,b)};W.formatDates=function(q,x,J){return Va(q,x,J,b)};W.getDate=ia;W.getView=H;W.option=T;W.trigger=va;Fb.call(W,b,f);var w=W.isFetchNeeded,K=W.fetchEvents,Q=a[0],L,D,I,P,v,i={},k,E,j,d=0,n=0,t=new Date,U=[],Z;jb(t,b.year,b.month,b.date);b.droppable&&l(document).bind("dragstart",function(q,x){var J=q.target,ja=l(J);if(!ja.parents(".fc").length){var ma= b.dropAccept;if(l.isFunction(ma)?ma.call(J,ja):ja.is(ma)){Z=J;v.dragStart(Z,q,x)}}}).bind("dragstop",function(q,x){if(Z){v.dragStop(Z,q,x);Z=null}})}function Eb(a,b){function f(){r=b.theme?"ui":"fc";var s=b.header;if(s)return O=l("<table class='fc-header'/>").append(l("<tr/>").append(l("<td class='fc-header-left'/>").append(g(s.left))).append(l("<td class='fc-header-center'/>").append(g(s.center))).append(l("<td class='fc-header-right'/>").append(g(s.right))))}function e(){O.remove()}function g(s){if(s){var Y= l("<tr/>");l.each(s.split(" "),function(ha){ha>0&&Y.append("<td><span class='fc-header-space'/></td>");var da;l.each(this.split(","),function(X,la){if(la=="title"){Y.append("<td><h2 class='fc-header-title'>&nbsp;</h2></td>");da&&da.addClass(r+"-corner-right");da=null}else{var oa;if(a[la])oa=a[la];else if(Fa[la])oa=function(){aa.removeClass(r+"-state-hover");a.changeView(la)};if(oa){da&&da.addClass(r+"-no-right");var aa;X=b.theme?Wa(b.buttonIcons,la):null;var ka=Wa(b.buttonText,la);if(X)aa=l("<div class='fc-button-"+ la+" ui-state-default'><a><span class='ui-icon ui-icon-"+X+"'/></a></div>");else if(ka)aa=l("<div class='fc-button-"+la+" "+r+"-state-default'><a><span>"+ka+"</span></a></div>");if(aa){aa.click(function(){aa.hasClass(r+"-state-disabled")||oa()}).mousedown(function(){aa.not("."+r+"-state-active").not("."+r+"-state-disabled").addClass(r+"-state-down")}).mouseup(function(){aa.removeClass(r+"-state-down")}).hover(function(){aa.not("."+r+"-state-active").not("."+r+"-state-disabled").addClass(r+"-state-hover")}, function(){aa.removeClass(r+"-state-hover").removeClass(r+"-state-down")}).appendTo(l("<td/>").appendTo(Y));da?da.addClass(r+"-no-right"):aa.addClass(r+"-corner-left");da=aa}}}});da&&da.addClass(r+"-corner-right")});return l("<table/>").append(Y)}}function h(s){O.find("h2.fc-header-title").html(s)}function m(s){O.find("div.fc-button-"+s).addClass(r+"-state-active")}function p(s){O.find("div.fc-button-"+s).removeClass(r+"-state-active")}function u(s){O.find("div.fc-button-"+s).addClass(r+"-state-disabled")} function z(s){O.find("div.fc-button-"+s).removeClass(r+"-state-disabled")}var N=this;N.render=f;N.destroy=e;N.updateTitle=h;N.activateButton=m;N.deactivateButton=p;N.disableButton=u;N.enableButton=z;var O=l([]),r}function Fb(a,b){function f(c,B){return!oa||c<oa||B>aa}function e(c,B){oa=c;aa=B;V=[];c=++ka;ca=B=b.length;for(var F=0;F<B;F++)g(b[F],c)}function g(c,B){h(c,function(F){if(B==ka){for(var G=0;G<F.length;G++){Y(F[G]);F[G].source=c}V=V.concat(F);ca--;ca||la(V)}})}function h(c,B){if(typeof c== "string"){var F={};F[a.startParam]=Math.round(oa.getTime()/1E3);F[a.endParam]=Math.round(aa.getTime()/1E3);if(a.cacheParam)F[a.cacheParam]=(new Date).getTime();r();l.ajax({url:c,dataType:"json",data:F,cache:a.cacheParam||false,success:function(G){s();B(G)}})}else if(l.isFunction(c)){r();c(C(oa),C(aa),function(G){s();B(G)})}else B(c)}function m(c){b.push(c);ca++;g(c,ka)}function p(c){b=l.grep(b,function(B){return B!=c});V=l.grep(V,function(B){return B.source!=c});la(V)}function u(c){var B,F=V.length, G,fa=X().defaultEventEnd,na=c.start-c._start,ia=c.end?c.end-(c._end||fa(c)):0;for(B=0;B<F;B++){G=V[B];if(G._id==c._id&&G!=c){G.start=new Date(+G.start+na);G.end=c.end?G.end?new Date(+G.end+ia):new Date(+fa(G)+ia):null;G.title=c.title;G.url=c.url;G.allDay=c.allDay;G.className=c.className;G.editable=c.editable;Y(G)}}Y(c);la(V)}function z(c,B){Y(c);if(!c.source){if(B){b[0].push(c);c.source=b[0]}V.push(c)}la(V)}function N(c){if(c){if(!l.isFunction(c)){var B=c+"";c=function(G){return G._id==B}}V=l.grep(V, c,true);for(F=0;F<b.length;F++)if(typeof b[F]=="object")b[F]=l.grep(b[F],c,true)}else{V=[];for(var F=0;F<b.length;F++)if(typeof b[F]=="object")b[F]=[]}la(V)}function O(c){if(l.isFunction(c))return l.grep(V,c);else if(c){c+="";return l.grep(V,function(B){return B._id==c})}return V}function r(){A++||da("loading",null,true)}function s(){--A||da("loading",null,false)}function Y(c){c._id=c._id||(c.id===ga?"_fc"+Gb++:c.id+"");if(c.date){if(!c.start)c.start=c.date;delete c.date}c._start=C(c.start=Xa(c.start, a.ignoreTimezone));c.end=Xa(c.end,a.ignoreTimezone);if(c.end&&c.end<=c.start)c.end=null;c._end=c.end?C(c.end):null;if(c.allDay===ga)c.allDay=a.allDayDefault;if(c.className){if(typeof c.className=="string")c.className=c.className.split(/\s+/)}else c.className=[]}var ha=this;ha.isFetchNeeded=f;ha.fetchEvents=e;ha.addEventSource=m;ha.removeEventSource=p;ha.updateEvent=u;ha.renderEvent=z;ha.removeEvents=N;ha.clientEvents=O;ha.normalizeEvent=Y;var da=ha.trigger,X=ha.getView,la=ha.reportEvents,oa,aa,ka= 0,ca=0,A=0,V=[];b.unshift([])}function Hb(a,b){function f(p,u){if(u){Ua(p,u);p.setDate(1)}p=C(p,true);p.setDate(1);u=Ua(C(p),1);var z=C(p),N=C(u),O=g("firstDay"),r=g("weekends")?0:1;if(r){ta(z);ta(N,-1,true)}S(z,-((z.getDay()-Math.max(O,r)+7)%7));S(N,(7-N.getDay()+Math.max(O,r))%7);O=Math.round((N-z)/(kb*7));if(g("weekMode")=="fixed"){S(N,(6-O)*7);O=6}e.title=m(p,g("titleFormat"));e.start=p;e.end=u;e.visStart=z;e.visEnd=N;h(O,r?5:7,true)}var e=this;e.render=f;Ya.call(e,a,b,"month");var g=e.opt,h= e.renderBasic,m=b.formatDate}function Ib(a,b){function f(p,u){u&&S(p,u*7);p=S(C(p),-((p.getDay()-g("firstDay")+7)%7));u=S(C(p),7);var z=C(p),N=C(u),O=g("weekends");if(!O){ta(z);ta(N,-1,true)}e.title=m(z,S(C(N),-1),g("titleFormat"));e.start=p;e.end=u;e.visStart=z;e.visEnd=N;h(1,O?7:5,false)}var e=this;e.render=f;Ya.call(e,a,b,"basicWeek");var g=e.opt,h=e.renderBasic,m=b.formatDates}function Jb(a,b){function f(p,u){if(u){S(p,u);g("weekends")||ta(p,u<0?-1:1)}e.title=m(p,g("titleFormat"));e.start=e.visStart= C(p,true);e.end=e.visEnd=S(C(e.start),1);h(1,1,false)}var e=this;e.render=f;Ya.call(e,a,b,"basicDay");var g=e.opt,h=e.renderBasic,m=b.formatDate}function Ya(a,b,f){function e(j,d,n){w=j;K=d;if(ia=V("isRTL")){H=-1;T=K-1}else{H=1;T=0}va=V("firstDay");W=V("weekends")?0:1;var t=V("theme")?"ui":"fc",U=V("columnFormat"),Z=A.start.getMonth(),q=Ga(new Date),x,J=C(A.visStart);if(P){B();d=P.find("tr").length;if(w<d)P.find("tr:gt("+(w-1)+")").remove();else if(w>d){j="";for(d=d;d<w;d++){j+="<tr class='fc-week"+ d+"'>";for(x=0;x<K;x++){j+="<td class='fc-"+Ca[J.getDay()]+" "+t+"-state-default fc-new fc-day"+(d*K+x)+(x==T?" fc-leftmost":"")+"'>"+(n?"<div class='fc-day-number'></div>":"")+"<div class='fc-day-content'><div style='position:relative'>&nbsp;</div></div></td>";S(J,1);W&&ta(J)}j+="</tr>"}P.append(j)}m(P.find("td.fc-new").removeClass("fc-new"));J=C(A.visStart);P.find("td").each(function(){var ma=l(this);if(w>1)J.getMonth()==Z?ma.removeClass("fc-other-month"):ma.addClass("fc-other-month");+J==+q?ma.removeClass("fc-not-today").addClass("fc-today").addClass(t+ "-state-highlight"):ma.addClass("fc-not-today").removeClass("fc-today").removeClass(t+"-state-highlight");ma.find("div.fc-day-number").text(J.getDate());S(J,1);W&&ta(J)});if(w==1){J=C(A.visStart);I.find("th").each(function(ma,$){l($).text(na(J,U));$.className=$.className.replace(/^fc-\w+(?= )/,"fc-"+Ca[J.getDay()]);S(J,1);W&&ta(J)});J=C(A.visStart);P.find("td").each(function(ma,$){$.className=$.className.replace(/^fc-\w+(?= )/,"fc-"+Ca[J.getDay()]);S(J,1);W&&ta(J)})}}else{var ja=l("<table/>").appendTo(a); j="<thead><tr>";for(d=0;d<K;d++){j+="<th class='fc-"+Ca[J.getDay()]+" "+t+"-state-default"+(d==T?" fc-leftmost":"")+"'>"+na(J,U)+"</th>";S(J,1);W&&ta(J)}I=l(j+"</tr></thead>").appendTo(ja);j="<tbody>";J=C(A.visStart);for(d=0;d<w;d++){j+="<tr class='fc-week"+d+"'>";for(x=0;x<K;x++){j+="<td class='fc-"+Ca[J.getDay()]+" "+t+"-state-default fc-day"+(d*K+x)+(x==T?" fc-leftmost":"")+(w>1&&J.getMonth()!=Z?" fc-other-month":"")+(+J==+q?" fc-today "+t+"-state-highlight":" fc-not-today")+"'>"+(n?"<div class='fc-day-number'>"+ J.getDate()+"</div>":"")+"<div class='fc-day-content'><div style='position:relative'>&nbsp;</div></div></td>";S(J,1);W&&ta(J)}j+="</tr>"}P=l(j+"</tbody>").appendTo(ja);m(P.find("td"));v=l("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(a)}}function g(j){D=j;j=P.find("tr td:first-child");var d=D-I.height(),n;if(V("weekMode")=="variable")n=d=Math.floor(d/(w==1?2:6));else{n=Math.floor(d/w);d=d-n*(w-1)}if(Za===ga){var t=P.find("tr:first").find("td:first");t.height(n);Za=n!=t.height()}if(Za){j.slice(0, -1).height(n);j.slice(-1).height(d)}else{Pa(j.slice(0,-1),n);Pa(j.slice(-1),d)}}function h(j){L=j;E.clear();Q=Math.floor(L/K);Ia(I.find("th").slice(0,-1),Q)}function m(j){j.click(p).mousedown(fa)}function p(j){if(!V("selectable")){var d=parseInt(this.className.match(/fc\-day(\d+)/)[1]);d=S(C(A.visStart),Math.floor(d/K)*7+d%K);c("dayClick",this,d,true,j)}}function u(j,d,n){n&&i.build();n=C(A.visStart);for(var t=S(C(n),K),U=0;U<w;U++){var Z=new Date(Math.max(n,j)),q=new Date(Math.min(t,d));if(Z<q){var x; if(ia){x=Aa(q,n)*H+T+1;Z=Aa(Z,n)*H+T+1}else{x=Aa(Z,n);Z=Aa(q,n)}m(z(U,x,U,Z-1))}S(n,7);S(t,7)}}function z(j,d,n,t){j=i.rect(j,d,n,t,a);return F(j,a)}function N(j){return C(j)}function O(j,d){u(j,S(C(d),1),true)}function r(){G()}function s(j,d){k.start(function(n){G();n&&z(n.row,n.col,n.row,n.col)},d)}function Y(j,d,n){var t=k.stop();G();if(t){t=aa(t);c("drop",j,t,true,d,n)}}function ha(j){return C(j.start)}function da(j){return E.left(j)}function X(j){return E.right(j)}function la(j){return(j-Math.max(va, W)+K)%K}function oa(j){return{row:Math.floor(Aa(j,A.visStart)/7),col:la(j.getDay())*H+T}}function aa(j){return S(C(A.visStart),j.row*7+j.col*H+T)}function ka(j){return P.find("tr:eq("+j+")")}function ca(){return{left:0,right:L}}var A=this;A.renderBasic=e;A.setHeight=g;A.setWidth=h;A.renderDayOverlay=u;A.defaultSelectionEnd=N;A.renderSelection=O;A.clearSelection=r;A.dragStart=s;A.dragStop=Y;A.defaultEventEnd=ha;A.getHoverListener=function(){return k};A.colContentLeft=da;A.colContentRight=X;A.dayOfWeekCol= la;A.dateCell=oa;A.cellDate=aa;A.cellIsAllDay=function(){return true};A.allDayTR=ka;A.allDayBounds=ca;A.getRowCnt=function(){return w};A.getColCnt=function(){return K};A.getColWidth=function(){return Q};A.getDaySegmentContainer=function(){return v};lb.call(A,a,b,f);mb.call(A);nb.call(A);Kb.call(A);var V=A.opt,c=A.trigger,B=A.clearEvents,F=A.renderOverlay,G=A.clearOverlays,fa=A.daySelectionMousedown,na=b.formatDate,ia,H,T,va,W,w,K,Q,L,D,I,P,v,i,k,E;ob(a.addClass("fc-grid"));i=new pb(function(j,d){var n, t,U,Z=P.find("tr:first td");if(ia)Z=l(Z.get().reverse());Z.each(function(q,x){n=l(x);t=n.offset().left;if(q)U[1]=t;U=[t];d[q]=U});U[1]=t+n.outerWidth();P.find("tr").each(function(q,x){n=l(x);t=n.offset().top;if(q)U[1]=t;U=[t];j[q]=U});U[1]=t+n.outerHeight()});k=new qb(i);E=new rb(function(j){return P.find("td:eq("+j+") div div")})}function Kb(){function a(ca,A){u(ca);aa(f(ca),A)}function b(){z();Y().empty()}function f(ca){var A=la(),V=oa(),c=C(h.visStart);V=S(C(c),V);var B=l.map(ca,Na),F,G,fa,na, ia,H,T=[];for(F=0;F<A;F++){G=$a(ab(ca,B,c,V));for(fa=0;fa<G.length;fa++){na=G[fa];for(ia=0;ia<na.length;ia++){H=na[ia];H.row=F;H.level=fa;T.push(H)}}S(c,7);S(V,7)}return T}function e(ca,A,V){N(ca,A);if(ca.editable||ca.editable===ga&&m("editable")){g(ca,A);V.isEnd&&ka(ca,A,V)}}function g(ca,A){if(!m("disableDragging")&&A.draggable){var V=ha(),c;A.draggable({zIndex:9,delay:50,opacity:m("dragOpacity"),revertDuration:m("dragRevertDuration"),start:function(B,F){p("eventDragStart",A,ca,B,F);r(ca,A);V.start(function(G, fa,na,ia){A.draggable("option","revert",!G||!na&&!ia);X();if(G){c=na*7+ia*(m("isRTL")?-1:1);da(S(C(ca.start),c),S(Na(ca),c))}else c=0},B,"drag")},stop:function(B,F){V.stop();X();p("eventDragStop",A,ca,B,F);if(c){A.find("a").removeAttr("href");s(this,ca,c,0,ca.allDay,B,F)}else{l.browser.msie&&A.css("filter","");O(ca,A)}}})}}var h=this;h.renderEvents=a;h.compileDaySegs=f;h.clearEvents=b;h.bindDaySeg=e;sb.call(h);var m=h.opt,p=h.trigger,u=h.reportEvents,z=h.reportEventClear,N=h.eventElementHandlers, O=h.showEvents,r=h.hideEvents,s=h.eventDrop,Y=h.getDaySegmentContainer,ha=h.getHoverListener,da=h.renderDayOverlay,X=h.clearOverlays,la=h.getRowCnt,oa=h.getColCnt,aa=h.renderDaySegs,ka=h.resizableDayEvent}function Lb(a,b){function f(p,u){u&&S(p,u*7);p=S(C(p),-((p.getDay()-g("firstDay")+7)%7));u=S(C(p),7);var z=C(p),N=C(u),O=g("weekends");if(!O){ta(z);ta(N,-1,true)}e.title=m(z,S(C(N),-1),g("titleFormat"));e.start=p;e.end=u;e.visStart=z;e.visEnd=N;h(O?7:5)}var e=this;e.render=f;tb.call(e,a,b,"agendaWeek"); var g=e.opt,h=e.renderAgenda,m=b.formatDates}function Mb(a,b){function f(p,u){if(u){S(p,u);g("weekends")||ta(p,u<0?-1:1)}u=C(p,true);var z=S(C(u),1);e.title=m(p,g("titleFormat"));e.start=e.visStart=u;e.end=e.visEnd=z;h(1)}var e=this;e.render=f;tb.call(e,a,b,"agendaDay");var g=e.opt,h=e.renderAgenda,m=b.formatDate}function tb(a,b,f){function e(o){d=o;ja=T("theme")?"ui":"fc";$=T("weekends")?0:1;ma=T("firstDay");if(qa=T("isRTL")){ea=-1;pa=d-1}else{ea=1;pa=0}xa=bb(T("minTime"));Ba=bb(T("maxTime"));o= qa?S(C(H.visEnd),-1):C(H.visStart);var y=C(o),M=Ga(new Date),R=T("columnFormat");if(v){W();v.find("tr:first th").slice(1,-1).each(function(Ja,ya){l(ya).text(P(y,R));ya.className=ya.className.replace(/^fc-\w+(?= )/,"fc-"+Ca[y.getDay()]);S(y,ea);$&&ta(y,ea)});y=C(o);j.find("td").each(function(Ja,ya){ya.className=ya.className.replace(/^fc-\w+(?= )/,"fc-"+Ca[y.getDay()]);+y==+M?l(ya).removeClass("fc-not-today").addClass("fc-today").addClass(ja+"-state-highlight"):l(ya).addClass("fc-not-today").removeClass("fc-today").removeClass(ja+ "-state-highlight");S(y,ea);$&&ta(y,ea)})}else{var ba,ua,Da=T("slotMinutes")%15==0,ra="<div class='fc-agenda-head' style='position:relative;z-index:4'><table style='width:100%'><tr class='fc-first"+(T("allDaySlot")?"":" fc-last")+"'><th class='fc-leftmost "+ja+"-state-default'>&nbsp;</th>";for(ba=0;ba<d;ba++){ra+="<th class='fc-"+Ca[y.getDay()]+" "+ja+"-state-default'>"+P(y,R)+"</th>";S(y,ea);$&&ta(y,ea)}ra+="<th class='"+ja+"-state-default'>&nbsp;</th></tr>";if(T("allDaySlot"))ra+="<tr class='fc-all-day'><th class='fc-axis fc-leftmost "+ ja+"-state-default'>"+T("allDayText")+"</th><td colspan='"+d+"' class='"+ja+"-state-default'><div class='fc-day-content'><div style='position:relative'>&nbsp;</div></div></td><th class='"+ja+"-state-default'>&nbsp;</th></tr><tr class='fc-divider fc-last'><th colspan='"+(d+2)+"' class='"+ja+"-state-default fc-leftmost'><div/></th></tr>";ra+="</table></div>";v=l(ra).appendTo(a);z(v.find("td"));ub=l("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(v);y=vb();var cb=sa(C(y),Ba);sa(y, xa);ra="<table>";for(ba=0;y<cb;ba++){ua=y.getMinutes();ra+="<tr class='"+(!ba?"fc-first":!ua?"":"fc-minor")+"'><th class='fc-axis fc-leftmost "+ja+"-state-default'>"+(!Da||!ua?P(y,T("axisFormat")):"&nbsp;")+"</th><td class='fc-slot"+ba+" "+ja+"-state-default'><div style='position:relative'>&nbsp;</div></td></tr>";sa(y,T("slotMinutes"));n++}ra+="</table>";i=l("<div class='fc-agenda-body'/>").append(k=l("<div style='position:relative;'>").append(E= l(ra))).appendTo(a);N(i.find("td"));wb=l("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(k);y=C(o);ra="<div class='fc-agenda-bg' style='position:absolute;z-index:1'><table style='width:100%;height:100%'><tr class='fc-first'>";for(ba=0;ba<d;ba++){ra+="<td class='fc-"+Ca[y.getDay()]+" "+ja+"-state-default "+(!ba?"fc-leftmost ":"")+(+y==+M?ja+"-state-highlight fc-today":"fc-not-today")+"'><div class='fc-day-content'><div>&nbsp;</div></div></td>";S(y,ea);$&&ta(y,ea)}ra+="</tr></table></div>"; j=l(ra).appendTo(a)}}function g(o,y){if(o===ga)o=x;x=o;db={};o=o-v.height();o=Math.min(o,E.height());i.height(o);Z=i.find("tr:first div").height()+1;y&&m()}function h(o){q=o;Qa.clear();i.width(o).css("overflow","auto");E.width("");var y=v.find("tr:first th"),M=v.find("tr.fc-all-day th:last"),R=j.find("td"),ba=i[0].clientWidth;E.width(ba);ba=i[0].clientWidth;E.width(ba);t=0;Ia(v.find("tr:lt(2) th:first").add(i.find("tr:first th")).width(1).each(function(){t=Math.max(t,l(this).outerWidth())}),t);U= Math.floor((ba-t)/d);Ia(R.slice(0,-1),U);Ia(y.slice(1,-2),U);if(o!=ba){Ia(y.slice(-2,-1),ba-t-U*(d-1));y.slice(-1).show();M.show()}else{i.css("overflow","auto");y.slice(-2,-1).width("");y.slice(-1).hide();M.hide()}j.css({top:v.find("tr").height(),left:t,width:ba-t,height:x})}function m(){var o=vb(),y=C(o);y.setHours(T("firstHour"));var M=oa(o,y)+1;o=function(){i.scrollTop(M)};o();setTimeout(o,0)}function p(){J=i.scrollTop()}function u(){i.scrollTop(J)}function z(o){o.click(O).mousedown(D)}function N(o){o.click(O).mousedown(fa)} function O(o){if(!T("selectable")){var y=Math.min(d-1,Math.floor((o.pageX-j.offset().left)/U));y=S(C(H.visStart),y*ea+pa);var M=this.className.match(/fc-slot(\d+)/);if(M){M=parseInt(M[1])*T("slotMinutes");var R=Math.floor(M/60);y.setHours(R);y.setMinutes(M%60+xa);va("dayClick",this,y,false,o)}else va("dayClick",this,y,true,o)}}function r(o,y,M){M&&wa.build();var R=C(H.visStart);if(qa){M=Aa(y,R)*ea+pa+1;o=Aa(o,R)*ea+pa+1}else{M=Aa(o,R);o=Aa(y,R)}M=Math.max(0,M);o=Math.min(d,o);M<o&&z(s(0,M,0,o-1))} function s(o,y,M,R){o=wa.rect(o,y,M,R,v);return w(o,v)}function Y(o,y){for(var M=C(H.visStart),R=S(C(M),1),ba=0;ba<d;ba++){var ua=new Date(Math.max(M,o)),Da=new Date(Math.min(R,y));if(ua<Da){var ra=ba*ea+pa;ra=wa.rect(0,ra,0,ra,k);ua=oa(M,ua);Da=oa(M,Da);ra.top=ua;ra.height=Da-ua;N(w(ra,k))}S(M,1);S(R,1)}}function ha(o){return t+Qa.left(o)}function da(o){return t+Qa.right(o)}function X(o){return(o-Math.max(ma,$)+d)%d*ea+pa}function la(o){return{row:Math.floor(Aa(o,H.visStart)/7),col:X(o.getDay())}} function oa(o,y){o=C(o,true);if(y<sa(C(o),xa))return 0;if(y>=sa(C(o),Ba))return k.height();o=T("slotMinutes");y=y.getHours()*60+y.getMinutes()-xa;var M=Math.floor(y/o),R=db[M];if(R===ga)R=db[M]=i.find("tr:eq("+M+") td div")[0].offsetTop;return Math.max(0,Math.round(R-1+Z*(y%o/o)))}function aa(o){var y=S(C(H.visStart),o.col*ea+pa);o=o.row;T("allDaySlot")&&o--;o>=0&&sa(y,xa+o*T("slotMinutes"));return y}function ka(o){return T("allDaySlot")&&!o.row}function ca(){return{left:t,right:q}}function A(){return v.find("tr.fc-all-day")} function V(o){var y=C(o.start);if(o.allDay)return y;return sa(y,T("defaultEventMinutes"))}function c(o,y){if(y)return C(o);return sa(C(o),T("slotMinutes"))}function B(o,y,M){if(M)T("allDaySlot")&&r(o,S(C(y),1),true);else F(o,y)}function F(o,y){var M=T("selectHelper");wa.build();if(M){var R=Aa(o,H.visStart)*ea+pa;if(R>=0&&R<d){R=wa.rect(0,R,0,R,k);var ba=oa(o,o),ua=oa(o,y);if(ua>ba){R.top=ba;R.height=ua-ba;R.left+=2;R.width-=5;if(l.isFunction(M)){if(o=M(o,y)){R.position="absolute";R.zIndex=8;za=l(o).css(R).appendTo(k)}}else{za= l(I({title:"",start:o,end:y,className:[],editable:false},R,"fc-event fc-event-vert fc-corner-top fc-corner-bottom "));l.browser.msie&&za.find("span.fc-event-bg").hide();za.css("opacity",T("dragOpacity"))}if(za){N(za);k.append(za);Ia(za,R.width,true);Pa(za,R.height,true)}}}}else Y(o,y)}function G(){K();if(za){za.remove();za=null}}function fa(o){if(o.which==1&&T("selectable")){L(o);var y=this,M;Ka.start(function(R,ba){G();if(R&&R.col==ba.col&&!ka(R)){ba=aa(ba);R=aa(R);M=[ba,sa(C(ba),T("slotMinutes")), R,sa(C(R),T("slotMinutes"))].sort(eb);F(M[0],M[3])}else M=null},o);l(document).one("mouseup",function(R){Ka.stop();if(M){+M[0]==+M[1]&&va("dayClick",y,M[0],false,R);Q(M[0],M[3],false,R)}})}}function na(o,y){Ka.start(function(M){K();if(M)if(ka(M))s(M.row,M.col,M.row,M.col);else{M=aa(M);var R=sa(C(M),T("defaultEventMinutes"));Y(M,R)}},y)}function ia(o,y,M){var R=Ka.stop();K();R&&va("drop",o,aa(R),ka(R),y,M)}var H=this;H.renderAgenda=e;H.setWidth=h;H.setHeight=g;H.beforeHide=p;H.afterShow=u;H.defaultEventEnd= V;H.timePosition=oa;H.dayOfWeekCol=X;H.dateCell=la;H.cellDate=aa;H.cellIsAllDay=ka;H.allDayTR=A;H.allDayBounds=ca;H.getHoverListener=function(){return Ka};H.colContentLeft=ha;H.colContentRight=da;H.getDaySegmentContainer=function(){return ub};H.getSlotSegmentContainer=function(){return wb};H.getMinMinute=function(){return xa};H.getMaxMinute=function(){return Ba};H.getBodyContent=function(){return k};H.getRowCnt=function(){return 1};H.getColCnt=function(){return d};H.getColWidth=function(){return U}; H.getSlotHeight=function(){return Z};H.defaultSelectionEnd=c;H.renderDayOverlay=r;H.renderSelection=B;H.clearSelection=G;H.dragStart=na;H.dragStop=ia;lb.call(H,a,b,f);mb.call(H);nb.call(H);Nb.call(H);var T=H.opt,va=H.trigger,W=H.clearEvents,w=H.renderOverlay,K=H.clearOverlays,Q=H.reportSelection,L=H.unselect,D=H.daySelectionMousedown,I=H.slotSegHtml,P=b.formatDate,v,i,k,E,j,d,n=0,t,U,Z,q,x,J,ja,ma,$,qa,ea,pa,xa,Ba,wa,Ka,Qa,db={},za,ub,wb;ob(a.addClass("fc-agenda"));wa=new pb(function(o,y){function M(ya){return Math.max(ra, Math.min(cb,ya))}var R,ba,ua;j.find("td").each(function(ya,Ob){R=l(Ob);ba=R.offset().left;if(ya)ua[1]=ba;ua=[ba];y[ya]=ua});ua[1]=ba+R.outerWidth();if(T("allDaySlot")){R=v.find("td");ba=R.offset().top;o[0]=[ba,ba+R.outerHeight()]}for(var Da=k.offset().top,ra=i.offset().top,cb=ra+i.outerHeight(),Ja=0;Ja<n;Ja++)o.push([M(Da+Z*Ja),M(Da+Z*(Ja+1))])});Ka=new qb(wa);Qa=new rb(function(o){return j.find("td:eq("+o+") div div")})}function Nb(){function a(i,k){da(i);var E,j=i.length,d=[],n=[];for(E=0;E<j;E++)i[E].allDay? d.push(i[E]):n.push(i[E]);if(s("allDaySlot")){G(f(d),k);oa()}h(e(n),k)}function b(){X();aa().empty();ka().empty()}function f(i){i=$a(ab(i,l.map(i,Na),r.visStart,r.visEnd));var k,E=i.length,j,d,n,t=[];for(k=0;k<E;k++){j=i[k];for(d=0;d<j.length;d++){n=j[d];n.row=0;n.level=k;t.push(n)}}return t}function e(i){var k=na(),E=V(),j=A(),d=sa(C(r.visStart),E),n=l.map(i,g),t,U,Z,q,x,J,ja=[];for(t=0;t<k;t++){U=$a(ab(i,n,d,sa(C(d),j-E)));Pb(U);for(Z=0;Z<U.length;Z++){q=U[Z];for(x=0;x<q.length;x++){J=q[x];J.col= t;J.level=Z;ja.push(J)}}S(d,1,true)}return ja}function g(i){return i.end?C(i.end):sa(C(i.start),s("defaultEventMinutes"))}function h(i,k){var E,j=i.length,d,n,t,U,Z,q,x,J,ja,ma,$="",qa,ea,pa={},xa={},Ba=ka(),wa;E=na();if(qa=s("isRTL")){ea=-1;wa=E-1}else{ea=1;wa=0}for(E=0;E<j;E++){d=i[E];n=d.event;t="fc-event fc-event-vert ";if(d.isStart)t+="fc-corner-top ";if(d.isEnd)t+="fc-corner-bottom ";U=c(d.start,d.start);Z=c(d.start,d.end);q=d.col;x=d.level;J=d.forward||0;ja=B(q*ea+wa);ma=F(q*ea+wa)-ja;ma=Math.min(ma- 6,ma*0.95);q=x?ma/(x+J+1):J?(ma/(J+1)-6)*2:ma;x=ja+ma/(x+J+1)*x*ea+(qa?ma-q:0);d.top=U;d.left=x;d.outerWidth=q;d.outerHeight=Z-U;$+=m(n,d,t)}Ba[0].innerHTML=$;qa=Ba.children();for(E=0;E<j;E++){d=i[E];n=d.event;$=l(qa[E]);ea=Y("eventRender",n,n,$);if(ea===false)$.remove();else{if(ea&&ea!==true){$.remove();$=l(ea).css({position:"absolute",top:d.top,left:d.left}).appendTo(Ba)}d.element=$;if(n._id===k)u(n,$,d);else $[0]._fci=E;va(n,$)}}xb(Ba,i,u);for(E=0;E<j;E++){d=i[E];if($=d.element){n=pa[k=d.key=yb($[0])]; d.vsides=n===ga?(pa[k]=Sa($[0],true)):n;n=xa[k];d.hsides=n===ga?(xa[k]=fb($[0],true)):n;k=$.find("span.fc-event-title");if(k.length)d.titleTop=k[0].offsetTop}}for(E=0;E<j;E++){d=i[E];if($=d.element){$[0].style.width=Math.max(0,d.outerWidth-d.hsides)+"px";pa=Math.max(0,d.outerHeight-d.vsides);$[0].style.height=pa+"px";n=d.event;if(d.titleTop!==ga&&pa-d.titleTop<10){$.find("span.fc-event-time").text(P(n.start,s("timeFormat"))+" - "+n.title);$.find("span.fc-event-title").remove()}Y("eventAfterRender", n,n,$)}}}function m(i,k,E){return"<div class='"+E+i.className.join(" ")+"' style='position:absolute;z-index:8;top:"+k.top+"px;left:"+k.left+"px'><a"+(i.url?" href='"+La(i.url)+"'":"")+"><span class='fc-event-bg'></span><span class='fc-event-time'>"+La(v(i.start,i.end,s("timeFormat")))+"</span><span class='fc-event-title'>"+La(i.title)+"</span></a>"+((i.editable||i.editable===ga&&s("editable"))&&!s("disableResizing")&&l.fn.resizable?"<div class='ui-resizable-handle ui-resizable-s'>=</div>":"")+"</div>"} function p(i,k,E){la(i,k);if(i.editable||i.editable===ga&&s("editable")){z(i,k,E.isStart);E.isEnd&&fa(i,k,E)}}function u(i,k,E){la(i,k);if(i.editable||i.editable===ga&&s("editable")){var j=k.find("span.fc-event-time");N(i,k,j);E.isEnd&&O(i,k,j)}}function z(i,k,E){if(!s("disableDragging")&&k.draggable){var j,d,n=true,t,U=s("isRTL")?-1:1,Z=ca(),q=ia(),x=H(),J=V();k.draggable({zIndex:9,opacity:s("dragOpacity","month"),revertDuration:s("dragRevertDuration"),start:function(ma,$){Y("eventDragStart",k,i, ma,$);w(i,k);j=k.width();Z.start(function(qa,ea,pa,xa){D();if(qa){d=false;t=xa*U;if(qa.row)if(E){if(n){k.width(q-10);Pa(k,x*Math.round((i.end?(i.end-i.start)/Qb:s("defaultEventMinutes"))/s("slotMinutes")));k.draggable("option","grid",[q,1]);n=false}}else d=true;else{L(S(C(i.start),t),S(Na(i),t));ja()}d=d||n&&!t}else d=true;k.draggable("option","revert",d)},ma,"drag")},stop:function(ma,$){Z.stop();D();Y("eventDragStop",k,i,ma,$);if(d){ja();l.browser.msie&&k.css("filter","");W(i,k)}else{k.find("a").removeAttr("href"); var qa=0;n||(qa=Math.round((k.offset().top-T().offset().top)/x)*s("slotMinutes")+J-(i.start.getHours()*60+i.start.getMinutes()));K(this,i,t,qa,n,ma,$)}}});function ja(){if(!n){k.width(j).height("").draggable("option","grid",null);n=true}}}}function N(i,k,E){if(!s("disableDragging")&&k.draggable){var j,d=false,n,t,U,Z=s("isRTL")?-1:1,q=ca(),x=na(),J=ia(),ja=H();k.draggable({zIndex:9,scroll:false,grid:[J,ja],axis:x==1?"y":false,opacity:s("dragOpacity"),revertDuration:s("dragRevertDuration"),start:function(qa, ea){Y("eventDragStart",k,i,qa,ea);w(i,k);l.browser.msie&&k.find("span.fc-event-bg").hide();j=k.position();t=U=0;q.start(function(pa,xa,Ba,wa){k.draggable("option","revert",!pa);D();if(pa){n=wa*Z;if(s("allDaySlot")&&!pa.row){if(!d){d=true;E.hide();k.draggable("option","grid",null)}L(S(C(i.start),n),S(Na(i),n))}else $()}},qa,"drag")},drag:function(qa,ea){t=Math.round((ea.position.top-j.top)/ja)*s("slotMinutes");if(t!=U){d||ma(t);U=t}},stop:function(qa,ea){var pa=q.stop();D();Y("eventDragStop",k,i,qa, ea);if(pa&&(n||t||d))K(this,i,n,d?0:t,d,qa,ea);else{$();k.css(j);ma(0);l.browser.msie&&k.css("filter","").find("span.fc-event-bg").css("display","");W(i,k)}}});function ma(qa){var ea=sa(C(i.start),qa),pa;if(i.end)pa=sa(C(i.end),qa);E.text(v(ea,pa,s("timeFormat")))}function $(){if(d){E.css("display","");k.draggable("option","grid",[J,ja]);d=false}}}}function O(i,k,E){if(!s("disableResizing")&&k.resizable){var j,d,n=H();k.resizable({handles:{s:"div.ui-resizable-s"},grid:n,start:function(t,U){j=d=0; w(i,k);l.browser.msie&&l.browser.version=="6.0"&&k.css("overflow","auto");k.css("z-index",9);Y("eventResizeStart",this,i,t,U)},resize:function(t,U){j=Math.round((Math.max(n,k.height())-U.originalSize.height)/n);if(j!=d){E.text(v(i.start,!j&&!i.end?null:sa(ha(i),s("slotMinutes")*j),s("timeFormat")));d=j}},stop:function(t,U){Y("eventResizeStop",this,i,t,U);if(j)Q(this,i,0,s("slotMinutes")*j,t,U);else{k.css("z-index",8);W(i,k)}}})}}var r=this;r.renderEvents=a;r.compileDaySegs=f;r.clearEvents=b;r.slotSegHtml= m;r.bindDaySeg=p;sb.call(r);var s=r.opt,Y=r.trigger,ha=r.eventEnd,da=r.reportEvents,X=r.reportEventClear,la=r.eventElementHandlers,oa=r.setHeight,aa=r.getDaySegmentContainer,ka=r.getSlotSegmentContainer,ca=r.getHoverListener,A=r.getMaxMinute,V=r.getMinMinute,c=r.timePosition,B=r.colContentLeft,F=r.colContentRight,G=r.renderDaySegs,fa=r.resizableDayEvent,na=r.getColCnt,ia=r.getColWidth,H=r.getSlotHeight,T=r.getBodyContent,va=r.reportEventElement,W=r.showEvents,w=r.hideEvents,K=r.eventDrop,Q=r.eventResize, L=r.renderDayOverlay,D=r.clearOverlays,I=r.calendar,P=I.formatDate,v=I.formatDates}function Pb(a){var b,f,e,g,h,m;for(b=a.length-1;b>0;b--){g=a[b];for(f=0;f<g.length;f++){h=g[f];for(e=0;e<a[b-1].length;e++){m=a[b-1][e];if(zb(h,m))m.forward=Math.max(m.forward||0,(h.forward||0)+1)}}}}function lb(a,b,f){function e(c,B){c=V[c];if(typeof c=="object")return Wa(c,B||f);return c}function g(c,B){return b.trigger.apply(b,[c,B||X].concat(Array.prototype.slice.call(arguments,2),[X]))}function h(c){ka={};var B, F=c.length,G;for(B=0;B<F;B++){G=c[B];if(ka[G._id])ka[G._id].push(G);else ka[G._id]=[G]}}function m(c){return c.end?C(c.end):la(c)}function p(c,B){ca.push(B);if(A[c._id])A[c._id].push(B);else A[c._id]=[B]}function u(){ca=[];A={}}function z(c,B){B.click(function(F){if(!B.hasClass("ui-draggable-dragging")&&!B.hasClass("ui-resizable-resizing"))return g("eventClick",this,c,F)}).hover(function(F){g("eventMouseover",this,c,F)},function(F){g("eventMouseout",this,c,F)})}function N(c,B){r(c,B,"show")}function O(c, B){r(c,B,"hide")}function r(c,B,F){c=A[c._id];var G,fa=c.length;for(G=0;G<fa;G++)if(!B||c[G][0]!=B[0])c[G][F]()}function s(c,B,F,G,fa,na,ia){var H=B.allDay,T=B._id;ha(ka[T],F,G,fa);g("eventDrop",c,B,F,G,fa,function(){ha(ka[T],-F,-G,H);aa(T)},na,ia);aa(T)}function Y(c,B,F,G,fa,na){var ia=B._id;da(ka[ia],F,G);g("eventResize",c,B,F,G,function(){da(ka[ia],-F,-G);aa(ia)},fa,na);aa(ia)}function ha(c,B,F,G){F=F||0;for(var fa,na=c.length,ia=0;ia<na;ia++){fa=c[ia];if(G!==ga)fa.allDay=G;sa(S(fa.start,B,true), F);if(fa.end)fa.end=sa(S(fa.end,B,true),F);oa(fa,V)}}function da(c,B,F){F=F||0;for(var G,fa=c.length,na=0;na<fa;na++){G=c[na];G.end=sa(S(m(G),B,true),F);oa(G,V)}}var X=this;X.element=a;X.calendar=b;X.name=f;X.opt=e;X.trigger=g;X.reportEvents=h;X.eventEnd=m;X.reportEventElement=p;X.reportEventClear=u;X.eventElementHandlers=z;X.showEvents=N;X.hideEvents=O;X.eventDrop=s;X.eventResize=Y;var la=X.defaultEventEnd,oa=b.normalizeEvent,aa=b.reportEventChange,ka={},ca=[],A={},V=b.options}function sb(){function a(w, K){var Q=na(),L=ka(),D=ca(),I=0,P,v,i=w.length,k,E;Q[0].innerHTML=f(w);e(w,Q.children());g(w);h(w,Q,K);m(w);p(w);u(w);K=z();for(Q=0;Q<L;Q++){P=[];for(v=0;v<D;v++)P[v]=0;for(;I<i&&(k=w[I]).row==Q;){v=Ab(P.slice(k.startCol,k.endCol));k.top=v;v+=k.outerHeight;for(E=k.startCol;E<k.endCol;E++)P[E]=v;I++}K[Q].height(Ab(P))}O(w,N(K))}function b(w,K,Q){var L=l("<div/>"),D=na(),I=w.length,P;L[0].innerHTML=f(w);L=L.children();D.append(L);e(w,L);m(w);p(w);u(w);O(w,N(z()));L=[];for(D=0;D<I;D++)if(P=w[D].element){w[D].row=== K&&P.css("top",Q);L.push(P[0])}return l(L)}function f(w){var K=Y("isRTL"),Q,L=w.length,D,I,P;Q=V();var v=Q.left,i=Q.right,k=[],E,j,d="";for(Q=0;Q<L;Q++){D=w[Q];I=D.event;P="fc-event fc-event-hori ";if(K){if(D.isStart)P+="fc-corner-right ";if(D.isEnd)P+="fc-corner-left ";k[0]=F(D.end.getDay()-1);k[1]=F(D.start.getDay());E=D.isEnd?c(k[0]):v;j=D.isStart?B(k[1]):i}else{if(D.isStart)P+="fc-corner-left ";if(D.isEnd)P+="fc-corner-right ";k[0]=F(D.start.getDay());k[1]=F(D.end.getDay()-1);E=D.isStart?c(k[0]): v;j=D.isEnd?B(k[1]):i}d+="<div class='"+P+I.className.join(" ")+"' style='position:absolute;z-index:8;left:"+E+"px'><a"+(I.url?" href='"+La(I.url)+"'":"")+">"+(!I.allDay&&D.isStart?"<span class='fc-event-time'>"+La(H(I.start,I.end,Y("timeFormat")))+"</span>":"")+"<span class='fc-event-title'>"+La(I.title)+"</span></a>"+(D.isEnd&&(I.editable||I.editable===ga&&Y("editable"))&&!Y("disableResizing")?"<div class='ui-resizable-handle ui-resizable-"+(K?"w":"e")+"'></div>":"")+"</div>";D.left=E;D.outerWidth= j-E;k.sort(eb);D.startCol=k[0];D.endCol=k[1]+1}return d}function e(w,K){var Q,L=w.length,D,I,P;for(Q=0;Q<L;Q++){D=w[Q];I=D.event;P=l(K[Q]);I=ha("eventRender",I,I,P);if(I===false)P.remove();else{if(I&&I!==true){I=l(I).css({position:"absolute",left:D.left});P.replaceWith(I);P=I}D.element=P}}}function g(w){var K,Q=w.length,L,D;for(K=0;K<Q;K++){L=w[K];(D=L.element)&&X(L.event,D)}}function h(w,K,Q){var L,D=w.length,I,P,v;for(L=0;L<D;L++){I=w[L];if(P=I.element){v=I.event;if(v._id===Q)ia(v,P,I);else P[0]._fci= L}}xb(K,w,ia)}function m(w){var K,Q=w.length,L,D,I,P,v={};for(K=0;K<Q;K++){L=w[K];if(D=L.element){I=L.key=yb(D[0]);P=v[I];if(P===ga)P=v[I]=fb(D[0],true);L.hsides=P}}}function p(w){var K,Q=w.length,L,D;for(K=0;K<Q;K++){L=w[K];if(D=L.element)D[0].style.width=Math.max(0,L.outerWidth-L.hsides)+"px"}}function u(w){var K,Q=w.length,L,D,I,P,v={};for(K=0;K<Q;K++){L=w[K];if(D=L.element){I=L.key;P=v[I];if(P===ga)P=v[I]=Bb(D[0]);L.outerHeight=D[0].offsetHeight+P}}}function z(){var w,K=ka(),Q=[];for(w=0;w<K;w++)Q[w]= A(w).find("td:first div.fc-day-content > div");return Q}function N(w){var K,Q=w.length,L=[];for(K=0;K<Q;K++)L[K]=w[K][0].offsetTop;return L}function O(w,K){var Q,L=w.length,D,I;for(Q=0;Q<L;Q++){D=w[Q];if(I=D.element){I[0].style.top=K[D.row]+(D.top||0)+"px";D=D.event;ha("eventAfterRender",D,D,I)}}}function r(w,K,Q){if(!Y("disableResizing")&&Q.isEnd){var L=Y("isRTL"),D=L?"w":"e";K.find("div.ui-resizable-"+D).mousedown(function(I){function P(q){ha("eventResizeStop",this,w,q);l("body").css("cursor","auto"); v.stop();va();n&&aa(this,w,n,0,q)}if(I.which==1){var v=s.getHoverListener(),i=ka(),k=ca(),E=L?-1:1,j=L?k:0,d=K.css("top"),n,t,U=l.extend({},w),Z=G(w.start);W();l("body").css("cursor",D+"-resize").one("mouseup",P);ha("eventResizeStart",this,w,I);v.start(function(q,x){if(q){var J=Math.max(Z.row,q.row);q=q.col;if(i==1)J=0;if(J==Z.row)q=L?Math.min(Z.col,q):Math.max(Z.col,q);n=J*7+q*E+j-(x.row*7+x.col*E+j);x=S(da(w),n,true);if(n){U.end=x;J=t;t=b(fa([U]),Q.row,d);t.find("*").css("cursor",D+"-resize");J&& J.remove();oa(w)}else if(t){la(w);t.remove();t=null}va();T(w.start,S(C(x),1))}},I)}})}}var s=this;s.renderDaySegs=a;s.resizableDayEvent=r;var Y=s.opt,ha=s.trigger,da=s.eventEnd,X=s.reportEventElement,la=s.showEvents,oa=s.hideEvents,aa=s.eventResize,ka=s.getRowCnt,ca=s.getColCnt,A=s.allDayTR,V=s.allDayBounds,c=s.colContentLeft,B=s.colContentRight,F=s.dayOfWeekCol,G=s.dateCell,fa=s.compileDaySegs,na=s.getDaySegmentContainer,ia=s.bindDaySeg,H=s.calendar.formatDates,T=s.renderDayOverlay,va=s.clearOverlays, W=s.clearSelection}function nb(){function a(O,r,s){b();r||(r=p(O,s));u(O,r,s);f(O,r,s)}function b(O){if(N){N=false;z();m("unselect",null,O)}}function f(O,r,s,Y){N=true;m("select",null,O,r,s,Y)}function e(O){var r=g.cellDate,s=g.cellIsAllDay,Y=g.getHoverListener();if(O.which==1&&h("selectable")){b(O);var ha=this,da;Y.start(function(X,la){z();if(X&&s(X)){da=[r(la),r(X)].sort(eb);u(da[0],da[1],true)}else da=null},O);l(document).one("mouseup",function(X){Y.stop();if(da){+da[0]==+da[1]&&m("dayClick",ha, da[0],true,X);f(da[0],da[1],true,X)}})}}var g=this;g.select=a;g.unselect=b;g.reportSelection=f;g.daySelectionMousedown=e;var h=g.opt,m=g.trigger,p=g.defaultSelectionEnd,u=g.renderSelection,z=g.clearSelection,N=false;h("selectable")&&h("unselectAuto")&&l(document).mousedown(function(O){var r=h("unselectCancel");if(r)if(l(O.target).parents(r).length)return;b(O)})}function mb(){function a(h,m){var p=g.shift();p||(p=l("<div class='fc-cell-overlay' style='position:absolute;z-index:3'/>"));p[0].parentNode!= m[0]&&p.appendTo(m);e.push(p.css(h).show());return p}function b(){for(var h;h=e.shift();)g.push(h.hide().unbind())}var f=this;f.renderOverlay=a;f.clearOverlays=b;var e=[],g=[]}function pb(a){var b=this,f,e;b.build=function(){f=[];e=[];a(f,e)};b.cell=function(g,h){var m=f.length,p=e.length,u,z=-1,N=-1;for(u=0;u<m;u++)if(h>=f[u][0]&&h<f[u][1]){z=u;break}for(u=0;u<p;u++)if(g>=e[u][0]&&g<e[u][1]){N=u;break}return z>=0&&N>=0?{row:z,col:N}:null};b.rect=function(g,h,m,p,u){u=u.offset();return{top:f[g][0]- u.top,left:e[h][0]-u.left,width:e[p][1]-e[h][0],height:f[m][1]-f[g][0]}}}function qb(a){function b(p){p=a.cell(p.pageX,p.pageY);if(!p!=!m||p&&(p.row!=m.row||p.col!=m.col)){if(p){h||(h=p);g(p,h,p.row-h.row,p.col-h.col)}else g(p,h);m=p}}var f=this,e,g,h,m;f.start=function(p,u,z){g=p;h=m=null;a.build();b(u);e=z||"mousemove";l(document).bind(e,b)};f.stop=function(){l(document).unbind(e,b);return m}}function rb(a){function b(m){return e[m]=e[m]||a(m)}var f=this,e={},g={},h={};f.left=function(m){return g[m]= g[m]===ga?b(m).position().left:g[m]};f.right=function(m){return h[m]=h[m]===ga?f.left(m)+b(m).width():h[m]};f.clear=function(){e={};g={};h={}}}function Ta(a,b,f){a.setFullYear(a.getFullYear()+b);f||Ga(a);return a}function Ua(a,b,f){if(+a){b=a.getMonth()+b;var e=C(a);e.setDate(1);e.setMonth(b);a.setMonth(b);for(f||Ga(a);a.getMonth()!=e.getMonth();)a.setDate(a.getDate()+(a<e?1:-1))}return a}function S(a,b,f){if(+a){b=a.getDate()+b;var e=C(a);e.setHours(9);e.setDate(b);a.setDate(b);f||Ga(a);gb(a,e)}return a} function gb(a,b){if(+a)for(;a.getDate()!=b.getDate();)a.setTime(+a+(a<b?1:-1)*Rb)}function sa(a,b){a.setMinutes(a.getMinutes()+b);return a}function Ga(a){a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0);return a}function C(a,b){if(b)return Ga(new Date(+a));return new Date(+a)}function vb(){var a=0,b;do b=new Date(1970,a++,1);while(b.getHours());return b}function ta(a,b,f){for(b=b||1;!a.getDay()||f&&a.getDay()==1||!f&&a.getDay()==6;)S(a,b);return a}function Aa(a,b){return Math.round((C(a, true)-C(b,true))/kb)}function jb(a,b,f,e){if(b!==ga&&b!=a.getFullYear()){a.setDate(1);a.setMonth(0);a.setFullYear(b)}if(f!==ga&&f!=a.getMonth()){a.setDate(1);a.setMonth(f)}e!==ga&&a.setDate(e)}function Xa(a,b){if(typeof a=="object")return a;if(typeof a=="number")return new Date(a*1E3);if(typeof a=="string"){if(a.match(/^\d+$/))return new Date(parseInt(a,10)*1E3);if(b===ga)b=true;return Cb(a,b)||(a?new Date(a):null)}return null}function Cb(a,b){a=a.match(/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})([T ]([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?$/); if(!a)return null;var f=new Date(a[1],0,1);if(b||!a[14]){b=new Date(a[1],0,1,9,0);if(a[3]){f.setMonth(a[3]-1);b.setMonth(a[3]-1)}if(a[5]){f.setDate(a[5]);b.setDate(a[5])}gb(f,b);a[7]&&f.setHours(a[7]);a[8]&&f.setMinutes(a[8]);a[10]&&f.setSeconds(a[10]);a[12]&&f.setMilliseconds(Number("0."+a[12])*1E3);gb(f,b)}else{f.setUTCFullYear(a[1],a[3]?a[3]-1:0,a[5]||1);f.setUTCHours(a[7]||0,a[8]||0,a[10]||0,a[12]?Number("0."+a[12])*1E3:0);b=Number(a[16])*60+Number(a[17]);b*=a[15]=="-"?1:-1;f=new Date(+f+b*60* 1E3)}return f}function bb(a){if(typeof a=="number")return a*60;if(typeof a=="object")return a.getHours()*60+a.getMinutes();if(a=a.match(/(\d+)(?::(\d+))?\s*(\w+)?/)){var b=parseInt(a[1],10);if(a[3]){b%=12;if(a[3].toLowerCase().charAt(0)=="p")b+=12}return b*60+(a[2]?parseInt(a[2],10):0)}}function Ha(a,b,f){return Va(a,null,b,f)}function Va(a,b,f,e){e=e||Oa;var g=a,h=b,m,p=f.length,u,z,N,O="";for(m=0;m<p;m++){u=f.charAt(m);if(u=="'")for(z=m+1;z<p;z++){if(f.charAt(z)=="'"){if(g){O+=z==m+1?"'":f.substring(m+ 1,z);m=z}break}}else if(u=="(")for(z=m+1;z<p;z++){if(f.charAt(z)==")"){m=Ha(g,f.substring(m+1,z),e);if(parseInt(m.replace(/\D/,""),10))O+=m;m=z;break}}else if(u=="[")for(z=m+1;z<p;z++){if(f.charAt(z)=="]"){u=f.substring(m+1,z);m=Ha(g,u,e);if(m!=Ha(h,u,e))O+=m;m=z;break}}else if(u=="{"){g=b;h=a}else if(u=="}"){g=a;h=b}else{for(z=p;z>m;z--)if(N=Sb[f.substring(m,z)]){if(g)O+=N(g,e);m=z-1;break}if(z==m)if(g)O+=u}}return O}function Na(a){return a.end?Tb(a.end,a.allDay):S(C(a.start),1)}function Tb(a,b){a= C(a);return b||a.getHours()||a.getMinutes()?S(a,1):Ga(a)}function Ub(a,b){return(b.msLength-a.msLength)*100+(a.event.start-b.event.start)}function zb(a,b){return a.end>b.start&&a.start<b.end}function ab(a,b,f,e){var g=[],h,m=a.length,p,u,z,N,O;for(h=0;h<m;h++){p=a[h];u=p.start;z=b[h];if(z>f&&u<e){if(u<f){u=C(f);N=false}else{u=u;N=true}if(z>e){z=C(e);O=false}else{z=z;O=true}g.push({event:p,start:u,end:z,isStart:N,isEnd:O,msLength:z-u})}}return g.sort(Ub)}function $a(a){var b=[],f,e=a.length,g,h,m, p;for(f=0;f<e;f++){g=a[f];for(h=0;;){m=false;if(b[h])for(p=0;p<b[h].length;p++)if(zb(b[h][p],g)){m=true;break}if(m)h++;else break}if(b[h])b[h].push(g);else b[h]=[g]}return b}function xb(a,b,f){a.unbind("mouseover").mouseover(function(e){for(var g=e.target,h;g!=this;){h=g;g=g.parentNode}if((g=h._fci)!==ga){h._fci=ga;h=b[g];f(h.event,h.element,h);l(e.target).trigger(e)}e.stopPropagation()})}function Ia(a,b,f){a.each(function(e,g){g.style.width=Math.max(0,b-fb(g,f))+"px"})}function Pa(a,b,f){a.each(function(e, g){g.style.height=Math.max(0,b-Sa(g,f))+"px"})}function fb(a,b){return(parseFloat(l.curCSS(a,"paddingLeft",true))||0)+(parseFloat(l.curCSS(a,"paddingRight",true))||0)+(parseFloat(l.curCSS(a,"borderLeftWidth",true))||0)+(parseFloat(l.curCSS(a,"borderRightWidth",true))||0)+(b?Vb(a):0)}function Vb(a){return(parseFloat(l.curCSS(a,"marginLeft",true))||0)+(parseFloat(l.curCSS(a,"marginRight",true))||0)}function Sa(a,b){return(parseFloat(l.curCSS(a,"paddingTop",true))||0)+(parseFloat(l.curCSS(a,"paddingBottom", true))||0)+(parseFloat(l.curCSS(a,"borderTopWidth",true))||0)+(parseFloat(l.curCSS(a,"borderBottomWidth",true))||0)+(b?Bb(a):0)}function Bb(a){return(parseFloat(l.curCSS(a,"marginTop",true))||0)+(parseFloat(l.curCSS(a,"marginBottom",true))||0)}function Ra(a,b){b=typeof b=="number"?b+"px":b;a[0].style.cssText+=";min-height:"+b+";_height:"+b}function ib(){}function eb(a,b){return a-b}function Ab(a){return Math.max.apply(Math,a)}function Ma(a){return(a<10?"0":"")+a}function Wa(a,b){if(a[b]!==ga)return a[b]; b=b.split(/(?=[A-Z])/);for(var f=b.length-1,e;f>=0;f--){e=a[b[f].toLowerCase()];if(e!==ga)return e}return a[""]}function La(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#039;").replace(/"/g,"&quot;").replace(/\n/g,"<br />")}function yb(a){return a.id+"/"+a.className+"/"+a.style.cssText.replace(/(^|;)\s*(top|left|width|height)\s*:[^;]*/ig,"")}function ob(a){a.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})} var Oa={defaultView:"month",aspectRatio:1.35,header:{left:"title",center:"",right:"today prev,next"},weekends:true,allDayDefault:true,ignoreTimezone:true,lazyFetching:true,startParam:"start",endParam:"end",titleFormat:{month:"MMMM yyyy",week:"MMM d[ yyyy]{ '&#8212;'[ MMM] d yyyy}",day:"dddd, MMM d, yyyy"},columnFormat:{month:"ddd",week:"ddd M/d",day:"dddd M/d"},timeFormat:{"":"h(:mm)t"},isRTL:false,firstDay:0,monthNames:["January","February","March","April","May","June","July","August","September", "October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],buttonText:{prev:"&nbsp;&#9668;&nbsp;",next:"&nbsp;&#9658;&nbsp;",prevYear:"&nbsp;&lt;&lt;&nbsp;",nextYear:"&nbsp;&gt;&gt;&nbsp;",today:"today",month:"month",week:"week",day:"day"},theme:false,buttonIcons:{prev:"circle-triangle-w",next:"circle-triangle-e"}, unselectAuto:true,dropAccept:"*"},Wb={header:{left:"next,prev today",center:"",right:"title"},buttonText:{prev:"&nbsp;&#9658;&nbsp;",next:"&nbsp;&#9668;&nbsp;",prevYear:"&nbsp;&gt;&gt;&nbsp;",nextYear:"&nbsp;&lt;&lt;&nbsp;"},buttonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w"}},Ea=l.fullCalendar={version:"1.4.11"},Fa=Ea.views={};l.fn.fullCalendar=function(a){if(typeof a=="string"){var b=Array.prototype.slice.call(arguments,1),f;this.each(function(){var g=l.data(this,"fullCalendar");if(g&& l.isFunction(g[a])){g=g[a].apply(g,b);if(f===ga)f=g;a=="destroy"&&l.removeData(this,"fullCalendar")}});if(f!==ga)return f;return this}var e=a.eventSources||[];delete a.eventSources;if(a.events){e.push(a.events);delete a.events}a=l.extend(true,{},Oa,a.isRTL||a.isRTL===ga&&Oa.isRTL?Wb:{},a);this.each(function(g,h){g=l(h);h=new Db(g,a,e);g.data("fullCalendar",h);h.render()});return this};var Gb=1;Fa.month=Hb;Fa.basicWeek=Ib;Fa.basicDay=Jb;var Za;hb({weekMode:"fixed"});Fa.agendaWeek=Lb;Fa.agendaDay=Mb; hb({allDaySlot:true,allDayText:"all-day",firstHour:6,slotMinutes:30,defaultEventMinutes:120,axisFormat:"h(:mm)tt",timeFormat:{agenda:"h:mm{ - h:mm}"},dragOpacity:{agenda:0.5},minTime:0,maxTime:24});Ea.addDays=S;Ea.cloneDate=C;Ea.parseDate=Xa;Ea.parseISO8601=Cb;Ea.parseTime=bb;Ea.formatDate=Ha;Ea.formatDates=Va;var Ca=["sun","mon","tue","wed","thu","fri","sat"],kb=864E5,Rb=36E5,Qb=6E4,Sb={s:function(a){return a.getSeconds()},ss:function(a){return Ma(a.getSeconds())},m:function(a){return a.getMinutes()}, mm:function(a){return Ma(a.getMinutes())},h:function(a){return a.getHours()%12||12},hh:function(a){return Ma(a.getHours()%12||12)},H:function(a){return a.getHours()},HH:function(a){return Ma(a.getHours())},d:function(a){return a.getDate()},dd:function(a){return Ma(a.getDate())},ddd:function(a,b){return b.dayNamesShort[a.getDay()]},dddd:function(a,b){return b.dayNames[a.getDay()]},M:function(a){return a.getMonth()+1},MM:function(a){return Ma(a.getMonth()+1)},MMM:function(a,b){return b.monthNamesShort[a.getMonth()]}, MMMM:function(a,b){return b.monthNames[a.getMonth()]},yy:function(a){return(a.getFullYear()+"").substring(2)},yyyy:function(a){return a.getFullYear()},t:function(a){return a.getHours()<12?"a":"p"},tt:function(a){return a.getHours()<12?"am":"pm"},T:function(a){return a.getHours()<12?"A":"P"},TT:function(a){return a.getHours()<12?"AM":"PM"},u:function(a){return Ha(a,"yyyy-MM-dd'T'HH:mm:ss'Z'")},S:function(a){a=a.getDate();if(a>10&&a<20)return"th";return["st","nd","rd"][a%10-1]||"th"}}})(jQuery);
mit
markijbema/strict_struct
spec/spec_helper.rb
103
require 'rspec' $LOAD_PATH << './lib/' RSpec.configure do |c| c.raise_errors_for_deprecations! end
mit
tr-codegeneration/tr-codegeneration
src/ThomsonReuters.Languages/TypesLanguage/MoleculeSymbol.cs
1909
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using iSynaptic.Commons; using iSynaptic.Commons.Collections.Generic; namespace ThomsonReuters.Languages.TypesLanguage { public abstract class MoleculeSymbol : ISemanticNode, ISymbol, IAnnotatable { private Maybe<TypeLookup> _Base; protected MoleculeSymbol(ISymbol parent, IEnumerable<Annotation> annotations, bool isAbstract, Identifier name, Maybe<TypeLookup> @base, IEnumerable<AtomSymbol> properties) { Annotations = Guard.NotNull(annotations, "annotations") .GroupBy(x => x.Name) .ToDictionary(x => x.Key, x => new ReadOnlyCollection<Annotation>(x.ToList())) .ToReadOnlyDictionary(); Parent = Guard.NotNull(parent, "parent"); IsAbstract = isAbstract; Name = Guard.NotNull(name, "name"); _Base = @base; Properties = Guard.NotNull(properties, "properties").ToArray(); } public ISymbol Parent { get; private set; } Maybe<ISemanticNode> ISemanticNode.Parent { get { return Parent.ToMaybe<ISemanticNode>(); } } public QualifiedIdentifier FullName { get { return Parent.FullName + Name; } } public bool IsAbstract { get; private set; } public Identifier Name { get; private set; } public IEnumerable<AtomSymbol> Properties { get; private set; } public Maybe<MoleculeSymbol> Base { get { return _Base .Select(x => x.Type) .Cast<MoleculeSymbol>(); } } public ReadOnlyDictionary<Identifier, ReadOnlyCollection<Annotation>> Annotations { get; private set; } } }
mit
camsys/onebusaway-siri-api-v20
src/main/java/eu/datex2/schema/_2_0rc1/_2_0/SpeedPercentile.java
2906
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2014.11.22 at 01:45:09 PM EST // package eu.datex2.schema._2_0rc1._2_0; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for SpeedPercentile complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="SpeedPercentile"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="vehiclePercentage" type="{http://datex2.eu/schema/2_0RC1/2_0}Percentage"/> * &lt;element name="speedPercentile" type="{http://datex2.eu/schema/2_0RC1/2_0}KilometresPerHour"/> * &lt;element name="speedPercentileExtension" type="{http://datex2.eu/schema/2_0RC1/2_0}ExtensionType" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "SpeedPercentile", propOrder = { "vehiclePercentage", "speedPercentile", "speedPercentileExtension" }) public class SpeedPercentile { protected float vehiclePercentage; protected float speedPercentile; protected ExtensionType speedPercentileExtension; /** * Gets the value of the vehiclePercentage property. * */ public float getVehiclePercentage() { return vehiclePercentage; } /** * Sets the value of the vehiclePercentage property. * */ public void setVehiclePercentage(float value) { this.vehiclePercentage = value; } /** * Gets the value of the speedPercentile property. * */ public float getSpeedPercentile() { return speedPercentile; } /** * Sets the value of the speedPercentile property. * */ public void setSpeedPercentile(float value) { this.speedPercentile = value; } /** * Gets the value of the speedPercentileExtension property. * * @return * possible object is * {@link ExtensionType } * */ public ExtensionType getSpeedPercentileExtension() { return speedPercentileExtension; } /** * Sets the value of the speedPercentileExtension property. * * @param value * allowed object is * {@link ExtensionType } * */ public void setSpeedPercentileExtension(ExtensionType value) { this.speedPercentileExtension = value; } }
mit
SteveLillis/Syntaxiom
src/Syntaxiom.Liquid/Tokens/Parsers/IfChangedParser.cs
978
using System; using Syntaxiom.Nodes; using Syntaxiom.Nodes.TreeBuilders; using Syntaxiom.Tokens.Parsers; using Syntaxiom.Symbols.Factories; using Syntaxiom.Tokens; using Capture = Syntaxiom.Nodes.CaptureGlobalValue; namespace Syntaxiom.Liquid.Tokens.Parsers { public class IfChangedParser : ITokenParser { private readonly ISymbolFactory _symbolFactory; public IfChangedParser(ISymbolFactory symbolFactory) { if (symbolFactory == null) throw new ArgumentNullException(nameof(symbolFactory)); _symbolFactory = symbolFactory; } public void ParseToken(INodeTreeBuilder builder, IToken source) { if (builder == null) throw new ArgumentNullException(nameof(builder)); if (source == null) throw new ArgumentNullException(nameof(source)); builder.AttachAndMoveTo(new IfChanged(_symbolFactory)); } } }
mit
karldoenitz/karlooper
karlooper/web/__async_core_server.py
2492
# -*-coding:utf-8-*- """ __async_core_server ~~~~~~~~~~~~~~~~~~ introduction use python asyncore model to implement a async http server Usage ===== >>> EchoServer('0.0.0.0', port=8080, handlers={}, settings={}) >>> asyncore.loop() """ import logging import asyncore import socket from karlooper.http_parser.http_parser import HttpParser from karlooper.config.config import SOCKET_RECEIVE_SIZE, CLIENT_CONNECT_TO_SERVER_NUM from karlooper.utils import PY3 if PY3: unicode = str class EchoHandler(asyncore.dispatcher_with_send): def __init__(self, async_socket, handlers, settings): """async echo handler based on asyncore.dispatcher_with_send :param async_socket: the socket object :param handlers: handlers mapping :param settings: settings config """ self.logger = logging.getLogger() self.__handlers = handlers self.__settings = settings asyncore.dispatcher_with_send.__init__(self, sock=async_socket) def handle_read(self): try: if PY3: data = self.recv(SOCKET_RECEIVE_SIZE).decode("utf-8") else: data = self.recv(SOCKET_RECEIVE_SIZE) http_parser = HttpParser(data=data, handlers=self.__handlers, settings=self.__settings) response_data = http_parser.parse() while not (isinstance(response_data, str) or isinstance(response_data, unicode)): response_data = http_parser.parse() if PY3: response_data = response_data.encode('utf-8') self.send(response_data) except Exception as e: self.logger.info("echo handler error: %s" % str(e)) class EchoServer(asyncore.dispatcher): def __init__(self, host, port, handlers, settings): """async echo server based on asyncore.dispatcher :param host: http host :param port: http port :param handlers: handlers mapping :param settings: settings config """ self.__handlers = handlers self.__settings = settings asyncore.dispatcher.__init__(self) self.create_socket(socket.AF_INET, socket.SOCK_STREAM) self.set_reuse_addr() self.bind((host, port)) self.listen(CLIENT_CONNECT_TO_SERVER_NUM) def handle_accept(self): pair = self.accept() if pair is not None: sock, address = pair EchoHandler(sock, self.__handlers, self.__settings)
mit
mwpowellhtx/MicroMapper
src/MicroMapper/Mappers/StringMapper.cs
418
namespace MicroMapper.Mappers { public class StringMapper : IObjectMapper { public object Map(ResolutionContext context) { return context.SourceValue?.ToString(); } public bool IsMatch(ResolutionContext context) { return context.DestinationType == typeof (string) && context.SourceType != typeof (string); } } }
mit
dmpayton/reqon
reqon/coerce.py
1215
import datetime import json import dateutil.parser import pytz import rethinkdb as r import six from .geo import geojson_to_reql TIMEZONES = {tz: pytz.timezone(tz) for tz in pytz.all_timezones} def coerce(value): if isinstance(value, (list, tuple)): if len(value) == 2 and value[0] in COERSIONS: return COERSIONS[value[0]](value[1]) return [coerce(item) for item in value] if value == '$minval': return r.minval if value == '$maxval': return r.maxval return value def coerce_datetime(value): ''' ['$datetime', '1987-07-24 9:07pm'] ''' value = dateutil.parser.parse(value, tzinfos=TIMEZONES) if value.tzinfo is None: value = pytz.utc.localize(value) return value def coerce_date(value): ''' ['$date', '1987-07-24'] ''' value = coerce_datetime(value) return datetime.datetime(value.year, value.month, value.day, tzinfo=value.tzinfo) def coerce_time(value): ''' ['$time', '16:20'] ''' return coerce_datetime(value).time() COERSIONS = { '$date': coerce_date, '$time': coerce_time, '$datetime': coerce_datetime, '$geojson': geojson_to_reql, }
mit
impiaaa/MyWorldGen
src/main/java/net/boatcake/MyWorldGen/items/ItemWandSave.java
7279
package net.boatcake.MyWorldGen.items; import org.lwjgl.opengl.GL11; import net.boatcake.MyWorldGen.network.MessageGetSchemClient; import net.boatcake.MyWorldGen.utils.NetUtils; import net.boatcake.MyWorldGen.utils.WorldUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.VertexBuffer; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class ItemWandSave extends Item { public ItemWandSave() { this.maxStackSize = 1; MinecraftForge.EVENT_BUS.register(this); } @Override public boolean hasEffect(ItemStack stack) { return stack.hasTagCompound(); } @Override public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos blockPos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { if (!world.isRemote) { if (stack.hasTagCompound()) { /* * Step 2: While the client keeps a local copy of the blocks in * the world, it does not know any entity or tile entity data * until it's needed (e.g., the contents of a chest aren't sent * until the chest is opened; a villager's trades are not known * until the player talks to it). So, we the server to send back * what entities and tile entities are within the selected * region. */ // Step 3: The server receives the selection box from the // client. EntityPlayerMP playerMP = (EntityPlayerMP) player; /* * First we need to make sure that they're allowed to see chests * etc. I assume being in creative is good enough, I don't want * to implement a permissions system right now. */ if (playerMP.capabilities.isCreativeMode) { /* * Compile a response packet with both the original * selection box, as well as the entity and tile entity * data. We'll need the selection box in order to compile * block data later. */ MessageGetSchemClient message = new MessageGetSchemClient(); message.pos1 = new BlockPos(stack.getTagCompound().getInteger("x"), stack.getTagCompound().getInteger("y"), stack.getTagCompound().getInteger("z")); message.pos2 = blockPos; message.entitiesTag = WorldUtils.getEntities(playerMP.worldObj, message.pos1, message.pos2); message.tileEntitiesTag = WorldUtils.getTileEntities(playerMP.worldObj, message.pos1, message.pos2); NetUtils.sendTo(message, playerMP); } // Clear the item data, so that we can make a new selection stack.setTagCompound(null); } else { /* * START HERE Step 1: Find the first corner, and record it to * the item data. */ NBTTagCompound tag = new NBTTagCompound(); tag.setInteger("x", blockPos.getX()); tag.setInteger("y", blockPos.getY()); tag.setInteger("z", blockPos.getZ()); stack.setTagCompound(tag); } } return EnumActionResult.SUCCESS; } @SideOnly(Side.CLIENT) public static void translateToWorldCoords(Entity entity, float frame) { double interpPosX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * frame; double interpPosY = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * frame; double interpPosZ = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * frame; GlStateManager.translate(-interpPosX, -interpPosY, -interpPosZ); } @SideOnly(Side.CLIENT) @SubscribeEvent public void onWorldRender(RenderWorldLastEvent event) { Minecraft mc = Minecraft.getMinecraft(); EntityPlayerSP player = mc.thePlayer; if (player == null || mc.objectMouseOver == null) { return; } ItemStack wandStack = null; for (EnumHand hand : EnumHand.values()) { ItemStack heldStack = player.getHeldItem(hand); if (heldStack != null && heldStack.getItem() == this && heldStack.hasTagCompound()) { wandStack = heldStack; break; } } if (wandStack == null) { return; } BlockPos lookAtPos = mc.objectMouseOver.getBlockPos(); if (lookAtPos == null) { return; } NBTTagCompound tag = wandStack.getTagCompound(); double x1 = tag.getInteger("x"); double y1 = tag.getInteger("y"); double z1 = tag.getInteger("z"); double x2 = lookAtPos.getX(); double y2 = lookAtPos.getY(); double z2 = lookAtPos.getZ(); double t; if (x1 > x2) { x1 += 1.03125; x2 -= 0.03125; } else { t = x2 + 1.03125; x2 = x1 - 0.03125; x1 = t; } if (y1 > y2) { y1 += 1.03125; y2 -= 0.03125; } else { t = y2 + 1.03125; y2 = y1 - 0.03125; y1 = t; } if (z1 > z2) { z1 += 1.03125; z2 -= 0.03125; } else { t = z2 + 1.03125; z2 = z1 - 0.03125; z1 = t; } GlStateManager.enableCull(); GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); GlStateManager.disableLighting(); GlStateManager.disableTexture2D(); GlStateManager.color(0.5F, 0.75F, 1.0F, 0.5F); GlStateManager.pushMatrix(); Entity entity = Minecraft.getMinecraft().getRenderViewEntity(); translateToWorldCoords(entity, event.getPartialTicks()); Tessellator tess = Tessellator.getInstance(); VertexBuffer render = tess.getBuffer(); render.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); render.pos(x1, y1, z2).endVertex(); render.pos(x1, y2, z2).endVertex(); render.pos(x2, y2, z2).endVertex(); render.pos(x2, y1, z2).endVertex(); render.pos(x1, y1, z1).endVertex(); render.pos(x2, y1, z1).endVertex(); render.pos(x2, y2, z1).endVertex(); render.pos(x1, y2, z1).endVertex(); render.pos(x1, y1, z2).endVertex(); render.pos(x1, y1, z1).endVertex(); render.pos(x1, y2, z1).endVertex(); render.pos(x1, y2, z2).endVertex(); render.pos(x1, y2, z2).endVertex(); render.pos(x1, y2, z1).endVertex(); render.pos(x2, y2, z1).endVertex(); render.pos(x2, y2, z2).endVertex(); render.pos(x2, y2, z2).endVertex(); render.pos(x2, y2, z1).endVertex(); render.pos(x2, y1, z1).endVertex(); render.pos(x2, y1, z2).endVertex(); render.pos(x1, y1, z1).endVertex(); render.pos(x1, y1, z2).endVertex(); render.pos(x2, y1, z2).endVertex(); render.pos(x2, y1, z1).endVertex(); tess.draw(); GlStateManager.popMatrix(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.disableBlend(); GlStateManager.enableLighting(); GlStateManager.enableTexture2D(); } }
mit
ev-ui/ev-ui
lib/components/EvUI.js
5275
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _reactDom = require('react-dom'); var _Dialog = require('./Dialog.js'); var _Dialog2 = _interopRequireDefault(_Dialog); var _ContextMenu = require('./ContextMenu.js'); var _ContextMenu2 = _interopRequireDefault(_ContextMenu); var _Confirm = require('./Confirm.js'); var _Confirm2 = _interopRequireDefault(_Confirm); var _Drawer = require('./Drawer.js'); var _Drawer2 = _interopRequireDefault(_Drawer); var _Loading = require('./Loading.js'); var _Loading2 = _interopRequireDefault(_Loading); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var EvUI = function (_React$Component) { _inherits(EvUI, _React$Component); function EvUI(props) { _classCallCheck(this, EvUI); var _this = _possibleConstructorReturn(this, (EvUI.__proto__ || Object.getPrototypeOf(EvUI)).call(this, props)); _this.state = { mainBlur: false, dialogs: [], ctxMenu: null, confirm: null, drawer: null, loading: null }; return _this; } _createClass(EvUI, [{ key: 'componentDidMount', value: function componentDidMount() { _Dialog2.default.subscribe(this.onDialogChange.bind(this)); _ContextMenu2.default.subscribe(this.onContextMenuChange.bind(this)); _Confirm2.default.subscribe(this.onConfirmChange.bind(this)); _Drawer2.default.subscribe(this.onDrawerChange.bind(this)); _Loading2.default.subscribe(this.onLoadingChange.bind(this)); } }, { key: 'onDialogChange', value: function onDialogChange() { this.setState({ dialogs: _Dialog2.default.dialogs, mainBlur: _Dialog2.default.dialogs.some(function (d) { return d.mainBlur; }) }); } }, { key: 'onContextMenuChange', value: function onContextMenuChange() { this.setState({ ctxMenu: _ContextMenu2.default.view }); } }, { key: 'onConfirmChange', value: function onConfirmChange() { this.setState({ confirm: _Confirm2.default.view, mainBlur: _Confirm2.default.view !== null }); } }, { key: 'onDrawerChange', value: function onDrawerChange() { this.setState({ drawer: _Drawer2.default.view }); } }, { key: 'onLoadingChange', value: function onLoadingChange() { this.setState({ loading: _Loading2.default.view, mainBlur: _Loading2.default.view !== null }); } }, { key: 'render', value: function render() { return _react2.default.createElement( 'div', this.props, _react2.default.createElement( 'div', { id: 'app-main', style: { filter: this.state.mainBlur ? 'blur(7px) brightness(80%)' : 'none' } }, this.props.children ), this.state.drawer ? _Drawer2.default.view : '', this.state.dialogs.map(function (d, i) { return d.dialog; }), this.state.ctxMenu ? _ContextMenu2.default.view : '', this.state.confirm ? _Confirm2.default.view : '', this.state.loading ? _Loading2.default.view : '' ); } }]); return EvUI; }(_react2.default.Component); exports.default = EvUI;
mit
tilap/piggy
src/modules/user/Vo.js
234
import Vo from 'piggy-module/lib/Vo'; import config from './config'; export default class User extends Vo { constructor(data) { super(data); } toString() { return this.username; } } Vo.init(User, config.attributes);
mit
tedliang/osworkflow
src/test/com/opensymphony/workflow/spi/memory/MemoryFunctionalWorkflowTestCase.java
855
/* * Copyright (c) 2002-2003 by OpenSymphony * All rights reserved. */ package com.opensymphony.workflow.spi.memory; import com.opensymphony.workflow.spi.AbstractFunctionalWorkflowTest; /** * This test case is functional in that it attempts to validate the entire * lifecycle of a workflow. This is also a good resource for beginners * to OSWorkflow. * * @author Eric Pugh (epugh@upstate.com) */ public class MemoryFunctionalWorkflowTestCase extends AbstractFunctionalWorkflowTest { //~ Constructors /////////////////////////////////////////////////////////// public MemoryFunctionalWorkflowTestCase(String s) { super(s); } //~ Methods //////////////////////////////////////////////////////////////// protected void setUp() throws Exception { MemoryWorkflowStore.reset(); super.setUp(); } }
mit
Patchthesock/DisasterRecovery
DisasterRecovery/DisasterRecoveryAPI/Areas/HelpPage/ModelDescriptions/ComplexTypeModelDescription.cs
393
using System.Collections.ObjectModel; namespace DisasterRecoveryAPI.Areas.HelpPage.ModelDescriptions { public class ComplexTypeModelDescription : ModelDescription { public ComplexTypeModelDescription() { Properties = new Collection<ParameterDescription>(); } public Collection<ParameterDescription> Properties { get; private set; } } }
mit
kedarmhaswade/impatiently-j8
src/main/java/tmp/StreamOf.java
403
package tmp; import java.util.Arrays; import java.util.stream.Stream; /** * Created by kmhaswade on 2/23/16. */ public class StreamOf { public static void main(String[] args) { //does not do what you want! int[] ints = {1, 2, 3}; System.out.println(Stream.of(ints).count()); //does what you want! Arrays.stream(ints).forEach(System.out::println); } }
mit
dmtrKovalenko/material-ui-pickers
lib/src/_shared/hooks/date-helpers-hooks.tsx
1658
import * as React from 'react'; import { useUtils } from './useUtils'; import { ParsableDate } from '../../constants/prop-types'; export type OverrideParsableDateProps<TDate, TProps, TKey extends keyof TProps> = Omit< TProps, TKey > & Partial<Record<TKey, ParsableDate<TDate>>>; export function useParsedDate<TDate>( possiblyUnparsedValue: ParsableDate<TDate> ): TDate | undefined { const utils = useUtils<TDate>(); return React.useMemo( () => typeof possiblyUnparsedValue === 'undefined' ? undefined : utils.date(possiblyUnparsedValue)!, [possiblyUnparsedValue, utils] ); } interface MonthValidationOptions { disablePast?: boolean; disableFuture?: boolean; minDate: unknown; maxDate: unknown; } export function useNextMonthDisabled( month: unknown, { disableFuture, maxDate }: Pick<MonthValidationOptions, 'disableFuture' | 'maxDate'> ) { const utils = useUtils(); return React.useMemo(() => { const now = utils.date(); const lastEnabledMonth = utils.startOfMonth( disableFuture && utils.isBefore(now, maxDate) ? now : maxDate ); return !utils.isAfter(lastEnabledMonth, month); }, [disableFuture, maxDate, month, utils]); } export function usePreviousMonthDisabled( month: unknown, { disablePast, minDate }: Pick<MonthValidationOptions, 'disablePast' | 'minDate'> ) { const utils = useUtils(); return React.useMemo(() => { const now = utils.date(); const firstEnabledMonth = utils.startOfMonth( disablePast && utils.isAfter(now, minDate) ? now : minDate ); return !utils.isBefore(firstEnabledMonth, month); }, [disablePast, minDate, month, utils]); }
mit
Zauberstuhl/jsxc
src/jsxc.lib.gui.js
88249
/* global Favico, emojione*/ /** * Handle functions for chat window's and buddylist * * @namespace jsxc.gui */ jsxc.gui = { /** Smilie token to file mapping */ emotions: [ ['O:-) O:)', 'innocent'], ['>:-( >:( &gt;:-( &gt;:(', 'angry'], [':-) :)', 'slight_smile'], [':-D :D', 'grin'], [':-( :(', 'disappointed'], [';-) ;)', 'wink'], [':-P :P', 'stuck_out_tongue'], ['=-O', 'astonished'], [':kiss: :-*', 'kissing_heart'], ['8-) :cool:', 'sunglasses'], [':-X :X', 'zipper_mouth'], [':yes:', 'thumbsup'], [':no:', 'thumbsdown'], [':beer:', 'beer'], [':coffee:', 'coffee'], [':devil:', 'smiling_imp'], [':kiss: :kissing:', 'kissing'], ['@->-- @-&gt;--', 'rose'], [':music:', 'musical_note'], [':love:', 'heart_eyes'], [':heart:', 'heart'], [':brokenheart:', 'broken_heart'], [':zzz:', 'zzz'], [':wait:', 'hand_splayed'] ], favicon: null, regShortNames: null, emoticonList: { 'core': { ':klaus:': ['klaus'], ':jabber:': ['jabber'], ':xmpp:': ['xmpp'], ':jsxc:': ['jsxc'], ':owncloud:': ['owncloud'] }, 'emojione': emojione.emojioneList }, /** * Different uri query actions as defined in XEP-0147. * * @namespace jsxc.gui.queryActions */ queryActions: { /** xmpp:JID?message[;body=TEXT] */ message: function(jid, params) { var win = jsxc.gui.window.open(jsxc.jidToBid(jid)); if (params && typeof params.body === 'string') { win.find('.jsxc_textinput').val(params.body); } }, /** xmpp:JID?remove */ remove: function(jid) { jsxc.gui.showRemoveDialog(jsxc.jidToBid(jid)); }, /** xmpp:JID?subscribe[;name=NAME] */ subscribe: function(jid, params) { jsxc.gui.showContactDialog(jid); if (params && typeof params.name) { $('#jsxc_alias').val(params.name); } }, /** xmpp:JID?vcard */ vcard: function(jid) { jsxc.gui.showVcard(jid); }, /** xmpp:JID?join[;password=TEXT] */ join: function(jid, params) { var password = (params && params.password) ? params.password : null; jsxc.muc.showJoinChat(jid, password); } }, /** * Creates application skeleton. * * @memberOf jsxc.gui */ init: function() { // Prevent duplicate windowList if ($('#jsxc_windowList').length > 0) { return; } jsxc.gui.regShortNames = new RegExp(emojione.regShortNames.source + '|(' + Object.keys(jsxc.gui.emoticonList.core).join('|') + ')', 'gi'); $('body').append($(jsxc.gui.template.get('windowList'))); $(window).resize(jsxc.gui.updateWindowListSB); $('#jsxc_windowList').resize(jsxc.gui.updateWindowListSB); $('#jsxc_windowListSB .jsxc_scrollLeft').click(function() { jsxc.gui.scrollWindowListBy(-200); }); $('#jsxc_windowListSB .jsxc_scrollRight').click(function() { jsxc.gui.scrollWindowListBy(200); }); $('#jsxc_windowList').on('wheel', function(ev) { if ($('#jsxc_windowList').data('isOver')) { jsxc.gui.scrollWindowListBy((ev.originalEvent.wheelDelta > 0) ? 200 : -200); } }); jsxc.gui.tooltip('#jsxc_windowList'); var fo = jsxc.options.get('favicon'); if (fo && fo.enable) { jsxc.gui.favicon = new Favico({ animation: 'pop', bgColor: fo.bgColor, textColor: fo.textColor }); jsxc.gui.favicon.badge(jsxc.storage.getUserItem('unreadMsg') || 0); } if (!jsxc.el_exists('#jsxc_roster')) { jsxc.gui.roster.init(); } // prepare regexp for emotions $.each(jsxc.gui.emotions, function(i, val) { // escape characters var reg = val[0].replace(/(\/|\||\*|\.|\+|\?|\^|\$|\(|\)|\[|\]|\{|\})/g, '\\$1'); reg = '(' + reg.split(' ').join('|') + ')'; jsxc.gui.emotions[i][2] = new RegExp(reg, 'g'); }); // We need this often, so we creates some template jquery objects jsxc.gui.windowTemplate = $(jsxc.gui.template.get('chatWindow')); jsxc.gui.buddyTemplate = $(jsxc.gui.template.get('rosterBuddy')); }, /** * Init tooltip plugin for given jQuery selector. * * @param {String} selector jQuery selector * @memberOf jsxc.gui */ tooltip: function(selector) { $(selector).tooltip({ show: { delay: 600 }, content: function() { return $(this).attr('title').replace(/\n/g, '<br />'); } }); }, /** * Updates Information in roster and chatbar * * @param {String} bid bar jid */ update: function(bid) { var data = jsxc.storage.getUserItem('buddy', bid); if (!data) { jsxc.debug('No data for ' + bid); return; } var ri = jsxc.gui.roster.getItem(bid); // roster item from user var we = jsxc.gui.window.get(bid); // window element from user var ue = ri.add(we); // both var spot = $('.jsxc_spot[data-bid="' + bid + '"]'); // Attach data to corresponding roster item ri.data(data); // Add online status jsxc.gui.updatePresence(bid, jsxc.CONST.STATUS[data.status]); // Change name and add title ue.find('.jsxc_name:first').add(spot).text(data.name).attr('title', $.t('is_', { status: $.t(jsxc.CONST.STATUS[data.status]) })); // Update gui according to encryption state switch (data.msgstate) { case 0: we.find('.jsxc_transfer').removeClass('jsxc_enc jsxc_fin').attr('title', $.t('your_connection_is_unencrypted')); we.find('.jsxc_settings .jsxc_verification').addClass('jsxc_disabled'); we.find('.jsxc_settings .jsxc_transfer').text($.t('start_private')); break; case 1: we.find('.jsxc_transfer').addClass('jsxc_enc').attr('title', $.t('your_connection_is_encrypted')); we.find('.jsxc_settings .jsxc_verification').removeClass('jsxc_disabled'); we.find('.jsxc_settings .jsxc_transfer').text($.t('close_private')); break; case 2: we.find('.jsxc_settings .jsxc_verification').addClass('jsxc_disabled'); we.find('.jsxc_transfer').removeClass('jsxc_enc').addClass('jsxc_fin').attr('title', $.t('your_buddy_closed_the_private_connection')); we.find('.jsxc_settings .jsxc_transfer').text($.t('close_private')); break; } // update gui according to verification state if (data.trust) { we.find('.jsxc_transfer').addClass('jsxc_trust').attr('title', $.t('your_buddy_is_verificated')); } else { we.find('.jsxc_transfer').removeClass('jsxc_trust'); } // update gui according to subscription state if (data.sub && data.sub !== 'both') { ue.addClass('jsxc_oneway'); } else { ue.removeClass('jsxc_oneway'); } var info = Strophe.getBareJidFromJid(data.jid) + '\n'; info += $.t('Subscription') + ': ' + $.t(data.sub) + '\n'; info += $.t('Status') + ': ' + $.t(jsxc.CONST.STATUS[data.status]); ri.find('.jsxc_name').attr('title', info); jsxc.gui.updateAvatar(ri.add(we.find('.jsxc_bar')), data.jid, data.avatar); }, /** * Update avatar on all given elements. * * @memberOf jsxc.gui * @param {jQuery} el Elements with subelement .jsxc_avatar * @param {string} jid Jid * @param {string} aid Avatar id (sha1 hash of image) */ updateAvatar: function(el, jid, aid) { var setAvatar = function(src) { if (src === 0 || src === '0') { if (typeof jsxc.options.defaultAvatar === 'function') { jsxc.options.defaultAvatar.call(el, jid); return; } jsxc.gui.avatarPlaceholder(el.find('.jsxc_avatar'), jid); return; } el.find('.jsxc_avatar').removeAttr('style'); el.find('.jsxc_avatar').css({ 'background-image': 'url(' + src + ')', 'text-indent': '999px' }); }; if (typeof aid === 'undefined') { setAvatar(0); return; } var avatarSrc = jsxc.storage.getUserItem('avatar', aid); if (avatarSrc !== null) { setAvatar(avatarSrc); } else { var handler_cb = function(stanza) { jsxc.debug('vCard', stanza); var vCard = $(stanza).find("vCard > PHOTO"); var src; if (vCard.length === 0) { jsxc.debug('No photo provided'); src = '0'; } else if (vCard.find('EXTVAL').length > 0) { src = vCard.find('EXTVAL').text(); } else { var img = vCard.find('BINVAL').text(); var type = vCard.find('TYPE').text(); src = 'data:' + type + ';base64,' + img; } // concat chunks src = src.replace(/[\t\r\n\f]/gi, ''); jsxc.storage.setUserItem('avatar', aid, src); setAvatar(src); }; var error_cb = function(msg) { jsxc.warn('Could not load vcard.', msg); jsxc.storage.setUserItem('avatar', aid, 0); setAvatar(0); }; // workaround for https://github.com/strophe/strophejs/issues/172 if (Strophe.getBareJidFromJid(jid) === Strophe.getBareJidFromJid(jsxc.xmpp.conn.jid)) { jsxc.xmpp.conn.vcard.get(handler_cb, error_cb); } else { jsxc.xmpp.conn.vcard.get(handler_cb, Strophe.getBareJidFromJid(jid), error_cb); } } }, /** * Updates scrollbar handlers. * * @memberOf jsxc.gui */ updateWindowListSB: function() { if ($('#jsxc_windowList>ul').width() > $('#jsxc_windowList').width()) { $('#jsxc_windowListSB > div').removeClass('jsxc_disabled'); } else { $('#jsxc_windowListSB > div').addClass('jsxc_disabled'); $('#jsxc_windowList>ul').css('right', '0px'); } }, /** * Scroll window list by offset. * * @memberOf jsxc.gui * @param offset */ scrollWindowListBy: function(offset) { var scrollWidth = $('#jsxc_windowList>ul').width(); var width = $('#jsxc_windowList').width(); var el = $('#jsxc_windowList>ul'); var right = parseInt(el.css('right')) - offset; var padding = $("#jsxc_windowListSB").width(); if (scrollWidth < width) { return; } if (right > 0) { right = 0; } if (right < width - scrollWidth - padding) { right = width - scrollWidth - padding; } el.css('right', right + 'px'); }, /** * Returns the window element * * @deprecated Use {@link jsxc.gui.window.get} instead. * @param {String} bid * @returns {jquery} jQuery object of the window element */ getWindow: function(bid) { jsxc.warn('jsxc.gui.getWindow is deprecated!'); return jsxc.gui.window.get(bid); }, /** * Toggle list with timeout, like menu or settings * * @memberof jsxc.gui */ toggleList: function(el) { var self = el || $(this); self.disableSelection(); self.addClass('jsxc_list'); var ul = self.find('ul'); var slideUp = null; slideUp = function() { self.removeClass('jsxc_opened'); $('body').off('click', null, slideUp); }; $(this).click(function() { if (!self.hasClass('jsxc_opened')) { // hide other lists $('body').click(); $('body').one('click', slideUp); } else { $('body').off('click', null, slideUp); } window.clearTimeout(ul.data('timer')); self.toggleClass('jsxc_opened'); return false; }).mouseleave(function() { ul.data('timer', window.setTimeout(slideUp, 2000)); }).mouseenter(function() { window.clearTimeout(ul.data('timer')); }); }, /** * Creates and show loginbox */ showLoginBox: function() { // Set focus to password field $(document).on("complete.dialog.jsxc", function() { $('#jsxc_password').focus(); }); jsxc.gui.dialog.open(jsxc.gui.template.get('loginBox')); var alert = $('#jsxc_dialog').find('.jsxc_alert'); alert.hide(); $('#jsxc_dialog').find('form').submit(function(ev) { ev.preventDefault(); $(this).find('button[data-jsxc-loading-text]').trigger('btnloading.jsxc'); jsxc.options.loginForm.form = $(this); jsxc.options.loginForm.jid = $(this).find('#jsxc_username'); jsxc.options.loginForm.pass = $(this).find('#jsxc_password'); jsxc.triggeredFromBox = true; jsxc.options.loginForm.triggered = false; jsxc.prepareLogin(function(settings) { if (settings === false) { onAuthFail(); } else { $(document).on('authfail.jsxc', onAuthFail); jsxc.xmpp.login(); } }); }); function onAuthFail() { alert.show(); jsxc.gui.dialog.resize(); $('#jsxc_dialog').find('button').trigger('btnfinished.jsxc'); $('#jsxc_dialog').find('input').one('keypress', function() { alert.hide(); jsxc.gui.dialog.resize(); }); } }, /** * Creates and show the fingerprint dialog * * @param {String} bid */ showFingerprints: function(bid) { jsxc.gui.dialog.open(jsxc.gui.template.get('fingerprintsDialog', bid)); }, /** * Creates and show the verification dialog * * @param {String} bid */ showVerification: function(bid) { // Check if there is a open dialog if ($('#jsxc_dialog').length > 0) { setTimeout(function() { jsxc.gui.showVerification(bid); }, 3000); return; } // verification only possible if the connection is encrypted if (jsxc.storage.getUserItem('buddy', bid).msgstate !== OTR.CONST.MSGSTATE_ENCRYPTED) { jsxc.warn('Connection not encrypted'); return; } jsxc.gui.dialog.open(jsxc.gui.template.get('authenticationDialog', bid), { name: 'smp' }); // Add handler $('#jsxc_dialog > div:gt(0)').hide(); $('#jsxc_dialog > div:eq(0) button').click(function() { $(this).siblings().removeClass('active'); $(this).addClass('active'); $(this).get(0).blur(); $('#jsxc_dialog > div:gt(0)').hide(); $('#jsxc_dialog > div:eq(' + ($(this).index() + 1) + ')').show().find('input:first').focus(); }); // Manual $('#jsxc_dialog > div:eq(1) .jsxc_submit').click(function() { if (jsxc.master) { jsxc.otr.objects[bid].trust = true; } jsxc.storage.updateUserItem('buddy', bid, 'trust', true); jsxc.gui.dialog.close('smp'); jsxc.storage.updateUserItem('buddy', bid, 'trust', true); jsxc.gui.window.postMessage({ bid: bid, direction: jsxc.Message.SYS, msg: $.t('conversation_is_now_verified') }); jsxc.gui.update(bid); }); // Question $('#jsxc_dialog > div:eq(2) .jsxc_submit').click(function() { var div = $('#jsxc_dialog > div:eq(2)'); var sec = div.find('#jsxc_secret2').val(); var quest = div.find('#jsxc_quest').val(); if (sec === '' || quest === '') { // Add information for the user which form is missing div.find('input[value=""]').addClass('jsxc_invalid').keyup(function() { if ($(this).val().match(/.*/)) { $(this).removeClass('jsxc_invalid'); } }); return; } if (jsxc.master) { jsxc.otr.sendSmpReq(bid, sec, quest); } else { jsxc.storage.setUserItem('smp', bid, { sec: sec, quest: quest }); } jsxc.gui.dialog.close('smp'); jsxc.gui.window.postMessage({ bid: bid, direction: jsxc.Message.SYS, msg: $.t('authentication_query_sent') }); }); // Secret $('#jsxc_dialog > div:eq(3) .jsxc_submit').click(function() { var div = $('#jsxc_dialog > div:eq(3)'); var sec = div.find('#jsxc_secret').val(); if (sec === '') { // Add information for the user which form is missing div.find('#jsxc_secret').addClass('jsxc_invalid').keyup(function() { if ($(this).val().match(/.*/)) { $(this).removeClass('jsxc_invalid'); } }); return; } if (jsxc.master) { jsxc.otr.sendSmpReq(bid, sec); } else { jsxc.storage.setUserItem('smp', bid, { sec: sec, quest: null }); } jsxc.gui.dialog.close('smp'); jsxc.gui.window.postMessage({ bid: bid, direction: 'sys', msg: $.t('authentication_query_sent') }); }); }, /** * Create and show approve dialog * * @param {type} from valid jid */ showApproveDialog: function(from) { jsxc.gui.dialog.open(jsxc.gui.template.get('approveDialog'), { 'noClose': true }); $('#jsxc_dialog .jsxc_their_jid').text(Strophe.getBareJidFromJid(from)); $('#jsxc_dialog .jsxc_deny').click(function(ev) { ev.stopPropagation(); jsxc.xmpp.resFriendReq(from, false); jsxc.gui.dialog.close(); }); $('#jsxc_dialog .jsxc_approve').click(function(ev) { ev.stopPropagation(); var data = jsxc.storage.getUserItem('buddy', jsxc.jidToBid(from)); jsxc.xmpp.resFriendReq(from, true); // If friendship is not mutual show contact dialog if (!data || data.sub === 'from') { jsxc.gui.showContactDialog(from); } }); }, /** * Create and show dialog to add a buddy * * @param {string} [username] jabber id */ showContactDialog: function(username) { jsxc.gui.dialog.open(jsxc.gui.template.get('contactDialog')); // If we got a friendship request, we would display the username in our // response if (username) { $('#jsxc_username').val(username); } $('#jsxc_username').keyup(function() { if (typeof jsxc.options.getUsers === 'function') { var val = $(this).val(); $('#jsxc_userlist').empty(); if (val !== '') { jsxc.options.getUsers.call(this, val, function(list) { $.each(list || {}, function(uid, displayname) { var option = $('<option>'); option.attr('data-username', uid); option.attr('data-alias', displayname); option.attr('value', uid).appendTo('#jsxc_userlist'); if (uid !== displayname) { option.clone().attr('value', displayname).appendTo('#jsxc_userlist'); } }); }); } } }); $('#jsxc_username').on('input', function() { var val = $(this).val(); var option = $('#jsxc_userlist').find('option[data-username="' + val + '"], option[data-alias="' + val + '"]'); if (option.length > 0) { $('#jsxc_username').val(option.attr('data-username')); $('#jsxc_alias').val(option.attr('data-alias')); } }); $('#jsxc_dialog form').submit(function(ev) { ev.preventDefault(); var username = $('#jsxc_username').val(); var alias = $('#jsxc_alias').val(); if (!username.match(/@(.*)$/)) { username += '@' + Strophe.getDomainFromJid(jsxc.storage.getItem('jid')); } // Check if the username is valid if (!username || !username.match(jsxc.CONST.REGEX.JID)) { // Add notification $('#jsxc_username').addClass('jsxc_invalid').keyup(function() { if ($(this).val().match(jsxc.CONST.REGEX.JID)) { $(this).removeClass('jsxc_invalid'); } }); return false; } jsxc.xmpp.addBuddy(username, alias); jsxc.gui.dialog.close(); return false; }); }, /** * Create and show dialog to remove a buddy * * @param {type} bid * @returns {undefined} */ showRemoveDialog: function(bid) { jsxc.gui.dialog.open(jsxc.gui.template.get('removeDialog', bid)); var data = jsxc.storage.getUserItem('buddy', bid); $('#jsxc_dialog .jsxc_remove').click(function(ev) { ev.stopPropagation(); if (jsxc.master) { jsxc.xmpp.removeBuddy(data.jid); } else { // inform master jsxc.storage.setUserItem('deletebuddy', bid, { jid: data.jid }); } jsxc.gui.dialog.close(); }); }, /** * Create and show a wait dialog * * @param {type} msg message to display to the user * @returns {undefined} */ showWaitAlert: function(msg) { jsxc.gui.dialog.open(jsxc.gui.template.get('waitAlert', null, msg), { 'noClose': true }); }, /** * Create and show a wait dialog * * @param {type} msg message to display to the user * @returns {undefined} */ showAlert: function(msg) { jsxc.gui.dialog.open(jsxc.gui.template.get('alert', null, msg)); }, /** * Create and show a auth fail dialog * * @returns {undefined} */ showAuthFail: function() { jsxc.gui.dialog.open(jsxc.gui.template.get('authFailDialog')); if (jsxc.options.loginForm.triggered !== false) { $('#jsxc_dialog .jsxc_cancel').hide(); } $('#jsxc_dialog .jsxc_retry').click(function() { jsxc.gui.dialog.close(); }); $('#jsxc_dialog .jsxc_cancel').click(function() { jsxc.submitLoginForm(); }); }, /** * Create and show a confirm dialog * * @param {String} msg Message * @param {function} confirm * @param {function} dismiss * @returns {undefined} */ showConfirmDialog: function(msg, confirm, dismiss) { jsxc.gui.dialog.open(jsxc.gui.template.get('confirmDialog', null, msg), { noClose: true }); if (confirm) { $('#jsxc_dialog .jsxc_confirm').click(confirm); } if (dismiss) { $('#jsxc_dialog .jsxc_dismiss').click(dismiss); } }, /** * Show about dialog. * * @memberOf jsxc.gui */ showAboutDialog: function() { jsxc.gui.dialog.open(jsxc.gui.template.get('aboutDialog')); $('#jsxc_dialog .jsxc_debuglog').click(function() { jsxc.gui.showDebugLog(); }); }, /** * Show debug log. * * @memberOf jsxc.gui */ showDebugLog: function() { var userInfo = '<h3>User information</h3>'; if (navigator) { var key; for (key in navigator) { if (typeof navigator[key] === 'string') { userInfo += '<b>' + key + ':</b> ' + navigator[key] + '<br />'; } } } if ($.fn && $.fn.jquery) { userInfo += '<b>jQuery:</b> ' + $.fn.jquery + '<br />'; } if (window.screen) { userInfo += '<b>Height:</b> ' + window.screen.height + '<br />'; userInfo += '<b>Width:</b> ' + window.screen.width + '<br />'; } userInfo += '<b>jsxc version:</b> ' + jsxc.version + '<br />'; jsxc.gui.dialog.open('<div class="jsxc_log">' + userInfo + '<h3>Log</h3><pre>' + jsxc.escapeHTML(jsxc.log) + '</pre></div>'); }, /** * Show vCard of user with the given bar jid. * * @memberOf jsxc.gui * @param {String} jid */ showVcard: function(jid) { var bid = jsxc.jidToBid(jid); jsxc.gui.dialog.open(jsxc.gui.template.get('vCard', bid)); var data = jsxc.storage.getUserItem('buddy', bid); if (data) { // Display resources and corresponding information var i, j, res, identities, identity = null, cap, client; for (i = 0; i < data.res.length; i++) { res = data.res[i]; identities = []; cap = jsxc.xmpp.getCapabilitiesByJid(bid + '/' + res); if (cap !== null && cap.identities !== null) { identities = cap.identities; } client = ''; for (j = 0; j < identities.length; j++) { identity = identities[j]; if (identity.category === 'client') { if (client !== '') { client += ',\n'; } client += identity.name + ' (' + identity.type + ')'; } } var status = jsxc.storage.getUserItem('res', bid)[res]; $('#jsxc_dialog ul.jsxc_vCard').append('<li class="jsxc_sep"><strong>' + $.t('Resource') + ':</strong> ' + res + '</li>'); $('#jsxc_dialog ul.jsxc_vCard').append('<li><strong>' + $.t('Client') + ':</strong> ' + client + '</li>'); $('#jsxc_dialog ul.jsxc_vCard').append('<li><strong>' + $.t('Status') + ':</strong> ' + $.t(jsxc.CONST.STATUS[status]) + '</li>'); } } var printProp = function(el, depth) { var content = ''; el.each(function() { var item = $(this); var children = $(this).children(); content += '<li>'; var prop = $.t(item[0].tagName); if (prop !== ' ') { content += '<strong>' + prop + ':</strong> '; } if (item[0].tagName === 'PHOTO') { } else if (children.length > 0) { content += '<ul>'; content += printProp(children, depth + 1); content += '</ul>'; } else if (item.text() !== '') { content += jsxc.escapeHTML(item.text()); } content += '</li>'; if (depth === 0 && $('#jsxc_dialog ul.jsxc_vCard').length > 0) { if ($('#jsxc_dialog ul.jsxc_vCard li.jsxc_sep:first').length > 0) { $('#jsxc_dialog ul.jsxc_vCard li.jsxc_sep:first').before(content); } else { $('#jsxc_dialog ul.jsxc_vCard').append(content); } content = ''; } }); if (depth > 0) { return content; } }; var failedToLoad = function() { if ($('#jsxc_dialog ul.jsxc_vCard').length === 0) { return; } $('#jsxc_dialog p').remove(); var content = '<p>'; content += $.t('Sorry_your_buddy_doesnt_provide_any_information'); content += '</p>'; $('#jsxc_dialog').append(content); }; jsxc.xmpp.loadVcard(bid, function(stanza) { if ($('#jsxc_dialog ul.jsxc_vCard').length === 0) { return; } $('#jsxc_dialog p').remove(); var photo = $(stanza).find("vCard > PHOTO"); if (photo.length > 0) { var img = photo.find('BINVAL').text(); var type = photo.find('TYPE').text(); var src = 'data:' + type + ';base64,' + img; if (photo.find('EXTVAL').length > 0) { src = photo.find('EXTVAL').text(); } // concat chunks src = src.replace(/[\t\r\n\f]/gi, ''); var img_el = $('<img class="jsxc_vCard" alt="avatar" />'); img_el.attr('src', src); $('#jsxc_dialog h3').before(img_el); } if ($(stanza).find('vCard').length === 0 || ($(stanza).find('vcard > *').length === 1 && photo.length === 1)) { failedToLoad(); return; } printProp($(stanza).find('vcard > *'), 0); }, failedToLoad); }, showSettings: function() { jsxc.gui.dialog.open(jsxc.gui.template.get('settings')); if (jsxc.options.get('xmpp').overwrite === 'false' || jsxc.options.get('xmpp').overwrite === false) { $('.jsxc_fieldsetXmpp').parent().hide(); } $('#jsxc_dialog form').each(function() { var self = $(this); self.find('input[type!="submit"]').each(function() { var id = this.id.split("-"); var prop = id[0]; var key = id[1]; var type = this.type; var data = jsxc.options.get(prop); if (data && typeof data[key] !== 'undefined') { if (type === 'checkbox') { if (data[key] !== 'false' && data[key] !== false) { this.checked = 'checked'; } } else { $(this).val(data[key]); } } }); }); $('#jsxc_dialog form').submit(function() { var self = $(this); var data = {}; self.find('input[type!="submit"]').each(function() { var id = this.id.split("-"); var prop = id[0]; var key = id[1]; var val; var type = this.type; if (type === 'checkbox') { val = this.checked; } else { val = $(this).val(); } if (!data[prop]) { data[prop] = {}; } data[prop][key] = val; }); $.each(data, function(key, val) { jsxc.options.set(key, val); }); var cb = function(success) { if (typeof self.attr('data-onsubmit') === 'string') { jsxc.exec(self.attr('data-onsubmit'), [success]); } setTimeout(function() { if (success) { self.find('button[type="submit"]').switchClass('btn-primary', 'btn-success'); } else { self.find('button[type="submit"]').switchClass('btn-primary', 'btn-danger'); } setTimeout(function() { self.find('button[type="submit"]').switchClass('btn-danger btn-success', 'btn-primary'); }, 2000); }, 200); }; jsxc.options.saveSettinsPermanent.call(this, data, cb); return false; }); }, /** * Show prompt for notification permission. * * @memberOf jsxc.gui */ showRequestNotification: function() { jsxc.switchEvents({ 'notificationready.jsxc': function() { jsxc.gui.dialog.close(); jsxc.notification.init(); jsxc.storage.setUserItem('notification', 1); }, 'notificationfailure.jsxc': function() { jsxc.gui.dialog.close(); jsxc.options.notification = false; jsxc.storage.setUserItem('notification', 0); } }); jsxc.gui.showConfirmDialog($.t('Should_we_notify_you_'), function() { jsxc.gui.dialog.open(jsxc.gui.template.get('pleaseAccept'), { noClose: true }); jsxc.notification.requestPermission(); }, function() { $(document).trigger('notificationfailure.jsxc'); }); }, showUnknownSender: function(bid) { var confirmationText = $.t('You_received_a_message_from_an_unknown_sender_', { sender: bid }); jsxc.gui.showConfirmDialog(confirmationText, function() { jsxc.gui.dialog.close(); jsxc.storage.saveBuddy(bid, { jid: bid, name: bid, status: 0, sub: 'none', res: [] }); jsxc.gui.window.open(bid); }, function() { // reset state jsxc.storage.removeUserItem('chat', bid); }); }, showSelectionDialog: function(header, msg, primary, option, primaryLabel, optionLabel) { var opt; if (arguments.length === 1 && typeof header === 'object' && header !== null) { opt = header; } else { opt = { header: header, msg: msg, primary: { label: primaryLabel, cb: primary }, option: { label: optionLabel, cb: option } }; } var dialog = jsxc.gui.dialog.open(jsxc.gui.template.get('selectionDialog'), { noClose: true }); if (opt.header) { dialog.find('h3').text(opt.header); } else { dialog.find('h3').hide(); } if (opt.msg) { dialog.find('p').text(opt.msg); } else { dialog.find('p').hide(); } if (opt.primary && opt.primary.label) { dialog.find('.btn-primary').text(opt.primary.label); } if (opt.primary && opt.option.label) { dialog.find('.btn-default').text(opt.option.label); } if (opt.primary && opt.primary.cb) { dialog.find('.btn-primary').click(opt.primary.cb); } if (opt.primary && opt.option.cb) { dialog.find('.btn-primary').click(opt.option.cb); } }, /** * Change own presence to pres. * * @memberOf jsxc.gui * @param pres {CONST.STATUS} New presence state * @param external {boolean} True if triggered from other tab. */ changePresence: function(pres, external) { if (external !== true) { jsxc.storage.setUserItem('presence', pres); } if (pres !== 'offline' && (jsxc.xmpp.conn === undefined || jsxc.xmpp.conn === null)) { jsxc.xmpp.login(); } else if (jsxc.master) { jsxc.xmpp.sendPres(); } $('#jsxc_presence > span').text($('#jsxc_presence .jsxc_inner ul .jsxc_' + pres).text()); jsxc.gui.updatePresence('own', pres); }, /** * Update all presence objects for given user. * * @memberOf jsxc.gui * @param bid bar jid of user. * @param {CONST.STATUS} pres New presence state. */ updatePresence: function(bid, pres) { if (bid === 'own') { if (pres === 'dnd') { $('#jsxc_menu .jsxc_muteNotification').addClass('jsxc_disabled'); jsxc.notification.muteSound(true); } else { $('#jsxc_menu .jsxc_muteNotification').removeClass('jsxc_disabled'); if (!jsxc.options.get('muteNotification')) { jsxc.notification.unmuteSound(true); } } } $('[data-bid="' + bid + '"]').each(function() { var el = $(this); el.attr('data-status', pres); if (el.find('.jsxc_avatar').length > 0) { el = el.find('.jsxc_avatar'); } el.removeClass('jsxc_' + jsxc.CONST.STATUS.join(' jsxc_')).addClass('jsxc_' + pres); }); }, /** * Switch read state to UNread and increase counter. * * @memberOf jsxc.gui * @param bid */ unreadMsg: function(bid) { var winData = jsxc.storage.getUserItem('window', bid) || {}; var count = (winData && winData.unread) || 0; count = (count === true) ? 1 : count + 1; //unread was boolean (<2.1.0) // update user counter winData.unread = count; jsxc.storage.setUserItem('window', bid, winData); // update counter of total unread messages var total = jsxc.storage.getUserItem('unreadMsg') || 0; total++; jsxc.storage.setUserItem('unreadMsg', total); if (jsxc.gui.favicon) { jsxc.gui.favicon.badge(total); } jsxc.gui._unreadMsg(bid, count); }, /** * Switch read state to UNread. * * @memberOf jsxc.gui * @param bid * @param count */ _unreadMsg: function(bid, count) { var win = jsxc.gui.window.get(bid); if (typeof count !== 'number') { // get counter after page reload var winData = jsxc.storage.getUserItem('window', bid); count = (winData && winData.unread) || 1; count = (count === true) ? 1 : count; //unread was boolean (<2.1.0) } var el = jsxc.gui.roster.getItem(bid).add(win); el.addClass('jsxc_unreadMsg'); el.find('.jsxc_unread').text(count); }, /** * Switch read state to read. * * @memberOf jsxc.gui * @param bid */ readMsg: function(bid) { var win = jsxc.gui.window.get(bid); var winData = jsxc.storage.getUserItem('window', bid); var count = (winData && winData.unread) || 0; count = (count === true) ? 0 : count; //unread was boolean (<2.1.0) var el = jsxc.gui.roster.getItem(bid).add(win); el.removeClass('jsxc_unreadMsg'); el.find('.jsxc_unread').text(0); // update counters if not called from other tab if (count > 0) { // update counter of total unread messages var total = jsxc.storage.getUserItem('unreadMsg') || 0; total -= count; jsxc.storage.setUserItem('unreadMsg', total); if (jsxc.gui.favicon) { jsxc.gui.favicon.badge(total); } jsxc.storage.updateUserItem('window', bid, 'unread', 0); } }, /** * This function searches for URI scheme according to XEP-0147. * * @memberOf jsxc.gui * @param container In which element should we search? */ detectUriScheme: function(container) { container = (container) ? $(container) : $('body'); container.find("a[href^='xmpp:']").each(function() { var element = $(this); var href = element.attr('href').replace(/^xmpp:/, ''); var jid = href.split('?')[0]; var action, params = {}; if (href.indexOf('?') < 0) { action = 'message'; } else { var pairs = href.substring(href.indexOf('?') + 1).split(';'); action = pairs[0]; var i, key, value; for (i = 1; i < pairs.length; i++) { key = pairs[i].split('=')[0]; value = (pairs[i].indexOf('=') > 0) ? pairs[i].substring(pairs[i].indexOf('=') + 1) : null; params[decodeURIComponent(key)] = decodeURIComponent(value); } } if (typeof jsxc.gui.queryActions[action] === 'function') { element.addClass('jsxc_uriScheme jsxc_uriScheme_' + action); element.off('click').click(function(ev) { ev.stopPropagation(); jsxc.gui.queryActions[action].call(jsxc, jid, params); return false; }); } }); }, detectEmail: function(container) { container = (container) ? $(container) : $('body'); container.find('a[href^="mailto:"],a[href^="xmpp:"]').each(function() { var spot = $("<span>X</span>").addClass("jsxc_spot"); var href = $(this).attr("href").replace(/^ *(mailto|xmpp):/, "").trim(); if (href !== '' && href !== Strophe.getBareJidFromJid(jsxc.storage.getItem("jid"))) { var bid = jsxc.jidToBid(href); var self = $(this); var s = self.prev(); if (!s.hasClass('jsxc_spot')) { s = spot.clone().attr('data-bid', bid); self.before(s); } s.off('click'); if (jsxc.storage.getUserItem('buddy', bid)) { jsxc.gui.update(bid); s.click(function() { jsxc.gui.window.open(bid); return false; }); } else { s.click(function() { jsxc.gui.showContactDialog(href); return false; }); } } }); }, avatarPlaceholder: function(el, seed, text) { text = text || seed; var options = jsxc.options.get('avatarplaceholder') || {}; var hash = jsxc.hashStr(seed); var hue = Math.abs(hash) % 360; var saturation = options.saturation || 90; var lightness = options.lightness || 65; el.css({ 'background-color': 'hsl(' + hue + ', ' + saturation + '%, ' + lightness + '%)', 'color': '#fff', 'font-weight': 'bold', 'text-align': 'center', 'line-height': el.height() + 'px', 'font-size': el.height() * 0.6 + 'px' }); if (typeof text === 'string' && text.length > 0) { el.text(text[0].toUpperCase()); } }, /** * Replace shortname emoticons with images. * * @param {string} str text with emoticons as shortname * @return {string} text with emoticons as images */ shortnameToImage: function(str) { str = str.replace(jsxc.gui.regShortNames, function(shortname) { if (typeof shortname === 'undefined' || shortname === '' || (!(shortname in jsxc.gui.emoticonList.emojione) && !(shortname in jsxc.gui.emoticonList.core))) { return shortname; } var div = $('<div>'); if (jsxc.gui.emoticonList.core[shortname]) { var filename = jsxc.gui.emoticonList.core[shortname][jsxc.gui.emoticonList.core[shortname].length - 1].replace(/^:([^:]+):$/, '$1'); var src = jsxc.options.root + '/img/emotions/' + filename + '.svg'; div.css('background-image', 'url(' + src + ')'); } else if (jsxc.gui.emoticonList.emojione[shortname]) { div.html(emojione.shortnameToImage(shortname)); } div.addClass('jsxc_emoticon'); div.attr('title', shortname); return div.prop('outerHTML'); }); return str; } }; /** * Handle functions related to the gui of the roster * * @namespace jsxc.gui.roster */ jsxc.gui.roster = { /** True if roster is initialised */ ready: false, /** True if all items are loaded */ loaded: false, /** * Init the roster skeleton * * @memberOf jsxc.gui.roster * @returns {undefined} */ init: function() { $(jsxc.options.rosterAppend + ':first').append($(jsxc.gui.template.get('roster'))); if (jsxc.options.get('hideOffline')) { $('#jsxc_menu .jsxc_hideOffline').text($.t('Show_offline')); $('#jsxc_buddylist').addClass('jsxc_hideOffline'); } $('#jsxc_menu .jsxc_settings').click(function() { jsxc.gui.showSettings(); }); $('#jsxc_menu .jsxc_hideOffline').click(function() { var hideOffline = !jsxc.options.get('hideOffline'); if (hideOffline) { $('#jsxc_buddylist').addClass('jsxc_hideOffline'); } else { $('#jsxc_buddylist').removeClass('jsxc_hideOffline'); } $(this).text(hideOffline ? $.t('Show_offline') : $.t('Hide_offline')); jsxc.options.set('hideOffline', hideOffline); }); if (jsxc.options.get('muteNotification')) { jsxc.notification.muteSound(); } $('#jsxc_menu .jsxc_muteNotification').click(function() { if (jsxc.storage.getUserItem('presence') === 'dnd') { return; } // invert current choice var mute = !jsxc.options.get('muteNotification'); if (mute) { jsxc.notification.muteSound(); } else { jsxc.notification.unmuteSound(); } }); $('#jsxc_roster .jsxc_addBuddy').click(function() { jsxc.gui.showContactDialog(); }); $('#jsxc_roster .jsxc_onlineHelp').click(function() { window.open(jsxc.options.onlineHelp, 'onlineHelp'); }); $('#jsxc_roster .jsxc_about').click(function() { jsxc.gui.showAboutDialog(); }); $('#jsxc_toggleRoster').click(function() { jsxc.gui.roster.toggle(); }); $('#jsxc_presence li').click(function() { var self = $(this); var pres = self.data('pres'); jsxc.gui.changePresence(pres); if (pres === 'offline') { jsxc.xmpp.logout(false); } }); var jsxc_roster_top = $('#jsxc_roster').css('top'); jsxc_roster_top = parseInt((jsxc_roster_top === undefined)? 0 : jsxc_roster_top); $('#jsxc_buddylist').slimScroll({ distance: '3px', height: ($('#jsxc_roster').height() - jsxc_roster_top) + 'px', width: $('#jsxc_buddylist').width() + 'px', color: '#fff', opacity: '0.5' }); $('#jsxc_roster > .jsxc_bottom > div').each(function() { jsxc.gui.toggleList.call($(this)); }); var rosterState = jsxc.storage.getUserItem('roster') || (jsxc.options.get('loginForm').startMinimized ? 'hidden' : 'shown'); $('#jsxc_roster').addClass('jsxc_state_' + rosterState); // set class of diaspora* container $('body > .container-fluid') .removeClass('chat-roster-shown chat-roster-hidden') .addClass('chat-roster-'+rosterState); $('#jsxc_windowList').addClass('jsxc_roster_' + rosterState); var pres = 'offline'; jsxc.storage.setUserItem('presence', pres); // switch presence if connection restored $(document).on('connected.jsxc attached.jsxc', function() { jsxc.gui.changePresence('online', false); }); $('#jsxc_presence > span').text($('#jsxc_presence .jsxc_' + pres).text()); jsxc.gui.updatePresence('own', pres); jsxc.gui.tooltip('#jsxc_roster'); jsxc.notice.load(); jsxc.gui.roster.ready = true; $(document).trigger('ready.roster.jsxc'); }, /** * Create roster item and add it to the roster * * @param {String} bid bar jid */ add: function(bid) { var data = jsxc.storage.getUserItem('buddy', bid); var bud = jsxc.gui.buddyTemplate.clone().attr('data-bid', bid).attr('data-type', data.type || 'chat'); jsxc.gui.roster.insert(bid, bud); bud.click(function() { jsxc.gui.window.open(bid); }); bud.find('.jsxc_msg').click(function() { jsxc.gui.window.open(bid); return false; }); bud.find('.jsxc_rename').click(function() { jsxc.gui.roster.rename(bid); return false; }); if (data.type !== 'groupchat') { bud.find('.jsxc_delete').click(function() { jsxc.gui.showRemoveDialog(bid); return false; }); } var expandClick = function() { bud.trigger('extra.jsxc'); $('body').click(); if (!bud.find('.jsxc_menu').hasClass('jsxc_open')) { bud.find('.jsxc_menu').addClass('jsxc_open'); $('body').one('click', function() { bud.find('.jsxc_menu').removeClass('jsxc_open'); }); } return false; }; bud.find('.jsxc_more').click(expandClick); bud.find('.jsxc_vcard').click(function() { jsxc.gui.showVcard(data.jid); return false; }); jsxc.gui.update(bid); // update scrollbar $('#jsxc_buddylist').slimScroll({ scrollTo: '0px' }); var history = jsxc.storage.getUserItem('history', bid) || []; var i = 0; while (history.length > i) { var message = new jsxc.Message(history[i]); if (message.direction !== jsxc.Message.SYS) { $('[data-bid="' + bid + '"]').find('.jsxc_lastmsg .jsxc_text').html(message.msg); break; } i++; } $(document).trigger('add.roster.jsxc', [bid, data, bud]); }, getItem: function(bid) { return $("#jsxc_buddylist > li[data-bid='" + bid + "']"); }, /** * Insert roster item. First order: online > away > offline. Second order: * alphabetical of the name * * @param {type} bid * @param {jquery} li roster item which should be insert * @returns {undefined} */ insert: function(bid, li) { var data = jsxc.storage.getUserItem('buddy', bid); var listElements = $('#jsxc_buddylist > li'); var insert = false; // Insert buddy with no mutual friendship to the end var status = (data.sub === 'both') ? data.status : -1; listElements.each(function() { var thisStatus = ($(this).data('sub') === 'both') ? $(this).data('status') : -1; if (($(this).data('name').toLowerCase() > data.name.toLowerCase() && thisStatus === status) || thisStatus < status) { $(this).before(li); insert = true; return false; } }); if (!insert) { li.appendTo('#jsxc_buddylist'); } }, /** * Initiate reorder of roster item * * @param {type} bid * @returns {undefined} */ reorder: function(bid) { jsxc.gui.roster.insert(bid, jsxc.gui.roster.remove(bid)); }, /** * Removes buddy from roster * * @param {String} bid bar jid * @return {JQueryObject} Roster list element */ remove: function(bid) { return jsxc.gui.roster.getItem(bid).detach(); }, /** * Removes buddy from roster and clean up * * @param {String} bid bar compatible jid */ purge: function(bid) { if (jsxc.master) { jsxc.storage.removeUserItem('buddy', bid); jsxc.storage.removeUserItem('otr', bid); jsxc.storage.removeUserItem('otr_version_' + bid); jsxc.storage.removeUserItem('chat', bid); jsxc.storage.removeUserItem('window', bid); jsxc.storage.removeUserElement('buddylist', bid); jsxc.storage.removeUserElement('windowlist', bid); } jsxc.gui.window._close(bid); jsxc.gui.roster.remove(bid); }, /** * Create input element for rename action * * @param {type} bid * @returns {undefined} */ rename: function(bid) { var name = jsxc.gui.roster.getItem(bid).find('.jsxc_name'); var options = jsxc.gui.roster.getItem(bid).find('.jsxc_lastmsg, .jsxc_more'); var input = $('<input type="text" name="name"/>'); // hide more menu $('body').click(); options.hide(); name = name.replaceWith(input); input.val(name.text()); input.keypress(function(ev) { if (ev.which !== 13) { return; } options.css('display', ''); input.replaceWith(name); jsxc.gui.roster._rename(bid, $(this).val()); $('html').off('click'); }); // Disable html click event, if click on input input.click(function() { return false; }); $('html').one('click', function() { options.css('display', ''); input.replaceWith(name); jsxc.gui.roster._rename(bid, input.val()); }); }, /** * Rename buddy * * @param {type} bid * @param {type} newname new name of buddy * @returns {undefined} */ _rename: function(bid, newname) { if (jsxc.master) { var d = jsxc.storage.getUserItem('buddy', bid) || {}; if (d.type === 'chat') { var iq = $iq({ type: 'set' }).c('query', { xmlns: 'jabber:iq:roster' }).c('item', { jid: Strophe.getBareJidFromJid(d.jid), name: newname }); jsxc.xmpp.conn.sendIQ(iq); } else if (d.type === 'groupchat') { jsxc.xmpp.bookmarks.add(bid, newname, d.nickname, d.autojoin); } } jsxc.storage.updateUserItem('buddy', bid, 'name', newname); jsxc.gui.update(bid); }, /** * Toogle complete roster * * @param {string} state Toggle to state */ toggle: function(state) { var duration; var roster = $('#jsxc_roster'); var wl = $('#jsxc_windowList'); if (!state) { state = (jsxc.storage.getUserItem('roster') === jsxc.CONST.HIDDEN) ? jsxc.CONST.SHOWN : jsxc.CONST.HIDDEN; } if (state === 'shown' && jsxc.isExtraSmallDevice()) { jsxc.gui.window.hide(); } jsxc.storage.setUserItem('roster', state); // set class of diaspora* container $('body > .container-fluid') .removeClass('chat-roster-shown chat-roster-hidden') .addClass('chat-roster-'+state); roster.removeClass('jsxc_state_hidden jsxc_state_shown').addClass('jsxc_state_' + state); wl.removeClass('jsxc_roster_hidden jsxc_roster_shown').addClass('jsxc_roster_' + state); duration = parseFloat(roster.css('transitionDuration') || 0) * 1000; setTimeout(function() { jsxc.gui.updateWindowListSB(); }, duration); $(document).trigger('toggle.roster.jsxc', [state, duration]); return duration; }, /** * Shows a text with link to a login box that no connection exists. */ noConnection: function() { if ($('#jsxc_roster').hasClass('jsxc_noConnection')) { return; } $('#jsxc_buddylist').empty(); $('#jsxc_roster').append($('<p>' + $.t('no_connection') + '</p>').append(' <a>' + $.t('relogin') + '</a>').click(function() { jsxc.gui.changePresence('online'); })); }, /** * Shows a text with link to add a new buddy. * * @memberOf jsxc.gui.roster */ empty: function() { var text = $('<p>' + $.t('Your_roster_is_empty_add_') + '</p>'); var link = text.find('a'); link.click(function() { jsxc.gui.showContactDialog(); }); text.append(link); text.append('.'); $('#jsxc_roster').prepend(text); } }; /** * Wrapper for dialog * * @namespace jsxc.gui.dialog */ jsxc.gui.dialog = { /** * Open a Dialog. * * @memberOf jsxc.gui.dialog * @param {String} data Data of the dialog * @param {Object} [o] Options for the dialog * @param {Boolean} [o.noClose] If true, hide all default close options * @returns {jQuery} Dialog object */ open: function(data, o) { var opt = $.extend({ name: '' }, o); $.magnificPopup.open({ items: { src: '<div data-name="' + opt.name + '" id="jsxc_dialog">' + data + '</div>' }, type: 'inline', modal: opt.noClose, callbacks: { beforeClose: function() { $(document).trigger('cleanup.dialog.jsxc'); }, afterClose: function() { $(document).trigger('close.dialog.jsxc'); }, open: function() { $('#jsxc_dialog .jsxc_close').click(function(ev) { ev.preventDefault(); jsxc.gui.dialog.close(); }); $('#jsxc_dialog form').each(function() { var form = $(this); form.find('button[data-jsxc-loading-text]').each(function() { var btn = $(this); btn.on('btnloading.jsxc', function() { if (!btn.prop('disabled')) { btn.prop('disabled', true); btn.data('jsxc_value', btn.text()); btn.text(btn.attr('data-jsxc-loading-text')); } }); btn.on('btnfinished.jsxc', function() { if (btn.prop('disabled')) { btn.prop('disabled', false); btn.text(btn.data('jsxc_value')); } }); }); }); jsxc.gui.dialog.resize(); $(document).trigger('complete.dialog.jsxc'); } } }); return $('#jsxc_dialog'); }, /** * If no name is provided every dialog will be closed, * otherwise only dialog with given name is closed. * * @param {string} [name] Close only dialog with the given name */ close: function(name) { jsxc.debug('close dialog'); if (typeof name === 'string' && name.length > 0 && !jsxc.el_exists('#jsxc_dialog[data-name=' + name + ']')) { return; } $.magnificPopup.close(); }, /** * Resizes current dialog. * * @param {Object} options e.g. width and height */ resize: function() { } }; /** * Handle functions related to the gui of the window * * @namespace jsxc.gui.window */ jsxc.gui.window = { /** * Init a window skeleton * * @memberOf jsxc.gui.window * @param {String} bid * @returns {jQuery} Window object */ init: function(bid) { if (jsxc.gui.window.get(bid).length > 0) { return jsxc.gui.window.get(bid); } var win = jsxc.gui.windowTemplate.clone().attr('data-bid', bid).appendTo('#jsxc_windowList > ul'); var data = jsxc.storage.getUserItem('buddy', bid); // Attach jid to window win.data('jid', data.jid); // Add handler // @TODO generalize this. Duplicate of jsxc.roster.add var expandClick = function() { win.trigger('extra.jsxc'); $('body').click(); if (!win.find('.jsxc_menu').hasClass('jsxc_open')) { win.find('.jsxc_menu').addClass('jsxc_open'); $('body').one('click', function() { win.find('.jsxc_menu').removeClass('jsxc_open'); }); } return false; }; win.find('.jsxc_more').click(expandClick); win.find('.jsxc_verification').click(function() { jsxc.gui.showVerification(bid); }); win.find('.jsxc_fingerprints').click(function() { jsxc.gui.showFingerprints(bid); }); win.find('.jsxc_transfer').click(function() { jsxc.otr.toggleTransfer(bid); }); win.find('.jsxc_bar').click(function() { jsxc.gui.window.toggle(bid); }); win.find('.jsxc_close').click(function() { jsxc.gui.window.close(bid); }); win.find('.jsxc_clear').click(function() { jsxc.gui.window.clear(bid); }); win.find('.jsxc_sendFile').click(function() { $('body').click(); jsxc.gui.window.sendFile(bid); }); win.find('.jsxc_tools').click(function() { return false; }); win.find('.jsxc_textinput').keyup(function(ev) { var body = $(this).val(); if (ev.which === 13) { body = ''; } jsxc.storage.updateUserItem('window', bid, 'text', body); if (ev.which === 27) { jsxc.gui.window.close(bid); } }).keypress(function(ev) { if (ev.which !== 13 || !$(this).val()) { return; } jsxc.gui.window.postMessage({ bid: bid, direction: jsxc.Message.OUT, msg: $(this).val() }); $(this).val(''); }).focus(function() { // remove unread flag jsxc.gui.readMsg(bid); }).mouseenter(function() { $('#jsxc_windowList').data('isOver', true); }).mouseleave(function() { $('#jsxc_windowList').data('isOver', false); }); win.find('.jsxc_textarea').click(function() { // check if user clicks element or selects text if (typeof getSelection === 'function' && !getSelection().toString()) { win.find('.jsxc_textinput').focus(); } }); win.find('.jsxc_textarea').slimScroll({ height: '234px', distance: '3px' }); win.find('.jsxc_name').disableSelection(); win.find('.slimScrollDiv').resizable({ handles: 'w, nw, n', minHeight: 234, minWidth: 250, resize: function(event, ui) { jsxc.gui.window.resize(win, ui); }, start: function() { win.removeClass('jsxc_normal'); }, stop: function() { win.addClass('jsxc_normal'); } }); win.find('.jsxc_window').css('bottom', -1 * win.find('.jsxc_fade').height()); if ($.inArray(bid, jsxc.storage.getUserItem('windowlist')) < 0) { // add window to windowlist var wl = jsxc.storage.getUserItem('windowlist') || []; wl.push(bid); jsxc.storage.setUserItem('windowlist', wl); // init window element in storage jsxc.storage.setUserItem('window', bid, { minimize: true, text: '', unread: 0 }); jsxc.gui.window.hide(bid); } else { if (jsxc.storage.getUserItem('window', bid).unread) { jsxc.gui._unreadMsg(bid); } } $.each(jsxc.gui.emotions, function(i, val) { var ins = val[0].split(' ')[0]; var li = $('<li>'); li.append(jsxc.gui.shortnameToImage(':' + val[1] + ':')); li.find('div').attr('title', ins); li.click(function() { win.find('input').val(win.find('input').val() + ins); win.find('input').focus(); }); win.find('.jsxc_emoticons ul').prepend(li); }); jsxc.gui.toggleList.call(win.find('.jsxc_emoticons')); jsxc.gui.window.restoreChat(bid); jsxc.gui.update(bid); jsxc.gui.updateWindowListSB(); // create related otr object if (jsxc.master && !jsxc.otr.objects[bid]) { jsxc.otr.create(bid); } else { jsxc.otr.enable(bid); } $(document).trigger('init.window.jsxc', [win]); return win; }, /** * Resize given window to given size. If no size is provided the window is resized to the default size. * * @param {(string|jquery)} win Bid or window object * @param {object} ui The size has to be in the format {size:{width: [INT], height: [INT]}} * @param {boolean} [outer] If true the given size is used as outer dimensions. */ resize: function(win, ui, outer) { var bid; if (typeof win === 'object') { bid = win.attr('data-bid'); } else if (typeof win === 'string') { bid = win; win = jsxc.gui.window.get(bid); } else { jsxc.warn('jsxc.gui.window.resize has to be called either with bid or window object.'); return; } if (!win.attr('data-default-height')) { win.attr('data-default-height', win.find('.ui-resizable').height()); } if (!win.attr('data-default-width')) { win.attr('data-default-width', win.find('.ui-resizable').width()); } var outer_height_diff = (outer) ? win.find('.jsxc_window').outerHeight() - win.find('.ui-resizable').height() : 0; ui = $.extend({ size: { width: parseInt(win.attr('data-default-width')), height: parseInt(win.attr('data-default-height')) + outer_height_diff } }, ui || {}); if (outer) { ui.size.height -= outer_height_diff; } win.find('.slimScrollDiv').css({ width: ui.size.width, height: ui.size.height }); win.width(ui.size.width); win.find('.jsxc_textarea').slimScroll({ height: ui.size.height }); // var offset = win.find('.slimScrollDiv').position().top; //win.find('.jsxc_emoticons').css('top', (ui.size.height + offset + 6) + 'px'); $(document).trigger('resize.window.jsxc', [win, bid, ui.size]); }, fullsize: function(bid) { var win = jsxc.gui.window.get(bid); var size = jsxc.options.viewport.getSize(); size.width -= 10; size.height -= win.find('.jsxc_bar').outerHeight() + win.find('.jsxc_textinput').outerHeight(); jsxc.gui.window.resize(win, { size: size }); }, /** * Returns the window element * * @param {String} bid * @returns {jquery} jQuery object of the window element */ get: function(id) { return $("li.jsxc_windowItem[data-bid='" + jsxc.jidToBid(id) + "']"); }, /** * Open a window, related to the bid. If the window doesn't exist, it will be * created. * * @param {String} bid * @returns {jQuery} Window object */ open: function(bid) { var win = jsxc.gui.window.init(bid); jsxc.gui.window.show(bid); jsxc.gui.window.highlight(bid); return win; }, /** * Close chatwindow and clean up * * @param {String} bid bar jid */ close: function(bid) { if (jsxc.gui.window.get(bid).length === 0) { jsxc.warn('Want to close a window, that is not open.'); return; } jsxc.storage.removeUserElement('windowlist', bid); jsxc.storage.removeUserItem('window', bid); if (jsxc.storage.getUserItem('buddylist').indexOf(bid) < 0) { // delete data from unknown sender jsxc.storage.removeUserItem('buddy', bid); jsxc.storage.removeUserItem('chat', bid); } jsxc.gui.window._close(bid); }, /** * Close chatwindow * * @param {String} bid */ _close: function(bid) { jsxc.gui.window.get(bid).remove(); jsxc.gui.updateWindowListSB(); }, /** * Toggle between minimize and maximize of the text area * * @param {String} bid bar jid */ toggle: function(bid) { var win = jsxc.gui.window.get(bid); if (win.parents("#jsxc_windowList").length === 0) { return; } if (win.hasClass('jsxc_min')) { jsxc.gui.window.show(bid); } else { jsxc.gui.window.hide(bid); } jsxc.gui.updateWindowListSB(); }, /** * Maximize text area and save * * @param {String} bid */ show: function(bid) { jsxc.storage.updateUserItem('window', bid, 'minimize', false); return jsxc.gui.window._show(bid); }, /** * Maximize text area * * @param {String} bid * @returns {undefined} */ _show: function(bid) { var win = jsxc.gui.window.get(bid); var duration = 0; if (jsxc.isExtraSmallDevice()) { if (parseFloat($('#jsxc_roster').css('right')) >= 0) { duration = jsxc.gui.roster.toggle(); } jsxc.gui.window.hide(); jsxc.gui.window.fullsize(bid); } win.removeClass('jsxc_min').addClass('jsxc_normal'); win.find('.jsxc_window').css('bottom', '0'); setTimeout(function() { var padding = $("#jsxc_windowListSB").width(); var innerWidth = $('#jsxc_windowList>ul').width(); var outerWidth = $('#jsxc_windowList').width() - padding; if (innerWidth > outerWidth) { var offset = parseInt($('#jsxc_windowList>ul').css('right')); var width = win.outerWidth(true); var right = innerWidth - win.position().left - width + offset; var left = outerWidth - (innerWidth - win.position().left) - offset; if (left < 0) { jsxc.gui.scrollWindowListBy(left * -1); } if (right < 0) { jsxc.gui.scrollWindowListBy(right); } } }, duration); // If the area is hidden, the scrolldown function doesn't work. So we // call it here. jsxc.gui.window.scrollDown(bid); if (jsxc.restoreCompleted) { win.find('.jsxc_textinput').focus(); } win.trigger('show.window.jsxc'); }, /** * Minimize text area and save * * @param {String} [bid] */ hide: function(bid) { var hide = function(bid) { jsxc.storage.updateUserItem('window', bid, 'minimize', true); jsxc.gui.window._hide(bid); }; if (bid) { hide(bid); } else { $('#jsxc_windowList > ul > li').each(function() { var el = $(this); if (!el.hasClass('jsxc_min')) { hide(el.attr('data-bid')); } }); } }, /** * Minimize text area * * @param {String} bid */ _hide: function(bid) { var win = jsxc.gui.window.get(bid); win.removeClass('jsxc_normal').addClass('jsxc_min'); win.find('.jsxc_window').css('bottom', -1 * win.find('.jsxc_fade').height()); win.trigger('hidden.window.jsxc'); }, /** * Highlight window * * @param {type} bid */ highlight: function(bid) { var el = jsxc.gui.window.get(bid).find(' .jsxc_bar'); if (!el.is(':animated')) { /*el.effect('highlight', { color: 'orange' }, 2000);*/ } }, /** * Scroll chat area to the bottom * * @param {String} bid bar jid */ scrollDown: function(bid) { var chat = jsxc.gui.window.get(bid).find('.jsxc_textarea'); // check if chat exist if (chat.length === 0) { return; } chat.slimScroll({ scrollTo: (chat.get(0).scrollHeight + 'px') }); }, /** * Write Message to chat area and save. Check border cases and remove html. * * @function postMessage * @memberOf jsxc.gui.window * @param {jsxc.Message} message object to be send * @return {jsxc.Message} maybe modified message object */ /** * Create message object from given properties, write Message to chat area * and save. Check border cases and remove html. * * @function postMessage * @memberOf jsxc.gui.window * @param {object} args New message properties * @param {string} args.bid * @param {direction} args.direction * @param {string} args.msg * @param {boolean} args.encrypted * @param {boolean} args.forwarded * @param {boolean} args.sender * @param {integer} args.stamp * @param {object} args.attachment Attached data * @param {string} args.attachment.name File name * @param {string} args.attachment.size File size * @param {string} args.attachment.type File type * @param {string} args.attachment.data File data * @return {jsxc.Message} maybe modified message object */ postMessage: function(message) { if (typeof message === 'object' && !(message instanceof jsxc.Message)) { message = new jsxc.Message(message); } var data = jsxc.storage.getUserItem('buddy', message.bid); var html_msg = message.msg; // remove html tags and reencode html tags message.msg = jsxc.removeHTML(message.msg); message.msg = jsxc.escapeHTML(message.msg); // exceptions: if (message.direction === jsxc.Message.OUT && data.msgstate === OTR.CONST.MSGSTATE_FINISHED && message.forwarded !== true) { message.direction = jsxc.Message.SYS; message.msg = $.t('your_message_wasnt_send_please_end_your_private_conversation'); } if (message.direction === jsxc.Message.OUT && data.msgstate === OTR.CONST.MSGSTATE_FINISHED) { message.direction = 'sys'; message.msg = $.t('unencrypted_message_received') + ' ' + message.msg; } message.encrypted = message.encrypted || data.msgstate === OTR.CONST.MSGSTATE_ENCRYPTED; try { message.save(); } catch (err) { jsxc.warn('Unable to save message.', err); message = new jsxc.Message({ msg: 'Unable to save that message. Please clear some chat histories.', direction: jsxc.Message.SYS }); } if (message.direction === 'in' && !jsxc.gui.window.get(message.bid).find('.jsxc_textinput').is(":focus")) { jsxc.gui.unreadMsg(message.bid); $(document).trigger('postmessagein.jsxc', [message.bid, html_msg]); } if (message.direction === jsxc.Message.OUT && jsxc.master && message.forwarded !== true && html_msg) { jsxc.xmpp.sendMessage(message.bid, html_msg, message._uid); } jsxc.gui.window._postMessage(message); if (message.direction === 'out' && message.msg === '?' && jsxc.options.get('theAnswerToAnything') !== false) { if (typeof jsxc.options.get('theAnswerToAnything') === 'undefined' || (Math.random() * 100 % 42) < 1) { jsxc.options.set('theAnswerToAnything', true); jsxc.gui.window.postMessage(new jsxc.Message({ bid: message.bid, direction: jsxc.Message.SYS, msg: '42' })); } } return message; }, /** * Write Message to chat area * * @param {String} bid bar jid * @param {Object} post Post object with direction, msg, uid, received * @param {Bool} restore If true no highlights are used */ _postMessage: function(message, restore) { var bid = message.bid; var win = jsxc.gui.window.get(bid); var msg = message.msg; var direction = message.direction; var uid = message._uid; if (win.find('.jsxc_textinput').is(':not(:focus)') && direction === jsxc.Message.IN && !restore) { jsxc.gui.window.highlight(bid); } msg = msg.replace(jsxc.CONST.REGEX.URL, function(url) { var href = (url.match(/^https?:\/\//i)) ? url : 'http://' + url; // @TODO use jquery element builder return '<a href="' + href + '" target="_blank">' + url + '</a>'; }); msg = msg.replace(new RegExp('(xmpp:)?(' + jsxc.CONST.REGEX.JID.source + ')(\\?[^\\s]+\\b)?', 'i'), function(match, protocol, jid, action) { if (protocol === 'xmpp:') { if (typeof action === 'string') { jid += action; } // @TODO use jquery element builder return '<a href="xmpp:' + jid + '">xmpp:' + jid + '</a>'; } // @TODO use jquery element builder return '<a href="mailto:' + jid + '" target="_blank">mailto:' + jid + '</a>'; }); // replace emoticons from XEP-0038 and pidgin with shortnames $.each(jsxc.gui.emotions, function(i, val) { msg = msg.replace(val[2], ':' + val[1] + ':'); }); // translate shortnames to images msg = jsxc.gui.shortnameToImage(msg); // replace line breaks msg = msg.replace(/(\r\n|\r|\n)/g, '<br />'); var msgDiv = $("<div>"), msgTsDiv = $("<div>"); msgDiv.addClass('jsxc_chatmessage jsxc_' + direction); msgDiv.attr('id', uid.replace(/:/g, '-')); msgDiv.html('<div>' + msg + '</div>'); msgTsDiv.addClass('jsxc_timestamp'); msgTsDiv.text(jsxc.getFormattedTime(message.stamp)); if (message.isReceived() || false) { msgDiv.addClass('jsxc_received'); } if (message.forwarded) { msgDiv.addClass('jsxc_forwarded'); } if (message.encrypted) { msgDiv.addClass('jsxc_encrypted'); } if (message.attachment && message.attachment.name) { var attachment = $('<div>'); attachment.addClass('jsxc_attachment'); attachment.addClass('jsxc_' + message.attachment.type.replace(/\//, '-')); attachment.addClass('jsxc_' + message.attachment.type.replace(/^([^/]+)\/.*/, '$1')); if (message.attachment.persistent === false) { attachment.addClass('jsxc_notPersistent'); } if (message.attachment.data) { attachment.addClass('jsxc_data'); } if (message.attachment.type.match(/^image\//) && message.attachment.thumbnail) { $('<img alt="preview">').attr('src', message.attachment.thumbnail).attr('title', message.attachment.name).appendTo(attachment); } else { attachment.text(message.attachment.name); } if (message.attachment.data) { attachment = $('<a>').append(attachment); attachment.attr('href', message.attachment.data); attachment.attr('download', message.attachment.name); } msgDiv.find('div').first().append(attachment); } if (direction === 'sys') { jsxc.gui.window.get(bid).find('.jsxc_textarea').append('<div style="clear:both"/>'); } else if (typeof message.stamp !== 'undefined') { msgDiv.append(msgTsDiv); } if (direction !== 'sys') { $('[data-bid="' + bid + '"]').find('.jsxc_lastmsg .jsxc_text').html(msg); } if (jsxc.Message.getDOM(uid).length > 0) { jsxc.Message.getDOM(uid).replaceWith(msgDiv); } else { win.find('.jsxc_textarea').append(msgDiv); } if (typeof message.sender === 'object' && message.sender !== null) { var title = ''; var avatarDiv = $('<div>'); avatarDiv.addClass('jsxc_avatar').prependTo(msgDiv); if (typeof message.sender.jid === 'string') { msgDiv.attr('data-bid', jsxc.jidToBid(message.sender.jid)); var data = jsxc.storage.getUserItem('buddy', jsxc.jidToBid(message.sender.jid)) || {}; jsxc.gui.updateAvatar(msgDiv, jsxc.jidToBid(message.sender.jid), data.avatar); title = jsxc.jidToBid(message.sender.jid); } if (typeof message.sender.name === 'string') { msgDiv.attr('data-name', message.sender.name); if (typeof message.sender.jid !== 'string') { jsxc.gui.avatarPlaceholder(avatarDiv, message.sender.name); } if (title !== '') { title = '\n' + title; } title = message.sender.name + title; msgTsDiv.text(msgTsDiv.text() + ' ' + message.sender.name); } avatarDiv.attr('title', jsxc.escapeHTML(title)); if (msgDiv.prev().length > 0 && msgDiv.prev().find('.jsxc_avatar').attr('title') === avatarDiv.attr('title')) { avatarDiv.css('visibility', 'hidden'); } } jsxc.gui.detectUriScheme(win); jsxc.gui.detectEmail(win); jsxc.gui.window.scrollDown(bid); }, /** * Set text into input area * * @param {type} bid * @param {type} text * @returns {undefined} */ setText: function(bid, text) { jsxc.gui.window.get(bid).find('.jsxc_textinput').val(text); }, /** * Load old log into chat area * * @param {type} bid * @returns {undefined} */ restoreChat: function(bid) { var chat = jsxc.storage.getUserItem('chat', bid); // convert legacy storage structure introduced in v3.0.0 if (chat) { while (chat !== null && chat.length > 0) { var c = chat.pop(); c.bid = bid; c._uid = c.uid; delete c.uid; var message = new jsxc.Message(c); message.save(); jsxc.gui.window._postMessage(message, true); } jsxc.storage.removeUserItem('chat', bid); } var history = jsxc.storage.getUserItem('history', bid); while (history !== null && history.length > 0) { var uid = history.pop(); jsxc.gui.window._postMessage(new jsxc.Message(uid), true); } }, /** * Clear chat history * * @param {type} bid * @returns {undefined} */ clear: function(bid) { // deprecated jsxc.storage.removeUserItem('chat', bid); var history = jsxc.storage.getUserItem('history', bid) || []; history.map(function(id) { jsxc.storage.removeUserItem('msg', id); }); jsxc.storage.setUserItem('history', bid, []); var win = jsxc.gui.window.get(bid); if (win.length > 0) { win.find('.jsxc_textarea').empty(); } }, /** * Mark message as received. * * @param {string} bid * @param {string} uid message id * @deprecated since v3.0.0. Use {@link jsxc.Message.received}. */ receivedMessage: function(bid, uid) { jsxc.warn('Using deprecated receivedMessage.'); var message = new jsxc.Message(uid); message.received(); }, updateProgress: function(message, sent, size) { var div = message.getDOM(); var span = div.find('.jsxc_timestamp span'); if (span.length === 0) { div.find('.jsxc_timestamp').append('<span>'); span = div.find('.jsxc_timestamp span'); } span.text(' ' + Math.round(sent / size * 100) + '%'); if (sent === size) { span.remove(); message.received(); } }, showOverlay: function(bid, content, allowClose) { var win = jsxc.gui.window.get(bid); win.find('.jsxc_overlay .jsxc_body').empty().append(content); win.find('.jsxc_overlay .jsxc_close').off('click').click(function() { jsxc.gui.window.hideOverlay(bid); }); if (allowClose !== true) { win.find('.jsxc_overlay .jsxc_close').hide(); } else { win.find('.jsxc_overlay .jsxc_close').show(); } win.addClass('jsxc_showOverlay'); }, hideOverlay: function(bid) { var win = jsxc.gui.window.get(bid); win.removeClass('jsxc_showOverlay'); }, selectResource: function(bid, text, cb, res) { res = res || jsxc.storage.getUserItem('res', bid) || []; cb = cb || function() {}; if (res.length > 0) { var content = $('<div>'); var list = $('<ul>'), i, li; for (i = 0; i < res.length; i++) { li = $('<li>'); li.append($('<a>').text(res[i])); li.appendTo(list); } list.find('a').click(function(ev) { ev.preventDefault(); jsxc.gui.window.hideOverlay(bid); cb({ status: 'selected', result: $(this).text() }); }); if (text) { $('<p>').text(text).appendTo(content); } list.appendTo(content); jsxc.gui.window.showOverlay(bid, content); } else { cb({ status: 'unavailable' }); } }, smpRequest: function(bid, question) { var content = $('<div>'); var p = $('<p>'); p.text($.t('smpRequestReceived')); p.appendTo(content); var abort = $('<button>'); abort.text($.t('Abort')); abort.click(function() { jsxc.gui.window.hideOverlay(bid); jsxc.storage.removeUserItem('smp', bid); if (jsxc.master && jsxc.otr.objects[bid]) { jsxc.otr.objects[bid].sm.abort(); } }); abort.appendTo(content); var verify = $('<button>'); verify.text($.t('Verify')); verify.addClass('jsxc_btn jsxc_btn-primary'); verify.click(function() { jsxc.gui.window.hideOverlay(bid); jsxc.otr.onSmpQuestion(bid, question); }); verify.appendTo(content); jsxc.gui.window.showOverlay(bid, content); }, sendFile: function(jid) { var bid = jsxc.jidToBid(jid); var win = jsxc.gui.window.get(bid); var res = Strophe.getResourceFromJid(jid); if (!res) { jid = win.data('jid'); res = Strophe.getResourceFromJid(jid); var fileCapableRes = jsxc.webrtc.getCapableRes(jid, jsxc.webrtc.reqFileFeatures); var resources = Object.keys(jsxc.storage.getUserItem('res', bid)) || []; if (res === null && resources.length === 1 && fileCapableRes.length === 1) { res = fileCapableRes[0]; jid = bid + '/' + res; } else if (fileCapableRes.indexOf(res) < 0) { jsxc.gui.window.selectResource(bid, $.t('Your_contact_uses_multiple_clients_'), function(data) { if (data.status === 'unavailable') { jsxc.gui.window.hideOverlay(bid); } else if (data.status === 'selected') { jsxc.gui.window.sendFile(bid + '/' + data.result); } }, fileCapableRes); return; } } var msg = $('<div><div><label><input type="file" name="files" /><label></div></div>'); msg.addClass('jsxc_chatmessage'); jsxc.gui.window.showOverlay(bid, msg, true); msg.find('label').click(); msg.find('[type="file"]').change(function(ev) { var file = ev.target.files[0]; // FileList object if (!file) { return; } var attachment = $('<div>'); attachment.addClass('jsxc_attachment'); attachment.addClass('jsxc_' + file.type.replace(/\//, '-')); attachment.addClass('jsxc_' + file.type.replace(/^([^/]+)\/.*/, '$1')); msg.empty().append(attachment); if (FileReader && file.type.match(/^image\//)) { var img = $('<img alt="preview">').attr('title', file.name); img.attr('src', jsxc.options.get('root') + '/img/loading.gif'); img.appendTo(attachment); var reader = new FileReader(); reader.onload = function() { img.attr('src', reader.result); }; reader.readAsDataURL(file); } else { attachment.text(file.name + ' (' + file.size + ' byte)'); } $('<button>').addClass('jsxc_btn jsxc_btn-primary').text($.t('Send')).click(function() { var sess = jsxc.webrtc.sendFile(jid, file); jsxc.gui.window.hideOverlay(bid); var message = jsxc.gui.window.postMessage({ _uid: sess.sid + ':msg', bid: bid, direction: 'out', attachment: { name: file.name, size: file.size, type: file.type, data: (file.type.match(/^image\//)) ? img.attr('src') : null } }); sess.sender.on('progress', function(sent, size) { jsxc.gui.window.updateProgress(message, sent, size); }); msg.remove(); }).appendTo(msg); $('<button>').addClass('jsxc_btn jsxc_btn-default').text($.t('Abort')).click(function() { jsxc.gui.window.hideOverlay(bid); }).appendTo(msg); }); } }; jsxc.gui.template = {}; /** * Return requested template and replace all placeholder * * @memberOf jsxc.gui.template; * @param {type} name template name * @param {type} bid * @param {type} msg * @returns {String} HTML Template */ jsxc.gui.template.get = function(name, bid, msg) { // common placeholder var ph = { my_priv_fingerprint: jsxc.storage.getUserItem('priv_fingerprint') ? jsxc.storage.getUserItem('priv_fingerprint').replace(/(.{8})/g, '$1 ') : $.t('not_available'), my_jid: jsxc.storage.getItem('jid') || '', my_node: Strophe.getNodeFromJid(jsxc.storage.getItem('jid') || '') || '', root: jsxc.options.root, app_name: jsxc.options.app_name, version: jsxc.version }; // placeholder depending on bid if (bid) { var data = jsxc.storage.getUserItem('buddy', bid); $.extend(ph, { bid_priv_fingerprint: (data && data.fingerprint) ? data.fingerprint.replace(/(.{8})/g, '$1 ') : $.t('not_available'), bid_jid: bid, bid_name: (data && data.name) ? data.name : bid }); } // placeholder depending on msg if (msg) { $.extend(ph, { msg: msg }); } var ret = jsxc.gui.template[name]; if (typeof(ret) === 'string') { // prevent 404 ret = ret.replace(/\{\{root\}\}/g, ph.root); // convert to string ret = $('<div>').append($(ret).i18n()).html(); // replace placeholders ret = ret.replace(/\{\{([a-zA-Z0-9_\-]+)\}\}/g, function(s, key) { return (typeof ph[key] === 'string') ? ph[key] : s; }); return ret; } jsxc.debug('Template not available: ' + name); return name; };
mit
samNson/MyProject_JS300
app/app.js
510
var express = require('express'); var mongoose = require('mongoose'); var bodyParser = require('body-parser'); var truckRouter = require('./routes/truckRoutes'); var app = express(); var db = mongoose.connect('mongodb://localhost/foodTruckAPI'); app.use(express.static('public')); app.use(bodyParser.urlencoded({extended: true})); app.use(bodyParser.json()); var port = process.env.PORT || 3000; app.use('/trucks', truckRouter); app.listen(port, function() { console.log('listening on port', port); });
mit
laonawuli/secondhandmobiphone
MobilePhone/Program.cs
883
using System; using System.Drawing; using System.Windows.Forms; using DevExpress.Skins; using DevExpress.UserSkins; using DevExpress.Utils; using MobilePhoneLibrary.Controls.Forms; namespace MobilePhone { static class Program { /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main(string[] args) { if (args.Length != 1 || args[0] != "who") { return; } BonusSkins.Register(); SkinManager.EnableFormSkins(); AppearanceObject.DefaultFont = new Font("微软雅黑", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); } } }
mit
chanzuckerberg/idseq-web
spec/factories/taxon_summaries.rb
318
FactoryBot.define do factory :taxon_summary do sequence(:tax_id) { |n| n } count_type { "NT" } tax_level { 1 } mean { 0.5 } stdev { 1 } rpm_list { "[0,1] " } # NOTE: this conflicts with pipeline_report_service_spec.rb # association :taxon_lineage, factory: [:taxon_lineage] end end
mit
woodfobm/Capstone-Multiplayer
MpPong/MpPong/WebSockets/WebSocketHandler.cs
2061
using System; using System.Net.WebSockets; using System.Text; using System.Threading; using System.Threading.Tasks; namespace MpPong { public abstract class WebSocketHandler { protected WebSocketConnectionManager WebSocketConnectionManager { get; set; } public WebSocketHandler(WebSocketConnectionManager webSocketConnectionManager) { WebSocketConnectionManager = webSocketConnectionManager; } public virtual async Task OnConnected(WebSocket socket) { WebSocketConnectionManager.AddSocket(socket); } public virtual async Task OnDisconnected(WebSocket socket) { await WebSocketConnectionManager.RemoveSocket(WebSocketConnectionManager.GetId(socket)); } public async Task SendMessageAsync(WebSocket socket, string message) { if (socket.State != WebSocketState.Open) return; await socket.SendAsync(buffer: new ArraySegment<byte>(array: Encoding.ASCII.GetBytes(message), offset: 0, count: message.Length), messageType: WebSocketMessageType.Text, endOfMessage: true, cancellationToken: CancellationToken.None); } public async Task SendMessageAsync(string socketId, string message) { await SendMessageAsync(WebSocketConnectionManager.GetSocketById(socketId), message); } public async Task SendMessageToAllAsync(string message) { foreach (var pair in WebSocketConnectionManager.GetAll()) { if (pair.Value.State == WebSocketState.Open) await SendMessageAsync(pair.Value, message); } } public abstract Task ReceiveAsync(WebSocket socket, WebSocketReceiveResult result, byte[] buffer); } }
mit
davekago/ember-fhir
app/serializers/explanation-of-benefit-add-item.js
81
export { default } from 'ember-fhir/serializers/explanation-of-benefit-add-item';
mit
hellofornow/wedding-site-client
config/index.js
1512
// see http://vuejs-templates.github.io/webpack for documentation. var path = require('path') module.exports = { build: { env: require('./prod.env'), index: path.resolve(__dirname, '../dist/index.html'), assetsRoot: path.resolve(__dirname, '../dist'), assetsSubDirectory: 'static', assetsPublicPath: '/', productionSourceMap: true, // Gzip off by default as many popular static hosts such as // Surge or Netlify already gzip all static assets for you. // Before setting to `true`, make sure to: // npm install --save-dev compression-webpack-plugin productionGzip: false, productionGzipExtensions: ['js', 'css'], // Run the build command with an extra argument to // View the bundle analyzer report after build finishes: // `npm run build --report` // Set to `true` or `false` to always turn it on or off bundleAnalyzerReport: process.env.npm_config_report }, dev: { env: require('./dev.env'), port: 8080, autoOpenBrowser: true, assetsSubDirectory: 'static', assetsPublicPath: '/', proxyTable: { '/api': { target: 'http://localhost:9000' } }, // CSS Sourcemaps off by default because relative paths are "buggy" // with this option, according to the CSS-Loader README // (https://github.com/webpack/css-loader#sourcemaps) // In our experience, they generally work as expected, // just be aware of this issue when enabling this option. cssSourceMap: false } }
mit
Aryellix/scrumator
app/cache/dev/twig/a/8/a84cd1c31748ce66470e8409773e3c3be52a9c39ff51e97d6882dc49e87243f2.php
6687
<?php /* ScrumatorBackendBundle:Project:index.html.twig */ class __TwigTemplate_a9545428e17104d161772d36be2777d2b139eb83892e177080843478b24f1d1d extends Twig_Template { public function __construct(Twig_Environment $env) { parent::__construct($env); // line 1 $this->parent = $this->loadTemplate("::base.html.twig", "ScrumatorBackendBundle:Project:index.html.twig", 1); $this->blocks = array( 'content' => array($this, 'block_content'), ); } protected function doGetParent(array $context) { return "::base.html.twig"; } protected function doDisplay(array $context, array $blocks = array()) { $__internal_30afa8270436291eb7286bbf5f651e3095d888153fd0d641cc4d49516fc76350 = $this->env->getExtension("native_profiler"); $__internal_30afa8270436291eb7286bbf5f651e3095d888153fd0d641cc4d49516fc76350->enter($__internal_30afa8270436291eb7286bbf5f651e3095d888153fd0d641cc4d49516fc76350_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "ScrumatorBackendBundle:Project:index.html.twig")); $this->parent->display($context, array_merge($this->blocks, $blocks)); $__internal_30afa8270436291eb7286bbf5f651e3095d888153fd0d641cc4d49516fc76350->leave($__internal_30afa8270436291eb7286bbf5f651e3095d888153fd0d641cc4d49516fc76350_prof); } // line 3 public function block_content($context, array $blocks = array()) { $__internal_3a29dc99c64e41c928c2041e37aeb15fd233592fa22cac3c5b83fad2b9c14b68 = $this->env->getExtension("native_profiler"); $__internal_3a29dc99c64e41c928c2041e37aeb15fd233592fa22cac3c5b83fad2b9c14b68->enter($__internal_3a29dc99c64e41c928c2041e37aeb15fd233592fa22cac3c5b83fad2b9c14b68_prof = new Twig_Profiler_Profile($this->getTemplateName(), "block", "content")); // line 4 echo "<h1>Project list</h1> <table class=\"records_list\"> <thead> <tr> <th>Id</th> <th>Name</th> <th>Ability</th> <th>Actions</th> </tr> </thead> <tbody> "; // line 16 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable((isset($context["entities"]) ? $context["entities"] : $this->getContext($context, "entities"))); foreach ($context['_seq'] as $context["_key"] => $context["entity"]) { // line 17 echo " <tr> <td><a href=\""; // line 18 echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("project_show", array("id" => $this->getAttribute($context["entity"], "id", array()))), "html", null, true); echo "\">"; echo twig_escape_filter($this->env, $this->getAttribute($context["entity"], "id", array()), "html", null, true); echo "</a></td> <td>"; // line 19 echo twig_escape_filter($this->env, $this->getAttribute($context["entity"], "name", array()), "html", null, true); echo "</td> <td>"; // line 20 echo twig_escape_filter($this->env, $this->getAttribute($context["entity"], "ability", array()), "html", null, true); echo "</td> <td> <ul> <li> <a href=\""; // line 24 echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("project_show", array("id" => $this->getAttribute($context["entity"], "id", array()))), "html", null, true); echo "\">show</a> </li> <li> <a href=\""; // line 27 echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("project_edit", array("id" => $this->getAttribute($context["entity"], "id", array()))), "html", null, true); echo "\">edit</a> </li> </ul> </td> </tr> "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['entity'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 33 echo " </tbody> </table> <ul> <li> <a href=\""; // line 38 echo $this->env->getExtension('routing')->getPath("project_new"); echo "\"> Create a new entry </a> </li> </ul> "; $__internal_3a29dc99c64e41c928c2041e37aeb15fd233592fa22cac3c5b83fad2b9c14b68->leave($__internal_3a29dc99c64e41c928c2041e37aeb15fd233592fa22cac3c5b83fad2b9c14b68_prof); } public function getTemplateName() { return "ScrumatorBackendBundle:Project:index.html.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 103 => 38, 96 => 33, 84 => 27, 78 => 24, 71 => 20, 67 => 19, 61 => 18, 58 => 17, 54 => 16, 40 => 4, 34 => 3, 11 => 1,); } } /* {% extends '::base.html.twig' %}*/ /* */ /* {% block content -%}*/ /* <h1>Project list</h1>*/ /* */ /* <table class="records_list">*/ /* <thead>*/ /* <tr>*/ /* <th>Id</th>*/ /* <th>Name</th>*/ /* <th>Ability</th>*/ /* <th>Actions</th>*/ /* </tr>*/ /* </thead>*/ /* <tbody>*/ /* {% for entity in entities %}*/ /* <tr>*/ /* <td><a href="{{ path('project_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>*/ /* <td>{{ entity.name }}</td>*/ /* <td>{{ entity.ability }}</td>*/ /* <td>*/ /* <ul>*/ /* <li>*/ /* <a href="{{ path('project_show', { 'id': entity.id }) }}">show</a>*/ /* </li>*/ /* <li>*/ /* <a href="{{ path('project_edit', { 'id': entity.id }) }}">edit</a>*/ /* </li>*/ /* </ul>*/ /* </td>*/ /* </tr>*/ /* {% endfor %}*/ /* </tbody>*/ /* </table>*/ /* */ /* <ul>*/ /* <li>*/ /* <a href="{{ path('project_new') }}">*/ /* Create a new entry*/ /* </a>*/ /* </li>*/ /* </ul>*/ /* {% endblock %}*/ /* */
mit
microsoft/Azure-Kinect-Sensor-SDK
src/csharp/SDK/DeviceConfiguration.cs
3879
//------------------------------------------------------------------------------ // <copyright file="DeviceConfiguration.cs" company="Microsoft"> // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // </copyright> //------------------------------------------------------------------------------ using System; namespace Microsoft.Azure.Kinect.Sensor { /// <summary> /// Represents the configuration to run an Azure Kinect device in. /// </summary> /// <remarks> /// Default initialization is the same as K4A_DEVICE_CONFIG_INIT_DISABLE_ALL. /// </remarks> public class DeviceConfiguration { /// <summary> /// Gets or sets the image format to capture with the color camera. /// </summary> public ImageFormat ColorFormat { get; set; } = ImageFormat.ColorMJPG; /// <summary> /// Gets or sets the image resolution to capture with the color camera. /// </summary> public ColorResolution ColorResolution { get; set; } = ColorResolution.Off; /// <summary> /// Gets or sets the capture mode for the depth camera. /// </summary> public DepthMode DepthMode { get; set; } = DepthMode.Off; /// <summary> /// Gets or sets the desired frame rate for the color and depth cameras. /// </summary> public FPS CameraFPS { get; set; } = FPS.FPS30; /// <summary> /// Gets or sets a value indicating whether to only return synchronized depth and color images. /// </summary> /// <remarks> /// If this is false, when color or depth images are dropped, the other corresponding image will be dropped too. /// </remarks> public bool SynchronizedImagesOnly { get; set; } = false; /// <summary> /// Gets or sets the desired delay between the capture of the color image and the capture of the depth image. /// </summary> public TimeSpan DepthDelayOffColor { get; set; } = TimeSpan.Zero; /// <summary> /// Gets or sets the external synchronization mode. /// </summary> public WiredSyncMode WiredSyncMode { get; set; } = WiredSyncMode.Standalone; /// <summary> /// Gets or sets the external synchronization timing. /// </summary> public TimeSpan SuboridinateDelayOffMaster { get; set; } = TimeSpan.Zero; /// <summary> /// Gets or sets a value indicating whether the automatic streaming indicator light is disabled. /// </summary> public bool DisableStreamingIndicator { get; set; } = false; /// <summary> /// Get the equivalent native configuration structure. /// </summary> /// <returns>A k4a_device_configuration_t.</returns> internal NativeMethods.k4a_device_configuration_t GetNativeConfiguration() { // Ticks are in 100ns units int depth_delay_off_color_usec = checked((int)( this.DepthDelayOffColor.Ticks / 10)); uint subordinate_delay_off_master_usec = checked((uint)( this.SuboridinateDelayOffMaster.Ticks / 10)); return new NativeMethods.k4a_device_configuration_t { color_format = this.ColorFormat, color_resolution = this.ColorResolution, depth_mode = this.DepthMode, camera_fps = this.CameraFPS, synchronized_images_only = this.SynchronizedImagesOnly, depth_delay_off_color_usec = depth_delay_off_color_usec, wired_sync_mode = this.WiredSyncMode, subordinate_delay_off_master_usec = subordinate_delay_off_master_usec, disable_streaming_indicator = this.DisableStreamingIndicator, }; } } }
mit
tritech/jsDAV
lib/DAV/util.js
39341
/* * @package jsDAV * @subpackage DAV * @copyright Copyright(c) 2011 Ajax.org B.V. <info AT ajax DOT org> * @author Mike de Boer <info AT mikedeboer DOT nl> * @license http://github.com/mikedeboer/jsDAV/blob/master/LICENSE MIT License */ var jsDAV = require("./../jsdav"); var Crypto = require("crypto"); var Async = require("asyncjs"); var Exc = require("./exceptions"); var Xml = require("libxmljs"); var Util = require("util"); /** * Make sure that an array instance contains only unique values (NO duplicates). * * @type {Array} */ exports.makeUnique = function(arr){ var i, length, newArr = []; for (i = 0, length = arr.length; i < length; i++) { if (newArr.indexOf(arr[i]) == -1) newArr.push(arr[i]); } arr.length = 0; for (i = 0, length = newArr.length; i < length; i++) arr.push(newArr[i]); return arr; }; /** * Search for a value 'obj' inside an array instance and remove it when found. * * @param {Array} arr * @param {mixed} obj * @type {Array} */ exports.arrayRemove = function(arr, obj) { for (var i = arr.length - 1; i >= 0; i--) { if (arr[i] != obj) continue; arr.splice(i, 1); } return arr; }; /** * Strips whitespace from the beginning and end of a string * version: 1107.2516 * from: http://phpjs.org/functions/trim * original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) * example 1: trim(' Kevin van Zonneveld '); * returns 1: 'Kevin van Zonneveld' * example 2: trim('Hello World', 'Hdle'); * returns 2: 'o Wor' * example 3: trim(16, 1); * returns 3: 6 */ exports.trim = function(str, charlist) { // Strips whitespace from the beginning and end of a string var whitespace, l = 0, i = 0; str += ""; if (!charlist) { // default list whitespace = " \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000"; } else { // preg_quote custom list charlist += ""; whitespace = charlist.replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g, "$1"); } l = str.length; for (i = 0; i < l; i++) { if (whitespace.indexOf(str.charAt(i)) === -1) { str = str.substring(i); break; } } l = str.length; for (i = l - 1; i >= 0; i--) { if (whitespace.indexOf(str.charAt(i)) === -1) { str = str.substring(0, i + 1); break; } } return whitespace.indexOf(str.charAt(0)) === -1 ? str : ""; }; /** * Removes trailing whitespace * version: 1107.2516 * from: http://phpjs.org/functions/rtrim * original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) * example 1: rtrim(' Kevin van Zonneveld '); * returns 1: ' Kevin van Zonneveld' */ exports.rtrim = function(str, charlist) { charlist = !charlist ? " \\s\u00A0" : (charlist+"").replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g, "\\$1"); var re = new RegExp("[" + charlist + "]+$", "g"); return (str+"").replace(re, ""); }; /** * Splits a string into chunks like JS' String#split(), but with some additional * options, like each item in the resulting array is stripped from any whitespace. * * @param {String} s * @param {String} seperator * @param {Number} limit * @param {Boolean} bLowerCase */ exports.splitSafe = function(s, seperator, limit, bLowerCase) { return (bLowerCase && s.toLowerCase() || s) .replace(/(?:^\s+|\n|\s+$)/g, "") .split(new RegExp("[\\s ]*" + seperator + "[\\s ]*", "g"), limit || 999); }; /** * Extends an object with one or more other objects by copying all their * properties. * @param {Object} dest the destination object. * @param {Object} src the object that is copies from. * @return {Object} the destination object. */ exports.extend = function(dest, src){ var prop, i, x = !dest.notNull; if (arguments.length == 2) { for (prop in src) { if (x || src[prop]) dest[prop] = src[prop]; } return dest; } for (i = 1; i < arguments.length; i++) { src = arguments[i]; for (prop in src) { if (x || src[prop]) dest[prop] = src[prop]; } } return dest; }; /** * Main used to check if 'err' is undefined or null * * @param {mixed} obj * @return {Boolean} */ exports.empty = function(obj) { if (arguments.length === 1) return obj === undefined || obj === null || obj === "" || obj === false; // support multiple arguments that shortens: // Util.empty('foo') && Util.empty('bar') to Util.empty('foo', 'bar') for (var empty = true, i = 0, l = arguments.length; i < l && empty; ++i) { obj = arguments[i]; empty = (obj === undefined || obj === null || obj === "" || obj === false); } return empty; }; /** * Determines whether a string is true in the html attribute sense. * @param {mixed} value the variable to check * Possible values: * true The function returns true. * 'true' The function returns true. * 'on' The function returns true. * 1 The function returns true. * '1' The function returns true. * @return {Boolean} whether the string is considered to imply truth. */ exports.isTrue = function(c){ return (c === true || c === "true" || c === "on" || typeof c == "number" && c > 0 || c === "1"); }; /** * Determines whether a string is false in the html attribute sense. * @param {mixed} value the variable to check * Possible values: * false The function returns true. * 'false' The function returns true. * 'off' The function returns true. * 0 The function returns true. * '0' The function returns true. * @return {Boolean} whether the string is considered to imply untruth. */ exports.isFalse = function(c){ return (c === false || c === "false" || c === "off" || c === 0 || c === "0"); }; /** * Returns the 'dirname' and 'basename' for a path. * * The reason there is a custom function for this purpose, is because * basename() is locale aware (behaviour changes if C locale or a UTF-8 locale is used) * and we need a method that just operates on UTF-8 characters. * * In addition basename and dirname are platform aware, and will treat backslash (\) as a * directory separator on windows. * * This method returns the 2 components as an array. * * If there is no dirname, it will return an empty string. Any / appearing at the end of the * string is stripped off. * * @param {string} path * @return array */ exports.splitPath = function(path) { //var sPath = Url.parse(path).pathname; //return [Path.dirname(sPath) || null, Path.basename(sPath) || null]; var matches = path.match(/^(?:(?:(.*)(?:\/+))?([^\/]+))(?:\/?)$/i); return matches && matches.length ? [matches[1] || "", matches[2] || ""] : [null, null]; }; exports.escapeRegExp = function(str) { return str.replace(/([.*+?\^${}()|\[\]\/\\])/g, "\\$1"); }; exports.escapeShell = function(str) { return str.replace(/([\\"'`$\s\(\)<>])/g, "\\$1"); }; // Internationalization strings exports.i18n = { /** * Defines what day starts the week * * Monday (1) is the international standard. * Redefine this to 0 if you want weeks to begin on Sunday. */ beginWeekday : 1, dayNames : [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], dayNumbers : { "Sun" : 0, "Mon" : 1, "Tue" : 2, "Wed" : 3, "Thu" : 4, "Fri" : 5, "Sat" : 6, "Sunday" : 0, "Monday" : 1, "Tuesday" : 2, "Wednesday" : 3, "Thursday" : 4, "Friday" : 5, "Saturday" : 6 }, monthNames : [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], monthNumbers : { "Jan" : 0, "Feb" : 1, "Mar" : 2, "Apr" : 3, "May" : 4, "Jun" : 5, "Jul" : 6, "Aug" : 7, "Sep" : 8, "Oct" : 9, "Nov" : 10, "Dec" : 11 } }; exports.DATE_DEFAULT = "ddd mmm dd yyyy HH:MM:ss"; exports.DATE_SHORT = "m/d/yy"; exports.DATE_MEDIUM = "mmm d, yyyy"; exports.DATE_LONG = "mmmm d, yyyy"; exports.DATE_FULL = "dddd, mmmm d, yyyy"; exports.DATE_SHORTTIME = "h:MM TT"; exports.DATE_MEDIUMTIME = "h:MM:ss TT"; exports.DATE_LONGTIME = "h:MM:ss TT Z"; exports.DATE_ISODATE = "yyyy-mm-dd"; exports.DATE_ISOTIME = "HH:MM:ss"; exports.DATE_ISODATETIME = "yyyy-mm-dd'T'HH:MM:ss"; exports.DATE_ISOUTCDATETIME = "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"; exports.DATE_RFC1123 = "ddd, dd mmm yyyy HH:MM:ss o"; exports.DATE_RFC822 = "ddd, dd, mmm yy HH:MM:ss Z";////RFC 822: 'Tue, 20 Jun 82 08:09:07 GMT' exports.dateFormat = (function () { var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g, timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[\-+]\d{4})?)\b/g, timezoneClip = /[^\-+\dA-Z]/g, pad = function (val, len) { val = String(val); len = len || 2; while (val.length < len) val = "0" + val; return val; }; // Regexes and supporting functions are cached through closure return function (date, mask, utc) { // You can't provide utc if you skip other args (use the "UTC:" mask prefix) if (arguments.length == 1 && (typeof date == "string" || date instanceof String) && !/\d/.test(date)) { mask = date; date = undefined; } // Passing date through Date applies apf.date.getDateTime, if necessary date = date ? new Date(date) : new Date(); if (isNaN(date)) return "NaN";//throw new SyntaxError("invalid date"); mask = String(mask || exports.DATE_DEFAULT); // Allow setting the utc argument via the mask if (mask.slice(0, 4) == "UTC:") { mask = mask.slice(4); utc = true; } var _ = utc ? "getUTC" : "get", d = date[_ + "Date"](), D = date[_ + "Day"](), m = date[_ + "Month"](), y = date[_ + "FullYear"](), H = date[_ + "Hours"](), M = date[_ + "Minutes"](), s = date[_ + "Seconds"](), L = date[_ + "Milliseconds"](), o = utc ? 0 : date.getTimezoneOffset(), flags = { d : d, dd : pad(d), ddd : exports.i18n.dayNames[D], dddd: exports.i18n.dayNames[D + 7], m : m + 1, mm : pad(m + 1), mmm : exports.i18n.monthNames[m], mmmm: exports.i18n.monthNames[m + 12], yy : String(y).slice(2), yyyy: y, h : H % 12 || 12, hh : pad(H % 12 || 12), H : H, HH : pad(H), M : M, MM : pad(M), s : s, ss : pad(s), l : pad(L, 3), L : pad(L > 99 ? Math.round(L / 10) : L), t : H < 12 ? "a" : "p", tt : H < 12 ? "am" : "pm", T : H < 12 ? "A" : "P", TT : H < 12 ? "AM" : "PM", Z : utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""), o : (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4), S : ["th", "st", "nd", "rd"] [d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10] }; return mask.replace(token, function ($0) { return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1); }); }; })(); /** * Returns the 'clark notation' for an element. * * For example, and element encoded as: * <b:myelem xmlns:b="http://www.example.org/" /> * will be returned as: * {http://www.example.org}myelem * * This format is used throughout the jsDAV sourcecode. * Elements encoded with the urn:DAV namespace will * be returned as if they were in the DAV: namespace. This is to avoid * compatibility problems. * * This function will return null if a nodetype other than an Element is passed. * * @param DOMElement dom * @return string */ exports.toClarkNotation = function(node_or_ns, name) { var ns, name; if (!node_or_ns) return null; if(node_or_ns instanceof Xml.Element) { ns = node_or_ns.namespace(); if(ns) ns = ns.href(); name = node_or_ns.name(); } else { ns = node_or_ns; } if(ns === "urn:DAV") ns = "DAV:"; return "{" + ns + "}" + name; }; /** * Converts a string from {DAV:}element-name to a two element array. * * If the element namespace was not specified, the first element of the * array will be null. */ exports.fromClarkNotation = function(element) { var parts = element.match(/^\{([^\}]*)\}(.*)/); if(!parts || parts[1] === "") return [null, element]; else return [parts[1], parts[2]]; } ///** // * This method takes an XML document (as string) and converts all instances of the // * DAV: namespace to urn:DAV // * // * This is unfortunately needed, because the DAV: namespace violates the xml namespaces // * spec, and causes the DOM to throw errors // */ //exports.convertDAVNamespace = function(xmlDocument) { // // This is used to map the DAV: namespace to urn:DAV. This is needed, because the DAV: // // namespace is actually a violation of the XML namespaces specification, and will cause errors // return xmlDocument.replace(/xmlns(:[A-Za-z0-9_]*)?=("|')DAV:("|')/g, "xmlns$1=$2urn:DAV$2"); //}; exports.xmlEntityMap = { "quot": "34", "amp": "38", "apos": "39", "lt": "60", "gt": "62", "nbsp": "160", "iexcl": "161", "cent": "162", "pound": "163", "curren": "164", "yen": "165", "brvbar": "166", "sect": "167", "uml": "168", "copy": "169", "ordf": "170", "laquo": "171", "not": "172", "shy": "173", "reg": "174", "macr": "175", "deg": "176", "plusmn": "177", "sup2": "178", "sup3": "179", "acute": "180", "micro": "181", "para": "182", "middot": "183", "cedil": "184", "sup1": "185", "ordm": "186", "raquo": "187", "frac14": "188", "frac12": "189", "frac34": "190", "iquest": "191", "agrave": ["192", "224"], "aacute": ["193", "225"], "acirc": ["194", "226"], "atilde": ["195", "227"], "auml": ["196", "228"], "aring": ["197", "229"], "aelig": ["198", "230"], "ccedil": ["199", "231"], "egrave": ["200", "232"], "eacute": ["201", "233"], "ecirc": ["202", "234"], "euml": ["203", "235"], "igrave": ["204", "236"], "iacute": ["205", "237"], "icirc": ["206", "238"], "iuml": ["207", "239"], "eth": ["208", "240"], "ntilde": ["209", "241"], "ograve": ["210", "242"], "oacute": ["211", "243"], "ocirc": ["212", "244"], "otilde": ["213", "245"], "ouml": ["214", "246"], "times": "215", "oslash": ["216", "248"], "ugrave": ["217", "249"], "uacute": ["218", "250"], "ucirc": ["219", "251"], "uuml": ["220", "252"], "yacute": ["221", "253"], "thorn": ["222", "254"], "szlig": "223", "divide": "247", "yuml": ["255", "376"], "oelig": ["338", "339"], "scaron": ["352", "353"], "fnof": "402", "circ": "710", "tilde": "732", "alpha": ["913", "945"], "beta": ["914", "946"], "gamma": ["915", "947"], "delta": ["916", "948"], "epsilon": ["917", "949"], "zeta": ["918", "950"], "eta": ["919", "951"], "theta": ["920", "952"], "iota": ["921", "953"], "kappa": ["922", "954"], "lambda": ["923", "955"], "mu": ["924", "956"], "nu": ["925", "957"], "xi": ["926", "958"], "omicron": ["927", "959"], "pi": ["928", "960"], "rho": ["929", "961"], "sigma": ["931", "963"], "tau": ["932", "964"], "upsilon": ["933", "965"], "phi": ["934", "966"], "chi": ["935", "967"], "psi": ["936", "968"], "omega": ["937", "969"], "sigmaf": "962", "thetasym": "977", "upsih": "978", "piv": "982", "ensp": "8194", "emsp": "8195", "thinsp": "8201", "zwnj": "8204", "zwj": "8205", "lrm": "8206", "rlm": "8207", "ndash": "8211", "mdash": "8212", "lsquo": "8216", "rsquo": "8217", "sbquo": "8218", "ldquo": "8220", "rdquo": "8221", "bdquo": "8222", "dagger": ["8224", "8225"], "bull": "8226", "hellip": "8230", "permil": "8240", "prime": ["8242", "8243"], "lsaquo": "8249", "rsaquo": "8250", "oline": "8254", "frasl": "8260", "euro": "8364", "image": "8465", "weierp": "8472", "real": "8476", "trade": "8482", "alefsym": "8501", "larr": ["8592", "8656"], "uarr": ["8593", "8657"], "rarr": ["8594", "8658"], "darr": ["8595", "8659"], "harr": ["8596", "8660"], "crarr": "8629", "forall": "8704", "part": "8706", "exist": "8707", "empty": "8709", "nabla": "8711", "isin": "8712", "notin": "8713", "ni": "8715", "prod": "8719", "sum": "8721", "minus": "8722", "lowast": "8727", "radic": "8730", "prop": "8733", "infin": "8734", "ang": "8736", "and": "8743", "or": "8744", "cap": "8745", "cup": "8746", "int": "8747", "there4": "8756", "sim": "8764", "cong": "8773", "asymp": "8776", "ne": "8800", "equiv": "8801", "le": "8804", "ge": "8805", "sub": "8834", "sup": "8835", "nsub": "8836", "sube": "8838", "supe": "8839", "oplus": "8853", "otimes": "8855", "perp": "8869", "sdot": "8901", "lceil": "8968", "rceil": "8969", "lfloor": "8970", "rfloor": "8971", "lang": "9001", "rang": "9002", "loz": "9674", "spades": "9824", "clubs": "9827", "hearts": "9829", "diams": "9830" }; /** * Escape an xml string making it ascii compatible. * @param {String} str the xml string to escape. * @return {String} the escaped string. */ exports.escapeXml = function(str) { if (typeof str != "string") return str; return (str || "") .replace(/&/g, "&#38;") .replace(/"/g, "&#34;") .replace(/</g, "&#60;") .replace(/>/g, "&#62;") .replace(/'/g, "&#39;") .replace(/&([a-z]+);/gi, function(a, m) { var x = exports.xmlEntityMap[m.toLowerCase()]; if (x) return "&#" + (Array.isArray(x) ? x[0] : x) + ";"; return a; }); }; /** * This method provides a generic way to load a DOMDocument for WebDAV use. * * This method throws a jsDAV_Exception_BadRequest exception for any xml errors. * It does not preserve whitespace, and it converts the DAV: namespace to urn:DAV. * * @param string xml * @throws jsDAV_Exception_BadRequest * @return DOMDocument */ exports.loadDOMDocument = function(xml, callback) { if (!xml) return callback(new Exc.jsDAV_Exception_BadRequest("Empty XML document sent")); var root = Xml.parseXmlString(xml); if(root instanceof Xml.Document) callback(null, root); else callback(new Exc.jsDAV_Exception_BadRequest("The request body had an invalid XML body.")); }; /** * Parses all WebDAV properties out of a DOM Element * * Generally WebDAV properties are encloded in {DAV:}prop elements. This * method helps by going through all these and pulling out the actual * propertynames, making them array keys and making the property values, * well.. the array values. * * If no value was given (self-closing element) null will be used as the * value. This is used in for example PROPFIND requests. * * Complex values are supported through the propertyMap argument. The * propertyMap should have the clark-notation properties as it's keys, and * classnames as values. * * When any of these properties are found, the unserialize() method will be * (statically) called. The result of this method is used as the value. * * @param {DOMElement} parentNode * @param {Object} propertyMap * @return array */ exports.parseProperties = function(parentNode, propertyMap) { propertyMap = propertyMap || {}; var proplist = {}; var propnodes = parentNode.find('xmlns:prop', 'DAV:'); for(var i=0; i<propnodes.length; ++i) { var children = propnodes[i].childNodes(); for(var j=0; j<children.length; ++j) { var propdata = children[j]; if(propdata.type() != 'element') continue; var propname = exports.toClarkNotation(propdata); if(propertyMap[propname]) proplist[propname] = propertyMap[propname].unserialize(propdata); else proplist[propname] = propdata.text(); } } return proplist; }; /** * Return md5 hash of the given string and optional encoding, * defaulting to hex. * * @param {String} str * @param {String} encoding * @return {String} * @api public */ exports.md5 = function(str, encoding){ return Crypto.createHash("md5").update(str).digest(encoding || "hex"); }; /** * Return sha1 hash of the given string and optional encoding, * defaulting to hex. * * @param {String} str * @param {String} encoding * @return {String} * @api public */ exports.sha1 = function(str, encoding){ return Crypto.createHash("sha1").update(str).digest(encoding || "hex"); }; /** * Default mime type. */ var defaultMime = exports.defaultMime = "application/octet-stream"; exports.mime = { /** * Return mime type for the given path, * otherwise default to exports.defaultMime * ("application/octet-stream"). * * @param {String} path * @return {String} * @api public */ type: function getMime(path) { var index = String(path).lastIndexOf("."); if (index < 0) { return defaultMime; } var type = exports.mime.types[path.substring(index).toLowerCase()] || defaultMime; return (/(text|javascript)/).test(type) ? type + "; charset=utf-8" : type; }, /** * Mime types. */ types: { ".3gp" : "video/3gpp", ".a" : "application/octet-stream", ".ai" : "application/postscript", ".aif" : "audio/x-aiff", ".aiff" : "audio/x-aiff", ".aml" : "application/aml", ".asc" : "application/pgp-signature", ".asf" : "video/x-ms-asf", ".asm" : "text/x-asm", ".asx" : "video/x-ms-asf", ".atom" : "application/atom+xml", ".au" : "audio/basic", ".avi" : "video/x-msvideo", ".bat" : "application/x-msdownload", ".bin" : "application/octet-stream", ".bmp" : "image/bmp", ".bz2" : "application/x-bzip2", ".c" : "text/x-c", ".cab" : "application/vnd.ms-cab-compressed", ".cc" : "text/x-c", ".chm" : "application/vnd.ms-htmlhelp", ".class" : "application/octet-stream", ".coffee": "text/x-script.coffeescript", ".com" : "application/x-msdownload", ".conf" : "text/plain", ".cpp" : "text/x-c", ".crt" : "application/x-x509-ca-cert", ".cs" : "text/x-csharp", ".css" : "text/css", ".csv" : "text/csv", ".cxx" : "text/x-c", ".deb" : "application/x-debian-package", ".der" : "application/x-x509-ca-cert", ".diff" : "text/x-diff", ".djv" : "image/vnd.djvu", ".djvu" : "image/vnd.djvu", ".dll" : "application/x-msdownload", ".dmg" : "application/octet-stream", ".doc" : "application/msword", ".dot" : "application/msword", ".dtd" : "application/xml-dtd", ".dvi" : "application/x-dvi", ".ear" : "application/java-archive", ".eml" : "message/rfc822", ".eps" : "application/postscript", ".exe" : "application/x-msdownload", ".f" : "text/x-fortran", ".f77" : "text/x-fortran", ".f90" : "text/x-fortran", ".flv" : "video/x-flv", ".for" : "text/x-fortran", ".gem" : "application/octet-stream", ".gemspec" : "text/x-script.ruby", ".gif" : "image/gif", ".gz" : "application/x-gzip", ".h" : "text/x-c", ".hh" : "text/x-c", ".htm" : "text/html", ".html" : "text/html", ".ico" : "image/vnd.microsoft.icon", ".ics" : "text/calendar", ".ifb" : "text/calendar", ".iso" : "application/octet-stream", ".jar" : "application/java-archive", ".java" : "text/x-java-source", ".jnlp" : "application/x-java-jnlp-file", ".jpeg" : "image/jpeg", ".jpg" : "image/jpeg", ".js" : "application/javascript", ".json" : "application/json", ".log" : "text/plain", ".m3u" : "audio/x-mpegurl", ".m4v" : "video/mp4", ".man" : "text/troff", ".manifest": "text/cache-manifest", ".mathml" : "application/mathml+xml", ".mbox" : "application/mbox", ".mdoc" : "text/troff", ".me" : "text/troff", ".mid" : "audio/midi", ".midi" : "audio/midi", ".mime" : "message/rfc822", ".mml" : "application/mathml+xml", ".mng" : "video/x-mng", ".mov" : "video/quicktime", ".mp3" : "audio/mpeg", ".mp4" : "video/mp4", ".mp4v" : "video/mp4", ".mpeg" : "video/mpeg", ".mpg" : "video/mpeg", ".ms" : "text/troff", ".msi" : "application/x-msdownload", ".odp" : "application/vnd.oasis.opendocument.presentation", ".ods" : "application/vnd.oasis.opendocument.spreadsheet", ".odt" : "application/vnd.oasis.opendocument.text", ".ogg" : "application/ogg", ".p" : "text/x-pascal", ".pas" : "text/x-pascal", ".pbm" : "image/x-portable-bitmap", ".pdf" : "application/pdf", ".pem" : "application/x-x509-ca-cert", ".pgm" : "image/x-portable-graymap", ".pgp" : "application/pgp-encrypted", ".php" : "application/x-httpd-php", ".pkg" : "application/octet-stream", ".pl" : "text/x-script.perl", ".pm" : "text/x-script.perl-module", ".png" : "image/png", ".pnm" : "image/x-portable-anymap", ".ppm" : "image/x-portable-pixmap", ".pps" : "application/vnd.ms-powerpoint", ".ppt" : "application/vnd.ms-powerpoint", ".ps" : "application/postscript", ".psd" : "image/vnd.adobe.photoshop", ".py" : "text/x-script.python", ".qt" : "video/quicktime", ".ra" : "audio/x-pn-realaudio", ".rake" : "text/x-script.ruby", ".ram" : "audio/x-pn-realaudio", ".rar" : "application/x-rar-compressed", ".rb" : "text/x-script.ruby", ".rdf" : "application/rdf+xml", ".roff" : "text/troff", ".rpm" : "application/x-redhat-package-manager", ".rss" : "application/rss+xml", ".rtf" : "application/rtf", ".ru" : "text/x-script.ruby", ".s" : "text/x-asm", ".sgm" : "text/sgml", ".sgml" : "text/sgml", ".sh" : "application/x-sh", ".sig" : "application/pgp-signature", ".snd" : "audio/basic", ".so" : "application/octet-stream", ".svg" : "image/svg+xml", ".svgz" : "image/svg+xml", ".swf" : "application/x-shockwave-flash", ".t" : "text/troff", ".tar" : "application/x-tar", ".tbz" : "application/x-bzip-compressed-tar", ".tci" : "application/x-topcloud", ".tcl" : "application/x-tcl", ".tex" : "application/x-tex", ".texi" : "application/x-texinfo", ".texinfo" : "application/x-texinfo", ".text" : "text/plain", ".textile" : "text/x-web-textile", ".tif" : "image/tiff", ".tiff" : "image/tiff", ".torrent" : "application/x-bittorrent", ".tr" : "text/troff", ".ttf" : "application/x-font-ttf", ".txt" : "text/plain", ".vcf" : "text/x-vcard", ".vcs" : "text/x-vcalendar", ".vrml" : "model/vrml", ".war" : "application/java-archive", ".wav" : "audio/x-wav", ".wma" : "audio/x-ms-wma", ".wmv" : "video/x-ms-wmv", ".wmx" : "video/x-ms-wmx", ".wrl" : "model/vrml", ".wsdl" : "application/wsdl+xml", ".xbm" : "image/x-xbitmap", ".xhtml" : "application/xhtml+xml", ".xls" : "application/vnd.ms-excel", ".xml" : "application/xml", ".xpm" : "image/x-xpixmap", ".xsl" : "application/xml", ".xslt" : "application/xslt+xml", ".yaml" : "text/yaml", ".yml" : "text/yaml", ".zip" : "application/zip" } }; /** * Generate a random uuid. Usage: Math.uuid(length, radix) * * EXAMPLES: * // No arguments - returns RFC4122, version 4 ID * >>> Math.uuid() * "92329D39-6F5C-4520-ABFC-AAB64544E172" * * // One argument - returns ID of the specified length * >>> Math.uuid(15) // 15 character ID (default base=62) * "VcydxgltxrVZSTV" * * // Two arguments - returns ID of the specified length, and radix. (Radix must be <= 62) * >>> Math.uuid(8, 2) // 8 character ID (base=2) * "01001010" * >>> Math.uuid(8, 10) // 8 character ID (base=10) * "47473046" * >>> Math.uuid(8, 16) // 8 character ID (base=16) * "098F4D35" * * @param {Number} [len] The desired number of characters. Defaults to rfc4122, version 4 form * @param {Number} [radix] The number of allowable values for each character. * @type {String} */ exports.uuid = function(len, radix) { var i, chars = exports.uuid.CHARS, uuid = [], rnd = Math.random; radix = radix || chars.length; if (len) { // Compact form for (i = 0; i < len; i++) uuid[i] = chars[0 | rnd() * radix]; } else { // rfc4122, version 4 form var r; // rfc4122 requires these characters uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-"; uuid[14] = "4"; // Fill in random data. At i==19 set the high bits of clock sequence as // per rfc4122, sec. 4.1.5 for (i = 0; i < 36; i++) { if (!uuid[i]) { r = 0 | rnd() * 16; uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r & 0xf]; } } } return uuid.join(""); }; //Public array of chars to use exports.uuid.CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""); exports.uniqid = function(prefix, more_entropy) { // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + revised by: Kankrelune (http://www.webfaktory.info/) // % note 1: Uses an internal counter (in php_js global) to avoid collision // * example 1: uniqid(); // * returns 1: 'a30285b160c14' // * example 2: uniqid('foo'); // * returns 2: 'fooa30285b1cd361' // * example 3: uniqid('bar', true); // * returns 3: 'bara20285b23dfd1.31879087' if (typeof prefix == 'undefined') { prefix = ""; } var retId; var formatSeed = function (seed, reqWidth) { seed = parseInt(seed, 10).toString(16); // to hex str if (reqWidth < seed.length) { // so long we split return seed.slice(seed.length - reqWidth); } if (reqWidth > seed.length) { // so short we pad return Array(1 + (reqWidth - seed.length)).join("0") + seed; } return seed; }; if (!exports.uniqidSeed) { // init seed with big random int exports.uniqidSeed = Math.floor(Math.random() * 0x75bcd15); } exports.uniqidSeed++; retId = prefix // start with prefix, add current milliseconds hex string + formatSeed(parseInt(new Date().getTime() / 1000, 10), 8) + formatSeed(exports.uniqidSeed, 5); // add seed hex string if (more_entropy) { // for more entropy we add a float lower to 10 retId += (Math.random() * 10).toFixed(8).toString(); } return retId; }; exports.EventEmitter = function() {}; exports.EventEmitter.DEFAULT_TIMEOUT = 10000; // in milliseconds exports.EventEmitter.PRIO_LOW = 0x0001; exports.EventEmitter.PRIO_NORMAL = 0x0002; exports.EventEmitter.PRIO_HIGH = 0x0004; var _slice = Array.prototype.slice; (function() { var _ev = exports.EventEmitter; function persistRegistry() { if (this.$eventRegistry) return; this.$eventRegistry = {}; this.$eventRegistry[_ev.PRIO_LOW] = {}; this.$eventRegistry[_ev.PRIO_NORMAL] = {}; this.$eventRegistry[_ev.PRIO_HIGH] = {}; } function getListeners(eventName) { return (this.$eventRegistry[_ev.PRIO_HIGH][eventName] || []).concat( this.$eventRegistry[_ev.PRIO_NORMAL][eventName] || []).concat( this.$eventRegistry[_ev.PRIO_LOW][eventName] || []); } this.dispatchEvent = function() { persistRegistry.call(this); var args = _slice.call(arguments), eventName = args.shift().toLowerCase(), listeners = getListeners.call(this, eventName), cbdispatch = (typeof args[args.length - 1] == "function") ? args.pop() : function(){}; if (!listeners.length) return cbdispatch(); Async.list(listeners).each(function(listener, cbnext) { var timeout = null; var e = new exports.Event(eventName, function() { if(timeout) clearTimeout(timeout); cbnext.apply(null, arguments); }); if (listener.$usetimeout > 0) { timeout = setTimeout(function() { e.next("Event callback timeout: timeout reached, no "+ "callback fired within "+listener.$usetimeout+"ms"); }, listener.$usetimeout); } try { listener.apply(null, [e].concat(args)); } catch(err) { if(timeout) clearTimeout(timeout); return cbdispatch(err); } }).end(function(err) { if (jsDAV.debugMode && err && err !== true) exports.log("argument after event '" + eventName + "': " + err, "error"); cbdispatch(err); }); }; this.addEventListener = function(eventName, listener, prio, timeout) { persistRegistry.call(this); listener.$usetimeout = timeout === false ? 0 : (typeof timeout == "number") ? timeout : exports.EventEmitter.DEFAULT_TIMEOUT; eventName = eventName.toLowerCase(); prio = prio || _ev.PRIO_NORMAL; var allListeners = getListeners.call(this, eventName), listeners = this.$eventRegistry[prio][eventName]; if (!listeners) listeners = this.$eventRegistry[prio][eventName] = []; if (allListeners.indexOf(listener) == -1) listeners.push(listener); }; this.removeEventListener = function(eventName, listener) { persistRegistry.call(this); eventName = eventName.toLowerCase(); var _self = this; [_ev.PRIO_LOW, _ev.PRIO_NORMAL, _ev.PRIO_HIGH].forEach(function(prio) { var listeners = _self.$eventRegistry[prio][eventName]; if (!listeners) return; var index = listeners.indexOf(listener); if (index !== -1) listeners.splice(index, 1); }); }; }).call(exports.EventEmitter.prototype); exports.Event = function(type, callback) { this.done = false; this.type = type; this.next = function(err) { if(this.done) throw new Error("Event callback fired twice!"); this.done = true; callback(err); }; this.stop = function() { return this.next(true); }; }; exports.concatBuffers = function(bufs) { var buffer, length = 0, index = 0; if (!Array.isArray(bufs)) bufs = Array.prototype.slice.call(arguments); for (var i = 0, l = bufs.length; i < l; ++i) { buffer = bufs[i]; if (!buffer) continue; if (!Buffer.isBuffer(buffer)) buffer = bufs[i] = new Buffer(buffer); length += buffer.length; } buffer = new Buffer(length); bufs.forEach(function(buf, i) { buf = bufs[i]; buf.copy(buffer, index, 0, buf.length); index += buf.length; delete bufs[i]; }); return buffer; }; /** * StreamBuffer - Buffers submitted data in advance to facilitate asynchonous operations * http://tech.richardrodger.com/2011/03/28/node-js---dealing-with-submitted-http-request-data-when-you-have-to-make-a-database-call-first/ */ exports.streamBuffer = function(req) { var buffers = []; var ended = false; var ondata = null; var onend = null; req.streambuffer = { ondata: function(fn) { for (var i = 0; i < buffers.length; i++) fn(buffers[i]); ondata = fn; buffers = null; }, onend: function(fn) { onend = fn; if (ended) onend(); } }; req.on("data", function(chunk) { if (!chunk) return; if (ondata) ondata(chunk); else buffers.push(chunk); }); req.on("end", function() { ended = true; if (onend) onend(); }); return req; }; var levels = { "info": ["\033[90m", "\033[39m"], // grey "error": ["\033[31m", "\033[39m"], // red "fatal": ["\033[35m", "\033[39m"], // magenta "exit": ["\033[36m", "\033[39m"] // cyan }; exports.log = function() { var args = _slice.call(arguments); var lastArg = args[args.length - 1]; var level = levels[lastArg] ? args.pop() : "info"; if (!args.length) return; var msg = args.map(function(arg) { return typeof arg != "string" ? Util.inspect(arg) : arg; }).join(" "); var pfx = levels[level][0] + "[" + level + "]" + levels[level][1]; msg.split("\n").forEach(function(line) { console.log(pfx + " " + line); }); };
mit
sqli-nantes/ethereum-java
ethereum-java-core/src/main/java/ethereumjava/gson/ResponseTypeAdapter.java
1521
package ethereumjava.gson; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; import java.lang.reflect.Type; import java.util.Map; import ethereumjava.net.Request; import ethereumjava.net.Response; /** * Created by gunicolas on 25/08/16. */ public class ResponseTypeAdapter<T> implements JsonSerializer<Response<T>>, JsonDeserializer<Response<T>> { Map<Integer, Request> requestQueue; public ResponseTypeAdapter(Map<Integer, Request> _requestQueue) { requestQueue = _requestQueue; } @Override public Response<T> deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { JsonObject requestJson = json.getAsJsonObject(); int requestId = requestJson.get("id").getAsInt(); Request request = requestQueue.get(requestId); Type returnType = request.getReturnType(); T result = context.deserialize(requestJson.get("result"), returnType); Response<T>.Error error = context.deserialize(requestJson.get("error"), Response.Error.class); return new Response<>(requestId, result, error, request); } @Override public JsonElement serialize(Response src, Type typeOfSrc, JsonSerializationContext context) { return null; } }
mit
agrc/public-utilities
src/app/LayerPicker.js
2030
define([ 'dojo/text!./templates/LayerPicker.html', 'dojo/_base/declare', 'dojo/_base/array', 'dojo/on', 'dojo/topic', 'dijit/_WidgetBase', 'dijit/_TemplatedMixin', 'dijit/_WidgetsInTemplateMixin', './LayerItem', './config', './data/mapLayers' ], function( template, declare, array, on, topic, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, LayerItem, config, mapLayers ) { return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], { // description: // Lets users choose what layer to show on the map templateString: template, baseClass: 'layer-picker', widgetsInTemplate: true, // Properties to be sent into constructor postCreate: function() { // summary: // Overrides method of same name in dijit._Widget. // tags: // private console.log('app.LayerPicker::postCreate', arguments); this.childWidgets = []; array.forEach(mapLayers, function(layerInfo) { var item = new LayerItem(layerInfo).placeAt(this.listItems, 'last'); item.on('map-layer-activated', this.notifyMap); this.childWidgets.push(item); }, this); this.inherited(arguments); }, notifyMap: function(e) { // summary: // tell the map controller to do stuff console.log('app.LayerPicker::notifyMap', arguments); topic.publish(config.topics.map.enableLayer, e.layerInfo); }, startup: function() { // summary: // startup console.log('app.LayerPicker::startup', arguments); array.forEach(this.childWidgets, function(widget) { this.own(widget); widget.startup(); }, this); this.inherited(arguments); } }); });
mit
CatalinaTechnology/ctAPIClientExamples
client.serviceEmployeeMaintenance/Form1.Designer.cs
72107
namespace client.fieldService.serviceDispatch.maintenance.serviceEmployeeMaintenance { partial class Form1 { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.btnNew = new System.Windows.Forms.Button(); this.lblScreen = new System.Windows.Forms.Label(); this.lblScreenXML = new System.Windows.Forms.Label(); this.gvsmEmp = new System.Windows.Forms.DataGridView(); this.errorMessageDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.notesDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.resultCodeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.cetrtifiedDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.commLaborPctDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.commMaterialPctDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.cpnyIDDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.crtdDateTimeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.crtdProgDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.crtdUserDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.earnTypeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.eMID01DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.eMID02DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.eMID03DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.eMID04DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.eMID05DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.eMID06DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.eMID07DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.eMID08DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.eMID09DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.eMID10DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.eMID11DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.eMID12DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.eMID13DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.eMID14DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.eMID15DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.eMID16DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.eMID17DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.eMID18DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.eMID19DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.eMID20DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.emailAddrDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeActiveDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeaddress1DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeaddress2DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeBdateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeBranchIDDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeCellPhoneDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeCityDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeCommPlanDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeDeptDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeDLClassDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeDLExpDateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeDLNoDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeDLStateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeExemptionDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeFaxNoDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeFirstNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeHiredateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeHomePhoneDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeIdDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeLastNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeMaritalDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeMiddleInitDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeOffPhoneExtDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeePagerNoDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeePayRollIdDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeePayTypeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeQuotaDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeRaiseDateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeRateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeSexDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeSSNoDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeStateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeTermDateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeTypeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeVehicleIdDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeWorkerDeptDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.employeeZipDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.invtSiteIDDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.laborClassDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.lupdDateTimeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.lupdProgDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.lupdUserDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.noteIDDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ovhdFringeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ovhdFringeTypeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ovhdInsurDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ovhdInsurTypeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ovhdOtherDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ovhdOtherTypeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ovhdTaxesDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ovhdTaxesTypeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.shiftCodeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.supervisorDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.templateIDDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.timeZoneDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.unionCodeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.user1DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.user2DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.user3DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.user4DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.user5DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.user6DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.user7DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.user8DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.wageCodeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.wageGroupDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.workersCompDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.workLocDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.workTypeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.smEmpBindingSource = new System.Windows.Forms.BindingSource(this.components); this.btnUpdate = new System.Windows.Forms.Button(); this.tbScreen = new System.Windows.Forms.TextBox(); this.lblEmployeeID = new System.Windows.Forms.Label(); this.tbEmployeeID = new System.Windows.Forms.TextBox(); this.btnLoad = new System.Windows.Forms.Button(); this.btnSearch = new System.Windows.Forms.Button(); this.btnGets = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.gvsmEmp)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.smEmpBindingSource)).BeginInit(); this.SuspendLayout(); // // btnNew // this.btnNew.Location = new System.Drawing.Point(677, 29); this.btnNew.Margin = new System.Windows.Forms.Padding(4); this.btnNew.Name = "btnNew"; this.btnNew.Size = new System.Drawing.Size(100, 28); this.btnNew.TabIndex = 38; this.btnNew.Text = "Create New"; this.btnNew.UseVisualStyleBackColor = true; this.btnNew.Click += new System.EventHandler(this.btnNew_Click); // // lblScreen // this.lblScreen.AutoSize = true; this.lblScreen.Location = new System.Drawing.Point(73, 120); this.lblScreen.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lblScreen.Name = "lblScreen"; this.lblScreen.Size = new System.Drawing.Size(57, 17); this.lblScreen.TabIndex = 37; this.lblScreen.Text = "Screen:"; // // lblScreenXML // this.lblScreenXML.AutoSize = true; this.lblScreenXML.Location = new System.Drawing.Point(73, 426); this.lblScreenXML.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lblScreenXML.Name = "lblScreenXML"; this.lblScreenXML.Size = new System.Drawing.Size(99, 17); this.lblScreenXML.TabIndex = 36; this.lblScreenXML.Text = "Screen (XML):"; // // gvsmEmp // this.gvsmEmp.AllowUserToAddRows = false; this.gvsmEmp.AllowUserToDeleteRows = false; this.gvsmEmp.AllowUserToOrderColumns = true; this.gvsmEmp.AutoGenerateColumns = false; this.gvsmEmp.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gvsmEmp.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.errorMessageDataGridViewTextBoxColumn, this.notesDataGridViewTextBoxColumn, this.resultCodeDataGridViewTextBoxColumn, this.cetrtifiedDataGridViewTextBoxColumn, this.commLaborPctDataGridViewTextBoxColumn, this.commMaterialPctDataGridViewTextBoxColumn, this.cpnyIDDataGridViewTextBoxColumn, this.crtdDateTimeDataGridViewTextBoxColumn, this.crtdProgDataGridViewTextBoxColumn, this.crtdUserDataGridViewTextBoxColumn, this.earnTypeDataGridViewTextBoxColumn, this.eMID01DataGridViewTextBoxColumn, this.eMID02DataGridViewTextBoxColumn, this.eMID03DataGridViewTextBoxColumn, this.eMID04DataGridViewTextBoxColumn, this.eMID05DataGridViewTextBoxColumn, this.eMID06DataGridViewTextBoxColumn, this.eMID07DataGridViewTextBoxColumn, this.eMID08DataGridViewTextBoxColumn, this.eMID09DataGridViewTextBoxColumn, this.eMID10DataGridViewTextBoxColumn, this.eMID11DataGridViewTextBoxColumn, this.eMID12DataGridViewTextBoxColumn, this.eMID13DataGridViewTextBoxColumn, this.eMID14DataGridViewTextBoxColumn, this.eMID15DataGridViewTextBoxColumn, this.eMID16DataGridViewTextBoxColumn, this.eMID17DataGridViewTextBoxColumn, this.eMID18DataGridViewTextBoxColumn, this.eMID19DataGridViewTextBoxColumn, this.eMID20DataGridViewTextBoxColumn, this.emailAddrDataGridViewTextBoxColumn, this.employeeActiveDataGridViewTextBoxColumn, this.employeeaddress1DataGridViewTextBoxColumn, this.employeeaddress2DataGridViewTextBoxColumn, this.employeeBdateDataGridViewTextBoxColumn, this.employeeBranchIDDataGridViewTextBoxColumn, this.employeeCellPhoneDataGridViewTextBoxColumn, this.employeeCityDataGridViewTextBoxColumn, this.employeeCommPlanDataGridViewTextBoxColumn, this.employeeDeptDataGridViewTextBoxColumn, this.employeeDLClassDataGridViewTextBoxColumn, this.employeeDLExpDateDataGridViewTextBoxColumn, this.employeeDLNoDataGridViewTextBoxColumn, this.employeeDLStateDataGridViewTextBoxColumn, this.employeeExemptionDataGridViewTextBoxColumn, this.employeeFaxNoDataGridViewTextBoxColumn, this.employeeFirstNameDataGridViewTextBoxColumn, this.employeeHiredateDataGridViewTextBoxColumn, this.employeeHomePhoneDataGridViewTextBoxColumn, this.employeeIdDataGridViewTextBoxColumn, this.employeeLastNameDataGridViewTextBoxColumn, this.employeeMaritalDataGridViewTextBoxColumn, this.employeeMiddleInitDataGridViewTextBoxColumn, this.employeeOffPhoneExtDataGridViewTextBoxColumn, this.employeePagerNoDataGridViewTextBoxColumn, this.employeePayRollIdDataGridViewTextBoxColumn, this.employeePayTypeDataGridViewTextBoxColumn, this.employeeQuotaDataGridViewTextBoxColumn, this.employeeRaiseDateDataGridViewTextBoxColumn, this.employeeRateDataGridViewTextBoxColumn, this.employeeSexDataGridViewTextBoxColumn, this.employeeSSNoDataGridViewTextBoxColumn, this.employeeStateDataGridViewTextBoxColumn, this.employeeTermDateDataGridViewTextBoxColumn, this.employeeTypeDataGridViewTextBoxColumn, this.employeeVehicleIdDataGridViewTextBoxColumn, this.employeeWorkerDeptDataGridViewTextBoxColumn, this.employeeZipDataGridViewTextBoxColumn, this.invtSiteIDDataGridViewTextBoxColumn, this.laborClassDataGridViewTextBoxColumn, this.lupdDateTimeDataGridViewTextBoxColumn, this.lupdProgDataGridViewTextBoxColumn, this.lupdUserDataGridViewTextBoxColumn, this.noteIDDataGridViewTextBoxColumn, this.ovhdFringeDataGridViewTextBoxColumn, this.ovhdFringeTypeDataGridViewTextBoxColumn, this.ovhdInsurDataGridViewTextBoxColumn, this.ovhdInsurTypeDataGridViewTextBoxColumn, this.ovhdOtherDataGridViewTextBoxColumn, this.ovhdOtherTypeDataGridViewTextBoxColumn, this.ovhdTaxesDataGridViewTextBoxColumn, this.ovhdTaxesTypeDataGridViewTextBoxColumn, this.shiftCodeDataGridViewTextBoxColumn, this.supervisorDataGridViewTextBoxColumn, this.templateIDDataGridViewTextBoxColumn, this.timeZoneDataGridViewTextBoxColumn, this.unionCodeDataGridViewTextBoxColumn, this.user1DataGridViewTextBoxColumn, this.user2DataGridViewTextBoxColumn, this.user3DataGridViewTextBoxColumn, this.user4DataGridViewTextBoxColumn, this.user5DataGridViewTextBoxColumn, this.user6DataGridViewTextBoxColumn, this.user7DataGridViewTextBoxColumn, this.user8DataGridViewTextBoxColumn, this.wageCodeDataGridViewTextBoxColumn, this.wageGroupDataGridViewTextBoxColumn, this.workersCompDataGridViewTextBoxColumn, this.workLocDataGridViewTextBoxColumn, this.workTypeDataGridViewTextBoxColumn}); this.gvsmEmp.DataSource = this.smEmpBindingSource; this.gvsmEmp.Location = new System.Drawing.Point(77, 140); this.gvsmEmp.Margin = new System.Windows.Forms.Padding(4); this.gvsmEmp.Name = "gvsmEmp"; this.gvsmEmp.Size = new System.Drawing.Size(701, 245); this.gvsmEmp.TabIndex = 35; // // errorMessageDataGridViewTextBoxColumn // this.errorMessageDataGridViewTextBoxColumn.DataPropertyName = "errorMessage"; this.errorMessageDataGridViewTextBoxColumn.HeaderText = "errorMessage"; this.errorMessageDataGridViewTextBoxColumn.Name = "errorMessageDataGridViewTextBoxColumn"; // // notesDataGridViewTextBoxColumn // this.notesDataGridViewTextBoxColumn.DataPropertyName = "notes"; this.notesDataGridViewTextBoxColumn.HeaderText = "notes"; this.notesDataGridViewTextBoxColumn.Name = "notesDataGridViewTextBoxColumn"; // // resultCodeDataGridViewTextBoxColumn // this.resultCodeDataGridViewTextBoxColumn.DataPropertyName = "resultCode"; this.resultCodeDataGridViewTextBoxColumn.HeaderText = "resultCode"; this.resultCodeDataGridViewTextBoxColumn.Name = "resultCodeDataGridViewTextBoxColumn"; // // cetrtifiedDataGridViewTextBoxColumn // this.cetrtifiedDataGridViewTextBoxColumn.DataPropertyName = "Cetrtified"; this.cetrtifiedDataGridViewTextBoxColumn.HeaderText = "Cetrtified"; this.cetrtifiedDataGridViewTextBoxColumn.Name = "cetrtifiedDataGridViewTextBoxColumn"; // // commLaborPctDataGridViewTextBoxColumn // this.commLaborPctDataGridViewTextBoxColumn.DataPropertyName = "CommLaborPct"; this.commLaborPctDataGridViewTextBoxColumn.HeaderText = "CommLaborPct"; this.commLaborPctDataGridViewTextBoxColumn.Name = "commLaborPctDataGridViewTextBoxColumn"; // // commMaterialPctDataGridViewTextBoxColumn // this.commMaterialPctDataGridViewTextBoxColumn.DataPropertyName = "CommMaterialPct"; this.commMaterialPctDataGridViewTextBoxColumn.HeaderText = "CommMaterialPct"; this.commMaterialPctDataGridViewTextBoxColumn.Name = "commMaterialPctDataGridViewTextBoxColumn"; // // cpnyIDDataGridViewTextBoxColumn // this.cpnyIDDataGridViewTextBoxColumn.DataPropertyName = "CpnyID"; this.cpnyIDDataGridViewTextBoxColumn.HeaderText = "CpnyID"; this.cpnyIDDataGridViewTextBoxColumn.Name = "cpnyIDDataGridViewTextBoxColumn"; // // crtdDateTimeDataGridViewTextBoxColumn // this.crtdDateTimeDataGridViewTextBoxColumn.DataPropertyName = "Crtd_DateTime"; this.crtdDateTimeDataGridViewTextBoxColumn.HeaderText = "Crtd_DateTime"; this.crtdDateTimeDataGridViewTextBoxColumn.Name = "crtdDateTimeDataGridViewTextBoxColumn"; // // crtdProgDataGridViewTextBoxColumn // this.crtdProgDataGridViewTextBoxColumn.DataPropertyName = "Crtd_Prog"; this.crtdProgDataGridViewTextBoxColumn.HeaderText = "Crtd_Prog"; this.crtdProgDataGridViewTextBoxColumn.Name = "crtdProgDataGridViewTextBoxColumn"; // // crtdUserDataGridViewTextBoxColumn // this.crtdUserDataGridViewTextBoxColumn.DataPropertyName = "Crtd_User"; this.crtdUserDataGridViewTextBoxColumn.HeaderText = "Crtd_User"; this.crtdUserDataGridViewTextBoxColumn.Name = "crtdUserDataGridViewTextBoxColumn"; // // earnTypeDataGridViewTextBoxColumn // this.earnTypeDataGridViewTextBoxColumn.DataPropertyName = "EarnType"; this.earnTypeDataGridViewTextBoxColumn.HeaderText = "EarnType"; this.earnTypeDataGridViewTextBoxColumn.Name = "earnTypeDataGridViewTextBoxColumn"; // // eMID01DataGridViewTextBoxColumn // this.eMID01DataGridViewTextBoxColumn.DataPropertyName = "EM_ID01"; this.eMID01DataGridViewTextBoxColumn.HeaderText = "EM_ID01"; this.eMID01DataGridViewTextBoxColumn.Name = "eMID01DataGridViewTextBoxColumn"; // // eMID02DataGridViewTextBoxColumn // this.eMID02DataGridViewTextBoxColumn.DataPropertyName = "EM_ID02"; this.eMID02DataGridViewTextBoxColumn.HeaderText = "EM_ID02"; this.eMID02DataGridViewTextBoxColumn.Name = "eMID02DataGridViewTextBoxColumn"; // // eMID03DataGridViewTextBoxColumn // this.eMID03DataGridViewTextBoxColumn.DataPropertyName = "EM_ID03"; this.eMID03DataGridViewTextBoxColumn.HeaderText = "EM_ID03"; this.eMID03DataGridViewTextBoxColumn.Name = "eMID03DataGridViewTextBoxColumn"; // // eMID04DataGridViewTextBoxColumn // this.eMID04DataGridViewTextBoxColumn.DataPropertyName = "EM_ID04"; this.eMID04DataGridViewTextBoxColumn.HeaderText = "EM_ID04"; this.eMID04DataGridViewTextBoxColumn.Name = "eMID04DataGridViewTextBoxColumn"; // // eMID05DataGridViewTextBoxColumn // this.eMID05DataGridViewTextBoxColumn.DataPropertyName = "EM_ID05"; this.eMID05DataGridViewTextBoxColumn.HeaderText = "EM_ID05"; this.eMID05DataGridViewTextBoxColumn.Name = "eMID05DataGridViewTextBoxColumn"; // // eMID06DataGridViewTextBoxColumn // this.eMID06DataGridViewTextBoxColumn.DataPropertyName = "EM_ID06"; this.eMID06DataGridViewTextBoxColumn.HeaderText = "EM_ID06"; this.eMID06DataGridViewTextBoxColumn.Name = "eMID06DataGridViewTextBoxColumn"; // // eMID07DataGridViewTextBoxColumn // this.eMID07DataGridViewTextBoxColumn.DataPropertyName = "EM_ID07"; this.eMID07DataGridViewTextBoxColumn.HeaderText = "EM_ID07"; this.eMID07DataGridViewTextBoxColumn.Name = "eMID07DataGridViewTextBoxColumn"; // // eMID08DataGridViewTextBoxColumn // this.eMID08DataGridViewTextBoxColumn.DataPropertyName = "EM_ID08"; this.eMID08DataGridViewTextBoxColumn.HeaderText = "EM_ID08"; this.eMID08DataGridViewTextBoxColumn.Name = "eMID08DataGridViewTextBoxColumn"; // // eMID09DataGridViewTextBoxColumn // this.eMID09DataGridViewTextBoxColumn.DataPropertyName = "EM_ID09"; this.eMID09DataGridViewTextBoxColumn.HeaderText = "EM_ID09"; this.eMID09DataGridViewTextBoxColumn.Name = "eMID09DataGridViewTextBoxColumn"; // // eMID10DataGridViewTextBoxColumn // this.eMID10DataGridViewTextBoxColumn.DataPropertyName = "EM_ID10"; this.eMID10DataGridViewTextBoxColumn.HeaderText = "EM_ID10"; this.eMID10DataGridViewTextBoxColumn.Name = "eMID10DataGridViewTextBoxColumn"; // // eMID11DataGridViewTextBoxColumn // this.eMID11DataGridViewTextBoxColumn.DataPropertyName = "EM_ID11"; this.eMID11DataGridViewTextBoxColumn.HeaderText = "EM_ID11"; this.eMID11DataGridViewTextBoxColumn.Name = "eMID11DataGridViewTextBoxColumn"; // // eMID12DataGridViewTextBoxColumn // this.eMID12DataGridViewTextBoxColumn.DataPropertyName = "EM_ID12"; this.eMID12DataGridViewTextBoxColumn.HeaderText = "EM_ID12"; this.eMID12DataGridViewTextBoxColumn.Name = "eMID12DataGridViewTextBoxColumn"; // // eMID13DataGridViewTextBoxColumn // this.eMID13DataGridViewTextBoxColumn.DataPropertyName = "EM_ID13"; this.eMID13DataGridViewTextBoxColumn.HeaderText = "EM_ID13"; this.eMID13DataGridViewTextBoxColumn.Name = "eMID13DataGridViewTextBoxColumn"; // // eMID14DataGridViewTextBoxColumn // this.eMID14DataGridViewTextBoxColumn.DataPropertyName = "EM_ID14"; this.eMID14DataGridViewTextBoxColumn.HeaderText = "EM_ID14"; this.eMID14DataGridViewTextBoxColumn.Name = "eMID14DataGridViewTextBoxColumn"; // // eMID15DataGridViewTextBoxColumn // this.eMID15DataGridViewTextBoxColumn.DataPropertyName = "EM_ID15"; this.eMID15DataGridViewTextBoxColumn.HeaderText = "EM_ID15"; this.eMID15DataGridViewTextBoxColumn.Name = "eMID15DataGridViewTextBoxColumn"; // // eMID16DataGridViewTextBoxColumn // this.eMID16DataGridViewTextBoxColumn.DataPropertyName = "EM_ID16"; this.eMID16DataGridViewTextBoxColumn.HeaderText = "EM_ID16"; this.eMID16DataGridViewTextBoxColumn.Name = "eMID16DataGridViewTextBoxColumn"; // // eMID17DataGridViewTextBoxColumn // this.eMID17DataGridViewTextBoxColumn.DataPropertyName = "EM_ID17"; this.eMID17DataGridViewTextBoxColumn.HeaderText = "EM_ID17"; this.eMID17DataGridViewTextBoxColumn.Name = "eMID17DataGridViewTextBoxColumn"; // // eMID18DataGridViewTextBoxColumn // this.eMID18DataGridViewTextBoxColumn.DataPropertyName = "EM_ID18"; this.eMID18DataGridViewTextBoxColumn.HeaderText = "EM_ID18"; this.eMID18DataGridViewTextBoxColumn.Name = "eMID18DataGridViewTextBoxColumn"; // // eMID19DataGridViewTextBoxColumn // this.eMID19DataGridViewTextBoxColumn.DataPropertyName = "EM_ID19"; this.eMID19DataGridViewTextBoxColumn.HeaderText = "EM_ID19"; this.eMID19DataGridViewTextBoxColumn.Name = "eMID19DataGridViewTextBoxColumn"; // // eMID20DataGridViewTextBoxColumn // this.eMID20DataGridViewTextBoxColumn.DataPropertyName = "EM_ID20"; this.eMID20DataGridViewTextBoxColumn.HeaderText = "EM_ID20"; this.eMID20DataGridViewTextBoxColumn.Name = "eMID20DataGridViewTextBoxColumn"; // // emailAddrDataGridViewTextBoxColumn // this.emailAddrDataGridViewTextBoxColumn.DataPropertyName = "EmailAddr"; this.emailAddrDataGridViewTextBoxColumn.HeaderText = "EmailAddr"; this.emailAddrDataGridViewTextBoxColumn.Name = "emailAddrDataGridViewTextBoxColumn"; // // employeeActiveDataGridViewTextBoxColumn // this.employeeActiveDataGridViewTextBoxColumn.DataPropertyName = "EmployeeActive"; this.employeeActiveDataGridViewTextBoxColumn.HeaderText = "EmployeeActive"; this.employeeActiveDataGridViewTextBoxColumn.Name = "employeeActiveDataGridViewTextBoxColumn"; // // employeeaddress1DataGridViewTextBoxColumn // this.employeeaddress1DataGridViewTextBoxColumn.DataPropertyName = "employeeaddress1"; this.employeeaddress1DataGridViewTextBoxColumn.HeaderText = "employeeaddress1"; this.employeeaddress1DataGridViewTextBoxColumn.Name = "employeeaddress1DataGridViewTextBoxColumn"; // // employeeaddress2DataGridViewTextBoxColumn // this.employeeaddress2DataGridViewTextBoxColumn.DataPropertyName = "employeeaddress2"; this.employeeaddress2DataGridViewTextBoxColumn.HeaderText = "employeeaddress2"; this.employeeaddress2DataGridViewTextBoxColumn.Name = "employeeaddress2DataGridViewTextBoxColumn"; // // employeeBdateDataGridViewTextBoxColumn // this.employeeBdateDataGridViewTextBoxColumn.DataPropertyName = "employeeBdate"; this.employeeBdateDataGridViewTextBoxColumn.HeaderText = "employeeBdate"; this.employeeBdateDataGridViewTextBoxColumn.Name = "employeeBdateDataGridViewTextBoxColumn"; // // employeeBranchIDDataGridViewTextBoxColumn // this.employeeBranchIDDataGridViewTextBoxColumn.DataPropertyName = "EmployeeBranchID"; this.employeeBranchIDDataGridViewTextBoxColumn.HeaderText = "EmployeeBranchID"; this.employeeBranchIDDataGridViewTextBoxColumn.Name = "employeeBranchIDDataGridViewTextBoxColumn"; // // employeeCellPhoneDataGridViewTextBoxColumn // this.employeeCellPhoneDataGridViewTextBoxColumn.DataPropertyName = "EmployeeCellPhone"; this.employeeCellPhoneDataGridViewTextBoxColumn.HeaderText = "EmployeeCellPhone"; this.employeeCellPhoneDataGridViewTextBoxColumn.Name = "employeeCellPhoneDataGridViewTextBoxColumn"; // // employeeCityDataGridViewTextBoxColumn // this.employeeCityDataGridViewTextBoxColumn.DataPropertyName = "EmployeeCity"; this.employeeCityDataGridViewTextBoxColumn.HeaderText = "EmployeeCity"; this.employeeCityDataGridViewTextBoxColumn.Name = "employeeCityDataGridViewTextBoxColumn"; // // employeeCommPlanDataGridViewTextBoxColumn // this.employeeCommPlanDataGridViewTextBoxColumn.DataPropertyName = "EmployeeCommPlan"; this.employeeCommPlanDataGridViewTextBoxColumn.HeaderText = "EmployeeCommPlan"; this.employeeCommPlanDataGridViewTextBoxColumn.Name = "employeeCommPlanDataGridViewTextBoxColumn"; // // employeeDeptDataGridViewTextBoxColumn // this.employeeDeptDataGridViewTextBoxColumn.DataPropertyName = "EmployeeDept"; this.employeeDeptDataGridViewTextBoxColumn.HeaderText = "EmployeeDept"; this.employeeDeptDataGridViewTextBoxColumn.Name = "employeeDeptDataGridViewTextBoxColumn"; // // employeeDLClassDataGridViewTextBoxColumn // this.employeeDLClassDataGridViewTextBoxColumn.DataPropertyName = "EmployeeDLClass"; this.employeeDLClassDataGridViewTextBoxColumn.HeaderText = "EmployeeDLClass"; this.employeeDLClassDataGridViewTextBoxColumn.Name = "employeeDLClassDataGridViewTextBoxColumn"; // // employeeDLExpDateDataGridViewTextBoxColumn // this.employeeDLExpDateDataGridViewTextBoxColumn.DataPropertyName = "employeeDLExpDate"; this.employeeDLExpDateDataGridViewTextBoxColumn.HeaderText = "employeeDLExpDate"; this.employeeDLExpDateDataGridViewTextBoxColumn.Name = "employeeDLExpDateDataGridViewTextBoxColumn"; // // employeeDLNoDataGridViewTextBoxColumn // this.employeeDLNoDataGridViewTextBoxColumn.DataPropertyName = "EmployeeDLNo"; this.employeeDLNoDataGridViewTextBoxColumn.HeaderText = "EmployeeDLNo"; this.employeeDLNoDataGridViewTextBoxColumn.Name = "employeeDLNoDataGridViewTextBoxColumn"; // // employeeDLStateDataGridViewTextBoxColumn // this.employeeDLStateDataGridViewTextBoxColumn.DataPropertyName = "EmployeeDLState"; this.employeeDLStateDataGridViewTextBoxColumn.HeaderText = "EmployeeDLState"; this.employeeDLStateDataGridViewTextBoxColumn.Name = "employeeDLStateDataGridViewTextBoxColumn"; // // employeeExemptionDataGridViewTextBoxColumn // this.employeeExemptionDataGridViewTextBoxColumn.DataPropertyName = "EmployeeExemption"; this.employeeExemptionDataGridViewTextBoxColumn.HeaderText = "EmployeeExemption"; this.employeeExemptionDataGridViewTextBoxColumn.Name = "employeeExemptionDataGridViewTextBoxColumn"; // // employeeFaxNoDataGridViewTextBoxColumn // this.employeeFaxNoDataGridViewTextBoxColumn.DataPropertyName = "EmployeeFaxNo"; this.employeeFaxNoDataGridViewTextBoxColumn.HeaderText = "EmployeeFaxNo"; this.employeeFaxNoDataGridViewTextBoxColumn.Name = "employeeFaxNoDataGridViewTextBoxColumn"; // // employeeFirstNameDataGridViewTextBoxColumn // this.employeeFirstNameDataGridViewTextBoxColumn.DataPropertyName = "EmployeeFirstName"; this.employeeFirstNameDataGridViewTextBoxColumn.HeaderText = "EmployeeFirstName"; this.employeeFirstNameDataGridViewTextBoxColumn.Name = "employeeFirstNameDataGridViewTextBoxColumn"; // // employeeHiredateDataGridViewTextBoxColumn // this.employeeHiredateDataGridViewTextBoxColumn.DataPropertyName = "EmployeeHiredate"; this.employeeHiredateDataGridViewTextBoxColumn.HeaderText = "EmployeeHiredate"; this.employeeHiredateDataGridViewTextBoxColumn.Name = "employeeHiredateDataGridViewTextBoxColumn"; // // employeeHomePhoneDataGridViewTextBoxColumn // this.employeeHomePhoneDataGridViewTextBoxColumn.DataPropertyName = "EmployeeHomePhone"; this.employeeHomePhoneDataGridViewTextBoxColumn.HeaderText = "EmployeeHomePhone"; this.employeeHomePhoneDataGridViewTextBoxColumn.Name = "employeeHomePhoneDataGridViewTextBoxColumn"; // // employeeIdDataGridViewTextBoxColumn // this.employeeIdDataGridViewTextBoxColumn.DataPropertyName = "EmployeeId"; this.employeeIdDataGridViewTextBoxColumn.HeaderText = "EmployeeId"; this.employeeIdDataGridViewTextBoxColumn.Name = "employeeIdDataGridViewTextBoxColumn"; // // employeeLastNameDataGridViewTextBoxColumn // this.employeeLastNameDataGridViewTextBoxColumn.DataPropertyName = "EmployeeLastName"; this.employeeLastNameDataGridViewTextBoxColumn.HeaderText = "EmployeeLastName"; this.employeeLastNameDataGridViewTextBoxColumn.Name = "employeeLastNameDataGridViewTextBoxColumn"; // // employeeMaritalDataGridViewTextBoxColumn // this.employeeMaritalDataGridViewTextBoxColumn.DataPropertyName = "EmployeeMarital"; this.employeeMaritalDataGridViewTextBoxColumn.HeaderText = "EmployeeMarital"; this.employeeMaritalDataGridViewTextBoxColumn.Name = "employeeMaritalDataGridViewTextBoxColumn"; // // employeeMiddleInitDataGridViewTextBoxColumn // this.employeeMiddleInitDataGridViewTextBoxColumn.DataPropertyName = "EmployeeMiddleInit"; this.employeeMiddleInitDataGridViewTextBoxColumn.HeaderText = "EmployeeMiddleInit"; this.employeeMiddleInitDataGridViewTextBoxColumn.Name = "employeeMiddleInitDataGridViewTextBoxColumn"; // // employeeOffPhoneExtDataGridViewTextBoxColumn // this.employeeOffPhoneExtDataGridViewTextBoxColumn.DataPropertyName = "EmployeeOffPhoneExt"; this.employeeOffPhoneExtDataGridViewTextBoxColumn.HeaderText = "EmployeeOffPhoneExt"; this.employeeOffPhoneExtDataGridViewTextBoxColumn.Name = "employeeOffPhoneExtDataGridViewTextBoxColumn"; // // employeePagerNoDataGridViewTextBoxColumn // this.employeePagerNoDataGridViewTextBoxColumn.DataPropertyName = "EmployeePagerNo"; this.employeePagerNoDataGridViewTextBoxColumn.HeaderText = "EmployeePagerNo"; this.employeePagerNoDataGridViewTextBoxColumn.Name = "employeePagerNoDataGridViewTextBoxColumn"; // // employeePayRollIdDataGridViewTextBoxColumn // this.employeePayRollIdDataGridViewTextBoxColumn.DataPropertyName = "EmployeePayRollId"; this.employeePayRollIdDataGridViewTextBoxColumn.HeaderText = "EmployeePayRollId"; this.employeePayRollIdDataGridViewTextBoxColumn.Name = "employeePayRollIdDataGridViewTextBoxColumn"; // // employeePayTypeDataGridViewTextBoxColumn // this.employeePayTypeDataGridViewTextBoxColumn.DataPropertyName = "EmployeePayType"; this.employeePayTypeDataGridViewTextBoxColumn.HeaderText = "EmployeePayType"; this.employeePayTypeDataGridViewTextBoxColumn.Name = "employeePayTypeDataGridViewTextBoxColumn"; // // employeeQuotaDataGridViewTextBoxColumn // this.employeeQuotaDataGridViewTextBoxColumn.DataPropertyName = "EmployeeQuota"; this.employeeQuotaDataGridViewTextBoxColumn.HeaderText = "EmployeeQuota"; this.employeeQuotaDataGridViewTextBoxColumn.Name = "employeeQuotaDataGridViewTextBoxColumn"; // // employeeRaiseDateDataGridViewTextBoxColumn // this.employeeRaiseDateDataGridViewTextBoxColumn.DataPropertyName = "EmployeeRaiseDate"; this.employeeRaiseDateDataGridViewTextBoxColumn.HeaderText = "EmployeeRaiseDate"; this.employeeRaiseDateDataGridViewTextBoxColumn.Name = "employeeRaiseDateDataGridViewTextBoxColumn"; // // employeeRateDataGridViewTextBoxColumn // this.employeeRateDataGridViewTextBoxColumn.DataPropertyName = "EmployeeRate"; this.employeeRateDataGridViewTextBoxColumn.HeaderText = "EmployeeRate"; this.employeeRateDataGridViewTextBoxColumn.Name = "employeeRateDataGridViewTextBoxColumn"; // // employeeSexDataGridViewTextBoxColumn // this.employeeSexDataGridViewTextBoxColumn.DataPropertyName = "EmployeeSex"; this.employeeSexDataGridViewTextBoxColumn.HeaderText = "EmployeeSex"; this.employeeSexDataGridViewTextBoxColumn.Name = "employeeSexDataGridViewTextBoxColumn"; // // employeeSSNoDataGridViewTextBoxColumn // this.employeeSSNoDataGridViewTextBoxColumn.DataPropertyName = "EmployeeSSNo"; this.employeeSSNoDataGridViewTextBoxColumn.HeaderText = "EmployeeSSNo"; this.employeeSSNoDataGridViewTextBoxColumn.Name = "employeeSSNoDataGridViewTextBoxColumn"; // // employeeStateDataGridViewTextBoxColumn // this.employeeStateDataGridViewTextBoxColumn.DataPropertyName = "EmployeeState"; this.employeeStateDataGridViewTextBoxColumn.HeaderText = "EmployeeState"; this.employeeStateDataGridViewTextBoxColumn.Name = "employeeStateDataGridViewTextBoxColumn"; // // employeeTermDateDataGridViewTextBoxColumn // this.employeeTermDateDataGridViewTextBoxColumn.DataPropertyName = "EmployeeTermDate"; this.employeeTermDateDataGridViewTextBoxColumn.HeaderText = "EmployeeTermDate"; this.employeeTermDateDataGridViewTextBoxColumn.Name = "employeeTermDateDataGridViewTextBoxColumn"; // // employeeTypeDataGridViewTextBoxColumn // this.employeeTypeDataGridViewTextBoxColumn.DataPropertyName = "EmployeeType"; this.employeeTypeDataGridViewTextBoxColumn.HeaderText = "EmployeeType"; this.employeeTypeDataGridViewTextBoxColumn.Name = "employeeTypeDataGridViewTextBoxColumn"; // // employeeVehicleIdDataGridViewTextBoxColumn // this.employeeVehicleIdDataGridViewTextBoxColumn.DataPropertyName = "EmployeeVehicleId"; this.employeeVehicleIdDataGridViewTextBoxColumn.HeaderText = "EmployeeVehicleId"; this.employeeVehicleIdDataGridViewTextBoxColumn.Name = "employeeVehicleIdDataGridViewTextBoxColumn"; // // employeeWorkerDeptDataGridViewTextBoxColumn // this.employeeWorkerDeptDataGridViewTextBoxColumn.DataPropertyName = "EmployeeWorkerDept"; this.employeeWorkerDeptDataGridViewTextBoxColumn.HeaderText = "EmployeeWorkerDept"; this.employeeWorkerDeptDataGridViewTextBoxColumn.Name = "employeeWorkerDeptDataGridViewTextBoxColumn"; // // employeeZipDataGridViewTextBoxColumn // this.employeeZipDataGridViewTextBoxColumn.DataPropertyName = "EmployeeZip"; this.employeeZipDataGridViewTextBoxColumn.HeaderText = "EmployeeZip"; this.employeeZipDataGridViewTextBoxColumn.Name = "employeeZipDataGridViewTextBoxColumn"; // // invtSiteIDDataGridViewTextBoxColumn // this.invtSiteIDDataGridViewTextBoxColumn.DataPropertyName = "InvtSiteID"; this.invtSiteIDDataGridViewTextBoxColumn.HeaderText = "InvtSiteID"; this.invtSiteIDDataGridViewTextBoxColumn.Name = "invtSiteIDDataGridViewTextBoxColumn"; // // laborClassDataGridViewTextBoxColumn // this.laborClassDataGridViewTextBoxColumn.DataPropertyName = "LaborClass"; this.laborClassDataGridViewTextBoxColumn.HeaderText = "LaborClass"; this.laborClassDataGridViewTextBoxColumn.Name = "laborClassDataGridViewTextBoxColumn"; // // lupdDateTimeDataGridViewTextBoxColumn // this.lupdDateTimeDataGridViewTextBoxColumn.DataPropertyName = "Lupd_DateTime"; this.lupdDateTimeDataGridViewTextBoxColumn.HeaderText = "Lupd_DateTime"; this.lupdDateTimeDataGridViewTextBoxColumn.Name = "lupdDateTimeDataGridViewTextBoxColumn"; // // lupdProgDataGridViewTextBoxColumn // this.lupdProgDataGridViewTextBoxColumn.DataPropertyName = "Lupd_Prog"; this.lupdProgDataGridViewTextBoxColumn.HeaderText = "Lupd_Prog"; this.lupdProgDataGridViewTextBoxColumn.Name = "lupdProgDataGridViewTextBoxColumn"; // // lupdUserDataGridViewTextBoxColumn // this.lupdUserDataGridViewTextBoxColumn.DataPropertyName = "Lupd_User"; this.lupdUserDataGridViewTextBoxColumn.HeaderText = "Lupd_User"; this.lupdUserDataGridViewTextBoxColumn.Name = "lupdUserDataGridViewTextBoxColumn"; // // noteIDDataGridViewTextBoxColumn // this.noteIDDataGridViewTextBoxColumn.DataPropertyName = "NoteID"; this.noteIDDataGridViewTextBoxColumn.HeaderText = "NoteID"; this.noteIDDataGridViewTextBoxColumn.Name = "noteIDDataGridViewTextBoxColumn"; // // ovhdFringeDataGridViewTextBoxColumn // this.ovhdFringeDataGridViewTextBoxColumn.DataPropertyName = "OvhdFringe"; this.ovhdFringeDataGridViewTextBoxColumn.HeaderText = "OvhdFringe"; this.ovhdFringeDataGridViewTextBoxColumn.Name = "ovhdFringeDataGridViewTextBoxColumn"; // // ovhdFringeTypeDataGridViewTextBoxColumn // this.ovhdFringeTypeDataGridViewTextBoxColumn.DataPropertyName = "OvhdFringeType"; this.ovhdFringeTypeDataGridViewTextBoxColumn.HeaderText = "OvhdFringeType"; this.ovhdFringeTypeDataGridViewTextBoxColumn.Name = "ovhdFringeTypeDataGridViewTextBoxColumn"; // // ovhdInsurDataGridViewTextBoxColumn // this.ovhdInsurDataGridViewTextBoxColumn.DataPropertyName = "OvhdInsur"; this.ovhdInsurDataGridViewTextBoxColumn.HeaderText = "OvhdInsur"; this.ovhdInsurDataGridViewTextBoxColumn.Name = "ovhdInsurDataGridViewTextBoxColumn"; // // ovhdInsurTypeDataGridViewTextBoxColumn // this.ovhdInsurTypeDataGridViewTextBoxColumn.DataPropertyName = "OvhdInsurType"; this.ovhdInsurTypeDataGridViewTextBoxColumn.HeaderText = "OvhdInsurType"; this.ovhdInsurTypeDataGridViewTextBoxColumn.Name = "ovhdInsurTypeDataGridViewTextBoxColumn"; // // ovhdOtherDataGridViewTextBoxColumn // this.ovhdOtherDataGridViewTextBoxColumn.DataPropertyName = "OvhdOther"; this.ovhdOtherDataGridViewTextBoxColumn.HeaderText = "OvhdOther"; this.ovhdOtherDataGridViewTextBoxColumn.Name = "ovhdOtherDataGridViewTextBoxColumn"; // // ovhdOtherTypeDataGridViewTextBoxColumn // this.ovhdOtherTypeDataGridViewTextBoxColumn.DataPropertyName = "OvhdOtherType"; this.ovhdOtherTypeDataGridViewTextBoxColumn.HeaderText = "OvhdOtherType"; this.ovhdOtherTypeDataGridViewTextBoxColumn.Name = "ovhdOtherTypeDataGridViewTextBoxColumn"; // // ovhdTaxesDataGridViewTextBoxColumn // this.ovhdTaxesDataGridViewTextBoxColumn.DataPropertyName = "OvhdTaxes"; this.ovhdTaxesDataGridViewTextBoxColumn.HeaderText = "OvhdTaxes"; this.ovhdTaxesDataGridViewTextBoxColumn.Name = "ovhdTaxesDataGridViewTextBoxColumn"; // // ovhdTaxesTypeDataGridViewTextBoxColumn // this.ovhdTaxesTypeDataGridViewTextBoxColumn.DataPropertyName = "OvhdTaxesType"; this.ovhdTaxesTypeDataGridViewTextBoxColumn.HeaderText = "OvhdTaxesType"; this.ovhdTaxesTypeDataGridViewTextBoxColumn.Name = "ovhdTaxesTypeDataGridViewTextBoxColumn"; // // shiftCodeDataGridViewTextBoxColumn // this.shiftCodeDataGridViewTextBoxColumn.DataPropertyName = "ShiftCode"; this.shiftCodeDataGridViewTextBoxColumn.HeaderText = "ShiftCode"; this.shiftCodeDataGridViewTextBoxColumn.Name = "shiftCodeDataGridViewTextBoxColumn"; // // supervisorDataGridViewTextBoxColumn // this.supervisorDataGridViewTextBoxColumn.DataPropertyName = "Supervisor"; this.supervisorDataGridViewTextBoxColumn.HeaderText = "Supervisor"; this.supervisorDataGridViewTextBoxColumn.Name = "supervisorDataGridViewTextBoxColumn"; // // templateIDDataGridViewTextBoxColumn // this.templateIDDataGridViewTextBoxColumn.DataPropertyName = "TemplateID"; this.templateIDDataGridViewTextBoxColumn.HeaderText = "TemplateID"; this.templateIDDataGridViewTextBoxColumn.Name = "templateIDDataGridViewTextBoxColumn"; // // timeZoneDataGridViewTextBoxColumn // this.timeZoneDataGridViewTextBoxColumn.DataPropertyName = "TimeZone"; this.timeZoneDataGridViewTextBoxColumn.HeaderText = "TimeZone"; this.timeZoneDataGridViewTextBoxColumn.Name = "timeZoneDataGridViewTextBoxColumn"; // // unionCodeDataGridViewTextBoxColumn // this.unionCodeDataGridViewTextBoxColumn.DataPropertyName = "UnionCode"; this.unionCodeDataGridViewTextBoxColumn.HeaderText = "UnionCode"; this.unionCodeDataGridViewTextBoxColumn.Name = "unionCodeDataGridViewTextBoxColumn"; // // user1DataGridViewTextBoxColumn // this.user1DataGridViewTextBoxColumn.DataPropertyName = "User1"; this.user1DataGridViewTextBoxColumn.HeaderText = "User1"; this.user1DataGridViewTextBoxColumn.Name = "user1DataGridViewTextBoxColumn"; // // user2DataGridViewTextBoxColumn // this.user2DataGridViewTextBoxColumn.DataPropertyName = "User2"; this.user2DataGridViewTextBoxColumn.HeaderText = "User2"; this.user2DataGridViewTextBoxColumn.Name = "user2DataGridViewTextBoxColumn"; // // user3DataGridViewTextBoxColumn // this.user3DataGridViewTextBoxColumn.DataPropertyName = "User3"; this.user3DataGridViewTextBoxColumn.HeaderText = "User3"; this.user3DataGridViewTextBoxColumn.Name = "user3DataGridViewTextBoxColumn"; // // user4DataGridViewTextBoxColumn // this.user4DataGridViewTextBoxColumn.DataPropertyName = "User4"; this.user4DataGridViewTextBoxColumn.HeaderText = "User4"; this.user4DataGridViewTextBoxColumn.Name = "user4DataGridViewTextBoxColumn"; // // user5DataGridViewTextBoxColumn // this.user5DataGridViewTextBoxColumn.DataPropertyName = "User5"; this.user5DataGridViewTextBoxColumn.HeaderText = "User5"; this.user5DataGridViewTextBoxColumn.Name = "user5DataGridViewTextBoxColumn"; // // user6DataGridViewTextBoxColumn // this.user6DataGridViewTextBoxColumn.DataPropertyName = "User6"; this.user6DataGridViewTextBoxColumn.HeaderText = "User6"; this.user6DataGridViewTextBoxColumn.Name = "user6DataGridViewTextBoxColumn"; // // user7DataGridViewTextBoxColumn // this.user7DataGridViewTextBoxColumn.DataPropertyName = "User7"; this.user7DataGridViewTextBoxColumn.HeaderText = "User7"; this.user7DataGridViewTextBoxColumn.Name = "user7DataGridViewTextBoxColumn"; // // user8DataGridViewTextBoxColumn // this.user8DataGridViewTextBoxColumn.DataPropertyName = "User8"; this.user8DataGridViewTextBoxColumn.HeaderText = "User8"; this.user8DataGridViewTextBoxColumn.Name = "user8DataGridViewTextBoxColumn"; // // wageCodeDataGridViewTextBoxColumn // this.wageCodeDataGridViewTextBoxColumn.DataPropertyName = "WageCode"; this.wageCodeDataGridViewTextBoxColumn.HeaderText = "WageCode"; this.wageCodeDataGridViewTextBoxColumn.Name = "wageCodeDataGridViewTextBoxColumn"; // // wageGroupDataGridViewTextBoxColumn // this.wageGroupDataGridViewTextBoxColumn.DataPropertyName = "WageGroup"; this.wageGroupDataGridViewTextBoxColumn.HeaderText = "WageGroup"; this.wageGroupDataGridViewTextBoxColumn.Name = "wageGroupDataGridViewTextBoxColumn"; // // workersCompDataGridViewTextBoxColumn // this.workersCompDataGridViewTextBoxColumn.DataPropertyName = "WorkersComp"; this.workersCompDataGridViewTextBoxColumn.HeaderText = "WorkersComp"; this.workersCompDataGridViewTextBoxColumn.Name = "workersCompDataGridViewTextBoxColumn"; // // workLocDataGridViewTextBoxColumn // this.workLocDataGridViewTextBoxColumn.DataPropertyName = "WorkLoc"; this.workLocDataGridViewTextBoxColumn.HeaderText = "WorkLoc"; this.workLocDataGridViewTextBoxColumn.Name = "workLocDataGridViewTextBoxColumn"; // // workTypeDataGridViewTextBoxColumn // this.workTypeDataGridViewTextBoxColumn.DataPropertyName = "WorkType"; this.workTypeDataGridViewTextBoxColumn.HeaderText = "WorkType"; this.workTypeDataGridViewTextBoxColumn.Name = "workTypeDataGridViewTextBoxColumn"; // // smEmpBindingSource // this.smEmpBindingSource.DataSource = typeof(client.fieldService.serviceDispatch.maintenance.serviceEmployeeMaintenance.ctDynamicsSL.fieldService.serviceDispatch.maintenance.serviceEmployeeMaintenance.smEmp); // // btnUpdate // this.btnUpdate.Location = new System.Drawing.Point(368, 64); this.btnUpdate.Margin = new System.Windows.Forms.Padding(4); this.btnUpdate.Name = "btnUpdate"; this.btnUpdate.Size = new System.Drawing.Size(125, 28); this.btnUpdate.TabIndex = 34; this.btnUpdate.Text = "Save Screen"; this.btnUpdate.UseVisualStyleBackColor = true; this.btnUpdate.Click += new System.EventHandler(this.btnUpdate_Click); // // tbScreen // this.tbScreen.Location = new System.Drawing.Point(77, 446); this.tbScreen.Margin = new System.Windows.Forms.Padding(4); this.tbScreen.Multiline = true; this.tbScreen.Name = "tbScreen"; this.tbScreen.ScrollBars = System.Windows.Forms.ScrollBars.Both; this.tbScreen.Size = new System.Drawing.Size(700, 98); this.tbScreen.TabIndex = 33; this.tbScreen.WordWrap = false; // // lblEmployeeID // this.lblEmployeeID.AutoSize = true; this.lblEmployeeID.Location = new System.Drawing.Point(74, 32); this.lblEmployeeID.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lblEmployeeID.Name = "lblEmployeeID"; this.lblEmployeeID.Size = new System.Drawing.Size(91, 17); this.lblEmployeeID.TabIndex = 32; this.lblEmployeeID.Text = "Employee ID:"; // // tbEmployeeID // this.tbEmployeeID.Location = new System.Drawing.Point(173, 32); this.tbEmployeeID.Margin = new System.Windows.Forms.Padding(4); this.tbEmployeeID.Name = "tbEmployeeID"; this.tbEmployeeID.Size = new System.Drawing.Size(188, 22); this.tbEmployeeID.TabIndex = 31; // // btnLoad // this.btnLoad.Location = new System.Drawing.Point(516, 29); this.btnLoad.Name = "btnLoad"; this.btnLoad.Size = new System.Drawing.Size(137, 28); this.btnLoad.TabIndex = 39; this.btnLoad.Text = "Load"; this.btnLoad.UseVisualStyleBackColor = true; this.btnLoad.Click += new System.EventHandler(this.btnLoad_Click); // // btnSearch // this.btnSearch.Location = new System.Drawing.Point(368, 29); this.btnSearch.Name = "btnSearch"; this.btnSearch.Size = new System.Drawing.Size(125, 28); this.btnSearch.TabIndex = 40; this.btnSearch.Text = "Search"; this.btnSearch.UseVisualStyleBackColor = true; this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click); // // btnGets // this.btnGets.Location = new System.Drawing.Point(516, 64); this.btnGets.Name = "btnGets"; this.btnGets.Size = new System.Drawing.Size(132, 28); this.btnGets.TabIndex = 41; this.btnGets.Text = "Test all Gets"; this.btnGets.UseVisualStyleBackColor = true; this.btnGets.Click += new System.EventHandler(this.btnGets_Click); // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(851, 577); this.Controls.Add(this.btnGets); this.Controls.Add(this.btnSearch); this.Controls.Add(this.btnLoad); this.Controls.Add(this.btnNew); this.Controls.Add(this.lblScreen); this.Controls.Add(this.lblScreenXML); this.Controls.Add(this.gvsmEmp); this.Controls.Add(this.btnUpdate); this.Controls.Add(this.tbScreen); this.Controls.Add(this.lblEmployeeID); this.Controls.Add(this.tbEmployeeID); this.Name = "Form1"; this.Text = "client.fieldService.serviceDispatch.maintenance.serviceEmployeeMaintenance"; ((System.ComponentModel.ISupportInitialize)(this.gvsmEmp)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.smEmpBindingSource)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Button btnNew; private System.Windows.Forms.Label lblScreen; private System.Windows.Forms.Label lblScreenXML; private System.Windows.Forms.DataGridView gvsmEmp; private System.Windows.Forms.Button btnUpdate; private System.Windows.Forms.TextBox tbScreen; private System.Windows.Forms.Label lblEmployeeID; public System.Windows.Forms.TextBox tbEmployeeID; public System.Windows.Forms.Button btnLoad; private System.Windows.Forms.Button btnSearch; private System.Windows.Forms.DataGridViewTextBoxColumn errorMessageDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn notesDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn resultCodeDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn cetrtifiedDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn commLaborPctDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn commMaterialPctDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn cpnyIDDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn crtdDateTimeDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn crtdProgDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn crtdUserDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn earnTypeDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn eMID01DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn eMID02DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn eMID03DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn eMID04DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn eMID05DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn eMID06DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn eMID07DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn eMID08DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn eMID09DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn eMID10DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn eMID11DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn eMID12DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn eMID13DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn eMID14DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn eMID15DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn eMID16DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn eMID17DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn eMID18DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn eMID19DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn eMID20DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn emailAddrDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeActiveDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeaddress1DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeaddress2DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeBdateDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeBranchIDDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeCellPhoneDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeCityDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeCommPlanDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeDeptDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeDLClassDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeDLExpDateDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeDLNoDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeDLStateDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeExemptionDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeFaxNoDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeFirstNameDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeHiredateDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeHomePhoneDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeIdDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeLastNameDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeMaritalDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeMiddleInitDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeOffPhoneExtDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeePagerNoDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeePayRollIdDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeePayTypeDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeQuotaDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeRaiseDateDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeRateDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeSexDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeSSNoDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeStateDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeTermDateDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeTypeDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeVehicleIdDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeWorkerDeptDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn employeeZipDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn invtSiteIDDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn laborClassDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn lupdDateTimeDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn lupdProgDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn lupdUserDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn noteIDDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn ovhdFringeDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn ovhdFringeTypeDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn ovhdInsurDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn ovhdInsurTypeDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn ovhdOtherDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn ovhdOtherTypeDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn ovhdTaxesDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn ovhdTaxesTypeDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn shiftCodeDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn supervisorDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn templateIDDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn timeZoneDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn unionCodeDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn user1DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn user2DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn user3DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn user4DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn user5DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn user6DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn user7DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn user8DataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn wageCodeDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn wageGroupDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn workersCompDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn workLocDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn workTypeDataGridViewTextBoxColumn; private System.Windows.Forms.BindingSource smEmpBindingSource; private System.Windows.Forms.Button btnGets; } }
mit
roqua/physiqual
spec/shared_context_for_exporters.rb
649
module Physiqual module Exporters shared_context 'exporter context' do let(:user) { FactoryBot.create(:physiqual_user) } let(:first_measurement) { Time.new(2015, 7, 4, 10, 0).in_time_zone } let(:number_of_days) { 1 } let(:mock_result) do { '2015-08-03 10:00:00 +0200' => { heart_rate: 87.0, steps: 924, calories: 17, activities: 'Walking' }, '2015-08-03 16:00:00 +0200' => { heart_rate: 49.0, steps: 540, calories: 46, activities: 'Moving' }, '2015-08-03 22:00:00 +0200' => { heart_rate: 68.0, steps: 270, calories: 53, activities: 'Moving' } } end end end end
mit
glazedSolutions/apey-eye
example/resources/ProductResource.js
745
/** * Created by GlazedSolutions on 12/05/2015. */ import ApeyEye from '../../apey-eye'; let Decorators = ApeyEye.Decorators; let GenericResource = ApeyEye.GenericResource; let Input = ApeyEye.Input; import ProductModel from '../models/ProductModel.js'; @Decorators.Model(ProductModel) @Decorators.Name("product") @Decorators.Authentication("basic") @Decorators.Roles(["restaurant_owner"]) class ProductResource extends GenericResource { @Decorators.Roles(["basic_client"]) static async fetch(options){ return await GenericResource.fetch(options); } @Decorators.Roles(["basic_client"]) static async fetchOne(options){ return await GenericResource.fetch(options); } } export default ProductResource;
mit
ghoulsblade/vegaogre
lugre/widgets/lib.gui.widget.root.lua
694
-- root widget, starting point for mousepicking, immediate childs are layers (dialogs,menus,tooltips..) -- see also lib.gui.widget.lua RegisterWidgetClass("Root") function CreateRootWidget (rendermanager2d) return CreateWidget("Root",nil,rendermanager2d) end -- parentwidget_ignored : since this is a root widget, the parent widget will be nil function gWidgetPrototype.Root:Init (parentwidget_ignored,rendermanager2d) self.rendergroup2d = CreateRenderGroup2D(rendermanager2d) self:SetRenderGroup2D(self.rendergroup2d) self:AddToDestroyList(self.rendergroup2d) self:SetIgnoreBBoxHit(true) end function gWidgetPrototype.Root:CreateLayer (name) return self:CreateChild("Layer",name) end
mit
NeosStore/pandacoin
src/qt/locale/bitcoin_pam.ts
161872
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0" language="pam"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About PandaBank</source> <translation type="unfinished"></translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;Pandacoin&lt;/b&gt; version</source> <translation type="unfinished"></translation> </message> <message> <location line="+41"/> <source>Copyright © 2009-2014 The Bitcoin developers Copyright © 2012-2014 The NovaCoin developers Copyright © 2014 The Pandacoin developers</source> <translation type="unfinished"></translation> </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> Metung ya ining experimental software. Me-distribute ya lalam na ning lisensya na ning MIT/X11 software, lawan ye ing makayabeng file COPYING o http://www.opensource.org/licenses/mit-license.php. Ing produktung ini atin yang makayabeng software a gewa dareng OpenSSL Project para gamit king OpenSSL Toolkit(http://www.openssl.org/) at cryptographic software a sinulat ng Eric Young (eay@cryptsoft.com) at UPnp software a sinulat ng Thomas Bernard.</translation> </message> </context> <context> <name>AccountModel</name> <message> <location filename="../accountmodel.cpp" line="+24"/> <source>Account Name</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>Account Address</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>Account Balance</source> <translation type="unfinished"></translation> </message> </context> <context> <name>AccountPage</name> <message> <location filename="../forms/accountpage.ui" line="+20"/> <source>Frame</source> <translation type="unfinished"></translation> </message> <message> <location line="+31"/> <source>Transactions</source> <translation type="unfinished"></translation> </message> <message> <location line="+38"/> <source>View transactions for</source> <translation type="unfinished"></translation> </message> <message> <location line="+36"/> <source>Copy Address</source> <translation type="unfinished"></translation> </message> <message> <location line="+14"/> <source>Show QR Code</source> <translation type="unfinished"></translation> </message> <message> <location line="+14"/> <source>Sign message</source> <translation type="unfinished"></translation> </message> <message> <location line="+132"/> <source>Last 30 Days</source> <translation type="unfinished"></translation> </message> <message> <location line="+40"/> <source>Out</source> <translation type="unfinished"></translation> </message> <message> <location line="+23"/> <source>In</source> <translation type="unfinished"></translation> </message> <message> <location line="+23"/> <location line="+10"/> <location line="+140"/> <source>PND</source> <translation type="unfinished"></translation> </message> <message> <location line="-128"/> <source>Interest Gained</source> <translation type="unfinished"></translation> </message> <message> <location line="+115"/> <source>Total interest</source> <translation type="unfinished"></translation> </message> <message> <location line="+32"/> <location line="+25"/> <source>Create Account</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/accountpage.cpp" line="+155"/> <source>All Accounts</source> <translation type="unfinished"></translation> </message> <message> <location line="+28"/> <location line="+4"/> <source>transaction found</source> <translation type="unfinished"></translation> </message> </context> <context> <name>AccountSummaryHeaderWidget</name> <message> <location filename="../forms/accountsummaryheaderwidget.ui" line="+14"/> <source>Frame</source> <translation type="unfinished"></translation> </message> <message> <location line="+32"/> <source>Earning interest</source> <translation type="unfinished"></translation> </message> <message> <location line="+31"/> <source>Total balance</source> <translation type="unfinished"></translation> </message> <message> <location line="+153"/> <source>Edit account name.</source> <translation type="unfinished"></translation> </message> <message> <location line="+20"/> <source>Accept new account name.</source> <translation type="unfinished"></translation> </message> <message> <location line="+20"/> <source>Cancel editing of account name.</source> <translation type="unfinished"></translation> </message> <message> <location line="-156"/> <source>Available</source> <translation type="unfinished"></translation> </message> <message> <location line="+37"/> <source>Pending</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/accountsummaryheaderwidget.cpp" line="+63"/> <location line="+9"/> <source>Error</source> <translation type="unfinished">Mali</translation> </message> <message> <location line="-9"/> <source>An account with this name already exists.</source> <translation type="unfinished"></translation> </message> <message> <location line="+9"/> <source>Error could not change name of PandaBank account.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation type="unfinished"></translation> </message> <message> <location line="+22"/> <source>Double-click to edit address or label</source> <translation>Pindutan meng makatidduang besis ban ayalilan me ing address o label</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Maglalang kang bayung address</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Kopyan me ing salukuyan at makipiling address keng system clipboard</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation type="unfinished"></translation> </message> <message> <location line="-46"/> <source>These are your Pandacoin 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"></translation> </message> <message> <location line="+60"/> <source>&amp;Copy Address</source> <translation>&amp;Kopyan ing address</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation type="unfinished"></translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a Pandacoin address</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"></translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>Ilako ya ing kasalungsungan makapiling address keng listahan</translation> </message> <message> <location line="-14"/> <source>Verify a message to ensure it was signed with a specified Pandacoin address</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished">&amp;Beripikan ing Mensayi</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Ilako</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+65"/> <source>Copy &amp;Label</source> <translation>Kopyan ing &amp;Label</translation> </message> <message> <location line="+2"/> <source>&amp;Edit</source> <translation>&amp;Alilan</translation> </message> <message> <location line="+250"/> <source>Export Address Book Data</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Comma separated file (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>AddressBookPage_new</name> <message> <location filename="../forms/addressbookpage_new.ui" line="+14"/> <source>Frame</source> <translation type="unfinished"></translation> </message> <message> <location line="+34"/> <source>Address Book</source> <translation type="unfinished"></translation> </message> <message> <location line="+26"/> <source>Create a new address</source> <translation type="unfinished">Maglalang kang bayung address</translation> </message> <message> <location line="+3"/> <source>&amp;New Address</source> <translation type="unfinished"></translation> </message> <message> <location line="+11"/> <source>Copy the currently selected address to the system clipboard</source> <translation type="unfinished">Kopyan me ing salukuyan at makipiling address keng system clipboard</translation> </message> <message> <location line="+3"/> <source>&amp;Copy Address</source> <translation type="unfinished">&amp;Kopyan ing address</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation type="unfinished"></translation> </message> <message> <location line="+11"/> <source>Verify a message to ensure it was signed with a specified Pandacoin address</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished">&amp;Beripikan ing Mensayi</translation> </message> <message> <location line="+11"/> <source>Delete the currently selected address from the list</source> <translation type="unfinished">Ilako ya ing kasalungsungan makapiling address keng listahan</translation> </message> <message> <location line="+3"/> <source>&amp;Delete</source> <translation type="unfinished">&amp;Ilako</translation> </message> <message> <location line="+25"/> <source>Search address book</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <source>...</source> <translation type="unfinished"></translation> </message> <message> <source>label</source> <translation type="obsolete">label</translation> </message> <message> <location line="+80"/> <location line="+245"/> <source>Edit</source> <translation type="unfinished"></translation> </message> <message> <location line="+40"/> <source>Account address</source> <translation type="unfinished"></translation> </message> <message> <location line="-191"/> <source>Send Pandacoins</source> <translation type="unfinished"></translation> </message> <message> <location line="+40"/> <source>From</source> <translation type="unfinished">Menibat</translation> </message> <message> <location line="+36"/> <source>Amount</source> <translation type="unfinished">Alaga</translation> </message> <message> <location line="+15"/> <source>Next</source> <translation type="unfinished"></translation> </message> <message> <location line="+67"/> <source>Done</source> <translation type="unfinished"></translation> </message> <message> <location line="+16"/> <source>Account name</source> <translation type="unfinished"></translation> </message> <message> <location line="+57"/> <source>Delete</source> <translation type="unfinished"></translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+25"/> <source>Label</source> <translation>Label</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Address</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(alang label)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Dialogo ning Passphrase</translation> </message> <message> <location line="+21"/> <location filename="../askpassphrasedialog.cpp" line="+42"/> <source>Enter password</source> <translation type="unfinished"></translation> </message> <message> <location line="+14"/> <source>New password</source> <translation type="unfinished"></translation> </message> <message> <location line="+14"/> <source>Repeat new password</source> <translation type="unfinished"></translation> </message> <message> <location line="+39"/> <source>For earning interest only</source> <translation type="unfinished"></translation> </message> <message> <source>Enter passphrase</source> <translation type="obsolete">Mamalub kang passphrase</translation> </message> <message> <source>New passphrase</source> <translation type="obsolete">Panibayung passphrase</translation> </message> <message> <source>Repeat new passphrase</source> <translation type="obsolete">Pasibayuan ya ing bayung passphrase</translation> </message> <message> <location line="-3"/> <source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source> <translation type="unfinished"></translation> </message> <message> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation type="obsolete">Palub ye ing bayung passphrase king wallet.&lt;br/&gt;Maliari pu sanang gumamit kayung passphrase a maki&lt;/b&gt; 10 or dakal pang miyayaliuang characters&lt;/b&gt;, o ualu o dakal pang salita&lt;/b&gt;</translation> </message> <message> <source>Encrypt wallet</source> <translation type="obsolete">I-encrypt ye ing wallet</translation> </message> <message> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation type="obsolete">Ing operasyun a ini kailangan ne ing kekayung wallet passphrase, ban a-unlock ya ing wallet</translation> </message> <message> <source>Unlock wallet</source> <translation type="obsolete">Unlock ya ing wallet</translation> </message> <message> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation type="obsolete">Ing operasyun a ini kailangan ne ing kekang wallet passphrase ban a-decrypt ne ing wallet.</translation> </message> <message> <source>Decrypt wallet</source> <translation type="obsolete">I-decrypt ya ing wallet</translation> </message> <message> <source>Change passphrase</source> <translation type="obsolete">Alilan ya ing passphrase</translation> </message> <message> <source>Enter the old and new passphrase to the wallet.</source> <translation type="obsolete">Palub ye ing luma ampo ing bayung passphrase king wallet.</translation> </message> <message> <source>Confirm wallet encryption</source> <translation type="obsolete">Kumpirman ya ing wallet encryption</translation> </message> <message> <source>Are you sure you wish to encrypt your wallet?</source> <translation type="obsolete">Siguradu na kang buri meng i-encrypt ing kekang wallet?</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="-7"/> <source>Enter the new password to the wallet.&lt;br/&gt;Please use a password of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Encrypt PandaBank</source> <translation type="unfinished"></translation> </message> <message> <location line="+4"/> <source>Log on to PandaBank</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Please enter your PandaBank password to log on to PandaBank.</source> <translation type="unfinished"></translation> </message> <message> <location line="+4"/> <source>LOG ON</source> <translation type="unfinished"></translation> </message> <message> <location line="+11"/> <source>This operation needs your PandaBank password to unlock PandaBank.</source> <translation type="unfinished"></translation> </message> <message> <location line="+5"/> <source>Unlock PandaBank</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>This operation needs your PandaBank password to decrypt PandaBank.</source> <translation type="unfinished"></translation> </message> <message> <location line="+5"/> <source>Decrypt PandaBank</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>Change password</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Enter the old and new password to PandaBank.</source> <translation type="unfinished"></translation> </message> <message> <location line="+46"/> <source>Confirm PandaBank encryption</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your PandaBank and lose your password, you will &lt;b&gt;LOSE ALL OF YOUR COINS&lt;/b&gt;!</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your PandaBank?</source> <translation type="unfinished"></translation> </message> <message> <location line="+9"/> <location line="+61"/> <source>PandaBank encrypted</source> <translation type="unfinished"></translation> </message> <message> <location line="-59"/> <source>PandaBank will close now to finish the encryption process. Remember that encrypting your PandaBank cannot fully protect your coins from being stolen by malware infecting your computer.</source> <translation type="unfinished"></translation> </message> <message> <location line="+4"/> <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>Mayalaga: Reng milabas a backups a gewa mu gamit ing wallet file mu dapat lamung mialilan bayung gawang encrypted wallet file. Para keng seguridad , reng milabas a backups dareng ali maka encrypt a wallet file ma-ala nala istung inumpisan mu nalang gamitan reng bayu, at me encrypt a wallet. </translation> </message> <message> <location line="+9"/> <location line="+7"/> <location line="+45"/> <location line="+6"/> <source>PandaBank encryption failed</source> <translation type="unfinished"></translation> </message> <message> <location line="-57"/> <source>PandaBank encryption failed due to an internal error. Your PandaBank was not encrypted.</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <location line="+51"/> <source>The supplied passwords do not match.</source> <translation type="unfinished"></translation> </message> <message> <location line="-38"/> <source>PandaBank unlock failed</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <location line="+12"/> <location line="+19"/> <source>The password entered for your PandaBank was incorrect.</source> <translation type="unfinished"></translation> </message> <message> <location line="-20"/> <source>PandaBank decryption failed</source> <translation type="unfinished"></translation> </message> <message> <location line="+14"/> <source>Wallet password was successfully changed.</source> <translation type="unfinished"></translation> </message> <message> <location line="+49"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Kapabaluan: Makabuklat ya ing Caps Lock key!</translation> </message> <message> <source>Wallet encrypted</source> <translation type="obsolete">Me-encrypt ne ing wallet</translation> </message> <message> <source>Wallet encryption failed</source> <translation type="obsolete">Memali ya ing pamag-encrypt king wallet </translation> </message> <message> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation type="obsolete">Memali ya ing encryption uli na ning ausan dang internal error. E ya me-encrypt ing wallet yu.</translation> </message> <message> <source>The supplied passphrases do not match.</source> <translation type="obsolete">E la mitutugma ring mibieng passphrase</translation> </message> <message> <source>Wallet unlock failed</source> <translation type="obsolete">Memali ya ing pamag-unlock king wallet </translation> </message> <message> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation type="obsolete">E ya istu ing passphrase a pepalub da para king wallet decryption</translation> </message> <message> <source>Wallet decryption failed</source> <translation type="obsolete">Me-mali ya ing pamag-decrypt king wallet</translation> </message> <message> <source>Wallet passphrase was successfully changed.</source> <translation type="obsolete">Mi-alilan ne ing passphrase na ning wallet.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+311"/> <source>Sign &amp;message...</source> <translation>I-sign ing &amp;mensayi</translation> </message> <message> <location line="+506"/> <source>Synchronizing with network...</source> <translation>Mag-sychronize ne king network...</translation> </message> <message> <location line="-570"/> <source>&amp;Overview</source> <translation>&amp;Overview</translation> </message> <message> <location line="-156"/> <source>PandaBank</source> <translation type="unfinished"></translation> </message> <message> <location line="+58"/> <source>My Home</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>View Accounts</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Transfers</source> <translation type="unfinished"></translation> </message> <message> <location line="+96"/> <source>Show general overview of wallet</source> <translation>Ipakit ing kabuuang lawe ning wallet</translation> </message> <message> <location line="+6"/> <source>Send coins to a PandaBank address</source> <translation type="unfinished"></translation> </message> <message> <location line="+11"/> <source>&amp;Transactions</source> <translation>&amp;Transaksion</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Lawan ing kasalesayan ning transaksion</translation> </message> <message> <location line="+5"/> <source>&amp;Address Book</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Edit the list of stored addresses and labels</source> <translation type="unfinished"></translation> </message> <message> <location line="-13"/> <source>&amp;Receive coins</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Show the list of addresses for receiving payments</source> <translation type="unfinished"></translation> </message> <message> <location line="-7"/> <source>&amp;Send coins</source> <translation type="unfinished"></translation> </message> <message> <location line="+33"/> <source>E&amp;xit</source> <translation>L&amp;umwal</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Tuknangan ing aplikasyon</translation> </message> <message> <location line="+6"/> <source>About &amp;Qt</source> <translation>Tungkul &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Magpakit impormasion tungkul king Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Pipamilian...</translation> </message> <message> <source>&amp;Encrypt Wallet...</source> <translation type="obsolete">I-&amp;Encrypt in Wallet...</translation> </message> <message> <source>&amp;Backup Wallet...</source> <translation type="obsolete">I-&amp;Backup ing Wallet...</translation> </message> <message> <source>&amp;Change Passphrase...</source> <translation type="obsolete">&amp;Alilan ing Passphrase...</translation> </message> <message> <location line="+537"/> <source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source> <translation type="unfinished"></translation> </message> <message> <location line="-512"/> <source>&amp;Export...</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"></translation> </message> <message> <source>Backup wallet to another location</source> <translation type="obsolete">I-backup ing wallet king aliwang lugal</translation> </message> <message> <source>Change the passphrase used for wallet encryption</source> <translation type="obsolete">Alilan ya ing passphrase a gagamitan para king wallet encryption</translation> </message> <message> <location line="+1"/> <source>&amp;Debug window</source> <translation>I-&amp;Debug ing awang</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Ibuklat ing debugging at diagnostic console</translation> </message> <message> <location line="-12"/> <source>&amp;Verify message...</source> <translation>&amp;Beripikan ing message...</translation> </message> <message> <source>Wallet</source> <translation type="obsolete">Wallet</translation> </message> <message> <location line="-13"/> <source>&amp;Show / Hide</source> <translation>&amp;Ipalto / Isalikut</translation> </message> <message> <source>&amp;File</source> <translation type="obsolete">&amp;File</translation> </message> <message> <source>&amp;Settings</source> <translation type="obsolete">&amp;Pamag-ayus</translation> </message> <message> <source>&amp;Help</source> <translation type="obsolete">&amp;Saup</translation> </message> <message> <source>Tabs toolbar</source> <translation type="obsolete">Gamit para king Tabs</translation> </message> <message> <location line="+102"/> <location line="+9"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+431"/> <source>Downloaded %1 blocks of transaction history.</source> <translation type="unfinished"></translation> </message> <message> <location line="+240"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid PandaBank address or malformed URI parameters.</source> <translation type="unfinished"></translation> </message> <message> <location line="+239"/> <source>Staking.&lt;br&gt;Your weight is %1&lt;br&gt;Network weight is %2&lt;br&gt;Expected time to earn reward is %3</source> <translation type="unfinished"></translation> </message> <message> <location line="-1045"/> <source>&amp;About PandaBank</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Show information about PandaBank</source> <translation type="unfinished"></translation> </message> <message> <location line="+6"/> <source>Modify configuration options for PandaBank</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>&amp;Encrypt PandaBank...</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Encrypt or decrypt PandaBank</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>&amp;Backup PandaBank...</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Backup PandaBank to another location</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>&amp;Change Password...</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Change the password used for wallet encryption</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>&amp;Unlock PandaBank...</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Unlock PandaBank</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>&amp;Lock PandaBank</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Lock PandaBank</source> <translation type="unfinished"></translation> </message> <message> <location line="+4"/> <location line="+1"/> <source>Activate &apos;Classic&apos; client mode.</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <location line="+1"/> <source>Activate &apos;Hybrid&apos; client mode.</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <location line="+1"/> <source>Activate &apos;Lite&apos; client mode.</source> <translation type="unfinished"></translation> </message> <message> <location line="+91"/> <location line="+71"/> <source>PandaBank client</source> <translation type="unfinished"></translation> </message> <message> <location line="+134"/> <source>Downloaded %1 of %2 checkpoints (%3% done).</source> <translation type="unfinished"></translation> </message> <message> <location line="+268"/> <source>Up to date</source> <translation>Makatuki ya king aldo</translation> </message> <message> <location line="+7"/> <source>Catching up...</source> <translation>Catching up...</translation> </message> <message> <location line="+10"/> <source>Last received block was generated %1.</source> <translation type="unfinished"></translation> </message> <message> <location line="+64"/> <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"></translation> </message> <message> <location line="+5"/> <source>Confirm transaction fee</source> <translation type="unfinished"></translation> </message> <message> <location line="+27"/> <source>Sent transaction</source> <translation>Mipadalang transaksion</translation> </message> <message> <location line="+1"/> <source>Incoming transaction</source> <translation>Paparatang a transaksion</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Aldo: %1 Alaga: %2 Type: %3 Address: %4 </translation> </message> <message> <location line="+83"/> <location line="+15"/> <source>URI handling</source> <translation type="unfinished"></translation> </message> <message> <location line="+116"/> <source>Activate PandaBank ‘Classic’</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>PandaBank &apos;Classic&apos; allows you to earn interest and help secure the Pandacoin Network once synchronization and download of the blockchain is completed. It operates using the outdated method of synchronization and downloading of the blockchain, which could take between 4 to 24 hours to complete. We recommend most Pandacoin users to use Pandacoin &apos;Hybrid&apos;. Switching to PandaBank &apos;Classic&apos; from other modes will wipe out your existing blockchain data. Activate PandaBank &apos;Classic&apos;?</source> <translation type="unfinished"></translation> </message> <message> <location line="+21"/> <source>Activate PandaBank ‘Hybrid’</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>PandaBank &apos;Hybrid&apos; is the recommended mode for most Pandacoin users. Synchronization with the Pandacoin Network will only take seconds after installation so you can see and use your Pandacoins immediately. PandaBank &apos;Hybrid allows you to earn interest and help secure the Pandacoin Network in approximately 5 to 15 minutes after installation, once both synchronization and download of the blockchain is completed. Activate PandaBank &apos;Hybrid&apos;?</source> <translation type="unfinished"></translation> </message> <message> <location line="+19"/> <source>Activate PandaBank ‘Lite’</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>PandaBank &apos;Lite&apos; is for users that have access to limited download or hard drive storage space. Stored data is only a few megabytes. Synchronization with the Pandacoin Network will only take seconds after installation so you can see and use your Pandacoins immediately. Pandacoin &apos;Lite&apos; DOES NOT allow you to earn interest or help secure the Pandacoin Network. Activate PandaBank &apos;Lite&apos;?</source> <translation type="unfinished"></translation> </message> <message> <location line="+42"/> <source>Unable to earn interest in light mode.&lt;br/&gt;Switch to hybrid mode if you would like to earn interest.</source> <translation type="unfinished"></translation> </message> <message> <location line="+6"/> <source>Unable to earn interest until syncing is completed.</source> <translation type="unfinished"></translation> </message> <message> <location line="+16"/> <location line="+4"/> <location line="+4"/> <location line="+4"/> <source>%1 %2</source> <translation type="unfinished"></translation> </message> <message> <location line="+10"/> <source>Not earning interest because wallet is locked</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Not earning interest because wallet is offline</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Not earning interest because wallet is syncing</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Not earning interest because you don&apos;t have mature coins</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Not earning interest</source> <translation type="unfinished"></translation> </message> <message> <location line="-235"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Maka-&lt;b&gt;encrypt&lt;/b&gt; ya ing wallet at kasalukuyan yang maka-&lt;b&gt;unlocked&lt;/b&gt;</translation> </message> <message> <location line="-563"/> <source>%1 active %2 to PandaBank network</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>connection</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>connections</source> <translation type="unfinished"></translation> </message> <message> <location line="+16"/> <source>Searching for peers.</source> <translation type="unfinished"></translation> </message> <message> <location line="+17"/> <source>Connecting to peers.</source> <translation type="unfinished"></translation> </message> <message> <location line="+16"/> <source>Fetching checkpoints.</source> <translation type="unfinished"></translation> </message> <message> <location line="+8"/> <location line="+33"/> <location line="+33"/> <location line="+33"/> <location line="+30"/> <location line="+30"/> <location line="+29"/> <location line="+29"/> <source>%1 %2 remaining</source> <translation type="unfinished"></translation> </message> <message> <location line="-217"/> <source>checkpoint</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>checkpoints</source> <translation type="unfinished"></translation> </message> <message> <location line="+22"/> <location line="+33"/> <source>Performing Instant Sync</source> <translation type="unfinished"></translation> </message> <message> <location line="-31"/> <source>(Phase 1 of 3)</source> <translation type="unfinished"></translation> </message> <message> <location line="+9"/> <location line="+96"/> <source>header</source> <translation type="unfinished"></translation> </message> <message> <location line="-96"/> <location line="+96"/> <source>headers</source> <translation type="unfinished"></translation> </message> <message> <location line="-88"/> <location line="+96"/> <source>Downloaded %1 of %2 headers (%3% done).</source> <translation type="unfinished"></translation> </message> <message> <location line="-80"/> <source>(Phase 2 of 3)</source> <translation type="unfinished"></translation> </message> <message> <location line="+9"/> <location line="+33"/> <location line="+60"/> <location line="+29"/> <location line="+29"/> <source>block</source> <translation type="unfinished"></translation> </message> <message> <location line="-151"/> <location line="+33"/> <location line="+60"/> <location line="+29"/> <location line="+29"/> <source>blocks</source> <translation type="unfinished"></translation> </message> <message> <location line="-143"/> <location line="+93"/> <source>Downloaded %1 of %2 blocks (%3% done).</source> <translation type="unfinished"></translation> </message> <message> <location line="-79"/> <source>Scanning wallet transactions</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>(Phase 3 of 3)</source> <translation type="unfinished"></translation> </message> <message> <location line="+17"/> <source>Scanned %1 of %2 blocks (%3% done).</source> <translation type="unfinished"></translation> </message> <message> <location line="+14"/> <source>Rapid Blockchain Download (Phase 1 of 2).</source> <translation type="unfinished"></translation> </message> <message> <location line="+30"/> <source>Rapid Blockchain Download (Phase 2 of 2).</source> <translation type="unfinished"></translation> </message> <message> <location line="+29"/> <source>Verify blockchain.</source> <translation type="unfinished"></translation> </message> <message> <location line="+16"/> <source>Verified %1 of %2 blocks (%3% done).</source> <translation type="unfinished"></translation> </message> <message> <location line="+61"/> <location line="+4"/> <location line="+4"/> <location line="+4"/> <source>%1 %2 ago</source> <translation type="unfinished"></translation> </message> <message> <location line="-12"/> <location line="+454"/> <source>second</source> <translation type="unfinished"></translation> </message> <message> <location line="-454"/> <location line="+454"/> <source>seconds</source> <translation type="unfinished"></translation> </message> <message> <location line="-450"/> <location line="+454"/> <source>minute</source> <translation type="unfinished"></translation> </message> <message> <location line="-454"/> <location line="+454"/> <source>minutes</source> <translation type="unfinished"></translation> </message> <message> <location line="-450"/> <location line="+454"/> <source>hour</source> <translation type="unfinished"></translation> </message> <message> <location line="-454"/> <location line="+454"/> <source>hours</source> <translation type="unfinished"></translation> </message> <message> <location line="-450"/> <location line="+454"/> <source>day</source> <translation type="unfinished"></translation> </message> <message> <location line="-454"/> <location line="+454"/> <source>days</source> <translation type="unfinished"></translation> </message> <message> <location line="-207"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Maka-&lt;b&gt;encrypt&lt;/b&gt; ya ing wallet at kasalukuyan yang maka-&lt;b&gt;locked&lt;/b&gt;</translation> </message> <message> <location line="+26"/> <source>Backup Wallet</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. Pandacoin can no longer continue safely and will quit.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+92"/> <source>Network Alert</source> <translation>Alertu ning Network</translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control</source> <translation type="unfinished"></translation> </message> <message> <location line="+31"/> <source>Quantity:</source> <translation type="unfinished"></translation> </message> <message> <location line="+32"/> <source>Bytes:</source> <translation type="unfinished"></translation> </message> <message> <location line="+48"/> <source>Amount:</source> <translation type="unfinished"></translation> </message> <message> <location line="+32"/> <source>Priority:</source> <translation type="unfinished"></translation> </message> <message> <location line="+48"/> <source>Fee:</source> <translation type="unfinished"></translation> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="+551"/> <source>no</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="+51"/> <source>After Fee:</source> <translation type="unfinished"></translation> </message> <message> <location line="+35"/> <source>Change:</source> <translation type="unfinished"></translation> </message> <message> <location line="+69"/> <source>(un)select all</source> <translation type="unfinished"></translation> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation type="unfinished"></translation> </message> <message> <location line="+16"/> <source>List mode</source> <translation type="unfinished"></translation> </message> <message> <location line="+45"/> <source>Amount</source> <translation>Alaga</translation> </message> <message> <location line="+5"/> <source>Label</source> <translation type="unfinished">Label</translation> </message> <message> <location line="+5"/> <source>Address</source> <translation>Address</translation> </message> <message> <location line="+5"/> <source>Date</source> <translation>Kaaldauan</translation> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation>Me-kumpirma</translation> </message> <message> <location line="+5"/> <source>Priority</source> <translation type="unfinished"></translation> </message> <message> <location filename="../coincontroldialog.cpp" line="-515"/> <source>Copy address</source> <translation>Kopyan ing address</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Kopyan ing label</translation> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation>Kopyan ing alaga</translation> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation type="unfinished"></translation> </message> <message> <location line="+24"/> <source>Copy quantity</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"></translation> </message> <message> <location line="+317"/> <source>highest</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>high</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>medium-high</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>medium</source> <translation type="unfinished"></translation> </message> <message> <location line="+4"/> <source>low-medium</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>low</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>lowest</source> <translation type="unfinished"></translation> </message> <message> <location line="+155"/> <source>DUST</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>yes</source> <translation type="unfinished"></translation> </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"></translation> </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 &quot;medium&quot;. This means a fee of at least %1 per kb is required.</source> <translation type="unfinished"></translation> </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"></translation> </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"></translation> </message> <message> <location line="+37"/> <location line="+66"/> <source>(no label)</source> <translation>(alang label)</translation> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>(change)</source> <translation type="unfinished"></translation> </message> </context> <context> <name>CreateAccountWidget</name> <message> <location filename="../forms/createaccountwidget.ui" line="+20"/> <source>Frame</source> <translation type="unfinished"></translation> </message> <message> <location line="+53"/> <source>Creating a new PandaBank account is easy</source> <translation type="unfinished"></translation> </message> <message> <location line="+15"/> <source>Create</source> <translation type="unfinished"></translation> </message> <message> <location line="+19"/> <source>Account name</source> <translation type="unfinished"></translation> </message> <message> <location line="+15"/> <source>Account address</source> <translation type="unfinished"></translation> </message> <message> <location line="+27"/> <source>Cancel</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/createaccountwidget.cpp" line="+55"/> <location line="+19"/> <source>Error</source> <translation type="unfinished">Mali</translation> </message> <message> <location line="-19"/> <source>An account with this name already exists.</source> <translation type="unfinished"></translation> </message> <message> <location line="+15"/> <source>PandaBank account created</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>Your PandaBank Account has been created.</source> <translation type="unfinished"></translation> </message> <message> <location line="+4"/> <source>Error creating PandaBank account.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Alilan ing Address</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Label</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Address</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"></translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+23"/> <source>New receiving address</source> <translation>Bayung address king pamagtanggap</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Bayung address king pamagpadala</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Alilan ya ing address king pamagpadala</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Alilan ya ing address king pamagpadala</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>Ing pepalub yung address &quot;%1&quot; ati na yu king aklat dareng address</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Pandacoin address.</source> <translation type="unfinished"></translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Ali ya bisang mag-unlock ing wallet</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Memali ya ing pamangaua king key</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+655"/> <location line="+12"/> <source>Pandacoin-Qt</source> <translation type="unfinished"></translation> </message> <message> <location line="-12"/> <source>version</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation type="unfinished">Pamanggamit:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"></translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"></translation> </message> </context> <context> <name>LockBar</name> <message> <location filename="../forms/lockbar.ui" line="+69"/> <location filename="../forms/lockbar.cpp" line="+37"/> <location line="+5"/> <source>Lock</source> <translation type="unfinished"></translation> </message> <message> <location filename="../forms/lockbar.cpp" line="-3"/> <source>Wallet is &lt;b&gt;not encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt; click to encrypt and lock.</source> <translation type="unfinished"></translation> </message> <message> <location line="+5"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt; click to lock.</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>Unlock</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt; click to unlock.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>MainFrame</name> <message> <location filename="../forms/mainframe.ui" line="+14"/> <source>Frame</source> <translation type="unfinished"></translation> </message> </context> <context> <name>MenuBar</name> <message> <location filename="../forms/menubar.ui" line="+55"/> <source>Mode</source> <translation type="unfinished"></translation> </message> <message> <location line="+26"/> <source>File</source> <translation type="unfinished"></translation> </message> <message> <location line="+26"/> <source>Settings</source> <translation type="unfinished"></translation> </message> <message> <location line="+26"/> <source>Help</source> <translation type="unfinished"></translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Pipamilian</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Pun</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"></translation> </message> <message> <location line="+21"/> <source>Pay transaction &amp;fee</source> <translation>Mamayad &amp;bayad para king transaksion </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"></translation> </message> <message> <location line="+21"/> <source>Reserve</source> <translation type="unfinished"></translation> </message> <message> <location line="+31"/> <source>Automatically start Pandacoin after logging in to the system.</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>&amp;Start PandaBank on system login</source> <translation type="unfinished"></translation> </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"></translation> </message> <message> <location line="+3"/> <source>&amp;Detach databases at shutdown</source> <translation type="unfinished"></translation> </message> <message> <location line="+21"/> <source>&amp;Network</source> <translation>&amp;Network</translation> </message> <message> <location line="+6"/> <source>Automatically open the Pandacoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Mapa ng ning port gamit ing &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the Pandacoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation type="unfinished"></translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>Proxy &amp;IP:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Port:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Port na ning proxy(e.g. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>&amp;Bersion na ning SOCKS</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Bersion a SOCKS ning proxy (e.g 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Awang</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Ipakit mu ing tray icon kaibat meng pelatian ing awang.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Latian ya ing tray kesa king taskbar</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>Palatian namu kesa king iluwal ya ing aplikasion istung makasara ya ing awang. Istung ing pipamilian a ini atiu king &quot;magsilbi&quot;, ing aplikasion misara yamu kaibat meng pinili ing &quot;Tuknangan&quot; king menu.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>P&amp;alatian istung isara</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;Ipalto</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>Amanu na ning user interface:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Pandacoin.</source> <translation type="unfinished"></translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>Ing &amp;Unit a ipakit king alaga ning:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Pilinan ing default subdivision unit a ipalto o ipakit king interface at istung magpadala kang barya.</translation> </message> <message> <location line="+9"/> <source>Whether to show Pandacoin addresses in the transaction list or not.</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>&amp;Ipakit ing address king listahan naning transaksion</translation> </message> <message> <location line="+7"/> <source>Whether to show coin control features or not.</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only!)</source> <translation type="unfinished"></translation> </message> <message> <location line="+21"/> <source>Advanced</source> <translation type="unfinished"></translation> </message> <message> <location line="+8"/> <source>Reset Blockchain</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <source>Reset Peers</source> <translation type="unfinished"></translation> </message> <message> <location line="+86"/> <source>&amp;OK</source> <translation>&amp;OK</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>I-&amp;Cancel</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"></translation> </message> <message> <location filename="../optionsdialog.cpp" line="+58"/> <source>default</source> <translation>default</translation> </message> <message> <location line="+152"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"></translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting Pandacoin.</source> <translation type="unfinished"></translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>Ing milageng proxy address eya katanggap-tanggap.</translation> </message> <message> <location line="+20"/> <source>Confirm Blockchain reset</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>Are you sure you want to reset your Blockchain? This will cause the entire Blockchain to download again.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Form</translation> </message> <message> <location line="+26"/> <source>Welcome to your PandaBank, You last logged on at &lt;TIME&gt; on &lt;DATE&gt;</source> <translation type="unfinished"></translation> </message> <message> <location line="+22"/> <source>My Portfolio</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <source>More</source> <translation type="unfinished"></translation> </message> <message> <location line="+58"/> <source>Portfolio Summary</source> <translation type="unfinished"></translation> </message> <message> <location line="+20"/> <source>Available</source> <translation type="unfinished"></translation> </message> <message> <location line="+45"/> <source>Earning Interest</source> <translation type="unfinished"></translation> </message> <message> <location line="+42"/> <source>Pending</source> <translation type="unfinished"></translation> </message> <message> <location line="+45"/> <source>Total Balance</source> <translation type="unfinished"></translation> </message> <message> <location line="+48"/> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Note: &lt;span style=&quot; font-weight:600;&quot;&gt;Available&lt;/span&gt; is the amount of PND that is available for you to spend or transfer. &lt;span style=&quot; font-weight:600;&quot;&gt;Earning Interest&lt;/span&gt; is the amount of PND that is currently being used to generate interest. &lt;span style=&quot; font-weight:600;&quot;&gt;Pending&lt;/span&gt; is the amount of recent incoming PND from another account address waiting to be transferred to your account. &lt;span style=&quot; font-weight:600;&quot;&gt;Total Balance&lt;/span&gt; is the sum total of PND of all your account balances. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <translation type="unfinished"></translation> </message> <message> <location line="+89"/> <source>Quick Transfer</source> <translation type="unfinished"></translation> </message> <message> <location line="+30"/> <source>To</source> <translation type="unfinished">Para kang</translation> </message> <message> <location line="+7"/> <source>Amount</source> <translation type="unfinished">Alaga</translation> </message> <message> <location line="+7"/> <source>From</source> <translation type="unfinished">Menibat</translation> </message> <message> <location line="+71"/> <source>Next</source> <translation type="unfinished"></translation> </message> <message> <source>Wallet</source> <translation type="obsolete">Wallet</translation> </message> <message> <location line="-365"/> <source>Your current spendable balance</source> <translation>Ing kekang kasalungsungan balanse a malyari mung gastusan</translation> </message> <message> <source>Immature:</source> <translation type="obsolete">Immature:</translation> </message> <message> <source>Mined balance that has not yet matured</source> <translation type="obsolete">Reng me-minang balanse a epa meg-matured</translation> </message> <message> <source>Total:</source> <translation type="obsolete">Kabuuan:</translation> </message> <message> <location line="+132"/> <source>Your current total balance</source> <translation>Ing kekang kasalungsungan kabuuang balanse</translation> </message> <message> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation type="obsolete">&lt;b&gt;Reng kapilan pamung transaksion&lt;/b&gt;</translation> </message> <message> <location line="-45"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation type="unfinished"></translation> </message> <message> <location line="-42"/> <source>Total of coins that was staked, and do not yet count toward the current balance</source> <translation type="unfinished"></translation> </message> <message> <source>out of sync</source> <translation type="obsolete">ali ya maka-sync</translation> </message> <message> <location filename="../overviewpage.cpp" line="+40"/> <source>Copy account address</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Copy account name</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Copy account balance</source> <translation type="unfinished"></translation> </message> <message> <location line="+13"/> <source>Welcome to your PandaBank, You last logged on at</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>on</source> <translation type="unfinished"></translation> </message> <message> <location line="+96"/> <location line="+7"/> <source>Select account</source> <translation type="unfinished"></translation> </message> </context> <context> <name>QObject</name> <message> <location filename="../guiutil.cpp" line="-569"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>Confirm send coins</source> <translation type="unfinished">Kumpirman ing pamagpadalang barya</translation> </message> <message> <location line="+0"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source> and </source> <translation type="unfinished"></translation> </message> <message> <location line="+63"/> <location line="+12"/> <location line="+14"/> <location line="+4"/> <location line="+15"/> <location line="+4"/> <location line="+13"/> <location line="+12"/> <location line="+12"/> <location line="+12"/> <source>Send Coins</source> <translation type="unfinished">Magpadalang Barya</translation> </message> <message> <location line="-98"/> <source>The recipient address is not valid, please recheck.</source> <translation type="unfinished">Ing address na ning tumanggap ali ya katanggap-tanggap, maliari pung pakilaue pasibayu.</translation> </message> <message> <location line="+12"/> <source>The amount to pay must be larger than 0.</source> <translation type="unfinished">Ing alaga na ning bayaran dapat mung mas matas ya king 0.</translation> </message> <message> <location line="+14"/> <source>The amount exceeds your balance.</source> <translation type="unfinished">Ing alaga mipasobra ya king kekang balanse.</translation> </message> <message> <location line="+4"/> <source>The amount exceeds your available balance, some of your Pandacoins are currently being used to earn you interest.</source> <translation type="unfinished"></translation> </message> <message> <location line="+15"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation type="unfinished">Ing kabuuan mipasobra ya king kekang balanse istung inabe ya ing %1 a bayad king transaksion </translation> </message> <message> <location line="+4"/> <source>The amount exceeds your available balance when the %1 transaction fee is included, some of your Pandacoins are currently being used to earn you interest.</source> <translation type="unfinished"></translation> </message> <message> <location line="+13"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation type="unfinished">Atin meakit a milupang address, maliari kamung magpadalang misan king metung a address king misan a pamagpadalang transaksion.</translation> </message> <message> <location line="+12"/> <source>Error: Transaction creation failed because transaction size (in Kb) too large.</source> <translation type="unfinished"></translation> </message> <message> <location line="+12"/> <source>Error: Transaction creation failed.</source> <translation type="unfinished"></translation> </message> <message> <location line="+12"/> <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"></translation> </message> <message> <location filename="../pandastyles.cpp" line="+18"/> <source>Arial, &apos;Helvetica Neue&apos;, Helvetica, sans-serif</source> <translation type="unfinished"></translation> </message> <message> <location filename="../../init.cpp" line="+849"/> <source>My account</source> <translation type="unfinished"></translation> </message> <message> <location filename="../../main.cpp" line="+928"/> <source>Sync error encountered: %s The most likely cause of this error is a problem with your local blockchain, so the blockchain will now reset itself and sync again. Should you encounter this error repeatedly please seek assistance.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"></translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation type="unfinished"></translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation type="unfinished"></translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation type="unfinished"></translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation type="unfinished"></translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation type="unfinished"></translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"></translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"></translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"></translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation type="unfinished"></translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Lagyu ning kliente</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="+347"/> <source>N/A</source> <translation>N/A</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Bersion ning Cliente</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Impormasion</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Gagamit bersion na ning OpenSSL</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Oras ning umpisa</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Network</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Bilang dareng koneksion</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"></translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Block chain</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Kasalungsungan bilang dareng blocks</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Estima kareng kabuuan dareng blocks</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Tatauling oras na ning block</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Ibuklat</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <source>Show the Pandacoin-Qt help message to get a list with possible Pandacoin command-line options.</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"></translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Console</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Kaaldauan ning pamaglalang</translation> </message> <message> <location line="-104"/> <source>Pandacoin - Debug window</source> <translation type="unfinished"></translation> </message> <message> <location line="+25"/> <source>Pandacoin Core</source> <translation type="unfinished"></translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>Debug log file</translation> </message> <message> <location line="+7"/> <source>Open the Pandacoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"></translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>I-Clear ing console</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-33"/> <source>Welcome to the Pandacoin RPC console.</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Gamitan me ing patas at pababang arrow para alibut me ing kasalesayan, at &lt;b&gt;Ctrl-L&lt;/b&gt; ban I-clear ya ing screen.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>I-type ing &lt;b&gt;help&lt;/b&gt; ban akit la reng ati at magsilbing commands.</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <source>Send Coins</source> <translation type="obsolete">Magpadalang Barya</translation> </message> <message> <source>Send to multiple recipients at once</source> <translation type="obsolete">Misanang magpadala kareng alialiuang tumanggap</translation> </message> <message> <source>Add &amp;Recipient</source> <translation type="obsolete">Maglage &amp;Tumanggap</translation> </message> <message> <source>Clear &amp;All</source> <translation type="obsolete">I-Clear &amp;Eganagana</translation> </message> <message> <source>Balance:</source> <translation type="obsolete">Balanse:</translation> </message> <message> <source>Confirm the send action</source> <translation type="obsolete">Kumpirman ing aksion king pamagpadala</translation> </message> <message> <source>S&amp;end</source> <translation type="obsolete">Ipadala</translation> </message> <message> <source>Copy amount</source> <translation type="obsolete">Kopyan ing alaga</translation> </message> <message> <source>Confirm send coins</source> <translation type="obsolete">Kumpirman ing pamagpadalang barya</translation> </message> <message> <source>The recipient address is not valid, please recheck.</source> <translation type="obsolete">Ing address na ning tumanggap ali ya katanggap-tanggap, maliari pung pakilaue pasibayu.</translation> </message> <message> <source>The amount to pay must be larger than 0.</source> <translation type="obsolete">Ing alaga na ning bayaran dapat mung mas matas ya king 0.</translation> </message> <message> <source>The amount exceeds your balance.</source> <translation type="obsolete">Ing alaga mipasobra ya king kekang balanse.</translation> </message> <message> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation type="obsolete">Ing kabuuan mipasobra ya king kekang balanse istung inabe ya ing %1 a bayad king transaksion </translation> </message> <message> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation type="obsolete">Atin meakit a milupang address, maliari kamung magpadalang misan king metung a address king misan a pamagpadalang transaksion.</translation> </message> <message> <source>(no label)</source> <translation type="obsolete">(alang label)</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation type="unfinished">Form</translation> </message> <message> <location line="+59"/> <source>Send Pandacoins</source> <translation type="unfinished"></translation> </message> <message> <location line="+74"/> <source>Coin Control Features</source> <translation type="unfinished"></translation> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation type="unfinished"></translation> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation type="unfinished"></translation> </message> <message> <location line="+77"/> <source>Quantity:</source> <translation type="unfinished"></translation> </message> <message> <location line="+22"/> <location line="+35"/> <source>0</source> <translation type="unfinished"></translation> </message> <message> <location line="-19"/> <source>Bytes:</source> <translation type="unfinished"></translation> </message> <message> <location line="+51"/> <source>Amount:</source> <translation type="unfinished"></translation> </message> <message> <location line="+22"/> <location line="+86"/> <location line="+86"/> <location line="+32"/> <source>0.00 PND</source> <translation type="unfinished"></translation> </message> <message> <location line="-191"/> <source>Priority:</source> <translation type="unfinished"></translation> </message> <message> <location line="+19"/> <source>medium</source> <translation type="unfinished"></translation> </message> <message> <location line="+32"/> <source>Fee:</source> <translation type="unfinished"></translation> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"></translation> </message> <message> <location line="+19"/> <source>no</source> <translation type="unfinished"></translation> </message> <message> <location line="+32"/> <source>After Fee:</source> <translation type="unfinished"></translation> </message> <message> <location line="+35"/> <source>Change</source> <translation type="unfinished"></translation> </message> <message> <location line="+50"/> <source>custom change address</source> <translation type="unfinished"></translation> </message> <message> <location line="+67"/> <source>From</source> <translation type="unfinished">Menibat</translation> </message> <message> <location line="+35"/> <source>To</source> <translation type="unfinished">Para kang</translation> </message> <message> <location line="+15"/> <source>Or</source> <translation type="unfinished"></translation> </message> <message> <location line="+25"/> <source>Amount</source> <translation type="unfinished">Alaga</translation> </message> <message> <location line="+7"/> <source>▾ Send To My Own Accounts</source> <translation type="unfinished"></translation> </message> <message> <location line="+13"/> <source>Next</source> <translation type="unfinished"></translation> </message> <message> <source>A&amp;mount:</source> <translation type="obsolete">A&amp;laga:</translation> </message> <message> <source>Pay &amp;To:</source> <translation type="obsolete">Ibayad &amp;kang:</translation> </message> <message> <source>Enter a label for this address to add it to your address book</source> <translation type="obsolete">Magpalub kang label para king address a ini ban a-iabe me king aklat dareng address</translation> </message> <message> <source>&amp;Label:</source> <translation type="obsolete">&amp;Label:</translation> </message> <message> <source>Alt+A</source> <translation type="obsolete">Alt+A</translation> </message> <message> <source>Paste address from clipboard</source> <translation type="obsolete">Idikit ing address menibat king clipboard</translation> </message> <message> <source>Alt+P</source> <translation type="obsolete">Alt+P</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+108"/> <source>Copy quantity</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation type="unfinished">Kopyan ing alaga</translation> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"></translation> </message> <message> <location line="+115"/> <location line="+46"/> <source>No from account selected</source> <translation type="unfinished"></translation> </message> <message> <location line="-46"/> <location line="+46"/> <source>You have not selected an account from which to make the payment. Please select the &quot;from&quot; address at the top of this page.</source> <translation type="unfinished"></translation> </message> <message> <location line="+114"/> <source>Search your accounts list...</source> <translation type="unfinished"></translation> </message> <message> <location line="+224"/> <source>WARNING: Invalid Pandacoin address</source> <translation type="unfinished"></translation> </message> <message> <location line="+13"/> <source>(no label)</source> <translation type="unfinished">(alang label)</translation> </message> <message> <location line="+4"/> <source>WARNING: unknown change address</source> <translation type="unfinished"></translation> </message> </context> <context> <name>SendCoinsTargetWidget</name> <message> <location filename="../forms/sendcoinstargetwidget.ui" line="+14"/> <source>Frame</source> <translation type="unfinished"></translation> </message> <message> <location line="+27"/> <source>Account name</source> <translation type="unfinished"></translation> </message> <message> <location line="+12"/> <source>The address to send the payment to (e.g. PBZ8YVV3XT3WWWd2a1jo4N9WePiwKB3mJE)</source> <translation type="unfinished"></translation> </message> <message> <location line="+6"/> <source>Enter a Pandacoin address (e.g. PBZ8YVV3XT3WWWd2a1jo4N9WePiwKB3mJE)</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <source>Choose address from address book</source> <translation type="unfinished"></translation> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation type="unfinished">Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation type="unfinished"></translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation type="unfinished">Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation type="unfinished"></translation> </message> <message> <location line="+16"/> <source>Account address</source> <translation type="unfinished"></translation> </message> <message> <location line="+13"/> <source>Next</source> <translation type="unfinished"></translation> </message> <message> <location line="+13"/> <source>Add another</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <source>▾</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <source>Amount</source> <translation type="unfinished">Alaga</translation> </message> <message> <location line="+7"/> <source>New accounts will automatically be added to your address book</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <source>Enter an account name for this account address to add it to your address book</source> <translation type="unfinished"></translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Pirma - Pirman / I-beripika ing mensayi</translation> </message> <message> <location line="+13"/> <location line="+124"/> <source>&amp;Sign Message</source> <translation>&amp;Pirman ing Mensayi</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>Maliari kang mamirmang mensayi king kekang address bilang patune na keka ya ini. Mimingat mu king pamag-pirmang e malino uling mapalyari kang mabiktimang phishing attack a manloku keka na pirman me ing sarili mu para king karela. Only sign fully-detailed statements you agree to.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. PBZ8YVV3XT3WWWd2a1jo4N9WePiwKB3mJE)</source> <translation type="unfinished"></translation> </message> <message> <location line="+10"/> <location line="+203"/> <source>Choose an address from the address book</source> <translation type="unfinished"></translation> </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>Idikit ing address menibat clipboard</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>Ipalub ing mensayi a buri mung pirman keni</translation> </message> <message> <location line="+24"/> <source>Copy the current signature to the system clipboard</source> <translation>Kopyan ing kasalungsungan pirma king system clipboard</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Pandacoin address</source> <translation type="unfinished"></translation> </message> <message> <location line="+17"/> <source>Reset all sign message fields</source> <translation>Ibalik keng dati reng ngan fields keng pamamirmang mensayi</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>I-Clear &amp;Eganagana</translation> </message> <message> <location line="-87"/> <location line="+70"/> <source>&amp;Verify Message</source> <translation>&amp;Beripikan ing Mensayi</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 type="unfinished"></translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. PBZ8YVV3XT3WWWd2a1jo4N9WePiwKB3mJE)</source> <translation type="unfinished"></translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Pandacoin address</source> <translation type="unfinished"></translation> </message> <message> <location line="+17"/> <source>Reset all verify message fields</source> <translation>Ibalik king dati reng ngan fields na ning pamag beripikang mensayi</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a Pandacoin address (e.g. PBZ8YVV3XT3WWWd2a1jo4N9WePiwKB3mJE)</source> <translation type="unfinished"></translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>I-click ing &quot;Pirman ing Mensayi&quot; ban agawa ya ing metung a pirma</translation> </message> <message> <location line="+3"/> <source>Enter Pandacoin signature</source> <translation type="unfinished"></translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>Ing milub a address e ya katanggap-tanggap.</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>Maliaring pakilawe pasibayu ing address at pasibayuan ya iti.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>Ing milub a address ali ya mag-refer king metung a key.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>Me-kansela ya ing pamag-unlock king wallet.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>Ing private key para king milub a address, ala ya.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Me-mali ya ing pamag-pirma king mensayi .</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Me-pirman ne ing mensayi.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>Ing pirma ali ya bisang ma-decode.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Maliaring pakilawe pasibayu ing pirma kaibat pasibayuan ya iti.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>Ing pirma ali ya makatugma king message digest.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Me-mali ya ing pamag-beripika king mensayi.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Me-beripika ne ing mensayi.</translation> </message> </context> <context> <name>SingleColumnAccountModel</name> <message> <location filename="../accountmodel.cpp" line="+241"/> <location line="+4"/> <source>All Accounts</source> <translation type="unfinished"></translation> </message> </context> <context> <name>TabbedDateWidget</name> <message> <location filename="../forms/tabbeddatewidget.ui" line="+20"/> <source>TabWidget</source> <translation type="unfinished"></translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+19"/> <source>Open until %1</source> <translation>Makabuklat anggang %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"></translation> </message> <message> <location line="+2"/> <source>%1/offline</source> <translation>%1/offline</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/ali me-kumpirma</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 kumpirmasion</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Kabilian</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation type="unfinished"> <numerusform></numerusform> </translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Kaaldauan</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Pikuanan</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Megawa</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>Menibat</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Para kang</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>sariling address</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>label</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Credit</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation type="unfinished"> <numerusform></numerusform> </translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>ali metanggap</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Debit</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Bayad king Transaksion</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Alaga dareng eganagana</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Mensayi</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Komentu</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>ID ning Transaksion</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 510 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 &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Impormasion ning Debug</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transaksion</translation> </message> <message> <location line="+5"/> <source>Inputs</source> <translation type="unfinished"></translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Alaga</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>tutu</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>e tutu</translation> </message> <message> <location line="-211"/> <source>, has not been successfully broadcast yet</source> <translation>, eya matagumpeng mibalita</translation> </message> <message> <location line="+35"/> <source>unknown</source> <translation>e miya balu</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Detalye ning Transaksion</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Ining pane a ini magpakit yang detalyadung description ning transaksion</translation> </message> </context> <context> <name>TransactionFilterWidget</name> <message> <location filename="../forms/transactionfilterwidget.ui" line="+20"/> <source>Frame</source> <translation type="unfinished"></translation> </message> <message> <location line="+21"/> <source> or jump to</source> <translation type="unfinished"></translation> </message> <message> <location line="+14"/> <source>Show</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <source>Recent Transactions</source> <translation type="unfinished"></translation> </message> <message> <location line="+30"/> <source>Export</source> <translation type="unfinished"></translation> </message> <message> <location line="+19"/> <source>Search by keyword</source> <translation type="unfinished"></translation> </message> <message> <location line="+7"/> <source>...</source> <translation type="unfinished"></translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+326"/> <source>Date</source> <translation>Kaaldauan</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Klase</translation> </message> <message> <source>Address</source> <translation type="obsolete">Address</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Alaga</translation> </message> <message> <location line="+67"/> <source>Open until %1</source> <translation>Makabuklat anggang %1</translation> </message> <message> <location line="+12"/> <source>Confirmed (%1 confirmations)</source> <translation>Me-kumpirma(%1 kumpirmasion)</translation> </message> <message numerus="yes"> <location line="-15"/> <source>Open for %n more block(s)</source> <translation type="unfinished"> <numerusform></numerusform> </translation> </message> <message> <location line="-64"/> <source>From account</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>To account</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>Account Name</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>Balance</source> <translation type="unfinished"></translation> </message> <message> <location line="+70"/> <source>Offline</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>Unconfirmed</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation type="unfinished"></translation> </message> <message> <location line="+6"/> <source>Conflicted</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Ing block a ini ali de atanggap deng aliwa pang nodes ania ali ya magsilbing tanggapan</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Me-generate ya oneng ali ya metanggap</translation> </message> <message> <location line="+42"/> <location line="+2"/> <source>Received</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>Sent</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>Internal Transfer</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Interest</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Fee</source> <translation type="unfinished"></translation> </message> <message> <location line="+569"/> <source>Destination account of transaction.</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Source account of transaction.</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Account for transaction.</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Other account for transaction.</source> <translation type="unfinished"></translation> </message> <message> <location line="+4"/> <source>Account balance at end of transaction.</source> <translation type="unfinished"></translation> </message> <message> <source>Received with</source> <translation type="obsolete">Atanggap kayabe ning</translation> </message> <message> <source>Received from</source> <translation type="obsolete">Atanggap menibat kang</translation> </message> <message> <source>Sent to</source> <translation type="obsolete">Mipadala kang</translation> </message> <message> <source>Payment to yourself</source> <translation type="obsolete">Kabayaran keka</translation> </message> <message> <source>Mined</source> <translation type="obsolete">Me-mina</translation> </message> <message> <location line="-539"/> <location line="+19"/> <location line="+19"/> <location line="+19"/> <source>(n/a)</source> <translation>(n/a)</translation> </message> <message> <location line="+466"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Status ning Transaksion: Itapat me babo na ning field a ini ban ipakit dala reng bilang dareng me-kumpirma na</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Aldo at oras nung kapilan me tanggap ya ing transaksion</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Klase ning transaksion</translation> </message> <message> <source>Destination address of transaction.</source> <translation type="obsolete">Kepuntalan a address ning transaksion</translation> </message> <message> <location line="+10"/> <source>Amount removed from or added to balance.</source> <translation>Alagang milako o miragdag king balanse.</translation> </message> </context> <context> <name>TransactionView</name> <message> <source>All</source> <translation type="obsolete">Eganagana</translation> </message> <message> <source>Today</source> <translation type="obsolete">Aldo iti</translation> </message> <message> <source>This week</source> <translation type="obsolete">Paruminggung iti</translation> </message> <message> <source>This month</source> <translation type="obsolete">Bulan a iti</translation> </message> <message> <source>Last month</source> <translation type="obsolete">Milabas a bulan</translation> </message> <message> <source>This year</source> <translation type="obsolete">Banuang iti</translation> </message> <message> <source>Range...</source> <translation type="obsolete">Angganan...</translation> </message> <message> <source>Received with</source> <translation type="obsolete">Atanggap kayabe ning</translation> </message> <message> <source>Sent to</source> <translation type="obsolete">Mipadala kang</translation> </message> <message> <source>To yourself</source> <translation type="obsolete">Keng sarili mu</translation> </message> <message> <source>Mined</source> <translation type="obsolete">Me-mina</translation> </message> <message> <source>Other</source> <translation type="obsolete">Aliwa</translation> </message> <message> <source>Enter address or label to search</source> <translation type="obsolete">Magpalub kang address o label para pantunan</translation> </message> <message> <source>Min amount</source> <translation type="obsolete">Pekaditak a alaga</translation> </message> <message> <location filename="../transactionview.cpp" line="+65"/> <source>Copy address</source> <translation>Kopyan ing address</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Kopyan ing label</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Kopyan ing alaga</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Alilan ing label</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Ipakit ing detalye ning transaksion</translation> </message> <message> <location line="+1"/> <source>Show transaction in blockchain explorer</source> <translation type="unfinished"></translation> </message> <message> <location line="+57"/> <source>Export Transaction Data</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Comma separated file (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Me-kumpirma</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Kaaldauan</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Klase</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Label</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Address</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Alaga</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation type="unfinished"></translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"></translation> </message> <message> <source>Range:</source> <translation type="obsolete">Angga:</translation> </message> <message> <source>to</source> <translation type="obsolete">para kang</translation> </message> </context> <context> <name>TransferPage</name> <message> <location filename="../forms/transferpage.ui" line="+14"/> <source>Frame</source> <translation type="unfinished"></translation> </message> <message> <location line="+22"/> <source>Transfers</source> <translation type="unfinished"></translation> </message> <message> <location line="+16"/> <source>Address Book</source> <translation type="unfinished"></translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+501"/> <source>Sending...</source> <translation type="unfinished"></translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+33"/> <source>Pandacoin version</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Usage:</source> <translation>Pamanggamit:</translation> </message> <message> <location line="+1"/> <source>Send command to -server or pandacoind</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>List commands</source> <translation>Listahan dareng commands</translation> </message> <message> <location line="+1"/> <source>Get help for a command</source> <translation>Maniauad saup para kareng command</translation> </message> <message> <location line="+2"/> <source>Options:</source> <translation>Pipamilian:</translation> </message> <message> <location line="+2"/> <source>Specify configuration file (default: pandacoin.conf)</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Specify pid file (default: pandacoind.pid)</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Specify wallet file (within data directory)</source> <translation type="unfinished"></translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Pilinan ing data directory</translation> </message> <message> <location line="+2"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Ilage ya ing dagul o lati na ing database cache king megabytes (default: 25)</translation> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation type="unfinished"></translation> </message> <message> <location line="+6"/> <source>Listen for connections on &lt;port&gt; (default: 15714 or testnet: 25714)</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Mag-maintain peka &lt;n&gt; koneksion keng peers (default: 125)</translation> </message> <message> <location line="+3"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Kumunekta king note ban ayakua mula reng peer address, at mako king panga konekta</translation> </message> <message> <location line="+1"/> <source>Specify your own public address</source> <translation>Sabyan me ing kekang pampublikong address</translation> </message> <message> <location line="+5"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Stake your coins to support network and gain reward (default: 1)</source> <translation type="unfinished"></translation> </message> <message> <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Threshold for disconnecting misbehaving peers (default: 100)</translation> </message> <message> <location line="+1"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</translation> </message> <message> <location line="-44"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Atin kamalian a milyari kabang ayusan ya ing RPC port %u para keng pamakiramdam king IPv4: %s</translation> </message> <message> <location line="+51"/> <source>Detach block and address databases. Increases shutdown time (default: 0)</source> <translation type="unfinished"></translation> </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"></translation> </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"></translation> </message> <message> <location line="-87"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 22444 or testnet: 25715)</source> <translation type="unfinished"></translation> </message> <message> <location line="-11"/> <source>Accept command line and JSON-RPC commands</source> <translation>Tumanggap command line at JSON-RPC commands</translation> </message> <message> <location line="+101"/> <source>Error: Transaction creation failed </source> <translation type="unfinished"></translation> </message> <message> <location line="-5"/> <source>Error: Wallet locked, unable to create transaction </source> <translation type="unfinished"></translation> </message> <message> <location line="-8"/> <source>Importing blockchain data file.</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Importing bootstrap blockchain data file.</source> <translation type="unfinished"></translation> </message> <message> <location line="-88"/> <source>Run in the background as a daemon and accept commands</source> <translation>Gumana king gulut bilang daemon at tumanggap commands</translation> </message> <message> <location line="+1"/> <source>Use the test network</source> <translation>Gamitan ing test network</translation> </message> <message> <location line="-24"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Tumanggap koneksion menibat king kilwal (default: 1 if no -proxy or -connect)</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"></translation> </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"></translation> </message> <message> <location line="-20"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"></translation> </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>Kapabaluan: Sobra ya katas ing makalage king -paytxfee. Ini ing maging bayad mu para king bayad na ning transaksion istung pepadala me ing transaksion a ini.</translation> </message> <message> <location line="+61"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong Pandacoin will not work properly.</source> <translation type="unfinished"></translation> </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"></translation> </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"></translation> </message> <message> <location line="-30"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"></translation> </message> <message> <location line="+4"/> <source>Block creation options:</source> <translation>Pipamilian king pamag-gawang block:</translation> </message> <message> <location line="-62"/> <source>Connect only to the specified node(s)</source> <translation>Kumunekta mu king mepiling node(s)</translation> </message> <message> <location line="+4"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>I-discover ing sariling IP address (default: 1 istung makiramdam at -externalip)</translation> </message> <message> <location line="+94"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Memali ya ing pamakiramdam kareng gang nanung port. Gamita me ini -listen=0 nung buri me ini.</translation> </message> <message> <location line="-90"/> <source>Find peers using DNS lookup (default: 1)</source> <translation type="unfinished"></translation> </message> <message> <location line="+5"/> <source>Sync checkpoints policy (default: strict)</source> <translation type="unfinished"></translation> </message> <message> <location line="+83"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"></translation> </message> <message> <location line="+4"/> <source>Invalid amount for -reservebalance=&lt;amount&gt;</source> <translation type="unfinished"></translation> </message> <message> <location line="-82"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation type="unfinished"></translation> </message> <message> <location line="-16"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation type="unfinished"></translation> </message> <message> <location line="+28"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Prepend debug output with timestamp</source> <translation type="unfinished"></translation> </message> <message> <location line="+35"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation>Pipamilian ning SSL: (lawen ye ing Bitcoin Wiki para king SSL setup instructions)</translation> </message> <message> <location line="-74"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"></translation> </message> <message> <location line="+41"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Magpadalang trace/debug info okeng console kesa keng debug.log file</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"></translation> </message> <message> <location line="+28"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"></translation> </message> <message> <location line="-1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Ilage ing pekaditak a dagul na ning block king bytes (default: 0)</translation> </message> <message> <location line="-29"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation type="unfinished"></translation> </message> <message> <location line="-42"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation type="unfinished"></translation> </message> <message> <location line="+109"/> <source>Unable to sign checkpoint, wrong checkpointkey? </source> <translation type="unfinished"></translation> </message> <message> <location line="-80"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation type="unfinished"></translation> </message> <message> <location line="-1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation type="unfinished"></translation> </message> <message> <location line="-25"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"></translation> </message> <message> <location line="+42"/> <source>Username for JSON-RPC connections</source> <translation>Username para king JSON-RPC koneksion</translation> </message> <message> <location line="+47"/> <source>Verifying database integrity...</source> <translation type="unfinished"></translation> </message> <message> <location line="+57"/> <source>WARNING: syncronized checkpoint violation detected, but skipped!</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Warning: Disk space is low!</source> <translation type="unfinished"></translation> </message> <message> <location line="-2"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Kapabaluan: Ing bersioin a ini laus ne, kailangan nang mag-upgrade!</translation> </message> <message> <location line="-48"/> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"></translation> </message> <message> <location line="-54"/> <source>Password for JSON-RPC connections</source> <translation>Password para king JSON-RPC koneksion</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=pandacoinrpc 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 &quot;Pandacoin Alert&quot; admin@foo.com </source> <translation type="unfinished"></translation> </message> <message> <location line="+51"/> <source>Find peers using internet relay chat (default: 0)</source> <translation type="unfinished"></translation> </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"></translation> </message> <message> <location line="+15"/> <source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source> <translation type="unfinished"></translation> </message> <message> <location line="+16"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Payagan ya i JSON-RPC koneksion para king metung a IP address</translation> </message> <message> <location line="+1"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Magpadalang command king node a gagana king &lt;ip&gt;(default: 127.0.0.1)</translation> </message> <message> <location line="+1"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>I-execute ing command istung mialilan ya ing best block (%s in cmd is replaced by 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 type="unfinished"></translation> </message> <message> <location line="+3"/> <source>Require a confirmations for change (default: 0)</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source> <translation type="unfinished"></translation> </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"></translation> </message> <message> <location line="+3"/> <source>Upgrade wallet to latest format</source> <translation>I-upgrade ing wallet king pekabayung porma</translation> </message> <message> <location line="+1"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>I-set ing key pool size king &lt;n&gt;(default: 100)</translation> </message> <message> <location line="+1"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>I-scan pasibayu ing block chain para kareng mauaualang transaksion</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 2500, 0 = all)</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Imports blocks from external blk000?.dat file</source> <translation type="unfinished"></translation> </message> <message> <location line="+8"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Gumamit OpenSSL(https) para king JSON-RPC koneksion</translation> </message> <message> <location line="+1"/> <source>Server certificate file (default: server.cert)</source> <translation>Server certificate file (default: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Server private key (default: server.pem)</translation> </message> <message> <location line="+1"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation type="unfinished"></translation> </message> <message> <location line="+53"/> <source>Error: Wallet unlocked for staking only, unable to create transaction.</source> <translation type="unfinished"></translation> </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"></translation> </message> <message> <location line="-158"/> <source>This help message</source> <translation>Ining saup a mensayi</translation> </message> <message> <location line="+95"/> <source>Wallet %s resides outside data directory %s.</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Cannot obtain a lock on data directory %s. Pandacoin is probably already running.</source> <translation type="unfinished"></translation> </message> <message> <location line="-98"/> <source>Pandacoin</source> <translation type="unfinished"></translation> </message> <message> <location line="+140"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Ali ya magsilbing mag-bind keng %s kening kompyuter a ini (bind returned error %d, %s)</translation> </message> <message> <location line="-130"/> <source>Connect through socks proxy</source> <translation type="unfinished"></translation> </message> <message> <location line="+3"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Payagan ing pamaglawe DNS para king -addnode, -seednode and -connect</translation> </message> <message> <location line="+122"/> <source>Loading addresses...</source> <translation>Lo-load da ne ing address...</translation> </message> <message> <location line="-15"/> <source>Error loading blkindex.dat</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Me-mali ya ing pamag-load king wallet.dat: Me-corrupt ya ing wallet</translation> </message> <message> <location line="+4"/> <source>Error loading wallet.dat: Wallet requires newer version of Pandacoin</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Wallet needed to be rewritten: restart Pandacoin to complete</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat</source> <translation>Me-mali ya ing pamag-load king wallet.dat</translation> </message> <message> <location line="-16"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Ali katanggap-tanggap a -proxy addresss: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>E kilalang network ing mepili king -onlynet: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>E kilalang -socks proxy version requested: %i</translation> </message> <message> <location line="+4"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Eya me-resolve ing -bind address: &apos;%s&apos;</translation> </message> <message> <location line="+2"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Eya me-resolve ing -externalip address: &apos;%s&apos;</translation> </message> <message> <location line="-24"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Eya maliari ing alaga keng -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Error: could not start node</source> <translation type="unfinished"></translation> </message> <message> <location line="+11"/> <source>Sending...</source> <translation type="unfinished"></translation> </message> <message> <location line="+5"/> <source>Invalid amount</source> <translation>Ing alaga e ya katanggap-tanggap</translation> </message> <message> <location line="+1"/> <source>Insufficient funds</source> <translation>Kulang a pondo</translation> </message> <message> <location line="-34"/> <source>Loading block index...</source> <translation>Lo-load dane ing block index...</translation> </message> <message> <location line="-103"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Magdagdag a node ban kumunekta at subuknan apanatili yang makabuklat ing koneksion</translation> </message> <message> <location line="+122"/> <source>Unable to bind to %s on this computer. Pandacoin is probably already running.</source> <translation type="unfinished"></translation> </message> <message> <location line="-97"/> <source>Fee per KB to add to transactions you send</source> <translation type="unfinished"></translation> </message> <message> <location line="+55"/> <source>Invalid amount for -mininput=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"></translation> </message> <message> <location line="+25"/> <source>Loading wallet...</source> <translation>Lo-load dane ing wallet...</translation> </message> <message> <location line="+8"/> <source>Cannot downgrade wallet</source> <translation>Ali ya magsilbing i-downgrade ing wallet</translation> </message> <message> <location line="+1"/> <source>Cannot initialize keypool</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> <source>Cannot write default address</source> <translation>Eya misulat ing default address</translation> </message> <message> <location line="+1"/> <source>Rescanning...</source> <translation>I-scan deng pasibayu...</translation> </message> <message> <location line="+5"/> <source>Done loading</source> <translation>Yari ne ing pamag-load</translation> </message> <message> <location line="-167"/> <source>To use the %s option</source> <translation>Para agamit ing %s a pimamilian</translation> </message> <message> <location line="+14"/> <source>Error</source> <translation>Mali</translation> </message> <message> <location line="+6"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Dapat meng ilage ing rpcpassword=&lt;password&gt; king configuration file: %s Nung ing file ala ya, gawa ka gamit ing owner-readable-only file permissions.</translation> </message> </context> </TS>
mit
mchekin/rpg
resources/js/bootstrap.js
1742
window._ = require('lodash'); /** * We'll load jQuery and the Bootstrap jQuery plugin which provides support * for JavaScript based Bootstrap features such as modals and tabs. This * code may be modified to fit the specific needs of your application. */ try { window.Popper = require('popper.js').default; window.$ = window.jQuery = require('jquery'); require('bootstrap'); } catch (e) {} /** * We'll load the axios HTTP library which allows us to easily issue requests * to our Laravel back-end. This library automatically handles sending the * CSRF token as a header based on the value of the "XSRF" token cookie. */ window.axios = require('axios'); window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; /** * Next we will register the CSRF Token as a common header with Axios so that * all outgoing HTTP requests automatically have it attached. This is just * a simple convenience so we don't have to attach every token manually. */ let token = document.head.querySelector('meta[name="csrf-token"]'); if (token) { window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; } else { console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); } /** * Echo exposes an expressive API for subscribing to channels and listening * for events that are broadcast by Laravel. Echo and event broadcasting * allows your team to easily build robust real-time web applications. */ // import Echo from 'laravel-echo'; // window.Pusher = require('pusher-js'); // window.Echo = new Echo({ // broadcaster: 'pusher', // key: process.env.MIX_PUSHER_APP_KEY, // cluster: process.env.MIX_PUSHER_APP_CLUSTER, // forceTLS: true // });
mit
Squama/Master
AdminEAP-web/src/main/java/com/radish/master/entity/volumePay/ReimburseDet.java
2086
package com.radish.master.entity.volumePay; import com.cnpc.framework.annotation.Header; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import org.hibernate.annotations.GenericGenerator; import org.springframework.format.annotation.DateTimeFormat; import javax.persistence.*; import java.io.Serializable; import java.util.Date; //报销明细表 @Entity @Table(name ="tbl_reimburseDet") @JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler", "fieldHandler" }) public class ReimburseDet implements Serializable { /** * */ private static final long serialVersionUID = 1L; /** * 主键ID自动生成策略 */ @Id @GenericGenerator(name = "id", strategy = "uuid") @GeneratedValue(generator = "id") @Column(name = "id", length = 64) private String id; @Header(name = "报销内码") @Column(name = "reimburseId") private String reimburseId; @Header(name = "发票编号") @Column(name = "fpnumber") private String fpnumber; @Header(name = "发票类型") @Column(name = "fptype") private String fptype; @Header(name = "发票金额") @Column(name = "fpmoney") private String fpmoney; @Header(name = "备注") @Column(name = "remark") private String remark; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getReimburseId() { return reimburseId; } public void setReimburseId(String reimburseId) { this.reimburseId = reimburseId; } public String getFpnumber() { return fpnumber; } public void setFpnumber(String fpnumber) { this.fpnumber = fpnumber; } public String getFptype() { return fptype; } public void setFptype(String fptype) { this.fptype = fptype; } public String getFpmoney() { return fpmoney; } public void setFpmoney(String fpmoney) { this.fpmoney = fpmoney; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } }
mit
zhipenglin/pc-components
build/webpack.var.config.js
304
/** * Created by Administrator on 2016/5/23. */ var path=require('path'); var ROOT_PATH=path.resolve(__dirname,'../'), APP_PATH=path.resolve(ROOT_PATH,'src'), BUILD_PATH=path.resolve(ROOT_PATH,'dist'); module.exports={ ROOT_PATH:ROOT_PATH, APP_PATH:APP_PATH, BUILD_PATH:BUILD_PATH }
mit
JosiasMattiole/CursoJavaAvancado
webschool/app/config/webpack.common.js
1802
const webpack = require('webpack'); const path = require('path'); // plugins const HtmlWebpackPlugin = require('html-webpack-plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); exports.config = { entry: { main: './src/index.js', }, output: { sourceMapFilename: '[name].map', chunkFilename: '[id].[hash:20].js', }, resolve: { alias: { '@views': path.resolve(__dirname, './../src/webschool/views') } }, module: { rules: [{ test: /\.js$/, loader: 'babel-loader', options: { presets: ['env'] }, exclude: /node_modules/ }, { test: /\.html$/, loader: 'raw-loader' }, { test: /\.(eot|svg)$/, loader: 'file-loader?name=assets/[name].[hash:20].[ext]', }, { test: /\.(jpg|png|gif|otf|ttf|woff|woff2|cur|ani)$/, loader: 'url-loader?name=assets/[name].[hash:20].[ext]&limit=10000', }, { test: /\.css$/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader' }), include: /node_modules/ }, { test: /\.scss$/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'sass-loader' }), include: /node_modules/ }] }, plugins: [ new HtmlWebpackPlugin({ template: './src/index.html', chunksSortMode: 'dependency', }), new ExtractTextPlugin('styles.css'), new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery', 'window.jQuery': 'jquery', Popper: ['popper.js', 'default'] }) ], devServer: { stats: 'minimal', port: 9001 }, stats: { assets: true, children: false, errors: true, errorDetails: true, modules: false, warnings: false, } };
mit
igonzaleztrujillo/angular-require-skeleton
src/js/app.js
800
define(['jQuery', 'angular', 'angularResource', 'uiRouter', 'controller1', 'controller2', 'templates' ], function($, angular, angularResource, uiRouter, controller1, controller2) { 'use strict'; var app = angular.module('app', ['ngResource', 'ui.router', 'templates']); app.config(/* @ngInject */ function($urlRouterProvider, $stateProvider) { $urlRouterProvider.otherwise('/'); $stateProvider .state('state1', { url: '/', templateUrl: 'partial/view1.html', }) .state('state2', { url: '/state2', templateUrl: 'partial/view2.html', }); }); app.controller('Controller1', controller1); app.controller('Controller2', controller2); return app; } );
mit
islinjr/My-Project
nalanda/adminpanel/aplikasi/pmb_diterima_jenkel.php
5110
<h3>PMB Online</h3> <div class="isikanan"><!--Awal class isi kanan--> <div class="judulisikanan"> <div class="menuhorisontalaktif-ujung"><a href="pmb_online.php">Pendaftar</a></div> <div class="menuhorisontal"><a href="pmb_diterima.php">Diterima</a></div> <div class="menuhorisontal"><a href="pmb_setting.php">Pengaturan</a></div> </div> <div class="atastabel" style="margin: 30px 10px 0 10px"> <div class="tombol"> <?php $pendaftar=mysql_query("SELECT * FROM sh_psb WHERE status_psb='1'"); $jmlpendaftar=mysql_num_rows($pendaftar); $pendaftarlaki=mysql_query("SELECT * FROM sh_psb WHERE status_psb='1' AND jenkel='L'"); $jmllaki=mysql_num_rows($pendaftarlaki); $pendaftarperempuan=mysql_query("SELECT * FROM sh_psb WHERE status_psb='1' AND jenkel='P'"); $jmlperempuan=mysql_num_rows($pendaftarperempuan); ?> <a href="psb_diterima.php">Jumlah data</a> (<?php echo "$jmlpendaftar";?>)&nbsp;&nbsp;| <a href="<?php echo"?pilih=jenkel&kode=L";?>">Laki-Laki</a> (<?php echo "$jmllaki";?>)&nbsp;&nbsp;| <a href="<?php echo"?pilih=jenkel&kode=P";?>">Perempuan</a> (<?php echo "$jmlperempuan";?>) </div> <div class="cari"> <form method="POST" action="?pilih=pencarian"> <input type="text" class="pencarian" name="cari"><input type="submit" class="pencet" value="Cari"> </form> </div> </div> <?php if ($_GET[kode]=='L'){ echo "<form method='POST' action='$database?pilih=laki&untukdi=hapusbanyak'>";} else { echo "<form method='POST' action='$database?pilih=perempuan&untukdi=hapusbanyak'>"; }?> <div class="atastabel" style="margin-bottom: 10px"> <div class="tombol"> <input type="submit" class="hapus" value="Hapus yang ditandai"> </div> <div class="cari"> </div> </div> <div class="clear"></div> <table class="tabel" id="results"> <tr> <th class="tabel" width="25px">No</th> <th class="tabel" width="25px">&nbsp;</th> <th class="tabel">No. Reg</th> <th class="tabel">Nama Pendaftar</th> <th class="tabel">NEM</th> <th class="tabel">JK</th> <th class="tabel">Sekolah Asal</th> <th class="tabel">Tanggal Daftar</th> <th class="tabel" width="150px">Pilihan</th> </tr> <?php $no=1; $psb=mysql_query("SELECT * FROM sh_psb WHERE status_psb='1' AND jenkel='$_GET[kode]' ORDER BY id_psb DESC"); $cek_psb=mysql_num_rows($psb); if($cek_psb > 0){ while($p=mysql_fetch_array($psb)){ ?> <tr class="tabel"> <td class="tabel"><?php echo "$no";?></td> <td class="tabel"><?php echo "<input type=checkbox name=cek[] value=$p[id_psb] id=id$no>"; ?></td> <td class="tabel"><?php echo "$p[id_psb]";?></td> <td class="tabel"><a href="<?php echo"?pilih=edit&id=$p[id_psb]";?>"><b><?php echo "$p[nama_psb]";?></b></a></td> <td class="tabel"><?php echo "$p[nem]";?></td> <td class="tabel"><?php echo "$p[jenkel]";?></td> <td class="tabel"><?php echo "$p[sekolah_asal]";?></td> <td class="tabel"><a href=""><?php echo "$p[tanggal_psb]";?></a></td> <td class="tabel"> <?php if ($_GET[kode]=='L'){ ?> <div class="hapusdata"><a href="<?php echo"$database?pilih=laki&untukdi=hapus&id=$p[id_psb]";?>">hapus</a></div> <div class="editdata"><a href="<?php echo"?pilih=edit&id=$p[id_psb]";?>">edit</a></div> <?php if ($p[status_psb]==0){ ?> <div class="terbitdata"><a href="<?php echo"$database?pilih=laki&untukdi=terima&id=$p[id_psb]";?>">terima</a></div> <?php } else { ?> <div class="bataldata"><a href="<?php echo"$database?pilih=laki&untukdi=tolak&id=$p[id_psb]";?>">tolak</a></div> <?php } } else {?> <div class="hapusdata"><a href="<?php echo"$database?pilih=perempuan&untukdi=hapus&id=$p[id_psb]";?>">hapus</a></div> <div class="editdata"><a href="<?php echo"?pilih=edit&id=$p[id_psb]";?>">edit</a></div> <?php if ($p[status_psb]==0){ ?> <div class="terbitdata"><a href="<?php echo"$database?pilih=perempuan&untukdi=terima&id=$p[id_psb]";?>">terima</a></div> <?php } else { ?> <div class="bataldata"><a href="<?php echo"$database?pilih=perempuan&untukdi=tolak&id=$p[id_psb]";?>">tolak</a></div> <?php }} ?> </td> </tr> <?php $no++; }} else { ?> <tr class="tabel"><td class="tabel" colspan="9"><b>DATA PENDAFTAR <u> <?php if ($_GET[kode]=='L') { echo "Laki-laki"; } else { echo "Perempuan"; } ?></u> BELUM TERSEDIA</b></td></tr> <?php } ?> </table> <div class="atastabel" style="margin: 5px 10px 0 10px"> <div id="pageNavPosition"></div> </div> <div class="atastabel" style="margin: 5px 10px 0 10px"> <?php $jumlahtampil=mysql_query("SELECT * FROM sh_pengaturan WHERE id_pengaturan='3'"); $jt=mysql_fetch_array($jumlahtampil); ?> <script type="text/javascript"><!-- var pager = new Pager('results', <?php echo "$jt[isi_pengaturan]"; ?>); pager.init(); pager.showPageNav('pager', 'pageNavPosition'); pager.showPage(1); //--></script> </div> </form> </div><!--Akhir class isi kanan-->
mit
testributor/katana
test/features/test_run_index_feature_test.rb
1148
require 'test_helper' class TestRunIndexFeatureTest < Capybara::Rails::TestCase describe 'when visiting the TestRun#index ' do let(:tracked_branch) { FactoryGirl.create(:tracked_branch) } before do count = 0 start_id = 20000 while count < 10 do test_run = FactoryGirl.build(:testributor_run, project_id: tracked_branch.project_id, tracked_branch_id: tracked_branch.id) test_run.id = start_id count += 1 if test_run.save start_id += 1 end login_as tracked_branch.project.user, scope: :user end it 'should display run indexes (not ids) for each test run', js: true do visit project_test_runs_path(tracked_branch.project_id, branch: tracked_branch.branch_name) page.must_have_content('#1') page.must_have_content('#2') page.must_have_content('#3') page.must_have_content('#4') page.must_have_content('#5') page.must_have_content('#6') page.must_have_content('#7') page.must_have_content('#8') page.must_have_content('#9') page.must_have_content('#10') end end end
mit
jipiboily/forwardlytics-ruby
lib/forwardlytics/track.rb
255
module Forwardlytics def self.track(event:, user_id:, properties: {}) params = { name: event, userID: user_id, properties: properties, timestamp: Time.now().to_i } t = Thread.new { post('/track', params) } end end
mit
goggle/backupper
Backupper/config.py
4264
import configparser import os HOME_DIRECTORY = os.path.expanduser('~') # Specify the possible paths to the config files. The first items in the list # have higher priorities: CONFIG_FILES = [os.path.join(HOME_DIRECTORY, '.config/backupper.conf'), '/etc/backupper.conf'] class Config: def __init__(self): hasConfig = False for elem in CONFIG_FILES: if os.path.isfile(elem): self.configFile = elem hasConfig = True break if not hasConfig: raise NoConfigFileException self.config = configparser.ConfigParser() self.config.read(self.configFile) if 'Default' not in self.config: raise NoDefaultSectionException if 'BackupDirectory' not in self.config['Default']: raise NoBackupDirectoryException if 'RecoveryDirectory' not in self.config['Default']: raise NoRecoveryDirectoryException if 'LogFile' not in self.config['Default']: raise NoLogFileException self.backupDirectory = self.config['Default']['BackupDirectory'] self.recoveryDirectory = self.config['Default']['RecoveryDirectory'] self.logFile = self.config['Default']['LogFile'] if not os.path.isdir(self.backupDirectory): raise NoBackupDirectoryException if not os.path.isdir(self.recoveryDirectory): raise NoRecoveryDirectoryException self.entries = [] hasSection = False for section in self.config.sections(): if section == 'Default': continue hasSection = True name = section if 'Directory' not in self.config[section]: raise InvalidSectionException if 'Compression' not in self.config[section]: raise InvalidSectionException directory = self.config[section]['Directory'] compressionType = self.config[section]['Compression'] if compressionType == 'tar': pass elif compressionType == 'gz': pass elif compressionType == 'gzip': compressionType = 'gz' elif compressionType == 'bz2': pass elif compressionType == 'bzip2': compressionType = 'bz2' elif compressionType == 'xz': pass else: raise InvalidCompressionException if not os.path.isdir(directory): raise InvalidDirectoryException entry = BackupEntry(name, directory, compressionType) self.entries.append(entry) if not hasSection: raise NoEntrySectionException def getBackupDirectory(self): return self.backupDirectory def getRecoveryDirectory(self): return self.recoveryDirectory def getLogFile(self): return self.logFile def getBackupEntries(self): return self.entries class BackupEntry: def __init__(self, name, directory, compressionType): self.name = name self.directory = directory self.compressionType = compressionType def getName(self): return self.name def getDirectory(self): return self.directory def getCompressionType(self): return self.compressionType def getFilenameExtension(self): if self.compressionType == 'tar': return '.tar' elif self.compressionType == 'gz': return '.tar.gz' elif self.compressionType == 'bz2': return '.tar.bz2' elif self.compressionType == 'xz': return '.tar.xz' else: raise InvalidCompressionException class NoConfigFileException(Exception): pass class NoDefaultSectionException(Exception): pass class NoBackupDirectoryException(Exception): pass class NoRecoveryDirectoryException(Exception): pass class NoLogFileException(Exception): pass class InvalidSectionException(Exception): pass class InvalidDirectoryException(Exception): pass class InvalidCompressionException(Exception): pass class NoEntrySectionException(Exception): pass
mit
typetools/annotation-tools
annotation-file-utilities/tests/GenericAnnoBound.java
188
import java.lang.annotation.*; @Target(ElementType.TYPE_USE) @interface Bla {} public class GenericAnnoBound<X extends @Bla Object> { GenericAnnoBound(GenericAnnoBound<X> n, X p) {} }
mit
leei/thinking-sphinx
lib/thinking_sphinx/deltas.rb
556
require 'thinking_sphinx/deltas/default_delta' require 'thinking_sphinx/deltas/delayed_delta' require 'thinking_sphinx/deltas/datetime_delta' module ThinkingSphinx module Deltas def self.parse(index, options) case options.delete(:delta) when TrueClass, :default DefaultDelta.new index, options when :delayed DelayedDelta.new index, options when :datetime DatetimeDelta.new index, options when FalseClass, nil nil else raise "Unknown delta type" end end end end
mit
shr1th1k/0fferc1t1
system/database/drivers/mysqli/mysqli_result.php
4750
<?php /** * CodeIgniter * * An open source app development framework for PHP * * This content is released under the MIT License (MIT) * * Copyright (c) 2014 - 2016, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * 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. * * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com * @since Version 1.3.0 * @filesource */ defined('BASEPATH') OR exit('No direct script access allowed'); /** * MySQLi Result Class * * This class extends the parent result class: CI_DB_result * * @package CodeIgniter * @subpackage Drivers * @category Database * @author EllisLab Dev Team * @link https://codeigniter.com/user_guide/database/ */ class CI_DB_mysqli_result extends CI_DB_result { /** * Number of rows in the result set * * @return int */ public function num_rows() { return is_int($this->num_rows) ? $this->num_rows : $this->num_rows = $this->result_id->num_rows; } // -------------------------------------------------------------------- /** * Number of fields in the result set * * @return int */ public function num_fields() { return $this->result_id->field_count; } // -------------------------------------------------------------------- /** * Fetch Field Names * * Generates an array of column names * * @return array */ public function list_fields() { $field_names = array(); $this->result_id->field_seek(0); while ($field = $this->result_id->fetch_field()) { $field_names[] = $field->name; } return $field_names; } // -------------------------------------------------------------------- /** * Field data * * Generates an array of objects containing field meta-data * * @return array */ public function field_data() { $retval = array(); $field_data = $this->result_id->fetch_fields(); for ($i = 0, $c = count($field_data); $i < $c; $i++) { $retval[$i] = new stdClass(); $retval[$i]->name = $field_data[$i]->name; $retval[$i]->type = $field_data[$i]->type; $retval[$i]->max_length = $field_data[$i]->max_length; $retval[$i]->primary_key = (int) ($field_data[$i]->flags & 2); $retval[$i]->default = $field_data[$i]->def; } return $retval; } // -------------------------------------------------------------------- /** * Free the result * * @return void */ public function free_result() { if (is_object($this->result_id)) { $this->result_id->free(); $this->result_id = FALSE; } } // -------------------------------------------------------------------- /** * Data Seek * * Moves the internal pointer to the desired offset. We call * this internally before fetching results to make sure the * result set starts at zero. * * @param int $n * @return bool */ public function data_seek($n = 0) { return $this->result_id->data_seek($n); } // -------------------------------------------------------------------- /** * Result - associative array * * Returns the result set as an array * * @return array */ protected function _fetch_assoc() { return $this->result_id->fetch_assoc(); } // -------------------------------------------------------------------- /** * Result - object * * Returns the result set as an object * * @param string $class_name * @return object */ protected function _fetch_object($class_name = 'stdClass') { return $this->result_id->fetch_object($class_name); } }
mit
JEG2/pdf-reader
examples/text.rb
898
#!/usr/bin/env ruby # coding: utf-8 # Extract all text from a single PDF class PageTextReceiver attr_accessor :content def initialize @content = [] end # Called when page parsing starts def begin_page(arg = nil) @content << "" end # record text that is drawn on the page def show_text(string, *params) @content.last << string.strip end # there's a few text callbacks, so make sure we process them all alias :super_show_text :show_text alias :move_to_next_line_and_show_text :show_text alias :set_spacing_next_line_show_text :show_text # this final text callback takes slightly different arguments def show_text_with_positioning(*params) params = params.first params.each { |str| show_text(str) if str.kind_of?(String)} end end receiver = PageTextReceiver.new pdf = PDF::Reader.file("somefile.pdf", receiver) puts receiver.content.inspect
mit
Derjik/LibMach
src/Point.cpp
1636
/* * Copyright (c) 2016 Julien "Derjik" Laurent <julien.laurent@engineer.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * 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. */ #include "../include/Mach/Point.hpp" #include <sstream> namespace Mach { using namespace std; /* * Point to string conversion used for easy-to-read display */ Point::operator string() const { ostringstream s; s << "[" << x << " , " << y << "]"; return s.str(); } /* * Manhattan distance between two Points */ unsigned distance(Point const & a, Point const & b) { unsigned d(0); d += (b.x - a.x) * (b.x - a.x); d += (b.y - a.y) * (b.y - a.y); return d; } }
mit
boyombo/django-stations
stations/parcel/urls.py
453
from django.conf.urls import url from parcel import views urlpatterns = [ url(r'register/$', views.register, name='parcel_register'), url(r'load/$', views.load, name='parcel_load'), url(r'arrival/$', views.arrival, name='parcel_arrival'), url(r'arrived/$', views.arrived_parcels, name='parcel_arrived'), url(r'pickup/(?P<id>\d+)/$', views.pickup, name='parcel_pickup'), url(r'status/$', views.status, name='parcel_status'), ]
mit
Malkovski/Telerik
DSA/Homework/Workshop1/JediMeditation/JediMeditationWithBag/Properties/AssemblyInfo.cs
1418
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("JediMeditationWithBag")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("JediMeditationWithBag")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("bdfa5320-b0d5-43a7-a9e9-eb7c6014cc60")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit