code stringlengths 3 1.05M | repo_name stringlengths 4 116 | path stringlengths 4 991 | language stringclasses 9 values | license stringclasses 15 values | size int32 3 1.05M |
|---|---|---|---|---|---|
'use strict';
//
// Third party modules.
//
module.exports = require('canihaz')({
location: __dirname,
dot: 'smithy'
});
| bigpipe/smithy | canihaz.js | JavaScript | mit | 126 |
<?php
/**
* Model for Pages within the CMS
*
* @author Chris
*/
class modelPage extends ormModelCsv implements hamleModel {
function setup() {
$this->openFile(__DIR__."/../../data/page.csv");
$this->fields = array(
new ormType_KeyInt("pageid"),
new ormType_String("title"),
new ormType_String("content"),
);
}
function hamleGet($key) {
try {
return $this->$key;
} catch (Exception $e) {
throw new hamleEx_NoKey("Unable to find Key ($key)");
}
}
function hamleExec($func, $args) {
throw new hamleEx_NoFunc("Not Enabled");
}
function hamleRel($rel, $typeTags) {
throw new hamleEx_NoFunc("Not Implemented");
}
}
?>
| cseufert/ormsiteshell | php/model/page.php | PHP | mit | 732 |
import path from 'path'
import inquirer from 'inquirer'
import downloadTwitterPhoto from './utils/download-twitter-photo'
inquirer.prompt([
{
name: 'twitter',
type: 'input',
message: 'Twitter handle?',
},
]).then(({twitter}) => {
const destinationPath = path.join(process.cwd(), 'data/contributors')
downloadTwitterPhoto(twitter, destinationPath)
})
| javascriptair/site | other/add-contributor.js | JavaScript | mit | 371 |
import {Component} from '@angular/core'
@Component({
selector: 'd-ausrq',
template: `
<span [attr.aria-label]="msg" [hidden]="false">This is a dummy component for Ausrq</span>
<div (click)="doNothing($event)"></div>
`,
})
export class Ausrq {
msg: string = 'nothing to say';
doNothing(evt: any) {}
}
| mlaval/optimize-angular-app | app/welcome/generated/ausrq.ts | TypeScript | mit | 326 |
'use strict';
angular.module('core').controller('HomeController', ['$scope', '$http', '$location', 'Authentication',
function($scope, $http, $location, Authentication) {
// =====================================================================
// Non $scope member
// =====================================================================
var init = function() {
$scope.authentication = Authentication;
};
init();
var redirectToHome = function(user) {
var location = '/';
if(user.roles.indexOf('admin') !== -1) {
location = '/admin/home';
} else if(user.roles.indexOf('ero') !== -1) {
location = '/ero/home';
} else if(user.roles.indexOf('resource') !== -1) {
location = '/resource/home';
}
$location.path(location);
};
if ($scope.authentication.user) {
redirectToHome($scope.authentication.user);
}
// =====================================================================
// $scope Member
// =====================================================================
$scope.prepare = function() {
$scope.credentials = {
email: null,
password: null
};
};
$scope.signin = function() {
$scope.authenticationPromise = $http.post('/api/auth/signin', $scope.credentials).success(function(response) {
$scope.authentication.user = response;
redirectToHome($scope.authentication.user);
}).error(function(response) {
$scope.error = response.message;
});
};
// =====================================================================
// Event listener
// =====================================================================
}
]);
| atriumxsis/atrium | public/modules/core/controllers/home.client.controller.js | JavaScript | mit | 1,639 |
import React, { useCallback, useState } from 'react';
import { css } from 'emotion';
import { Button, Col, Input, Row } from 'reactstrap';
import Localized from 'components/Localized/Localized';
import LocationsCount from 'components/LocationsCount/LocationsCount';
import { useTranslation } from 'react-i18next';
import { Link } from 'react-router-dom';
import { GoX } from 'react-icons/go';
import { useSelectAll } from 'selectors/selectAll';
import { logEvent } from 'utils/analytics';
import DefaultLocationsList from './DefaultLocationsList';
import CustomLocationsList from './CustomLocationsList';
import FilteredLocationsList from './FilteredLocationsList';
import ExportLocations from './ExportLocations';
import DownloadLocations from './DownloadLocations';
export const Settings = () => {
const [t] = useTranslation();
const [filter, setFilter] = useState('');
const { selectAllLocations, deselectAllLocations } = useSelectAll();
const onFilterChange = useCallback((event) => {
logEvent('LOCATIONS_FILTER');
setFilter(event.target.value);
}, []);
const onClearFilter = useCallback(() => {
logEvent('LOCATIONS_FILTER_CLEAR');
setFilter('');
}, []);
return (
<Row className={`${styles.container} justify-content-center`}>
<Col xs={12} md={10}>
<Row className={styles.locationsContainer}>
<Col className="text-center">
<h4><Localized name="interface.game_locations" /> (<LocationsCount />)</h4>
</Col>
</Row>
<Row className={`${styles.filterContainer} justify-content-center`}>
<Col className="text-center">
<Input placeholder={t('interface.filter')} value={filter} onChange={onFilterChange} />
{!!filter && <GoX className={`${styles.clearFilter} text-dark`} onClick={onClearFilter} />}
</Col>
</Row>
{!filter && (
<>
<DefaultLocationsList version={1} onSelectAll={selectAllLocations} onDeselectAll={deselectAllLocations} />
<DefaultLocationsList version={2} onSelectAll={selectAllLocations} onDeselectAll={deselectAllLocations} />
<CustomLocationsList onSelectAll={selectAllLocations} onDeselectAll={deselectAllLocations} />
</>
)}
{!!filter && <FilteredLocationsList filter={filter} />}
<ExportLocations />
<DownloadLocations />
<Row className={`${styles.backContainer} justify-content-center`}>
<Col xs={12} className="text-center">
<Link className={styles.backLink} to="/">
<Button color="danger" block><Localized name="interface.back_to_game" /></Button>
</Link>
</Col>
</Row>
</Col>
</Row>
);
};
const styles = {
container: css({
marginBottom: 50,
}),
locationsContainer: css({
marginTop: 20,
}),
filterContainer: css({
marginTop: 20,
}),
backContainer: css({
marginTop: 20,
}),
backLink: css({
textDecoration: 'none',
':hover': {
textDecoration: 'none',
},
}),
clearFilter: css({
position: 'absolute',
right: 25,
top: 8,
fontSize: 22,
cursor: 'pointer',
}),
};
export default React.memo(Settings);
| adrianocola/spyfall | app/containers/Settings/Settings.js | JavaScript | mit | 3,230 |
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTablePermissionRole extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('permission_role', function ($table) {
$table->increments('id')->unsigned();
$table->integer('permission_id')->unsigned();
$table->integer('role_id')->unsigned();
$table->foreign('permission_id')->references('id')->on('permissions'); // assumes a users table
$table->foreign('role_id')->references('id')->on('roles');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('permission_role');
}
}
| teruk/cpm | app/database/migrations/2015_01_04_063318_create_table_permission_role.php | PHP | mit | 767 |
import styled from 'styled-components';
export const Container = styled.div`
width: 100%;
height: 100%;
`;
export const EditorContainer = styled.div`
${''/* padding: 30px 30px; */}
width: 100%;
box-sizing: border-box;
position: relative;
font-family: 'Proxima-Nova', 'helvetica', 'arial';
box-sizing: border-box;
font-size: 21px;
color: #131517;
font-weight: 300;
line-height: 1.54;
& h1 {
font-size: 48px;
font-weight: bold;
letter-spacing: -.024em;
line-height: 1.18;
margin-bottom: 20px;
color: #131517;
}
& h2 {
font-size: 28px;
font-weight: normal;
letter-spacing: -.008em;
line-height: 1.24;
margin-bottom: 20px;
color: #797C80;
}
& ul {
padding-left: 24px;
${''/* list-style: none; */}
}
& ol {
padding-left: 24px;
${''/* list-style: none; */}
}
& li {
font-size: 21px;
line-height: 1,78;
}::selection {
background-color: #B1DFCB;
}
`;
| markdyousef/zen-editor | src/components/Editor/styles.js | JavaScript | mit | 1,090 |
/*globals rabbitmq_test_bindings: false,
rabbitmq_bindings_to_remove: false */
/*jslint mocha: true */
"use strict";
var expect = require('chai').expect,
util = require('util'),
Qlobber = require('..').Qlobber;
function QlobberTopicCount (options)
{
Qlobber.call(this, options);
this.topic_count = 0;
}
util.inherits(QlobberTopicCount, Qlobber);
QlobberTopicCount.prototype._initial_value = function (val)
{
this.topic_count += 1;
return Qlobber.prototype._initial_value(val);
};
QlobberTopicCount.prototype._remove_value = function (vals, val)
{
var removed = Qlobber.prototype._remove_value(vals, val);
if (removed)
{
this.topic_count -= 1;
}
return removed;
};
QlobberTopicCount.prototype.clear = function ()
{
this.topic_count = 0;
return Qlobber.prototype.clear.call(this);
};
describe('qlobber-topic-count', function ()
{
it('should be able to count topics added', function ()
{
var matcher = new QlobberTopicCount();
rabbitmq_test_bindings.forEach(function (topic_val)
{
matcher.add(topic_val[0], topic_val[1]);
});
expect(matcher.topic_count).to.equal(25);
rabbitmq_bindings_to_remove.forEach(function (i)
{
matcher.remove(rabbitmq_test_bindings[i-1][0],
rabbitmq_test_bindings[i-1][1]);
});
expect(matcher.topic_count).to.equal(21);
matcher.clear();
expect(matcher.topic_count).to.equal(0);
expect(matcher.match('a.b.c').length).to.equal(0);
});
it('should not decrement count if entry does not exist', function ()
{
var matcher = new QlobberTopicCount();
expect(matcher.topic_count).to.equal(0);
matcher.add('foo.bar', 23);
expect(matcher.topic_count).to.equal(1);
matcher.remove('foo.bar', 24);
expect(matcher.topic_count).to.equal(1);
matcher.remove('foo.bar2', 23);
expect(matcher.topic_count).to.equal(1);
matcher.remove('foo.bar', 23);
expect(matcher.topic_count).to.equal(0);
matcher.remove('foo.bar', 24);
expect(matcher.topic_count).to.equal(0);
matcher.remove('foo.bar2', 23);
expect(matcher.topic_count).to.equal(0);
});
});
| davedoesdev/qlobber | test/topic_count.js | JavaScript | mit | 2,315 |
/***********************************
This is our GPS library
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, check license.txt for more information
All text above must be included in any redistribution
****************************************/
#include "Adafruit_GPS.h"
#include "math.h"
#include <ctype.h>
// how long are max NMEA lines to parse?
#define MAXLINELENGTH 120
// we double buffer: read one line in and leave one for the main program
volatile char line1[MAXLINELENGTH];
volatile char line2[MAXLINELENGTH];
// our index into filling the current line
volatile uint8_t lineidx=0;
// pointers to the double buffers
volatile char *currentline;
volatile char *lastline;
volatile boolean recvdflag;
volatile boolean inStandbyMode;
boolean Adafruit_GPS::parse(char *nmea) {
// do checksum check
// first look if we even have one
if (nmea[strlen(nmea)-4] == '*') {
uint16_t sum = parseHex(nmea[strlen(nmea)-3]) * 16;
sum += parseHex(nmea[strlen(nmea)-2]);
// check checksum
for (uint8_t i=1; i < (strlen(nmea)-4); i++) {
sum ^= nmea[i];
}
if (sum != 0) {
// bad checksum :(
//return false;
Spark.publish("GPS", "{ error: \"bad checksum\"}", 60, PRIVATE );
}
}
// look for a few common sentences
if (strstr(nmea, "$GPGGA")) {
// found GGA
char *p = nmea;
// get time
p = strchr(p, ',')+1;
float timef = atof(p);
uint32_t time = timef;
hour = time / 10000;
minute = (time % 10000) / 100;
seconds = (time % 100);
milliseconds = fmod(timef, 1.0) * 1000;
// parse out latitude
p = strchr(p, ',')+1;
latitude = atof(p);
p = strchr(p, ',')+1;
if (p[0] == 'N') lat = 'N';
else if (p[0] == 'S') lat = 'S';
else if (p[0] == ',') lat = 0;
else return false;
// parse out longitude
p = strchr(p, ',')+1;
longitude = atof(p);
p = strchr(p, ',')+1;
if (p[0] == 'W') lon = 'W';
else if (p[0] == 'E') lon = 'E';
else if (p[0] == ',') lon = 0;
else return false;
p = strchr(p, ',')+1;
fixquality = atoi(p);
p = strchr(p, ',')+1;
satellites = atoi(p);
p = strchr(p, ',')+1;
HDOP = atof(p);
p = strchr(p, ',')+1;
altitude = atof(p);
p = strchr(p, ',')+1;
p = strchr(p, ',')+1;
geoidheight = atof(p);
return true;
}
if (strstr(nmea, "$GPRMC")) {
// found RMC
char *p = nmea;
// get time
p = strchr(p, ',')+1;
float timef = atof(p);
uint32_t time = timef;
hour = time / 10000;
minute = (time % 10000) / 100;
seconds = (time % 100);
milliseconds = fmod(timef, 1.0) * 1000;
p = strchr(p, ',')+1;
// Serial.println(p);
if (p[0] == 'A')
fix = true;
else if (p[0] == 'V')
fix = false;
else
return false;
// parse out latitude
p = strchr(p, ',')+1;
latitude = atof(p);
p = strchr(p, ',')+1;
if (p[0] == 'N') lat = 'N';
else if (p[0] == 'S') lat = 'S';
else if (p[0] == ',') lat = 0;
else return false;
// parse out longitude
p = strchr(p, ',')+1;
longitude = atof(p);
p = strchr(p, ',')+1;
if (p[0] == 'W') lon = 'W';
else if (p[0] == 'E') lon = 'E';
else if (p[0] == ',') lon = 0;
else return false;
// speed
p = strchr(p, ',')+1;
speed = atof(p);
// angle
p = strchr(p, ',')+1;
angle = atof(p);
p = strchr(p, ',')+1;
uint32_t fulldate = atof(p);
day = fulldate / 10000;
month = (fulldate % 10000) / 100;
year = (fulldate % 100);
// we dont parse the remaining, yet!
return true;
}
return false;
}
char Adafruit_GPS::read(void) {
char c = 0;
if (paused) return c;
#ifdef __AVR__
if(gpsSwSerial) {
if(!gpsSwSerial->available()) return c;
c = gpsSwSerial->read();
} else
#endif
{
if(!gpsHwSerial->available()) return c;
c = gpsHwSerial->read();
}
//Serial.print(c);
if (c == '$') {
currentline[lineidx] = 0;
lineidx = 0;
}
if (c == '\n') {
currentline[lineidx] = 0;
if (currentline == line1) {
currentline = line2;
lastline = line1;
} else {
currentline = line1;
lastline = line2;
}
//Serial.println("----");
//Serial.println((char *)lastline);
//Serial.println("----");
lineidx = 0;
recvdflag = true;
}
currentline[lineidx++] = c;
if (lineidx >= MAXLINELENGTH)
lineidx = MAXLINELENGTH-1;
return c;
}
#ifdef __AVR__
// Constructor when using SoftwareSerial or NewSoftSerial
#if ARDUINO >= 100
Adafruit_GPS::Adafruit_GPS(SoftwareSerial *ser)
#else
Adafruit_GPS::Adafruit_GPS(NewSoftSerial *ser)
#endif
{
common_init(); // Set everything to common state, then...
gpsSwSerial = ser; // ...override gpsSwSerial with value passed.
}
#endif
// Constructor when using HardwareSerial
Adafruit_GPS::Adafruit_GPS(Stream *ser) {
common_init(); // Set everything to common state, then...
gpsHwSerial = ser; // ...override gpsHwSerial with value passed.
}
// Initialization code used by all constructor types
void Adafruit_GPS::common_init(void) {
#ifdef __AVR__
gpsSwSerial = NULL; // Set both to NULL, then override correct
#endif
gpsHwSerial = NULL; // port pointer in corresponding constructor
recvdflag = false;
paused = false;
lineidx = 0;
currentline = line1;
lastline = line2;
hour = minute = seconds = year = month = day =
fixquality = satellites = 0; // uint8_t
lat = lon = mag = 0; // char
fix = false; // boolean
milliseconds = 0; // uint16_t
latitude = longitude = geoidheight = altitude =
speed = angle = magvariation = HDOP = 0.0; // float
}
void Adafruit_GPS::begin(uint16_t baud)
{
#ifdef __AVR__
if(gpsSwSerial)
gpsSwSerial->begin(baud);
else
gpsHwSerial->begin(baud);
#endif
delay(10);
}
void Adafruit_GPS::sendCommand(char *str) {
#ifdef __AVR__
if(gpsSwSerial)
gpsSwSerial->println(str);
else
#endif
gpsHwSerial->println(str);
}
boolean Adafruit_GPS::newNMEAreceived(void) {
return recvdflag;
}
void Adafruit_GPS::pause(boolean p) {
paused = p;
}
char *Adafruit_GPS::lastNMEA(void) {
recvdflag = false;
return (char *)lastline;
}
// read a Hex value and return the decimal equivalent
uint8_t Adafruit_GPS::parseHex(char c) {
if (c < '0')
return 0;
if (c <= '9')
return c - '0';
if (c < 'A')
return 0;
if (c <= 'F')
return (c - 'A')+10;
return 0;
}
boolean Adafruit_GPS::waitForSentence(char *wait4me, uint8_t max) {
char str[20];
uint8_t i=0;
while (i < max) {
if (newNMEAreceived()) {
char *nmea = lastNMEA();
strncpy(str, nmea, 20);
str[19] = 0;
i++;
if (strstr(str, wait4me))
return true;
}
}
return false;
}
boolean Adafruit_GPS::LOCUS_StartLogger(void) {
sendCommand(PMTK_LOCUS_STARTLOG);
recvdflag = false;
return waitForSentence(PMTK_LOCUS_LOGSTARTED);
}
boolean Adafruit_GPS::LOCUS_ReadStatus(void) {
sendCommand(PMTK_LOCUS_QUERY_STATUS);
if (! waitForSentence("$PMTKLOG"))
return false;
char *response = lastNMEA();
uint16_t parsed[10];
uint8_t i;
for (i=0; i<10; i++) parsed[i] = -1;
response = strchr(response, ',');
for (i=0; i<10; i++) {
if (!response || (response[0] == 0) || (response[0] == '*'))
break;
response++;
parsed[i]=0;
while ((response[0] != ',') && (response[0] != '*') && (response[0] != 0))
{
parsed[i] *= 10;
char c = response[0];
if (isdigit(c))
parsed[i] += c - '0';
else
parsed[i] = c;
response++;
}
}
LOCUS_serial = parsed[0];
LOCUS_type = parsed[1];
if (isalpha(parsed[2])) {
parsed[2] = parsed[2] - 'a' + 10;
}
LOCUS_mode = parsed[2];
LOCUS_config = parsed[3];
LOCUS_interval = parsed[4];
LOCUS_distance = parsed[5];
LOCUS_speed = parsed[6];
LOCUS_status = !parsed[7];
LOCUS_records = parsed[8];
LOCUS_percent = parsed[9];
return true;
}
// Standby Mode Switches
boolean Adafruit_GPS::standby(void) {
if (inStandbyMode) {
return false; // Returns false if already in standby mode, so that you do not wake it up by sending commands to GPS
}
else {
inStandbyMode = true;
sendCommand(PMTK_STANDBY);
//return waitForSentence(PMTK_STANDBY_SUCCESS); // don't seem to be fast enough to catch the message, or something else just is not working
return true;
}
}
boolean Adafruit_GPS::wakeup(void) {
if (inStandbyMode) {
inStandbyMode = false;
sendCommand(""); // send byte to wake it up
return waitForSentence(PMTK_AWAKE);
}
else {
return false; // Returns false if not in standby mode, nothing to wakeup
}
}
| sfugarino/Adafruit_GPS | firmware/Adafruit_GPS.cpp | C++ | mit | 8,875 |
<?php
namespace Kahlan\Spec\Suite\Jit\Patcher;
use Kahlan\Jit\Parser;
use Kahlan\Jit\Patcher\Monkey;
describe("Monkey", function() {
describe("->process()", function() {
beforeEach(function() {
$this->path = 'spec/Fixture/Jit/Patcher/Monkey';
$this->patcher = new Monkey();
});
it("patches class's methods", function() {
$nodes = Parser::parse(file_get_contents($this->path . '/Class.php'));
$expected = file_get_contents($this->path . '/ClassProcessed.php');
$actual = Parser::unparse($this->patcher->process($nodes));
expect($actual)->toBe($expected);
});
it("patches trait's methods", function() {
$nodes = Parser::parse(file_get_contents($this->path . '/Trait.php'));
$expected = file_get_contents($this->path . '/TraitProcessed.php');
$actual = Parser::unparse($this->patcher->process($nodes));
expect($actual)->toBe($expected);
});
it("patches plain php file", function() {
$nodes = Parser::parse(file_get_contents($this->path . '/Plain.php'));
$expected = file_get_contents($this->path . '/PlainProcessed.php');
$actual = Parser::unparse($this->patcher->process($nodes));
expect($actual)->toBe($expected);
});
});
});
| m1ome/kahlan | spec/Suite/Jit/Patcher/MonkeySpec.php | PHP | mit | 1,380 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
namespace _14.FactorialTrailingZeroes
{
class Program
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
BigInteger factorielNum = FactorialNumber(n);
int zeros = GetFactorieZeros(factorielNum.ToString());
Console.WriteLine(zeros);
}
public static int GetFactorieZeros(string factorielStr)
{
int zeros = 0;
for (int currentDigit = factorielStr.Length - 1; currentDigit > 1; currentDigit--)
{
if (factorielStr[currentDigit] == '0')
{
zeros++;
}
else
{
break;
}
}
return zeros;
}
public static BigInteger FactorialNumber(int n)
{
BigInteger factoriel = 1;
while (n > 1)
{
factoriel *= n;
n--;
}
return factoriel;
}
}
}
| AleksandarKostadinov/Tech-Module-Solutions | Programming Fundamentals - януари 2017/Е.03.Methods and Debugging/14.FactorialTrailingZeroes/Program.cs | C# | mit | 1,212 |
package com.bgstation0.android.sample.fragment_;
import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
//tOg1
public class Fragment1 extends Fragment implements OnClickListener{
// otB[h
static final String TAG = "Fragment1"; // TAGð"Fragment1"Åú».
public int mNumber = 0; // mNumberð0Åú».
public MainActivity mContext = null; // mContextðnullÅú».
// RXgN^
public Fragment1(){
}
// A^b`
@Override
public void onAttach(Activity activity){
// ùèÌ.
super.onAttach(activity);
Log.d(TAG, "Fragment1.onAttach"); // "Fragment1.onAttach"ÆOÉc·.
mContext = (MainActivity)activity; // activityðmContextÉn·.
mContext.func(); // funcðÄÔ.
}
// tOg¶¬
@Override
public void onCreate(Bundle savedInstanceState){
// ùèÌ.
super.onCreate(savedInstanceState); // eNXÌonCreateðÄÔ.
// FragmentÌͬð}~.
setRetainInstance(true); // setRetainInstanceðtrueÉ.
// Oðc·.
Log.d(TAG, "Fragment1.onCreate"); // "Fragment1.onCreate"ÆOÉc·.
}
// tOgjü
@Override
public void onDestroy(){
// Oðc·.
Log.d(TAG, "Fragment1.onDestroy"); // "Fragment1.onDestroy"ÆOÉc·.
// ùèÌ.
super.onDestroy(); // eNXÌonDestroyðÄÔ.
}
// r
[¶¬
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
// Oðc·.
Log.d(TAG, "Fragment1.onCreateView"); // "Fragment1.onCreateView"ÆOÉc·.
// ùèÌ.
View view = inflater.inflate(R.layout.fragment1_main, null); // inflater.inflateÅR.layout.fragment1_main©çr
[ðì¬.
Button button1 = (Button)view.findViewById(R.id.fragment1_button1); // Fragment1Ìbutton1ðæ¾.
button1.setOnClickListener(this); // Xi[ƵÄthisðZbg.
TextView tv = (TextView)view.findViewById(R.id.fragment1_textview);
tv.setText(Integer.toString(mNumber));
return view;
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
mNumber++; // mNumberðâ·.
View view = getView();
TextView tv = (TextView)view.findViewById(R.id.fragment1_textview);
tv.setText(Integer.toString(mNumber));
}
// f^b`
@Override
public void onDetach(){
// Oðc·.
Log.d(TAG, "Fragment1.onDetach"); // "Fragment1.onDetach"ÆOÉc·.
// mContextðnull.
mContext = null;
// ùèÌ.
super.onDetach(); // eNXÌonDetachðÄÔ.
}
} | bg1bgst333/Sample | android/Fragment/setRetainInstance/src/Fragment/Fragment_/src/com/bgstation0/android/sample/fragment_/Fragment1.java | Java | mit | 2,852 |
#include <app/Fuse.Node.h>
#include <app/Fuse.Resources.ResourceBinding__float4.h>
#include <app/Fuse.Resources.ResourceRegistry.h>
#include <app/Uno.Action.h>
#include <app/Uno.ArgumentNullException.h>
#include <app/Uno.Bool.h>
#include <app/Uno.Float4.h>
#include <app/Uno.Object.h>
#include <app/Uno.Predicate__object.h>
#include <app/Uno.String.h>
#include <app/Uno.UX.Property__float4.h>
namespace app {
namespace Fuse {
namespace Resources {
// This file was generated based on 'C:\ProgramData\Uno\Packages\FuseCore\0.11.3\Resources\$.uno'.
// WARNING: Changes might be lost if you edit this file directly.
ResourceBinding__float4__uType* ResourceBinding__float4__typeof()
{
static ::uStaticStrong<ResourceBinding__float4__uType*> type;
if (type != NULL) return type;
type = (ResourceBinding__float4__uType*)::uAllocClassType(sizeof(ResourceBinding__float4__uType), "Fuse.Resources.ResourceBinding<float4>", false, 0, 3, 0);
type->SetBaseType(::app::Fuse::Behavior__typeof());
type->__fp_OnRooted = (void(*)(::app::Fuse::Behavior*, ::app::Fuse::Node*))ResourceBinding__float4__OnRooted;
type->__fp_OnUnrooted = (void(*)(::app::Fuse::Behavior*, ::app::Fuse::Node*))ResourceBinding__float4__OnUnrooted;
type->SetStrongRefs(
"_Key", offsetof(ResourceBinding__float4, _Key),
"_n", offsetof(ResourceBinding__float4, _n),
"_Target", offsetof(ResourceBinding__float4, _Target));
type->SetFields(1,
::uNewField("_n", NULL, offsetof(ResourceBinding__float4, _n), ::app::Fuse::Node__typeof()));
type->SetFunctions(5,
::uNewFunction("get_Key", ResourceBinding__float4__get_Key, 0, false, ::app::Uno::String__typeof()),
::uNewFunction("get_Target", ResourceBinding__float4__get_Target, 0, false, ::app::Uno::UX::Property__float4__typeof()),
::uNewFunction(".ctor", ResourceBinding__float4__New_1, 0, true, ResourceBinding__float4__typeof(), ::app::Uno::UX::Property__float4__typeof(), ::app::Uno::String__typeof()),
::uNewFunctionVoid("set_Key", ResourceBinding__float4__set_Key, 0, false, ::app::Uno::String__typeof()),
::uNewFunctionVoid("set_Target", ResourceBinding__float4__set_Target, 0, false, ::app::Uno::UX::Property__float4__typeof()));
::uRegisterType(type);
return type;
}
void ResourceBinding__float4___ObjInit_1(ResourceBinding__float4* __this, ::app::Uno::UX::Property__float4* target, ::uString* key)
{
::app::Fuse::Behavior___ObjInit(__this);
if (target == NULL)
{
U_THROW(::app::Uno::ArgumentNullException__New_5(NULL, ::uGetConstString("target")));
}
__this->Target(target);
__this->Key(key);
}
bool ResourceBinding__float4__Acceptor(ResourceBinding__float4* __this, ::uObject* obj)
{
return ::uIs(obj, ::app::Uno::Float4__typeof());
}
::uString* ResourceBinding__float4__get_Key(ResourceBinding__float4* __this)
{
return __this->_Key;
}
::app::Uno::UX::Property__float4* ResourceBinding__float4__get_Target(ResourceBinding__float4* __this)
{
return __this->_Target;
}
ResourceBinding__float4* ResourceBinding__float4__New_1(::uStatic* __this, ::app::Uno::UX::Property__float4* target, ::uString* key)
{
ResourceBinding__float4* inst = (ResourceBinding__float4*)::uAllocObject(sizeof(ResourceBinding__float4), ResourceBinding__float4__typeof());
inst->_ObjInit_1(target, key);
return inst;
}
void ResourceBinding__float4__OnChanged(ResourceBinding__float4* __this)
{
if (__this->_n != NULL)
{
::uObject* resource;
if (::uPtr< ::app::Fuse::Node*>(__this->_n)->TryGetResource(__this->Key(), ::uNewDelegateNonVirt(::app::Uno::Predicate__object__typeof(), (const void*)ResourceBinding__float4__Acceptor, __this), &resource))
{
::uPtr< ::app::Uno::UX::Property__float4*>(__this->Target())->SetRestState(::uUnbox< ::app::Uno::Float4>(::app::Uno::Float4__typeof(), resource), (::uObject*)__this);
}
}
}
void ResourceBinding__float4__OnRooted(ResourceBinding__float4* __this, ::app::Fuse::Node* n)
{
__this->_n = n;
::app::Fuse::Resources::ResourceRegistry__AddResourceChangedHandler(NULL, __this->Key(), ::uNewDelegateNonVirt(::app::Uno::Action__typeof(), (const void*)ResourceBinding__float4__OnChanged, __this));
__this->OnChanged();
}
void ResourceBinding__float4__OnUnrooted(ResourceBinding__float4* __this, ::app::Fuse::Node* n)
{
__this->_n = NULL;
::app::Fuse::Resources::ResourceRegistry__RemoveResourceChangedHandler(NULL, __this->Key(), ::uNewDelegateNonVirt(::app::Uno::Action__typeof(), (const void*)ResourceBinding__float4__OnChanged, __this));
}
void ResourceBinding__float4__set_Key(ResourceBinding__float4* __this, ::uString* value)
{
__this->_Key = value;
}
void ResourceBinding__float4__set_Target(ResourceBinding__float4* __this, ::app::Uno::UX::Property__float4* value)
{
__this->_Target = value;
}
}}}
| blyk/BlackCode-Fuse | AndroidUI/.build/Simulator/Android/jni/app/Fuse.Resources.ResourceBinding-1.cpp | C++ | mit | 4,908 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
namespace EventLogNotifier
{
public class NotifyIconViewModel
{
/// <summary>
/// Shuts down the application.
/// </summary>
public ICommand ExitApplicationCommand
{
get
{
return new DelegateCommand { CommandAction = () => Application.Current.Shutdown() };
}
}
}
public class DelegateCommand : ICommand
{
public Action CommandAction { get; set; }
public Func<bool> CanExecuteFunc { get; set; }
public void Execute(object parameter)
{
CommandAction();
}
public bool CanExecute(object parameter)
{
return CanExecuteFunc == null || CanExecuteFunc();
}
public event EventHandler CanExecuteChanged
{
add { CommandManager.RequerySuggested += value; }
remove { CommandManager.RequerySuggested -= value; }
}
}
}
| basvo/EventLogNotifier | EventLogNotifier/NotifyIconViewModel.cs | C# | mit | 1,184 |
using System;
using System.Collections.Generic;
using Loyc.Syntax;
using Flame.Compiler;
using LeMP;
using Loyc;
namespace Flame.Ecs.Parsing
{
/// <summary>
/// Represents a parsed source code file.
/// </summary>
public struct ParsedDocument
{
/// <summary>
/// Initializes a new instance of the <see cref="Flame.Ecs.Parsing.ParsedDocument"/> class.
/// </summary>
/// <param name="Document">The document whose contents have been parsed.</param>
/// <param name="Contents">The parsed contents of the document.</param>
public ParsedDocument(
ISourceDocument Document,
IReadOnlyList<LNode> Contents)
{
this = default(ParsedDocument);
this.Document = Document;
this.Contents = Contents;
}
/// <summary>
/// Gets the document whose contents have been parsed.
/// </summary>
/// <value>The document.</value>
public ISourceDocument Document { get; private set; }
/// <summary>
/// Gets the parsed contents of the source document.
/// </summary>
/// <value>The contents.</value>
public IReadOnlyList<LNode> Contents { get; private set; }
/// <summary>
/// Gets a value indicating whether this instance is empty, i.e.,
/// both the source document and the contents are null.
/// </summary>
/// <value><c>true</c> if this instance is empty; otherwise, <c>false</c>.</value>
public bool IsEmpty { get { return Document == null && Contents == null; } }
/// <summary>
/// Gets the original source code of the parsed document,
/// without macro expansion.
/// </summary>
/// <value>The original source code.</value>
public string OriginalSource { get { return Document.Source; } }
/// <summary>
/// Generate source code for the document's (macro-expanded) contents.
/// </summary>
/// <returns>The macro-expanded source code.</returns>
/// <param name="Sink">The message sink to log diagnostics to.</param>
/// <param name="Printer">The node printer that is used to generate source code.</param>
/// <param name="Options">The node printer options.</param>
public string GetExpandedSource(
ILNodePrinter Printer, IMessageSink Sink,
ILNodePrinterOptions Options = null)
{
return Printer.Print(Contents, Sink, options: Options);
}
/// <summary>
/// Expands all macros in this parsed document.
/// </summary>
/// <returns>A parsed document whose macros have been expanded.</returns>
/// <param name="Processor">The macro processor to use.</param>
public ParsedDocument ExpandMacros(MacroProcessor Processor)
{
return SourceHelpers.ExpandMacros(this, Processor);
}
/// <summary>
/// Expands all macros in this parsed document.
/// </summary>
/// <returns>A parsed document whose macros have been expanded.</returns>
/// <param name="Processor">The macro processor to use.</param>
/// <param name="Prologue"></param>
public ParsedDocument ExpandMacros(
MacroProcessor Processor, IEnumerable<LNode> Prologue)
{
return SourceHelpers.ExpandMacros(this, Processor, Prologue);
}
/// <summary>
/// The empty parsed document, with a null document and null contents.
/// </summary>
public static readonly ParsedDocument Empty = default(ParsedDocument);
}
}
| jonathanvdc/ecsc | src/Flame.Ecs/Parsing/ParsedDocument.cs | C# | mit | 3,691 |
'use strict';
/* eslint-disable no-console */
const cryptoJS = require('crypto-js');
module.exports = {
toJsonObj: function (str) {
try {
return JSON.parse(str);
} catch (e) {
return false;
}
},
getMacString: function (req) {
var arr = [];
for (let key in req) {
if (req.hasOwnProperty(key)) {
arr.push(key + '=' + req[key]);
}
}
arr.sort();
return arr.join(':');
},
calculateMac: function (macString, secret) {
return '1:' + cryptoJS.enc.Base64.stringify(cryptoJS.HmacSHA256(macString, secret));
},
encodeData: function (data) {
return Object.keys(data).map(function (key) {
return [key, data[key]].map(encodeURIComponent).join('=');
}).join('&');
}
}
| osmoossi/tapsudraft | gui/app/js/util.js | JavaScript | mit | 757 |
<!--
Safe sample
input : get the field userData from the variable $_GET via an object, which store it in a array
sanitize : cast via + = 0.0
File : use of untrusted data in a doubled quote attribute
-->
<!--Copyright 2015 Bertrand STIVALET
Permission is hereby granted, without written agreement or royalty fee, to
use, copy, modify, and distribute this software and its documentation for
any purpose, provided that the above copyright notice and the following
three paragraphs appear in all copies of this software.
IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT,
INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT
LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO
OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.-->
<!DOCTYPE html>
<html>
<head/>
<body>
<?php
class Input{
private $input;
public function getInput(){
return $this->input[1];
}
public function __construct(){
$this->input = array();
$this->input[0]= 'safe' ;
$this->input[1]= $_GET['UserData'] ;
$this->input[2]= 'safe' ;
}
}
$temp = new Input();
$tainted = $temp->getInput();
$tainted += 0.0 ;
echo "<div id=\"". $tainted ."\">content</div>" ;
?>
<h1>Hello World!</h1>
</body>
</html> | stivalet/PHP-Vulnerability-test-suite | XSS/CWE_79/safe/CWE_79__object-Array__CAST-cast_float_sort_of__Use_untrusted_data_attribute-Double_Quote_Attr.php | PHP | mit | 1,587 |
export declare const CLAMP_MIN_MAX: string;
export declare const ALERT_WARN_CANCEL_PROPS: string;
export declare const COLLAPSIBLE_LIST_INVALID_CHILD: string;
export declare const CONTEXTMENU_WARN_DECORATOR_NO_METHOD: string;
export declare const HOTKEYS_HOTKEY_CHILDREN: string;
export declare const MENU_WARN_CHILDREN_SUBMENU_MUTEX: string;
export declare const NUMERIC_INPUT_MIN_MAX: string;
export declare const NUMERIC_INPUT_MINOR_STEP_SIZE_BOUND: string;
export declare const NUMERIC_INPUT_MAJOR_STEP_SIZE_BOUND: string;
export declare const NUMERIC_INPUT_MINOR_STEP_SIZE_NON_POSITIVE: string;
export declare const NUMERIC_INPUT_MAJOR_STEP_SIZE_NON_POSITIVE: string;
export declare const NUMERIC_INPUT_STEP_SIZE_NON_POSITIVE: string;
export declare const NUMERIC_INPUT_STEP_SIZE_NULL: string;
export declare const POPOVER_REQUIRES_TARGET: string;
export declare const POPOVER_MODAL_INTERACTION: string;
export declare const POPOVER_WARN_TOO_MANY_CHILDREN: string;
export declare const POPOVER_WARN_DOUBLE_CONTENT: string;
export declare const POPOVER_WARN_DOUBLE_TARGET: string;
export declare const POPOVER_WARN_EMPTY_CONTENT: string;
export declare const POPOVER_WARN_MODAL_INLINE: string;
export declare const POPOVER_WARN_DEPRECATED_CONSTRAINTS: string;
export declare const POPOVER_WARN_INLINE_NO_TETHER: string;
export declare const POPOVER_WARN_UNCONTROLLED_ONINTERACTION: string;
export declare const PORTAL_CONTEXT_CLASS_NAME_STRING: string;
export declare const RADIOGROUP_WARN_CHILDREN_OPTIONS_MUTEX: string;
export declare const SLIDER_ZERO_STEP: string;
export declare const SLIDER_ZERO_LABEL_STEP: string;
export declare const RANGESLIDER_NULL_VALUE: string;
export declare const TABS_FIRST_CHILD: string;
export declare const TABS_MISMATCH: string;
export declare const TABS_WARN_DEPRECATED: string;
export declare const TOASTER_WARN_INLINE: string;
export declare const TOASTER_WARN_LEFT_RIGHT: string;
export declare const DIALOG_WARN_NO_HEADER_ICON: string;
export declare const DIALOG_WARN_NO_HEADER_CLOSE_BUTTON: string;
| aggiedefenders/aggiedefenders.github.io | node_modules/@blueprintjs/core/dist/common/errors.d.ts | TypeScript | mit | 2,047 |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="tr" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="14"/>
<source>About Etercoin</source>
<translation>Etercoin hakkında</translation>
</message>
<message>
<location filename="../forms/aboutdialog.ui" line="53"/>
<source><b>Etercoin</b> version</source>
<translation><b>Etercoin</b> sürüm</translation>
</message>
<message>
<location filename="../forms/aboutdialog.ui" line="85"/>
<source>Copyright © 2014 The Etercoin Developers
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file license.txt 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>Telif hakkı © 2014 The Etercoin geliştiricileri
Bu yazılım deneme safhasındadır.
MIT/X11 yazılım lisansı kapsamında yayınlanmıştır, license.txt dosyasına ya da http://www.opensource.org/licenses/mit-license.php sayfasına bakınız.
Bu ürün OpenSSL projesi tarafından OpenSSL Toolkit (http://www.openssl.org/) için geliştirilen yazılımlar, Eric Young (eay@cryptsoft.com) tarafından yazılmış şifreleme yazılımları ve Thomas Bernard tarafından yazılmış UPnP yazılımı içerir.</translation>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="14"/>
<source>Address Book</source>
<translation>Adres defteri</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="20"/>
<source>These are your Etercoin 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>Bunlar, ödemeleri almak için Etercoin adresleridir. Kimin ödeme yaptığını izleyebilmek için her ödeme yollaması gereken kişiye değişik bir adres verebilirsiniz.</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="33"/>
<source>Double-click to edit address or label</source>
<translation>Adresi ya da etiketi düzenlemek için çift tıklayınız</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="57"/>
<source>Create a new address</source>
<translation>Yeni bir adres oluştur</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="60"/>
<source>&New Address...</source>
<translation>&Yeni adres...</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="71"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Şu anda seçili olan adresi panoya kopyalar</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="74"/>
<source>&Copy to Clipboard</source>
<translation>Panoya &kopyala</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="85"/>
<source>Show &QR Code</source>
<translation>&QR kodunu göster</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="96"/>
<source>Sign a message to prove you own this address</source>
<translation>Bu adresin sizin olduğunu ispatlamak için mesaj imzalayın</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="99"/>
<source>&Sign Message</source>
<translation>Mesaj &imzala</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="110"/>
<source>Delete the currently selected address from the list. Only sending addresses can be deleted.</source>
<translation>Seçilen adresi listeden siler. Sadece gönderi adresleri silinebilir.</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="113"/>
<source>&Delete</source>
<translation>&Sil</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="61"/>
<source>Copy address</source>
<translation>Adresi kopyala</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="62"/>
<source>Copy label</source>
<translation>Etiketi kopyala</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="63"/>
<source>Edit</source>
<translation>Düzenle</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="64"/>
<source>Delete</source>
<translation>Sil</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="281"/>
<source>Export Address Book Data</source>
<translation>Adres defteri verilerini dışa aktar</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="282"/>
<source>Comma separated file (*.csv)</source>
<translation>Virgülle ayrılmış değerler dosyası (*.csv)</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="295"/>
<source>Error exporting</source>
<translation>Dışa aktarımda hata oluştu</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="295"/>
<source>Could not write to file %1.</source>
<translation>%1 dosyasına yazılamadı.</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="77"/>
<source>Label</source>
<translation>Etiket</translation>
</message>
<message>
<location filename="../addresstablemodel.cpp" line="77"/>
<source>Address</source>
<translation>Adres</translation>
</message>
<message>
<location filename="../addresstablemodel.cpp" line="113"/>
<source>(no label)</source>
<translation>(boş etiket)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="26"/>
<source>Dialog</source>
<translation>Diyalog</translation>
</message>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="32"/>
<location filename="../forms/askpassphrasedialog.ui" line="97"/>
<source>TextLabel</source>
<translation>Metin Etiketi</translation>
</message>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="50"/>
<source>Enter passphrase</source>
<translation>Parolayı giriniz</translation>
</message>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="64"/>
<source>New passphrase</source>
<translation>Yeni parola</translation>
</message>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="78"/>
<source>Repeat new passphrase</source>
<translation>Yeni parolayı tekrarlayınız</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="34"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>Cüzdanınız için yeni parolayı giriniz.<br/>Lütfen <b>10 ya da daha fazla rastgele karakter</b> veya <b>sekiz ya da daha fazla kelime</b> içeren bir parola seçiniz.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="35"/>
<source>Encrypt wallet</source>
<translation>Cüzdanı şifrele</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="38"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Bu işlem cüzdan kilidini açmak için cüzdan parolanızı gerektirir.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="43"/>
<source>Unlock wallet</source>
<translation>Cüzdan kilidini aç</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="46"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Bu işlem, cüzdan şifresini açmak için cüzdan parolasını gerektirir.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="51"/>
<source>Decrypt wallet</source>
<translation>Cüzdan şifresini aç</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="54"/>
<source>Change passphrase</source>
<translation>Parolayı değiştir</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="55"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Cüzdan için eski ve yeni parolaları giriniz.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="101"/>
<source>Confirm wallet encryption</source>
<translation>Cüzdan şifrelenmesini teyit eder</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="102"/>
<source>WARNING: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR EtercoinS</b>!
Are you sure you wish to encrypt your wallet?</source>
<translation>UYARI: Eğer cüzdanınızı şifrelerseniz ve parolanızı kaybederseniz, <b>TÜM BİTCOİNLERİNİZİ KAYBEDERSİNİZ</b>!
Cüzdanınızı şifrelemek istediğinizden emin misiniz?</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="111"/>
<location filename="../askpassphrasedialog.cpp" line="160"/>
<source>Wallet encrypted</source>
<translation>Cüzdan şifrelendi</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="112"/>
<source>Etercoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your Etercoins from being stolen by malware infecting your computer.</source>
<translation>Şifreleme işlemini tamamlamak için Etercoin şimdi kapanacaktır. Cüzdanınızı şifrelemenin, Etercoinlerinizin bilgisayara bulaşan kötücül bir yazılım tarafından çalınmaya karşı tamamen koruyamayacağını unutmayınız.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="208"/>
<location filename="../askpassphrasedialog.cpp" line="232"/>
<source>Warning: The Caps Lock key is on.</source>
<translation>Uyarı: Caps Lock tuşu etkin durumda.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="117"/>
<location filename="../askpassphrasedialog.cpp" line="124"/>
<location filename="../askpassphrasedialog.cpp" line="166"/>
<location filename="../askpassphrasedialog.cpp" line="172"/>
<source>Wallet encryption failed</source>
<translation>Cüzdan şifrelemesi başarısız oldu</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="118"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Dahili bir hata sebebiyle cüzdan şifrelemesi başarısız oldu. Cüzdanınız şifrelenmedi.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="125"/>
<location filename="../askpassphrasedialog.cpp" line="173"/>
<source>The supplied passphrases do not match.</source>
<translation>Girilen parolalar birbirleriyle uyumlu değil.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="136"/>
<source>Wallet unlock failed</source>
<translation>Cüzdan kilidinin açılması başarısız oldu</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="137"/>
<location filename="../askpassphrasedialog.cpp" line="148"/>
<location filename="../askpassphrasedialog.cpp" line="167"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Cüzdan şifresinin açılması için girilen parola yanlıştı.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="147"/>
<source>Wallet decryption failed</source>
<translation>Cüzdan şifresinin açılması başarısız oldu</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="161"/>
<source>Wallet passphrase was succesfully changed.</source>
<translation>Cüzdan parolası başarılı bir şekilde değiştirildi.</translation>
</message>
</context>
<context>
<name>EtercoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="69"/>
<source>Etercoin Wallet</source>
<translation>Etercoin cüzdanı</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="142"/>
<location filename="../bitcoingui.cpp" line="464"/>
<source>Synchronizing with network...</source>
<translation>Şebeke ile senkronizasyon...</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="145"/>
<source>Block chain synchronization in progress</source>
<translation>Blok zinciri senkronizasyonu sürüyor</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="176"/>
<source>&Overview</source>
<translation>&Genel bakış</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="177"/>
<source>Show general overview of wallet</source>
<translation>Cüzdana genel bakışı gösterir</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="182"/>
<source>&Transactions</source>
<translation>&Muameleler</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="183"/>
<source>Browse transaction history</source>
<translation>Muamele tarihçesini tara</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="188"/>
<source>&Address Book</source>
<translation>&Adres defteri</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="189"/>
<source>Edit the list of stored addresses and labels</source>
<translation>Saklanan adres ve etiket listesini düzenler</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="194"/>
<source>&Receive coins</source>
<translation>Para &al</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="195"/>
<source>Show the list of addresses for receiving payments</source>
<translation>Ödeme alma adreslerinin listesini gösterir</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="200"/>
<source>&Send coins</source>
<translation>Para &yolla</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="201"/>
<source>Send coins to a Etercoin address</source>
<translation>Bir Etercoin adresine para (Etercoin) yollar</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="206"/>
<source>Sign &message</source>
<translation>&Mesaj imzala</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="207"/>
<source>Prove you control an address</source>
<translation>Bu adresin kontrolünüz altında olduğunu ispatlayın</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="226"/>
<source>E&xit</source>
<translation>&Çık</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="227"/>
<source>Quit application</source>
<translation>Uygulamadan çıkar</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="230"/>
<source>&About %1</source>
<translation>%1 &hakkında</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="231"/>
<source>Show information about Etercoin</source>
<translation>Etercoin hakkında bilgi gösterir</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="233"/>
<source>About &Qt</source>
<translation>&Qt hakkında</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="234"/>
<source>Show information about Qt</source>
<translation>Qt hakkında bilgi görüntüler</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="236"/>
<source>&Options...</source>
<translation>&Seçenekler...</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="237"/>
<source>Modify configuration options for Etercoin</source>
<translation>Etercoin seçeneklerinin yapılandırmasını değiştirir</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="239"/>
<source>Open &Etercoin</source>
<translation>&Etercoin'i aç</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="240"/>
<source>Show the Etercoin window</source>
<translation>Etercoin penceresini gösterir</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="241"/>
<source>&Export...</source>
<translation>&Dışa aktar...</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="242"/>
<source>Export the data in the current tab to a file</source>
<translation>Güncel sekmedeki verileri bir dosyaya aktar</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="243"/>
<source>&Encrypt Wallet</source>
<translation>Cüzdanı &şifrele</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="244"/>
<source>Encrypt or decrypt wallet</source>
<translation>Cüzdanı şifreler ya da şifreyi açar</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="246"/>
<source>&Backup Wallet</source>
<translation>Cüzdanı &yedekle</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="247"/>
<source>Backup wallet to another location</source>
<translation>Cüzdanı diğer bir konumda yedekle</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="248"/>
<source>&Change Passphrase</source>
<translation>&Parolayı değiştir</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="249"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Cüzdan şifrelemesi için kullanılan parolayı değiştirir</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="272"/>
<source>&File</source>
<translation>&Dosya</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="281"/>
<source>&Settings</source>
<translation>&Ayarlar</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="287"/>
<source>&Help</source>
<translation>&Yardım</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="294"/>
<source>Tabs toolbar</source>
<translation>Sekme araç çubuğu</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="305"/>
<source>Actions toolbar</source>
<translation>Faaliyet araç çubuğu</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="317"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="407"/>
<source>Etercoin-qt</source>
<translation>Etercoin-qt</translation>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="449"/>
<source>%n active connection(s) to Etercoin network</source>
<translation><numerusform>Etercoin şebekesine %n etkin bağlantı</numerusform></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="475"/>
<source>Downloaded %1 of %2 blocks of transaction history.</source>
<translation>Muamele tarihçesinin %2 sayıda blokundan %1 adet blok indirildi.</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="487"/>
<source>Downloaded %1 blocks of transaction history.</source>
<translation>Muamele tarihçesinin %1 adet bloku indirildi.</translation>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="502"/>
<source>%n second(s) ago</source>
<translation><numerusform>%n saniye önce</numerusform></translation>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="506"/>
<source>%n minute(s) ago</source>
<translation><numerusform>%n dakika önce</numerusform></translation>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="510"/>
<source>%n hour(s) ago</source>
<translation><numerusform>%n saat önce</numerusform></translation>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="514"/>
<source>%n day(s) ago</source>
<translation><numerusform>%n gün önce</numerusform></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="520"/>
<source>Up to date</source>
<translation>Güncel</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="525"/>
<source>Catching up...</source>
<translation>Aralık kapatılıyor...</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="533"/>
<source>Last received block was generated %1.</source>
<translation>Son alınan blok şu vakit oluşturulmuştu: %1.</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="597"/>
<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>Bu muamele boyut sınırlarını aşmıştır. Gene de %1 ücret ödeyerek gönderebilirsiniz, ki bu ücret muamelenizi işleyen ve şebekeye yardım eden düğümlere ödenecektir. Ücreti ödemek istiyor musunuz?</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="602"/>
<source>Sending...</source>
<translation>Yollanıyor...</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="629"/>
<source>Sent transaction</source>
<translation>Muamele yollandı</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="630"/>
<source>Incoming transaction</source>
<translation>Gelen muamele</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="631"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Tarih: %1
Miktar: %2
Tür: %3
Adres: %4
</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="751"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Cüzdan <b>şifrelenmiştir</b> ve şu anda <b>kilidi açılmıştır</b></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="759"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Cüzdan <b>şifrelenmiştir</b> ve şu anda <b>kilitlidir</b></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="782"/>
<source>Backup Wallet</source>
<translation>Cüzdanı yedekle</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="782"/>
<source>Wallet Data (*.dat)</source>
<translation>Cüzdan verileri (*.dat)</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="785"/>
<source>Backup Failed</source>
<translation>Yedekleme başarısız oldu</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="785"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation>Cüzdan verilerinin başka bir konumda kaydedilmesi sırasında bir hata meydana geldi.</translation>
</message>
</context>
<context>
<name>DisplayOptionsPage</name>
<message>
<location filename="../optionsdialog.cpp" line="270"/>
<source>&Unit to show amounts in: </source>
<translation>Miktarı göstermek için &birim: </translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="274"/>
<source>Choose the default subdivision unit to show in the interface, and when sending coins</source>
<translation>Para (coin) gönderildiğinde arayüzde gösterilecek varsayılan alt birimi seçiniz</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="281"/>
<source>Display addresses in transaction list</source>
<translation>Muamele listesinde adresleri göster</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="14"/>
<source>Edit Address</source>
<translation>Adresi düzenle</translation>
</message>
<message>
<location filename="../forms/editaddressdialog.ui" line="25"/>
<source>&Label</source>
<translation>&Etiket</translation>
</message>
<message>
<location filename="../forms/editaddressdialog.ui" line="35"/>
<source>The label associated with this address book entry</source>
<translation>Bu adres defteri unsuru ile ilişkili etiket</translation>
</message>
<message>
<location filename="../forms/editaddressdialog.ui" line="42"/>
<source>&Address</source>
<translation>&Adres</translation>
</message>
<message>
<location filename="../forms/editaddressdialog.ui" line="52"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation>Bu adres defteri unsuru ile ilişkili adres. Bu, sadece gönderi adresi için değiştirilebilir.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="20"/>
<source>New receiving address</source>
<translation>Yeni alım adresi</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="24"/>
<source>New sending address</source>
<translation>Yeni gönderi adresi</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="27"/>
<source>Edit receiving address</source>
<translation>Alım adresini düzenle</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="31"/>
<source>Edit sending address</source>
<translation>Gönderi adresini düzenle</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="91"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Girilen "%1" adresi hâlihazırda adres defterinde mevcuttur.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="96"/>
<source>The entered address "%1" is not a valid Etercoin address.</source>
<translation>Girilen "%1" adresi geçerli bir Etercoin adresi değildir.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="101"/>
<source>Could not unlock wallet.</source>
<translation>Cüzdan kilidi açılamadı.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="106"/>
<source>New key generation failed.</source>
<translation>Yeni anahtar oluşturulması başarısız oldu.</translation>
</message>
</context>
<context>
<name>MainOptionsPage</name>
<message>
<location filename="../optionsdialog.cpp" line="170"/>
<source>&Start Etercoin on window system startup</source>
<translation>Etercoin'i pencere sistemi ile &başlat</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="171"/>
<source>Automatically start Etercoin after the computer is turned on</source>
<translation>Etercoin'i bilgisayar başlatıldığında başlatır</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="175"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>İşlem çubuğu yerine sistem çekmesine &küçült</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="176"/>
<source>Show only a tray icon after minimizing the window</source>
<translation>Küçültüldükten sonra sadece çekmece ikonu gösterir</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="180"/>
<source>Map port using &UPnP</source>
<translation>Portları &UPnP kullanarak haritala</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="181"/>
<source>Automatically open the Etercoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>Yönlendiricide Etercoin istemci portlarını otomatik olarak açar. Bu, sadece yönlendiricinizin UPnP desteği bulunuyorsa ve etkinse çalışabilir.</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="185"/>
<source>M&inimize on close</source>
<translation>Kapatma sırasında k&üçült</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="186"/>
<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>Pencere kapatıldığında uygulamadan çıkmak yerine uygulamayı küçültür. Bu seçenek etkinleştirildiğinde, uygulama sadece menüden çıkış seçildiğinde kapanacaktır.</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="190"/>
<source>&Connect through SOCKS4 proxy:</source>
<translation>SOCKS4 vekil sunucusu vasıtasıyla ba&ğlan:</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="191"/>
<source>Connect to the Bitcon network through a SOCKS4 proxy (e.g. when connecting through Tor)</source>
<translation>Etercoin şebekesine SOCKS4 vekil sunucusu vasıtasıyla bağlanır (mesela Tor ile bağlanıldığında)</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="196"/>
<source>Proxy &IP: </source>
<translation>Vekil &İP: </translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="202"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation>Vekil sunucunun İP adresi (mesela 127.0.0.1)</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="205"/>
<source>&Port: </source>
<translation>&Port: </translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="211"/>
<source>Port of the proxy (e.g. 1234)</source>
<translation>Vekil sunucun portu (örneğin 1234)</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="217"/>
<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>Muamelelerin hızlı işlenmesini garantilemeye yardım eden, seçime dayalı kB başı muamele ücreti. Muamelelerin çoğunluğunun boyutu 1 kB'dir. 0.01 ücreti önerilir. </translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="223"/>
<source>Pay transaction &fee</source>
<translation>Muamele ücreti &öde</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="226"/>
<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>Muamelelerin hızlı işlenmesini garantilemeye yardım eden, seçime dayalı kB başı muamele ücreti. Muamelelerin çoğunluğunun boyutu 1 kB'dir. 0.01 ücreti önerilir. </translation>
</message>
</context>
<context>
<name>MessagePage</name>
<message>
<location filename="../forms/messagepage.ui" line="14"/>
<source>Message</source>
<translation>Mesaj</translation>
</message>
<message>
<location filename="../forms/messagepage.ui" line="20"/>
<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>Bir adresin sizin olduğunu ispatlamak için adresinizle mesaj imzalayabilirsiniz. Oltalama saldırılarının kimliğinizi imzanızla elde etmeyi deneyebilecekleri için belirsiz hiçbir şey imzalamamaya dikkat ediniz. Sadece ayrıntılı açıklaması olan ve tümüne katıldığınız ifadeleri imzalayın.</translation>
</message>
<message>
<location filename="../forms/messagepage.ui" line="38"/>
<source>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Ödemenin gönderileceği adres (mesela 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
<message>
<location filename="../forms/messagepage.ui" line="48"/>
<source>Choose adress from address book</source>
<translation>Adres defterinden adres seç</translation>
</message>
<message>
<location filename="../forms/messagepage.ui" line="58"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location filename="../forms/messagepage.ui" line="71"/>
<source>Paste address from clipboard</source>
<translation>Panodan adres yapıştır</translation>
</message>
<message>
<location filename="../forms/messagepage.ui" line="81"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location filename="../forms/messagepage.ui" line="93"/>
<source>Enter the message you want to sign here</source>
<translation>İmzalamak istediğiniz mesajı burada giriniz</translation>
</message>
<message>
<location filename="../forms/messagepage.ui" line="105"/>
<source>Click "Sign Message" to get signature</source>
<translation>İmza elde etmek için "Mesaj İmzala" unsurunu tıklayın</translation>
</message>
<message>
<location filename="../forms/messagepage.ui" line="117"/>
<source>Sign a message to prove you own this address</source>
<translation>Bu adresin sizin olduğunu ispatlamak için bir mesaj imzalayın</translation>
</message>
<message>
<location filename="../forms/messagepage.ui" line="120"/>
<source>&Sign Message</source>
<translation>Mesaj &İmzala</translation>
</message>
<message>
<location filename="../forms/messagepage.ui" line="131"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Şu anda seçili olan adresi panoya kopyalar</translation>
</message>
<message>
<location filename="../forms/messagepage.ui" line="134"/>
<source>&Copy to Clipboard</source>
<translation>Panoya &kopyala</translation>
</message>
<message>
<location filename="../messagepage.cpp" line="74"/>
<location filename="../messagepage.cpp" line="89"/>
<location filename="../messagepage.cpp" line="101"/>
<source>Error signing</source>
<translation>İmza sırasında hata meydana geldi</translation>
</message>
<message>
<location filename="../messagepage.cpp" line="74"/>
<source>%1 is not a valid address.</source>
<translation>%1 geçerli bir adres değildir.</translation>
</message>
<message>
<location filename="../messagepage.cpp" line="89"/>
<source>Private key for %1 is not available.</source>
<translation>%1 için özel anahtar mevcut değil.</translation>
</message>
<message>
<location filename="../messagepage.cpp" line="101"/>
<source>Sign failed</source>
<translation>İmzalama başarısız oldu</translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../optionsdialog.cpp" line="79"/>
<source>Main</source>
<translation>Ana menü</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="84"/>
<source>Display</source>
<translation>Görünüm</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="104"/>
<source>Options</source>
<translation>Seçenekler</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="14"/>
<source>Form</source>
<translation>Form</translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="40"/>
<source>Balance:</source>
<translation>Bakiye:</translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="47"/>
<source>123.456 BTC</source>
<translation>123.456 BTC</translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="54"/>
<source>Number of transactions:</source>
<translation>Muamele sayısı:</translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="61"/>
<source>0</source>
<translation>0</translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="68"/>
<source>Unconfirmed:</source>
<translation>Doğrulanmamış:</translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="75"/>
<source>0 BTC</source>
<translation>0 BTC</translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="82"/>
<source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Wallet</span></p></body></html></source>
<translation><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Cüzdan</span></p></body></html></translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="122"/>
<source><b>Recent transactions</b></source>
<translation><b>Son muameleler</b></translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="103"/>
<source>Your current balance</source>
<translation>Güncel bakiyeniz</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="108"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation>Doğrulanması beklenen ve henüz güncel bakiyeye ilâve edilmemiş muamelelerin toplamı</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="111"/>
<source>Total number of transactions in wallet</source>
<translation>Cüzdandaki muamelelerin toplam sayısı</translation>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="14"/>
<source>Dialog</source>
<translation>Diyalog</translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="32"/>
<source>QR Code</source>
<translation>QR Kod</translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="52"/>
<source>Request Payment</source>
<translation>Ödeme isteği</translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="67"/>
<source>Amount:</source>
<translation>Miktar:</translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="102"/>
<source>BTC</source>
<translation>BTC</translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="118"/>
<source>Label:</source>
<translation>Etiket:</translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="141"/>
<source>Message:</source>
<translation>Mesaj:</translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="183"/>
<source>&Save As...</source>
<translation>&Farklı kaydet...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="101"/>
<source>Save Image...</source>
<translation>Resmi kaydet...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="101"/>
<source>PNG Images (*.png)</source>
<translation>PNG resimleri (*.png)</translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="14"/>
<location filename="../sendcoinsdialog.cpp" line="122"/>
<location filename="../sendcoinsdialog.cpp" line="127"/>
<location filename="../sendcoinsdialog.cpp" line="132"/>
<location filename="../sendcoinsdialog.cpp" line="137"/>
<location filename="../sendcoinsdialog.cpp" line="143"/>
<location filename="../sendcoinsdialog.cpp" line="148"/>
<location filename="../sendcoinsdialog.cpp" line="153"/>
<source>Send Coins</source>
<translation>Para (coin) yolla</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="64"/>
<source>Send to multiple recipients at once</source>
<translation>Birçok alıcıya aynı anda gönder</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="67"/>
<source>&Add recipient...</source>
<translation>&Alıcı ekle...</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="84"/>
<source>Remove all transaction fields</source>
<translation>Bütün muamele alanlarını kaldır</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="87"/>
<source>Clear all</source>
<translation>Tümünü temizle</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="106"/>
<source>Balance:</source>
<translation>Bakiye:</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="113"/>
<source>123.456 BTC</source>
<translation>123.456 BTC</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="144"/>
<source>Confirm the send action</source>
<translation>Yollama etkinliğini teyit ediniz</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="147"/>
<source>&Send</source>
<translation>&Gönder</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="94"/>
<source><b>%1</b> to %2 (%3)</source>
<translation><b>%1</b> şu adrese: %2 (%3)</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="99"/>
<source>Confirm send coins</source>
<translation>Gönderiyi teyit ediniz</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="100"/>
<source>Are you sure you want to send %1?</source>
<translation>%1 tutarını göndermek istediğinizden emin misiniz?</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="100"/>
<source> and </source>
<translation> ve </translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="123"/>
<source>The recepient address is not valid, please recheck.</source>
<translation>Alıcı adresi geçerli değildir, lütfen denetleyiniz.</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="128"/>
<source>The amount to pay must be larger than 0.</source>
<translation>Ödeyeceğiniz tutarın sıfırdan yüksek olması gerekir.</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="133"/>
<source>Amount exceeds your balance</source>
<translation>Tutar bakiyenizden yüksektir</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="138"/>
<source>Total exceeds your balance when the %1 transaction fee is included</source>
<translation>Toplam, %1 muamele ücreti ilâve edildiğinde bakiyenizi geçmektedir</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="144"/>
<source>Duplicate address found, can only send to each address once in one send operation</source>
<translation>Çift adres bulundu, belli bir gönderi sırasında her adrese sadece tek bir gönderide bulunulabilir</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="149"/>
<source>Error: Transaction creation failed </source>
<translation>Hata: Muamele oluşturması başarısız oldu </translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="154"/>
<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>Hata: Muamele reddedildi. Cüzdanınızdaki madenî paraların bazıları zaten harcanmış olduğunda bu meydana gelebilir. Örneğin wallet.dat dosyasının bir kopyasını kullandıysanız ve kopyada para harcandığında ancak burada harcandığı işaretlenmediğinde.</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="14"/>
<source>Form</source>
<translation>Form</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="29"/>
<source>A&mount:</source>
<translation>M&iktar:</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="42"/>
<source>Pay &To:</source>
<translation>&Şu kişiye öde:</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="66"/>
<location filename="../sendcoinsentry.cpp" line="26"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>Adres defterinize eklemek için bu adres için bir etiket giriniz</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="75"/>
<source>&Label:</source>
<translation>&Etiket:</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="93"/>
<source>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Ödemenin gönderileceği adres (mesela 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose address from address book</source>
<translation>Adres defterinden adres seç</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="113"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="120"/>
<source>Paste address from clipboard</source>
<translation>Panodan adres yapıştır</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="130"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="137"/>
<source>Remove this recipient</source>
<translation>Bu alıcıyı kaldır</translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="25"/>
<source>Enter a Etercoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Etercoin adresi giriniz (mesela 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="18"/>
<source>Open for %1 blocks</source>
<translation>%1 blok için açık</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="20"/>
<source>Open until %1</source>
<translation>%1 değerine dek açık</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="26"/>
<source>%1/offline?</source>
<translation>%1/çevrimdışı mı?</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="28"/>
<source>%1/unconfirmed</source>
<translation>%1/doğrulanmadı</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="30"/>
<source>%1 confirmations</source>
<translation>%1 doğrulama</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="47"/>
<source><b>Status:</b> </source>
<translation><b>Durum:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="52"/>
<source>, has not been successfully broadcast yet</source>
<translation>, henüz başarılı bir şekilde yayınlanmadı</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="54"/>
<source>, broadcast through %1 node</source>
<translation>, %1 düğüm vasıtasıyla yayınlandı</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="56"/>
<source>, broadcast through %1 nodes</source>
<translation>, %1 düğüm vasıtasıyla yayınlandı</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="60"/>
<source><b>Date:</b> </source>
<translation><b>Tarih:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="67"/>
<source><b>Source:</b> Generated<br></source>
<translation><b>Kaynak:</b> Oluşturuldu<br></translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="73"/>
<location filename="../transactiondesc.cpp" line="90"/>
<source><b>From:</b> </source>
<translation><b>Gönderen:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="90"/>
<source>unknown</source>
<translation>bilinmiyor</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="91"/>
<location filename="../transactiondesc.cpp" line="114"/>
<location filename="../transactiondesc.cpp" line="173"/>
<source><b>To:</b> </source>
<translation><b>Alıcı:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="94"/>
<source> (yours, label: </source>
<translation> (sizin, etiket: </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="96"/>
<source> (yours)</source>
<translation> (sizin)</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="131"/>
<location filename="../transactiondesc.cpp" line="145"/>
<location filename="../transactiondesc.cpp" line="190"/>
<location filename="../transactiondesc.cpp" line="207"/>
<source><b>Credit:</b> </source>
<translation><b>Gelir:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="133"/>
<source>(%1 matures in %2 more blocks)</source>
<translation>(%1, %2 ek blok sonrasında olgunlaşacak)</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="137"/>
<source>(not accepted)</source>
<translation>(kabul edilmedi)</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="181"/>
<location filename="../transactiondesc.cpp" line="189"/>
<location filename="../transactiondesc.cpp" line="204"/>
<source><b>Debit:</b> </source>
<translation><b>Gider:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="195"/>
<source><b>Transaction fee:</b> </source>
<translation><b>Muamele ücreti:<b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="211"/>
<source><b>Net amount:</b> </source>
<translation><b>Net miktar:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="217"/>
<source>Message:</source>
<translation>Mesaj:</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="219"/>
<source>Comment:</source>
<translation>Yorum:</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="221"/>
<source>Transaction ID:</source>
<translation>Muamele kimliği:</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="224"/>
<source>Generated coins must wait 120 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, it will change to "not accepted" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation>Oluşturulan paraların (coin) harcanabilmelerinden önce 120 blok beklemeleri gerekmektedir. Bu blok, oluşturduğunuzda, blok zincirine eklenmesi için ağda yayınlandı. Zincire eklenmesi başarısız olursa, "kabul edilmedi" olarak değiştirilecek ve harcanamayacaktır. Bu, bazen başka bir düğüm sizden birkaç saniye önce ya da sonra blok oluşturursa meydana gelebilir.</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="14"/>
<source>Transaction details</source>
<translation>Muamele detayları</translation>
</message>
<message>
<location filename="../forms/transactiondescdialog.ui" line="20"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Bu pano muamelenin ayrıntılı açıklamasını gösterir</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="213"/>
<source>Date</source>
<translation>Tarih</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="213"/>
<source>Type</source>
<translation>Tür</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="213"/>
<source>Address</source>
<translation>Adres</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="213"/>
<source>Amount</source>
<translation>Miktar</translation>
</message>
<message numerus="yes">
<location filename="../transactiontablemodel.cpp" line="274"/>
<source>Open for %n block(s)</source>
<translation><numerusform>%n blok için açık</numerusform></translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="277"/>
<source>Open until %1</source>
<translation>%1 değerine dek açık</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="280"/>
<source>Offline (%1 confirmations)</source>
<translation>Çevrimdışı (%1 doğrulama)</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="283"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation>Doğrulanmadı (%1 (toplam %2 üzerinden) doğrulama)</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="286"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Doğrulandı (%1 doğrulama)</translation>
</message>
<message numerus="yes">
<location filename="../transactiontablemodel.cpp" line="295"/>
<source>Mined balance will be available in %n more blocks</source>
<translation><numerusform>Madenden çıkarılan bakiye %n ek blok sonrasında kullanılabilecektir</numerusform></translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="301"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Bu blok başka hiçbir düğüm tarafından alınmamıştır ve muhtemelen kabul edilmeyecektir!</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="304"/>
<source>Generated but not accepted</source>
<translation>Oluşturuldu ama kabul edilmedi</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="347"/>
<source>Received with</source>
<translation>Şununla alınan</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="349"/>
<source>Received from</source>
<translation>Alındığı kişi</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="352"/>
<source>Sent to</source>
<translation>Gönderildiği adres</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="354"/>
<source>Payment to yourself</source>
<translation>Kendinize ödeme</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="356"/>
<source>Mined</source>
<translation>Madenden çıkarılan</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="394"/>
<source>(n/a)</source>
<translation>(mevcut değil)</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="593"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Muamele durumu. Doğrulama sayısını görüntülemek için imleci bu alanda tutunuz.</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="595"/>
<source>Date and time that the transaction was received.</source>
<translation>Muamelenin alındığı tarih ve zaman.</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="597"/>
<source>Type of transaction.</source>
<translation>Muamele türü.</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="599"/>
<source>Destination address of transaction.</source>
<translation>Muamelenin alıcı adresi.</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="601"/>
<source>Amount removed from or added to balance.</source>
<translation>Bakiyeden alınan ya da bakiyeye eklenen miktar.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="55"/>
<location filename="../transactionview.cpp" line="71"/>
<source>All</source>
<translation>Hepsi</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="56"/>
<source>Today</source>
<translation>Bugün</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="57"/>
<source>This week</source>
<translation>Bu hafta</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="58"/>
<source>This month</source>
<translation>Bu ay</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="59"/>
<source>Last month</source>
<translation>Geçen ay</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="60"/>
<source>This year</source>
<translation>Bu sene</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="61"/>
<source>Range...</source>
<translation>Aralık...</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="72"/>
<source>Received with</source>
<translation>Şununla alınan</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="74"/>
<source>Sent to</source>
<translation>Gönderildiği adres</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="76"/>
<source>To yourself</source>
<translation>Kendinize</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="77"/>
<source>Mined</source>
<translation>Oluşturulan</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="78"/>
<source>Other</source>
<translation>Diğer</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="84"/>
<source>Enter address or label to search</source>
<translation>Aranacak adres ya da etiket giriniz</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="90"/>
<source>Min amount</source>
<translation>Asgari miktar</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="124"/>
<source>Copy address</source>
<translation>Adresi kopyala</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="125"/>
<source>Copy label</source>
<translation>Etiketi kopyala</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="126"/>
<source>Copy amount</source>
<translation>Miktarı kopyala</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="127"/>
<source>Edit label</source>
<translation>Etiketi düzenle</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="128"/>
<source>Show details...</source>
<translation>Detayları göster...</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="268"/>
<source>Export Transaction Data</source>
<translation>Muamele verilerini dışa aktar</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="269"/>
<source>Comma separated file (*.csv)</source>
<translation>Virgülle ayrılmış değerler dosyası (*.csv)</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="277"/>
<source>Confirmed</source>
<translation>Doğrulandı</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="278"/>
<source>Date</source>
<translation>Tarih</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="279"/>
<source>Type</source>
<translation>Tür</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="280"/>
<source>Label</source>
<translation>Etiket</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="281"/>
<source>Address</source>
<translation>Adres</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="282"/>
<source>Amount</source>
<translation>Miktar</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="283"/>
<source>ID</source>
<translation>Kimlik</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="287"/>
<source>Error exporting</source>
<translation>Dışa aktarımda hata oluştu</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="287"/>
<source>Could not write to file %1.</source>
<translation>%1 dosyasına yazılamadı.</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="382"/>
<source>Range:</source>
<translation>Aralık:</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="390"/>
<source>to</source>
<translation>ilâ</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="145"/>
<source>Sending...</source>
<translation>Gönderiliyor...</translation>
</message>
</context>
<context>
<name>Etercoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="3"/>
<source>Etercoin version</source>
<translation>Etercoin sürümü</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="4"/>
<source>Usage:</source>
<translation>Kullanım:</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="5"/>
<source>Send command to -server or etercoind</source>
<translation>-server ya da etercoind'ye komut gönder</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="6"/>
<source>List commands</source>
<translation>Komutları listele</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="7"/>
<source>Get help for a command</source>
<translation>Bir komut için yardım al</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="8"/>
<source>Options:</source>
<translation>Seçenekler:</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="9"/>
<source>Specify configuration file (default: Etercoin.conf)</source>
<translation>Yapılandırma dosyası belirt (varsayılan: Etercoin.conf)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="10"/>
<source>Specify pid file (default: etercoind.pid)</source>
<translation>Pid dosyası belirt (varsayılan: etercoind.pid)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="11"/>
<source>Generate coins</source>
<translation>Madenî para (coin) oluştur</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="12"/>
<source>Don't generate coins</source>
<translation>Para oluşturma</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="13"/>
<source>Start minimized</source>
<translation>Küçültülmüş olarak başla</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="14"/>
<source>Specify data directory</source>
<translation>Veri dizinini belirt</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="15"/>
<source>Specify connection timeout (in milliseconds)</source>
<translation>Bağlantı zaman aşım süresini milisaniye olarak belirt</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="16"/>
<source>Connect through socks4 proxy</source>
<translation>Socks4 vekil sunucusu vasıtasıyla bağlan</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="17"/>
<source>Allow DNS lookups for addnode and connect</source>
<translation>Düğüm ekleme ve bağlantı için DNS aramalarına izin ver</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="18"/>
<source>Listen for connections on <port> (default: 8333 or testnet: 18333)</source>
<translation>Bağlantılar için dinlenecek <port> (varsayılan: 8333 ya da testnet: 18333)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="19"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>Eşler ile en çok <n> adet bağlantı kur (varsayılan: 125)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="20"/>
<source>Add a node to connect to</source>
<translation>Bağlanılacak düğüm ekle</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="21"/>
<source>Connect only to the specified node</source>
<translation>Sadece belirtilen düğüme bağlan</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="22"/>
<source>Don't accept connections from outside</source>
<translation>Dışarıdan bağlantıları reddet</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="23"/>
<source>Don't bootstrap list of peers using DNS</source>
<translation>Eş listesini DNS kullanarak başlatma</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="24"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Aksaklık gösteren eşlerle bağlantıyı kesme sınırı (varsayılan: 100)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="25"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Aksaklık gösteren eşlerle yeni bağlantıları engelleme süresi, saniye olarak (varsayılan: 86400)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="28"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 10000)</source>
<translation>Her bağlantı için alım tamponu, <n>*1000 bayt (varsayılan: 10000)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="29"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 10000)</source>
<translation>Her bağlantı için yollama tamponu, <n>*1000 bayt (varsayılan: 10000)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="30"/>
<source>Don't attempt to use UPnP to map the listening port</source>
<translation>Dinlenilecek portu haritalamak için UPnP kullanma</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="31"/>
<source>Attempt to use UPnP to map the listening port</source>
<translation>Dinlenilecek portu haritalamak için UPnP kullan</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="32"/>
<source>Fee per kB to add to transactions you send</source>
<translation>Yolladığınız muameleler için eklenecek kB başı ücret</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="33"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Konut satırı ve JSON-RPC komutlarını kabul et</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="34"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Arka planda daemon (servis) olarak çalış ve komutları kabul et</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="35"/>
<source>Use the test network</source>
<translation>Deneme şebekesini kullan</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="36"/>
<source>Output extra debugging information</source>
<translation>İlâve hata ayıklama verisi çıkar</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="37"/>
<source>Prepend debug output with timestamp</source>
<translation>Hata ayıklama çıktısına tarih ön ekleri ilâve et</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="38"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Trace/hata ayıklama verilerini debug.log dosyası yerine konsola gönder</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="39"/>
<source>Send trace/debug info to debugger</source>
<translation>Hata ayıklayıcıya -debugger- trace/hata ayıklama verileri gönder</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="40"/>
<source>Username for JSON-RPC connections</source>
<translation>JSON-RPC bağlantıları için kullanıcı ismi</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="41"/>
<source>Password for JSON-RPC connections</source>
<translation>JSON-RPC bağlantıları için parola</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="42"/>
<source>Listen for JSON-RPC connections on <port> (default: 8332)</source>
<translation>JSON-RPC bağlantıları için dinlenecek <port> (varsayılan: 8332)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="43"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Belirtilen İP adresinden JSON-RPC bağlantılarını kabul et</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="44"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Şu <ip> adresinde (varsayılan: 127.0.0.1) çalışan düğüme komut yolla</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="45"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>Anahtar alan boyutunu <n> değerine ayarla (varsayılan: 100)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="46"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Blok zincirini eksik cüzdan muameleleri için tekrar tara</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="47"/>
<source>
SSL options: (see the Etercoin Wiki for SSL setup instructions)</source>
<translation>
SSL seçenekleri: (SSL kurulum bilgisi için Etercoin vikisine bakınız)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="50"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>JSON-RPC bağlantıları için OpenSSL (https) kullan</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="51"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Sunucu sertifika dosyası (varsayılan: server.cert)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="52"/>
<source>Server private key (default: server.pem)</source>
<translation>Sunucu özel anahtarı (varsayılan: server.pem)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="53"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation>Kabul edilebilir şifreler (varsayılan: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="56"/>
<source>This help message</source>
<translation>Bu yardım mesajı</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="57"/>
<source>Cannot obtain a lock on data directory %s. Etercoin is probably already running.</source>
<translation>%s veri dizininde kilit elde edilemedi. Etercoin muhtemelen hâlihazırda çalışmaktadır.</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="60"/>
<source>Loading addresses...</source>
<translation>Adresler yükleniyor...</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="61"/>
<source>Error loading addr.dat</source>
<translation>addr.dat dosyasının yüklenmesinde hata oluştu</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="63"/>
<source>Error loading blkindex.dat</source>
<translation>blkindex.dat dosyasının yüklenmesinde hata oluştu</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="65"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>wallet.dat dosyasının yüklenmesinde hata oluştu: bozuk cüzdan</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="66"/>
<source>Error loading wallet.dat: Wallet requires newer version of Etercoin</source>
<translation>wallet.dat dosyasının yüklenmesinde hata oluştu: cüzdanın daha yeni bir Etercoin sürümüne ihtiyacı var</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="67"/>
<source>Wallet needed to be rewritten: restart Etercoin to complete</source>
<translation>Cüzdanın tekrar yazılması gerekiyordu: işlemi tamamlamak için Etercoin'i yeniden başlatınız</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="68"/>
<source>Error loading wallet.dat</source>
<translation>wallet.dat dosyasının yüklenmesinde hata oluştu</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="62"/>
<source>Loading block index...</source>
<translation>Blok indeksi yükleniyor...</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="64"/>
<source>Loading wallet...</source>
<translation>Cüzdan yükleniyor...</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="69"/>
<source>Rescanning...</source>
<translation>Yeniden tarama...</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="70"/>
<source>Done loading</source>
<translation>Yükleme tamamlandı</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="71"/>
<source>Invalid -proxy address</source>
<translation>Geçersiz -proxy adresi</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="72"/>
<source>Invalid amount for -paytxfee=<amount></source>
<translation>-paytxfee=<miktar> için geçersiz miktar</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="73"/>
<source>Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction.</source>
<translation>Uyarı: -paytxfee çok yüksek bir değere ayarlanmış. Bu, muamele gönderirseniz ödeyeceğiniz muamele ücretidir.</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="76"/>
<source>Error: CreateThread(StartNode) failed</source>
<translation>Hata: CreateThread(StartNode) başarısız oldu</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="77"/>
<source>Warning: Disk space is low </source>
<translation>Uyarı: Disk alanı düşük </translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="78"/>
<source>Unable to bind to port %d on this computer. Etercoin is probably already running.</source>
<translation>%d sayılı porta bu bilgisayarda bağlanılamadı. Etercoin muhtemelen hâlihazırda çalışmaktadır.</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="81"/>
<source>Warning: Please check that your computer's date and time are correct. If your clock is wrong Etercoin will not work properly.</source>
<translation>Uyarı: Lütfen bilgisayarınızın tarih ve saatinin doğru olup olmadığını kontrol ediniz. Saatiniz doğru değilse Etercoin gerektiği gibi çalışamaz.</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="84"/>
<source>beta</source>
<translation>beta</translation>
</message>
</context>
</TS> | etercoin/etercoin | src/qt/locale/bitcoin_tr.ts | TypeScript | mit | 90,092 |
namespace NetTypeS.ExampleData.Models
{
public class ExampleArrayItem
{
public int[] NumberArray { get; set; }
public string[] StringArray { get; set; }
public bool[] BoolArray { get; set; }
public object[] ObjectArray { get; set; }
public dynamic[] DynamicArray { get; set; }
}
}
| Ormikon/NetTypeS | src/NetTypeS/NetTypeS.ExampleData/Models/ExampleArrayItem.cs | C# | mit | 336 |
/**
* download webdriver
*/
var path = require('path');
var fs = require('fs');
var rimraf = require('rimraf');
var Download = require('download');
var Decompress = require('decompress');
var fse = require('fs-extra');
var debug = require('debug')('browser');
var chromeVersion = '2.20';
var phantomVersion = '1.9.7';
var basePath = 'https://npm.taobao.org/mirrors/';
var driversDest = path.resolve(__dirname, './driver');
/**
* 下载对应平台的 driver
*/
function downloadDrivers() {
var driversConfig = {
darwin: [
{name: 'phantomjs-darwin', url: 'phantomjs/phantomjs-' + phantomVersion + '-macosx.zip'},
{name: 'chromedriver-darwin', url: 'chromedriver/' + chromeVersion + '/chromedriver_mac32.zip'}
],
win32: [
{name: 'chromedriver.exe', url: 'chromedriver/' + chromeVersion + '/chromedriver_win32.zip'},
{name: 'phantomjs.exe', url: 'phantomjs/phantomjs-' + phantomVersion + '-windows.zip'}
],
linux: [
{name: 'phantomjs-linux', url: 'phantomjs/phantomjs-' + phantomVersion + '-linux-x86_64.tar.bz2'}
]
};
var driverConfig = driversConfig[process.platform];
var count = 0;
console.log('load: download webDrivers...');
if (fs.existsSync(driversDest)) {
rimraf.sync(driversDest);
}
fs.mkdirSync(driversDest);
driverConfig.forEach(function(item) {
var download = new Download({
mode: '777'
// 取不出 tar
// extract: true
});
debug('download', item);
download
.get(basePath + item.url)
// .rename(item.name)
.dest(path.resolve(__dirname, './driver/'))
.run(function(err, files) {
if (err) {
throw new Error('Download drivers error, please reinstall ' + err.message);
}
var downloadFilePath = files[0].path;
var compressDir = path.resolve(driversDest, './' + item.name + '-dir');
debug('下载完一个文件:', downloadFilePath, '开始压缩:');
new Decompress({mode: '777'})
.src(downloadFilePath)
.dest(compressDir)
.use(Decompress.zip({strip: 1}))
.run(function(err) {
if (err) {
throw err;
}
debug('压缩完一个文件');
var type = /phantom/.test(item.name) ? 'phantomjs' : 'chromedriver';
reworkDest(downloadFilePath, compressDir, type);
debug('更改文件权限');
fs.chmodSync(path.resolve(driversDest, item.name), '777');
count ++;
if (count >= driverConfig.length) {
console.log('Download drivers successfully.');
}
});
});
});
}
/**
* 解压之后对文件夹重新整理
*/
function reworkDest(downloadFilePath, compressDir, type) {
// 清理下载的压缩文件
fse.removeSync(downloadFilePath);
var binName = type + (process.platform === 'win32' ? '.exe' : '-' + process.platform);
var binSrcPath = path.resolve(compressDir, type === 'phantomjs' ? './bin/phantomjs' : './chromedriver');
var binDestPath = path.resolve(driversDest, binName);
debug('复制 bin 文件:', binSrcPath, binDestPath);
fse.copySync(binSrcPath, binDestPath);
debug('移除源的文件夹');
fse.removeSync(compressDir);
}
downloadDrivers(); | imsobear/node-browser | build.js | JavaScript | mit | 3,298 |
# -*- coding: utf-8 -*-
"""
Production Configurations
- Use Redis for cache
"""
from __future__ import absolute_import, unicode_literals
from boto.s3.connection import OrdinaryCallingFormat
from django.utils import six
from .common import * # noqa
# SECRET CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
# Raises ImproperlyConfigured exception if DJANGO_SECRET_KEY not in os.environ
SECRET_KEY = env('DJANGO_SECRET_KEY')
# This ensures that Django will be able to detect a secure connection
# properly on Heroku.
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# SECURITY CONFIGURATION
# ------------------------------------------------------------------------------
# See https://docs.djangoproject.com/en/1.9/ref/middleware/#module-django.middleware.security
# and https://docs.djangoproject.com/ja/1.9/howto/deployment/checklist/#run-manage-py-check-deploy
# set this to 60 seconds and then to 518400 when you can prove it works
SECURE_HSTS_SECONDS = 60
SECURE_HSTS_INCLUDE_SUBDOMAINS = env.bool(
'DJANGO_SECURE_HSTS_INCLUDE_SUBDOMAINS', default=True)
SECURE_CONTENT_TYPE_NOSNIFF = env.bool(
'DJANGO_SECURE_CONTENT_TYPE_NOSNIFF', default=True)
SECURE_BROWSER_XSS_FILTER = True
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
SECURE_SSL_REDIRECT = env.bool('DJANGO_SECURE_SSL_REDIRECT', default=True)
CSRF_COOKIE_SECURE = True
CSRF_COOKIE_HTTPONLY = True
X_FRAME_OPTIONS = 'DENY'
# SITE CONFIGURATION
# ------------------------------------------------------------------------------
# Hosts/domain names that are valid for this site
# See https://docs.djangoproject.com/en/1.6/ref/settings/#allowed-hosts
ALLOWED_HOSTS = env.list('DJANGO_ALLOWED_HOSTS', default=['example.com'])
# END SITE CONFIGURATION
INSTALLED_APPS += ('gunicorn', )
# STORAGE CONFIGURATION
# ------------------------------------------------------------------------------
# Uploaded Media Files
# ------------------------
# See: http://django-storages.readthedocs.io/en/latest/index.html
INSTALLED_APPS += (
'storages',
)
# AWS cache settings, don't change unless you know what you're doing:
AWS_EXPIRY = 60 * 60 * 24 * 7
# TODO See: https://github.com/jschneier/django-storages/issues/47
# Revert the following and use str after the above-mentioned bug is fixed in
# either django-storage-redux or boto
AWS_HEADERS = {
'Cache-Control': six.b('max-age=%d, s-maxage=%d, must-revalidate' % (
AWS_EXPIRY, AWS_EXPIRY))
}
# URL that handles the media served from MEDIA_ROOT, used for managing
# stored files.
# See:http://stackoverflow.com/questions/10390244/
from storages.backends.s3boto import S3BotoStorage
StaticRootS3BotoStorage = lambda: S3BotoStorage(location='static')
MediaRootS3BotoStorage = lambda: S3BotoStorage(location='media')
DEFAULT_FILE_STORAGE = 'config.settings.production.MediaRootS3BotoStorage'
#MEDIA_URL = 'https://s3.amazonaws.com/%s/media/' % AWS_STORAGE_BUCKET_NAME
# Static Assets
# ------------------------
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
# TEMPLATE CONFIGURATION
# ------------------------------------------------------------------------------
# See:
# https://docs.djangoproject.com/en/dev/ref/templates/api/#django.template.loaders.cached.Loader
TEMPLATES[0]['OPTIONS']['loaders'] = [
('django.template.loaders.cached.Loader',
['django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader', ]),
]
# DATABASE CONFIGURATION
# ------------------------------------------------------------------------------
# Use the Heroku-style specification
# Raises ImproperlyConfigured exception if DATABASE_URL not in os.environ
DATABASES['default'] = env.db('DATABASE_URL')
# CACHING
# ------------------------------------------------------------------------------
REDIS_LOCATION = '{0}/{1}'.format(env('REDIS_URL', default='redis://127.0.0.1:6379'), 0)
# Heroku URL does not pass the DB number, so we parse it in
CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': REDIS_LOCATION,
'OPTIONS': {
'CLIENT_CLASS': 'django_redis.client.DefaultClient',
'IGNORE_EXCEPTIONS': True, # mimics memcache behavior.
# http://niwinz.github.io/django-redis/latest/#_memcached_exceptions_behavior
}
}
}
# Custom Admin URL, use {% url 'admin:index' %}
ADMIN_URL = env('DJANGO_ADMIN_URL')
# Your production stuff: Below this line define 3rd party library settings
# ------------------------------------------------------------------------------
# EMAIL
# ------------------------------------------------------------------------------
# for now, send emails to console, even in production
EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND', default='django.core.mail.backends.console.EmailBackend')
| Patrick-and-Michael/trumptweets | config/settings/production.py | Python | mit | 4,984 |
import {Directive, AfterViewInit, ElementRef, Renderer} from '@angular/core';
@Directive({
selector: '[setFocus]'
})
export class SetFocusDirective implements AfterViewInit {
constructor(public renderer: Renderer, public elementRef: ElementRef) {
}
ngAfterViewInit() {
this.renderer.invokeElementMethod(
this.elementRef.nativeElement, 'focus', []);
}
} | philipdai/uipalette | src/directives/set-focus.ts | TypeScript | mit | 376 |
#include <iostream>
#include "Net.h"
#include "InputLayer.h"
#include "ForwardLayer.h"
#include "RecurrentLayer.h"
using namespace std;
int main() {
// arma::arma_rng::set_seed(100);
arma::arma_rng::set_seed_random();
Net net;
net.add_layer(new InputLayer(2));
net.add_layer(new ForwardLayer(3));
net.add_layer(new ForwardLayer(1));
TrainData<double> train_data;
train_data.add({{0, 0}}, {0});
train_data.add({{0, 1}}, {1});
train_data.add({{1, 0}}, {1});
train_data.add({{1, 1}}, {0});
net.train(std::move(train_data));
std::cout << "{0, 0} => " << net.predict(arma::vec({0, 0})) << std::endl;
std::cout << "{0, 1} => " << net.predict(arma::vec({0, 1})) << std::endl;
std::cout << "{1, 0} => " << net.predict(arma::vec({1, 0})) << std::endl;
std::cout << "{1, 1} => " << net.predict(arma::vec({1, 1})) << std::endl;
return 0;
}
| igorcoding/cppnet | ex/xor.cc | C++ | mit | 906 |
module Riik
# Document is the base object for the Riik ORM. Including it provides
# the basic functionality for assigning attributes to models,
# assigning a bucket name, and serializing objects.
#
module Document
autoload :Persistence, 'riik/document/persistence'
autoload :Finders, 'riik/document/finders'
def self.included(base)
base.send :extend, ClassMethods
base.send :include, Finders
base.send :include, Persistence
end
module ClassMethods
# List of model properties that should be assigned from the attributes
# hash.
#
attr_reader :riik_attributes
# Create accessors for each of the properties of the model.
#
# @private
#
def property(attribute)
@riik_attributes ||= []
@riik_attributes << attribute
attr_accessor attribute
end
# Returns the Riak bucket for this object.
#
# @return [Riak::Bucket]
#
def bucket
@bucket ||= Riik.client.bucket(bucket_name)
end
# Returns the bucket name for this object. Override in your class
# to change.
#
# @return [String] bucket name.
#
def bucket_name
self.to_s.gsub(/::/, '_').downcase
end
end
# Assign model attributes through initialization hash.
#
# @param [Hash] attributes
#
def initialize(attributes = {})
attributes.symbolize_keys.each do |key, value|
if riik_attributes.include?(key)
instance_variable_set "@#{key}", value
end
end
end
# Serialize the attributes of this model.
#
# @return [Hash] serialized attributes.
# @private
#
def attributes
Hash[riik_attributes.zip(riik_attributes.map { |attr| instance_variable_get "@#{attr}" })]
end
# Return the riik attribute list for this class.
#
# @return [Array] symbols for each model property.
# @private
#
def riik_attributes
self.class.riik_attributes
end
# Return the bucket for this class.
#
# @return [Riak::Bucket]
#
def bucket
self.class.bucket
end
# Delegate the object key to the Riak object.
#
# @return [String]
#
def key
robject.key
end
# Store the current Riak client object.
#
attr_accessor :robject
# Create or return the current Riak client object.
#
# @return [Riak::RObject]
#
def robject
key = self.respond_to?(:default_key) ? self.default_key : nil
@robject ||= Riak::RObject.new(bucket, key).tap do |object|
object.content_type = "application/json"
end
end
end
end
| cmeiklejohn/riik | lib/riik/document.rb | Ruby | mit | 2,705 |
import { combineReducers } from 'redux';
import PostsReducer from './reducer-posts';
import { reducer as formReducer } from 'redux-form';
const rootReducer = combineReducers({
posts: PostsReducer,
form: formReducer
});
export default rootReducer;
| andrewdc92/react-crud-blog | src/reducers/index.js | JavaScript | mit | 253 |
(function(){
var app = angular.module('howtoApp', []);
/*TODO - add custom filters
https://scotch.io/tutorials/building-custom-angularjs-filters
*/
app.filter('facetedNavFilter', function() {
return function(input,scope) {
/*console.log(scope);
var out = [];
var tmpArr = [];
var isEmptyFilterNav = true;
angular.forEach(scope.tmpListing, function(howto) {
angular.forEach(howto.metaData, function(metaRaw){
angular.forEach(metaArr,function(meta){
angular.forEach(tmpArr,function(el){
if(el!==meta){
tmpArr.push(meta);
isEmptyFilterNav = false;
}
});
});
});
});
if(!isEmptyFilterNav){
angular.forEach(input, function(facetCollection){
angular.forEach(facetCollection.categories, function(facetCat){
angular.forEach(facetCat.values, function(facet){
//console.log(facet);
});
});
});
return out;
}else{
return input;
}*/
return input;
}
});
app.filter('facetFilterListings', function() {
return function(input,scope) {
//scope.tmpListing = [];
/*var out = [];
var facetSelectionArr = scope.facetSelectionArr;
angular.forEach(input, function(howto) {
if(facetSelectionArr.length > 0){
var addToOut = false;
angular.forEach(howto.metaData, function(metaRaw){
metaArr = metaRaw.split(",");
angular.forEach(metaArr,function(meta){
angular.forEach(facetSelectionArr,function(facet){
if(facet === meta){
addToOut = true;
}
});
});
});
if(!addToOut){
out.push(howto);
}
}else{
out.push(howto);
}
});
console.log($scope);
return out;*/
return input;
}
});
app.controller('howToController', ['$scope','$filter','$http',function($scope,$filter,$http){
$scope.orderBy = $filter('orderBy');
$scope.callbackName = 'fbcallback';
$scope.defaultQry = "!padrenullquery";
$scope.query = {};
$scope.angularCallback = "&callback=JSON_CALLBACK";
$scope.minInputToSearch = 3;
$scope.numRanks = 10;
$scope.currentPage = 1;
$scope.facetSelectionArr = [];
$scope.xhrSource = "search.json?1";
//$scope.xhrSource = "//funnelback-dev.ucl.ac.uk/s/search.json?collection=isd-howto&profile=_default_preview&num_ranks=1000";
$scope.log = function(){
console.log($scope.resultModel);
}
$scope.fbEncodeURI = function(str){
var str = encodeURI(str);
//return 'hello world';
return str.replace('+','%20').replace('%257C','%7C');//convert fb use of + and | char
}
$scope.loadResultsTmp = function(){
return 'js/includes/listings.html';
}
$scope.loadFacetsTmp = function(){
return 'js/includes/facets.html';
}
$scope.loadPaginationTmp = function(){
return 'js/includes/pagination.html';
}
$scope.removeFacet = function(arr,el){
var pos = arr.indexOf(el);
if(pos >= 0){
arr.splice(pos,1);//second arg ensures 1 item is removed from array
}
return arr;
}
$scope.filterFacets = function(currentElQry,currentElLabel){
var isSelected = false;
if($scope.facetSelectionArr){
for(var i in $scope.facetSelectionArr){
var tmpSelectedItem = $scope.facetSelectionArr[i]
if(tmpSelectedItem == currentElLabel){
isSelected = true;
$scope.facetSelectionArr = $scope.removeFacet($scope.facetSelectionArr,currentElLabel);
}
if(isSelected == true)break;
}
if(isSelected == false){
$scope.facetSelectionArr.push(currentElLabel);
}
}
//$scope.filterListings();
}
$scope.updateMeta = function(){
console.log($filter);
}
$scope.isInputChecked = function(el){
var isChecked = false;
var facets = $scope.xhrDataSelectedFacets;
for(var i in facets){
var tmpArr = facets[i];
for(var j in tmpArr){
var tmpQry = encodeURI(i + '=' + tmpArr[j]);
if($scope.fbEncodeURI(el) === tmpQry)
isChecked = true;
}
}
return isChecked;
}
$scope.facetHasCount = function(el){
//console.log($scope.listingModel);
if($scope.getCount(el) > 0){
return true;
}else{
return false;
}
}
$scope.getCount = function(el){
var count = 0;
angular.forEach($scope.xhrDataResults,function(result){
angular.forEach(result.metaData,function(metaArr){
metaArr = metaArr.split(",");
angular.forEach(metaArr,function(meta){
if(el==meta){
count+=1;
}
});
});
});
return count;
}
$scope.showFacetCount = function(facetObj){
var showFacet = false;
var tmpCount = 0;
if(typeof facetObj.categories[0] !== 'undefined'){
for(var i in facetObj.categories[0].values){
var facet = facetObj.categories[0].values[i];
tmpCount += parseInt(facet.count);
}
}
if(tmpCount > 0)showFacet = true;
return showFacet;
}
$scope.updatePage = function(x) {
$scope.currentPage = x;
return;
}
$scope.isCurrentPage = function(x) {
if(x === $scope.currentPage) {
return true;
}else{
return false;
}
}
$scope.showListing = function(x) {
var rankStart = $scope.currentPage * $scope.numRanks;
var rankEnd = ($scope.currentPage + 1) * $scope.numRanks;
if(x >= rankStart && x < rankEnd) {
return true;
}else{
return false;
}
}
$scope.getData = function(){
var requestUrl = $scope.xhrSource + "&query=" + $scope.defaultQry + $scope.angularCallback;
$http.jsonp(requestUrl).success(function(data) {
$scope.data = data;//make available to $scope variable
//$scope.xhrDataResults = $scope.orderBy(data.response.resultPacket.results,'title',$scope.direction);
$scope.xhrDataResults = data.response.resultPacket.results;
$scope.xhrDataFacets = $scope.orderBy(data.response.facets,'title',$scope.direction);
$scope.xhrDataSelectedFacets = data.question.selectedCategoryValues;
$scope.totalPages = Math.ceil(data.response.resultPacket.resultsSummary.fullyMatching/$scope.numRanks);
$scope.paginationArr = [];
var i=1;
for(i=1;i<=$scope.totalPages;i++){
$scope.paginationArr.push(i);
}
});
}
$scope.getData();
}]);
})();
| aaronBeryUcl/funnelback-angular-app | js/howto.js | JavaScript | mit | 8,516 |
<?php
session_start();
require_once('connections/lib_connect.php');
require_once('./xajax_0.2.4/xajax.inc.php');
require_once('filters.php');
$xajax = new xajax();
$xajax->errorHandlerOn();
#************************
#registering functions
#************************
//$xajax->registerFunction('view_all');
$xajax->registerFunction('search_district');
$xajax->registerFunction('view_district');
$xajax->registerFunction('edit_district');
$xajax->registerFunction('update_district');
$xajax->registerFunction('updatedistrict2');
$xajax->registerFunction('delete_district');
$xajax->registerFunction('deletedistrict');
$xajax->registerFunction('SystemLog');
#**************************
#view district
#edit district
#update district
#confirm update district
#delete district
#confirm delete district
#**************************
function view_district($distcode,$district,$acronym,$subcounty,$parish,$cur_page=1,$records_per_page=20){
$object=new xajaxResponse();
$n=1;
$dist=$_SESSION['district'];
$cur_user=$_SESSION['role'];
//$object->addAlert($cur_user);
$data="<table width='600' border='0'><tr><td>Setup » Districts</td></tr>
<tr><td><hr/></td></tr>
</table>";
$data.="<table width='400' border='0'>".filter_district()."</table>";
$data.="<table width='400' border='0' align='left'>
<tr class=''><th scope='col' colspan='5' align='center'><b class='greenlinks'>REGISTERED DISTRICTS</b></th></tr>
<tr class='' align='left'><th scope='col' >NO</th>
<th scope='col'>DISTRICT </th>
<th scope='col'>ACRONYM</th>
<th scope='col' colspan='2' align='center' >ACTION</th></tr>";
$p=1;
$query_string="select * from tbl_district order by districtName";
$SELECT=@mysql_query($query_string)or die("<div align='center' style='color:#ff0000;font-weight:bold;font-size:12px;'>abi-Error code 0073:".mysql_error());
/**************
*paging parameters
*
****/
$max_records = mysql_num_rows($SELECT);
//$records_per_page=5;
$num_pages=ceil($max_records/$records_per_page);
//$feedback->addAlert($cur_page);
$offset = ($cur_page-1)*$records_per_page;
$p=$offset+1;
$new_query=mysql_query($query_string." limit ".$offset.",".$records_per_page) or die(mysql_error());
while($row=mysql_fetch_array($new_query)){
$_SESSION['parishCode']=$row['parishCode'];
$color=$n%2==1?"#f0e5a5":"#ffffff";
$data.="<tr class=$color>
<td><input type ='hidden' name ='".$row['districtCode']."' id='".$row['districtCode']."'>".$p++."</td>
<td>".$row['districtName']."</td><td>".$row['acronym']."</td>
<TD align='right' width='10'><input type='button' name='edit' value='Edit' onclick=\"xajax_edit_district('".$_SESSION['parishCode']."')\"></TD>
<td align='right' width='10'><input type='button' id='delete' class='redhdrs' value='Delete' onclick=\"xajax_delete_district('".$_SESSION['parishCode']."')\"></td>
</tr>";
$n++;
}
/*
*display pages
*/
$data.="<tr align='right'><td colspan=6>";
$num_links=10;
$startAt_links=($cur_page-5);
$endAt_links=($cur_page+$num_links);
$cur_link=$cur_page;
if($num_pages>1){
$links=1;
$append_bar=$p==$num_pages?"":"|";
if ($cur_page==1)$data.="<a href='#' onclick=\"xajax_view_district('".$distcode."','".$district."','".$acronym."','".$subcounty."','".$parish."','1','".$records_per_page."')\"><font color=red><b>1</b></font>\n</a>...".$append_bar;
else $data.="<a href='#' onclick=\"xajax_view_district('".$distcode."','".$district."','".$acronym."','".$subcounty."','".$parish."','1','".$records_per_page."')\">1\n</a>...".$append_bar;
//for($p=2;$p<$num_pages;$p++){
$p=2;
while($p<$num_pages){
if(($p>$startAt_links) and ($p<$endAt_links)){
$data.=$p==$cur_page?"<font color=red><b>".$p."</b></font>".$append_bar:"<a href='#' onclick=\"xajax_view_district('".$distcode."','".$district."','".$acronym."','".$subcounty."','".$parish."','".$pp."','".$records_per_page."')\">".$p."\n</a>".$append_bar;
}
$p++;
}
if($p==$num_pages){
$data.="...<a href='#' onclick=\"xajax_view_district('".$distcode."','".$district."','".$acronym."','".$subcounty."','".$parish."','".$pp."','".$records_per_page."')\">".$p."\n</a>".$append_bar;
}
}
/*
if($num_pages>1){
for($pp=1;$pp<=$num_pages;$pp++){
$append_bar=$pp==$num_pages?"":"|";
$data.=$pp==$cur_page?"<font color=red><b>".$pp."</b></font>".$append_bar:"<a href='#' onclick=\"xajax_view_district('".$distcode."','".$district."','".$acronym."','".$subcounty."','".$parish."','".$pp."','".$records_per_page."')\">".$pp."\n</a>".$append_bar;
///while($pp=20){
//$data.="<br>";
//$pp++;
//}
}
} */
$data.=" Records: <select name='num_rec' id='num_rec' onchange=\"xajax_view_district('".$distcode."','".$district."','".$acronym."','".$subcounty."','".$parish."','".$cur_page."',this.value)\">";
$i=1;
$selected="";
while($i*10<=$max_records){
$selected=$i*10==$records_per_page?"SELECTED":"";
$data.="<option value='".($i*10)."' ".$selected.">".($i*10)."</option>";
$i++;
}
//$feedback->addAlert($max_records."-->".($i*10));
$sel=$records_per_page>=$max_records?"SELECTED":"";
$data.="<option value='".$max_records."' ".$sel.">All</option>";
$data.="</select>";
$data.="</br></td></tr><table>";
$object->addAssign('bodyDisplay','innerHTML',$data);
return $object;
}
#*********************************
#search district
#delete district
#*********************************
function search_district($district,$subcounty,$parish){
$object=new xajaxResponse();
$n=1;
$dist=$_SESSION['district'];
$data="<table width='' border='0' align='left'>
<tr class='evenrow'><td class='black2' colspan='2'>District:</td><td colspan='2'><select id='district'><option value=''>-All-</option>";
$query=mysql_query("select DISTINCT(districtname) from view_dsp order by districtname ASC")or die(mysql_error());
while($row=mysql_fetch_array($query)){
$data.="<option value='".$row['districtname']."'>".$row['districtname']."</option>";
}
$data.="</select></td><td></td></tr>
<tr class='evenrow'>
<td class='black2' colspan='2'>Subcounty</td>
<td class='black2' colspan='2'>Parish</td>
<td><label>
<input type='button' id='export' name='export' value='Export to Excel' />
</label></td>
</tr>
<tr class='evenrow'>
<td colspan='2'><select id='subcounty'><option value=''>-All-</option>";
$query=mysql_query("select distinct(subcountyName) from view_dsp order by subcountyName ASC ")or die(mysql_error());
while($row=mysql_fetch_array($query)){
$data.="<option value='".$row['subcountyName']."'>".$row['subcountyName']."</option>";
}
$data.="</select></td>
<td colspan='2'><select id='parish'><option value=''>-All-</option>
";
$query=mysql_query("select distinct(parishName) from view_dsp order by parishName Asc")or die(mysql_error());
while($row=mysql_fetch_array($query)){
$data.="<option value='".$row['parishName']."'>".$row['parishName']."</option>";
}
$data.="
</select></td>
<td colspan=''><label>
<input type='button' id='search' value='Go' onclick=\"xajax_search_district(getElementById('district').value,getElementById('subcounty').value,getElementById('parish').value); return false;\" />
</label></td>
</tr>
";
$data.="
<tr><td class='evenrow' colspan='4' align='center'><b class='greenlinks'>REGISTERED DISTRICTS, SUBCOUNTIES AND PARISHES</b></td><td class='evenrow'><a href='adddistrict.php' class='evenrow''><input name='new_district' type='button' value='Add District' /></a></td></tr>
<tr class='evenrow' align='left'><td class='black2'>NO</td><td class='black2'>DISTRICT </td><td class='black2'>ACRONYM</td><td class='black2'>SUB-COUNTY</td><td class='black2'>PARISH</td><td class='black2' align='right'>ACTION</td></tr>";
$p=1;
$SELECT=@mysql_query("select * from view_dsp where lower(districtname) like '%".strtolower($district)."%' && lower(subcountyName) like '%".strtolower($subcounty)."%' && lower(parishName) like '%".strtolower($parish)."%' order by districtname")or die('UNASO-Error code 00163:'.mysql_error());
if(mysql_num_rows($SELECT)>0){
while($row=mysql_fetch_array($SELECT)){
$color=$n%2==1?"#E6E6E6":"#ffffff";
$data.="<tr class=$color><td>".$p++."<input type ='hidden' name ='".$row['districtCode']."' id='".$row['districtCode']."'></td><td>".$row['districtname']."</td><td>".$row['acronym']."</td><td>".$row['subcountyName']."</td><td>".$row['parishName']."</td><TD align='right'><input type='button' name='details' value='Details' onclick=\"xajax_view_all('".$row['parishCode']."')\"></TD></tr>";
$n++;
}}
$data.="<table>";
$object->addAssign('bodyDisplay','innerHTML',$data);
return $object;
}
/*view_all district,subcounty,parish*/
/* function view_all($parishcode){
$obj=new xajaxResponse();
$_SESSION['parishCode']=$parishcode;
$data="</td></tr>
<tr><td><form method='post' ><table>
<tr><td class='greenlinks' colspan='4' align='center'><div align='center'><b>DISTRICT INFORMATION</b></div></td></tr>
<tr class='black2'>
</tr>";
$y=1; $xx=1;
$query=mysql_query("select * from view_dsp where parishCode='".$_SESSION['parishCode']."'")or die(mysql_error());
while($row=mysql_fetch_array($query)){
$_SESSION['parishCode']=$row['parishCode'];
$data.="<tr><td><strong>District:</strong></td><td><input type='hidden' value='".$row['parishCode']."' id='".$row['parishCode']."'>".$row['districtname']."</td></tr>
<tr><td><strong>Acronym:</strong></td><td>".$row['acronym']."</td></tr>
<tr><td><strong>SubCounty:</strong></td><td>".$row['subcountyName']."</td></tr>
<tr><td><strong>Parish:</strong></td><td>".$row['parishName']."</td></tr>";
$data.=" <tr><td colspan=2>
<input type='button' value='Delete' class='redhdrs' title='delete' onclick=\"xajax_delete_district('".$_SESSION['parishCode']."')\">|
<input type='button' value='Cancel' title='close' onclick=\"xajax_view_district('','','','','',1,20)\">|
<input type='button' value='Edit' title='edit' onclick=\"xajax_edit_district('".$_SESSION['parishCode']."')\"></td>
</tr></table></form>";
}
$obj->addAssign('bodyDisplay','innerHTML',$data);
return $obj;
} */
//edit district
//confirm edit district
function edit_district($parish){
$object=new xajaxResponse();
$_SESSION['parishCode']=$parish;
$check="select * from view_dsp where parishCode ='".$_SESSION['parishCode']."'";
//$object->addAlert($check);
$select = mysql_query($check)or die(mysql_error());
while($row = mysql_fetch_array($select)){
$data="<table width='419' border='0'>
<tr>
<td colspan='2'>
<table border='0'>
<tr>
<td>District Name:</td>
<td>".$row['districtname']."</td>
</tr>
<tr>
<td>Acronym:</td>
<td><input type='text' id='acronym' value='".$row['acronym']."' /></td>
</tr>
<tr>
<td>Subcounty Name:</td>
<td><input type='text' name='subcountyName' id='subcountyName' value='".$row['subcountyName']."' /></td>
</tr>
<tr>
<td>Parish Name:</td>
<td><input type='text' name='parishname' id='parishname' value='".$row['parishName']."'/></td>
</tr>
<tr>
<td colspan='2' align='center'><input name='close' title='Close' type='button' id='cancel' value='Cancel' /> | <input name='btn_item' title='update' type='button' id='btn_item' onclick=\"xajax_update_district('".$row['parishCode']."','".$row['subcountyCode']."',getElementById('acronym').value,getElementById('subcountyName').value,getElementById('parishname').value)\" value='Save' /> |<a href='adddistrict.php'><input name='btn_item' title='New Entry' type='button' id='btn_item' value='New Entry' /></a></td>
<td> </td>
</tr>
";
}
$data.=" </table>";
$object->addAssign('bodyDisplay','innerHTML',$data);
return $object;
}
#****************************************************
function update_district($parishcode,$subcountycode,$acronym,$subcountyname,$parishname){
$object=new xajaxResponse();
if($_SESSION['role']<>'Admin'){
$object->AddAlert("Access Denied!\n Only the Admin can edit an item");
$object->addRedirect("index.php");
return $object;
}
$check=mysql_query("select * from view_dsp where parishCode='".$parishcode."'")or die(mysql_error());
if(@mysql_num_rows($check)>0){
$object->AddConfirmCommands(1,"Do You really Want to Update?");
$object->AddScriptCall('xajax_updatedistrict2',$parishcode,$subcountycode,$acronym,$subcountyname,$parishname);
//$object->AddScriptCall('SystemLog',$_SESSION['username']);
}
$object->addAssign('bodyDisplay','innerHTML',$data);
return $object;
}
function updatedistrict2($parishcode,$subcountycode,$acronym,$subcountyname,$parishname){
$object=new xajaxResponse();
$cur_user=$_SESSION['role'];
mysql_query("update tblparish set parishName='".$parishname."' where parishCode='".$parishcode."'")or die(mysql_error());
mysql_query("update tblsubcounty set subcountyName='".$subcountyname."' where subcountyCode='".$subcountycode."'")or die(mysql_error());
//$sel=mysql_fetch_array(mysql_query("select max(login_id) from tbl_login"))or die(mysql_error());
$user="select user() as cur_user";
//$object->addAlert($user);
$usr=mysql_fetch_array(mysql_query("select user() as cur_user"))or die(mysql_error());
//root@localhost
$upd="update parish_log set user_id='".$_SESSION['id']."',district='".$_SESSION['district']."' where user_id='".$usr['cur_user']."'";
$object->addAlert($upd);
mysql_query($upd)or die("UNASO-Error: 333 Because". mysql_error());
$object->addAssign('status','innerHTML',"<div align='center' class='green'>Subcounty and subcounty changed Successfully!</div>");
$object->addRedirect("view_district.php");
return $object;
}
/************************
*delete district os subcounty
*
******/
function delete_district($parishcode){
$feedback = new xajaxResponse();
$check="select * from view_dsp where parishCode ='".$parishcode."'";
$select =mysql_query($check)or die(mysql_error());
//$feedback->addAlert($check);
if(@mysql_num_rows($select)>0){
$feedback->AddConfirmCommands(1,"Do you really want to delete?");
$feedback->AddScriptCall('xajax_deletedistrict', $parishcode);
}
$feedback->addAssign('bodyDisplay','innerHTML',$data);
return $feedback;
}
function deletedistrict($parishcode){
$feedback =new xajaxResponse();
$row =mysql_fetch_array(mysql_query("select * from view_dsp where parishCode ='".$parishcode."'"))or die("<font color=red>Could not delete subcounty or parish because " .mysql_error()."</font>");
mysql_query("delete from tblparish where parishCode='".$parishcode."'")or die(mysql_error());
$feedback->addAssign('bodyDisplay','innerHTML',"<font color=red>Parish Deleted!</font>");
$feedback->AddRedirect("view_district.php");
return $feedback;
}
$xajax->processRequests();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<?php $xajax->printJavascript('xajax_0.2.4/'); ?>
<title>aBi Trust:VIEW DISTRICTS</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="820" border="0" align="center" bgcolor="#FFFFFF">
<tr>
<td><?php require_once('connections/header.php'); ?></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td><table width="820" border="0" bgcolor="#FFFFFF">
<tr>
<td width="200" valign="top"><table width="200" border="0" bgcolor="#FFFFFF">
<tr>
<td valign="top"><?php require_once('connections/left_links.php'); ?></td>
</tr>
</table></td>
<td width="620" valign="top" align="left"><table width="620" border="0">
<tr>
<td><div id="bodyDisplay" align="left"><script language="JavaScript" type="text/javascript">
xajax_view_district("","","","","");
</script>
</div><div id="status"></div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr><td><table width="820" border="0" align="center" bordercolor="#FFFFFF">
<tr>
<td><?php require_once('connections/footer.php'); ?></td>
</tr>
</table>
</td></tr>
</table>
</body>
</html>
| aasiimweDataCare/Dev_ftf | Dev_CPM/view_district.php | PHP | mit | 16,446 |
# -*- encoding : utf-8 -*-
class DropUidAndProviderConstraintOnUsers < ActiveRecord::Migration
def up
execute "
ALTER TABLE users DROP CONSTRAINT users_provider_uid_unique;
"
end
def down
execute "
ALTER TABLE users ADD CONSTRAINT users_provider_uid_unique UNIQUE (provider, uid);
"
end
end
| cesvald/lbm | db/migrate/20130311191444_drop_uid_and_provider_constraint_on_users.rb | Ruby | mit | 338 |
#pragma once
#include <cstdint>
#include <cstddef>
#include <ctime>
#include <stdexcept>
#include <unistd.h>
#include <sys/time.h>
#ifdef __MACH__
# include <mach/mach.h>
# include <mach/clock.h>
#endif
#ifndef CLOCK_MONOTONIC_COARSE
# define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC
#endif
#ifndef CLOCK_REALTIME_COARSE
# define CLOCK_REALTIME_COARSE CLOCK_REALTIME
#endif
namespace mimosa
{
// signed to ease time substraction
using Time = std::int64_t;
const Time nanosecond = 1;
const Time microsecond = 1000 * nanosecond;
const Time millisecond = 1000 * microsecond;
const Time second = 1000 * millisecond;
const Time minute = 60 * second;
const Time hour = 60 * minute;
const Time day = 24 * hour;
#ifdef __MACH__
inline Time realTime() noexcept
{
::clock_serv_t cal_clock;
::mach_timespec tp;
::host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cal_clock);
::clock_get_time(cal_clock, &tp);
return tp.tv_nsec * nanosecond + tp.tv_sec * second;
}
inline Time monotonicTime() noexcept
{
::clock_serv_t sys_clock;
::mach_timespec tp;
::host_get_clock_service(mach_host_self(), SYSTEM_CLOCK, &sys_clock);
::clock_get_time(sys_clock, &tp);
return tp.tv_nsec * nanosecond + tp.tv_sec * second;
}
inline Time realTimeCoarse() noexcept
{
return realTime();
}
inline Time monotonicTimeCoarse() noexcept
{
return monotonicTime();
}
#else
inline Time realTime()
{
::timespec tp;
int ret = ::clock_gettime(CLOCK_REALTIME, &tp);
if (ret)
throw std::runtime_error("clock_gettime");
return tp.tv_nsec * nanosecond + tp.tv_sec * second;
}
inline Time monotonicTime()
{
::timespec tp;
int ret = ::clock_gettime(CLOCK_MONOTONIC, &tp);
if (ret)
throw std::runtime_error("clock_gettime");
return tp.tv_nsec * nanosecond + tp.tv_sec * second;
}
inline Time realTimeCoarse()
{
::timespec tp;
int ret = ::clock_gettime(CLOCK_REALTIME_COARSE, &tp);
if (ret)
throw std::runtime_error("clock_gettime");
return tp.tv_nsec * nanosecond + tp.tv_sec * second;
}
inline Time monotonicTimeCoarse()
{
::timespec tp;
int ret = ::clock_gettime(CLOCK_MONOTONIC_COARSE, &tp);
if (ret)
throw std::runtime_error("clock_gettime");
return tp.tv_nsec * nanosecond + tp.tv_sec * second;
}
#endif
inline Time time()
{
return monotonicTimeCoarse();
}
inline ::timespec toTimeSpec(Time time) noexcept
{
::timespec tp;
tp.tv_sec = time / second;
tp.tv_nsec = time % second;
return tp;
}
inline ::timeval toTimeVal(Time time) noexcept
{
::timeval tv;
tv.tv_sec = time / second;
tv.tv_usec = (time % second) / microsecond;
return tv;
}
inline void sleep(Time duration) noexcept
{
::usleep(duration / microsecond);
}
}
| abique/mimosa | mimosa/time.hh | C++ | mit | 2,900 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
getname
~~~~~~~
Get popular cat/dog/superhero/supervillain names.
:copyright: (c) 2015 by lord63.
:license: MIT, see LICENSE for more details.
"""
from getname.main import random_name
__title__ = "getname"
__version__ = '0.1.1'
__author__ = "lord63"
__license__ = "MIT"
__copyright__ = "Copyright 2015 lord63"
| lord63/getname | getname/__init__.py | Python | mit | 385 |
__d("UPoCs",function(o,e,s){s.exports="Here is brisk demo!"}); | Saber-Team/brisky | www/dist/static/js/BvMT+JZAM.text.js | JavaScript | mit | 62 |
// C/C++ File
// Author: Alexandre Tea <alexandre.qtea@gmail.com>
// File: /Users/alexandretea/Work/gachc-steinerproblem/srcs/ga/FixedBinaryString.hpp
// Purpose: TODO (a one-line explanation)
// Created: 2017-01-15 20:57:05
// Modified: 2017-03-15 17:31:42
#ifndef FIXEDBINARYSTRING_H
#define FIXEDBINARYSTRING_H
#include <cstddef>
#include <vector>
#include <utility>
#include "utils/random.hpp"
#include "utils/IStringRepresentation.hpp"
namespace ga {
// TODO assert _rep_size is the same when operations between two instances
class FixedBinaryString : public utils::IStringRepresentation
{
public:
using DynamicBitset = std::vector<bool>; // will store values as bits
using ChildPair = std::pair<FixedBinaryString,
FixedBinaryString>;
public:
FixedBinaryString();
FixedBinaryString(size_t s);
FixedBinaryString(DynamicBitset const& bitset);
virtual ~FixedBinaryString();
FixedBinaryString(FixedBinaryString const& o);
FixedBinaryString& operator=(FixedBinaryString const& o);
public:
void flip(unsigned int index);
bool test(unsigned int index) const;
bool operator[](unsigned int index) const;
size_t size() const;
// Reproduction operators
ChildPair crossover_singlepoint(FixedBinaryString const& rhs) const;
ChildPair crossover_twopoint(FixedBinaryString const& rhs) const;
// Mutation operators
void flip_all();
void flip_random();
// Iterators
DynamicBitset::const_iterator begin() const;
DynamicBitset::const_iterator end() const;
DynamicBitset::iterator begin();
DynamicBitset::iterator end();
public:
virtual std::string to_string() const;
static FixedBinaryString random(size_t size);
protected:
size_t _rep_size;
DynamicBitset _rep;
};
std::ostream&
operator<<(std::ostream& s, utils::IStringRepresentation const& o);
}
#endif /* end of include guard: FIXEDBINARYSTRING_H */
| alexandretea/gachc-steinerproblem | srcs/ga/FixedBinaryString.hpp | C++ | mit | 2,172 |
var icons = [
'moneybag',
'save',
'establishment',
'completion',
'share',
'no_money',
'euro',
'palette',
'puzzle',
'backward',
'partial',
'minimize',
'tick',
'tick_thin',
'tick_bold',
'compass',
'minus',
'supplies',
'alarm',
'analytics',
'charts',
'apps',
'nine_tiles',
'archive',
'arrow_double',
'forward',
'arrow_east',
'east_arrow',
'east_thin_arrow',
'chevron_east',
'arrow_full_east',
'arrow_full_north',
'arrow_full_south',
'arrow_full_west',
'arrow_north',
'north_arrow',
'north_thin_arrow',
'chevron_north',
'arrow_south',
'south_arrow',
'south_thin_arrow',
'chevron_south',
'arrow_west',
'west_arrow',
'west_thin_arrow',
'chevron_west',
'priority_lowest',
'priority_highest',
'answer',
'api_sync',
'attach',
'banking_card',
'bill',
'birthday',
'book',
'branch',
'breakfast',
'broken_heart',
'build',
'bus',
'calendar',
'calendar_off',
'planning',
'calendar_checked',
'camera',
'car',
'certif_ok',
'certif_ko',
'certif_waiting',
'chat',
'talk',
'messenger',
'dialog',
'chrono_on',
'clean_car',
'clock',
'close',
'thin_cross',
'cross',
'cross_bold',
'coffee',
'breakTime',
'collapse',
'computer',
'computer_mouse',
'contract',
'copy',
'credit_debit',
'cut',
'dashboard',
'database',
'diner',
'discount',
'distribute',
'dollar',
'download',
'drag',
'drink',
'edit',
'edit_mini',
'edit_write',
'editFrame',
'equal',
'error',
'evolution',
'evolution_down',
'expand',
'family_tree',
'org_tree',
'file',
'file_export',
'file_import',
'import_dirty',
'import_pristine',
'filter',
'filter_abstract',
'flag',
'folder',
'forbidden',
'format_bold',
'format_clear',
'format_italic',
'format_justify',
'format_link',
'format_list_nb',
'format_redo',
'format_size',
'format_strikethrough',
'format_underlined',
'format_undo',
'fullscreen',
'fullscreen_exit',
'gallery',
'gasoline',
'gift',
'present',
'heart',
'help',
'help_outline',
'history',
'home',
'hotel',
'image',
'import_cb',
'info',
'iron',
'journey',
'milestone',
'key',
'laptop',
'light_bulb',
'list',
'list_checked',
'list_todo',
'location',
'lock',
'login',
'logout',
'lucca',
'luggage',
'lunch',
'meal',
'lunch_alternative',
'mail',
'mailbox',
'stamp',
'postage',
'menu',
'hamburger_menu',
'menu_ellipsis',
'ellipsis',
'mileage',
'money',
'payment',
'notification',
'outside',
'overplanned',
'parking',
'paste',
'clipboard',
'piggy_bank',
'pause',
'pay_period',
'pin',
'plane',
'planning_edit',
'planning_manage',
'play',
'play_full',
'plus',
'plus_bold',
'postpone',
'pressing',
'pricetag',
'print',
'refresh',
'update',
'reply',
'restaurant',
'user_roles',
'rotate',
'rotate_right',
'school',
'search',
'send',
'send2User',
'settings',
'sign',
'sliders',
'snack',
'sort',
'reorder',
'star',
'stop',
'subway',
'success',
'sync',
'sync_disabled',
'table',
'target',
'taxi',
'telephone',
'test',
'timer',
'timesheet',
'thumb_down',
'thumb_up',
'thumbnail',
'toll',
'toll_dollar',
'toll_euro',
'tools',
'train',
'trash',
'truck',
'unlink',
'unlock',
'unstared',
'unwatch',
'upload',
'cloud_upload',
'user',
'face',
'user_add',
'addUser',
'user_file',
'dossier_rh',
'user_group',
'group',
'user_remove',
'wallet',
'warning',
'watch',
'weather_cloudy',
'weather_storm',
'weather_sun',
'weight',
'divide',
'crown',
'unarchive',
];
export default icons; | LuccaSA/lucca-front | packages/icons/icons-list.js | JavaScript | mit | 3,468 |
import Ember from 'ember';
import moment from 'moment';
import dateFormat from '../utils/date-format';
export default Ember.Controller.extend({
loadingMeta: false,
notify: Ember.inject.service(),
aggController: Ember.inject.controller('discover.aggregate'),
queryParams: ['center', 'obs_date__le', 'obs_date__ge', 'agg', 'location_geom__within'],
obs_date__le: dateFormat(moment()),
obs_date__ge: dateFormat(moment().subtract(90, 'days')),
agg: 'week',
center: 'default',
location_geom__within: null,
_resetParams() {
this.set('obs_date__le', dateFormat(moment()));
this.set('obs_date__ge', dateFormat(moment().subtract(90, 'days')));
this.set('agg', 'week');
this.set('center', 'default');
this.set('location_geom__within', null);
},
queryParamsHash: Ember.computed('obs_date__le', 'obs_date__ge',
'agg', 'center', 'location_geom__within', function () {
return this.getProperties(this.get('queryParams'));
}),
queryParamsClone() {
return Ember.copy(this.get('queryParamsHash'));
},
// Central location to define all acceptable values for aggregate-query-maker
// IDs for cities, their display names, and bounds (usually city limits)
// City bounding boxes determined via https://www.mapdevelopers.com/geocode_bounding_box.php
cities: {
default: {
// "Cities" named "default" are not shown to the user
// This is a copy of Chicago
bounds: [
[42.023131, -87.940267], // NW corner
[41.644335, -87.523661], // SE corner
],
location: [41.795509, -87.581916],
zoom: 10,
},
chicago: {
label: 'Chicago, IL',
bounds: [
[42.023131, -87.940267], // NW corner
[41.644335, -87.523661], // SE corner
],
location: [41.795509, -87.581916],
zoom: 10,
},
newyork: {
label: 'New York, NY',
bounds: [
[40.917577, -74.259090], // NW corner
[40.477399, -73.700272], // SE corner
],
location: [40.7268362, -74.0017699],
zoom: 10,
},
seattle: {
label: 'Seattle, WA',
bounds: [
[47.734140, -122.459696],
[47.491912, -122.224433],
],
location: [47.6076397, -122.3258644],
zoom: 10,
},
sanfrancisco: {
label: 'San Francisco, CA',
bounds: [
[37.929820, -123.173825], // NW corner (yes, the city limits DO include those tiny islands)
[37.639830, -122.281780], // SE corner
],
location: [37.7618864, -122.4406926],
zoom: 12,
},
austin: {
label: 'Austin, TX',
bounds: [
[30.516863, -97.938383], // NW corner
[30.098659, -97.568420], // SE corner
],
location: [30.3075693, -97.7399898],
zoom: 10,
},
denver: {
label: 'Denver, CO',
bounds: [
[39.914247, -105.109927], // NW corner
[39.614430, -104.600296], // SE corner
],
location: [39.7534338, -104.890141],
zoom: 11,
},
bristol: {
label: 'Bristol, England, UK',
bounds: [
[51.544433, -2.730516], // NW corner
[51.392545, -2.450902], // SE corner
],
location: [51.4590572, -2.5909956],
zoom: 11,
},
atlanta: {
label: 'Atlanta, GA',
bounds: [
[33.647808, -84.551819],
[33.887618, -84.2891076],
],
location: [33.748998, -84.388113],
zoom: 10,
},
},
aggOptions: ([
{ id: 'day', label: 'day' },
{ id: 'week', label: 'week' },
{ id: 'month', label: 'month' },
{ id: 'quarter', label: 'quarter' },
{ id: 'year', label: 'year' },
]),
resOptions: ([
{ id: '100', label: '100 meters' },
{ id: '200', label: '200 meters' },
{ id: '300', label: '300 meters' },
{ id: '400', label: '400 meters' },
{ id: '500', label: '500 meters' },
{ id: '1000', label: '1 kilometer' },
]),
// ------------- end of central aggregate-query-maker values ---------------//
// _zoomIn() {
// this.set('zoom', true);
// const self = this;
// Ember.run.next(() => {
// self.set('zoom', false);
// });
// },
_resetDatePickers() {
this.set('override', true);
Ember.run.next(() => {
this.set('override', false);
});
},
_inIndex() {
// Thanks: https://gist.github.com/eliotsykes/8954cf64fcd0df16f519
return Ember.getOwner(this).lookup('controller:application').currentPath === 'discover.index';
},
actions: {
submit() {
if (this.get('submitCooldown')) {
this.get('notify').info('Cooldown active. Please wait a few seconds between query submissions.');
return;
}
// Implement a cooldown on the submit button to
// prevent double-clicks from reloading the query
// before a new one begins (resulting in undefined behavior)
this.set('submitCooldown', true);
Ember.run.later(this, function () {
this.set('submitCooldown', false);
}, 500);
// Reflect to find if we need to transition,
// or just reload current model.
if (this._inIndex()) {
this.transitionToRoute('discover.aggregate');
} else {
this.get('aggController').send('submit');
}
// Refocus map on user-drawn shape.
// if (this.get('location_geom__within')) {
// this._zoomIn();
// }
},
reset() {
if (!this._inIndex()) {
this.transitionToRoute('index');
}
this._resetParams();
this._resetDatePickers();
},
},
});
| UrbanCCD-UChicago/plenario-explorer | app/controllers/discover.js | JavaScript | mit | 5,637 |
<div class="form-group {{ $errors->has('name') ? 'has-error' : '' }}">
{{ Form::label('name', 'Name') }}
{{ Form::text('name', old('name'), ['class' => 'form-control']) }}
@if ($errors->has('name'))
<span class="help-block">{{ $errors->first('name') }}</span>
@endif
</div>
<div class="form-group {{ $errors->has('email') ? 'has-error' : '' }}">
{{ Form::label('email', 'Email') }}
{{ Form::text('email', old('email'), ['class' => 'form-control']) }}
@if ($errors->has('email'))
<span class="help-block">{{ $errors->first('email') }}</span>
@endif
</div>
<div class="form-group {{ $errors->has('phone') ? 'has-error' : '' }}">
{{ Form::label('phone', 'Telephone') }}
{{ Form::text('phone', old('phone'), ['class' => 'form-control']) }}
@if ($errors->has('phone'))
<span class="help-block">{{ $errors->first('phone') }}</span>
@endif
</div>
<div class="form-group {{ $errors->has('age') ? 'has-error' : '' }}">
{{ Form::label('age', 'Age') }}
{{ Form::text('age', old('age'), ['class' => 'form-control']) }}
@if ($errors->has('age'))
<span class="help-block">{{ $errors->first('age') }}</span>
@endif
</div>
<div class="form-group {{ $errors->has('gender') ? 'has-error' : '' }}">
@foreach ( $genders as $key => $val )
<label class="radio-inline" for="gender_{{ $key }}">
@if ( isset($patient) )
{{ Form::radio('gender', $key, $patient->gender == $key, ['id' => "gender_${key}"]) }}
@else
<input type="radio" name="gender" value="{{ $key }}" id="{{ "gender_${key}" }}"
{{ old('gender') === $key ? 'checked' : '' }}>
@endif
{{ $val }}
</label>
@endforeach
@if ($errors->has('gender'))
<span class="help-block">{{ $errors->first('gender') }}</span>
@endif
</div>
<div class="form-group {{ $errors->has('surgeon_id') ? 'has-error' : '' }}">
{{ Form::label('surgeon_id', 'Surgeon') }}
{{ Form::select('surgeon_id', $surgeons, old('surgeon_id'), ['class' => 'form-control']) }}
@if ($errors->has('surgeon_id'))
<span class="help-block">{{ $errors->first('surgeon_id') }}</span>
@endif
</div>
<div class="form-group actions">
{{ Form::submit('Add', ['class'=> 'submit']) }}
<a href="{{ route('patients.index') }}" class="cancel">Cancel</a>
</div> | brianally/infoframe | resources/views/patients/_form.blade.php | PHP | mit | 2,629 |
version https://git-lfs.github.com/spec/v1
oid sha256:5df6faea233808c6556f6ab7b79d7e126b054faf6651af82437fe36f225404cf
size 1193
| yogeshsaroya/new-cdnjs | ajax/libs/uikit/2.6.0/js/addons/form-password.min.js | JavaScript | mit | 129 |
<?php
declare(strict_types = 1);
namespace Apha\Testing;
interface TraceableEventHandler
{
/**
* @return array
*/
public function getEvents(): array;
/**
* @return void
*/
public function clearTraceLog();
}
| martyn82/apha | src/main/Apha/Testing/TraceableEventHandler.php | PHP | mit | 246 |
/*
* Copyright (c) 2014 airbug Inc. All rights reserved.
*
* All software, both binary and source contained in this work is the exclusive property
* of airbug Inc. Modification, decompilation, disassembly, or any other means of discovering
* the source code of this software is prohibited. This work is protected under the United
* States copyright law and other international copyright treaties and conventions.
*/
//-------------------------------------------------------------------------------
// Annotations
//-------------------------------------------------------------------------------
//@Export('bugyarn.Yarn')
//@Require('ArgumentBug')
//@Require('Bug')
//@Require('Class')
//@Require('Obj')
//@Require('ObjectUtil')
//@Require('Set')
//@Require('TypeUtil')
//-------------------------------------------------------------------------------
// Context
//-------------------------------------------------------------------------------
require('bugpack').context("*", function(bugpack) {
//-------------------------------------------------------------------------------
// BugPack
//-------------------------------------------------------------------------------
var ArgumentBug = bugpack.require('ArgumentBug');
var Bug = bugpack.require('Bug');
var Class = bugpack.require('Class');
var Obj = bugpack.require('Obj');
var ObjectUtil = bugpack.require('ObjectUtil');
var Set = bugpack.require('Set');
var TypeUtil = bugpack.require('TypeUtil');
//-------------------------------------------------------------------------------
// Declare Class
//-------------------------------------------------------------------------------
/**
* @class
* @extends {Obj}
*/
var Yarn = Class.extend(Obj, {
_name: "bugyarn.Yarn",
//-------------------------------------------------------------------------------
// Constructor
//-------------------------------------------------------------------------------
/**
* @constructs
* @param {Object} yarnContext
* @param {LoomContext} loomContext
*/
_constructor: function(yarnContext, loomContext) {
this._super();
//-------------------------------------------------------------------------------
// Private Properties
//-------------------------------------------------------------------------------
/**
* @private
* @type {LoomContext}
*/
this.loomContext = loomContext;
/**
* @private
* @type {Set.<string>}
*/
this.spunSet = new Set();
/**
* @private
* @type {Object}
*/
this.yarnContext = yarnContext;
},
//-------------------------------------------------------------------------------
// Getters and Setters
//-------------------------------------------------------------------------------
/**
* @return {LoomContext}
*/
getLoomContext: function() {
return this.loomContext;
},
/**
* @return {Object}
*/
getYarnContext: function() {
return this.yarnContext;
},
//-------------------------------------------------------------------------------
// Public Methods
//-------------------------------------------------------------------------------
/**
* @param {string} yarnName
* @return {*}
*/
get: function(yarnName) {
return this.yarnContext[yarnName];
},
/**
* @param {(string | Array.<string>)} winderNames
*/
spin: function(winderNames) {
var _this = this;
if (TypeUtil.isString(winderNames)) {
winderNames = [winderNames];
}
if (!TypeUtil.isArray(winderNames)) {
throw new ArgumentBug(ArgumentBug.ILLEGAL, "winderNames", winderNames, "parameter must either be either a string or an array of strings");
}
winderNames.forEach(function(winderName) {
if (!_this.spunSet.contains(winderName)) {
/** @type {Winder} */
var winder = _this.loomContext.getWinderByName(winderName);
if (!winder) {
throw new Bug("NoWinder", {}, "Cannot find Winder by the name '" + winderName + "'");
}
_this.spunSet.add(winderName);
winder.runWinder(_this);
}
});
},
/**
* @param {string} weaverName
* @param {Array.<*>=} args
* @return {*}
*/
weave: function(weaverName, args) {
if (!TypeUtil.isString(weaverName)) {
throw new ArgumentBug(ArgumentBug.ILLEGAL, "weaverName", weaverName, "parameter must either be a string");
}
/** @type {Weaver} */
var weaver = this.loomContext.getWeaverByName(weaverName);
if (!weaver) {
throw new Bug("NoWeaver", {}, "Cannot find Weaver by the name '" + weaverName + "'");
}
return weaver.runWeaver(this, args);
},
/**
* @param {Object} windObject
*/
wind: function(windObject) {
var _this = this;
ObjectUtil.forIn(windObject, function(yarnName, yarnValue) {
if (!ObjectUtil.hasProperty(_this.yarnContext, yarnName)) {
_this.yarnContext[yarnName] = yarnValue;
}
});
}
});
//-------------------------------------------------------------------------------
// Exports
//-------------------------------------------------------------------------------
bugpack.export('bugyarn.Yarn', Yarn);
});
| airbug/bugyarn | libraries/bugyarn/js/src/Yarn.js | JavaScript | mit | 6,157 |
// _____ _ _ _ _ _
// | ___| | (_) | | | | | |
// _ __ |___ \ ___| |_ ___| | ____ _| |__ | | ___
// | '_ \ \ \/ __| | |/ __| |/ / _` | '_ \| |/ _ \
// | |_) /\__/ / (__| | | (__| < (_| | |_) | | __/
// | .__/\____(_)___|_|_|\___|_|\_\__,_|_.__/|_|\___|
// | | www.github.com/lartu/p5.clickable
// |_| created by Lartu, version 1.2
//Determines if the mouse was pressed on the previous frame
var cl_mouseWasPressed = false;
//Last hovered button
var cl_lastHovered = null;
//Last pressed button
var cl_lastClicked = null;
//All created buttons
var cl_clickables = [];
//This function is what makes the magic happen and should be ran after
//each draw cycle.
p5.prototype.runGUI = function(){
for(i = 0; i < cl_clickables.length; ++i){
if(cl_lastHovered != cl_clickables[i])
cl_clickables[i].onOutside();
}
if(cl_lastHovered != null){
if(cl_lastClicked != cl_lastHovered){
cl_lastHovered.onHover();
}
}
if(!cl_mouseWasPressed && cl_lastClicked != null){
cl_lastClicked.onPress();
}
if(cl_mouseWasPressed && !mouseIsPressed && cl_lastClicked != null){
if(cl_lastClicked == cl_lastHovered){
cl_lastClicked.onRelease();
}
cl_lastClicked = null;
}
cl_lastHovered = null;
cl_mouseWasPressed = mouseIsPressed;
}
p5.prototype.registerMethod('post', p5.prototype.runGUI);
//Button Class
function Clickable(x,y,img)
{
this.x = x || 0; //X position of the clickable
this.y = y || 0; //Y position of the clickable
this.width = img ? img.width : 100; //Width of the clickable
this.height = img ? img.height : 50; //Height of the clickable
this.color = "#FFFFFF"; //Background color of the clickable
this.cornerRadius = 10; //Corner radius of the clickable
this.strokeWeight = 2; //Stroke width of the clickable
this.stroke = "#000000"; //Border color of the clickable
this.text = "Press Me"; //Text of the clickable
this.textColor = "#000000"; //Color for the text shown
this.textSize = 12; //Size for the text shown
this.textFont = "sans-serif"; //Font for the text shown
this.img = img;
this.onHover = function(){
//This function is ran when the clickable is hovered but not
//pressed.
}
this.onOutside = function(){
//This function is ran when the clickable is NOT hovered.
}
this.onPress = function(){
//This function is ran when the clickable is pressed.
}
this.onRelease = function(){
//This funcion is ran when the cursor was pressed and then
//released inside the clickable. If it was pressed inside and
//then released outside this won't work.
}
this.locate = function(x, y){
this.x = x;
this.y = y;
}
this.resize = function(w, h){
this.width = w;
this.height = h;
}
this.draw = function()
{
if (this.img != null)
{
image(this.img, this.x, this.y, this.width, this.height);
} else
{
fill(this.color);
stroke(this.stroke);
strokeWeight(this.strokeWeight);
rect(this.x, this.y, this.width, this.height, this.cornerRadius);
fill(this.textColor);
noStroke();
textAlign(CENTER, CENTER);
textSize(this.textSize);
textFont(this.textFont);
text(this.text, this.x+1, this.y+1, this.width, this.height);
}
if(mouseX >= this.x && mouseY >= this.y
&& mouseX < this.x+this.width && mouseY < this.y+this.height){
cl_lastHovered = this;
if(mouseIsPressed && !cl_mouseWasPressed)
cl_lastClicked = this;
}
}
cl_clickables.push(this);
}
| alexlamb/alexlamb.github.io | js/virus/p5.clickable.js | JavaScript | mit | 3,452 |
require 'pathname'
require 'sqlite3'
require 'active_record'
require 'logger'
require 'sinatra'
APP_ROOT = Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), '..')))
APP_NAME = APP_ROOT.basename.to_s
DB_PATH = APP_ROOT.join('db', APP_NAME + ".db").to_s
if ENV['DEBUG']
ActiveRecord::Base.logger = Logger.new(STDOUT)
end
# Automatically load every file in APP_ROOT/app/models/*.rb, e.g.,
# autoload "Person", 'app/models/person.rb'
#
# See http://www.rubyinside.com/ruby-techniques-revealed-autoload-1652.html
Dir[APP_ROOT.join('app', 'models', '*.rb')].each do |model_file|
filename = File.basename(model_file).gsub('.rb', '')
autoload ActiveSupport::Inflector.camelize(filename), model_file
end
ActiveRecord::Base.establish_connection :adapter => 'sqlite3',
:database => DB_PATH
require_relative 'controllers/todo_control'
# get '/' do
# @notes = Task.all :order => :id.desc
# @title = 'All Notes'
# erb :home
# end
# post '/' do
# n = Task.create({:content => params[:content], :complete => false})
# redirect '/'
# end
# get '/:id' do
# @note = Task.find(params[:id])
# @title = "Edit note ##{params[:id]}"
# erb :edit
# end
# put '/:id' do
# n = Task.find(params[:id])
# n.content = params[:content]
# n.complete = params[:complete] ? 1 : 0
# n.save
# redirect '/'
# end
# get '/:id/delete' do
# @note = Task.find(params[:id])
# @title = "Confirm deletion of note ##{params[:id]}"
# erb :delete
# end
# delete '/:id' do
# Task.destroy(params[:id])
# redirect '/'
# end
# get '/:id/complete' do
# n = Task.find(params[:id])
# n.complete = n.complete ? 0 : 1 #flip the state
# n.save
# redirect '/'
# end
################## Leftover from ARGV DBC prompt
# puts "Put your application code in #{File.expand_path(__FILE__)}"
# input = ARGV.dup
# command = input.shift
# desc = input.join(" ")
# task_id = desc.to_i
# case command
# when "list"
# task_set = Task.all
# task_set.each do |task|
# task.complete ? completeness = "X" : completeness = " "
# p "[#{completeness}] " + task.id.to_s + " - " + task.description
# end
# when "add"
# new_task = {description: desc, complete: false }
# Task.create(new_task)
# p "Task added."
# when "delete"
# Task.destroy(task_id)
# p "Task deleted."
# when "complete"
# target_task = Task.find(task_id)
# target_task.complete = true
# target_task.save
# p "Task marked as complete"
# end
| whitfieldc/Sinatra_tasks | ar_todos/app/todo.rb | Ruby | mit | 2,548 |
"use strict";
let express = require('express');
let app = express();
let bodyParser = require('body-parser');
var randomPoem = require('./tools/poemBuilder1.js')
app.set('view engine', 'ejs');
app.set('views', __dirname + '/views');
app.use(express.static("client"))
app.use(bodyParser.json());
app.get("/poem", function(req, res) {
res.render('index', {data: randomPoem()});
})
/////???????////?////????//?
let mongoose = require('mongoose');
mongoose.connect("mongodb://localhost/literate_telegram");
let WordPairSchema = new mongoose.Schema({
aKey: String,
bKey: String,
cKey: String,
aPhones: String,
bPhones: String,
cPhones: String,
aCount: Number,
bCount: Number,
cCount: Number,
occurances: Number,
});
let PronunciationSchema = new mongoose.Schema({
key: String,
phones: String,
syllable_count: Number,
alternate: Boolean
});
var Pronunciation = mongoose.model("Pronunciation", PronunciationSchema);
var WordPair = mongoose.model("WordPair", WordPairSchema);
app.post("/pronunciation", function(req, res){
console.log(req.body);
// Pronunciation.findOne({key: req.body.key}, function(err, word){
// if(err) res.status(404).json(err)
// else res.json(word);
// })
})
app.get("/word-pairs/random", function(req, res){
WordPair.aggregate([{$sample: {size: 1}},{$project: {_id: false, aKey:true, bKey:true}}], function(err, words){
res.json(words[0]);
});
})
app.post("/word-pairs/next", function(req, res){
// console.log(req.body)
WordPair.aggregate([{$match: {aKey: req.body.bKey}}, {$sample: {size: 1}}, {$project: {_id: false, aKey:true, bKey:true}}], function(err, pairs){
// console.log(pairs);
res.json(pairs);
})
})
app.listen(1337, function(){
console.log('l33t rhymes')
}); | robotson/literate-telegram | index.js | JavaScript | mit | 1,777 |
<?php
require("./includes/daySeasson.php");
@$page=$_GET['page'];
switch($page){
case "aktivnosti":
include "view.php";
$view=str_replace("<!-- SAT -->", insertClock() ,$view);
$view=setActivity($view,$daySesson);
$view=setTitle("Aktivnosti u toku izbora",$view);
break;
case "izlaznost":
include "view.php";
$view=makeBirackaMestaList("install/izborna_mesta_Novi_Sad.txt",$view,$daySesson);
$view=setTitle("Izlaznost",$view);
break;
case "lokalni-rezultati-po-birackim-mestima":
include "view.php";
$view=makeRezultatiTabela("install/izborna_mesta_Novi_Sad.txt","lokalni",$view);
$view=setTitle("Rezultati u Novom Sadu za gradski parlament po biračkim mestima",$view);
break;
case "lokalni-rezultati-po-listama":
include "view.php";
$view=makeRezultatiGraph("lokalni",$view);
$view=setTitle("Rezultati u Novom Sadu za gradski parlament po listama",$view);
break;
case "pokrajinski-rezultati-po-birackim-mestima":
include "view.php";
$view=makeRezultatiTabela("install/izborna_mesta_Novi_Sad.txt","pokrajinski",$view);
$view=setTitle("Rezultati u Novom Sadu za pokrajinski parlament po biračkim mestima",$view);
break;
case "pokrajinski-rezultati-po-listama":
include "view.php";
$view=makeRezultatiGraph("pokrajinski",$view);
$view=setTitle("Rezultati u Novom Sadu za pokrajinski parlament po listama",$view);
break;
case "republicki-rezultati-po-birackim-mestima":
include "view.php";
$view=makeRezultatiTabela("install/izborna_mesta_Novi_Sad.txt","republicki",$view);
$view=setTitle("Rezultati u Novom Sadu za republički parlament po biračkim mestima",$view);
break;
case "republicki-rezultati-po-listama":
include "view.php";
$view=makeRezultatiGraph("republicki",$view);
$view=setTitle("Rezultati u Novom Sadu za republički parlament po listama",$view);
break;
case "izborne-liste-lokalni":
include "view.php";
$view=makeList("install/gradske_izborne_liste.txt",$view);
$view=setTitle("Izborne liste za gradski parlament u Novom Sadu",$view);
break;
case "izborne-liste-pokrajinski":
include "view.php";
$view=makeList("install/pokrajinske_izborne_liste.txt",$view);
$view=setTitle("Izborne liste za pokrajinski parlament",$view);
break;
case "izborne-liste-republicki":
include "view.php";
$view=makeList("install/republicke_izborne_liste.txt",$view);
$view=setTitle("Izborne liste za republički parlament",$view);
break;
case "o-nama":
include "view.php";
$view=setTitle("Tim koji je doprineo stvaranju ovog softvera",$view);
break;
case "get":
require ("./includes/get.php");
break;
case "post":
require ("./includes/post.php");
$view="WRITEN";
break;
case "conf":
require ("./includes/conf.php");
break;
default :
$page='aktivnosti';
include "view.php";
$view=str_replace("<!-- SAT -->", insertClock() ,$view);
$view=setActivity($view,$daySesson);
break;
}
echo $view;
?>
| IvanDermanov/izbori | index.php | PHP | mit | 3,087 |
require 'spec_helper'
describe Blimp::Handler do
it 'should find handlers by name' do
Blimp::Handler.find_by_name("static").should be(Blimp::Handlers::StaticHandler)
Blimp::Handler.find_by_name("page").should be(Blimp::Handlers::PageHandler)
end
it 'should raise on unknown handlers' do
expect {
Blimp::Handler.find_by_name("unknown")
}.to raise_error(Blimp::Handler::HandlerNotFound)
end
end
| ttencate/blimp | spec/blimp/handler_spec.rb | Ruby | mit | 425 |
from cse.util import Util
from collections import OrderedDict
from cse.pipeline import Handler
class WpApiParser(Handler):
def __init__(self):
super()
def parse(self, comments, url, assetId, parentId):
data = self.__buildDataSkeleton(url, assetId)
data["comments"] = self.__iterateComments(comments, parentId)
return data
def __buildDataSkeleton(self, url, assetId):
return {
"article_url" : url,
"article_id" : assetId,
"comments" : None
}
def __iterateComments(self, comments, parentId=None):
commentList = OrderedDict()
for comment in comments:
votes = 0
for action_summary in comment["action_summaries"]:
if action_summary["__typename"] == "LikeActionSummary":
votes = action_summary["count"]
commentObject = {
"comment_author": comment["user"]["username"],
"comment_text" : comment["body"],
"timestamp" : comment["created_at"],
"parent_comment_id" : parentId,
"upvotes" : votes,
"downvotes": 0
}
commentList[comment["id"]] = commentObject
try:
commentReplies = self.__iterateComments(comment["replies"]["nodes"], comment["id"])
except KeyError: # There may be a limit of the nesting level of comments on wp
commentReplies = {}
commentList.update(commentReplies)
return commentList
# inherited from cse.pipeline.Handler
def registeredAt(self, ctx):
pass
def process(self, ctx, data):
result = self.parse(
comments=data["comments"],
url=data["url"],
assetId=data["assetId"],
parentId=data["parentId"]
)
ctx.write(result)
| CodeLionX/CommentSearchEngine | cse/WpApiParser.py | Python | mit | 1,919 |
module CerberusCore::Datastreams
# Datastream for holding the results of FITS characterization, which can be run
# against FileContentDatastream datastreams via the Characterizable concern.
class FitsDatastream < ActiveFedora::OmDatastream
include OM::XML::Document
set_terminology do |t|
t.root(:path => "fits",
:xmlns => "http://hul.harvard.edu/ois/xml/ns/fits/fits_output",
:schema => "http://hul.harvard.edu/ois/xml/xsd/fits/fits_output.xsd")
t.identification {
t.identity {
t.format_label(:path=>{:attribute=>"format"})
t.mime_type(:path=>{:attribute=>"mimetype"}, index_as: [:stored_searchable])
}
}
t.fileinfo {
t.file_size(:path=>"size")
t.last_modified(:path=>"lastmodified")
t.filename(:path=>"filename")
t.original_checksum(:path=>"md5checksum")
t.rights_basis(:path=>"rightsBasis")
t.copyright_basis(:path=>"copyrightBasis")
t.copyright_note(:path=>"copyrightNote")
}
t.filestatus {
t.well_formed(:path=>"well-formed")
t.valid(:path=>"valid")
t.status_message(:path=>"message")
}
t.metadata {
t.document {
t.file_title(:path=>"title")
t.file_author(:path=>"author")
t.file_language(:path=>"language")
t.page_count(:path=>"pageCount")
t.word_count(:path=>"wordCount")
t.character_count(:path=>"characterCount")
t.paragraph_count(:path=>"paragraphCount")
t.line_count(:path=>"lineCount")
t.table_count(:path=>"tableCount")
t.graphics_count(:path=>"graphicsCount")
}
t.image {
t.byte_order(:path=>"byteOrder")
t.compression(:path=>"compressionScheme")
t.width(:path=>"imageWidth")
t.height(:path=>"imageHeight")
t.color_space(:path=>"colorSpace")
t.profile_name(:path=>"iccProfileName")
t.profile_version(:path=>"iccProfileVersion")
t.orientation(:path=>"orientation")
t.color_map(:path=>"colorMap")
t.image_producer(:path=>"imageProducer")
t.capture_device(:path=>"captureDevice")
t.scanning_software(:path=>"scanningSoftwareName")
t.exif_version(:path=>"exifVersion")
t.gps_timestamp(:path=>"gpsTimeStamp")
t.latitude(:path=>"gpsDestLatitude")
t.longitude(:path=>"gpsDestLongitude")
}
t.text {
t.character_set(:path=>"charset")
t.markup_basis(:path=>"markupBasis")
t.markup_language(:path=>"markupLanguage")
}
t.audio {
t.duration(:path=>"duration")
t.bit_depth(:path=>"bitDepth")
t.sample_rate(:path=>"sampleRate")
t.channels(:path=>"channels")
t.data_format(:path=>"dataFormatType")
t.offset(:path=>"offset")
}
t.video {
# Not yet implemented in FITS
}
}
t.format_label(:proxy=>[:identification, :identity, :format_label])
t.mime_type(:proxy=>[:identification, :identity, :mime_type])
t.file_size(:proxy=>[:fileinfo, :file_size])
t.last_modified(:proxy=>[:fileinfo, :last_modified])
t.filename(:proxy=>[:fileinfo, :filename])
t.original_checksum(:proxy=>[:fileinfo, :original_checksum])
t.rights_basis(:proxy=>[:fileinfo, :rights_basis])
t.copyright_basis(:proxy=>[:fileinfo, :copyright_basis])
t.copyright_note(:proxy=>[:fileinfo, :copyright_note])
t.well_formed(:proxy=>[:filestatus, :well_formed])
t.valid(:proxy=>[:filestatus, :valid])
t.status_message(:proxy=>[:filestatus, :status_message])
t.file_title(:proxy=>[:metadata, :document, :file_title])
t.file_author(:proxy=>[:metadata, :document, :file_author])
t.page_count(:proxy=>[:metadata, :document, :page_count])
t.file_language(:proxy=>[:metadata, :document, :file_language])
t.word_count(:proxy=>[:metadata, :document, :word_count])
t.character_count(:proxy=>[:metadata, :document, :character_count])
t.paragraph_count(:proxy=>[:metadata, :document, :paragraph_count])
t.line_count(:proxy=>[:metadata, :document, :line_count])
t.table_count(:proxy=>[:metadata, :document, :table_count])
t.graphics_count(:proxy=>[:metadata, :document, :graphics_count])
t.byte_order(:proxy=>[:metadata, :image, :byte_order])
t.compression(:proxy=>[:metadata, :image, :compression])
t.width(:proxy=>[:metadata, :image, :width])
t.height(:proxy=>[:metadata, :image, :height])
t.color_space(:proxy=>[:metadata, :image, :color_space])
t.profile_name(:proxy=>[:metadata, :image, :profile_name])
t.profile_version(:proxy=>[:metadata, :image, :profile_version])
t.orientation(:proxy=>[:metadata, :image, :orientation])
t.color_map(:proxy=>[:metadata, :image, :color_map])
t.image_producer(:proxy=>[:metadata, :image, :image_producer])
t.capture_device(:proxy=>[:metadata, :image, :capture_device])
t.scanning_software(:proxy=>[:metadata, :image, :scanning_software])
t.exif_version(:proxy=>[:metadata, :image, :exif_version])
t.gps_timestamp(:proxy=>[:metadata, :image, :gps_timestamp])
t.latitude(:proxy=>[:metadata, :image, :latitude])
t.longitude(:proxy=>[:metadata, :image, :longitude])
t.character_set(:proxy=>[:metadata, :text, :character_set])
t.markup_basis(:proxy=>[:metadata, :text, :markup_basis])
t.markup_language(:proxy=>[:metadata, :text, :markup_language])
t.duration(:proxy=>[:metadata, :audio, :duration])
t.bit_depth(:proxy=>[:metadata, :audio, :bit_depth])
t.sample_rate(:proxy=>[:metadata, :audio, :sample_rate])
t.channels(:proxy=>[:metadata, :audio, :channels])
t.data_format(:proxy=>[:metadata, :audio, :data_format])
t.offset(:proxy=>[:metadata, :audio, :offset])
end
def self.xml_template
builder = Nokogiri::XML::Builder.new do |xml|
xml.fits(:xmlns => 'http://hul.harvard.edu/ois/xml/ns/fits/fits_output',
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
'xsi:schemaLocation' =>
"http://hul.harvard.edu/ois/xml/ns/fits/fits_output
http://hul.harvard.edu/ois/xml/xsd/fits/fits_output.xsd",
:version => "0.6.0",
:timestamp => "1/25/12 11:04 AM") {
xml.identification {
xml.identity(:format => '', :mimetype => '',
:toolname => 'FITS', :toolversion => '') {
xml.tool(:toolname => '', :toolversion => '')
xml.version(:toolname => '', :toolversion => '')
xml.externalIdentifier(:toolname => '', :toolversion => '')
}
}
xml.fileinfo {
xml.size(:toolname => '', :toolversion => '')
xml.creatingApplicatioName(:toolname => '', :toolversion => '',
:status => '')
xml.lastmodified(:toolname => '', :toolversion => '', :status => '')
xml.filepath(:toolname => '', :toolversion => '', :status => '')
xml.filename(:toolname => '', :toolversion => '', :status => '')
xml.md5checksum(:toolname => '', :toolversion => '', :status => '')
xml.fslastmodified(:toolname => '', :toolversion => '', :status => '')
}
xml.filestatus {
xml.tag! "well-formed", :toolname => '', :toolversion => '', :status => ''
xml.valid(:toolname => '', :toolversion => '', :status => '')
}
xml.metadata {
xml.document {
xml.title(:toolname => '', :toolversion => '', :status => '')
xml.author(:toolname => '', :toolversion => '', :status => '')
xml.pageCount(:toolname => '', :toolversion => '')
xml.isTagged(:toolname => '', :toolversion => '')
xml.hasOutline(:toolname => '', :toolversion => '')
xml.hasAnnotations(:toolname => '', :toolversion => '')
xml.isRightsManaged(:toolname => '', :toolversion => '',
:status => '')
xml.isProtected(:toolname => '', :toolversion => '')
xml.hasForms(:toolname => '', :toolversion => '', :status => '')
}
}
}
end
builder.doc
end
def prefix
""
end
end
end | NEU-Libraries/cerberus_core | lib/cerberus_core/datastreams/fits_datastream.rb | Ruby | mit | 8,529 |
using System;
using System.Diagnostics;
using BCurve=NS_GMath.I_BCurveD;
namespace NS_GMath
{
public class Param
{
/*
* CONSTS & ENUMS
*/
public const double Infinity=2.0e20;
public const double Degen=1.0e20;
public const double Invalid=1.5e20;
public enum TypeParam
{
Before=-2,
Start=-1,
Inner=0,
End=1,
After=2,
Invalid=100,
};
/*
* MEMBERS
*/
double val;
/*
* PROPERTIES
*/
public double Val
{
get { return this.val; }
set
{
if (Math.Abs(value)>Param.Infinity)
{
value=Param.Infinity*Math.Sign(value);
}
this.val=value;
}
}
public bool IsValid
{
get { return (this.val!=Param.Invalid); }
}
public bool IsFictive
{
get { return ((this.IsDegen)||(this.IsInfinite)||(!this.IsValid)); }
}
public bool IsDegen
{
get { return (this.val==Param.Degen); }
}
public bool IsInfinite
{
get { return (Math.Abs(this.val)==Param.Infinity); }
}
/*
* CONSTRUCTORS
*/
protected Param()
{
this.val=0.5;
}
public Param(double val)
{
this.Val=val;
}
/*
* METHODS
*/
virtual public void ClearRelease()
{
}
virtual public Param Copy()
{
return new Param(this.val);
}
public void Invalidate()
{
this.val=Param.Invalid;
}
public void Round(params double[] valRound)
{
for (int i=0; i<valRound.Length; i++)
{
if (Math.Abs(this.Val-valRound[i])<MConsts.EPS_DEC)
this.Val=valRound[i];
}
}
public void Reverse(double valRev)
{
if (this.val==Param.Degen)
return;
if (this.val==Param.Invalid)
return;
if (Math.Abs(this.val)==Param.Infinity)
{
this.val=-this.val;
return;
}
this.val=valRev-this.val;
this.Clip(-Param.Infinity,Param.Infinity);
}
public void Clip(double start, double end)
{
if (start>end)
{
throw new ExceptionGMath("Param","Clip",null);
}
if (this.val==Param.Degen)
return;
if (this.val==Param.Invalid)
return;
this.Round(start,end);
if (this.Val<start)
this.Val=start;
if (this.Val>end)
this.Val=end;
}
public void FromReduced(BCurve bcurve)
{
// parameter of the (reduced)curve may be invalidated if
// the curve intersects the self-intersecting Bezier
if (this.val==Param.Invalid)
return;
if (bcurve.IsDegen)
{
return;
}
if (bcurve is Bez2D)
{
Bez2D bez=bcurve as Bez2D;
Param parM;
if (bez.IsSeg(out parM))
{
bez.ParamFromSeg(this);
}
}
}
/*
* CONVERSIONS
*/
public static implicit operator double(Param par)
{
return par.val;
}
public static implicit operator Param(double val)
{
return new Param(val);
}
}
public class CParam : Param
{
Knot knot;
/*
* CONSTRUCTORS
*/
public CParam(double val, Knot knot)
{
this.Val=val;
this.knot=knot;
}
public CParam(Param par, Knot knot)
{
if (par.GetType()!=typeof(Param))
{
throw new ExceptionGMath("Param","CParam",null);
}
this.Val=par.Val;
this.knot=knot;
}
/*
* PROPERTIES
*/
public Knot Kn
{
get { return this.knot; }
}
public int IndKnot
{
get
{
if (this.knot==null)
return GConsts.IND_UNINITIALIZED;
return this.knot.IndexKnot;
}
}
/*
* METHODS
*/
override public void ClearRelease()
{
this.knot=null;
}
override public Param Copy()
{
throw new ExceptionGMath("Param","Copy","NOT IMPLEMENTED");
//return null;
}
}
} | Microsoft/Font-Validator | GMath/Param.cs | C# | mit | 5,165 |
<?php
class Football_Pool_Admin_Options extends Football_Pool_Admin {
public function __construct() {}
private static function back_to_top() {
echo '<p class="options-page back-to-top"><a href="#">back to top</a></p>';
}
public static function help() {
$help_tabs = array(
array(
'id' => 'overview',
'title' => __( 'Overview', FOOTBALLPOOL_TEXT_DOMAIN ),
'content' => __( '<p>The fields on this page set different options for the plugin.</p><p>Some settings have effect on the ranking (e.g. points), when changing such a setting you can recalculate the ranking on this page with the <em>\'Recalculate scores\'</em> button.</p><p>You have to click <em>Save Changes</em> for the new settings to take effect.</p>', FOOTBALLPOOL_TEXT_DOMAIN )
),
);
$help_sidebar = sprintf( '<a href="?page=footballpool-help#rankings">%s</a>'
, __( 'Help section about rankings', FOOTBALLPOOL_TEXT_DOMAIN )
);
self::add_help_tabs( $help_tabs, $help_sidebar );
}
public static function admin() {
$action = Football_Pool_Utils::post_string( 'action' );
$date = date_i18n( 'Y-m-d H:i' );
$match_time_offsets = array();
// based on WordPress's functions.php
$offset_range = array(
-12, -11.5, -11, -10.5, -10, -9.5, -9, -8.5, -8, -7.5, -7,
-6.5, -6, -5.5, -5, -4.5, -4, -3.5, -3, -2.5, -2, -1.5, -1,
-0.5, 0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 5.75,
6, 6.5, 7, 7.5, 8, 8.5, 8.75, 9, 9.5, 10, 10.5, 11, 11.5,
12, 12.75, 13, 13.75, 14
);
foreach ( $offset_range as $offset ) {
if ( 0 <= $offset )
$offset_text = '+' . $offset;
else
$offset_text = (string) $offset;
$offset_text = str_replace( array( '.25', '.5', '.75' ), array( ':15', ':30', ':45' ), $offset_text );
$offset_text = 'UTC' . $offset_text;
$match_time_offsets[] = array( 'value' => $offset, 'text' => $offset_text );
}
$user_defined_rankings = array();
$pool = new Football_Pool_Pool;
$rankings = $pool->get_rankings( 'user defined' );
foreach ( $rankings as $ranking ) {
$user_defined_rankings[] = array( 'value' => $ranking['id'], 'text' => $ranking['name'] );
}
if ( $action == 'update' ) {
// in case of a save action
check_admin_referer( FOOTBALLPOOL_NONCE_ADMIN );
$offset_switch = ( Football_Pool_Utils::post_int( 'match_time_display' ) !== 2 );
$ranking_switch = ( Football_Pool_Utils::post_int( 'ranking_display' ) !== 2 );
} else {
// normal situation
$offset_switch = ( (int)Football_Pool_Utils::get_fp_option( 'match_time_display', 0, 'int' ) !== 2 );
$ranking_switch = ( (int)Football_Pool_Utils::get_fp_option( 'ranking_display', 0, 'int' ) !== 2 );
}
// get the match types for the groups page
$match_types = Football_Pool_Matches::get_match_types();
$options = array();
foreach ( $match_types as $type ) {
$options[] = array( 'value' => $type->id, 'text' => $type->name );
}
$match_types = $options;
// get the leagues
$user_defined_leagues = $pool->get_leagues( true );
$options = array();
$options[] = array( 'value' => 0, 'text' => '' );
foreach ( $user_defined_leagues as $league ) {
$options[] = array( 'value' => $league['league_id'], 'text' => $league['league_name'] );
}
$user_defined_leagues = $options;
// get the pages for the redirect option & the plugin pages
$redirect_pages = $plugin_pages = array();
$redirect_pages[] = array(
'value' => '',
'text' => ''
);
$redirect_pages[] = array(
'value' => home_url(),
'text' => __( 'homepage', FOOTBALLPOOL_TEXT_DOMAIN )
);
$redirect_pages[] = array(
'value' => admin_url( 'profile.php' ),
'text' => __( 'edit profile', FOOTBALLPOOL_TEXT_DOMAIN )
);
$args = array(
'sort_order' => 'ASC',
'sort_column' => 'post_title',
'hierarchical' => 0,
'exclude' => '',
'include' => '',
'meta_key' => '',
'meta_value' => '',
'authors' => '',
'child_of' => 0,
'parent' => -1,
'exclude_tree' => '',
'number' => '',
'offset' => 0,
'post_type' => 'page',
'post_status' => 'publish'
);
$pages = get_pages( $args );
foreach( $pages as $page ) {
$redirect_pages[] = array( 'value' => $page->guid, 'text' => $page->post_title ); // uses the URL
$plugin_pages[] = array( 'value' => $page->ID, 'text' => $page->post_title ); // uses the post ID
}
// definition of all configurable options
$options = array(
'page_id_tournament' =>
array(
array( 'select', 'integer' ),
__( 'Matches page', FOOTBALLPOOL_TEXT_DOMAIN ),
'page_id_tournament',
$plugin_pages,
'',
''
),
'page_id_teams' =>
array(
array( 'select', 'integer' ),
__( 'Team(s) page', FOOTBALLPOOL_TEXT_DOMAIN ),
'page_id_teams',
$plugin_pages,
'',
''
),
'page_id_groups' =>
array(
array( 'select', 'integer' ),
__( 'Group(s) page', FOOTBALLPOOL_TEXT_DOMAIN ),
'page_id_groups',
$plugin_pages,
'',
''
),
'page_id_stadiums' =>
array(
array( 'select', 'integer' ),
__( 'Venue(s) page', FOOTBALLPOOL_TEXT_DOMAIN ),
'page_id_stadiums',
$plugin_pages,
'',
''
),
'page_id_rules' =>
array(
array( 'select', 'integer' ),
__( 'Rules page', FOOTBALLPOOL_TEXT_DOMAIN ),
'page_id_rules',
$plugin_pages,
'',
''
),
'page_id_pool' =>
array(
array( 'select', 'integer' ),
__( 'Submit predictions page', FOOTBALLPOOL_TEXT_DOMAIN ),
'page_id_pool',
$plugin_pages,
'',
''
),
'page_id_ranking' =>
array(
array( 'select', 'integer' ),
__( 'Ranking page', FOOTBALLPOOL_TEXT_DOMAIN ),
'page_id_ranking',
$plugin_pages,
'',
''
),
'page_id_statistics' =>
array(
array( 'select', 'integer' ),
__( 'Statistics page', FOOTBALLPOOL_TEXT_DOMAIN ),
'page_id_statistics',
$plugin_pages,
'',
''
),
'page_id_user' =>
array(
array( 'select', 'integer' ),
__( 'See a user\'s predictions page', FOOTBALLPOOL_TEXT_DOMAIN ),
'page_id_user',
$plugin_pages,
'',
''
),
'redirect_url_after_login' =>
array(
array( 'select', 'string' ),
__( 'Page after registration', FOOTBALLPOOL_TEXT_DOMAIN ),
'redirect_url_after_login',
$redirect_pages,
sprintf( '%s %s'
, __( 'You can set the page where users must be redirected to after registration (and first time login).', FOOTBALLPOOL_TEXT_DOMAIN )
, __( 'Leave empty to use default behavior of WordPress.', FOOTBALLPOOL_TEXT_DOMAIN ) ),
''
),
'keep_data_on_uninstall' =>
array( 'checkbox', __( 'Keep data on uninstall', FOOTBALLPOOL_TEXT_DOMAIN ), 'keep_data_on_uninstall', __( 'If checked the options and pool data (teams, matches, predictions, etc.) are not removed when deactivating the plugin.', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'webmaster' =>
array( 'text', __( 'Webmaster', FOOTBALLPOOL_TEXT_DOMAIN ), 'webmaster', __( 'This value is used for the shortcode [fp-webmaster].', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'money' =>
array( 'text', __( 'Money', FOOTBALLPOOL_TEXT_DOMAIN ), 'money', __( 'If you play for money, then this is the sum users have to pay. The shortcode [fp-money] adds this value in the content.', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'bank' =>
array( 'text', __( 'Bank', FOOTBALLPOOL_TEXT_DOMAIN ), 'bank', __( 'If you play for money, then this is the person you have to give the money. The shortcode [fp-bank] adds this value in the content.', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'start' =>
array( 'text', __( 'Start date', FOOTBALLPOOL_TEXT_DOMAIN ), 'start', __( 'The start date of the tournament or pool. The shortcode [fp-start] adds this value in the content.', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'joker_multiplier' =>
array( 'text', __( 'Joker multiplier', FOOTBALLPOOL_TEXT_DOMAIN ) . ' *', 'joker_multiplier', __( 'Multiplier used for predictions with a joker set. The shortcode [fp-jokermultiplier] adds this value in the content. This value is also used for the calculations in the pool.', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'fullpoints' =>
array( 'text', __( 'Full score', FOOTBALLPOOL_TEXT_DOMAIN ) . ' *', 'fullpoints', __( 'The points a user gets for getting the exact outcome of a match. The shortcode [fp-fullpoints] adds this value in the content. This value is also used for the calculations in the pool.', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'totopoints' =>
array( 'text', __( 'Toto score', FOOTBALLPOOL_TEXT_DOMAIN ) . ' *', 'totopoints', __( 'The points a user gets for guessing the outcome of a match (win, loss or draw) without also getting the exact amount of goals. The shortcode [fp-totopoints] adds this value in the content. This value is also used in the calculations in the pool.', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'goalpoints' =>
array( 'text', __( 'Goal bonus', FOOTBALLPOOL_TEXT_DOMAIN ) . ' *', 'goalpoints', __( 'Extra points a user gets for guessing the goals correct for one of the teams. These points are added to the toto points or full points. The shortcode [fp-goalpoints] adds this value in the content. This value is also used in the calculations in the pool.', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'diffpoints' =>
array( 'text', __( 'Goal difference bonus', FOOTBALLPOOL_TEXT_DOMAIN ) . ' *', 'diffpoints', __( 'Extra points a user gets for guessing the goal difference correct for a match. Only awarded in matches with a winning team and only on top of toto points. See the help page for more information. The shortcode [fp-diffpoints] adds this value in the content. This value is also used in the calculations in the pool.', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'stop_time_method_matches' =>
array(
'radiolist',
__( 'Prediction stop method for matches', FOOTBALLPOOL_TEXT_DOMAIN ),
'stop_time_method_matches',
array(
array( 'value' => 0, 'text' => __( 'Dynamic time', FOOTBALLPOOL_TEXT_DOMAIN ) ),
array( 'value' => 1, 'text' => __( 'One stop date', FOOTBALLPOOL_TEXT_DOMAIN ) ),
),
__( 'Select which method to use for the prediction stop.', FOOTBALLPOOL_TEXT_DOMAIN ),
array(
'onclick="FootballPoolAdmin.toggle_linked_options( \'#r-maxperiod\', [ \'#r-matches_locktime\' ] )"',
'onclick="FootballPoolAdmin.toggle_linked_options( \'#r-matches_locktime\', [ \'#r-maxperiod\' ] )"',
),
),
'maxperiod' =>
array(
'text',
__( 'Dynamic stop threshold (in seconds) for matches', FOOTBALLPOOL_TEXT_DOMAIN ) . ' *',
'maxperiod',
__( 'A user may change his/her predictions untill this amount of time before game kickoff. The time is in seconds, e.g. 15 minutes is 900 seconds.', FOOTBALLPOOL_TEXT_DOMAIN ),
array( 'stop_time_method_matches' => 1 )
),
'matches_locktime' =>
array(
'datetime',
__( 'Prediction stop date for matches', FOOTBALLPOOL_TEXT_DOMAIN ) . ' *',
'matches_locktime',
__( 'If a valid date and time [Y-m-d H:i] is given here, then this date/time will be used as a single value before all predictions for the matches have to be entered by users. (your local time is:', FOOTBALLPOOL_TEXT_DOMAIN ) . ' <a href="options-general.php">' . $date . '</a>)',
'',
array( 'stop_time_method_matches' => 0 )
),
'stop_time_method_questions' =>
array(
'radiolist',
__( 'Use one prediction stop date for questions?', FOOTBALLPOOL_TEXT_DOMAIN ),
'stop_time_method_questions',
array(
array( 'value' => 0, 'text' => __( 'No', FOOTBALLPOOL_TEXT_DOMAIN ) ),
array( 'value' => 1, 'text' => __( 'Yes', FOOTBALLPOOL_TEXT_DOMAIN ) ),
),
__( 'Select which method to use for the prediction stop.', FOOTBALLPOOL_TEXT_DOMAIN ),
array(
'onclick="FootballPoolAdmin.toggle_linked_options( \'\', [ \'#r-bonus_question_locktime\' ] )"',
'onclick="FootballPoolAdmin.toggle_linked_options( \'#r-bonus_question_locktime\', null )"',
),
),
'bonus_question_locktime' =>
array(
'datetime',
__( 'Prediction stop date for questions', FOOTBALLPOOL_TEXT_DOMAIN ) . ' *',
'bonus_question_locktime',
__( 'If a valid date and time [Y-m-d H:i] is given here, then this date/time will be used as a single value before all predictions for the bonus questions have to be entered by users. (your local time is:', FOOTBALLPOOL_TEXT_DOMAIN ) . ' <a href="options-general.php">' . $date . '</a>)',
'',
array( 'stop_time_method_questions' => 0 )
),
'shoutbox_max_chars' =>
array( 'text', __( 'Maximum length for a shoutbox message', FOOTBALLPOOL_TEXT_DOMAIN ) . ' *', 'shoutbox_max_chars', __( 'Maximum length (number of characters) a message in the shoutbox may have.', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'use_leagues' =>
array( 'checkbox', __( 'Use leagues', FOOTBALLPOOL_TEXT_DOMAIN ), 'use_leagues', __( 'Set this if you want to use leagues in your pool. You can use this (e.g.) for paying and non-paying users, or different departments. Important: if you change this value when there are already points given, then the scoretable will not be automatically recalculated. Use the recalculate button on this page for that.', FOOTBALLPOOL_TEXT_DOMAIN ), 'onclick="jQuery(\'#r-default_league_new_user\').toggle()"' ),
'default_league_new_user' =>
array(
array( 'select', 'integer' ),
__( 'Standard league for new users', FOOTBALLPOOL_TEXT_DOMAIN ),
'default_league_new_user',
$user_defined_leagues,
__( 'The standard league a new user will be placed after registration.', FOOTBALLPOOL_TEXT_DOMAIN ),
'use_leagues'
),
'dashboard_image' =>
array( 'text', __( 'Image for Dashboard Widget', FOOTBALLPOOL_TEXT_DOMAIN ), 'dashboard_image', '<a href="' . get_admin_url() . '">Dashboard</a>' ),
'hide_admin_bar' =>
array( 'checkbox', __( 'Hide Admin Bar for subscribers', FOOTBALLPOOL_TEXT_DOMAIN ), 'hide_admin_bar', __( 'After logging in a subscriber may see an Admin Bar on top of your blog (a user option). With this plugin option you can ignore the user configuration and never show the Admin Bar.', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'use_favicon' =>
array( 'checkbox', __( 'Use favicon', FOOTBALLPOOL_TEXT_DOMAIN ), 'use_favicon', __( "Switch off if you don't want to use the icons in the plugin.", FOOTBALLPOOL_TEXT_DOMAIN ) ),
'use_touchicon' =>
array( 'checkbox', __( 'Use Apple touch icon', FOOTBALLPOOL_TEXT_DOMAIN ), 'use_touchicon', __( "Switch off if you don't want to use the icons in the plugin.", FOOTBALLPOOL_TEXT_DOMAIN ) ),
'show_team_link' =>
array( 'checkbox', __( 'Show team names as links', FOOTBALLPOOL_TEXT_DOMAIN ), 'show_team_link', __( "Switch off if you don't want to link the team names to a team info page.", FOOTBALLPOOL_TEXT_DOMAIN ) ),
// 'show_team_link' =>
// array( 'checkbox', __( 'Show team names as links', FOOTBALLPOOL_TEXT_DOMAIN ), 'show_team_link', __( "Switch off if you don't want to link the team names to a team info page.", FOOTBALLPOOL_TEXT_DOMAIN ), 'onclick="jQuery(\'#r-show_team_link_use_external\').toggle()"' ),
// 'show_team_link_use_external' =>
// array( 'checkbox', __( 'Use the external link for the link team names', FOOTBALLPOOL_TEXT_DOMAIN ), 'show_team_link_use_external', __( ".", FOOTBALLPOOL_TEXT_DOMAIN ) ),
'show_venues_on_team_page' =>
array( 'checkbox', __( 'Show venues on team page', FOOTBALLPOOL_TEXT_DOMAIN ), 'show_venues_on_team_page', __( "Switch off if you don't want to show all venues a team plays in during a season or tournament (in national competitions the venue list is a bit useless).", FOOTBALLPOOL_TEXT_DOMAIN ) ),
'use_charts' =>
array(
'checkbox',
__( 'Use charts', FOOTBALLPOOL_TEXT_DOMAIN ),
'use_charts',
sprintf(
__( 'The Highcharts API is needed for this feature. See the <%s>Help page<%s> for information on installing this library.', FOOTBALLPOOL_TEXT_DOMAIN ),
'a href="?page=footballpool-help#charts"', '/a'
)
),
'export_format' =>
array(
'radiolist',
__( 'Format for the csv export (match schedule)', FOOTBALLPOOL_TEXT_DOMAIN ),
'export_format',
array(
array( 'value' => 0, 'text' => __( 'Full data', FOOTBALLPOOL_TEXT_DOMAIN ) ),
array( 'value' => 1, 'text' => __( 'Minimal data', FOOTBALLPOOL_TEXT_DOMAIN ) ),
),
sprintf( __( 'Select the format of the csv export. See the <%s>Help page<%s> for more information.', FOOTBALLPOOL_TEXT_DOMAIN ), 'a href="?page=footballpool-help#teams-groups-and-matches"', '/a' ),
),
'match_time_display' =>
array(
'radiolist',
__( 'Match time setting', FOOTBALLPOOL_TEXT_DOMAIN ),
'match_time_display',
array(
array( 'value' => 0, 'text' => __( 'Use WordPress Timezone setting', FOOTBALLPOOL_TEXT_DOMAIN ) ),
array( 'value' => 1, 'text' => __( 'Use UTC time', FOOTBALLPOOL_TEXT_DOMAIN ) ),
array( 'value' => 2, 'text' => __( 'Custom setting', FOOTBALLPOOL_TEXT_DOMAIN ) ),
),
__( 'Select which method to use for the display of match times.', FOOTBALLPOOL_TEXT_DOMAIN ),
array(
'onclick="FootballPoolAdmin.toggle_linked_options( null, \'#r-match_time_offset\' )"',
'onclick="FootballPoolAdmin.toggle_linked_options( null, \'#r-match_time_offset\' )"',
'onclick="FootballPoolAdmin.toggle_linked_options( \'#r-match_time_offset\', null )"',
),
),
'match_time_offset' =>
array(
array( 'dropdown', 'string' ),
__( 'Match time offset', FOOTBALLPOOL_TEXT_DOMAIN ),
'match_time_offset',
$match_time_offsets,
__( 'The offset in hours to add to (or extract from) the UTC start time of a match. Only used for display of the time.', FOOTBALLPOOL_TEXT_DOMAIN ),
'',
$offset_switch,
),
'add_tinymce_button' =>
array( 'checkbox', __( 'Use shortcode button in visual editor', FOOTBALLPOOL_TEXT_DOMAIN ), 'add_tinymce_button', __( 'The plugin can add a button to the visual editor of WordPress. With this option disabled this button will not be included (uncheck if the button is causing problems).', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'always_show_predictions' =>
array( 'checkbox', __( 'Always show predictions', FOOTBALLPOOL_TEXT_DOMAIN ), 'always_show_predictions', __( 'Normally match predictions are only shown to other players after a prediction can\'t be changed anymore. With this option enabled the predictions are visible to anyone, anytime. Works only for matches, not bonus questions.', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'use_spin_controls' =>
array( 'checkbox', __( 'Use HTML5 number inputs', FOOTBALLPOOL_TEXT_DOMAIN ), 'use_spin_controls', __( 'Make use of HTML5 number inputs for the prediction form. Some browsers display these as spin controls.', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'groups_page_match_types' =>
array(
array( 'multi-select', 'integer array' ),
__( 'Groups page matches', FOOTBALLPOOL_TEXT_DOMAIN ),
'groups_page_match_types',
$match_types,
sprintf( __( 'The Groups page shows standings for the matches in these match types. Defaults to match type id: %d.', FOOTBALLPOOL_TEXT_DOMAIN ), FOOTBALLPOOL_GROUPS_PAGE_DEFAULT_MATCHTYPE ) . ' ' . __( 'Use CTRL+click to select multiple values.', FOOTBALLPOOL_TEXT_DOMAIN ),
'',
),
'match_sort_method' =>
array(
'radiolist',
__( 'Match sorting', FOOTBALLPOOL_TEXT_DOMAIN ),
'match_sort_method',
array(
array( 'value' => 0, 'text' => __( 'Date ascending', FOOTBALLPOOL_TEXT_DOMAIN ) ),
array( 'value' => 1, 'text' => __( 'Date descending', FOOTBALLPOOL_TEXT_DOMAIN ) ),
array( 'value' => 2, 'text' => __( 'Match types descending, matches date ascending', FOOTBALLPOOL_TEXT_DOMAIN ) ),
array( 'value' => 3, 'text' => __( 'Match types ascending, matches date descending', FOOTBALLPOOL_TEXT_DOMAIN ) ),
),
__( 'Select the order in which matches must be displayed on the matches page and the prediction page..', FOOTBALLPOOL_TEXT_DOMAIN ),
),
'auto_calculation' =>
array( 'checkbox', __( 'Automatic calculation', FOOTBALLPOOL_TEXT_DOMAIN ), 'auto_calculation', __( 'By default the rankings are automatically (re)calculated in the admin. Change this setting if you want to (temporarily) disable this behaviour.', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'ranking_display' =>
array(
'radiolist',
__( 'Ranking to show', FOOTBALLPOOL_TEXT_DOMAIN ),
'ranking_display',
array(
array( 'value' => 0, 'text' => __( 'Default ranking', FOOTBALLPOOL_TEXT_DOMAIN ) ),
array( 'value' => 1, 'text' => __( 'Let the user decide', FOOTBALLPOOL_TEXT_DOMAIN ) ),
array( 'value' => 2, 'text' => __( 'Custom setting', FOOTBALLPOOL_TEXT_DOMAIN ) ),
),
__( 'The ranking page and charts page can show different rankings. Use this setting to decide which ranking to show.', FOOTBALLPOOL_TEXT_DOMAIN ),
array(
'onclick="FootballPoolAdmin.toggle_linked_options( null, \'#r-show_ranking\' )"',
'onclick="FootballPoolAdmin.toggle_linked_options( null, \'#r-show_ranking\' )"',
'onclick="FootballPoolAdmin.toggle_linked_options( \'#r-show_ranking\', null )"',
),
),
'show_ranking' =>
array(
array( 'dropdown', 'string' ),
__( 'Choose ranking', FOOTBALLPOOL_TEXT_DOMAIN ),
'show_ranking',
$user_defined_rankings,
__( 'Choose the ranking you want to use on the ranking page and the charts page.', FOOTBALLPOOL_TEXT_DOMAIN ),
'',
$ranking_switch,
),
// 'prediction_type' =>
// array(
// 'radiolist',
// __( 'Prediction type', FOOTBALLPOOL_TEXT_DOMAIN ),
// 'prediction_type',
// array(
// array( 'value' => 0, 'text' => __( 'Scores', FOOTBALLPOOL_TEXT_DOMAIN ) ),
// array( 'value' => 1, 'text' => __( 'Match winner', FOOTBALLPOOL_TEXT_DOMAIN ) ),
// ),
// __( 'Select the prediction method for matches. Possible choices are \'Scores\' for the prediction of the match result in goals/points and \'Match winner\' for picking the winner of the match', FOOTBALLPOOL_TEXT_DOMAIN ),
// array(
// 'onclick="FootballPoolAdmin.toggle_linked_options( \'\', [ \'#r-prediction_type_draw\' ] )"',
// 'onclick="FootballPoolAdmin.toggle_linked_options( \'#r-prediction_type_draw\', null )"',
// ),
// ),
// 'prediction_type_draw' =>
// array(
// 'checkbox',
// __( 'Include \'Draw\' as prediction option', FOOTBALLPOOL_TEXT_DOMAIN ),
// 'prediction_type_draw',
// __( 'If checked users may also predict a draw as outcome of a match. If unchecked only home team and away team are selectable options.', FOOTBALLPOOL_TEXT_DOMAIN ),
// '',
// array( 'prediction_type' => 0 )
// ),
'team_points_win' =>
array( 'text', __( 'Points for win', FOOTBALLPOOL_TEXT_DOMAIN ) . ' *', 'team_points_win', __( 'The points a team gets for a win.', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'team_points_draw' =>
array( 'text', __( 'Points for draw', FOOTBALLPOOL_TEXT_DOMAIN ) . ' *', 'team_points_draw', __( 'The points a team gets for a draw.', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'listing_show_team_thumb' =>
array( 'checkbox', __( 'Show photo in team listing', FOOTBALLPOOL_TEXT_DOMAIN ), 'listing_show_team_thumb', __( 'Show the team\'s photo on the team listing page (if available).', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'listing_show_venue_thumb' =>
array( 'checkbox', __( 'Show photo in venue listing', FOOTBALLPOOL_TEXT_DOMAIN ), 'listing_show_venue_thumb', __( 'Show the venue\'s photo on the team listing page (if available).', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'listing_show_team_comments' =>
array( 'checkbox', __( 'Show comments in team listing', FOOTBALLPOOL_TEXT_DOMAIN ), 'listing_show_team_comments', __( 'Show the team\'s comments on the team listing page (if available).', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'listing_show_venue_comments' =>
array( 'checkbox', __( 'Show comments in venue listing', FOOTBALLPOOL_TEXT_DOMAIN ), 'listing_show_venue_comments', __( 'Show the venue\'s comments on the team listing page (if available).', FOOTBALLPOOL_TEXT_DOMAIN ) ),
// 'number_of_jokers' =>
// array( 'text', __( 'Number of jokers', FOOTBALLPOOL_TEXT_DOMAIN ) . ' *', 'number_of_jokers', __( 'The number of jokers a user can use. Default is 1, if set to 0 the joker functionality is disabled.', FOOTBALLPOOL_TEXT_DOMAIN ) ),
'number_of_jokers' =>
array( 'checkbox', __( 'Enable jokers?', FOOTBALLPOOL_TEXT_DOMAIN ), 'number_of_jokers', __( 'When checked the joker is enabled and users can add the joker to one prediction to multiply the score.', FOOTBALLPOOL_TEXT_DOMAIN ) ),
);
$donate = sprintf( '<div class="donate">%s%s</div>'
, __( 'If you want to support this plugin, you can buy me an espresso (doppio please ;))', FOOTBALLPOOL_TEXT_DOMAIN )
, self::donate_button( 'return' )
);
$menu = sprintf( '<span title="%s" class="fp-icon-menu" onclick="jQuery( \'#fp-options-menu\' ).slideToggle( \'slow\' )"></span>', __( 'Option categories', FOOTBALLPOOL_TEXT_DOMAIN ) );
self::admin_header( __( 'Plugin Options', FOOTBALLPOOL_TEXT_DOMAIN ) . $menu, null, null, $donate );
echo '<p id="fp-options-menu"></p>';
echo '<script type="text/javascript">
jQuery( document ).ready( function() {
var i = 0;
var menu = jQuery( "#fp-options-menu" );
jQuery( "h3", ".fp-admin" ).each( function() {
$this = jQuery( this );
$this.attr( "id", "option-section-" + i );
menu.append( "<a href=\'#option-section-" + i + "\'>" + $this.text() + "</a><br />" );
i++;
} );
} );
</script>';
$recalculate = ( Football_Pool_Utils::post_string( 'recalculate' ) ==
__( 'Recalculate Scores', FOOTBALLPOOL_TEXT_DOMAIN ) )
|| ( Football_Pool_Utils::get_string( 'recalculate' ) == 'yes' );
$ranking_id = Football_Pool_Utils::get_int( 'single_ranking' );
if ( $recalculate ) {
check_admin_referer( FOOTBALLPOOL_NONCE_ADMIN );
self::update_score_history( 'force', $ranking_id );
} elseif ( $action == 'update' ) {
check_admin_referer( FOOTBALLPOOL_NONCE_ADMIN );
$update_log = false;
$log_options = array( 'fullpoints', 'totopoints', 'goalpoints', 'diffpoints', 'joker_multiplier', 'use_leagues' );
foreach ( $options as $option ) {
if ( is_array( $option[0] ) ) {
$value_type = $option[0][1];
} else {
$value_type = $option[0];
}
if ( $value_type == 'text' || $value_type == 'string' ) {
$value = Football_Pool_Utils::post_string( $option[2] );
} elseif ( $value_type == 'date' || $value_type == 'datetime' ) {
$value = Football_Pool_Utils::gmt_from_date( self::make_date_from_input( $option[2], $value_type ) );
} elseif ( $value_type == 'integer array' ) {
$value = Football_Pool_Utils::post_integer_array( $option[2] );
} elseif ( $value_type == 'string array' ) {
$value = Football_Pool_Utils::post_string_array( $option[2] );
} else {
$value = Football_Pool_Utils::post_integer( $option[2] );
}
// check if ranking log should be updated
if ( in_array( $option[2], $log_options ) && self::get_value( $option[2] ) != $value ) {
$update_log = true;
}
self::set_value( $option[2], $value );
}
if ( $update_log ) {
foreach ( $user_defined_rankings as $ranking ) {
self::update_ranking_log( $ranking['value'], null, null,
__( 'plugin options changed', FOOTBALLPOOL_TEXT_DOMAIN )
);
}
}
self::notice( __( 'Changes saved.', FOOTBALLPOOL_TEXT_DOMAIN ) );
}
$chart = new Football_Pool_Chart;
if ( $chart->stats_enabled && ! $chart->API_loaded ) {
self::notice( sprintf( __( 'Charts are enabled but Highcharts API was not found! See <a href="%s">Help page</a> for details.', FOOTBALLPOOL_TEXT_DOMAIN ), 'admin.php?page=footballpool-help#charts' ) , 'important' );
}
self::intro( __( 'If values in the fields marked with an asterisk are left empty, then the plugin will default to the initial values.', FOOTBALLPOOL_TEXT_DOMAIN ) );
do_action( 'footballpool_admin_options_screen_pre', $action );
self::admin_sectiontitle( __( 'Scoring Options', FOOTBALLPOOL_TEXT_DOMAIN ) );
self::options_form( array(
$options['joker_multiplier'],
$options['fullpoints'],
$options['totopoints'],
$options['goalpoints'],
$options['diffpoints'],
)
);
echo '<p class="submit">';
submit_button( null, 'primary', null, false );
self::recalculate_button();
echo '</p>';
self::back_to_top();
self::admin_sectiontitle( __( 'Ranking Options', FOOTBALLPOOL_TEXT_DOMAIN ) );
self::options_form( array(
$options['auto_calculation'],
$options['ranking_display'],
$options['show_ranking'],
)
);
echo '<p class="submit">';
submit_button( null, 'primary', null, false );
self::recalculate_button();
echo '</p>';
self::back_to_top();
self::admin_sectiontitle( __( 'Prediction Options', FOOTBALLPOOL_TEXT_DOMAIN ) );
self::options_form( array(
// $options['prediction_type'],
// $options['prediction_type_draw'],
$options['stop_time_method_matches'],
$options['maxperiod'],
$options['matches_locktime'],
$options['stop_time_method_questions'],
$options['bonus_question_locktime'],
$options['always_show_predictions'],
$options['number_of_jokers'],
)
);
echo '<p class="submit">';
submit_button( null, 'primary', null, false );
self::recalculate_button();
echo '</p>';
self::back_to_top();
self::admin_sectiontitle( __( 'League Options', FOOTBALLPOOL_TEXT_DOMAIN ) );
self::options_form( array(
$options['use_leagues'],
$options['default_league_new_user'],
)
);
echo '<p class="submit">';
submit_button( null, 'primary', null, false );
self::recalculate_button();
echo '</p>';
self::back_to_top();
self::admin_sectiontitle( __( 'Pool Layout Options', FOOTBALLPOOL_TEXT_DOMAIN ) );
self::options_form( array(
$options['use_spin_controls'],
$options['match_time_display'],
$options['match_time_offset'],
$options['show_team_link'],
// $options['show_team_link_use_external'],
$options['show_venues_on_team_page'],
$options['listing_show_team_thumb'],
$options['listing_show_team_comments'],
$options['listing_show_venue_thumb'],
$options['listing_show_venue_comments'],
$options['match_sort_method'],
)
);
submit_button( null, 'primary', null, true );
self::back_to_top();
self::admin_sectiontitle( __( 'Groups Page Options', FOOTBALLPOOL_TEXT_DOMAIN ) );
self::options_form( array(
$options['team_points_win'],
$options['team_points_draw'],
$options['groups_page_match_types'],
)
);
submit_button( null, 'primary', null, true );
self::back_to_top();
self::admin_sectiontitle( __( 'Other Options', FOOTBALLPOOL_TEXT_DOMAIN ) );
self::options_form( array(
$options['keep_data_on_uninstall'],
$options['use_charts'],
$options['redirect_url_after_login'],
$options['export_format'],
$options['shoutbox_max_chars'],
$options['dashboard_image'],
$options['use_favicon'],
$options['use_touchicon'],
$options['hide_admin_bar'],
$options['add_tinymce_button'],
)
);
submit_button( null, 'primary', null, true );
self::back_to_top();
self::admin_sectiontitle( __( 'Plugin pages', FOOTBALLPOOL_TEXT_DOMAIN ) );
self::options_form( array(
$options['page_id_tournament'],
$options['page_id_teams'],
$options['page_id_groups'],
$options['page_id_stadiums'],
$options['page_id_rules'],
$options['page_id_pool'],
$options['page_id_ranking'],
$options['page_id_statistics'],
$options['page_id_user'],
// $options['redirect_url_after_login'],
)
);
submit_button( null, 'primary', null, true );
self::back_to_top();
self::admin_sectiontitle( __( 'Shortcodes', FOOTBALLPOOL_TEXT_DOMAIN ) );
self::options_form( array(
$options['webmaster'],
$options['bank'],
$options['money'],
$options['start'],
)
);
submit_button( null, 'primary', null, true );
self::back_to_top();
// self::admin_sectiontitle( __( 'Advanced Options', FOOTBALLPOOL_TEXT_DOMAIN ) );
// self::options_form( array(
// )
// );
// submit_button( null, 'primary', null, true );
// self::back_to_top();
do_action( 'footballpool_admin_options_screen_post', $action );
self::admin_footer();
}
}
| wp-plugins/football-pool | admin/class-football-pool-admin-options.php | PHP | mit | 34,914 |
require 'rails_helper'
describe Api::SessionsController do
describe "#create" do
let(:user) { create(:user, password: 'password') }
it 'returns a JSON Web Token' do
post :create, params: { username: user.username, password: 'password' }
json = JSON.parse(response.body)
expect(json['authentication_token']).to be_present
end
end
end
| mokhan/surface | spec/controllers/api/sessions_controller_spec.rb | Ruby | mit | 370 |
package measurement
// transaction
type TransactionMessage struct {
}
// item
type ItemMessage struct{}
// impression
// action
// refund
// purchase
| vly/go-ga-measurement | measurement/ecommerce.go | GO | mit | 156 |
/* Game namespace */
var game = {
// an object where to store game information
data : {
// score
score : 0
},
// Run on page load.
"onload" : function () {
// Initialize the video.
if (!me.video.init("screen", me.video.CANVAS, 1067, 600, true, '1.0')) {
alert("Your browser does not support HTML5 canvas.");
return;
}
// add "#debug" to the URL to enable the debug Panel
if (document.location.hash === "#debug") {
window.onReady(function () {
me.plugin.register.defer(this, debugPanel, "debug");
});
}
// Initialize the audio.
me.audio.init("mp3,ogg");
// Set a callback to run when loading is complete.
me.loader.onload = this.loaded.bind(this);
// Load the resources.
me.loader.preload(game.resources);
// Initialize melonJS and display a loading screen.
me.state.change(me.state.LOADING);
},
// Run on game resources loaded.
"loaded" : function () {
me.pool.register("player", game.PlayerEntity, true);
me.state.set(me.state.MENU, new game.TitleScreen());
me.state.set(me.state.PLAY, new game.PlayScreen());
// Start the game.
me.state.change(me.state.PLAY);
}
};
| KaelenJuntilla/KaelenCameron | js/game.js | JavaScript | mit | 1,155 |
require 'uottawa_odesi_utils'
RSpec.configure do |config|
# Use color in STDOUT
config.color = true
# Use color not only in STDOUT but also in pagers and files
config.tty = true
# Use the specified formatter
config.formatter = :documentation # :progress, :html, :textmate
end | guinslym/uottawa_odesi_utils | spec/spec_helper.rb | Ruby | mit | 290 |
package shop.main.controller.admin;
import static shop.main.controller.admin.AdminController.ADMIN_PREFIX;
import static shop.main.controller.admin.AdminController.MANAGER_PREFIX;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import shop.main.data.entity.Discount;
import shop.main.data.service.DiscountService;
@Controller
@RequestMapping(value = { ADMIN_PREFIX, MANAGER_PREFIX })
public class AdminDiscountController extends AdminController {
@Autowired
DiscountService discountService;
@RequestMapping(value = "/discounts")
public String discountsList(Model model) {
loadTableData("", null, 1, PAGE_SIZE, model);
return "../admin/discounts/discounts";
}
@RequestMapping(value = "/findDiscounts", method = RequestMethod.POST)
public String findDiscounts(@RequestParam String name, @RequestParam String status,
@RequestParam(value = "current", required = false) Integer current,
@RequestParam(value = "pageSize", required = false) Integer pageSize, Model model) {
loadTableData(name, status, current, pageSize, model);
return "../admin/discounts/_table";
}
private void loadTableData(String name, String status, Integer current, Integer pageSize, Model model) {
Pageable pageable = new PageRequest(current - 1, pageSize);
model.addAttribute("discountList", discountService.findByNameAndStatus(name, status, pageable));
model.addAttribute("current", current);
model.addAttribute("pageSize", pageSize);
addPaginator(model, current, pageSize, discountService.countByNameAndStatus(name, status));
}
@RequestMapping(value = "/discount", method = RequestMethod.POST)
public String saveDiscount(@ModelAttribute("discount") @Valid Discount discount, BindingResult result, Model model,
final RedirectAttributes redirectAttributes, HttpServletRequest request) {
if (result.hasErrors()) {
model.addAttribute("errorSummary", result.getFieldErrors().stream()
.map(e -> e.getField() + " error - " + e.getDefaultMessage() + " ").collect(Collectors.toList()));
return "../admin/discounts/edit_discount";
} else {
if (discount.isNew()) {
redirectAttributes.addFlashAttribute("flashMessage", "Discount added successfully!");
if (discountService.notUniqueCoupon(discount.getCoupon())) {
model.addAttribute("errorSummary",
(new ArrayList<String>(Arrays.asList("Coupon code must be unique!"))));
return "../admin/discounts/edit_discount";
}
} else {
redirectAttributes.addFlashAttribute("flashMessage", "Discount updated successfully!");
}
discountService.save(discount);
return "redirect:" + getUrlPrefix(request) + "discounts";
}
}
@RequestMapping(value = "/discount/add", method = RequestMethod.GET)
public String addDiscount(Model model) {
model.addAttribute("discount", new Discount());
return "../admin/discounts/edit_discount";
}
@RequestMapping(value = "/discount/{id}/update", method = RequestMethod.GET)
public String editDiscount(@PathVariable("id") long id, Model model) {
model.addAttribute("discount", discountService.findById(id));
return "../admin/discounts/edit_discount";
}
@RequestMapping(value = "/discount/{id}/delete", method = RequestMethod.GET)
public String deleteDiscount(@PathVariable("id") long id, Model model, final RedirectAttributes redirectAttributes,
HttpServletRequest request) {
discountService.deleteById(id);
redirectAttributes.addFlashAttribute("flashMessage", "Discount deleted successfully!");
return "redirect:" + getUrlPrefix(request) + "discounts";
}
}
| spacerovka/jShop | src/main/java/shop/main/controller/admin/AdminDiscountController.java | Java | mit | 4,334 |
/**
* @class EZ3.Box
* @constructor
* @param {EZ3.Vector3} [min]
* @param {EZ3.Vector3} [max]
*/
EZ3.Box = function(min, max) {
/**
* @property {EZ3.Vector3} min
* @default new EZ3.Vector3(Infinity)
*/
this.min = (min !== undefined) ? min : new EZ3.Vector3(Infinity);
/**
* @property {EZ3.Vector3} max
* @default new EZ3.Vector3(-Infinity)
*/
this.max = (max !== undefined) ? max : new EZ3.Vector3(-Infinity);
};
EZ3.Box.prototype.constructor = EZ3.Box;
/**
* @method EZ3.Box#set
* @param {EZ3.Vector3} min
* @param {EZ3.Vector3} max
* @return {EZ3.Box}
*/
EZ3.Box.prototype.set = function(min, max) {
this.min.copy(min);
this.max.copy(max);
return this;
};
/**
* @method EZ3.Box#copy
* @param {EZ3.Box} box
* @return {EZ3.Box}
*/
EZ3.Box.prototype.copy = function(box) {
this.min.copy(box.min);
this.max.copy(box.max);
return this;
};
/**
* @method EZ3.Box#clone
* @return {EZ3.Box}
*/
EZ3.Box.prototype.clone = function() {
return new EZ3.Box(this.min, this.max);
};
/**
* @method EZ3.Box#expand
* @param {EZ3.Vector3} point
* @return {EZ3.Box}
*/
EZ3.Box.prototype.expand = function(point) {
this.min.min(point);
this.max.max(point);
return this;
};
/**
* @method EZ3.Box#union
* @param {EZ3.Box} box
* @return {EZ3.Box}
*/
EZ3.Box.prototype.union = function(box) {
this.min.min(box.min);
this.max.max(box.max);
return this;
};
/**
* @method EZ3.Box#applyMatrix4
* @param {EZ3.Matrix4} matrix
* @return {EZ3.Box}
*/
EZ3.Box.prototype.applyMatrix4 = function(matrix) {
var points = [];
var i;
points.push((new EZ3.Vector3(this.min.x, this.min.y, this.min.z)).mulMatrix4(matrix));
points.push((new EZ3.Vector3(this.min.x, this.min.y, this.max.z)).mulMatrix4(matrix));
points.push((new EZ3.Vector3(this.min.x, this.max.y, this.min.z)).mulMatrix4(matrix));
points.push((new EZ3.Vector3(this.min.x, this.max.y, this.max.z)).mulMatrix4(matrix));
points.push((new EZ3.Vector3(this.max.x, this.min.y, this.min.z)).mulMatrix4(matrix));
points.push((new EZ3.Vector3(this.max.x, this.min.y, this.max.z)).mulMatrix4(matrix));
points.push((new EZ3.Vector3(this.max.x, this.max.y, this.min.z)).mulMatrix4(matrix));
points.push((new EZ3.Vector3(this.max.x, this.max.y, this.max.z)).mulMatrix4(matrix));
this.min.set(Infinity);
this.max.set(-Infinity);
for (i = 0; i < 8; i++)
this.expand(points[i]);
return this;
};
/**
* @method EZ3.Box#size
* @return {EZ3.Vector3}
*/
EZ3.Box.prototype.size = function() {
return new EZ3.Vector3().sub(this.max, this.min);
};
/**
* @method EZ3.Box#getCenter
* @return {EZ3.Vector3}
*/
EZ3.Box.prototype.center = function() {
return new EZ3.Vector3().add(this.max, this.min).scale(0.5);
};
| andresz1/ez3.js | src/math/Box.js | JavaScript | mit | 2,872 |
package jkanvas.table;
import java.util.Objects;
import jkanvas.animation.GenericPaintList;
/**
* Maps rows of tables to shapes.
*
* @author Joschi <josua.krause@gmail.com>
* @param <T> The list of shapes.
*/
public abstract class ListMapper<T extends GenericPaintList<?>> {
/** The table. */
private final DataTable table;
/**
* Creates a map for the table.
*
* @param table The table.
*/
public ListMapper(final DataTable table) {
this.table = Objects.requireNonNull(table);
}
/**
* Getter.
*
* @return Creates a new list.
*/
protected abstract T createList();
/**
* Creates a shape for the given row.
*
* @param list The shape list.
* @param row The row.
* @return The index of the new shape.
*/
protected abstract int createForRow(T list, int row);
/**
* Fills the list.
*
* @return The list.
*/
private T fillList() {
final T res = createList();
final int rows = table.rows();
for(int el = 0; el < rows; ++el) {
final int i = createForRow(res, el);
// TODO allow arbitrary mappings
if(i != el) throw new IllegalStateException(
"unpredicted index: " + i + " != " + el);
}
return res;
}
/** The list. */
private T list;
/**
* Getter.
*
* @return The list.
*/
public T getList() {
if(list == null) {
list = fillList();
}
return list;
}
/**
* Getter.
*
* @return The table.
*/
public DataTable getTable() {
return table;
}
/**
* Getter.
*
* @param row The row.
* @return The index of the shape in the list.
*/
public int getIndexForRow(final int row) {
return row;
}
/**
* Getter.
*
* @param index The index of the shape.
* @return The row in the table.
*/
public int getRowForIndex(final int index) {
return index;
}
}
| JosuaKrause/JKanvas | src/main/java/jkanvas/table/ListMapper.java | Java | mit | 1,891 |
require_relative "../test_helper"
require_relative "../support/apiai_responses"
require_relative "../../lib/ai/weather_responder"
include ApiaiResponses
describe AI::WebQueryResponder do
before do
@responder = AI::WebQueryResponder.new(web_query_apiai_response)
end
describe "#call" do
it "returns the correct response" do
WebSearcher.any_instance.
expects(:first_link).
returns("http://www.fanolug.org/")
@responder.call.must_equal("http://www.fanolug.org/")
end
end
end
| fanolug/fortuna_luca | test/ai/test_web_query_responder.rb | Ruby | mit | 543 |
<?php
//api.php
//This is the API transaction script.
?> | grubbyhax/litewrench | litewrench/plugins/api.php | PHP | mit | 57 |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.resourcemanager.compute;
import com.azure.core.http.HttpPipeline;
import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetInner;
import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage;
import com.azure.resourcemanager.compute.models.VirtualMachineScaleSet;
import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetSkuTypes;
import com.azure.resourcemanager.network.models.LoadBalancer;
import com.azure.resourcemanager.network.models.LoadBalancerSkuType;
import com.azure.resourcemanager.network.models.Network;
import com.azure.resourcemanager.resources.models.ResourceGroup;
import com.azure.core.management.Region;
import com.azure.resourcemanager.resources.fluentcore.model.Creatable;
import com.azure.core.management.profile.AzureProfile;
import com.azure.resourcemanager.storage.models.StorageAccount;
import java.util.ArrayList;
import java.util.List;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class VirtualMachineScaleSetBootDiagnosticsTests extends ComputeManagementTest {
private String rgName = "";
private final Region region = locationOrDefault(Region.US_SOUTH_CENTRAL);
private final String vmName = "javavm";
@Override
protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) {
rgName = generateRandomResourceName("javacsmrg", 15);
super.initializeClients(httpPipeline, profile);
}
@Override
protected void cleanUpResources() {
resourceManager.resourceGroups().beginDeleteByName(rgName);
}
@Test
public void canEnableBootDiagnosticsWithImplicitStorageOnManagedVMSSCreation() throws Exception {
final String vmssName = generateRandomResourceName("vmss", 10);
ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create();
Network network =
this
.networkManager
.networks()
.define("vmssvnet")
.withRegion(region)
.withExistingResourceGroup(resourceGroup)
.withAddressSpace("10.0.0.0/28")
.withSubnet("subnet1", "10.0.0.0/28")
.create();
LoadBalancer publicLoadBalancer =
createInternetFacingLoadBalancer(region, resourceGroup, "1", LoadBalancerSkuType.BASIC);
List<String> backends = new ArrayList<>();
for (String backend : publicLoadBalancer.backends().keySet()) {
backends.add(backend);
}
Assertions.assertTrue(backends.size() == 2);
VirtualMachineScaleSet virtualMachineScaleSet =
this
.computeManager
.virtualMachineScaleSets()
.define(vmssName)
.withRegion(region)
.withExistingResourceGroup(resourceGroup)
.withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0)
.withExistingPrimaryNetworkSubnet(network, "subnet1")
.withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer)
.withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1))
.withoutPrimaryInternalLoadBalancer()
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername("jvuser")
.withSsh(sshPublicKey())
.withBootDiagnostics()
.create();
Assertions.assertNotNull(virtualMachineScaleSet);
Assertions.assertTrue(virtualMachineScaleSet.isBootDiagnosticsEnabled());
Assertions.assertNotNull(virtualMachineScaleSet.bootDiagnosticsStorageUri());
}
@Test
public void canEnableBootDiagnosticsWithCreatableStorageOnManagedVMSSCreation() throws Exception {
final String vmssName = generateRandomResourceName("vmss", 10);
final String storageName = generateRandomResourceName("st", 14);
ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create();
Network network =
this
.networkManager
.networks()
.define("vmssvnet")
.withRegion(region)
.withExistingResourceGroup(resourceGroup)
.withAddressSpace("10.0.0.0/28")
.withSubnet("subnet1", "10.0.0.0/28")
.create();
LoadBalancer publicLoadBalancer =
createInternetFacingLoadBalancer(region, resourceGroup, "1", LoadBalancerSkuType.BASIC);
List<String> backends = new ArrayList<>();
for (String backend : publicLoadBalancer.backends().keySet()) {
backends.add(backend);
}
Assertions.assertTrue(backends.size() == 2);
Creatable<StorageAccount> creatableStorageAccount =
storageManager.storageAccounts().define(storageName).withRegion(region).withExistingResourceGroup(rgName);
VirtualMachineScaleSet virtualMachineScaleSet =
this
.computeManager
.virtualMachineScaleSets()
.define(vmssName)
.withRegion(region)
.withExistingResourceGroup(resourceGroup)
.withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0)
.withExistingPrimaryNetworkSubnet(network, "subnet1")
.withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer)
.withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1))
.withoutPrimaryInternalLoadBalancer()
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername("jvuser")
.withSsh(sshPublicKey())
.withBootDiagnostics(creatableStorageAccount)
.create();
Assertions.assertNotNull(virtualMachineScaleSet);
Assertions.assertTrue(virtualMachineScaleSet.isBootDiagnosticsEnabled());
Assertions.assertNotNull(virtualMachineScaleSet.bootDiagnosticsStorageUri());
Assertions.assertTrue(virtualMachineScaleSet.bootDiagnosticsStorageUri().contains(storageName));
}
@Test
public void canEnableBootDiagnosticsWithExplicitStorageOnManagedVMSSCreation() throws Exception {
final String vmssName = generateRandomResourceName("vmss", 10);
final String storageName = generateRandomResourceName("st", 14);
ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create();
Network network =
this
.networkManager
.networks()
.define("vmssvnet")
.withRegion(region)
.withExistingResourceGroup(resourceGroup)
.withAddressSpace("10.0.0.0/28")
.withSubnet("subnet1", "10.0.0.0/28")
.create();
LoadBalancer publicLoadBalancer =
createInternetFacingLoadBalancer(region, resourceGroup, "1", LoadBalancerSkuType.BASIC);
List<String> backends = new ArrayList<>();
for (String backend : publicLoadBalancer.backends().keySet()) {
backends.add(backend);
}
Assertions.assertTrue(backends.size() == 2);
StorageAccount storageAccount =
storageManager
.storageAccounts()
.define(storageName)
.withRegion(region)
.withNewResourceGroup(rgName)
.create();
VirtualMachineScaleSet virtualMachineScaleSet =
this
.computeManager
.virtualMachineScaleSets()
.define(vmssName)
.withRegion(region)
.withExistingResourceGroup(resourceGroup)
.withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0)
.withExistingPrimaryNetworkSubnet(network, "subnet1")
.withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer)
.withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1))
.withoutPrimaryInternalLoadBalancer()
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername("jvuser")
.withSsh(sshPublicKey())
.withBootDiagnostics(storageAccount)
.create();
Assertions.assertNotNull(virtualMachineScaleSet);
Assertions.assertTrue(virtualMachineScaleSet.isBootDiagnosticsEnabled());
Assertions.assertNotNull(virtualMachineScaleSet.bootDiagnosticsStorageUri());
Assertions.assertTrue(virtualMachineScaleSet.bootDiagnosticsStorageUri().contains(storageName));
}
@Test
public void canDisableVMSSBootDiagnostics() throws Exception {
final String vmssName = generateRandomResourceName("vmss", 10);
ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create();
Network network =
this
.networkManager
.networks()
.define("vmssvnet")
.withRegion(region)
.withExistingResourceGroup(resourceGroup)
.withAddressSpace("10.0.0.0/28")
.withSubnet("subnet1", "10.0.0.0/28")
.create();
LoadBalancer publicLoadBalancer =
createInternetFacingLoadBalancer(region, resourceGroup, "1", LoadBalancerSkuType.BASIC);
List<String> backends = new ArrayList<>();
for (String backend : publicLoadBalancer.backends().keySet()) {
backends.add(backend);
}
Assertions.assertTrue(backends.size() == 2);
VirtualMachineScaleSet virtualMachineScaleSet =
this
.computeManager
.virtualMachineScaleSets()
.define(vmssName)
.withRegion(region)
.withExistingResourceGroup(resourceGroup)
.withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0)
.withExistingPrimaryNetworkSubnet(network, "subnet1")
.withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer)
.withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1))
.withoutPrimaryInternalLoadBalancer()
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername("jvuser")
.withSsh(sshPublicKey())
.withBootDiagnostics()
.create();
Assertions.assertNotNull(virtualMachineScaleSet);
Assertions.assertTrue(virtualMachineScaleSet.isBootDiagnosticsEnabled());
Assertions.assertNotNull(virtualMachineScaleSet.bootDiagnosticsStorageUri());
virtualMachineScaleSet.update().withoutBootDiagnostics().apply();
Assertions.assertFalse(virtualMachineScaleSet.isBootDiagnosticsEnabled());
// Disabling boot diagnostics will not remove the storage uri from the vm payload.
Assertions.assertNotNull(virtualMachineScaleSet.bootDiagnosticsStorageUri());
}
@Test
public void bootDiagnosticsShouldUsesVMSSOSUnManagedDiskImplicitStorage() throws Exception {
final String vmssName = generateRandomResourceName("vmss", 10);
ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create();
Network network =
this
.networkManager
.networks()
.define("vmssvnet")
.withRegion(region)
.withExistingResourceGroup(resourceGroup)
.withAddressSpace("10.0.0.0/28")
.withSubnet("subnet1", "10.0.0.0/28")
.create();
LoadBalancer publicLoadBalancer =
createInternetFacingLoadBalancer(region, resourceGroup, "1", LoadBalancerSkuType.BASIC);
List<String> backends = new ArrayList<>();
for (String backend : publicLoadBalancer.backends().keySet()) {
backends.add(backend);
}
Assertions.assertTrue(backends.size() == 2);
VirtualMachineScaleSet virtualMachineScaleSet =
this
.computeManager
.virtualMachineScaleSets()
.define(vmssName)
.withRegion(region)
.withExistingResourceGroup(resourceGroup)
.withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0)
.withExistingPrimaryNetworkSubnet(network, "subnet1")
.withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer)
.withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1))
.withoutPrimaryInternalLoadBalancer()
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername("jvuser")
.withSsh(sshPublicKey())
.withUnmanagedDisks()
.withBootDiagnostics()
.create();
Assertions.assertNotNull(virtualMachineScaleSet);
Assertions.assertTrue(virtualMachineScaleSet.isBootDiagnosticsEnabled());
Assertions.assertNotNull(virtualMachineScaleSet.bootDiagnosticsStorageUri());
VirtualMachineScaleSetInner inner = virtualMachineScaleSet.innerModel();
Assertions.assertNotNull(inner);
Assertions.assertNotNull(inner.virtualMachineProfile());
Assertions.assertNotNull(inner.virtualMachineProfile().storageProfile());
Assertions.assertNotNull(inner.virtualMachineProfile().storageProfile().osDisk());
List<String> containers = inner.virtualMachineProfile().storageProfile().osDisk().vhdContainers();
Assertions.assertFalse(containers.isEmpty());
// Boot diagnostics should share storage used for os/disk containers
boolean found = false;
for (String containerStorageUri : containers) {
if (containerStorageUri
.toLowerCase()
.startsWith(virtualMachineScaleSet.bootDiagnosticsStorageUri().toLowerCase())) {
found = true;
break;
}
}
Assertions.assertTrue(found);
}
@Test
public void bootDiagnosticsShouldUseVMSSUnManagedDisksExplicitStorage() throws Exception {
final String storageName = generateRandomResourceName("st", 14);
final String vmssName = generateRandomResourceName("vmss", 10);
ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create();
Network network =
this
.networkManager
.networks()
.define("vmssvnet")
.withRegion(region)
.withExistingResourceGroup(resourceGroup)
.withAddressSpace("10.0.0.0/28")
.withSubnet("subnet1", "10.0.0.0/28")
.create();
LoadBalancer publicLoadBalancer =
createInternetFacingLoadBalancer(region, resourceGroup, "1", LoadBalancerSkuType.BASIC);
List<String> backends = new ArrayList<>();
for (String backend : publicLoadBalancer.backends().keySet()) {
backends.add(backend);
}
Assertions.assertTrue(backends.size() == 2);
StorageAccount storageAccount =
storageManager
.storageAccounts()
.define(storageName)
.withRegion(region)
.withNewResourceGroup(rgName)
.create();
VirtualMachineScaleSet virtualMachineScaleSet =
this
.computeManager
.virtualMachineScaleSets()
.define(vmssName)
.withRegion(region)
.withExistingResourceGroup(resourceGroup)
.withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0)
.withExistingPrimaryNetworkSubnet(network, "subnet1")
.withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer)
.withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1))
.withoutPrimaryInternalLoadBalancer()
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername("jvuser")
.withSsh(sshPublicKey())
.withUnmanagedDisks()
.withBootDiagnostics()
.withExistingStorageAccount(
storageAccount) // This storage account must be shared by disk and boot diagnostics
.create();
Assertions.assertNotNull(virtualMachineScaleSet);
Assertions.assertTrue(virtualMachineScaleSet.isBootDiagnosticsEnabled());
Assertions.assertNotNull(virtualMachineScaleSet.bootDiagnosticsStorageUri());
Assertions.assertTrue(virtualMachineScaleSet.bootDiagnosticsStorageUri().contains(storageName));
VirtualMachineScaleSetInner inner = virtualMachineScaleSet.innerModel();
Assertions.assertNotNull(inner);
Assertions.assertNotNull(inner.virtualMachineProfile());
Assertions.assertNotNull(inner.virtualMachineProfile().storageProfile());
Assertions.assertNotNull(inner.virtualMachineProfile().storageProfile().osDisk());
List<String> containers = inner.virtualMachineProfile().storageProfile().osDisk().vhdContainers();
Assertions.assertFalse(containers.isEmpty());
}
@Test
public void canEnableBootDiagnosticsWithCreatableStorageOnUnManagedVMSSCreation() throws Exception {
final String storageName = generateRandomResourceName("st", 14);
final String vmssName = generateRandomResourceName("vmss", 10);
ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create();
Network network =
this
.networkManager
.networks()
.define("vmssvnet")
.withRegion(region)
.withExistingResourceGroup(resourceGroup)
.withAddressSpace("10.0.0.0/28")
.withSubnet("subnet1", "10.0.0.0/28")
.create();
LoadBalancer publicLoadBalancer =
createInternetFacingLoadBalancer(region, resourceGroup, "1", LoadBalancerSkuType.BASIC);
List<String> backends = new ArrayList<>();
for (String backend : publicLoadBalancer.backends().keySet()) {
backends.add(backend);
}
Assertions.assertTrue(backends.size() == 2);
Creatable<StorageAccount> creatableStorageAccount =
storageManager.storageAccounts().define(storageName).withRegion(region).withExistingResourceGroup(rgName);
VirtualMachineScaleSet virtualMachineScaleSet =
this
.computeManager
.virtualMachineScaleSets()
.define(vmssName)
.withRegion(region)
.withExistingResourceGroup(resourceGroup)
.withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0)
.withExistingPrimaryNetworkSubnet(network, "subnet1")
.withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer)
.withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1))
.withoutPrimaryInternalLoadBalancer()
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername("jvuser")
.withSsh(sshPublicKey())
.withUnmanagedDisks()
.withBootDiagnostics(
creatableStorageAccount) // This storage account should be used for BDiagnostics not OS disk storage
// account
.create();
Assertions.assertNotNull(virtualMachineScaleSet);
Assertions.assertTrue(virtualMachineScaleSet.isBootDiagnosticsEnabled());
Assertions.assertNotNull(virtualMachineScaleSet.bootDiagnosticsStorageUri());
Assertions.assertTrue(virtualMachineScaleSet.bootDiagnosticsStorageUri().contains(storageName));
// There should be a different storage account created for VMSS OS Disk
VirtualMachineScaleSetInner inner = virtualMachineScaleSet.innerModel();
Assertions.assertNotNull(inner);
Assertions.assertNotNull(inner.virtualMachineProfile());
Assertions.assertNotNull(inner.virtualMachineProfile().storageProfile());
Assertions.assertNotNull(inner.virtualMachineProfile().storageProfile().osDisk());
List<String> containers = inner.virtualMachineProfile().storageProfile().osDisk().vhdContainers();
Assertions.assertFalse(containers.isEmpty());
boolean notFound = true;
for (String containerStorageUri : containers) {
if (containerStorageUri
.toLowerCase()
.startsWith(virtualMachineScaleSet.bootDiagnosticsStorageUri().toLowerCase())) {
notFound = false;
break;
}
}
Assertions.assertTrue(notFound);
}
@Test
public void canEnableBootDiagnosticsOnManagedStorageAccount() {
Network network =
this
.networkManager
.networks()
.define("vmssvnet")
.withRegion(region)
.withNewResourceGroup(rgName)
.withAddressSpace("10.0.0.0/28")
.withSubnet("subnet1", "10.0.0.0/28")
.create();
VirtualMachineScaleSet virtualMachineScaleSet =
this
.computeManager
.virtualMachineScaleSets()
.define(vmName)
.withRegion(region)
.withExistingResourceGroup(rgName)
.withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0)
.withExistingPrimaryNetworkSubnet(network, "subnet1")
.withoutPrimaryInternetFacingLoadBalancer()
.withoutPrimaryInternalLoadBalancer()
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername("jvuser")
.withSsh(sshPublicKey())
.withBootDiagnosticsOnManagedStorageAccount()
.create();
Assertions.assertNotNull(virtualMachineScaleSet);
Assertions.assertTrue(virtualMachineScaleSet.isBootDiagnosticsEnabled());
Assertions.assertNull(virtualMachineScaleSet.bootDiagnosticsStorageUri());
}
}
| Azure/azure-sdk-for-java | sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineScaleSetBootDiagnosticsTests.java | Java | mit | 23,110 |
class AddPostReceiveUrlModes < ActiveRecord::Migration
def self.up
add_column :repository_post_receive_urls, :mode, :string, :default => "github"
end
def self.down
remove_column :repository_post_receive_urls, :mode
end
end
| cema-sp/docker-redmine | to_data/plugins/redmine_git_hosting/db/migrate/20120522000000_add_post_receive_url_modes.rb | Ruby | mit | 240 |
#include "qrcodedialog.h"
#include "ui_qrcodedialog.h"
#include "bitcoinunits.h"
#include "guiconstants.h"
#include "guiutil.h"
#include "optionsmodel.h"
#include <QPixmap>
#include <QUrl>
#include <qrencode.h>
QRCodeDialog::QRCodeDialog(const QString &addr, const QString &label, bool enableReq, QWidget *parent) :
QDialog(parent),
ui(new Ui::QRCodeDialog),
model(0),
address(addr)
{
ui->setupUi(this);
setWindowTitle(QString("%1").arg(address));
ui->chkReqPayment->setVisible(enableReq);
ui->lblAmount->setVisible(enableReq);
ui->lnReqAmount->setVisible(enableReq);
ui->lnLabel->setText(label);
ui->btnSaveAs->setEnabled(false);
genCode();
}
QRCodeDialog::~QRCodeDialog()
{
delete ui;
}
void QRCodeDialog::setModel(OptionsModel *model)
{
this->model = model;
if (model)
connect(model, SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
// update the display unit, to not use the default ("BTC")
updateDisplayUnit();
}
void QRCodeDialog::genCode()
{
QString uri = getURI();
if (uri != "")
{
ui->lblQRCode->setText("");
QRcode *code = QRcode_encodeString(uri.toUtf8().constData(), 0, QR_ECLEVEL_L, QR_MODE_8, 1);
if (!code)
{
ui->lblQRCode->setText(tr("Error encoding URI into QR Code."));
return;
}
myImage = QImage(code->width + 8, code->width + 8, QImage::Format_RGB32);
myImage.fill(0xffffff);
unsigned char *p = code->data;
for (int y = 0; y < code->width; y++)
{
for (int x = 0; x < code->width; x++)
{
myImage.setPixel(x + 4, y + 4, ((*p & 1) ? 0x0 : 0xffffff));
p++;
}
}
QRcode_free(code);
ui->lblQRCode->setPixmap(QPixmap::fromImage(myImage).scaled(300, 300));
ui->outUri->setPlainText(uri);
}
}
QString QRCodeDialog::getURI()
{
QString ret = QString("elcoin:%1").arg(address);
int paramCount = 0;
ui->outUri->clear();
if (ui->chkReqPayment->isChecked())
{
if (ui->lnReqAmount->validate())
{
// even if we allow a non BTC unit input in lnReqAmount, we generate the URI with BTC as unit (as defined in BIP21)
ret += QString("?amount=%1").arg(BitcoinUnits::format(BitcoinUnits::BTC, ui->lnReqAmount->value()));
paramCount++;
}
else
{
ui->btnSaveAs->setEnabled(false);
ui->lblQRCode->setText(tr("The entered amount is invalid, please check."));
return QString("");
}
}
if (!ui->lnLabel->text().isEmpty())
{
QString lbl(QUrl::toPercentEncoding(ui->lnLabel->text()));
ret += QString("%1label=%2").arg(paramCount == 0 ? "?" : "&").arg(lbl);
paramCount++;
}
if (!ui->lnMessage->text().isEmpty())
{
QString msg(QUrl::toPercentEncoding(ui->lnMessage->text()));
ret += QString("%1message=%2").arg(paramCount == 0 ? "?" : "&").arg(msg);
paramCount++;
}
// limit URI length to prevent a DoS against the QR-Code dialog
if (ret.length() > MAX_URI_LENGTH)
{
ui->btnSaveAs->setEnabled(false);
ui->lblQRCode->setText(tr("Resulting URI too long, try to reduce the text for label / message."));
return QString("");
}
ui->btnSaveAs->setEnabled(true);
return ret;
}
void QRCodeDialog::on_lnReqAmount_textChanged()
{
genCode();
}
void QRCodeDialog::on_lnLabel_textChanged()
{
genCode();
}
void QRCodeDialog::on_lnMessage_textChanged()
{
genCode();
}
void QRCodeDialog::on_btnSaveAs_clicked()
{
QString fn = GUIUtil::getSaveFileName(this, tr("Save QR Code"), QString(), tr("PNG Images (*.png)"));
if (!fn.isEmpty())
myImage.scaled(EXPORT_IMAGE_SIZE, EXPORT_IMAGE_SIZE).save(fn);
}
void QRCodeDialog::on_chkReqPayment_toggled(bool fChecked)
{
if (!fChecked)
// if chkReqPayment is not active, don't display lnReqAmount as invalid
ui->lnReqAmount->setValid(true);
genCode();
}
void QRCodeDialog::updateDisplayUnit()
{
if (model)
{
// Update lnReqAmount with the current unit
ui->lnReqAmount->setDisplayUnit(model->getDisplayUnit());
}
}
| elco-coin/elcoin-source | src/qt/qrcodedialog.cpp | C++ | mit | 4,309 |
module Beatport
module Catalog
class Keys < Item
has_one :standard, Key
end
end
end | mateomurphy/beatport | lib/beatport/catalog/keys.rb | Ruby | mit | 102 |
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("ExternalNoCookieLogin")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Target Corporation")]
[assembly: AssemblyProduct("ExternalNoCookieLogin")]
[assembly: AssemblyCopyright("Copyright © Target Corporation 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("865efabd-dac7-4bfd-83ff-1ba0132a26d7")]
// 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 Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| jzoss/LowCalorieOwin | ExternalNoCookieLogin/Properties/AssemblyInfo.cs | C# | mit | 1,409 |
import { times, flatten } from "lodash"
import { APIOptions } from "./loaders/api"
// TODO: Type this and refactor, because I think things just kinda work by luck,
// because a static and a dynamic path loader take different number of
// arguments.
export const MAX_GRAPHQL_INT = 2147483647
export const allViaLoader = (
loader,
options: {
// For dynamic path loaders
path?: string | { [key: string]: any }
params?: { [key: string]: any }
api?: APIOptions
} = {}
) => {
const params = options.params ? { size: 25, ...options.params } : { size: 25 }
const invokeLoader = invocationParams =>
options.path
? loader(options.path, invocationParams, options.api)
: loader(invocationParams, options.api)
const countParams = {
...params,
page: 1,
size: 0,
total_count: true,
}
return invokeLoader(countParams)
.then(({ headers }) => {
const count = parseInt(headers["x-total-count"] || "0", 10)
const pages = Math.ceil(count / params.size)
return Promise.all(
times(pages, i => {
const pageParams = { ...params, page: i + 1 }
return invokeLoader(pageParams).then(({ body }) => body)
})
)
})
.then(flatten)
}
| mzikherman/metaphysics-1 | src/lib/all.ts | TypeScript | mit | 1,251 |
// Type definitions for ag-grid-community v20.2.0
// Project: http://www.ag-grid.com/
// Definitions by: Niall Crosby <https://github.com/ag-grid/>
import { Component } from "../widgets/component";
import { IFilterOptionDef, IDoesFilterPassParams, IFilterComp, IFilterParams } from "../interfaces/iFilter";
import { GridOptionsWrapper } from "../gridOptionsWrapper";
import { FloatingFilterChange } from "./floatingFilter";
import { INumberFilterParams, ITextFilterParams } from "./textFilter";
export interface Comparator<T> {
(left: T, right: T): number;
}
export declare enum FilterConditionType {
MAIN = 0,
CONDITION = 1
}
export interface CombinedFilter<T> {
operator: string;
condition1: T;
condition2: T;
}
/**
* T(ype) The type of this filter. ie in DateFilter T=Date
* P(arams) The params that this filter can take
* M(model getModel/setModel) The object that this filter serializes to
* F Floating filter params
*
* Contains common logic to ALL filters.. Translation, apply and clear button
* get/setModel context wiring....
*/
export declare abstract class BaseFilter<T, P extends IFilterParams, M> extends Component implements IFilterComp {
static EMPTY: string;
static EQUALS: string;
static NOT_EQUAL: string;
static LESS_THAN: string;
static LESS_THAN_OR_EQUAL: string;
static GREATER_THAN: string;
static GREATER_THAN_OR_EQUAL: string;
static IN_RANGE: string;
static CONTAINS: string;
static NOT_CONTAINS: string;
static STARTS_WITH: string;
static ENDS_WITH: string;
private newRowsActionKeep;
customFilterOptions: {
[name: string]: IFilterOptionDef;
};
filterParams: P;
clearActive: boolean;
applyActive: boolean;
defaultFilter: string;
selectedFilter: string;
selectedFilterCondition: string;
private eButtonsPanel;
private eFilterBodyWrapper;
private eApplyButton;
private eClearButton;
private eConditionWrapper;
conditionValue: string;
gridOptionsWrapper: GridOptionsWrapper;
init(params: P): void;
onClearButton(): void;
abstract customInit(): void;
abstract isFilterActive(): boolean;
abstract modelFromFloatingFilter(from: string): M;
abstract doesFilterPass(params: IDoesFilterPassParams): boolean;
abstract bodyTemplate(type: FilterConditionType): string;
abstract resetState(resetConditionFilterOnly?: boolean): void;
abstract serialize(type: FilterConditionType): M;
abstract parse(toParse: M, type: FilterConditionType): void;
abstract refreshFilterBodyUi(type: FilterConditionType): void;
abstract initialiseFilterBodyUi(type: FilterConditionType): void;
abstract isFilterConditionActive(type: FilterConditionType): boolean;
floatingFilter(from: string): void;
onNewRowsLoaded(): void;
getModel(): M | CombinedFilter<M>;
getNullableModel(): M | CombinedFilter<M>;
setModel(model: M | CombinedFilter<M>): void;
private doOnFilterChanged;
onFilterChanged(applyNow?: boolean): void;
private redrawCondition;
private refreshOperatorUi;
onFloatingFilterChanged(change: FloatingFilterChange): boolean;
generateFilterHeader(type: FilterConditionType): string;
private generateTemplate;
acceptsBooleanLogic(): boolean;
wrapCondition(mainCondition: string): string;
private createConditionTemplate;
private createConditionBody;
translate(toTranslate: string): string;
getDebounceMs(filterParams: ITextFilterParams | INumberFilterParams): number;
doesFilterHaveHiddenInput(filterType: string): boolean;
}
/**
* Every filter with a dropdown where the user can specify a comparing type against the filter values
*/
export declare abstract class ComparableBaseFilter<T, P extends IComparableFilterParams, M> extends BaseFilter<T, P, M> {
private eTypeSelector;
private eTypeConditionSelector;
private suppressAndOrCondition;
abstract getApplicableFilterTypes(): string[];
abstract filterValues(type: FilterConditionType): T | T[];
abstract individualFilterPasses(params: IDoesFilterPassParams, type: FilterConditionType): boolean;
doesFilterPass(params: IDoesFilterPassParams): boolean;
init(params: P): void;
customInit(): void;
acceptsBooleanLogic(): boolean;
generateFilterHeader(type: FilterConditionType): string;
initialiseFilterBodyUi(type: FilterConditionType): void;
abstract getDefaultType(): string;
private onFilterTypeChanged;
isFilterActive(): boolean;
setFilterType(filterType: string, type: FilterConditionType): void;
isFilterConditionActive(type: FilterConditionType): boolean;
}
export interface NullComparator {
equals?: boolean;
lessThan?: boolean;
greaterThan?: boolean;
}
export interface IComparableFilterParams extends IFilterParams {
suppressAndOrCondition: boolean;
}
export interface IScalarFilterParams extends IComparableFilterParams {
inRangeInclusive?: boolean;
nullComparator?: NullComparator;
}
/**
* Comparable filter with scalar underlying values (ie numbers and dates. Strings are not scalar so have to extend
* ComparableBaseFilter)
*/
export declare abstract class ScalarBaseFilter<T, P extends IScalarFilterParams, M> extends ComparableBaseFilter<T, P, M> {
static readonly DEFAULT_NULL_COMPARATOR: NullComparator;
abstract comparator(): Comparator<T>;
private nullComparator;
getDefaultType(): string;
private translateNull;
individualFilterPasses(params: IDoesFilterPassParams, type: FilterConditionType): boolean;
private doIndividualFilterPasses;
}
| ceolter/angular-grid | dist/lib/filter/baseFilter.d.ts | TypeScript | mit | 5,617 |
using IoT_Core.Models;
using MongoDB.Bson;
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
namespace IoT_Core.Services.Repositories
{
public class WateringRepository : BaseRepository, IWateringRepository
{
public WateringRepository(IOptions<AppSettings> optionsAccessor)
: base(optionsAccessor)
{
}
public async Task<WateringValue> AddWateringAsync(WateringValue watering)
{
var wateringCollection = _database.GetCollection<WateringValue>("watering");
await wateringCollection.InsertOneAsync(watering);
return watering;
}
public async Task<WateringValue> GetWateringByIdAsync(string id)
{
var wateringCollection = _database.GetCollection<WateringValue>("watering");
var objectId = new ObjectId(id);
var filter = Builders<WateringValue>.Filter.Eq(wv => wv.Id, objectId);
return await wateringCollection.Find(filter)
.FirstAsync<WateringValue>();
}
public async Task<IEnumerable<WateringValue>> GetWateringsAsync()
{
var wateringCollection = _database.GetCollection<WateringValue>("watering");
return await wateringCollection.Find(new BsonDocument())
.Limit(_listLimit)
.ToListAsync();
}
}
}
| MCeddy/IoT-core | IoT-Core/Services/Repositories/WateringRepository.cs | C# | mit | 1,483 |
<?php
/*
* This file is part of Gloubster.
*
* (c) Alchemy <info@alchemy.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Gloubster\Receipt;
use Gloubster\Exception\RuntimeException;
class Factory
{
public static function fromArray(array $data)
{
if (!isset($data['type'])) {
throw new RuntimeException('Invalid receipt data : missing key `type`');
}
$classname = $data['type'];
if (!class_exists($classname)) {
throw new RuntimeException(sprintf('Invalid receipt data : class %s does not exists', $classname));
}
$obj = new $classname;
if (!$obj instanceof ReceiptInterface) {
throw new RuntimeException('Invalid receipt data, ReceiptInterface expected');
}
foreach ($data as $key => $serializedValue) {
if (in_array($key, array('name', 'type'))) {
continue;
}
$obj->{'set' . ucfirst($key)}($serializedValue);
}
return $obj;
}
}
| Gloubster/Communications | src/Gloubster/Receipt/Factory.php | PHP | mit | 1,130 |
package input
import (
glfw "github.com/go-gl/glfw3"
"github.com/tedsta/fission/core"
"github.com/tedsta/fission/core/event"
)
type InputSystem struct {
eventManager *event.Manager
window *glfw.Window
}
func NewInputSystem(w *glfw.Window, e *event.Manager) *InputSystem {
i := &InputSystem{}
// Set the input callbacks
w.SetMouseButtonCallback(i.onMouseBtn)
//w.SetMouseWheelCallback((i).onMouseWheel)
w.SetCursorPositionCallback(i.onMouseMove)
w.SetKeyCallback(i.onKey)
w.SetCharacterCallback(i.onChar)
i.window = w
i.eventManager = e
return i
}
func (i *InputSystem) Begin(dt float32) {
glfw.PollEvents()
}
func (i *InputSystem) ProcessEntity(e *core.Entity, dt float32) {
}
func (i *InputSystem) End(dt float32) {
}
func (i *InputSystem) TypeBits() (core.TypeBits, core.TypeBits) {
return 0, 0
}
// Callbacks ###################################################################
func (i *InputSystem) onResize(wnd *glfw.Window, w, h int) {
//fmt.Printf("resized: %dx%d\n", w, h)
}
func (i *InputSystem) onMouseBtn(w *glfw.Window, btn glfw.MouseButton, action glfw.Action, mods glfw.ModifierKey) {
e := &MouseBtnEvent{MouseButton(btn), Action(action), ModifierKey(mods)}
i.eventManager.FireEvent(e)
}
func (i *InputSystem) onMouseWheel(w *glfw.Window, delta int) {
//fmt.Printf("mouse wheel: %d\n", delta)
}
func (i *InputSystem) onMouseMove(w *glfw.Window, xpos float64, ypos float64) {
e := &MouseMoveEvent{int(xpos), int(ypos)}
i.eventManager.FireEvent(e)
}
func (i *InputSystem) onKey(w *glfw.Window, key glfw.Key, scancode int, action glfw.Action, mods glfw.ModifierKey) {
e := &KeyEvent{Key(key), scancode, Action(action), ModifierKey(mods)}
i.eventManager.FireEvent(e)
}
func (i *InputSystem) onChar(w *glfw.Window, key uint) {
//fmt.Printf("char: %d\n", key)
}
// init ##########################################################
func init() {
IntentComponentType = core.RegisterComponent(IntentComponentFactory)
}
| tedsta/gofission | input/inputsystem.go | GO | mit | 1,973 |
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// 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: 2017.11.30 at 08:24:17 PM JST
//
package uk.org.siri.siri;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* Type for list of effects.
*
* <p>Java class for PtConsequencesStructure complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="PtConsequencesStructure">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Consequence" type="{http://www.siri.org.uk/siri}PtConsequenceStructure" maxOccurs="unbounded"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "PtConsequencesStructure", propOrder = {
"consequence"
})
public class PtConsequencesStructure {
@XmlElement(name = "Consequence", required = true)
protected List<PtConsequenceStructure> consequence;
/**
* Gets the value of the consequence property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the consequence property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getConsequence().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link PtConsequenceStructure }
*
*
*/
public List<PtConsequenceStructure> getConsequence() {
if (consequence == null) {
consequence = new ArrayList<PtConsequenceStructure>();
}
return this.consequence;
}
}
| laidig/siri-20-java | src/uk/org/siri/siri/PtConsequencesStructure.java | Java | mit | 2,372 |
$(document).ready(function(){
//fancybox.js init
/*$('.fancybox').fancybox({
openEffect : 'none',
closeEffect : 'none',
prevEffect : 'none',
nextEffect : 'none',
arrows : false,
helpers : {
media : {},
buttons : {}
}
});*/
//wow.js init
wow = new WOW(
{
animateClass: 'animated',
mobile: false,
offset: 100
}
);
wow.init();
});
| Sirchem/WebGraph | js/main.js | JavaScript | mit | 411 |
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddSiezidColumnDishprice extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('dish_prices', function (Blueprint $table) {
$table->integer('size_id')->unsigned()->nullable();
$table->integer('price_old')->unsigned()->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('dish_prices', function (Blueprint $table) {
$table->dropColumn('size_id');
$table->dropColumn('price_old');
});
}
}
| stanleygomes/stanleygomes.github.io | projects/netrango-laravel-netrango/database/migrations/2017_05_08_203031_add_siezid_column_dishprice.php | PHP | mit | 785 |
<?php // lint >= 7.4
function foo():?Foo
{
}
$callback = function():?Foo
{
};
$callback = fn ($a):?Foo => $a;
interface Foo
{
public function doFoo($param):?Foo;
}
class FooBar implements Foo
{
public function doFoo($param):?Foo
{
}
}
| slevomat/coding-standard | tests/Sniffs/TypeHints/data/fixableReturnTypeHintNoSpaceBetweenColonAndNullabilitySymbol.php | PHP | mit | 251 |
"use strict";
var compression = require("../lib/core/middleware/compression");
describe("core.middleware.compression", function() {
var fakeThis;
beforeEach("create fake this", function() {
fakeThis = {
enabled: sinon.stub().withArgs("compress").returns(true),
app: {
use: sinon.spy()
}
};
});
it("should be a function", function() {
compression.should.be.a("function");
});
it("should only check the compress option", function() {
compression.call(fakeThis);
fakeThis.enabled.should.be.calledOnce;
fakeThis.enabled.should.be.calledWith("compress");
});
it("should use one middleware function if enabled", function() {
compression.call(fakeThis);
fakeThis.app.use.should.be.calledOnce;
// express-compress returns an array of middleware
fakeThis.app.use.args[0][0].should.be.a("function");
});
it("should not use any middleware if not enabled", function() {
fakeThis.enabled = sinon.stub().withArgs("compress").returns(false);
compression.call(fakeThis);
fakeThis.app.use.should.not.be.called;
});
});
| Nulifier/Obsidian | test/hide/core.middleware.compression.js | JavaScript | mit | 1,098 |
EmberChat::Application.routes.draw do
root :to => 'application#index'
end
| johnkpaul/emberchat | config/routes.rb | Ruby | mit | 76 |
package misc
import (
"net/http"
"strconv"
"time"
)
//Writer http response writer interface.
type Writer interface {
http.ResponseWriter
http.Hijacker
}
//ElapsedTime add requset elapsed time to "Elapsed-Time" header of response.
//Elapsed time is time spent between middleware exetue and data wrote to response.
func ElapsedTime(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
nw := elapsedTimeResponseWriter{
Writer: w.(Writer),
Timestamp: time.Now().UnixNano(),
written: false,
}
next(&nw, r)
}
type elapsedTimeResponseWriter struct {
Writer
Timestamp int64
written bool
}
func (e *elapsedTimeResponseWriter) WriteHeader(status int) {
if e.written == false {
e.written = true
e.Writer.Header().Set("Elapsed-Time", strconv.FormatInt(time.Now().UnixNano()-e.Timestamp, 10)+" ns")
}
e.Writer.WriteHeader(status)
}
func (e *elapsedTimeResponseWriter) Write(data []byte) (int, error) {
if e.written == false {
e.WriteHeader(http.StatusOK)
}
return e.Writer.Write(data)
}
| herb-go/herb | middleware/misc/elapsedtime.go | GO | mit | 1,028 |
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("1. DescriptionOfStrings")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("1. DescriptionOfStrings")]
[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("6f286f01-7df7-4b97-991a-3448a77a6e17")]
// 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")]
| TeeeeeC/TelerikAcademy2015-2016 | 02. C# part 2/06. Strings and Text processing/1. DescriptionOfStrings/Properties/AssemblyInfo.cs | C# | mit | 1,422 |
def clear_console
puts "\e[H\e[2J"
end
watch('lib/.*\.php') do |match|
clear_console
system 'phpunit'
end
| immense/php-macaroons | autotest-watchr.rb | Ruby | mit | 114 |
namespace Gibraltar.Messaging
{
/// <summary>
/// Wraps a Gibraltar Packet for publishing
/// </summary>
/// <remarks>For thread safety, request a lock on this object directly. This is necessary when accessing updateable properties.</remarks>
internal class PacketEnvelope
{
private readonly IMessengerPacket m_Packet;
private readonly bool m_IsCommand;
private readonly bool m_IsHeader;
private readonly bool m_WriteThrough;
private bool m_Committed;
private bool m_Pending;
//public event EventHandler PacketCommitted;
public PacketEnvelope(IMessengerPacket packet, bool writeThrough)
{
m_Packet = packet;
m_WriteThrough = writeThrough;
if (packet is CommandPacket)
{
m_IsCommand = true;
}
else
{
m_IsCommand = false;
}
ICachedMessengerPacket cachedPacket = packet as ICachedMessengerPacket;
if (cachedPacket != null)
{
m_IsHeader = cachedPacket.IsHeader;
}
}
/// <summary>
/// True if the packet is a command packet, false otherwise.
/// </summary>
public bool IsCommand { get { return m_IsCommand; } }
/// <summary>
/// True if the packet is a header cached packet, false otherwise.
/// </summary>
public bool IsHeader { get { return m_IsHeader; } }
/// <summary>
/// True if the packet has been commited, false otherwise
/// </summary>
/// <remarks>This property is thread safe and will pulse waiting threads when it is set to true.
/// This property functions as a latch and can't be set false once it has been set to true.</remarks>
public bool IsCommitted
{
get
{
return m_Committed;
}
set
{
lock (this)
{
//we can't set committed to false, only true.
if ((value) && (m_Committed == false))
{
m_Committed = true;
}
System.Threading.Monitor.PulseAll(this);
}
}
}
/// <summary>
/// True if the packet is pending submission to the queue, false otherwise
/// </summary>
/// <remarks>This property is thread safe and will pulse waiting threads when changed.</remarks>
public bool IsPending
{
get
{
return m_Pending;
}
set
{
lock (this)
{
//are they changing the value?
if (value != m_Pending)
{
m_Pending = value;
}
System.Threading.Monitor.PulseAll(this);
}
}
}
/// <summary>
/// The actual Gibraltar Packet
/// </summary>
public IMessengerPacket Packet { get { return m_Packet; } }
/// <summary>
/// True if the client is waiting for the packet to be written before returning.
/// </summary>
public bool WriteThrough { get { return m_WriteThrough; } }
}
}
| GibraltarSoftware/Loupe.Agent.Core | src/Core/Messaging/PacketEnvelope.cs | C# | mit | 3,447 |
<?php
namespace Icecave\Chrono\TimeSpan;
use DateInterval;
use Icecave\Chrono\Interval\IntervalInterface;
use Icecave\Chrono\TimePointInterface;
/**
* A common interface for non-anchored blocks of time (periods and durations).
*/
interface TimeSpanInterface
{
/**
* @return bool True if the time span is zero seconds in length; otherwise, false.
*/
public function isEmpty();
/**
* @return TimeSpanInterface
*/
public function inverse();
/**
* Resolve the time span to a total number of seconds, using the given time point as the start of the span.
*
* @param TimePointInterface $timePoint The start of the time span.
*
* @return int The total number of seconds.
*/
public function resolveToSeconds(TimePointInterface $timePoint);
/**
* Resolve the time span to a {@see Duration}, using the given time point as the start of the span.
*
* @param TimePointInterface $timePoint The start of the time span.
*
* @return Duration
*/
public function resolveToDuration(TimePointInterface $timePoint);
/**
* Resolve the time span to a {@see Period}, using the given time point as the start of the span.
*
* @param TimePointInterface $timePoint The start of the time span.
*
* @return Period
*/
public function resolveToPeriod(TimePointInterface $timePoint);
/**
* Resolve the time span an an {@see IntervalInterface} starting at the given time point, with a length equal to this time span.
*
* @param TimePointInterface $timePoint The start of the interval.
*
* @return IntervalInterface The end of the time span.
*/
public function resolveToInterval(TimePointInterface $timePoint);
/**
* Resolve the time span to a time point after the given time point by the length of this span.
*
* @param TimePointInterface $timePoint The start of the time span.
*
* @return TimePointInterface
*/
public function resolveToTimePoint(TimePointInterface $timePoint);
/**
* @return DateInterval A native PHP DateInterval instance representing this span.
*/
public function nativeDateInterval();
/**
* @return string
*/
public function string();
/**
* @return string
*/
public function __toString();
}
| IcecaveStudios/chrono | src/TimeSpan/TimeSpanInterface.php | PHP | mit | 2,370 |
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Network::Mgmt::V2019_11_01
module Models
#
# Authentication certificates of an application gateway.
#
class ApplicationGatewayAuthenticationCertificate < SubResource
include MsRestAzure
# @return [String] Certificate public data.
attr_accessor :data
# @return [ProvisioningState] The provisioning state of the
# authentication certificate resource. Possible values include:
# 'Succeeded', 'Updating', 'Deleting', 'Failed'
attr_accessor :provisioning_state
# @return [String] Name of the authentication certificate that is unique
# within an Application Gateway.
attr_accessor :name
# @return [String] A unique read-only string that changes whenever the
# resource is updated.
attr_accessor :etag
# @return [String] Type of the resource.
attr_accessor :type
#
# Mapper for ApplicationGatewayAuthenticationCertificate class as Ruby
# Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'ApplicationGatewayAuthenticationCertificate',
type: {
name: 'Composite',
class_name: 'ApplicationGatewayAuthenticationCertificate',
model_properties: {
id: {
client_side_validation: true,
required: false,
serialized_name: 'id',
type: {
name: 'String'
}
},
data: {
client_side_validation: true,
required: false,
serialized_name: 'properties.data',
type: {
name: 'String'
}
},
provisioning_state: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'properties.provisioningState',
type: {
name: 'String'
}
},
name: {
client_side_validation: true,
required: false,
serialized_name: 'name',
type: {
name: 'String'
}
},
etag: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'etag',
type: {
name: 'String'
}
},
type: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'type',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end
| Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-11-01/generated/azure_mgmt_network/models/application_gateway_authentication_certificate.rb | Ruby | mit | 3,157 |
# pre_NAMD.py
# Creates the files used for NAMD based on the .pdb file dowloaded from PDB bank
#
# Usage:
# python pre_NAMD.py $PDBID
#
# $PDBID=the 4 characters identification code of the .pdb file
#
# Input:
# $PDBID.pdb: .pdb file downloaded from PDB bank
#
# Output:
# $PDBID_p.pdb: .pdb file with water molecules removed
# $PDBID_p_h.pdb: .pdb file with water removed and hydrogen atoms added
# $PDBID_p_h.psf: .psf file of $PDBID_p_h.pdb
# $PDBID_p_h.log: Log file of adding hydrogen atoms
# $PDBID_wb.pdb: .pdb file of the water box model
# $PDBID_wb.psf: .psf file of $PDBID_wb.pdb
# $PDBID_wb.log: Log file of the water box model generation
# $PDBID_wb_i.pdb: .pdb file of the ionized water box model (For NAMD)
# $PDBID_wb_i.psf: .psf file of PDBID_wb_i.pdb (For NAMD)
# $PDBID.log: Log file of the whole process (output of VMD)
# $PDBID_center.txt: File contains the grid and center information of
# the ionized water box model
#
# Author: Xiaofei Zhang
# Date: June 20 2016
from __future__ import print_function
import sys, os
def print_error(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
# main
if len(sys.argv) != 2:
print_error("Usage: python pre_NAMD.py $PDBID")
sys.exit(-1)
mypath = os.path.realpath(__file__)
tclpath = os.path.split(mypath)[0] + os.path.sep + 'tcl' + os.path.sep
pdbid = sys.argv[1]
logfile = pdbid+'.log'
# Using the right path of VMD
vmd = "/Volumes/VMD-1.9.2/VMD 1.9.2.app/Contents/vmd/vmd_MACOSXX86"
print("Input: "+pdbid+".pdb")
# Remove water
print("Remove water..")
cmdline = '\"'+ vmd + '\"' +' -dispdev text -eofexit < '+ tclpath + 'remove_water.tcl' + ' ' + '-args' + ' '+ pdbid +'> '+ logfile
os.system(cmdline)
# Create .psf
print("Create PSF file...")
cmdline = '\"'+ vmd + '\"' +' -dispdev text -eofexit < '+ tclpath + 'create_psf.tcl' + ' ' + '-args' + ' '+ pdbid +'>> '+ logfile
os.system(cmdline)
# Build water box
print("Build water box...")
cmdline = '\"'+ vmd + '\"' +' -dispdev text -eofexit < '+ tclpath + 'build_water_box.tcl' + ' ' + '-args' + ' '+ pdbid +'>> '+ logfile
os.system(cmdline)
# Add ions
print("Add ions...")
cmdline = '\"'+ vmd + '\"' +' -dispdev text -eofexit < '+ tclpath + 'add_ion.tcl' + ' ' + '-args' + ' '+ pdbid +'>> '+ logfile
os.system(cmdline)
# Calculate grid and center
print("Calculate center coordinates...")
cmdline = '\"'+ vmd + '\"' +' -dispdev text -eofexit < '+ tclpath + 'get_center.tcl' + ' ' + '-args' + ' '+ pdbid +'>> '+ logfile
os.system(cmdline)
print("Finish!")
# end main
| Xiaofei-Zhang/NAMD_Docking_pipeline | pre_NAMD/pre_NAMD.py | Python | mit | 2,553 |
<?php
declare(strict_types = 1);
namespace OctoLab\Common\Util;
/**
* @author Kamil Samigullin <kamil@samigullin.info>
*/
final class Ini
{
/** @var bool */
private $processSections;
/** @var int */
private $scannerMode;
/**
* @param bool $processSection
* @param int $scannerMode
*
* @api
*/
public function __construct(bool $processSection, int $scannerMode)
{
\assert('$scannerMode >= 0');
$this->processSections = $processSection;
$this->scannerMode = $scannerMode;
}
/**
* @param bool $processSections
* @param int $scannerMode
*
* @return Ini
*
* @api
*/
public static function new(bool $processSections = false, int $scannerMode = INI_SCANNER_NORMAL): Ini
{
return new self($processSections, $scannerMode);
}
/**
* @param string $ini
* @param bool|null $processSections
* @param int|null $scannerMode
*
* @return array
*
* @throws \InvalidArgumentException
*
* @api
*/
public function parse(string $ini, bool $processSections = null, int $scannerMode = null): array
{
list($content, $error) = $this->softParse($ini, $processSections, $scannerMode);
if ($error !== null) {
throw $error;
}
return $content;
}
/**
* @param string $ini
* @param bool|null $processSections
* @param int|null $scannerMode
*
* @return array where first element is a result of parse_ini_string, second - \InvalidArgumentException or null
*
* @api
*/
public function softParse(string $ini, bool $processSections = null, int $scannerMode = null): array
{
\assert('$scannerMode === null || $scannerMode >= 0');
error_reporting(($before = error_reporting()) & ~E_WARNING);
$content = parse_ini_string(
$ini,
$processSections ?? $this->processSections,
$scannerMode ?? $this->scannerMode
);
error_reporting($before);
if ($content === false) {
return [null, new \InvalidArgumentException(sprintf("Invalid ini string \n\n%s\n", $ini))];
}
return [$content, null];
}
}
| kamilsk/Common | src/Util/Ini.php | PHP | mit | 2,270 |
package com.humooooour.kit.screen;
import android.app.Activity;
import android.view.KeyEvent;
import android.view.MotionEvent;
import com.humooooour.kit.HSApp;
import com.humooooour.kit.geom.HSRect;
import processing.core.PApplet;
import processing.core.PGraphics;
public class HSScreen {
private HSApp mApp;
private HSRect mBounds;
public HSScreen(HSApp app, HSRect bounds) {
mApp = app;
mBounds =bounds;
}
public void dispose() {
}
public void update(float dt) {
}
public void draw(PGraphics g) {
}
public boolean handleTouch(MotionEvent touch) {
return false;
}
public boolean handleKey(KeyEvent key) {
return false;
}
protected HSApp getApp() {
return mApp;
}
protected PApplet getPApplet() {
return mApp.getPApplet();
}
protected Activity getActivity() {
return mApp.getActivity();
}
protected PGraphics getPGraphics() {
return mApp.getPGraphics();
}
protected HSRect getBounds() {
return mBounds;
}
protected HSRect getContentBounds() {
HSRect cBounds = new HSRect(mBounds);
cBounds.offsetTo(0.0f, 0.0f);
return cBounds;
}
}
| thedoritos/HumourKit | src/com/humooooour/kit/screen/HSScreen.java | Java | mit | 1,120 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-12-03 13:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('busshaming', '0013_auto_20170917_0502'),
]
operations = [
migrations.CreateModel(
name='StopSequence',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('sequence_hash', models.CharField(max_length=64)),
('stop_sequence', models.TextField()),
('length', models.SmallIntegerField()),
('trip_headsign', models.CharField(blank=True, max_length=200, null=True)),
('trip_short_name', models.CharField(blank=True, max_length=200, null=True)),
('direction', models.SmallIntegerField()),
('created_at', models.DateTimeField(auto_now_add=True)),
('route', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='busshaming.Route')),
],
),
migrations.AddField(
model_name='trip',
name='stop_sequence',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='busshaming.StopSequence'),
),
migrations.AlterUniqueTogether(
name='stopsequence',
unique_together=set([('sequence_hash', 'route')]),
),
]
| katharosada/bus-shaming | busshaming/migrations/0014_auto_20171203_1316.py | Python | mit | 1,559 |
"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class NonLatticeOneShot:
"""
the simplest device.
Uses a stepwise-constant quadrature rule and non-adaptive
smoothing.
"""
def __init__(
self,
positive=True,
normalize=False,
wlm=None,
wlm_factory='WeightedLassoLarsCV',
cum_interp='linear',
smoothing=1.0, # only for spline smoother
step_size=0.25, # only for dirac interpolant
strategy='random', # only for dirac interpolant
*args, **kwargs):
if wlm is None:
# Allow reference by class for easy serialization
if isinstance(wlm_factory, str):
wlm_factory = getattr(weighted_linear_model, wlm_factory)
self.wlm = wlm_factory(
positive=positive,
normalize=normalize,
*args, **kwargs
)
else:
self.wlm = wlm
self.big_n_hat_ = None
self.cum_interp = cum_interp
self.smoothing = smoothing
self.strategy = strategy
self.step_size = step_size
def fit(
self,
obs_t,
cum_obs,
basis_lag=1.0,
penalty_weight='adaptive',
sample_weight='bermanturner',
max_basis_span=float('inf'),
big_n_hat=None,
*args, **kwargs):
self.obs_t_ = obs_t
self.cum_obs_ = cum_obs
if np.isscalar(basis_lag):
# scalars are a bin width
basis_span = min(
(np.amax(obs_t) - np.amin(obs_t))/2.0,
max_basis_span
)
n_bins = ceil(basis_span/basis_lag)
self.basis_lag_ = np.arange(n_bins+1) * basis_lag
else:
self.basis_lag_ = basis_lag
if big_n_hat is None:
self.big_n_hat_ = self.predict_big_n()
(
self.inc_predictors_,
self.inc_response_,
self.inc_sample_weight_
) = (
design.design_stepwise(
obs_t=self.obs_t_,
cum_obs=self.cum_obs_,
basis_lag=self.basis_lag_,
big_n_hat=self.big_n_hat_,
sample_weight=sample_weight
)
)
self.wlm.fit(
X=self.inc_predictors_,
y=self.inc_response_,
sample_weight=self.inc_sample_weight_,
penalty_weight=penalty_weight,
*args, **kwargs
)
def predict_intensity(self, obs_t=None):
"""
This should return forward-predicted intensity
based on the fitted histogram, up to the last observations
before the given times.
"""
return design.predict_increment(
big_n=self.big_n_hat_,
obs_t=obs_t if obs_t is not None else self.obs_t_,
mu=self.intercept_,
basis_lag=self.basis_lag_,
coef=self.coef_)
def predict(self, obs_t=None):
"""
This should return predicted increments
based on the fitted histogram, up to the last observations
before the given times.
"""
return design.predict_increment(
big_n=self.big_n_hat_,
obs_t=obs_t if obs_t is not None else self.obs_t_,
mu=self.intercept_,
basis_lag=self.basis_lag_,
coef=self.coef_)
def predict_big_n(self, obs_t=None):
"""
This should return predicted increment interpolant
based on the fitted histogram, up to the last observations
before the given times.
"""
return design.interpolate(
obs_t=self.obs_t_,
cum_obs=self.cum_obs_,
cum_interp=self.cum_interp,
smoothing=self.smoothing,
step_size=self.step_size,
strategy=self.strategy,
)
@property
def coef_(self):
return self.wlm.coef_
@property
def eta_(self):
return np.sum(self.coef_)
@property
def intercept_(self):
return self.wlm.intercept_
@property
def alpha_(self):
return self.wlm.alpha_
@property
def n_iter_(self):
return self.wlm.n_iter_
class NonLatticeIterative(NonLatticeOneShot):
"""
repeatedly forward-smooth to find optimal interpolant.
TODO: This doesn't do backwards losses
"""
def __init__(
self,
*args, **kwargs):
super().__init__(
cum_interp='dirac',
strategy='random',
*args, **kwargs)
def fit(
self,
obs_t,
cum_obs,
basis_lag=1.0,
penalty_weight='adaptive',
sample_weight='bermanturner',
max_basis_span=float('inf'),
big_n_hat=None,
max_iter=3,
*args, **kwargs):
inner_model = NonLatticeOneShot(
wlm=self.wlm,
cum_interp='linear',
)
self.inner_model = inner_model
self.obs_t_ = obs_t
self.cum_obs_ = cum_obs
if np.isscalar(basis_lag):
# scalars are a bin width
basis_span = min(
(np.amax(obs_t) - np.amin(obs_t))/2.0,
max_basis_span
)
n_bins = ceil(basis_span/basis_lag)
self.basis_lag_ = np.arange(n_bins+1) * basis_lag
else:
self.basis_lag_ = basis_lag
if big_n_hat is None:
self.big_n_hat_ = self.predict_big_n()
for i in range(max_iter):
print('i', i, max_iter)
inner_model.fit(
obs_t=self.big_n_hat_.spike_lattice,
cum_obs=self.big_n_hat_.spike_cum_weight,
*args,
**kwargs)
n_hat_arr = inner_model.predict(
obs_t=self.big_n_hat_.spike_lattice,
)
self.big_n_hat_ = design.reweight_dirac_interpolant(
self.big_n_hat_,
n_hat_arr
)
| danmackinlay/branching_process | branching_process/nonlattice/fit.py | Python | mit | 6,351 |
<?php
namespace porcelanosa\yii2options\models\query;
/**
* This is the ActiveQuery class for [[\app\modules\admin\models\ChildOptionMultiple]].
*
* @see \app\modules\admin\models\ChildOptionMultiple
*/
class ChildOptionMultipleQuery extends \yii\db\ActiveQuery
{
/*public function active()
{
return $this->andWhere('[[status]]=1');
}*/
/**
* @inheritdoc
* @return \porcelanosa\yii2options\models\ChildOptionMultiple []|array
*/
public function all($db = null)
{
return parent::all($db);
}
/**
* @inheritdoc
* @return \app\modules\admin\models\ChildOptionMultiple|array|null
*/
public function one($db = null)
{
return parent::one($db);
}
}
| porcelanosa/yii2-options | models/query/ChildOptionMultipleQuery.php | PHP | mit | 747 |
"""useful context managers"""
from contextlib import suppress
with suppress(ModuleNotFoundError):
from lag import *
import os
import contextlib
def clog(*args, condition=True, log_func=print, **kwargs):
if condition:
return log_func(*args, **kwargs)
@contextlib.contextmanager
def cd(newdir, verbose=True):
"""Change your working directory, do stuff, and change back to the original"""
_clog = partial(clog, condition=verbose, log_func=print)
prevdir = os.getcwd()
os.chdir(os.path.expanduser(newdir))
try:
_clog(f'cd {newdir}')
yield
finally:
_clog(f'cd {prevdir}')
os.chdir(prevdir)
# from pathlib import Path
# _clog("Called before cd", Path().absolute())
# with cd(Path.home()):
# if verbose: print("Called under cd", Path().absolute())
# _clog("Called after cd and same as before", Path().absolute())
| thorwhalen/ut | util/context_managers.py | Python | mit | 908 |
package ls;
import java.util.*;
import javax.swing.table.AbstractTableModel;
public class DirectoryTableModel extends AbstractTableModel {
private final List<DirOpt> dirs = new ArrayList<>();
public List<DirOpt> getDirs () {
return new ArrayList<>(dirs);
}
public void add (DirOpt dir) {
dirs.add(dir);
Collections.sort(dirs);
fireTableDataChanged();
}
public void addAll (List<DirOpt> dirs) {
this.dirs.addAll(dirs);
Collections.sort(this.dirs);
fireTableDataChanged();
}
public void remove (int row) {
dirs.remove(row);
fireTableDataChanged();
}
public void setDir (int row, DirOpt dir) {
dirs.set(row, dir);
Collections.sort(dirs);
fireTableDataChanged();
}
public DirOpt getDir (int row) {
return dirs.get(row);
}
@Override
public int getRowCount () {
return dirs.size();
}
@Override
public int getColumnCount () {
return 3;
}
@Override
public String getColumnName (int column) {
switch (column) {
case 0:
return "Enabled";
case 1:
return "Dir";
case 2:
return "Recursive";
default:
throw new RuntimeException();
}
}
@Override
public Class<?> getColumnClass (int columnIndex) {
switch (columnIndex) {
case 0:
case 2:
return Boolean.class;
case 1:
return String.class;
default:
throw new RuntimeException();
}
}
@Override
public boolean isCellEditable (int rowIndex, int columnIndex) {
switch (columnIndex) {
case 0:
case 2:
return true;
case 1:
return false;
default:
throw new RuntimeException();
}
}
@Override
public Object getValueAt (int row, int col) {
DirOpt d = dirs.get(row);
switch (col) {
case 0:
return d.enabled;
case 1:
return d.dir;
case 2:
return d.recursive;
default:
throw new RuntimeException();
}
}
@Override
public void setValueAt (Object val, int row, int col) {
DirOpt d = dirs.get(row);
switch (col) {
case 0:
d = new DirOpt(d.dir, (Boolean) val, d.recursive);
case 2:
d = new DirOpt(d.dir, d.enabled, (Boolean) val);
break;
default:
throw new RuntimeException();
}
dirs.set(row, d);
}
} | alexyz/logsearch | src/ls/DirectoryTableModel.java | Java | mit | 2,287 |
<?php
declare(strict_types=1);
/**
* OrganizationsApi.
*
* PHP version 7.4
*
* @category Class
* @package DocuSign\eSign
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* DocuSign REST API
*
* The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
*
* OpenAPI spec version: v2.1
* Contact: devcenter@docusign.com
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 2.4.13-SNAPSHOT
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace DocuSign\eSign\Api\OrganizationsApi;
namespace DocuSign\eSign\Api;
use DocuSign\eSign\Client\ApiClient;
use DocuSign\eSign\Client\ApiException;
use DocuSign\eSign\Configuration;
use DocuSign\eSign\ObjectSerializer;
/**
* OrganizationsApi Class Doc Comment
*
* @category Class
* @package DocuSign\eSign
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class OrganizationsApi
{
/**
* API Client
*
* @var ApiClient instance of the ApiClient
*/
protected ApiClient $apiClient;
/**
* Constructor
*
* @param ApiClient|null $apiClient The api client to use
* @return void
*/
public function __construct(ApiClient $apiClient = null)
{
$this->apiClient = $apiClient ?? new ApiClient();
}
/**
* Get API client
*
* @return ApiClient get the API client
*/
public function getApiClient(): ApiClient
{
return $this->apiClient;
}
/**
* Set the API client
*
* @param ApiClient $apiClient set the API client
*
* @return self
*/
public function setApiClient(ApiClient $apiClient): self
{
$this->apiClient = $apiClient;
return $this;
}
/**
* Update $resourcePath with $
*
* @param string $resourcePath
* @param string $baseName
* @param string $paramName
*
* @return string
*/
public function updateResourcePath(string $resourcePath, string $baseName, string $paramName): string
{
return str_replace(
"{" . $baseName . "}",
$this->apiClient->getSerializer()->toPathValue($paramName),
$resourcePath
);
}
/**
* Operation deleteReport
*
* Retrieves org level report by correlation id and site.
*
* @param ?string $organization_id
* @param ?string $report_correlation_id
* @throws ApiException on non-2xx response
* @return mixed
*/
public function deleteReport($organization_id, $report_correlation_id): mixed
{
list($response) = $this->deleteReportWithHttpInfo($organization_id, $report_correlation_id);
return $response;
}
/**
* Operation deleteReportWithHttpInfo
*
* Retrieves org level report by correlation id and site.
*
* @param ?string $organization_id
* @param ?string $report_correlation_id
* @throws ApiException on non-2xx response
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function deleteReportWithHttpInfo($organization_id, $report_correlation_id): array
{
// verify the required parameter 'organization_id' is set
if ($organization_id === null) {
throw new \InvalidArgumentException('Missing the required parameter $organization_id when calling deleteReport');
}
// verify the required parameter 'report_correlation_id' is set
if ($report_correlation_id === null) {
throw new \InvalidArgumentException('Missing the required parameter $report_correlation_id when calling deleteReport');
}
// parse inputs
$resourcePath = "/v2.1/organization_reporting/{organizationId}/reports/{reportCorrelationId}";
$httpBody = $_tempBody ?? ''; // $_tempBody is the method argument, if present
$queryParams = $headerParams = $formParams = [];
$headerParams['Accept'] ??= $this->apiClient->selectHeaderAccept(['application/json']);
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]);
// path params
if ($organization_id !== null) {
$resourcePath = self::updateResourcePath($resourcePath, "organizationId", $organization_id);
}
// path params
if ($report_correlation_id !== null) {
$resourcePath = self::updateResourcePath($resourcePath, "reportCorrelationId", $report_correlation_id);
}
// default format to json
$resourcePath = str_replace("{format}", "json", $resourcePath);
// for model (json/xml)
if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
} elseif (count($formParams) > 0) {
$httpBody = $formParams; // for HTTP post (form)
}
// this endpoint requires OAuth (access token)
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
}
// make the API Call
try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath,
'DELETE',
$queryParams,
$httpBody,
$headerParams,
null,
'/v2.1/organization_reporting/{organizationId}/reports/{reportCorrelationId}'
);
return [null, $statusCode, $httpHeader];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 400:
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\DocuSign\eSign\Model\ErrorDetails', $e->getResponseHeaders());
$e->setResponseObject($data);
break;
}
throw $e;
}
}
/**
* Operation getReport
*
* Retrieves org level report by correlation id and site.
*
* @param ?string $organization_id
* @param ?string $report_correlation_id
* @throws ApiException on non-2xx response
* @return mixed
*/
public function getReport($organization_id, $report_correlation_id): mixed
{
list($response) = $this->getReportWithHttpInfo($organization_id, $report_correlation_id);
return $response;
}
/**
* Operation getReportWithHttpInfo
*
* Retrieves org level report by correlation id and site.
*
* @param ?string $organization_id
* @param ?string $report_correlation_id
* @throws ApiException on non-2xx response
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function getReportWithHttpInfo($organization_id, $report_correlation_id): array
{
// verify the required parameter 'organization_id' is set
if ($organization_id === null) {
throw new \InvalidArgumentException('Missing the required parameter $organization_id when calling getReport');
}
// verify the required parameter 'report_correlation_id' is set
if ($report_correlation_id === null) {
throw new \InvalidArgumentException('Missing the required parameter $report_correlation_id when calling getReport');
}
// parse inputs
$resourcePath = "/v2.1/organization_reporting/{organizationId}/reports/{reportCorrelationId}";
$httpBody = $_tempBody ?? ''; // $_tempBody is the method argument, if present
$queryParams = $headerParams = $formParams = [];
$headerParams['Accept'] ??= $this->apiClient->selectHeaderAccept(['application/json']);
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]);
// path params
if ($organization_id !== null) {
$resourcePath = self::updateResourcePath($resourcePath, "organizationId", $organization_id);
}
// path params
if ($report_correlation_id !== null) {
$resourcePath = self::updateResourcePath($resourcePath, "reportCorrelationId", $report_correlation_id);
}
// default format to json
$resourcePath = str_replace("{format}", "json", $resourcePath);
// for model (json/xml)
if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
} elseif (count($formParams) > 0) {
$httpBody = $formParams; // for HTTP post (form)
}
// this endpoint requires OAuth (access token)
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
}
// make the API Call
try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath,
'GET',
$queryParams,
$httpBody,
$headerParams,
null,
'/v2.1/organization_reporting/{organizationId}/reports/{reportCorrelationId}'
);
return [null, $statusCode, $httpHeader];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 400:
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\DocuSign\eSign\Model\ErrorDetails', $e->getResponseHeaders());
$e->setResponseObject($data);
break;
}
throw $e;
}
}
}
| docusign/docusign-php-client | src/Api/OrganizationsApi.php | PHP | mit | 9,995 |
export default interface DiscoveryPacket {
timestamp: number;
apiVersion: number;
port: number;
}
| ThomasGaubert/openvr-notifications | desktop/src/models/DiscoveryPacket.ts | TypeScript | mit | 104 |
package main
import (
"fmt"
)
type myType int
func (t myType) println() {
fmt.Println(t)
}
func main() {
var z myType = 123
z.println()
}
| skatsuta/kiso-golang | src/method.go | GO | mit | 147 |
/**
reframe.js - Reframe.js: responsive iframes for embedded content
@version v3.0.0
@link https://github.com/yowainwright/reframe.ts#readme
@author Jeff Wainwright <yowainwright@gmail.com> (http://jeffry.in)
@license MIT
**/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = global || self, global.reframe = factory());
}(this, (function () { 'use strict';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
}
/**
* REFRAME.TS 🖼
* ---
* @param target
* @param cName
* @summary defines the height/width ratio of the targeted <element>
*/
function reframe(target, cName) {
var _a, _b;
if (cName === void 0) { cName = 'js-reframe'; }
var frames = __spreadArrays((typeof target === 'string' ? document.querySelectorAll(target) : target));
var c = cName || 'js-reframe';
for (var i = 0; i < frames.length; i += 1) {
var frame = frames[i];
var hasClass = frame.className.split(' ').indexOf(c) !== -1;
if (hasClass || frame.style.width.indexOf('%') > -1)
continue;
// get height width attributes
var height = frame.getAttribute('height') || frame.offsetHeight;
var width = frame.getAttribute('width') || frame.offsetWidth;
var heightNumber = typeof height === 'string' ? parseInt(height) : height;
var widthNumber = typeof width === 'string' ? parseInt(width) : width;
// general targeted <element> sizes
var padding = (heightNumber / widthNumber) * 100;
// created element <wrapper> of general reframed item
// => set necessary styles of created element <wrapper>
var div = document.createElement('div');
div.className = cName;
var divStyles = div.style;
divStyles.position = 'relative';
divStyles.width = '100%';
divStyles.paddingTop = padding + "%";
// set necessary styles of targeted <element>
var frameStyle = frame.style;
frameStyle.position = 'absolute';
frameStyle.width = '100%';
frameStyle.height = '100%';
frameStyle.left = '0';
frameStyle.top = '0';
// reframe targeted <element>
(_a = frame.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(div, frame);
(_b = frame.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(frame);
div.appendChild(frame);
}
}
return reframe;
})));
| cdnjs/cdnjs | ajax/libs/reframe.js/3.0.0/reframe.js | JavaScript | mit | 3,883 |
<?php
declare(strict_types=1);
namespace Mihaeu\PhpDependencies\Dependencies;
class Clazz extends ClazzLike
{
}
| mihaeu/dephpend | src/Dependencies/Clazz.php | PHP | mit | 115 |
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: AssemblyCompany("Aluencube Community http://aliencube.org")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("Aliencube")]
// 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.*")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| aliencube/Hangeul-Romaniser | Documents/Properties/CommonAssemblyInfo.cs | C# | mit | 870 |
/**
*
* STREAM: MVA (window: 15)
*
*
*
* DESCRIPTION:
* -
*
*
* API:
* -
*
*
* NOTES:
* [1]
*
*
* TODO:
* [1]
*
*
* HISTORY:
* - 2014/05/28: Created. [AReines].
*
*
* DEPENDENCIES:
* [1]
*
*
* LICENSE:
* MIT
*
* Copyright (c) 2014. Athan Reines.
*
*
* AUTHOR:
* Athan Reines. athan@nodeprime.com. 2014.
*
*/
(function() {
'use strict';
// MODULES //
var // Stream combiner:
pipeline = require( 'stream-combiner' ),
// Flow streams:
flow = require( 'flow.io' );
// FUNCTIONS //
/**
* FUNCTION: map( fcn )
* Returns a data transformation function.
*
* @private
* @param {function} fcn - function which performs the map transform
* @returns {function} data transformation function
*/
function map( fcn ) {
/**
* FUNCTION: map( data )
* Defines the data transformation.
*
* @private
* @param {*} data - stream data
* @returns {number} transformed data
*/
return function map( data ) {
return fcn( data );
};
} // end FUNCTION map()
// STREAM //
/**
* FUNCTION: Stream()
* Stream constructor.
*
* @returns {Stream} Stream instance
*/
function Stream() {
this.name = '';
this._window = 15;
// ACCESSORS:
this._value = function( d ) {
return d.y;
};
return this;
} // end FUNCTION Stream()
/**
* ATTRIBUTE: type
* Defines the stream type.
*/
Stream.prototype.type = 'mva-w15';
/**
* METHOD: metric( metric )
* Metric setter and getter. If a metric instance is supplied, sets the metric. If no metric is supplied, returns the instance metric value function.
*
* @param {object} metric - an object with a 'value' method; see constructor for basic example. If the metric has a name property, sets the transform name.
* @returns {Stream|object} Stream instance or instance metric
*/
Stream.prototype.metric = function ( metric ) {
if ( !arguments.length ) {
return this._value;
}
if ( !metric.value ) {
throw new Error( 'metric()::invalid input argument. Metric must be an object with a \'value\' method.' );
}
// Extract the method to calculate the metric value and bind the metric context:
this._value = metric.value.bind( metric );
// If the metric has a name, set the transform name:
this.name = ( metric.name ) ? metric.name : '';
// Return the stream instance:
return this;
}; // end METHOD metric()
/**
* METHOD: stream()
* Returns a JSON data transform stream for performing MVA.
*
* @returns {stream} transform stream
*/
Stream.prototype.stream = function() {
var mTransform, tStream, mva, mStream, pStream;
// Create the input transform stream:
mTransform = flow.map()
.map( map( this._value ) );
// Create the input transform stream:
tStream = mTransform.stream();
// Create an MVA stream generator and configure:
mva = flow.mva()
.window( this._window );
// Create an MVA stream:
mStream = mva.stream();
// Create a stream pipeline:
pStream = pipeline(
tStream,
mStream
);
// Return the pipeline:
return pStream;
}; // end METHOD stream()
// EXPORTS //
module.exports = function createStream() {
return new Stream();
};
})(); | kgryte/rpo-dynamics | app/utils/streams/output/mva/mva-w15.js | JavaScript | mit | 3,126 |
'use strict';
module.exports = {
compile: {
options: {
style: 'expanded',
},
src : 'src/css/style.scss',
dest : 'dist/css/style.css',
},
};
| anstosa/sarahandansel.wedding | grunt/sass.js | JavaScript | mit | 194 |
<html>
<head>
<title>Praktikum PHP-Mysql</title>
</head>
<body>
<font style="arial,helvetica" size="medium">
<b>Selamat datang di praktikum PHP-Mysql.</b></font><br>
<font style="arial,helvetica" size="-1">
<b>Silahkan klik menu yang anda inginkan.</b></font>
<br><br>
<p>
insert data<br>
delete data<br>
update data<br>
<a href="list.php">list data</a><br>
search data<br>
</p>
</body>
</html> | ardiprakasa/PJW2015 | phpmysql/phpmysqlcoba.php | PHP | mit | 410 |
<?php
namespace Sdd;
use Sdd\Builder\DirectDebit as Builder;
use Sdd\DirectDebit\GroupHeader;
use Sdd\DirectDebit\PaymentInformation;
/**
* DirectDebit
*
* @author Carlo Chech 2016
* @license MIT
*/
class DirectDebit
{
/**
* @var null
*/
protected $groupHeader = null;
/**
* @var null
*/
protected $paymentInformation = null;
/**
* @param GroupHeader $groupHeader
*
* @return $this
*/
public function setGroupHeader(GroupHeader $groupHeader)
{
$this->groupHeader = $groupHeader;
return $this;
}
/**
*
* @param $paymentInformation
*
* @return DirectDebit
*/
public function addPaymentInformation(PaymentInformation $paymentInformation)
{
$this->paymentInformation[] = $paymentInformation;
return $this;
}
/**
*
* @param string $xml
* @param string $painformat
*
* @return boolean
*/
public function validate($xml, $painformat = 'CBISDDReqLogMsg.00.01.00')
{
$reader = new \DOMDocument;
$reader->loadXML($xml);
if ($reader->schemaValidate(__DIR__ . '/xsd/' . $painformat . '.xsd')) {
return true;
}
return false;
}
/**
*
* @throws \Exception
*/
public function xml()
{
if ($this->groupHeader === null) {
throw new \Exception('No GrpHdr');
}
if ($this->paymentInformation === null) {
// throw new \Exception('No pymnt');
}
$build = new Builder;
$build->appendGroupHeader($this->groupHeader);
$build->appendPaymentInformation($this->paymentInformation);
return $build->xml();
}
}
| wdog/sdd_ita | DirectDebit.php | PHP | mit | 1,601 |
import _plotly_utils.basevalidators
class ArrowcolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="arrowcolor", parent_name="layout.annotation", **kwargs
):
super(ArrowcolorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwargs.pop("edit_type", "arraydraw"),
role=kwargs.pop("role", "style"),
**kwargs
)
| plotly/python-api | packages/python/plotly/plotly/validators/layout/annotation/_arrowcolor.py | Python | mit | 479 |
<?php
/**
* @var $property Property
* @var $form ActiveForm
*/
use DevGroup\DataStructure\models\Property;
use DevGroup\DataStructure\propertyHandler\RelatedEntity;
use devgroup\jsoneditor\Jsoneditor;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\helpers\Json;
use yii\widgets\ActiveForm;
echo Yii::t('app', 'Masked input settings');
echo $form->field($property, 'params[' . Property::PACKED_HANDLER_PARAMS . '][alias]')->label(
Yii::t('app', 'Class name')
)->dropDownList(RelatedEntity::$aliases, ['prompt' => Yii::t('app', 'Not selected'),]);
echo $form->field($property, 'params[' . Property::PACKED_HANDLER_PARAMS . '][mask]')->label(Yii::t('app', 'Mask'));
?>
<div class="col-sm-12 blog-sidebar">
<div class="sidebar-module sidebar-module-inset">
<h4>
<i class="fa fa-question-circle"></i>
<?= Yii::t('app', 'Hint') ?>
</h4>
<p>
<?= Yii::t('app', 'You should enter correct settings') ?>
</p>
<p>
<?= Yii::t('app', 'More') . ' ' . Html::a(
Yii::t('app', 'here'),
'http://www.yiiframework.com/doc-2.0/yii-widgets-maskedinput.html'
) . ' ' . Yii::t('app', 'and') . ' ' . Html::a(
Yii::t('app', 'here'),
'http://demos.krajee.com/masked-input'
) ?>
</p>
</div>
</div>
| DevGroup-ru/yii2-data-structure-tools | src/Properties/views/manage/_masked-input-settings.php | PHP | mit | 1,384 |