code
stringlengths 3
1.01M
| repo_name
stringlengths 5
116
| path
stringlengths 3
311
| language
stringclasses 30
values | license
stringclasses 15
values | size
int64 3
1.01M
|
|---|---|---|---|---|---|
--[[
/////// //////////////////
/////// PROJECT: MTA iLife - German Fun Reallife Gamemode
/////// VERSION: 1.7.2
/////// DEVELOPERS: See DEVELOPERS.md in the top folder
/////// LICENSE: See LICENSE.md in the top folder
/////// /////////////////
]]
local QuestID = 33
local Quest = Quests[QuestID]
Quest.Texts = {
["Accepted"] = "Hole die Sprunk-Bestellung ab!",
["Finished"] = "Bringe die Sprunk-Bestellung zum Burger-Shot Nord!"
}
addEventHandler("onClientCallsServerQuestScript", getRootElement(),
function(ID, Status, Data)
if (ID == QuestID) then
if (Status == "Sprunk_Clicked") then
Quest:playerFinish(client)
end
end
end
)
Quest.playerReachedRequirements =
function(thePlayer, bOutput)
return true
end
Quest.getTaskPosition =
function()
--Should return int, dim, x, y, z
return 0, 0, 1327.1999511719, 292.60000610352, 19
end
Quest.onAccept =
function(thePlayer)
outputChatBox("Mitarbeiter: Guten Tag.", thePlayer, 255, 255, 255)
outputChatBox("Mitarbeiter: Wir haben ein gro\\szes Problem. Uns ist leider der Sprunk-Vorrat ausgegangen.", thePlayer, 255, 255, 255)
outputChatBox("Mitarbeiter: Wir w\\aeren sehr dankbar wenn du den Nachschub von der Sprunk-Fabrik in Montgomery abholen k\\oenntest!", thePlayer, 255, 255, 255)
return true
end
Quest.onResume =
function(thePlayer)
if ( thePlayer:isQuestActive(Quest) ~= "Finished" ) then
Quest:triggerClientScript(thePlayer, "Accepted", false)
end
return true
end
Quest.onProgress =
function(thePlayer)
return true
end
Quest.onFinish =
function(thePlayer)
return true
end
Quest.onTurnIn =
function(thePlayer)
outputChatBox("Mitarbeiter: Vielen Dank! Nun k\\oennen wir endlich wieder Sprunk anbieten.", thePlayer, 255, 255, 255)
outputChatBox("Mitarbeiter: Hier ist deine Belohnung. Viel Spa\\sz damit!", thePlayer, 255, 255, 255)
return true
end
Quest.onAbort =
function(thePlayer)
return true
end
--outputDebugString("Loaded Questscript: server/Classes/Quest/Scripts/"..tostring(QuestID)..".lua")
|
Noneatme/iLife-SA
|
server/Classes/Quest/Scripts/33.lua
|
Lua
|
mit
| 2,051
|
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("Sharparam.SteamLib")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Sharparam.SteamLib")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[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("bc07821b-ab11-4fd3-b844-75c2f28f5e1a")]
// 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")]
|
Sharparam/SteamLib
|
Sharparam.SteamLib/Properties/AssemblyInfo.cs
|
C#
|
mit
| 1,412
|
package de.fxnn.brainfuck;
import java.util.Objects;
import java.util.regex.Pattern;
import com.google.common.base.Function;
import com.google.common.base.Functions;
import de.fxnn.brainfuck.program.Program;
import de.fxnn.brainfuck.program.StringProgram;
import de.fxnn.brainfuck.program.TreePrograms;
public class ProgramOptimizer {
private static final Pattern ENDLESS_LOOP_PATTERN = Pattern.compile("\\[\\]");
private static final Pattern INCREMENT_DECREMENT_PATTERN = Pattern.compile("\\+-|-\\+");
private static final Pattern FORWARD_BACKWARD_PATTERN = Pattern.compile("><|<>");
private static final Function<String, String> OPTIMIZATION_FUNCTION = Functions
.compose(ProgramOptimizer::removeEndlessLoops,
Functions.compose(ProgramOptimizer::removeForwardBackwards, ProgramOptimizer::removeIncrementDecrements));
public StringProgram optimizeProgram(Program program) {
String programSource = TreePrograms.toString(program);
String optimizedProgramSource = programSource;
do {
programSource = optimizedProgramSource;
optimizedProgramSource = OPTIMIZATION_FUNCTION.apply(programSource);
} while (!Objects.equals(optimizedProgramSource, programSource));
return new StringProgram(optimizedProgramSource);
}
protected static String removeEndlessLoops(String input) {
return ENDLESS_LOOP_PATTERN.matcher(input).replaceAll("");
}
protected static String removeIncrementDecrements(String input) {
return INCREMENT_DECREMENT_PATTERN.matcher(input).replaceAll("");
}
protected static String removeForwardBackwards(String input) {
return FORWARD_BACKWARD_PATTERN.matcher(input).replaceAll("");
}
}
|
fxnn/brainfuck-on-genetics
|
src/main/java/de/fxnn/brainfuck/ProgramOptimizer.java
|
Java
|
mit
| 1,695
|
module Traductor
module Translatable
def self.included(base)
base.module_eval do
extend ClassMethods
# has_many :translations, :class_name => 'Traductor::Translation', :as => :source
end
end
def get_translation(locale)
self.translations.find_by_locale(locale) || self.translations.build(:locale => locale)
end
def get_translation_for(field, locale)
tr = get_translation(locale)
tr[field] || read_attribute(field)
end
def set_translation_for(field, locale, val)
tr = get_translation(locale)
tr[field] = val
tr.save
end
module ClassMethods
def translated_fields(*fields)
fields.each do |field|
self.module_eval %Q{
def #{field}
if I18n.default?
read_attribute(#{field.inspect})
else
get_translation_for(#{field.inspect}, I18n.locale)
end
end
def #{field}=(val)
if I18n.default?
write_attribute(#{field.inspect}, val)
else
set_translation_for(#{field.inspect}, I18n.locale, val)
end
end
}
end
end
end
end
end
|
cndreisbach/traductor
|
lib/traductor/translatable.rb
|
Ruby
|
mit
| 1,319
|
/* ==== html resets ==== */
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video {
margin : 0;
padding : 0;
border : 0;
font-size : 100%;
font : inherit;
vertical-align : baseline;
}
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
display : block;
}
blockquote, q {
quotes : none;
}
blockquote:before, blockquote:after, q:before, q:after {
content : '';
content : none;
}
ins {
background-color : #ff9;
color : #000;
text-decoration : none;
}
mark {
background-color : #ff9;
color : #000;
font-style : italic;
font-weight : bold;
}
del {
text-decoration : line-through;
}
abbr[title], dfn[title] {
border-bottom : 1px dotted;
cursor : help;
}
table {
border-collapse : collapse;
border-spacing : 0;
}
hr {
display : block;
height : 1px;
border : 0;
border-top : 1px solid #ccc;
margin : 1em 0;
padding : 0;
}
input, select {
vertical-align : middle;
}
body {
font : 13px/1.231 sans-serif;
*font-size : small;
}
select, input, textarea, button {
font : 99% sans-serif;
}
pre, code, kbd, samp {
font-family : monospace, sans-serif;
}
html {
}
a:hover, a:active {
outline : none;
}
ul, ol {
margin-left : 2em;
}
ol {
list-style-type : decimal;
}
nav ul, nav li {
margin : 0;
list-style : none;
list-style-image : none;
}
small {
font-size : 85%;
}
strong, th {
font-weight : bold;
}
td {
vertical-align : top;
}
sub, sup {
font-size : 75%;
line-height : 0;
position : relative;
}
sup {
top : -0.5em;
}
sub {
bottom : -0.25em;
}
pre {
white-space : pre;
white-space : pre-wrap;
word-wrap : break-word;
padding : 15px;
}
textarea {
overflow : auto;
}
.ie6 legend, .ie7 legend {
margin-left : -7px;
}
input[type="radio"] {
vertical-align : text-bottom;
}
input[type="checkbox"] {
vertical-align : bottom;
}
.ie7 input[type="checkbox"] {
vertical-align : baseline;
}
.ie6 input {
vertical-align : text-bottom;
}
label, input[type="button"], input[type="submit"], input[type="image"], button {
cursor : pointer;
}
button, input, select, textarea {
margin : 0;
}
input:valid, textarea:valid {
}
input:invalid, textarea:invalid {
border-radius : 1px;
-moz-box-shadow : 0px 0px 5px red;
-webkit-box-shadow : 0px 0px 5px red;
box-shadow : 0px 0px 5px red;
}
.no-boxshadow input:invalid, .no-boxshadow textarea:invalid {
background-color : #f0dddd;
}
::-moz-selection {
background : #FF5E99;
color : #fff;
text-shadow : none;
}
::selection {
background : #FF5E99;
color : #fff;
text-shadow : none;
}
a:link {
-webkit-tap-highlight-color : #FF5E99;
}
button {
width : auto;
overflow : visible;
}
.ie7 img {
-ms-interpolation-mode : bicubic;
}
body, select, input, textarea {
color : #444;
}
h1, h2, h3, h4, h5, h6 {
font-weight : bold;
}
a, a:active, a:visited {
color : #607890;
}
a:hover {
color : #036;
}
.ir {
display : block;
text-indent : -999em;
overflow : hidden;
background-repeat : no-repeat;
text-align : left;
direction : ltr;
}
.hidden {
display : none;
visibility : hidden;
}
.visuallyhidden {
border : 0;
clip : rect(0 0 0 0);
height : 1px;
margin : -1px;
overflow : hidden;
padding : 0;
position : absolute;
width : 1px;
}
.visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus {
clip : auto;
height : auto;
margin : 0;
overflow : visible;
position : static;
width : auto;
}
.invisible {
visibility : hidden;
}
.clearfix:before, .clearfix:after {
content : "\0020";
display : block;
height : 0;
overflow : hidden;
}
.clearfix:after {
clear : both;
}
.clearfix {
zoom : 1;
display: block;
clear: both;
}
@media print {
* {
background : transparent !important;
color : black !important;
text-shadow : none !important;
filter : none !important;
-ms-filter : none !important;
}
a, a:visited {
color : #444 !important;
text-decoration : underline;
}
a[href]:after {
content : " (" attr(href) ")";
}
abbr[title]:after {
content : " (" attr(title) ")";
}
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after {
content : "";
}
pre, blockquote {
border : 1px solid #999;
page-break-inside : avoid;
}
thead {
display : table-header-group;
}
tr, img {
page-break-inside : avoid;
}
@page {
margin : 0.5cm;
}
p, h2, h3 {
orphans : 3;
widows : 3;
}
h2, h3 {
page-break-after : avoid;
}
}
/* ==== form resets ==== */
input[type='text'], input[type='password'] {
padding: 0 3px;
}
input[type='text'], input[type='password'], select, textarea {
border : #999 1px solid;
height : 20px;
-moz-border-radius : 4px;
-webkit-border-radius : 4px;
border-radius : 4px;
font-size : 12px;
}
input[type='text']:focus, input[type='password']:focus, textarea:focus, select:focus {
-moz-box-shadow : 0 0 4px #999;
-webkit-box-shadow : 0 0 4px #999;
box-shadow : 0 0 4px #999;
}
select {
padding : 1px;
-moz-border-radius-bottomright : 0;
-webkit-border-bottom-right-radius : 0;
border-bottom-right-radius : 0;
-moz-border-radius-topright : 0;
-webkit-border-top-right-radius : 0;
border-top-right-radius : 0;
line-height : 20px;
vertical-align : middle;
height : 20px;
}
textarea {
padding : 5px;
}
button.primary {
-moz-border-radius : 12px;
-webkit-border-radius : 12px;
border-radius : 12px;
height : 27px;
line-height : 27px;
border : #999 1px solid;
padding : 0 10px;
font-size : 12px;
width : 120px;
font-weight : bold;
color : #888;
background : -webkit-gradient(linear, left top, left bottom, from(#FFF), to(#d6d6d6)); /* for webkit browsers */
background : -moz-linear-gradient(top, #FFF, #d6d6d6); /* for firefox 3.6+ */
background : -o-linear-gradient(top, #FFF, #d6d6d6);
cursor : pointer;
text-shadow : 0 1px 0 #f1f1f1;
}
button.primary:hover {
border : #666 1px solid;
color : #666;
}
button.secondary {
background : none;
border : none;
padding : 0 10px;
font-size : 12px;
color : #548ADF;
font-weight : bold;
text-shadow : 0 1px 0 #f1f1f1;
}
button.secondary:hover {
color : #3362fb;
}
label {
color : #666;
font-size : 12px;
text-shadow : 0 1px 0 #FFF;
padding : 0 5px;
display : block;
margin : 0;
vertical-align:middle;
}
label input {
margin-left : 10px;
margin-right : 10px;
min-height:16px;
}
label .assistance {
filter : alpha(opacity = 30);
-moz-opacity : 0.3;
-khtml-opacity : 0.3;
opacity : 0.3;
margin-right : 10px;
margin-left : 10px;
}
label .assistance img {
border : none;
height: 11px;
margin: 0;
margin-bottom: -2px;
}
label .assistance:hover {
filter : alpha(opacity = 100);
-moz-opacity : 1;
-khtml-opacity : 1;
opacity : 1;
}
label span.info {
color : #00F;
font-size : 10px;
text-shadow : 1px 1px 0 #FFF;
}
label span.error {
color : #F00;
font-size : 10px;
text-shadow : 1px 1px 0 #FFF;
}
fieldset {
padding : 5px;
border : #ccc 1px solid;
-moz-border-radius : 4px;
-webkit-border-radius : 4px;
border-radius : 4px;
}
fieldset legend {
text-shadow : 1px 1px 0 #FFF;
font-size : 10px;
color : #666;
margin-left : 20px;
padding : 5px 1px;
}
input[type='text'][disabled], input[type='password'][disabled], select[disabled], textarea[disabled] {
border-color : #ccc;
}
input[type='text'].search {
background : #f1f1f1 url('/gui/images/searchicon.png') no-repeat right;
padding-right : 25px;
}
button[disabled], button[disabled]:hover {
border-color : #ccc;
cursor : default;
color : #b9b9b9;
}
|
EkaPurnama/posilly
|
gui/css/reset.css
|
CSS
|
mit
| 8,604
|
<?php
namespace Petit\BackBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class PersonControllerTest extends WebTestCase
{
/*
public function testCompleteScenario()
{
// Create a new client to browse the application
$client = static::createClient();
// Create a new entry in the database
$crawler = $client->request('GET', '/persona/');
$this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /persona/");
$crawler = $client->click($crawler->selectLink('Create a new entry')->link());
// Fill in the form and submit it
$form = $crawler->selectButton('Create')->form(array(
'petit_backbundle_persontype[field_name]' => 'Test',
// ... other fields to fill
));
$client->submit($form);
$crawler = $client->followRedirect();
// Check data in the show view
$this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")');
// Edit the entity
$crawler = $client->click($crawler->selectLink('Edit')->link());
$form = $crawler->selectButton('Edit')->form(array(
'petit_backbundle_persontype[field_name]' => 'Foo',
// ... other fields to fill
));
$client->submit($form);
$crawler = $client->followRedirect();
// Check the element contains an attribute with value equals "Foo"
$this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]');
// Delete the entity
$client->submit($crawler->selectButton('Delete')->form());
$crawler = $client->followRedirect();
// Check the entity has been delete on the list
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
}
*/
}
|
pacordovad/project2
|
src/Petit/BackBundle/Tests/Controller/PersonControllerTest.php
|
PHP
|
mit
| 1,937
|
<html><body>
<h4>Windows 10 x64 (18362.356)</h4><br>
<h2>_KQOS_GROUPING_SETS</h2>
<font face="arial"> +0x000 SingleCoreSet : Uint8B<br>
+0x008 SmtSet : Uint8B<br>
</font></body></html>
|
epikcraw/ggool
|
public/Windows 10 x64 (18362.356)/_KQOS_GROUPING_SETS.html
|
HTML
|
mit
| 207
|
#ifndef RESOURCE_H
#define RESOURCE_H
#include <stdint.h>
#pragma pack(push, 1)
struct ArtResourceSettings {
uint32_t flags; /* 0 */
union {
struct {
uint32_t width; /* fixed */
uint32_t height; /* fixed */
int16_t frames;
} image;
struct {
int32_t scale; /* fixed */
uint16_t frames;
} mesh;
struct {
uint32_t frames; /* 4 */
uint32_t fps; /* 8 */
uint16_t start_dist; /* c */
uint16_t end_dist; /* e */
} anim;
struct {
uint32_t id;
} proc;
struct {
uint32_t x00;
uint32_t x04;
uint8_t frames;
} terrain;
} data;
uint8_t type; /* 10 */
uint8_t start_af; /* 11 */
uint8_t end_af; /* 12 */
uint8_t sometimes_one; /* 13 */
};
struct ArtResource {
char name[64];
ArtResourceSettings settings;
};
struct StringIds {
uint32_t ids[5];
uint8_t x14[4];
};
#pragma pack(pop)
#endif
|
werkt/kwd
|
src/Resource.h
|
C
|
mit
| 921
|
from __future__ import unicode_literals
import django
from django.core.exceptions import FieldError
from django.test import SimpleTestCase, TestCase
from .models import (
AdvancedUserStat, Child1, Child2, Child3, Child4, Image, LinkedList,
Parent1, Parent2, Product, StatDetails, User, UserProfile, UserStat,
UserStatResult,
)
class ReverseSelectRelatedTestCase(TestCase):
def setUp(self):
user = User.objects.create(username="test")
UserProfile.objects.create(user=user, state="KS", city="Lawrence")
results = UserStatResult.objects.create(results='first results')
userstat = UserStat.objects.create(user=user, posts=150,
results=results)
StatDetails.objects.create(base_stats=userstat, comments=259)
user2 = User.objects.create(username="bob")
results2 = UserStatResult.objects.create(results='moar results')
advstat = AdvancedUserStat.objects.create(user=user2, posts=200, karma=5,
results=results2)
StatDetails.objects.create(base_stats=advstat, comments=250)
p1 = Parent1(name1="Only Parent1")
p1.save()
c1 = Child1(name1="Child1 Parent1", name2="Child1 Parent2", value=1)
c1.save()
p2 = Parent2(name2="Child2 Parent2")
p2.save()
c2 = Child2(name1="Child2 Parent1", parent2=p2, value=2)
c2.save()
def test_basic(self):
with self.assertNumQueries(1):
u = User.objects.select_related("userprofile").get(username="test")
self.assertEqual(u.userprofile.state, "KS")
def test_follow_next_level(self):
with self.assertNumQueries(1):
u = User.objects.select_related("userstat__results").get(username="test")
self.assertEqual(u.userstat.posts, 150)
self.assertEqual(u.userstat.results.results, 'first results')
def test_follow_two(self):
with self.assertNumQueries(1):
u = User.objects.select_related("userprofile", "userstat").get(username="test")
self.assertEqual(u.userprofile.state, "KS")
self.assertEqual(u.userstat.posts, 150)
def test_follow_two_next_level(self):
with self.assertNumQueries(1):
u = User.objects.select_related("userstat__results", "userstat__statdetails").get(username="test")
self.assertEqual(u.userstat.results.results, 'first results')
self.assertEqual(u.userstat.statdetails.comments, 259)
def test_forward_and_back(self):
with self.assertNumQueries(1):
stat = UserStat.objects.select_related("user__userprofile").get(user__username="test")
self.assertEqual(stat.user.userprofile.state, 'KS')
self.assertEqual(stat.user.userstat.posts, 150)
def test_back_and_forward(self):
with self.assertNumQueries(1):
u = User.objects.select_related("userstat").get(username="test")
self.assertEqual(u.userstat.user.username, 'test')
def test_not_followed_by_default(self):
with self.assertNumQueries(2):
u = User.objects.select_related().get(username="test")
self.assertEqual(u.userstat.posts, 150)
def test_follow_from_child_class(self):
with self.assertNumQueries(1):
stat = AdvancedUserStat.objects.select_related('user', 'statdetails').get(posts=200)
self.assertEqual(stat.statdetails.comments, 250)
self.assertEqual(stat.user.username, 'bob')
def test_follow_inheritance(self):
with self.assertNumQueries(1):
stat = UserStat.objects.select_related('user', 'advanceduserstat').get(posts=200)
self.assertEqual(stat.advanceduserstat.posts, 200)
self.assertEqual(stat.user.username, 'bob')
with self.assertNumQueries(1):
self.assertEqual(stat.advanceduserstat.user.username, 'bob')
def test_nullable_relation(self):
im = Image.objects.create(name="imag1")
p1 = Product.objects.create(name="Django Plushie", image=im)
p2 = Product.objects.create(name="Talking Django Plushie")
with self.assertNumQueries(1):
result = sorted(Product.objects.select_related("image"), key=lambda x: x.name)
self.assertEqual([p.name for p in result], ["Django Plushie", "Talking Django Plushie"])
self.assertEqual(p1.image, im)
# Check for ticket #13839
self.assertIsNone(p2.image)
def test_missing_reverse(self):
"""
Ticket #13839: select_related() should NOT cache None
for missing objects on a reverse 1-1 relation.
"""
with self.assertNumQueries(1):
user = User.objects.select_related('userprofile').get(username='bob')
with self.assertRaises(UserProfile.DoesNotExist):
user.userprofile
def test_nullable_missing_reverse(self):
"""
Ticket #13839: select_related() should NOT cache None
for missing objects on a reverse 0-1 relation.
"""
Image.objects.create(name="imag1")
with self.assertNumQueries(1):
image = Image.objects.select_related('product').get()
with self.assertRaises(Product.DoesNotExist):
image.product
def test_parent_only(self):
with self.assertNumQueries(1):
p = Parent1.objects.select_related('child1').get(name1="Only Parent1")
with self.assertNumQueries(0):
with self.assertRaises(Child1.DoesNotExist):
p.child1
def test_multiple_subclass(self):
with self.assertNumQueries(1):
p = Parent1.objects.select_related('child1').get(name1="Child1 Parent1")
self.assertEqual(p.child1.name2, 'Child1 Parent2')
def test_onetoone_with_subclass(self):
with self.assertNumQueries(1):
p = Parent2.objects.select_related('child2').get(name2="Child2 Parent2")
self.assertEqual(p.child2.name1, 'Child2 Parent1')
def test_onetoone_with_two_subclasses(self):
with self.assertNumQueries(1):
p = Parent2.objects.select_related('child2', "child2__child3").get(name2="Child2 Parent2")
self.assertEqual(p.child2.name1, 'Child2 Parent1')
with self.assertRaises(Child3.DoesNotExist):
p.child2.child3
p3 = Parent2(name2="Child3 Parent2")
p3.save()
c2 = Child3(name1="Child3 Parent1", parent2=p3, value=2, value3=3)
c2.save()
with self.assertNumQueries(1):
p = Parent2.objects.select_related('child2', "child2__child3").get(name2="Child3 Parent2")
self.assertEqual(p.child2.name1, 'Child3 Parent1')
self.assertEqual(p.child2.child3.value3, 3)
self.assertEqual(p.child2.child3.value, p.child2.value)
self.assertEqual(p.child2.name1, p.child2.child3.name1)
def test_multiinheritance_two_subclasses(self):
with self.assertNumQueries(1):
p = Parent1.objects.select_related('child1', 'child1__child4').get(name1="Child1 Parent1")
self.assertEqual(p.child1.name2, 'Child1 Parent2')
self.assertEqual(p.child1.name1, p.name1)
with self.assertRaises(Child4.DoesNotExist):
p.child1.child4
Child4(name1='n1', name2='n2', value=1, value4=4).save()
with self.assertNumQueries(1):
p = Parent2.objects.select_related('child1', 'child1__child4').get(name2="n2")
self.assertEqual(p.name2, 'n2')
self.assertEqual(p.child1.name1, 'n1')
self.assertEqual(p.child1.name2, p.name2)
self.assertEqual(p.child1.value, 1)
self.assertEqual(p.child1.child4.name1, p.child1.name1)
self.assertEqual(p.child1.child4.name2, p.child1.name2)
self.assertEqual(p.child1.child4.value, p.child1.value)
self.assertEqual(p.child1.child4.value4, 4)
def test_inheritance_deferred(self):
if django.VERSION < (1, 10, 0):
self.skipTest('does not work on older version of Django')
c = Child4.objects.create(name1='n1', name2='n2', value=1, value4=4)
with self.assertNumQueries(1):
p = Parent2.objects.select_related('child1').only(
'id2', 'child1__value').get(name2="n2")
self.assertEqual(p.id2, c.id2)
self.assertEqual(p.child1.value, 1)
p = Parent2.objects.select_related('child1').only(
'id2', 'child1__value').get(name2="n2")
with self.assertNumQueries(1):
self.assertEqual(p.name2, 'n2')
p = Parent2.objects.select_related('child1').only(
'id2', 'child1__value').get(name2="n2")
with self.assertNumQueries(1):
self.assertEqual(p.child1.name2, 'n2')
def test_inheritance_deferred2(self):
if django.VERSION < (1, 10, 0):
self.skipTest('does not work on older version of Django')
c = Child4.objects.create(name1='n1', name2='n2', value=1, value4=4)
qs = Parent2.objects.select_related('child1', 'child1__child4').only(
'id2', 'child1__value', 'child1__child4__value4')
with self.assertNumQueries(1):
p = qs.get(name2="n2")
self.assertEqual(p.id2, c.id2)
self.assertEqual(p.child1.value, 1)
self.assertEqual(p.child1.child4.value4, 4)
self.assertEqual(p.child1.child4.id2, c.id2)
p = qs.get(name2="n2")
with self.assertNumQueries(1):
self.assertEqual(p.child1.name2, 'n2')
p = qs.get(name2="n2")
with self.assertNumQueries(0):
self.assertEqual(p.child1.name1, 'n1')
self.assertEqual(p.child1.child4.name1, 'n1')
def test_self_relation(self):
if django.VERSION < (1, 11, 0):
self.skipTest("does not work on older version of Django")
item1 = LinkedList.objects.create(name='item1')
LinkedList.objects.create(name='item2', previous_item=item1)
with self.assertNumQueries(1):
item1_db = LinkedList.objects.select_related('next_item').get(name='item1')
self.assertEqual(item1_db.next_item.name, 'item2')
class ReverseSelectRelatedValidationTests(SimpleTestCase):
"""
Rverse related fields should be listed in the validation message when an
invalid field is given in select_related().
"""
non_relational_error = "Non-relational field given in select_related: '%s'. Choices are: %s"
invalid_error = "Invalid field name(s) given in select_related: '%s'. Choices are: %s"
def test_reverse_related_validation(self):
fields = 'userprofile, userstat'
with self.assertRaisesMessage(FieldError, self.invalid_error % ('foobar', fields)):
list(User.objects.select_related('foobar'))
with self.assertRaisesMessage(FieldError, self.non_relational_error % ('username', fields)):
list(User.objects.select_related('username'))
|
denisenkom/django-sqlserver
|
tests/select_related_onetoone/tests.py
|
Python
|
mit
| 11,118
|
define([
'streamhub-sdk/content/views/content-list-view',
'streamhub-gallery/content/content-view-factory',
'text!streamhub-gallery/css/horizontal-list-view.css',
'streamhub-sdk/debug',
'inherits'
], function (ContentListView, HorizontalContentViewFactory, HorizontalListViewCss, debug, inherits) {
'use strict';
var log = debug('streamhub-gallery/views/horizontal-list-view');
var STYLE_EL;
/**
* A simple View that displays Content in a horizontal list.
*
* @param opts {Object} A set of options to config the view with
* @param opts.el {HTMLElement} The element in which to render the streamed content
* @exports streamhub-gallery/views/horizontal-list-view
* @augments streamhub-sdk/views/list-view
* @constructor
*/
var HorizontalListView = function (opts) {
opts = opts || {};
this._id = 'streamhub-horizontal-list-'+new Date().getTime();
this._aspectRatio = opts.aspectRatio || 16/9;
opts.contentViewFactory = new HorizontalContentViewFactory();
ContentListView.call(this, opts);
if (!STYLE_EL) {
STYLE_EL = $('<style></style>').text(HorizontalListViewCss).prependTo('head');
}
var self = this;
$(window).on('resize', function (e) {
self._handleResize(e);
});
this._adjustContentSize();
};
inherits(HorizontalListView, ContentListView);
HorizontalListView.prototype.horizontalListViewClassName = 'streamhub-horizontal-list-view';
HorizontalListView.prototype.contentContainerClassName = 'content-container';
/**
* Set the element for the view to render in.
* You will probably want to call .render() after this, but not always.
* @param element {HTMLElement} The element to render this View in
* @return this
*/
HorizontalListView.prototype.setElement = function (el) {
ContentListView.prototype.setElement.call(this, el);
this.$el.addClass(this.horizontalListViewClassName).addClass(this._id);
};
HorizontalListView.prototype._handleResize = function (e) {
this._adjustContentSize();
};
/**
* @private
* Sets appropriate dimensions on each ContentView in the gallery.
* By default, a ContentViews new dimensions respects the gallery's specified aspect ratio.
* For content whose intrinsic apsect ratio is 1:1, it will retain a 1:1 aspect ratio.
* ContentViews with tiled attachments will also retain a 1:1 aspect ratio.
*/
HorizontalListView.prototype._adjustContentSize = function () {
if (! this._aspectRatio) {
return;
}
var styleEl = $('style.'+this._id);
if (styleEl) {
styleEl.remove();
}
styleEl = $('<style class="'+this._id+'"></style>');
var styles = '';
var containerHeight = this.$el.height();
var contentWidth = containerHeight * this._aspectRatio;
styles = '.'+this.horizontalListViewClassName + ' .'+this.contentContainerClassName + '{ max-width: ' + contentWidth + 'px; }';
styleEl.html(styles);
$('head').append(styleEl);
return styleEl;
};
/**
* @private
* Insert a contentView into the ListView's .el
* after being wrapped by a container element.
* Get insertion index based on this.comparator
* @param contentView {ContentView} The ContentView's element to insert to the DOM
*/
HorizontalListView.prototype._insert = function (contentView) {
var newContentViewIndex,
$previousEl;
newContentViewIndex = this.views.indexOf(contentView);
var $containerEl = $('<div class="' + this.contentContainerClassName + '"></div>');
contentView.$el.wrap($containerEl);
var $wrappedEl = contentView.$el.parent();
if (newContentViewIndex === 0) {
// Beginning!
$wrappedEl.prependTo(this.el);
} else {
// Find it's previous contentView and insert new contentView after
$previousEl = this.views[newContentViewIndex - 1].$el;
$wrappedEl.insertAfter($previousEl.parent('.'+this.contentContainerClassName));
}
this.$el.css('width', this.views.length * this.views[0].$el.parent().outerWidth(true) + 'px');
};
return HorizontalListView;
});
|
cheung31/streamhub-gallery
|
src/views/horizontal-list-view.js
|
JavaScript
|
mit
| 4,409
|
using InformationMachineAPI.PCL.Http.Request;
using InformationMachineAPI.PCL.Http.Response;
namespace InformationMachineAPI.PCL.Http.Client
{
/// <summary>
/// Represents the contextual information of HTTP request and response
/// </summary>
public class HttpContext
{
/// <summary>
/// The http request in the current context
/// </summary>
public HttpRequest Request { get; set; }
/// <summary>
/// The http response in the current context
/// </summary>
public HttpResponse Response { get; set; }
/// <summary>
/// Constructor to initialize the context with http request and response information
/// </summary>
/// <param name="request">The http request in the current context</param>
/// <param name="response">The http response in the current context</param>
public HttpContext(HttpRequest request, HttpResponse response)
{
Request = request;
Response = response;
}
}
}
|
information-machine/information-machine-api-csharp
|
InformationMachineAPI.PCL/HTTP/Client/HttpContext.cs
|
C#
|
mit
| 1,055
|
---
layout: post
title: Java 图片缩略图生成库
tags: 其他
---
大家好,我是你们的章鱼猫。
最近有一个需求是需要给网站的图片生成一个高质量的缩略图,方便在有些场景中展示。而在 Java 中,如果要对图片进行处理,需要了解和使用 Image I/O API、Java 2D API、图片处理和图片缩放技术等,整体来看处理缩略图非常的复杂。
今天要推荐的开源库 Thumbnailator(GitHub 标星 3.2K)就是为了帮助大家更好的生成图片的缩略图。

Thumbnailator 是一个单独 Jar 包同时没有任何其他的网络库依赖,这样让集成变得非常的简单。以下代码就能完成对某一个文件夹下的图片进行批量的缩略图生成。
```java
Thumbnails.of(new File("path/to/directory").listFiles())
.size(640, 480)
.outputFormat("jpg")
.toFiles(Rename.PREFIX_DOT_THUMBNAIL);
```
目前 Thumbnailator 项目非常的活跃,最近(20201017)刚发布了 0.4.13 版本。通过如下 Maven 配置可直接将 Thumbnailator 引入到你的项目中。

更多项目详情请查看如下链接。
开源项目地址:https://github.com/coobird/thumbnailator
|
ZhuPeng/zhupeng.github.io
|
_posts/2020-10-25-java.thumbnailator.md
|
Markdown
|
mit
| 1,477
|
module WellsFargo
class Element
class InvoiceInfo < WellsFargo::Element
attribute :pmt_action_code
attribute :discount_cur_amt
attribute :total_cur_amt
attribute :net_cur_amt
attribute :withd_amt
attribute :eff_dt
attribute :invoice_type
attribute :invoice_num
child :ref_info
child :note
child :tax_info
child :invoice_adj
child :po_info
end
end
end
|
JackDanger/wells_fargo
|
lib/wells_fargo/elements/invoice_info.rb
|
Ruby
|
mit
| 442
|
local anim8 = {
_VERSION = 'anim8 v2.3.0',
_DESCRIPTION = 'An animation library for LÖVE',
_URL = 'https://github.com/kikito/anim8',
_LICENSE = [[
MIT LICENSE
Copyright (c) 2011 Enrique García Cota
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]
}
local Grid = {}
local _frames = {}
local function assertPositiveInteger(value, name)
if type(value) ~= 'number' then error(("%s should be a number, was %q"):format(name, tostring(value))) end
if value < 1 then error(("%s should be a positive number, was %d"):format(name, value)) end
if value ~= math.floor(value) then error(("%s should be an integer, was %d"):format(name, value)) end
end
local function createFrame(self, x, y)
local fw, fh = self.frameWidth, self.frameHeight
return love.graphics.newQuad(
self.left + (x-1) * fw + x * self.border,
self.top + (y-1) * fh + y * self.border,
fw,
fh,
self.imageWidth,
self.imageHeight
)
end
local function getGridKey(...)
return table.concat( {...} ,'-' )
end
local function getOrCreateFrame(self, x, y)
if x < 1 or x > self.width or y < 1 or y > self.height then
error(("There is no frame for x=%d, y=%d"):format(x, y))
end
local key = self._key
_frames[key] = _frames[key] or {}
_frames[key][x] = _frames[key][x] or {}
_frames[key][x][y] = _frames[key][x][y] or createFrame(self, x, y)
return _frames[key][x][y]
end
local function parseInterval(str)
if type(str) == "number" then return str,str,1 end
str = str:gsub('%s', '') -- remove spaces
local min, max = str:match("^(%d+)-(%d+)$")
assert(min and max, ("Could not parse interval from %q"):format(str))
min, max = tonumber(min), tonumber(max)
local step = min <= max and 1 or -1
return min, max, step
end
function Grid:getFrames(...)
local result, args = {}, {...}
local minx, maxx, stepx, miny, maxy, stepy
for i=1, #args, 2 do
minx, maxx, stepx = parseInterval(args[i])
miny, maxy, stepy = parseInterval(args[i+1])
for y = miny, maxy, stepy do
for x = minx, maxx, stepx do
result[#result+1] = getOrCreateFrame(self,x,y)
end
end
end
return result
end
local Gridmt = {
__index = Grid,
__call = Grid.getFrames
}
local function newGrid(frameWidth, frameHeight, imageWidth, imageHeight, left, top, border)
assertPositiveInteger(frameWidth, "frameWidth")
assertPositiveInteger(frameHeight, "frameHeight")
assertPositiveInteger(imageWidth, "imageWidth")
assertPositiveInteger(imageHeight, "imageHeight")
left = left or 0
top = top or 0
border = border or 0
local key = getGridKey(frameWidth, frameHeight, imageWidth, imageHeight, left, top, border)
local grid = setmetatable(
{ frameWidth = frameWidth,
frameHeight = frameHeight,
imageWidth = imageWidth,
imageHeight = imageHeight,
left = left,
top = top,
border = border,
width = math.floor(imageWidth/frameWidth),
height = math.floor(imageHeight/frameHeight),
_key = key
},
Gridmt
)
return grid
end
-----------------------------------------------------------
local Animation = {}
local function cloneArray(arr)
local result = {}
for i=1,#arr do result[i] = arr[i] end
return result
end
local function parseDurations(durations, frameCount)
local result = {}
if type(durations) == 'number' then
for i=1,frameCount do result[i] = durations end
else
local min, max, step
for key,duration in pairs(durations) do
assert(type(duration) == 'number', "The value [" .. tostring(duration) .. "] should be a number")
min, max, step = parseInterval(key)
for i = min,max,step do result[i] = duration end
end
end
if #result < frameCount then
error("The durations table has length of " .. tostring(#result) .. ", but it should be >= " .. tostring(frameCount))
end
return result
end
local function parseIntervals(durations)
local result, time = {0},0
for i=1,#durations do
time = time + durations[i]
result[i+1] = time
end
return result, time
end
local Animationmt = { __index = Animation }
local nop = function() end
local function newAnimation(frames, durations, onLoop)
local td = type(durations);
if (td ~= 'number' or durations <= 0) and td ~= 'table' then
error("durations must be a positive number. Was " .. tostring(durations) )
end
onLoop = onLoop or nop
durations = parseDurations(durations, #frames)
local intervals, totalDuration = parseIntervals(durations)
return setmetatable({
frames = cloneArray(frames),
durations = durations,
intervals = intervals,
totalDuration = totalDuration,
onLoop = onLoop,
timer = 0,
position = 1,
status = "playing",
flippedH = false,
flippedV = false
},
Animationmt
)
end
function Animation:clone()
local newAnim = newAnimation(self.frames, self.durations, self.onLoop)
newAnim.flippedH, newAnim.flippedV = self.flippedH, self.flippedV
return newAnim
end
function Animation:flipH()
self.flippedH = not self.flippedH
return self
end
function Animation:flipV()
self.flippedV = not self.flippedV
return self
end
local function seekFrameIndex(intervals, timer)
local high, low, i = #intervals-1, 1, 1
while(low <= high) do
i = math.floor((low + high) / 2)
if timer > intervals[i+1] then low = i + 1
elseif timer <= intervals[i] then high = i - 1
else
return i
end
end
return i
end
function Animation:update(dt)
if self.status ~= "playing" then return end
self.timer = self.timer + dt
local loops = math.floor(self.timer / self.totalDuration)
if loops ~= 0 then
self.timer = self.timer - self.totalDuration * loops
local f = type(self.onLoop) == 'function' and self.onLoop or self[self.onLoop]
f(self, loops)
end
self.position = seekFrameIndex(self.intervals, self.timer)
end
function Animation:pause()
self.status = "paused"
end
function Animation:gotoFrame(position)
self.position = position
self.timer = self.intervals[self.position]
end
function Animation:pauseAtEnd()
self.position = #self.frames
self.timer = self.totalDuration
self:pause()
end
function Animation:pauseAtStart()
self.position = 1
self.timer = 0
self:pause()
end
function Animation:resume()
self.status = "playing"
end
function Animation:draw(image, x, y, r, sx, sy, ox, oy, kx, ky)
love.graphics.draw(image, self:getFrameInfo(x, y, r, sx, sy, ox, oy, kx, ky))
end
function Animation:getFrameInfo(x, y, r, sx, sy, ox, oy, kx, ky)
local frame = self.frames[self.position]
if self.flippedH or self.flippedV then
r,sx,sy,ox,oy,kx,ky = r or 0, sx or 1, sy or 1, ox or 0, oy or 0, kx or 0, ky or 0
local _,_,w,h = frame:getViewport()
if self.flippedH then
sx = sx * -1
ox = w - ox
kx = kx * -1
ky = ky * -1
end
if self.flippedV then
sy = sy * -1
oy = h - oy
kx = kx * -1
ky = ky * -1
end
end
return frame, x, y, r, sx, sy, ox, oy, kx, ky
end
function Animation:getDimensions()
local _,_,w,h = self.frames[self.position]:getViewport()
return w,h
end
-----------------------------------------------------------
anim8.newGrid = newGrid
anim8.newAnimation = newAnimation
return anim8
|
Sewerbird/Helios2400
|
lib/anim8.lua
|
Lua
|
mit
| 8,491
|
(function() {
'use strict';
/**
* @name RootController
* @description The root controller that contains some rootScope accessible methods
* @memberof ag
*/
angular.module('ag').controller('RootController', getRootController);
var inject = ['$rootScope'];
getRootController.$inject = inject;
function getRootController($rootScope) {
// Method visible in the entire app and
// allows to start the loading spinner
$rootScope.startLoading = function() {
$rootScope.root.loading = true;
$rootScope.root.loadingQueue++;
};
// Method visible in the entire app and
// allows to stop the loading spinner
$rootScope.endLoading = function() {
$rootScope.root.loadingQueue--;
// Prevent bad call of the function
if ($rootScope.root.loadingQueue < 0) {
$rootScope.root.loadingQueue = 0;
}
if ($rootScope.root.loadingQueue === 0) {
$rootScope.root.loading = false;
}
};
}
})();
|
thlem/Agilog
|
src/app/agilog/agilog.controller.js
|
JavaScript
|
mit
| 1,111
|
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>{{ page.title }} - Stella Blog</title>
<meta name="author" content="Delano Mandelbaum" />
<meta name="description" content="The blog for the web monitoring service of the future: BlameStella." />
<link rel="alternate" type="application/atom+xml" href="/atom.xml" rel="alternate" title="BlameStella Blog - Atom Feed" />
<link rel="stylesheet" href="/css/base.css" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="/css/custom.css" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="/css/pygments.css" type="text/css" />
<link media="only screen and (max-device-width: 480px)" href="/css/iphone.css" type="text/css" rel="stylesheet" />
<link media="only screen and (device-width: 768px)" href="/css/iphone.css" type="text/css" rel="stylesheet" />
<link href='http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz' rel='stylesheet' type='text/css'>
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script type="text/javascript" src="/js/application.js"></script>
</head>
<body>
<section class="sidebar">
<a href="https://www.blamestella.com/">
<img src="/images/ios.png" height="75" width="75" class="avatar" />
</a>
<section class="name">
<a href="/">
<span id="title">The<br/>Blame<br/>Stella<br/>Blog</span>
</a>
</section>
<section class="meta">
<a href="https://github.com/stella"><img src="/images/github.png" /></a>
<a href="https://twitter.com/blamestella"><img src="/images/twitter.png"></a>
<a href="/atom.xml"><img src="/images/rss.png" /></a>
</section>
<section class="sections">
<ul>
<li><a href="/">home</a></li>
<li><a href="/posts/">archive</a></li>
<li><a href="/about/">about</a></li>
</ul>
</section>
<hr/>
<section class="about">
<h4>About Stella</h4>
<p><em>Stella monitors the speed of your web sites and applications and notifies you when there's a problem.</em></p>
<p><em><strong><a href="https://www.blamestella.com/">Run a checkup</a></strong> on your site today and signup for free.</em></p>
</section>
</section>
{{ content }}
<footer>
<p><a href="https://www.blamestella.com">Blamey & Stella Information Co.</a> - Template by <a href="http://twitter.com/holman">@holman</a></p>
</footer>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-23142033-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>
|
stella/stella.github.com
|
_layouts/layout.html
|
HTML
|
mit
| 3,174
|
'use strict';
/**
* @ngdoc function
* @name wavesApp.controller:EventsCtrl
* @description
* # EventsCtrl
* Controller of the wavesApp
*/
angular.module('wavesApp')
.controller('EventsCtrl', ['$scope', function ($scope) {
$scope.events = [
'Evento1', 'Evento2', 'Evento3', 'Evento4', 'Evento5', 'Evento6', 'Evento7'
];
}]);
|
InflectProject/waves
|
app/scripts/controllers/events.js
|
JavaScript
|
mit
| 357
|
/*
Package db holds the service-wide database configuration functionality.
It mostly calls into other <package>/db/ methods.
*/
package db
import (
"errors"
apiDB "spaciblo.org/api/db"
"spaciblo.org/be"
)
/*
InitDB sets up a be.DBInfo and migrates the api, sim, and ws tables
*/
func InitDB() (*be.DBInfo, error) {
dbInfo, err := be.InitDB()
if err != nil {
return nil, errors.New("DB Initialization Error: " + err.Error())
}
err = apiDB.MigrateDB(dbInfo)
if err != nil {
return nil, errors.New("API DB Migration Error: " + err.Error())
}
return dbInfo, nil
}
|
Spaciblo/spaciblo-core
|
go/src/spaciblo.org/db/db.go
|
GO
|
mit
| 578
|
# BibWord
Easy bibliography styles for Microsoft Word
## Introduction
The main goal of this project is to collect and maintain a number of bibliography styles which can be used by Microsoft Word 2007 and later. Most styles are either created using [BibWord](BibWord) or derived from the styles which come with Microsoft Word.
Everybody who wants to submit a style can do so by contacting one of the project coordinators. The only requirement for putting a style on the project page, is that you release your style under the MIT license. That basically allows people to do whatever they want with your style as long as they give you credit for it.
## Installation on Windows (Word 2007/2010/2013)
To use the bibliography styles, they have to be copied into the Microsoft Word bibliography style directory. This directory can vary depending on where Word is installed:
### Word 2007
```
<winword.exe directory>\Bibliography\Style
```
On most _32-bits_ machines with Microsoft Word 2007 this will be:
```
%programfiles%\Microsoft Office\Office12\Bibliography\Style
```
Once the styles are copied to the directory, they will show up every time Microsoft Word is opened.
### Word 2010
```
<winword.exe directory>\Bibliography\Style
```
On most _32-bits_ machines with Microsoft Word 2010 this will be:
```
%programfiles%\Microsoft Office\Office14\Bibliography\Style
```
Once the styles are copied to the directory, they will show up every time Microsoft Word is opened.
### Word 2013
```
<user directory>\AppData\Roaming\Microsoft\Bibliography\Style
```
On most machines with Micrososft Word 2013 this will be:
```
%userprofile%\AppData\Roaming\Microsoft\Bibliography\Style
```
Once the styles are copied to the directory, they will show up every time Microsoft Word is opened.
### Word 365
```
%AppData%\Microsoft\Templates\LiveContent\15\Managed\Word Document Bibliography Styles
```
Once the styles are copied to the directory, they will show up every time Microsoft Word is opened.
**Remark:** the types.xml included with the stylesheets should be used in combination with BibType to create some extra fields for the different types.
## Installation on Mac (Word 2008/2011/2016)
### Word 2008
To use the bibliography styles, right-click on Microsoft Word 2008 and select show package contents. Put the files in:
```
Contents/Resources/Style/
```
On most Macs with Microsoft Word 2008 this will be:
```
/Applications/Microsoft Office 2008/Microsoft Word.app/Contents/Resources/Style/
```
### Word 2011
To use the bibliography styles, right-click on Microsoft Word 2008 and select show package contents. Put the files in:
```
Contents/Resources/Style/
```
On most Macs with Microsoft Word 2011 this will be:
```
/Applications/Microsoft Office 2011/Microsoft Word.app/Contents/Resources/Style/
```
### Word 2016 (version 15.17.0 and up)
To use the bibliography styles, place them in the following folder
```
/Library/AppSupport/Microsoft/Office365/Citations/
```
|
ydhondt/BibWord
|
README.md
|
Markdown
|
mit
| 3,020
|
# Simple Battleship Game
Simple Battleship Game
Hello!
It's a simple realization of a Battleship game on Python 3
The rules and information about this game you can find on http://en.wikipedia.org/wiki/Battleship_%28game%29
To start game:
- Open terminal (ctr+t)
- Clone repository: git clone https://github.com/litany-of-madness/simple-battleship-game.git
- Run game: python3 simple-battleship-game/main.py
Tested on Ubuntu 14.04
Screenshots:


Have a nice day! :)
|
litany-of-madness/simple-battleship-game
|
README.md
|
Markdown
|
mit
| 701
|
<!DOCTYPE html>
<!--[if IEMobile 7]><html class="iem7 no-js" lang="en" dir="ltr"><![endif]-->
<!--[if lt IE 7]><html class="lt-ie9 lt-ie8 lt-ie7 no-js" lang="en" dir="ltr"><![endif]-->
<!--[if (IE 7)&(!IEMobile)]><html class="lt-ie9 lt-ie8 no-js" lang="en" dir="ltr"><![endif]-->
<!--[if IE 8]><html class="lt-ie9 no-js" lang="en" dir="ltr"><![endif]-->
<!--[if (gt IE 8)|(gt IEMobile 7)]><!-->
<html class="no-js not-oldie" lang="en" dir="ltr">
<!--<![endif]-->
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="HandheldFriendly" content="true" />
<link rel="shortcut icon" href="https://www.epa.gov/sites/all/themes/epa/favicon.ico" type="image/vnd.microsoft.icon" />
<meta name="MobileOptimized" content="width" />
<meta http-equiv="cleartype" content="on" />
<meta http-equiv="ImageToolbar" content="false" />
<meta name="viewport" content="width=device-width" />
<meta name="version" content="20161218" />
<!--googleon: all-->
<meta name="DC.description" content="" />
<meta name="DC.title" content="" />
<title>
ENOx Process for NOx and Unburned Hydrocarbon Emissions from Combustion Sources|
Research Project Database | Grantee Research Project | ORD | US EPA</title>
<!--googleoff: snippet-->
<meta name="keywords" content="" />
<link rel="shortlink" href="" />
<link rel="canonical" href="" />
<meta name="DC.creator" content="" />
<meta name="DC.language" content="en" />
<meta name="DC.Subject.epachannel" content="" />
<meta name="DC.type" content="" />
<meta name="DC.date.created" content="" />
<meta name="DC.date.modified" content="2017-01-26" />
<!--googleoff: all-->
<link type="text/css" rel="stylesheet" href="https://www.epa.gov/misc/ui/jquery.ui.autocomplete.css" media="all" />
<link type="text/css" rel="stylesheet" href="https://www.epa.gov/sites/all/themes/epa/css/lib/jquery.ui.theme.css" media="all" />
<link type="text/css" rel="stylesheet" href="https://www.epa.gov/sites/all/libraries/template2/s.css" media="all" />
<!--[if lt IE 9]><link type="text/css" rel="stylesheet" href="https://www.epa.gov/sites/all/themes/epa/css/ie.css" media="all" /><![endif]-->
<link rel="alternate" type="application/atom+xml" title="EPA.gov All Press Releases" href="https://www.epa.gov/newsreleases/search/rss" />
<link rel="alternate" type="application/atom+xml" title="EPA.gov Headquarters Press Releases" href="https://www.epa.gov/newsreleases/search/rss/field_press_office/headquarters" />
<link rel="alternate" type="application/atom+xml" title="Greenversations, EPA's Blog" href="https://blog.epa.gov/blog/feed/" />
<!--[if lt IE 9]><script src="https://www.epa.gov/sites/all/themes/epa/js/html5.js"></script><![endif]-->
<style type="text/css">
/*This style needed for highlight link. Please do not remove*/
.hlText {
font-family: "Arial";
color: red;
font-weight: bold;
font-style: italic;
background-color: yellow;
}
.tblClass {
font-size:smaller; min-width: 10%; line-height: normal;
}
</style>
</head>
<!-- NOTE, figure out body classes! -->
<body class="node-type-(web-area|page|document|webform) (microsite|resource-directory)" >
<!-- Google Tag Manager -->
<noscript>
<iframe src="//www.googletagmanager.com/ns.html?id=GTM-L8ZB" height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-L8ZB');</script>
<!-- End Google Tag Manager -->
<div class="skip-links"><a href="#main-content" class="skip-link element-invisible element-focusable">Jump to main content</a></div>
<header class="masthead clearfix" role="banner"> <img class="site-logo" src="https://www.epa.gov/sites/all/themes/epa/logo.png" alt="" />
<hgroup class="site-name-and-slogan">
<h1 class="site-name"><a href="https://www.epa.gov/" title="Go to the home page" rel="home"><span>US EPA</span></a></h1>
<div class="site-slogan">United States Environmental Protection Agency</div>
</hgroup>
<form class="epa-search" method="get" action="https://search.epa.gov/epasearch/epasearch">
<label class="element-hidden" for="search-box">Search</label>
<input class="form-text" placeholder="Search EPA.gov" name="querytext" id="search-box" value=""/>
<button class="epa-search-button" id="search-button" type="submit" title="Search">Search</button>
<input type="hidden" name="fld" value="" />
<input type="hidden" name="areaname" value="" />
<input type="hidden" name="areacontacts" value="" />
<input type="hidden" name="areasearchurl" value="" />
<input type="hidden" name="typeofsearch" value="epa" />
<input type="hidden" name="result_template" value="2col.ftl" />
<input type="hidden" name="filter" value="sample4filt.hts" />
</form>
</header>
<section id="main-content" class="main-content clearfix" role="main">
<div class="region-preface clearfix">
<div id="block-pane-epa-web-area-connect" class="block block-pane contextual-links-region">
<ul class="menu utility-menu">
<li class="menu-item"><a href="https://www.epa.gov/research-grants/forms/contact-us-about-research-grants" class="menu-link contact-us">Contact Us</a></li>
</ul>
</div>
</div>
<div class="main-column clearfix">
<!--googleon: all-->
<div class="panel-pane pane-node-content" >
<div class="pane-content">
<div class="node node-page clearfix view-mode-full">
<div class="box multi related-info right clear-right" style="max-width:300px; font-size:14px;"><!--googleoff: index-->
<!-- RFA Search start -->
<h5 class="pane-title">Related Information</h5>
<div class="pane-content">
<ul><li><a href="https://www.epa.gov/research-grants/">Research Grants</a></li>
<li><a href="https://www.epa.gov/P3">P3: Student Design Competition</a></li>
<li><a href="https://www.epa.gov/research-fellowships/">Research Fellowships</a></li>
<li><a href="https://www.epa.gov/sbir/">Small Business Innovation Research (SBIR)</a></li>
<li><a href="https://cfpub.epa.gov/ncer_abstracts/index.cfm/fuseaction/search.welcome">Grantee Research Project Results Search</a></li>
</ul>
</div>
<!-- RFA Search End --><!--googleon: index-->
</div>
<a name="content"></a>
<h2>
ENOx Process for NOx and Unburned Hydrocarbon Emissions from Combustion Sources</h2>
<b>EPA Contract Number:</b> 68D30082<br />
<b>Title:</b> ENOx Process for NOx and Unburned Hydrocarbon Emissions from Combustion Sources<br />
<b>Investigators:</b>
<a href="https://cfpub.epa.gov/ncer_abstracts/index.cfm/fuseaction/display.investigatorInfo/investigator/3886"> Manning, Michael P. </a>
<br />
<strong>Small Business:</strong>
<a href="https://cfpub.epa.gov/ncer_abstracts/index.cfm/fuseaction/display.institutionInfo/institution/3791">
<b>Plasmachines Inc.</b>
</a> <br />
<strong>EPA Contact:</strong>
<a href="https://cfpub.epa.gov/ncer_abstracts/index.cfm/fuseaction/display.investigatorInfo/investigator/1157"> Manager, SBIR Program </a>
<br />
<b>Phase:</b> II<br />
<b>Project Period:</b>
September 1, 1993 through
August 1, 1996
<br />
<b>Project Amount:</b>
$150,000
<br />
<b>RFA:</b>
Small Business Innovation Research (SBIR) - Phase II (1993)
<a href="https://cfpub.epa.gov/ncer_abstracts/index.cfm/fuseaction/recipients.display/rfa_id/220">Recipients Lists</a>
<br />
<b>Research Category:</b>
<a href="https://cfpub.epa.gov/ncer_abstracts/index.cfm/fuseaction/display.researchCategory/rc_id/228">Air Quality and Air Toxics</a>
,
<a href="https://cfpub.epa.gov/ncer_abstracts/index.cfm/fuseaction/display.researchCategory/rc_id/955">SBIR - Air Pollution</a>
,
<a href="https://cfpub.epa.gov/ncer_abstracts/index.cfm/fuseaction/display.researchCategory/rc_id/107">Small Business Innovation Research (SBIR)</a>
<br />
<br>
<h3>Description:</h3>
The proposed research will open new areas of electronically excited chemical plasma reduction of pollutant emission rates. The proposed research will determine the efficacy and mechanism of the process and report data allowing comparison of this process with previous proposed processes.
<p></p>
<h3>Supplemental Keywords:</h3>
RFA, Scientific Discipline, Air, Toxics, Waste, Sustainable Industry/Business, air toxics, cleaner production/pollution prevention, Sustainable Environment, Chemistry, HAPS, Technology for Sustainable Environment, New/Innovative technologies, Incineration/Combustion, Engineering, Engineering, Chemistry, & Physics, Nox, Nitrogen Oxides, air pollutants, control, hydrocarbon, emission control technologies, nitrogren oxides (NOx), air pollution control, pollution control technologies, acid rain precursors, unburned hydrocarbon, air pollution, emission controls, pollution control, treatment, combustion technology, unburned hydrocarbons, combustion, hydrocarbons, pollutants, electronically excited chemical plasma, nitrogen oxides (Nox), emissions contol engineering, ENOx Process <p /> </div>
</div>
</div>
<div id="block-epa-og-footer" class="block block-epa-og">
<p class="pagetop"><a href="#content">Top of Page</a></p>
<!--googleoff: all-->
<p id="epa-og-footer"> The perspectives, information and conclusions conveyed in research project abstracts, progress reports, final reports, journal abstracts and journal publications convey the viewpoints of the principal investigator and may not represent the views and policies of ORD and EPA. Conclusions drawn by the principal investigators have not been reviewed by the Agency. </p>
</div>
<!--googleoff: all-->
</div>
</section>
<nav class="nav simple-nav simple-main-nav" role="navigation">
<div class="nav__inner">
<h2 class="element-invisible">Main menu</h2>
<ul class="menu" role="menu">
<li class="menu-item" id="menu-learn" role="presentation"><a href="https://www.epa.gov/environmental-topics" title="Learn about EPA's environmental topics to help protect the environment in your home, workplace, and community and EPA's research mission is to conduct leading-edge research and foster the sound use of science and technology." class="menu-link" role="menuitem">Environmental Topics</a></li>
<li class="menu-item" id="menu-lawsregs" role="presentation"><a href="https://www.epa.gov/laws-regulations" title="Laws written by Congress provide the authority for EPA to write regulations. Regulations explain the technical, operational, and legal details necessary to implement laws." class="menu-link" role="menuitem">Laws & Regulations</a></li>
<li class="menu-item" id="menu-about" role="presentation"><a href="https://www.epa.gov/aboutepa" title="Learn more about: our mission and what we do, how we are organized, and our history." class="menu-link" role="menuitem">About EPA</a></li>
</ul>
</div>
</nav>
<footer class="main-footer clearfix" role="contentinfo">
<div class="main-footer__inner">
<div class="region-footer">
<div class="block block-pane block-pane-epa-global-footer">
<div class="row cols-3">
<div class="col size-1of3">
<div class="col__title">Discover.</div>
<ul class="menu">
<li><a href="https://www.epa.gov/accessibility">Accessibility</a></li>
<li><a href="https://www.epa.gov/aboutepa/administrator-gina-mccarthy">EPA Administrator</a></li>
<li><a href="https://www.epa.gov/planandbudget">Budget & Performance</a></li>
<li><a href="https://www.epa.gov/contracts">Contracting</a></li>
<li><a href="https://www.epa.gov/home/grants-and-other-funding-opportunities">Grants</a></li>
<li><a href="https://www.epa.gov/ocr/whistleblower-protections-epa-and-how-they-relate-non-disclosure-agreements-signed-epa-employees">No FEAR Act Data</a></li>
<li><a href="https://www.epa.gov/home/privacy-and-security-notice">Privacy and Security</a></li>
</ul>
</div>
<div class="col size-1of3">
<div class="col__title">Connect.</div>
<ul class="menu">
<li><a href="https://www.data.gov/">Data.gov</a></li>
<li><a href="https://www.epa.gov/office-inspector-general/about-epas-office-inspector-general">Inspector General</a></li>
<li><a href="https://www.epa.gov/careers">Jobs</a></li>
<li><a href="https://www.epa.gov/newsroom">Newsroom</a></li>
<li><a href="https://www.whitehouse.gov/open">Open Government</a></li>
<li><a href="http://www.regulations.gov/">Regulations.gov</a></li>
<li><a href="https://www.epa.gov/newsroom/email-subscriptions">Subscribe</a></li>
<li><a href="https://www.usa.gov/">USA.gov</a></li>
<li><a href="https://www.whitehouse.gov/">White House</a></li>
</ul>
</div>
<div class="col size-1of3">
<div class="col__title">Ask.</div>
<ul class="menu">
<li><a href="https://www.epa.gov/home/forms/contact-us">Contact Us</a></li>
<li><a href="https://www.epa.gov/home/epa-hotlines">Hotlines</a></li>
<li><a href="https://www.epa.gov/foia">FOIA Requests</a></li>
<li><a href="https://www.epa.gov/home/frequent-questions-specific-epa-programstopics">Frequent Questions</a></li>
</ul>
<div class="col__title">Follow.</div>
<ul class="social-menu">
<li><a class="menu-link social-facebook" href="https://www.facebook.com/EPA">Facebook</a></li>
<li><a class="menu-link social-twitter" href="https://twitter.com/epa">Twitter</a></li>
<li><a class="menu-link social-youtube" href="https://www.youtube.com/user/USEPAgov">YouTube</a></li>
<li><a class="menu-link social-flickr" href="https://www.flickr.com/photos/usepagov">Flickr</a></li>
<li><a class="menu-link social-instagram" href="https://instagram.com/epagov">Instagram</a></li>
</ul>
<p class="last-updated">Last updated on Thursday, January 26, 2017</p>
</div>
</div>
</div>
</div>
</div>
</footer>
<script src="https://www.epa.gov/sites/all/libraries/template2/jquery.js"></script>
<script src="https://www.epa.gov/sites/all/libraries/template/js.js"></script>
<script src="https://www.epa.gov/sites/all/modules/custom/epa_core/js/alert.js"></script>
<script src="https://www.epa.gov/sites/all/modules/contrib/jquery_update/replace/ui/ui/minified/jquery.ui.core.min.js"></script>
<script src="https://www.epa.gov/sites/all/modules/contrib/jquery_update/replace/ui/ui/minified/jquery.ui.widget.min.js"></script>
<script src="https://www.epa.gov/sites/all/modules/contrib/jquery_update/replace/ui/ui/minified/jquery.ui.position.min.js"></script>
<script src="https://www.epa.gov/sites/all/modules/contrib/jquery_update/replace/ui/ui/minified/jquery.ui.autocomplete.min.js"></script>
<!--[if lt IE 9]><script src="https://www.epa.gov/sites/all/themes/epa/js/ie.js"></script><![endif]-->
<!-- REMOVE if not using -->
<script language=javascript>
<!-- // Activate cloak
// pressing enter will not default submit the first defined button but the programmed defined button
function chkCDVal(cdVal)
{
var isErr = true;
try{
var CDParts = cdVal.split(',');
var st = CDParts[0];
var cd = CDParts[1];
var objRegExp = new RegExp('[0-9][0-9]');
if (!isNaN(st)) {
isErr = false;
}
if (!objRegExp.test(cd) || (cd.length>3)){
isErr = false;
}
}
catch(err){
isErr = false;
}
return isErr;
}
function checkCongDist(cdtxt)
{
//alert(cdtxt.value);
if (!chkCDVal(cdtxt.value)) {
alert('Congressional District MUST be in the following format: state, district; example: Virginia, 08');
return false;
}
else {
return true;
}
}
function fnTrapKD(btn, event)
{
var btn = getObject(btn);
if (document.all)
{
if (event.keyCode == 13)
{
event.returnValue=false;event.cancel = true;btn.click();
}
}
else
{
if (event.which == 13)
{
event.returnValue=false;event.cancelBubble = true;btn.click();
}
}
}
function CheckFilter()
{ if (document.searchform.presetTopic.options[document.searchform.presetTopic.selectedIndex].value == 'NA'){
alert('You must select a subtopic. \n This item is not selectable');
document.searchform.presetTopic.options[0].selected = true;
}
}
function openHelpWindow(url,title,scrollable)
{
var win = window.open(url,"title",'width=300,height=220,left=320,top=150,resizable=1,scrollbars='+scrollable+',menubar=no,status=no');
win.focus();
}
function openNewWindow(url,title,scrollable)
{
var win = window.open(url,"title",'width=300,height=220,left=320,top=150,resizable=1,scrollbars='+scrollable+',menubar=no,status=no');
}
function openNewWindow(url,title)
{
var win = window.open(url,"title",'width=300,height=220,left=320,top=150,resizable=1,scrollbars=no,menubar=no,status=no');
}
function openNewMapWindow(url,title)
{
var win = window.open(url,"title",'width=800,height=450,left=320,top=150,resizable=1,scrollbars=no,menubar=no,status=no');
}
function openNoticeWindow(url,title)
{
var win = window.open(url,"title",'width=300,height=150,left=500,top=150,resizable=1,scrollbars=no,menubar=no,status=no');
}
function openNewSearchWindow(site,subj)
{
title = 'window';
var win = window.open('https://cfpub.epa.gov/ncer_abstracts/index.cfm/fuseaction/display.pubsearch/site/' + site + '/redirect/' + subj,"title",'width=640,height=480,resizable=1,scrollbars=yes,menubar=yes,status=no');
}
function autoCheck(name)
{
document.forms['thisForm'].elements[name].checked = true;
}
function alertUser()
{
var ok = alert("This search might take longer than expected. Please refrain from hitting the refresh or reload button on your browser. The search results will appear after the search is complete. Thank you.");
}
function closePopupWindow(redirectUrl)
{
opener.location = redirectUrl;
opener.focus();
this.close();
}
//-->
</script>
</body>
</html>
|
1wheel/scraping
|
epa-grants/research/raw/01684.html
|
HTML
|
mit
| 19,849
|
/**
* Created by gongmw on 2017-05-03.
*/
public class No344 {
public String reverseString(String s) {
if (s == null) return null;
char[] sa = s.toCharArray();
char[] r = new char[sa.length];
for(int i=0; i<sa.length; i++) r[i] = sa[sa.length-1-i];
return new String(r);
}
}
|
GongWilliam/leetcode
|
easy/No344.java
|
Java
|
mit
| 325
|
'use strict';
angular.module('core.admin').run(['Menus',
function (Menus) {
Menus.addMenuItem('topbar', {
title: 'Admin',
state: 'admin',
type: 'dropdown',
roles: ['admin']
});
Menus.addSubMenuItem('topbar', 'admin', {
title: 'Dashboard',
state: 'admin.dashboard',
type: 'dropdown',
roles: ['admin']
});
}
]);
|
hibernator11/Galatea
|
modules/core/client/config/core-admin.client.menus.js
|
JavaScript
|
mit
| 384
|
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("FileToParts")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Bank Zachodni WBK S.A.")]
[assembly: AssemblyProduct("FileToParts")]
[assembly: AssemblyCopyright("Copyright © Bank Zachodni WBK S.A. 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("80c2c91b-4dd8-4782-9520-c51865e2239b")]
// 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")]
|
przemekwa/FileToPartsNet
|
FileToParts/Properties/AssemblyInfo.cs
|
C#
|
mit
| 1,442
|
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar
T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
class ExpressRoutePortsLocationsOperations(object):
"""ExpressRoutePortsLocationsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2021_05_01.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def list(
self,
**kwargs # type: Any
):
# type: (...) -> Iterable["_models.ExpressRoutePortsLocationListResult"]
"""Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each
location. Available bandwidths can only be obtained when retrieving a specific peering
location.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ExpressRoutePortsLocationListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2021_05_01.models.ExpressRoutePortsLocationListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2021-05-01"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list.metadata['url'] # type: ignore
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
def extract_data(pipeline_response):
deserialized = self._deserialize('ExpressRoutePortsLocationListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations'} # type: ignore
def get(
self,
location_name, # type: str
**kwargs # type: Any
):
# type: (...) -> "_models.ExpressRoutePortsLocation"
"""Retrieves a single ExpressRoutePort peering location, including the list of available
bandwidths available at said peering location.
:param location_name: Name of the requested ExpressRoutePort peering location.
:type location_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ExpressRoutePortsLocation, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2021_05_01.models.ExpressRoutePortsLocation
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2021-05-01"
accept = "application/json"
# Construct URL
url = self.get.metadata['url'] # type: ignore
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
'locationName': self._serialize.url("location_name", location_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('ExpressRoutePortsLocation', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations/{locationName}'} # type: ignore
|
Azure/azure-sdk-for-python
|
sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_05_01/operations/_express_route_ports_locations_operations.py
|
Python
|
mit
| 7,987
|
Link Highlighter for Chrome
===========================
This is a simple extension for Chrome which uses jQuery to highlight links. The jQuery library is injected into the page by the extension to make DOM access simpler. The injected code highlights links with specific file extensions.
|
brianly/LinkHighlighterExtension
|
README.md
|
Markdown
|
mit
| 288
|
TRUNCATE TABLE `nutrition`;
INSERT INTO `nutrition` (`id`, `name`, `description`, `order`, `active`, `created`, `createdById`, `updated`, `updatedById`) VALUES
(1, 'Serving Size', 'Serving Size', 1, 1, NOW(), 10, NOW(), 10),
(2, 'Calories', 'Calories', 2, 1, NOW(), 10, NOW(), 10),
(3, 'Fat Total', 'Fat Total', 3, 1, NOW(), 10, NOW(), 10),
(4, 'Saturated Fat', 'Saturated Fat', 4, 1, NOW(), 10, NOW(), 10),
(5, 'Sodium', 'Sodium', 5, 1, NOW(), 10, NOW(), 10),
(6, 'Carbohydrate', 'Carbohydrate', 6, 1, NOW(), 10, NOW(), 10),
(7, 'Sugar', 'Sugar', 7, 1, NOW(), 10, NOW(), 10),
(8, 'Protein', 'Protein', 8, 1, NOW(), 10, NOW(), 10);
|
tlan16/sushi-co
|
core/promotion/Archive/nutrition.sql
|
SQL
|
mit
| 642
|
<table width="90%" border="0"><tr><td><script>function openfile(url) {fullwin = window.open(url, "fulltext", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");}</script><div class="flayoutclass"><div class="flayoutclass_first"><table class="tableoutfmt2"><tr><th class="std1"><b>條目 </b></th><td class="std2">金馬玉堂</td></tr>
<tr><th class="std1"><b>注音 </b></th><td class="std2">ㄐ|ㄣ ㄇㄚ<sup class="subfont">ˇ</sup> ㄩ<sup class="subfont">ˋ</sup> ㄊㄤ<sup class="subfont">ˊ</sup></td></tr>
<tr><th class="std1"><b>漢語拼音 </b></th><td class="std2"><font class="english_word">jīn mǎ yù táng</font></td></tr>
<tr><th class="std1"><b>釋義 </b></th><td class="std2">漢代的金馬門與玉堂殿。後世用以指翰林院,引申為顯赫的高位。明˙陳汝元˙金蓮記˙第八齣:<img src=/cydic/dicword/fa40.gif border=0 alt=* class=fontimg valign=center>吾想金馬玉堂,雖然清貴,竹籬茆舍,亦自逍遙。<img src=/cydic/dicword/fa41.gif border=0 alt=* class=fontimg valign=center>幼學瓊林˙卷一˙文臣類:<img src=/cydic/dicword/fa40.gif border=0 alt=* class=fontimg valign=center>金馬玉堂,羨翰林之聲價。<img src=/cydic/dicword/fa41.gif border=0 alt=* class=fontimg valign=center>亦作<img src=/cydic/dicword/fa40.gif border=0 alt=* class=fontimg valign=center>玉堂金馬<img src=/cydic/dicword/fa41.gif border=0 alt=* class=fontimg valign=center>、<img src=/cydic/dicword/fa40.gif border=0 alt=* class=fontimg valign=center>玉堂金門<img src=/cydic/dicword/fa41.gif border=0 alt=* class=fontimg valign=center>。</td></tr>
<tr><th class="std1"><b><font class="fltypefont">附錄</font> </b></th><td class="std2">修訂本參考資料</td></tr>
</td></tr></table></div> <!-- flayoutclass_first --><div class="flayoutclass_second"></div> <!-- flayoutclass_second --></div> <!-- flayoutclass --></td></tr></table>
|
BuzzAcademy/idioms-moe-unformatted-data
|
all-data/13000-13999/13142-22.html
|
HTML
|
mit
| 1,977
|
package houseprices.admin.datadownload
import scala.concurrent.ExecutionContext
import scala.concurrent.Future
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.model.HttpMethod
import akka.http.scaladsl.model.HttpMethods
import akka.http.scaladsl.model.HttpRequest
import akka.http.scaladsl.model.Uri.apply
import akka.http.scaladsl.unmarshalling.Unmarshal
import akka.stream.ActorMaterializer
trait HttpClient {
this: HttpRequestService =>
def get(uri: String) = makeRequest(HttpMethods.GET, uri)
}
trait HttpRequestService {
def makeRequest(method: HttpMethod, uri: String): Future[String]
}
trait AkkaHttpRequestService extends HttpRequestService {
implicit def system: ActorSystem
implicit def materializer: ActorMaterializer
implicit val ec: ExecutionContext
lazy val http = Http(system)
val oneGigabyte = 1073741824
override def makeRequest(method: HttpMethod, uri: String): Future[String] = {
val req = HttpRequest(method, uri)
val res = http.singleRequest(req)
res.flatMap { r => Unmarshal(r.entity.withSizeLimit(oneGigabyte)).to[String] }
}
def shutdown() = http.shutdownAllConnectionPools
}
object AkkaHttpClient {
def apply(sys: ActorSystem) = {
new HttpClient with AkkaHttpRequestService {
override implicit val system = sys
override implicit val materializer = ActorMaterializer.create(system)
override implicit val ec: ExecutionContext = system.dispatcher
}
}
}
object HttpClientApp extends App {
val system = ActorSystem("Me")
implicit val ec = system.dispatcher
val client = AkkaHttpClient(system)
client.get("http://textfiles.com/art/simpsons.txt").onSuccess {
case _@ t =>
println(t)
client.shutdown.onSuccess { case _ => system.terminate }
}
}
|
ayubmalik/houseprices
|
houseprices-core/src/main/scala/houseprices/admin/datadownload/HttpClient.scala
|
Scala
|
mit
| 1,804
|
<?php
class SilkTopConfig extends ClothingConfig {
public $detailsPartial = './layouts/partials/silk-details.php';
public $sizeGuidance = './layouts/partials/size-guidance-top.php';
}
?>
|
olu1987/lntnew
|
classes/SilkTopConfig.php
|
PHP
|
mit
| 203
|
# Œ 978 ‰
---
Bwl ] hir ho ho ho myil inhwl ]1] rhwau ] hir kw mwrgu gur sMiq
bqwieE guir cwl idKweI hir cwl ] AMqir kptu cukwvhu myry gurisKhu
inhkpt kmwvhu hir kI hir Gwl inhwl inhwl inhwl ]1] qy gur ky isK
myry hir pRiB Bwey ijnw hir pRBu jwinE myrw nwil ] jn nwnk kau miq
hir pRiB dInI hir dyiK inkit hdUir inhwl inhwl inhwl inhwl
]2]3]9]
rwgu nt nwrwien mhlw 5
<> siqgur pRswid ]
rwm hau ikAw jwnw ikAw BwvY ] min ipAws bhuqu drswvY ]1] rhwau ]
soeI igAwnI soeI jnu qyrw ijsu aUpir ruc AwvY ] ik®pw krhu ijsu purK
ibDwqy so sdw sdw quDu iDAwvY ]1] kvn jog kvn igAwn iDAwnw kvn
gunI rIJwvY ] soeI jnu soeI inj Bgqw ijsu aUpir rMgu lwvY ]2] sweI miq
sweI buiD isAwnp ijqu inmK n pRBu ibsrwvY ] sMqsMig lig eyhu suKu
pwieE hir gun sd hI gwvY ]3] dyiKE Acrju mhw mMgl rUp ikCu Awn
nhI idstwvY ] khu nwnk morcw guir lwihE qh grB join kh AwvY
]4]1]
nt nwrwien mhlw 5 dupdy
<> siqgur pRswid ]
aulwhno mY kwhU n dIE ] mn mIT quhwro kIE ]1] rhwau ] AwigAw mwin
jwin suKu pwieAw suin suin nwmu quhwro jIE ] eIhW aUhw hir qum hI qum hI
iehu gur qy mMqRü idRVIE ]1] jb qy jwin pweI eyh bwqw qb kusl Kym sB
QIE ] swDsMig nwnk prgwisE Awn nwhI ry bIE ] 2]1]2] nt mhlw
5 ] jw kau BeI qumwrI DIr ] jm kI qRws imtI suKu pwieAw inksI haumY
pIr ]1] rhwau ] qpiq buJwnI AMimRq bwnI iqRpqy ijau bwirk KIr ] mwq
ipqw swjn sMq
####
|
bogas04/SikhJS
|
assets/docs/md/SGGS/Ang 978.md
|
Markdown
|
mit
| 1,319
|
<?php
/*
* Copyright 2011 Piotr Śliwa <peter.pl7@gmail.com>
*
* License information is in LICENSE file
*/
namespace PHPPdf;
use PHPPdf\Exception\BadMethodCallException;
/**
* Current version of this library
*
* @author Piotr Śliwa <peter.pl7@gmail.com>
*/
final class Version
{
const VERSION = '1.2.5-DEV';
private function __construct()
{
throw new BadMethodCallException(sprintf('Object of "%s" class can not be created.', __CLASS__));
}
}
|
rasamu/proyectoec
|
vendor/psliwa/php-pdf/lib/PHPPdf/Version.php
|
PHP
|
mit
| 507
|
'use strict';
angular.module('vppApp')
.factory('User', function ($resource) {
// TODO
});
|
MetropolitanTransportationCommission/vpp-webapp
|
client/public/utils/services/user.service.js
|
JavaScript
|
mit
| 96
|
#!/usr/bin/env python
# coding: utf-8
import sys, os
sys.path.append(os.pardir) # 親ディレクトリのファイルをインポートするための設定
import numpy as np
import matplotlib.pyplot as plt
from dataset.mnist import load_mnist
from simple_convnet import SimpleConvNet
from common.trainer import Trainer
# データの読み込み
(x_train, t_train), (x_test, t_test) = load_mnist(flatten=False)
# 処理に時間のかかる場合はデータを削減
# x_train, t_train = x_train[:5000], t_train[:5000]
# x_test, t_test = x_test[:1000], t_test[:1000]
max_epochs = 20
network = SimpleConvNet(input_dim=(1, 28, 28),
conv_param={'filter_num': 30, 'filter_size': 5, 'pad': 0, 'stride': 1},
hidden_size=100, output_size=10, weight_init_std=0.01)
trainer = Trainer(network, x_train, t_train, x_test, t_test,
epochs=max_epochs, mini_batch_size=100,
optimizer='Adam', optimizer_param={'lr': 0.001},
evaluate_sample_num_per_epoch=1000)
trainer.train()
# パラメータの保存
network.save_params(os.path.dirname(os.path.abspath(__file__)) + "/params.pkl")
print("Saved Network Parameters!")
# グラフの描画
markers = {'train': 'o', 'test': 's'}
x = np.arange(max_epochs)
plt.plot(x, trainer.train_acc_list, marker='o', label='train', markevery=2)
plt.plot(x, trainer.test_acc_list, marker='s', label='test', markevery=2)
plt.xlabel("epochs")
plt.ylabel("accuracy")
plt.ylim(0, 1.0)
plt.legend(loc='lower right')
plt.show()
|
kgsn1763/deep-learning-from-scratch
|
ch07/train_convnet.py
|
Python
|
mit
| 1,553
|
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {fromPromise} from 'rxjs/observable/fromPromise';
import {composeAsyncValidators, composeValidators} from './directives/shared';
import {AsyncValidatorFn, ValidatorFn} from './directives/validators';
import {EventEmitter, Observable} from './facade/async';
import {isObservable, isPromise} from './private_import_core';
/**
* Indicates that a FormControl is valid, i.e. that no errors exist in the input value.
*/
export const VALID = 'VALID';
/**
* Indicates that a FormControl is invalid, i.e. that an error exists in the input value.
*/
export const INVALID = 'INVALID';
/**
* Indicates that a FormControl is pending, i.e. that async validation is occurring and
* errors are not yet available for the input value.
*/
export const PENDING = 'PENDING';
/**
* Indicates that a FormControl is disabled, i.e. that the control is exempt from ancestor
* calculations of validity or value.
*/
export const DISABLED = 'DISABLED';
function _find(control: AbstractControl, path: Array<string|number>| string, delimiter: string) {
if (path == null) return null;
if (!(path instanceof Array)) {
path = (<string>path).split(delimiter);
}
if (path instanceof Array && (path.length === 0)) return null;
return (<Array<string|number>>path).reduce((v, name) => {
if (v instanceof FormGroup) {
return v.controls[name] || null;
}
if (v instanceof FormArray) {
return v.at(<number>name) || null;
}
return null;
}, control);
}
function toObservable(r: any): Observable<any> {
return isPromise(r) ? fromPromise(r) : r;
}
function coerceToValidator(validator: ValidatorFn | ValidatorFn[]): ValidatorFn {
return Array.isArray(validator) ? composeValidators(validator) : validator;
}
function coerceToAsyncValidator(asyncValidator: AsyncValidatorFn | AsyncValidatorFn[]):
AsyncValidatorFn {
return Array.isArray(asyncValidator) ? composeAsyncValidators(asyncValidator) : asyncValidator;
}
/**
* @whatItDoes This is the base class for {@link FormControl}, {@link FormGroup}, and
* {@link FormArray}.
*
* It provides some of the shared behavior that all controls and groups of controls have, like
* running validators, calculating status, and resetting state. It also defines the properties
* that are shared between all sub-classes, like `value`, `valid`, and `dirty`. It shouldn't be
* instantiated directly.
*
* @stable
*/
export abstract class AbstractControl {
/** @internal */
_value: any;
/** @internal */
_onCollectionChange = () => {};
private _valueChanges: EventEmitter<any>;
private _statusChanges: EventEmitter<any>;
private _status: string;
private _errors: {[key: string]: any};
private _pristine: boolean = true;
private _touched: boolean = false;
private _parent: FormGroup|FormArray;
private _asyncValidationSubscription: any;
constructor(public validator: ValidatorFn, public asyncValidator: AsyncValidatorFn) {}
/**
* The value of the control.
*/
get value(): any { return this._value; }
/**
* The parent control.
*/
get parent(): FormGroup|FormArray { return this._parent; }
/**
* The validation status of the control. There are four possible
* validation statuses:
*
* * **VALID**: control has passed all validation checks
* * **INVALID**: control has failed at least one validation check
* * **PENDING**: control is in the midst of conducting a validation check
* * **DISABLED**: control is exempt from validation checks
*
* These statuses are mutually exclusive, so a control cannot be
* both valid AND invalid or invalid AND disabled.
*/
get status(): string { return this._status; }
/**
* A control is `valid` when its `status === VALID`.
*
* In order to have this status, the control must have passed all its
* validation checks.
*/
get valid(): boolean { return this._status === VALID; }
/**
* A control is `invalid` when its `status === INVALID`.
*
* In order to have this status, the control must have failed
* at least one of its validation checks.
*/
get invalid(): boolean { return this._status === INVALID; }
/**
* A control is `pending` when its `status === PENDING`.
*
* In order to have this status, the control must be in the
* middle of conducting a validation check.
*/
get pending(): boolean { return this._status == PENDING; }
/**
* A control is `disabled` when its `status === DISABLED`.
*
* Disabled controls are exempt from validation checks and
* are not included in the aggregate value of their ancestor
* controls.
*/
get disabled(): boolean { return this._status === DISABLED; }
/**
* A control is `enabled` as long as its `status !== DISABLED`.
*
* In other words, it has a status of `VALID`, `INVALID`, or
* `PENDING`.
*/
get enabled(): boolean { return this._status !== DISABLED; }
/**
* Returns any errors generated by failing validation. If there
* are no errors, it will return null.
*/
get errors(): {[key: string]: any} { return this._errors; }
/**
* A control is `pristine` if the user has not yet changed
* the value in the UI.
*
* Note that programmatic changes to a control's value will
* *not* mark it dirty.
*/
get pristine(): boolean { return this._pristine; }
/**
* A control is `dirty` if the user has changed the value
* in the UI.
*
* Note that programmatic changes to a control's value will
* *not* mark it dirty.
*/
get dirty(): boolean { return !this.pristine; }
/**
* A control is marked `touched` once the user has triggered
* a `blur` event on it.
*/
get touched(): boolean { return this._touched; }
/**
* A control is `untouched` if the user has not yet triggered
* a `blur` event on it.
*/
get untouched(): boolean { return !this._touched; }
/**
* Emits an event every time the value of the control changes, in
* the UI or programmatically.
*/
get valueChanges(): Observable<any> { return this._valueChanges; }
/**
* Emits an event every time the validation status of the control
* is re-calculated.
*/
get statusChanges(): Observable<any> { return this._statusChanges; }
/**
* Sets the synchronous validators that are active on this control. Calling
* this will overwrite any existing sync validators.
*/
setValidators(newValidator: ValidatorFn|ValidatorFn[]): void {
this.validator = coerceToValidator(newValidator);
}
/**
* Sets the async validators that are active on this control. Calling this
* will overwrite any existing async validators.
*/
setAsyncValidators(newValidator: AsyncValidatorFn|AsyncValidatorFn[]): void {
this.asyncValidator = coerceToAsyncValidator(newValidator);
}
/**
* Empties out the sync validator list.
*/
clearValidators(): void { this.validator = null; }
/**
* Empties out the async validator list.
*/
clearAsyncValidators(): void { this.asyncValidator = null; }
/**
* Marks the control as `touched`.
*
* This will also mark all direct ancestors as `touched` to maintain
* the model.
*/
markAsTouched({onlySelf}: {onlySelf?: boolean} = {}): void {
this._touched = true;
if (this._parent && !onlySelf) {
this._parent.markAsTouched({onlySelf});
}
}
/**
* Marks the control as `untouched`.
*
* If the control has any children, it will also mark all children as `untouched`
* to maintain the model, and re-calculate the `touched` status of all parent
* controls.
*/
markAsUntouched({onlySelf}: {onlySelf?: boolean} = {}): void {
this._touched = false;
this._forEachChild(
(control: AbstractControl) => { control.markAsUntouched({onlySelf: true}); });
if (this._parent && !onlySelf) {
this._parent._updateTouched({onlySelf});
}
}
/**
* Marks the control as `dirty`.
*
* This will also mark all direct ancestors as `dirty` to maintain
* the model.
*/
markAsDirty({onlySelf}: {onlySelf?: boolean} = {}): void {
this._pristine = false;
if (this._parent && !onlySelf) {
this._parent.markAsDirty({onlySelf});
}
}
/**
* Marks the control as `pristine`.
*
* If the control has any children, it will also mark all children as `pristine`
* to maintain the model, and re-calculate the `pristine` status of all parent
* controls.
*/
markAsPristine({onlySelf}: {onlySelf?: boolean} = {}): void {
this._pristine = true;
this._forEachChild((control: AbstractControl) => { control.markAsPristine({onlySelf: true}); });
if (this._parent && !onlySelf) {
this._parent._updatePristine({onlySelf});
}
}
/**
* Marks the control as `pending`.
*/
markAsPending({onlySelf}: {onlySelf?: boolean} = {}): void {
this._status = PENDING;
if (this._parent && !onlySelf) {
this._parent.markAsPending({onlySelf});
}
}
/**
* Disables the control. This means the control will be exempt from validation checks and
* excluded from the aggregate value of any parent. Its status is `DISABLED`.
*
* If the control has children, all children will be disabled to maintain the model.
*/
disable({onlySelf, emitEvent}: {onlySelf?: boolean, emitEvent?: boolean} = {}): void {
this._status = DISABLED;
this._errors = null;
this._forEachChild((control: AbstractControl) => { control.disable({onlySelf: true}); });
this._updateValue();
if (emitEvent !== false) {
this._valueChanges.emit(this._value);
this._statusChanges.emit(this._status);
}
this._updateAncestors(onlySelf);
this._onDisabledChange.forEach((changeFn) => changeFn(true));
}
/**
* Enables the control. This means the control will be included in validation checks and
* the aggregate value of its parent. Its status is re-calculated based on its value and
* its validators.
*
* If the control has children, all children will be enabled.
*/
enable({onlySelf, emitEvent}: {onlySelf?: boolean, emitEvent?: boolean} = {}): void {
this._status = VALID;
this._forEachChild((control: AbstractControl) => { control.enable({onlySelf: true}); });
this.updateValueAndValidity({onlySelf: true, emitEvent});
this._updateAncestors(onlySelf);
this._onDisabledChange.forEach((changeFn) => changeFn(false));
}
private _updateAncestors(onlySelf: boolean) {
if (this._parent && !onlySelf) {
this._parent.updateValueAndValidity();
this._parent._updatePristine();
this._parent._updateTouched();
}
}
setParent(parent: FormGroup|FormArray): void { this._parent = parent; }
/**
* Sets the value of the control. Abstract method (implemented in sub-classes).
*/
abstract setValue(value: any, options?: Object): void;
/**
* Patches the value of the control. Abstract method (implemented in sub-classes).
*/
abstract patchValue(value: any, options?: Object): void;
/**
* Resets the control. Abstract method (implemented in sub-classes).
*/
abstract reset(value?: any, options?: Object): void;
/**
* Re-calculates the value and validation status of the control.
*
* By default, it will also update the value and validity of its ancestors.
*/
updateValueAndValidity({onlySelf, emitEvent}: {onlySelf?: boolean, emitEvent?: boolean} = {}):
void {
this._setInitialStatus();
this._updateValue();
if (this.enabled) {
this._cancelExistingSubscription();
this._errors = this._runValidator();
this._status = this._calculateStatus();
if (this._status === VALID || this._status === PENDING) {
this._runAsyncValidator(emitEvent);
}
}
if (emitEvent !== false) {
this._valueChanges.emit(this._value);
this._statusChanges.emit(this._status);
}
if (this._parent && !onlySelf) {
this._parent.updateValueAndValidity({onlySelf, emitEvent});
}
}
/** @internal */
_updateTreeValidity({emitEvent}: {emitEvent?: boolean} = {emitEvent: true}) {
this._forEachChild((ctrl: AbstractControl) => ctrl._updateTreeValidity({emitEvent}));
this.updateValueAndValidity({onlySelf: true, emitEvent});
}
private _setInitialStatus() { this._status = this._allControlsDisabled() ? DISABLED : VALID; }
private _runValidator(): {[key: string]: any} {
return this.validator ? this.validator(this) : null;
}
private _runAsyncValidator(emitEvent: boolean): void {
if (this.asyncValidator) {
this._status = PENDING;
const obs = toObservable(this.asyncValidator(this));
if (!(isObservable(obs))) {
throw new Error(
`expected the following validator to return Promise or Observable: ${this.asyncValidator}. If you are using FormBuilder; did you forget to brace your validators in an array?`);
}
this._asyncValidationSubscription =
obs.subscribe({next: (res: {[key: string]: any}) => this.setErrors(res, {emitEvent})});
}
}
private _cancelExistingSubscription(): void {
if (this._asyncValidationSubscription) {
this._asyncValidationSubscription.unsubscribe();
}
}
/**
* Sets errors on a form control.
*
* This is used when validations are run manually by the user, rather than automatically.
*
* Calling `setErrors` will also update the validity of the parent control.
*
* ### Example
*
* ```
* const login = new FormControl("someLogin");
* login.setErrors({
* "notUnique": true
* });
*
* expect(login.valid).toEqual(false);
* expect(login.errors).toEqual({"notUnique": true});
*
* login.setValue("someOtherLogin");
*
* expect(login.valid).toEqual(true);
* ```
*/
setErrors(errors: {[key: string]: any}, {emitEvent}: {emitEvent?: boolean} = {}): void {
this._errors = errors;
this._updateControlsErrors(emitEvent !== false);
}
/**
* Retrieves a child control given the control's name or path.
*
* Paths can be passed in as an array or a string delimited by a dot.
*
* To get a control nested within a `person` sub-group:
*
* * `this.form.get('person.name');`
*
* -OR-
*
* * `this.form.get(['person', 'name']);`
*/
get(path: Array<string|number>|string): AbstractControl { return _find(this, path, '.'); }
/**
* Returns true if the control with the given path has the error specified. Otherwise
* returns null or undefined.
*
* If no path is given, it checks for the error on the present control.
*/
getError(errorCode: string, path: string[] = null): any {
const control = path ? this.get(path) : this;
return control && control._errors ? control._errors[errorCode] : null;
}
/**
* Returns true if the control with the given path has the error specified. Otherwise
* returns false.
*
* If no path is given, it checks for the error on the present control.
*/
hasError(errorCode: string, path: string[] = null): boolean {
return !!this.getError(errorCode, path);
}
/**
* Retrieves the top-level ancestor of this control.
*/
get root(): AbstractControl {
let x: AbstractControl = this;
while (x._parent) {
x = x._parent;
}
return x;
}
/** @internal */
_updateControlsErrors(emitEvent: boolean): void {
this._status = this._calculateStatus();
if (emitEvent) {
this._statusChanges.emit(this._status);
}
if (this._parent) {
this._parent._updateControlsErrors(emitEvent);
}
}
/** @internal */
_initObservables() {
this._valueChanges = new EventEmitter();
this._statusChanges = new EventEmitter();
}
private _calculateStatus(): string {
if (this._allControlsDisabled()) return DISABLED;
if (this._errors) return INVALID;
if (this._anyControlsHaveStatus(PENDING)) return PENDING;
if (this._anyControlsHaveStatus(INVALID)) return INVALID;
return VALID;
}
/** @internal */
abstract _updateValue(): void;
/** @internal */
abstract _forEachChild(cb: Function): void;
/** @internal */
abstract _anyControls(condition: Function): boolean;
/** @internal */
abstract _allControlsDisabled(): boolean;
/** @internal */
_anyControlsHaveStatus(status: string): boolean {
return this._anyControls((control: AbstractControl) => control.status === status);
}
/** @internal */
_anyControlsDirty(): boolean {
return this._anyControls((control: AbstractControl) => control.dirty);
}
/** @internal */
_anyControlsTouched(): boolean {
return this._anyControls((control: AbstractControl) => control.touched);
}
/** @internal */
_updatePristine({onlySelf}: {onlySelf?: boolean} = {}): void {
this._pristine = !this._anyControlsDirty();
if (this._parent && !onlySelf) {
this._parent._updatePristine({onlySelf});
}
}
/** @internal */
_updateTouched({onlySelf}: {onlySelf?: boolean} = {}): void {
this._touched = this._anyControlsTouched();
if (this._parent && !onlySelf) {
this._parent._updateTouched({onlySelf});
}
}
/** @internal */
_onDisabledChange: Function[] = [];
/** @internal */
_isBoxedValue(formState: any): boolean {
return typeof formState === 'object' && formState !== null &&
Object.keys(formState).length === 2 && 'value' in formState && 'disabled' in formState;
}
/** @internal */
_registerOnCollectionChange(fn: () => void): void { this._onCollectionChange = fn; }
}
/**
* @whatItDoes Tracks the value and validation status of an individual form control.
*
* It is one of the three fundamental building blocks of Angular forms, along with
* {@link FormGroup} and {@link FormArray}.
*
* @howToUse
*
* When instantiating a {@link FormControl}, you can pass in an initial value as the
* first argument. Example:
*
* ```ts
* const ctrl = new FormControl('some value');
* console.log(ctrl.value); // 'some value'
*```
*
* You can also initialize the control with a form state object on instantiation,
* which includes both the value and whether or not the control is disabled.
* You can't use the value key without the disabled key; both are required
* to use this way of initialization.
*
* ```ts
* const ctrl = new FormControl({value: 'n/a', disabled: true});
* console.log(ctrl.value); // 'n/a'
* console.log(ctrl.status); // 'DISABLED'
* ```
*
* To include a sync validator (or an array of sync validators) with the control,
* pass it in as the second argument. Async validators are also supported, but
* have to be passed in separately as the third arg.
*
* ```ts
* const ctrl = new FormControl('', Validators.required);
* console.log(ctrl.value); // ''
* console.log(ctrl.status); // 'INVALID'
* ```
*
* See its superclass, {@link AbstractControl}, for more properties and methods.
*
* * **npm package**: `@angular/forms`
*
* @stable
*/
export class FormControl extends AbstractControl {
/** @internal */
_onChange: Function[] = [];
constructor(
formState: any = null, validator: ValidatorFn|ValidatorFn[] = null,
asyncValidator: AsyncValidatorFn|AsyncValidatorFn[] = null) {
super(coerceToValidator(validator), coerceToAsyncValidator(asyncValidator));
this._applyFormState(formState);
this.updateValueAndValidity({onlySelf: true, emitEvent: false});
this._initObservables();
}
/**
* Set the value of the form control to `value`.
*
* If `onlySelf` is `true`, this change will only affect the validation of this `FormControl`
* and not its parent component. This defaults to false.
*
* If `emitEvent` is `true`, this
* change will cause a `valueChanges` event on the `FormControl` to be emitted. This defaults
* to true (as it falls through to `updateValueAndValidity`).
*
* If `emitModelToViewChange` is `true`, the view will be notified about the new value
* via an `onChange` event. This is the default behavior if `emitModelToViewChange` is not
* specified.
*
* If `emitViewToModelChange` is `true`, an ngModelChange event will be fired to update the
* model. This is the default behavior if `emitViewToModelChange` is not specified.
*/
setValue(value: any, {onlySelf, emitEvent, emitModelToViewChange, emitViewToModelChange}: {
onlySelf?: boolean,
emitEvent?: boolean,
emitModelToViewChange?: boolean,
emitViewToModelChange?: boolean
} = {}): void {
this._value = value;
if (this._onChange.length && emitModelToViewChange !== false) {
this._onChange.forEach((changeFn) => changeFn(this._value, emitViewToModelChange !== false));
}
this.updateValueAndValidity({onlySelf, emitEvent});
}
/**
* Patches the value of a control.
*
* This function is functionally the same as {@link FormControl.setValue} at this level.
* It exists for symmetry with {@link FormGroup.patchValue} on `FormGroups` and `FormArrays`,
* where it does behave differently.
*/
patchValue(value: any, options: {
onlySelf?: boolean,
emitEvent?: boolean,
emitModelToViewChange?: boolean,
emitViewToModelChange?: boolean
} = {}): void {
this.setValue(value, options);
}
/**
* Resets the form control. This means by default:
*
* * it is marked as `pristine`
* * it is marked as `untouched`
* * value is set to null
*
* You can also reset to a specific form state by passing through a standalone
* value or a form state object that contains both a value and a disabled state
* (these are the only two properties that cannot be calculated).
*
* Ex:
*
* ```ts
* this.control.reset('Nancy');
*
* console.log(this.control.value); // 'Nancy'
* ```
*
* OR
*
* ```
* this.control.reset({value: 'Nancy', disabled: true});
*
* console.log(this.control.value); // 'Nancy'
* console.log(this.control.status); // 'DISABLED'
* ```
*/
reset(formState: any = null, {onlySelf, emitEvent}: {onlySelf?: boolean,
emitEvent?: boolean} = {}): void {
this._applyFormState(formState);
this.markAsPristine({onlySelf});
this.markAsUntouched({onlySelf});
this.setValue(this._value, {onlySelf, emitEvent});
}
/**
* @internal
*/
_updateValue() {}
/**
* @internal
*/
_anyControls(condition: Function): boolean { return false; }
/**
* @internal
*/
_allControlsDisabled(): boolean { return this.disabled; }
/**
* Register a listener for change events.
*/
registerOnChange(fn: Function): void { this._onChange.push(fn); }
/**
* @internal
*/
_clearChangeFns(): void {
this._onChange = [];
this._onDisabledChange = [];
this._onCollectionChange = () => {};
}
/**
* Register a listener for disabled events.
*/
registerOnDisabledChange(fn: (isDisabled: boolean) => void): void {
this._onDisabledChange.push(fn);
}
/**
* @internal
*/
_forEachChild(cb: Function): void {}
private _applyFormState(formState: any) {
if (this._isBoxedValue(formState)) {
this._value = formState.value;
formState.disabled ? this.disable({onlySelf: true, emitEvent: false}) :
this.enable({onlySelf: true, emitEvent: false});
} else {
this._value = formState;
}
}
}
/**
* @whatItDoes Tracks the value and validity state of a group of {@link FormControl}
* instances.
*
* A `FormGroup` aggregates the values of each child {@link FormControl} into one object,
* with each control name as the key. It calculates its status by reducing the statuses
* of its children. For example, if one of the controls in a group is invalid, the entire
* group becomes invalid.
*
* `FormGroup` is one of the three fundamental building blocks used to define forms in Angular,
* along with {@link FormControl} and {@link FormArray}.
*
* @howToUse
*
* When instantiating a {@link FormGroup}, pass in a collection of child controls as the first
* argument. The key for each child will be the name under which it is registered.
*
* ### Example
*
* ```
* const form = new FormGroup({
* first: new FormControl('Nancy', Validators.minLength(2)),
* last: new FormControl('Drew'),
* });
*
* console.log(form.value); // {first: 'Nancy', last; 'Drew'}
* console.log(form.status); // 'VALID'
* ```
*
* You can also include group-level validators as the second arg, or group-level async
* validators as the third arg. These come in handy when you want to perform validation
* that considers the value of more than one child control.
*
* ### Example
*
* ```
* const form = new FormGroup({
* password: new FormControl('', Validators.minLength(2)),
* passwordConfirm: new FormControl('', Validators.minLength(2)),
* }, passwordMatchValidator);
*
*
* function passwordMatchValidator(g: FormGroup) {
* return g.get('password').value === g.get('passwordConfirm').value
* ? null : {'mismatch': true};
* }
* ```
*
* * **npm package**: `@angular/forms`
*
* @stable
*/
export class FormGroup extends AbstractControl {
constructor(
public controls: {[key: string]: AbstractControl}, validator: ValidatorFn = null,
asyncValidator: AsyncValidatorFn = null) {
super(validator, asyncValidator);
this._initObservables();
this._setUpControls();
this.updateValueAndValidity({onlySelf: true, emitEvent: false});
}
/**
* Registers a control with the group's list of controls.
*
* This method does not update value or validity of the control, so for
* most cases you'll want to use {@link FormGroup.addControl} instead.
*/
registerControl(name: string, control: AbstractControl): AbstractControl {
if (this.controls[name]) return this.controls[name];
this.controls[name] = control;
control.setParent(this);
control._registerOnCollectionChange(this._onCollectionChange);
return control;
}
/**
* Add a control to this group.
*/
addControl(name: string, control: AbstractControl): void {
this.registerControl(name, control);
this.updateValueAndValidity();
this._onCollectionChange();
}
/**
* Remove a control from this group.
*/
removeControl(name: string): void {
if (this.controls[name]) this.controls[name]._registerOnCollectionChange(() => {});
delete (this.controls[name]);
this.updateValueAndValidity();
this._onCollectionChange();
}
/**
* Replace an existing control.
*/
setControl(name: string, control: AbstractControl): void {
if (this.controls[name]) this.controls[name]._registerOnCollectionChange(() => {});
delete (this.controls[name]);
if (control) this.registerControl(name, control);
this.updateValueAndValidity();
this._onCollectionChange();
}
/**
* Check whether there is an enabled control with the given name in the group.
*
* It will return false for disabled controls. If you'd like to check for
* existence in the group only, use {@link AbstractControl.get} instead.
*/
contains(controlName: string): boolean {
return this.controls.hasOwnProperty(controlName) && this.controls[controlName].enabled;
}
/**
* Sets the value of the {@link FormGroup}. It accepts an object that matches
* the structure of the group, with control names as keys.
*
* This method performs strict checks, so it will throw an error if you try
* to set the value of a control that doesn't exist or if you exclude the
* value of a control.
*
* ### Example
*
* ```
* const form = new FormGroup({
* first: new FormControl(),
* last: new FormControl()
* });
* console.log(form.value); // {first: null, last: null}
*
* form.setValue({first: 'Nancy', last: 'Drew'});
* console.log(form.value); // {first: 'Nancy', last: 'Drew'}
*
* ```
*/
setValue(
value: {[key: string]: any},
{onlySelf, emitEvent}: {onlySelf?: boolean, emitEvent?: boolean} = {}): void {
this._checkAllValuesPresent(value);
Object.keys(value).forEach(name => {
this._throwIfControlMissing(name);
this.controls[name].setValue(value[name], {onlySelf: true, emitEvent});
});
this.updateValueAndValidity({onlySelf, emitEvent});
}
/**
* Patches the value of the {@link FormGroup}. It accepts an object with control
* names as keys, and will do its best to match the values to the correct controls
* in the group.
*
* It accepts both super-sets and sub-sets of the group without throwing an error.
*
* ### Example
*
* ```
* const form = new FormGroup({
* first: new FormControl(),
* last: new FormControl()
* });
* console.log(form.value); // {first: null, last: null}
*
* form.patchValue({first: 'Nancy'});
* console.log(form.value); // {first: 'Nancy', last: null}
*
* ```
*/
patchValue(
value: {[key: string]: any},
{onlySelf, emitEvent}: {onlySelf?: boolean, emitEvent?: boolean} = {}): void {
Object.keys(value).forEach(name => {
if (this.controls[name]) {
this.controls[name].patchValue(value[name], {onlySelf: true, emitEvent});
}
});
this.updateValueAndValidity({onlySelf, emitEvent});
}
/**
* Resets the {@link FormGroup}. This means by default:
*
* * The group and all descendants are marked `pristine`
* * The group and all descendants are marked `untouched`
* * The value of all descendants will be null or null maps
*
* You can also reset to a specific form state by passing in a map of states
* that matches the structure of your form, with control names as keys. The state
* can be a standalone value or a form state object with both a value and a disabled
* status.
*
* ### Example
*
* ```ts
* this.form.reset({first: 'name', last: 'last name'});
*
* console.log(this.form.value); // {first: 'name', last: 'last name'}
* ```
*
* - OR -
*
* ```
* this.form.reset({
* first: {value: 'name', disabled: true},
* last: 'last'
* });
*
* console.log(this.form.value); // {first: 'name', last: 'last name'}
* console.log(this.form.get('first').status); // 'DISABLED'
* ```
*/
reset(value: any = {}, {onlySelf, emitEvent}: {onlySelf?: boolean, emitEvent?: boolean} = {}):
void {
this._forEachChild((control: AbstractControl, name: string) => {
control.reset(value[name], {onlySelf: true, emitEvent});
});
this.updateValueAndValidity({onlySelf, emitEvent});
this._updatePristine({onlySelf});
this._updateTouched({onlySelf});
}
/**
* The aggregate value of the {@link FormGroup}, including any disabled controls.
*
* If you'd like to include all values regardless of disabled status, use this method.
* Otherwise, the `value` property is the best way to get the value of the group.
*/
getRawValue(): any {
return this._reduceChildren(
{}, (acc: {[k: string]: AbstractControl}, control: AbstractControl, name: string) => {
acc[name] = control.value;
return acc;
});
}
/** @internal */
_throwIfControlMissing(name: string): void {
if (!Object.keys(this.controls).length) {
throw new Error(`
There are no form controls registered with this group yet. If you're using ngModel,
you may want to check next tick (e.g. use setTimeout).
`);
}
if (!this.controls[name]) {
throw new Error(`Cannot find form control with name: ${name}.`);
}
}
/** @internal */
_forEachChild(cb: (v: any, k: string) => void): void {
Object.keys(this.controls).forEach(k => cb(this.controls[k], k));
}
/** @internal */
_setUpControls(): void {
this._forEachChild((control: AbstractControl) => {
control.setParent(this);
control._registerOnCollectionChange(this._onCollectionChange);
});
}
/** @internal */
_updateValue(): void { this._value = this._reduceValue(); }
/** @internal */
_anyControls(condition: Function): boolean {
let res = false;
this._forEachChild((control: AbstractControl, name: string) => {
res = res || (this.contains(name) && condition(control));
});
return res;
}
/** @internal */
_reduceValue() {
return this._reduceChildren(
{}, (acc: {[k: string]: AbstractControl}, control: AbstractControl, name: string) => {
if (control.enabled || this.disabled) {
acc[name] = control.value;
}
return acc;
});
}
/** @internal */
_reduceChildren(initValue: any, fn: Function) {
let res = initValue;
this._forEachChild(
(control: AbstractControl, name: string) => { res = fn(res, control, name); });
return res;
}
/** @internal */
_allControlsDisabled(): boolean {
for (const controlName of Object.keys(this.controls)) {
if (this.controls[controlName].enabled) {
return false;
}
}
return Object.keys(this.controls).length > 0 || this.disabled;
}
/** @internal */
_checkAllValuesPresent(value: any): void {
this._forEachChild((control: AbstractControl, name: string) => {
if (value[name] === undefined) {
throw new Error(`Must supply a value for form control with name: '${name}'.`);
}
});
}
}
/**
* @whatItDoes Tracks the value and validity state of an array of {@link FormControl},
* {@link FormGroup} or {@link FormArray} instances.
*
* A `FormArray` aggregates the values of each child {@link FormControl} into an array.
* It calculates its status by reducing the statuses of its children. For example, if one of
* the controls in a `FormArray` is invalid, the entire array becomes invalid.
*
* `FormArray` is one of the three fundamental building blocks used to define forms in Angular,
* along with {@link FormControl} and {@link FormGroup}.
*
* @howToUse
*
* When instantiating a {@link FormArray}, pass in an array of child controls as the first
* argument.
*
* ### Example
*
* ```
* const arr = new FormArray([
* new FormControl('Nancy', Validators.minLength(2)),
* new FormControl('Drew'),
* ]);
*
* console.log(arr.value); // ['Nancy', 'Drew']
* console.log(arr.status); // 'VALID'
* ```
*
* You can also include array-level validators as the second arg, or array-level async
* validators as the third arg. These come in handy when you want to perform validation
* that considers the value of more than one child control.
*
* ### Adding or removing controls
*
* To change the controls in the array, use the `push`, `insert`, or `removeAt` methods
* in `FormArray` itself. These methods ensure the controls are properly tracked in the
* form's hierarchy. Do not modify the array of `AbstractControl`s used to instantiate
* the `FormArray` directly, as that will result in strange and unexpected behavior such
* as broken change detection.
*
* * **npm package**: `@angular/forms`
*
* @stable
*/
export class FormArray extends AbstractControl {
constructor(
public controls: AbstractControl[], validator: ValidatorFn = null,
asyncValidator: AsyncValidatorFn = null) {
super(validator, asyncValidator);
this._initObservables();
this._setUpControls();
this.updateValueAndValidity({onlySelf: true, emitEvent: false});
}
/**
* Get the {@link AbstractControl} at the given `index` in the array.
*/
at(index: number): AbstractControl { return this.controls[index]; }
/**
* Insert a new {@link AbstractControl} at the end of the array.
*/
push(control: AbstractControl): void {
this.controls.push(control);
this._registerControl(control);
this.updateValueAndValidity();
this._onCollectionChange();
}
/**
* Insert a new {@link AbstractControl} at the given `index` in the array.
*/
insert(index: number, control: AbstractControl): void {
this.controls.splice(index, 0, control);
this._registerControl(control);
this.updateValueAndValidity();
this._onCollectionChange();
}
/**
* Remove the control at the given `index` in the array.
*/
removeAt(index: number): void {
if (this.controls[index]) this.controls[index]._registerOnCollectionChange(() => {});
this.controls.splice(index, 1);
this.updateValueAndValidity();
this._onCollectionChange();
}
/**
* Replace an existing control.
*/
setControl(index: number, control: AbstractControl): void {
if (this.controls[index]) this.controls[index]._registerOnCollectionChange(() => {});
this.controls.splice(index, 1);
if (control) {
this.controls.splice(index, 0, control);
this._registerControl(control);
}
this.updateValueAndValidity();
this._onCollectionChange();
}
/**
* Length of the control array.
*/
get length(): number { return this.controls.length; }
/**
* Sets the value of the {@link FormArray}. It accepts an array that matches
* the structure of the control.
*
* This method performs strict checks, so it will throw an error if you try
* to set the value of a control that doesn't exist or if you exclude the
* value of a control.
*
* ### Example
*
* ```
* const arr = new FormArray([
* new FormControl(),
* new FormControl()
* ]);
* console.log(arr.value); // [null, null]
*
* arr.setValue(['Nancy', 'Drew']);
* console.log(arr.value); // ['Nancy', 'Drew']
* ```
*/
setValue(value: any[], {onlySelf, emitEvent}: {onlySelf?: boolean, emitEvent?: boolean} = {}):
void {
this._checkAllValuesPresent(value);
value.forEach((newValue: any, index: number) => {
this._throwIfControlMissing(index);
this.at(index).setValue(newValue, {onlySelf: true, emitEvent});
});
this.updateValueAndValidity({onlySelf, emitEvent});
}
/**
* Patches the value of the {@link FormArray}. It accepts an array that matches the
* structure of the control, and will do its best to match the values to the correct
* controls in the group.
*
* It accepts both super-sets and sub-sets of the array without throwing an error.
*
* ### Example
*
* ```
* const arr = new FormArray([
* new FormControl(),
* new FormControl()
* ]);
* console.log(arr.value); // [null, null]
*
* arr.patchValue(['Nancy']);
* console.log(arr.value); // ['Nancy', null]
* ```
*/
patchValue(value: any[], {onlySelf, emitEvent}: {onlySelf?: boolean, emitEvent?: boolean} = {}):
void {
value.forEach((newValue: any, index: number) => {
if (this.at(index)) {
this.at(index).patchValue(newValue, {onlySelf: true, emitEvent});
}
});
this.updateValueAndValidity({onlySelf, emitEvent});
}
/**
* Resets the {@link FormArray}. This means by default:
*
* * The array and all descendants are marked `pristine`
* * The array and all descendants are marked `untouched`
* * The value of all descendants will be null or null maps
*
* You can also reset to a specific form state by passing in an array of states
* that matches the structure of the control. The state can be a standalone value
* or a form state object with both a value and a disabled status.
*
* ### Example
*
* ```ts
* this.arr.reset(['name', 'last name']);
*
* console.log(this.arr.value); // ['name', 'last name']
* ```
*
* - OR -
*
* ```
* this.arr.reset([
* {value: 'name', disabled: true},
* 'last'
* ]);
*
* console.log(this.arr.value); // ['name', 'last name']
* console.log(this.arr.get(0).status); // 'DISABLED'
* ```
*/
reset(value: any = [], {onlySelf, emitEvent}: {onlySelf?: boolean, emitEvent?: boolean} = {}):
void {
this._forEachChild((control: AbstractControl, index: number) => {
control.reset(value[index], {onlySelf: true, emitEvent});
});
this.updateValueAndValidity({onlySelf, emitEvent});
this._updatePristine({onlySelf});
this._updateTouched({onlySelf});
}
/**
* The aggregate value of the array, including any disabled controls.
*
* If you'd like to include all values regardless of disabled status, use this method.
* Otherwise, the `value` property is the best way to get the value of the array.
*/
getRawValue(): any[] { return this.controls.map((control) => control.value); }
/** @internal */
_throwIfControlMissing(index: number): void {
if (!this.controls.length) {
throw new Error(`
There are no form controls registered with this array yet. If you're using ngModel,
you may want to check next tick (e.g. use setTimeout).
`);
}
if (!this.at(index)) {
throw new Error(`Cannot find form control at index ${index}`);
}
}
/** @internal */
_forEachChild(cb: Function): void {
this.controls.forEach((control: AbstractControl, index: number) => { cb(control, index); });
}
/** @internal */
_updateValue(): void {
this._value = this.controls.filter((control) => control.enabled || this.disabled)
.map((control) => control.value);
}
/** @internal */
_anyControls(condition: Function): boolean {
return this.controls.some((control: AbstractControl) => control.enabled && condition(control));
}
/** @internal */
_setUpControls(): void {
this._forEachChild((control: AbstractControl) => this._registerControl(control));
}
/** @internal */
_checkAllValuesPresent(value: any): void {
this._forEachChild((control: AbstractControl, i: number) => {
if (value[i] === undefined) {
throw new Error(`Must supply a value for form control at index: ${i}.`);
}
});
}
/** @internal */
_allControlsDisabled(): boolean {
for (const control of this.controls) {
if (control.enabled) return false;
}
return this.controls.length > 0 || this.disabled;
}
private _registerControl(control: AbstractControl) {
control.setParent(this);
control._registerOnCollectionChange(this._onCollectionChange);
}
}
|
not-for-me/angular
|
modules/@angular/forms/src/model.ts
|
TypeScript
|
mit
| 42,414
|
/**
* 所有组件的基类
*/
class BaseModule {
constructor() {
//this.__exp 接口引用,使用实例绑定上下文,不直接使用
//this.__exports 接口引用,未绑定上下文,不直接使用
//this.exports 提供设置和获取暴露接口的get、set,
}
get exports() {
return this.__exp;
}
set exports(exp_s) {
var context = this;
//用于编译时候的原始方法备份,防止编译出[native code]
var __exports = context.__exports = {};
var es = this.__exp = exp_s;
for(var exp in es){
if(es.hasOwnProperty(exp) && es[exp] instanceof Function){
__exports[exp] = es[exp];
es[exp] = es[exp].bind(context)
}
}
return context
}
//bindExports(context){
// //用于编译时候的原始方法备份,防止编译出[native code]
// var __exports = context.__exports = {};
// var es = context.exports
//
// for(var exp in es){
// if(es.hasOwnProperty(exp)){
// __exports[exp] = es[exp];
// es[exp] = es[exp].bind(context)
// }
// }
// return context
//}
//获取所有可编辑、配置的项,默认写法,可被重写
superFields() {
if(!this.element){
return undefined
}
//var param = this.element.param || {}
var $html;
if(this.configs instanceof Function){
$html = $(this.configs(this.element))
}else{
$html = $(this.configs)
}
//$html.find("[data-name]").each(function (i, n) {
// var $this = $(n)
// $this.val(param[$this.data("name")]);
//});
return $html;
}
fields(deferred, param) {
deferred.resolve(this.superFields())
}
config(key, value) {
var data = this.$dom.data("data")
if (arguments.length === 1) {
return data.param[key]
} else if (arguments.length > 1) {
return data.param[key] = value;
}
}
exec(code,api){
try{
var fun = new Function("api","" +
"var API = api;"
+code)
fun(api)
}catch(e){
console.log(e)
}
}
}
module.exports = BaseModule
|
Avtpas/PageCreator
|
src/modules/BaseModule.js
|
JavaScript
|
mit
| 2,393
|
/*
*
* Confidential Information of Telekinesys Research Limited (t/a Havok). Not for disclosure or distribution without Havok's
* prior written consent. This software contains code, techniques and know-how which is confidential and proprietary to Havok.
* Product and Trade Secret source code contains trade secrets of Havok. Havok Software (C) Copyright 1999-2014 Telekinesys Research Limited t/a Havok. All Rights Reserved. Use of this software is subject to the terms of an end user license agreement.
*
*/
#ifndef HKP_GEOMETRY_CONVERTER_H
#define HKP_GEOMETRY_CONVERTER_H
class hkpWorld;
class hkpRigidBody;
struct hkGeometry;
/// This utility class provides a set of methods useful for creating an hkGeometry from an existing physics integration
class hkpGeometryConverter
{
public:
/// Creates a geometry from a Havok physics world
static void HK_CALL createSingleGeometryFromWorld( const hkpWorld& world, hkGeometry& geomOut,
hkBool useFixedBodiesOnly = true, hkBool getMaterialFromUserData = true);
/// Creates a geometry from a single rigid body
static void HK_CALL appendGeometryFromRigidBody( const hkpRigidBody& body, hkGeometry& geomOut,
hkBool getMaterialFromUserData = true);
};
#endif // HKP_GEOMETRY_CONVERTER_H
/*
* Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20140907)
*
* Confidential Information of Havok. (C) Copyright 1999-2014
* Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok
* Logo, and the Havok buzzsaw logo are trademarks of Havok. Title, ownership
* rights, and intellectual property rights in the Havok software remain in
* Havok and/or its suppliers.
*
* Use of this software for evaluation purposes is subject to and indicates
* acceptance of the End User licence Agreement for this product. A copy of
* the license is included with this software and is also available at www.havok.com/tryhavok.
*
*/
|
wobbier/source3-engine
|
ThirdParty/Havok/include/Physics2012/Utilities/Geometry/hkpGeometryConverter.h
|
C
|
mit
| 1,904
|
/* globals __DEV__ */
import Phaser from 'phaser'
import Player from '../sprites/Player'
import Asteroid from '../sprites/Asteroid'
import Space from '../environment/Space'
import Bullet from '../sprites/Bullet'
import Pickup from '../sprites/Pickup'
import Overlay from '../UI/overlay'
import AsteroidDefinitions from '../definitions/asteroidDefinitions'
import LevelDefinitions from '../definitions/levelDefintions'
const ASTEROID_COUNT = 25;
const NO_FIRE_COOLDOWN = 400;
const INVULNERABLE_AFTER_DAMAGE_COOLDOWN = 2000;
const STARTING_BULLETS = 100;
const STARTING_TIMER = 5000;
export default class extends Phaser.State {
init() { }
preload() {
game.load.audio('bullet', 'assets/audio/SoundEffects/laser.wav');
game.load.audio('explosion', 'assets/audio/SoundEffects/explosion.wav');
game.load.audio('music', 'assets/audio/Music/Corruption.mp3');
game.load.audio('damage', 'assets/audio/SoundEffects/alarm.wav');
game.load.audio('noammo', 'assets/audio/SoundEffects/noammo.wav');
game.load.audio('death', 'assets/audio/SoundEffects/bigboom.wav');
game.load.audio('victory', 'assets/audio/SoundEffects/chime.wav');
game.load.audio('reload', 'assets/audio/SoundEffects/reload.mp3');
game.load.audio('powerup', 'assets/audio/SoundEffects/powerup.wav');
game.load.audio('powerdown', 'assets/audio/SoundEffects/powerdown.wav');
}
create() {
this.game.physics.startSystem(Phaser.Physics.ARCADE);
this.space = new Space(this);
this.player = new Player({
game: this,
x: this.world.centerX,
y: this.world.centerY,
asset: 'ship'
});
this.player.resetPosition();
this.game.add.existing(this.player);
this.fireCooldown = NO_FIRE_COOLDOWN;
this.playerScore = 0;
this.waveNumber = 0;
this.gameTimer = STARTING_TIMER;
this.inbetweenWave = false;
this.bullets = [];
this.asteroids = [];
this.pickups = [];
this.asteroidsGroup = this.game.add.group();
this.overlay = new Overlay({
game: this.game,
player: this.player,
wave: this.waveNumber
});
// Sound
this.sfxBullet = game.add.audio('bullet');
this.sfxExplosion = game.add.audio('explosion');
this.sfxDamage = game.add.audio('damage');
this.sfxNoAmmo = game.add.audio('noammo');
this.sfxDeath = game.add.audio('death');
this.sfxVictory = game.add.audio('victory');
this.sfxReload = game.add.audio('reload');
this.sfxPowerup = game.add.audio('powerup');
this.sfxPowerdown = game.add.audio('powerdown');
this.music = game.add.audio('music');
this.music.loopFull(1);
// particles
this.particleEmitter = game.add.emitter(0, 0, 300);
this.particleEmitter.makeParticles('asteroidParticle');
this.particleEmitter.minParticleSpeed.setTo(-100, -100);
this.particleEmitter.maxParticleSpeed.setTo(100, 100);
this.fireParticleEmitter = game.add.emitter(0, 0, 300);
this.fireParticleEmitter.makeParticles('fireParticle');
this.fireParticleEmitter.minParticleSpeed.setTo(0, 0);
this.fireParticleEmitter.maxParticleSpeed.setTo(0, 0);
}
update() {
this.game.physics.arcade.collide(this.asteroidsGroup);
this.overlay.update(this.waveNumber, this.gameTimer, this.inbetweenWave);
this.fireCooldown -= this.getDelta();
if (this.player.isAlive() && !this.inbetweenWave) {
this.gameTimer -= this.getDelta();
}
// if game time is out, destroy player
if (this.player.isAlive() && this.gameTimer <= 0) {
this.player.changeHealth(-999);
this.endGame();
}
this.space.update();
// damage player if they are hitting an asteroid
if (!this.player.isInvulnerable() && this.player.isCollidingWithAnyInArray(this.asteroids) && this.player.isAlive() > 0) {
this.player.changeHealth(-1);
if (!this.player.isAlive()) {
this.endGame();
} else if (this.player.isAlive()){
this.sfxDamage.play();
this.player.setInvulnerable(INVULNERABLE_AFTER_DAMAGE_COOLDOWN);
}
}
// assign pickup bonuses if player is close enough
for (var i = 0; i < this.pickups.length; i++) {
var pickup = this.pickups[i];
if (pickup.isCollidingWithEntity(this.player)) {
pickup.applyPowerup();
pickup.destroy();
this.pickups.splice(i, 1);
}
}
// clean up old bullets
for (var i = 0; i < this.bullets.length; i++) {
var b = this.bullets[i];
var destroyBullet = false;
b.update();
// damage or destroy and asteroids this bullet is in contact with
for (var j = 0; j < this.asteroids.length; j++) {
var asteroid = this.asteroids[j];
if (b.isCollidingWithEntity(asteroid)) {
destroyBullet = true;
asteroid.damage(b.getDamage());
this.sfxExplosion.play();
if (asteroid.hp <= 0) {
this.asteroids.splice(j, 1);
asteroid.destroy();
this.player.score += asteroid.getProfitValue();
}
}
}
// destroy any pickups this bullet is in contact with
for (var j = 0; j < this.pickups.length; j++) {
var pickup = this.pickups[j];
if (pickup.isCollidingWithEntity(b)) {
destroyBullet = true;
this.pickups.splice(j, 1);
pickup.destroy();
this.sfxPowerdown.play();
}
}
if (b.isOutOfBounds() || destroyBullet) {
this.bullets.splice(i, 1);
b.destroy();
}
}
if (this.waveComplete()) {
this.game.time.events.add(3000, function() {
this.startWave();
}, this);
}
}
spawnObject(type) {
var location = this.getRandomPositionNotNearPlayer();
var asteroid = new Asteroid({
game: this,
x: location.x,
y: location.y,
asset: 'asteroid',
type: type
});
this.asteroidsGroup.add(asteroid);
this.asteroids.push(asteroid);
}
spawnAsteroids() {
var levelDefinition = LevelDefinitions[this.waveNumber - 1].enemies;
for (var key in levelDefinition) {
for (var i = 0; i < levelDefinition[key]; i++) {
this.spawnObject(key);
}
}
this.asteroidsGroup.enableBody = true;
this.asteroidsGroup.physicsBodyType = Phaser.Physics.ARCADE;
this.asteroidsGroup.setAll('body.collideWorldBounds', true);
this.asteroidsGroup.setAll('body.bounce.x', 1);
this.asteroidsGroup.setAll('body.bounce.y', 1);
}
spawnPickup(type) {
var pickup = new Pickup({
game: this,
x: Math.random() * this.world.width,
y: Math.random() * this.world.height,
asset: type
});
game.add.existing(pickup);
this.pickups.push(pickup);
}
spawnPickups() {
var levelDefinition = LevelDefinitions[this.waveNumber - 1].pickups;
for (var key in levelDefinition) {
for (var i = 0; i < levelDefinition[key]; i++) {
this.spawnPickup(key);
}
}
}
addBullets() {
if (this.fireCooldown > 0) {
return;
} else if (this.player.bullets <= 0) {
this.sfxNoAmmo.play();
return;
} else {
this.fireCooldown = NO_FIRE_COOLDOWN;
this.player.useBullet();
this.sfxBullet.play();
}
var ammotype = "regular";
if (this.player.hasPowerup()) {
ammotype = "strong";
}
for (var i = 0; i < 4; i++) {
var bullet1 = new Bullet({
game: this,
x: this.player.x,
y: this.player.y,
asset: 'bullet',
type: ammotype
});
if (i===0) {
bullet1.velocity.x = .3;
} else if (i===1) {
bullet1.velocity.x = -.3;
} else if (i===2) {
bullet1.velocity.y = .3;
} else {
bullet1.velocity.y = -.3;
}
this.bullets.push(bullet1);
this.game.add.existing(bullet1);
}
}
waveComplete() {
if (this.inbetweenWave === false && this.asteroidsGroup.countLiving() === 0) {
this.inbetweenWave = true;
return true;
}
return false;
}
startWave(wave) {
this.inbetweenWave = false;
if (this.waveNumber > 0) {
this.sfxVictory.play();
}
this.waveNumber++;
this.gameTimer += 20000;
this.player.resetPosition();
this.player.setInvulnerable(INVULNERABLE_AFTER_DAMAGE_COOLDOWN*2);;
this.player.giveBullets(10);
this.spawnAsteroids();
for (var pickup of this.pickups) {
pickup.destroy();
}
this.pickups = [];
this.spawnPickups();
}
endGame() {
this.player.destroy();
this.sfxDeath.play();
}
getRandomPositionNotNearPlayer() {
var distance = 0;
var output = {x: 0, y: 0};
while (distance < 150) {
output.x = Math.random() * this.world.width;
output.y = Math.random() * this.world.height;
distance = Math.sqrt((output.x - this.player.x) * (output.x - this.player.x) +
(output.y - this.player.y) * (output.y - this.player.y));
}
return output;
}
render() {
if (__DEV__) {
//this.game.debug.spriteInfo(this.mushroom, 32, 32)
}
}
getDelta() {
return this.time.now - this.time.prevTime;
}
}
|
EthanPKlein/PhaserGame
|
src/states/Game.js
|
JavaScript
|
mit
| 9,158
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_09) on Wed Dec 12 23:07:28 EST 2012 -->
<title>javazoom.jl.player.advanced Class Hierarchy</title>
<meta name="date" content="2012-12-12">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="javazoom.jl.player.advanced Class Hierarchy";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li>Use</li>
<li class="navBarCell1Rev">Tree</li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../javazoom/jl/player/package-tree.html">Prev</a></li>
<li><a href="../../../../Storage/package-tree.html">Next</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?javazoom/jl/player/advanced/package-tree.html" target="_top">Frames</a></li>
<li><a href="package-tree.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 class="title">Hierarchy For Package javazoom.jl.player.advanced</h1>
<span class="strong">Package Hierarchies:</span>
<ul class="horizontal">
<li><a href="../../../../overview-tree.html">All Packages</a></li>
</ul>
</div>
<div class="contentContainer">
<h2 title="Class Hierarchy">Class Hierarchy</h2>
<ul>
<li type="circle">java.lang.Object
<ul>
<li type="circle">javazoom.jl.player.advanced.<a href="../../../../javazoom/jl/player/advanced/AdvancedPlayer.html" title="class in javazoom.jl.player.advanced"><span class="strong">AdvancedPlayer</span></a></li>
<li type="circle">javazoom.jl.player.advanced.<a href="../../../../javazoom/jl/player/advanced/jlap.html" title="class in javazoom.jl.player.advanced"><span class="strong">jlap</span></a></li>
<li type="circle">javazoom.jl.player.advanced.<a href="../../../../javazoom/jl/player/advanced/PlaybackEvent.html" title="class in javazoom.jl.player.advanced"><span class="strong">PlaybackEvent</span></a></li>
<li type="circle">javazoom.jl.player.advanced.<a href="../../../../javazoom/jl/player/advanced/PlaybackListener.html" title="class in javazoom.jl.player.advanced"><span class="strong">PlaybackListener</span></a>
<ul>
<li type="circle">javazoom.jl.player.advanced.<a href="../../../../javazoom/jl/player/advanced/jlap.InfoListener.html" title="class in javazoom.jl.player.advanced"><span class="strong">jlap.InfoListener</span></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li>Use</li>
<li class="navBarCell1Rev">Tree</li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../javazoom/jl/player/package-tree.html">Prev</a></li>
<li><a href="../../../../Storage/package-tree.html">Next</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?javazoom/jl/player/advanced/package-tree.html" target="_top">Frames</a></li>
<li><a href="package-tree.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
|
jakemmarsh/Comptune
|
doc/javazoom/jl/player/advanced/package-tree.html
|
HTML
|
mit
| 5,218
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery Mobile Docs - Sample form response</title>
<link rel="stylesheet" href="../../css/themes/default/jquery.mobile.css" />
<link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
<script src="../../js/jquery.js"></script>
<script src="../_assets/js/jqm-docs.js"></script>
<script src="../../js/"></script>
</head>
<body>
<div data-role="page" class="type-interior">
<div data-role="header" data-theme="e">
<h1>Sample form response</h1>
<a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse">Home</a>
<a href="../nav.html" data-icon="search" data-iconpos="notext" data-rel="dialog" data-transition="fade">Search</a>
</div><!-- /header -->
<div data-role="content" data-theme="c">
<div class="content-primary">
<form action="index.html" method="get">
<h2>You Chose:</h2>
<div class="ui-body ui-body-d ui-corner-all">
<p><?php echo isset( $_GET['shipping'] ) ? $_GET['shipping'] : ''; ?></p>
</div>
<a href="forms-sample.html" data-role="button" data-theme="b" data-icon="arrow-l">Change shipping method</a>
</form>
</div><!--/content-primary -->
<div class="content-secondary">
<div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
<h3>More in this section</h3>
<ul data-role="listview" data-theme="c" data-dividertheme="d">
<li data-role="list-divider">Form elements</li>
<li><a href="docs-forms.html">Form basics</a></li>
<li><a href="forms-all.html">Form element gallery</a></li>
<li><a href="textinputs/">Text inputs</a></li>
<li><a href="search/">Search inputs</a></li>
<li><a href="slider/">Slider</a></li>
<li><a href="switch/">Flip toggle switch</a></li>
<li><a href="radiobuttons/">Radio buttons</a></li>
<li><a href="checkboxes/">Checkboxes</a></li>
<li><a href="forms-selects.html">Select menus</a></li>
<li><a href="forms-themes.html">Theming forms</a></li>
<li><a href="forms-all-native.html">Native form elements</a></li>
<li data-theme="a"><a href="forms-sample.html">Submitting forms</a></li>
</ul>
</div>
</div>
</div><!-- /content -->
<div data-role="footer" class="footer-docs" data-theme="c">
<p class="jqm-version"></p>
<p>Copyright 2013 The jQuery Foundation</p>
</div>
</div><!-- /page -->
</body>
</html>
|
forresst/jquery-mobile-fr_FR
|
docs/forms/forms-sample-response.php
|
PHP
|
mit
| 2,523
|
<!-- HTML header for doxygen 1.8.10-->
<!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/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>SideCar: Logger::Configurator::InvalidCommand Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="DoxygenStyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SideCar
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Data Fields</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespaceLogger.html">Logger</a></li><li class="navelem"><a class="el" href="classLogger_1_1Configurator.html">Configurator</a></li><li class="navelem"><a class="el" href="structLogger_1_1Configurator_1_1InvalidCommand.html">InvalidCommand</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">Logger::Configurator::InvalidCommand Struct Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Exception thrown if command is not <code>writer</code> or <code>priority</code>.
<a href="structLogger_1_1Configurator_1_1InvalidCommand.html#details">More...</a></p>
<p><code>#include <<a class="el" href="Configurator_8h_source.html">/Users/howes/src/sidecar/Logger/Configurator.h</a>></code></p>
<div class="dynheader">
Inheritance diagram for Logger::Configurator::InvalidCommand:</div>
<div class="dyncontent">
<div class="center"><img src="structLogger_1_1Configurator_1_1InvalidCommand__inherit__graph.png" border="0" usemap="#Logger_1_1Configurator_1_1InvalidCommand_inherit__map" alt="Inheritance graph"/></div>
<map name="Logger_1_1Configurator_1_1InvalidCommand_inherit__map" id="Logger_1_1Configurator_1_1InvalidCommand_inherit__map">
<area shape="rect" id="node2" href="structLogger_1_1Configurator_1_1ConfiguratorException.html" title="Logger::Configurator\l::ConfiguratorException\l\< InvalidCommand \>" alt="" coords="132,297,290,364"/>
<area shape="rect" id="node3" href="structLogger_1_1LoggerException.html" title="Logger::LoggerException\l\< InvalidCommand \>" alt="" coords="127,199,295,249"/>
<area shape="rect" id="node4" href="classUtils_1_1Exception.html" title="Base exception class. " alt="" coords="76,112,189,142"/>
<area shape="rect" id="node5" title="STL class. " alt="" coords="5,15,108,45"/>
<area shape="rect" id="node6" href="structUtils_1_1ExceptionInserter.html" title="Utils::ExceptionInserter\l\< Exception \>" alt="" coords="132,5,288,54"/>
<area shape="rect" id="node7" href="structUtils_1_1ExceptionInserter.html" title="Utils::ExceptionInserter\l\< InvalidCommand \>" alt="" coords="213,102,369,151"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a330c6c757fb28e717abd3380830c38c7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a330c6c757fb28e717abd3380830c38c7"></a>
 </td><td class="memItemRight" valign="bottom"><b>InvalidCommand</b> (const std::string &cmd)</td></tr>
<tr class="separator:a330c6c757fb28e717abd3380830c38c7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_structLogger_1_1Configurator_1_1ConfiguratorException"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_structLogger_1_1Configurator_1_1ConfiguratorException')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="structLogger_1_1Configurator_1_1ConfiguratorException.html">Logger::Configurator::ConfiguratorException< InvalidCommand ></a></td></tr>
<tr class="memitem:a3606d8f0dfe8c4cd894e41e8acf4b56a inherit pub_methods_structLogger_1_1Configurator_1_1ConfiguratorException"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="structLogger_1_1Configurator_1_1ConfiguratorException.html#a3606d8f0dfe8c4cd894e41e8acf4b56a">ConfiguratorException</a> (const char *routine, const char *<a class="el" href="classUtils_1_1Exception.html#a2ff9c3a11769c0b66a18059e5caf3525">err</a>)</td></tr>
<tr class="memdesc:a3606d8f0dfe8c4cd894e41e8acf4b56a inherit pub_methods_structLogger_1_1Configurator_1_1ConfiguratorException"><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#a3606d8f0dfe8c4cd894e41e8acf4b56a">More...</a><br /></td></tr>
<tr class="separator:a3606d8f0dfe8c4cd894e41e8acf4b56a inherit pub_methods_structLogger_1_1Configurator_1_1ConfiguratorException"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3dad2f53e26bcaa72cdb49e4b970142f inherit pub_methods_structLogger_1_1Configurator_1_1ConfiguratorException"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="structLogger_1_1Configurator_1_1ConfiguratorException.html#a3dad2f53e26bcaa72cdb49e4b970142f">ConfiguratorException</a> (const char *routine, const char *<a class="el" href="classUtils_1_1Exception.html#a2ff9c3a11769c0b66a18059e5caf3525">err</a>, const <a class="el" href="classLogger_1_1Log.html">Log</a> &log)</td></tr>
<tr class="memdesc:a3dad2f53e26bcaa72cdb49e4b970142f inherit pub_methods_structLogger_1_1Configurator_1_1ConfiguratorException"><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#a3dad2f53e26bcaa72cdb49e4b970142f">More...</a><br /></td></tr>
<tr class="separator:a3dad2f53e26bcaa72cdb49e4b970142f inherit pub_methods_structLogger_1_1Configurator_1_1ConfiguratorException"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_structLogger_1_1LoggerException"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_structLogger_1_1LoggerException')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="structLogger_1_1LoggerException.html">Logger::LoggerException< InvalidCommand ></a></td></tr>
<tr class="memitem:a4ad4ab3f19ebb603cb788e704296a236 inherit pub_methods_structLogger_1_1LoggerException"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4ad4ab3f19ebb603cb788e704296a236"></a>
 </td><td class="memItemRight" valign="bottom"><b>LoggerException</b> (const char *module, const char *routine)</td></tr>
<tr class="separator:a4ad4ab3f19ebb603cb788e704296a236 inherit pub_methods_structLogger_1_1LoggerException"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_classUtils_1_1Exception"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classUtils_1_1Exception')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classUtils_1_1Exception.html">Utils::Exception</a></td></tr>
<tr class="memitem:a8bc6a88680d7acd3113963c462e99fb7 inherit pub_methods_classUtils_1_1Exception"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8bc6a88680d7acd3113963c462e99fb7"></a>
 </td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1Exception.html#a8bc6a88680d7acd3113963c462e99fb7">Exception</a> () throw ()</td></tr>
<tr class="memdesc:a8bc6a88680d7acd3113963c462e99fb7 inherit pub_methods_classUtils_1_1Exception"><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <br /></td></tr>
<tr class="separator:a8bc6a88680d7acd3113963c462e99fb7 inherit pub_methods_classUtils_1_1Exception"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a36bc63ba686e042c2d7631a66260fb95 inherit pub_methods_classUtils_1_1Exception"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1Exception.html#a36bc63ba686e042c2d7631a66260fb95">Exception</a> (const char *<a class="el" href="classUtils_1_1Exception.html#a2ff9c3a11769c0b66a18059e5caf3525">err</a>) throw (std::invalid_argument)</td></tr>
<tr class="memdesc:a36bc63ba686e042c2d7631a66260fb95 inherit pub_methods_classUtils_1_1Exception"><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#a36bc63ba686e042c2d7631a66260fb95">More...</a><br /></td></tr>
<tr class="separator:a36bc63ba686e042c2d7631a66260fb95 inherit pub_methods_classUtils_1_1Exception"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a15536202123f4aa09a16e9621247295f inherit pub_methods_classUtils_1_1Exception"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1Exception.html#a15536202123f4aa09a16e9621247295f">Exception</a> (const std::string &<a class="el" href="classUtils_1_1Exception.html#a2ff9c3a11769c0b66a18059e5caf3525">err</a>) throw ()</td></tr>
<tr class="memdesc:a15536202123f4aa09a16e9621247295f inherit pub_methods_classUtils_1_1Exception"><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#a15536202123f4aa09a16e9621247295f">More...</a><br /></td></tr>
<tr class="separator:a15536202123f4aa09a16e9621247295f inherit pub_methods_classUtils_1_1Exception"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab43b47490399a3b0bca9cd88052aa810 inherit pub_methods_classUtils_1_1Exception"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1Exception.html#ab43b47490399a3b0bca9cd88052aa810">Exception</a> (const <a class="el" href="classUtils_1_1Exception.html">Exception</a> &rhs) throw ()</td></tr>
<tr class="memdesc:ab43b47490399a3b0bca9cd88052aa810 inherit pub_methods_classUtils_1_1Exception"><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor. <a href="#ab43b47490399a3b0bca9cd88052aa810">More...</a><br /></td></tr>
<tr class="separator:ab43b47490399a3b0bca9cd88052aa810 inherit pub_methods_classUtils_1_1Exception"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6b214cd8627d0968bdeebc1fbb9556b8 inherit pub_methods_classUtils_1_1Exception"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1Exception.html#a6b214cd8627d0968bdeebc1fbb9556b8">~Exception</a> () throw ()</td></tr>
<tr class="memdesc:a6b214cd8627d0968bdeebc1fbb9556b8 inherit pub_methods_classUtils_1_1Exception"><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#a6b214cd8627d0968bdeebc1fbb9556b8">More...</a><br /></td></tr>
<tr class="separator:a6b214cd8627d0968bdeebc1fbb9556b8 inherit pub_methods_classUtils_1_1Exception"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab4b3f4b0121fc685f51a96c25e9b2bcd inherit pub_methods_classUtils_1_1Exception"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classUtils_1_1Exception.html">Exception</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1Exception.html#ab4b3f4b0121fc685f51a96c25e9b2bcd">operator=</a> (const <a class="el" href="classUtils_1_1Exception.html">Exception</a> &rhs) throw ()</td></tr>
<tr class="memdesc:ab4b3f4b0121fc685f51a96c25e9b2bcd inherit pub_methods_classUtils_1_1Exception"><td class="mdescLeft"> </td><td class="mdescRight">Assignment operator. <a href="#ab4b3f4b0121fc685f51a96c25e9b2bcd">More...</a><br /></td></tr>
<tr class="separator:ab4b3f4b0121fc685f51a96c25e9b2bcd inherit pub_methods_classUtils_1_1Exception"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2ff9c3a11769c0b66a18059e5caf3525 inherit pub_methods_classUtils_1_1Exception"><td class="memItemLeft" align="right" valign="top">const std::string & </td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1Exception.html#a2ff9c3a11769c0b66a18059e5caf3525">err</a> () const throw ()</td></tr>
<tr class="memdesc:a2ff9c3a11769c0b66a18059e5caf3525 inherit pub_methods_classUtils_1_1Exception"><td class="mdescLeft"> </td><td class="mdescRight">Accessor for the error text of the exception. <a href="#a2ff9c3a11769c0b66a18059e5caf3525">More...</a><br /></td></tr>
<tr class="separator:a2ff9c3a11769c0b66a18059e5caf3525 inherit pub_methods_classUtils_1_1Exception"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a380f0477d9ef319911e7a8167bd47f1f inherit pub_methods_classUtils_1_1Exception"><td class="memItemLeft" align="right" valign="top">virtual const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classUtils_1_1Exception.html#a380f0477d9ef319911e7a8167bd47f1f">what</a> () const throw ()</td></tr>
<tr class="memdesc:a380f0477d9ef319911e7a8167bd47f1f inherit pub_methods_classUtils_1_1Exception"><td class="mdescLeft"> </td><td class="mdescRight">Override of std::exception method. <a href="#a380f0477d9ef319911e7a8167bd47f1f">More...</a><br /></td></tr>
<tr class="separator:a380f0477d9ef319911e7a8167bd47f1f inherit pub_methods_classUtils_1_1Exception"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aad177442fd0bfcbebc6af1d71f6de04c inherit pub_methods_classUtils_1_1Exception"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
<tr class="memitem:aad177442fd0bfcbebc6af1d71f6de04c inherit pub_methods_classUtils_1_1Exception"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classUtils_1_1Exception.html#aad177442fd0bfcbebc6af1d71f6de04c">append</a> (const T &value)</td></tr>
<tr class="memdesc:aad177442fd0bfcbebc6af1d71f6de04c inherit pub_methods_classUtils_1_1Exception"><td class="mdescLeft"> </td><td class="mdescRight">Append a value to the exception text. <a href="#aad177442fd0bfcbebc6af1d71f6de04c">More...</a><br /></td></tr>
<tr class="separator:aad177442fd0bfcbebc6af1d71f6de04c inherit pub_methods_classUtils_1_1Exception"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Exception thrown if command is not <code>writer</code> or <code>priority</code>. </p>
<p>Definition at line <a class="el" href="Configurator_8h_source.html#l00143">143</a> of file <a class="el" href="Configurator_8h_source.html">Configurator.h</a>.</p>
</div><hr/>The documentation for this struct was generated from the following files:<ul>
<li>/Users/howes/src/sidecar/Logger/<a class="el" href="Configurator_8h_source.html">Configurator.h</a></li>
<li>/Users/howes/src/sidecar/Logger/<a class="el" href="Configurator_8cc_source.html">Configurator.cc</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
|
bradhowes/sidecar
|
docs/structLogger_1_1Configurator_1_1InvalidCommand.html
|
HTML
|
mit
| 16,751
|
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
{% include head.html %}
</head>
<body>
<div class="site"></div>
{% include hero.html %}
{% include nav.html %}
{{ content }}
{% include footer.html %}
{% include scripts.html %}
</body>
</html>
|
caleorourke/unveil
|
_layouts/default.html
|
HTML
|
mit
| 286
|
var vows = require('vows'),
assert = require('assert');
var Generateur = require('./generateur.js');
vows.describe('Générateur')
.addBatch({
'A name - ': {
topic: new (Generateur),
'when is generated': {
topic: function (generateur) {
params = {};
return generateur.getName(params);
},
'it should have a name': function (result) {
assert.ok(result.name);
},
'it should have a valid name': function (result) {
assert.equal(typeof(result.name), 'string')
},
'it should have a gender': function (result) {
assert.ok(result.gender);
},
'it should have a param "funny" set to false': function (result) {
assert.equal(result.funny, false);
}
}
}
})
.addBatch({
'A funny name - ': {
topic: new (Generateur),
'when is generated': {
topic: function (generateur) {
params = {
funny: "true"
};
return generateur.getName(params);
},
'it should have a valid name': function (result) {
assert.equal(typeof(result.name), 'string')
},
'it should have a gender': function (result) {
assert.ok(result.gender);
},
'it should have a param "funny" set to true': function (result) {
assert.equal(result.funny, true);
}
}
}
})
.addBatch({
'A not funny name - ': {
topic: new (Generateur),
'when generated': {
topic: function (generateur) {
params = {
funny: "false"
};
return generateur.getName(params);
},
'it should have a valid name': function (result) {
assert.equal(typeof(result.name), 'string')
},
'it should have a gender': function (result) {
assert.ok(result.gender);
},
'it should have a param "funny" set to false': function (result) {
assert.equal(result.funny, false);
}
}
}
})
.addBatch({
'A male name - ': {
topic: new (Generateur),
'when generated': {
topic: function (generateur) {
params = {
gender: "M"
};
return generateur.getName(params);
},
'it should have a valid name': function (result) {
assert.equal(typeof(result.name), 'string')
},
'it should have a gender': function (result) {
assert.ok(result.gender);
},
'it should have a male gender': function (result) {
assert.equal(result.gender, "M");
},
'it should have a param "funny" set to false': function (result) {
assert.equal(result.funny, false);
}
}
}
})
.addBatch({
'A female name - ': {
topic: new (Generateur),
'when generated': {
topic: function (generateur) {
params = {
gender: "F"
};
return generateur.getName(params);
},
'it should have a valid name': function (result) {
assert.equal(typeof(result.name), 'string')
},
'it should have a gender': function (result) {
assert.ok(result.gender);
},
'it should have a female gender': function (result) {
assert.equal(result.gender, "F");
},
'it should have a param "funny" set to false': function (result) {
assert.equal(result.funny, false);
}
}
}
})
.addBatch({
'A funny female name - ': {
topic: new (Generateur),
'when generated': {
topic: function (generateur) {
params = {
gender: "F",
funny: "true"
};
return generateur.getName(params);
},
'it should have a valid name': function (result) {
assert.equal(typeof(result.name), 'string')
},
'it should have a gender': function (result) {
assert.ok(result.gender);
},
'it should have a female gender': function (result) {
assert.equal(result.gender, "F");
},
'it should have a param "funny" set to false': function (result) {
assert.equal(result.funny, true);
}
}
}
})
.addBatch({
'A funny male name - ': {
topic: new (Generateur),
'when generated': {
topic: function (generateur) {
params = {
gender: "M",
funny: "true"
};
return generateur.getName(params);
},
'it should have a valid name': function (result) {
assert.equal(typeof(result.name), 'string')
},
'it should have a gender': function (result) {
assert.ok(result.gender);
},
'it should have a male gender': function (result) {
assert.equal(result.gender, "M");
},
'it should have a param "funny" set to false': function (result) {
assert.equal(result.funny, true);
}
}
}
})
.addBatch({
'A not funny female name - ': {
topic: new (Generateur),
'when generated': {
topic: function (generateur) {
params = {
gender: "F",
funny: "false"
};
return generateur.getName(params);
},
'it should have a valid name': function (result) {
assert.equal(typeof(result.name), 'string')
},
'it should have a gender': function (result) {
assert.ok(result.gender);
},
'it should have a female gender': function (result) {
assert.equal(result.gender, "F");
},
'it should have a param "funny" set to false': function (result) {
assert.equal(result.funny, false);
}
}
}
})
.addBatch({
'A not funny male name - ': {
topic: new (Generateur),
'when generated': {
topic: function (generateur) {
params = {
gender: "M",
funny: "false"
};
return generateur.getName(params);
},
'it should have a valid name': function (result) {
assert.equal(typeof(result.name), 'string')
},
'it should have a gender': function (result) {
assert.ok(result.gender);
},
'it should have a male gender': function (result) {
assert.equal(result.gender, "M");
},
'it should have a param "funny" set to false': function (result) {
assert.equal(result.funny, false);
}
}
}
})
.export(module);
|
Toam/generateurNoms
|
test.js
|
JavaScript
|
mit
| 6,675
|
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var _jestDiff = require('jest-diff');
var _jestDiff2 = _interopRequireDefault(_jestDiff);
var _jestGetType = require('jest-get-type');
var _jestGetType2 = _interopRequireDefault(_jestGetType);
var _jestRegexUtil = require('jest-regex-util');
var _jestMatcherUtils = require('jest-matcher-utils');
var _utils = require('./utils');
var _jasmine_utils = require('./jasmine_utils');
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
const matchers = {
toBe: function(received, expected) {
const comment = 'Object.is equality';
const pass = Object.is(received, expected);
const message = pass
? () =>
(0, _jestMatcherUtils.matcherHint)('.toBe', undefined, undefined, {
comment: comment,
isNot: true
}) +
'\n\n' +
`Expected: ${(0, _jestMatcherUtils.printExpected)(expected)}\n` +
`Received: ${(0, _jestMatcherUtils.printReceived)(received)}`
: () => {
const suggestToEqual =
(0, _jestGetType2.default)(received) ===
(0, _jestGetType2.default)(expected) &&
((0, _jestGetType2.default)(received) === 'object' ||
(0, _jestGetType2.default)(expected) === 'array') &&
(0, _jasmine_utils.equals)(received, expected, [
_utils.iterableEquality
]);
const oneline = (0, _utils.isOneline)(expected, received);
const diffString = (0, _jestDiff2.default)(expected, received, {
expand: this.expand
});
return (
(0, _jestMatcherUtils.matcherHint)('.toBe', undefined, undefined, {
comment: comment,
isNot: false
}) +
'\n\n' +
`Expected: ${(0, _jestMatcherUtils.printExpected)(expected)}\n` +
`Received: ${(0, _jestMatcherUtils.printReceived)(received)}` +
(diffString && !oneline ? `\n\nDifference:\n\n${diffString}` : '') +
(suggestToEqual ? ` ${_jestMatcherUtils.SUGGEST_TO_EQUAL}` : '')
);
};
// Passing the the actual and expected objects so that a custom reporter
// could access them, for example in order to display a custom visual diff,
// or create a different error message
return {
actual: received,
expected: expected,
message: message,
name: 'toBe',
pass: pass
};
},
toBeCloseTo: function(actual, expected) {
let precision =
arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
const secondArgument = arguments.length === 3 ? 'precision' : null;
(0, _jestMatcherUtils.ensureNumbers)(actual, expected, '.toBeCloseTo');
const pass = Math.abs(expected - actual) < Math.pow(10, -precision) / 2;
const message = () =>
(0, _jestMatcherUtils.matcherHint)('.toBeCloseTo', undefined, undefined, {
isNot: this.isNot,
secondArgument: secondArgument
}) +
'\n\n' +
`Precision: ${(0, _jestMatcherUtils.printExpected)(precision)}-digit\n` +
`Expected: ${(0, _jestMatcherUtils.printExpected)(expected)}\n` +
`Received: ${(0, _jestMatcherUtils.printReceived)(actual)}`;
return {message: message, pass: pass};
},
toBeDefined: function(actual, expected) {
(0, _jestMatcherUtils.ensureNoExpected)(expected, '.toBeDefined');
const pass = actual !== void 0;
const message = () =>
(0, _jestMatcherUtils.matcherHint)('.toBeDefined', 'received', '', {
isNot: this.isNot
}) +
'\n\n' +
`Received: ${(0, _jestMatcherUtils.printReceived)(actual)}`;
return {message: message, pass: pass};
},
toBeFalsy: function(actual, expected) {
(0, _jestMatcherUtils.ensureNoExpected)(expected, '.toBeFalsy');
const pass = !actual;
const message = () =>
(0, _jestMatcherUtils.matcherHint)('.toBeFalsy', 'received', '', {
isNot: this.isNot
}) +
'\n\n' +
`Received: ${(0, _jestMatcherUtils.printReceived)(actual)}`;
return {message: message, pass: pass};
},
toBeGreaterThan: function(actual, expected) {
(0, _jestMatcherUtils.ensureNumbers)(actual, expected, '.toBeGreaterThan');
const pass = actual > expected;
const message = () =>
(0, _jestMatcherUtils.matcherHint)(
'.toBeGreaterThan',
undefined,
undefined,
{
isNot: this.isNot
}
) +
'\n\n' +
`Expected: ${(0, _jestMatcherUtils.printExpected)(expected)}\n` +
`Received: ${(0, _jestMatcherUtils.printReceived)(actual)}`;
return {message: message, pass: pass};
},
toBeGreaterThanOrEqual: function(actual, expected) {
(0, _jestMatcherUtils.ensureNumbers)(
actual,
expected,
'.toBeGreaterThanOrEqual'
);
const pass = actual >= expected;
const message = () =>
(0, _jestMatcherUtils.matcherHint)(
'.toBeGreaterThanOrEqual',
undefined,
undefined,
{
isNot: this.isNot
}
) +
'\n\n' +
`Expected: ${(0, _jestMatcherUtils.printExpected)(expected)}\n` +
`Received: ${(0, _jestMatcherUtils.printReceived)(actual)}`;
return {message: message, pass: pass};
},
toBeInstanceOf: function(received, constructor) {
const constType = (0, _jestGetType2.default)(constructor);
if (constType !== 'function') {
throw new Error(
(0, _jestMatcherUtils.matcherHint)(
'.toBeInstanceOf',
'value',
'constructor',
{
isNot: this.isNot
}
) +
`\n\n` +
`Expected constructor to be a function. Instead got:\n` +
` ${(0, _jestMatcherUtils.printExpected)(constType)}`
);
}
const pass = received instanceof constructor;
const message = pass
? () =>
(0, _jestMatcherUtils.matcherHint)(
'.toBeInstanceOf',
'value',
'constructor',
{
isNot: this.isNot
}
) +
'\n\n' +
`Expected constructor: ${(0, _jestMatcherUtils.EXPECTED_COLOR)(
constructor.name || String(constructor)
)}\n` +
`Received value: ${(0, _jestMatcherUtils.printReceived)(received)}`
: () =>
(0, _jestMatcherUtils.matcherHint)(
'.toBeInstanceOf',
'value',
'constructor',
{
isNot: this.isNot
}
) +
'\n\n' +
`Expected constructor: ${(0, _jestMatcherUtils.EXPECTED_COLOR)(
constructor.name || String(constructor)
)}\n` +
`Received constructor: ${(0, _jestMatcherUtils.RECEIVED_COLOR)(
received.constructor && received.constructor.name
)}\n` +
`Received value: ${(0, _jestMatcherUtils.printReceived)(received)}`;
return {message: message, pass: pass};
},
toBeLessThan: function(actual, expected) {
(0, _jestMatcherUtils.ensureNumbers)(actual, expected, '.toBeLessThan');
const pass = actual < expected;
const message = () =>
(0, _jestMatcherUtils.matcherHint)(
'.toBeLessThan',
undefined,
undefined,
{
isNot: this.isNot
}
) +
'\n\n' +
`Expected: ${(0, _jestMatcherUtils.printExpected)(expected)}\n` +
`Received: ${(0, _jestMatcherUtils.printReceived)(actual)}`;
return {message: message, pass: pass};
},
toBeLessThanOrEqual: function(actual, expected) {
(0, _jestMatcherUtils.ensureNumbers)(
actual,
expected,
'.toBeLessThanOrEqual'
);
const pass = actual <= expected;
const message = () =>
(0, _jestMatcherUtils.matcherHint)(
'.toBeLessThanOrEqual',
undefined,
undefined,
{
isNot: this.isNot
}
) +
'\n\n' +
`Expected: ${(0, _jestMatcherUtils.printExpected)(expected)}\n` +
`Received: ${(0, _jestMatcherUtils.printReceived)(actual)}`;
return {message: message, pass: pass};
},
toBeNaN: function(actual, expected) {
(0, _jestMatcherUtils.ensureNoExpected)(expected, '.toBeNaN');
const pass = Number.isNaN(actual);
const message = () =>
(0, _jestMatcherUtils.matcherHint)('.toBeNaN', 'received', '', {
isNot: this.isNot
}) +
'\n\n' +
`Received: ${(0, _jestMatcherUtils.printReceived)(actual)}`;
return {message: message, pass: pass};
},
toBeNull: function(actual, expected) {
(0, _jestMatcherUtils.ensureNoExpected)(expected, '.toBeNull');
const pass = actual === null;
const message = () =>
(0, _jestMatcherUtils.matcherHint)('.toBeNull', 'received', '', {
isNot: this.isNot
}) +
'\n\n' +
`Received: ${(0, _jestMatcherUtils.printReceived)(actual)}`;
return {message: message, pass: pass};
},
toBeTruthy: function(actual, expected) {
(0, _jestMatcherUtils.ensureNoExpected)(expected, '.toBeTruthy');
const pass = !!actual;
const message = () =>
(0, _jestMatcherUtils.matcherHint)('.toBeTruthy', 'received', '', {
isNot: this.isNot
}) +
'\n\n' +
`Received: ${(0, _jestMatcherUtils.printReceived)(actual)}`;
return {message: message, pass: pass};
},
toBeUndefined: function(actual, expected) {
(0, _jestMatcherUtils.ensureNoExpected)(expected, '.toBeUndefined');
const pass = actual === void 0;
const message = () =>
(0, _jestMatcherUtils.matcherHint)('.toBeUndefined', 'received', '', {
isNot: this.isNot
}) +
'\n\n' +
`Received: ${(0, _jestMatcherUtils.printReceived)(actual)}`;
return {message: message, pass: pass};
},
toContain: function(collection, value) {
const collectionType = (0, _jestGetType2.default)(collection);
let converted = null;
if (Array.isArray(collection) || typeof collection === 'string') {
// strings have `indexOf` so we don't need to convert
// arrays have `indexOf` and we don't want to make a copy
converted = collection;
} else {
try {
converted = Array.from(collection);
} catch (e) {
throw new Error(
(0, _jestMatcherUtils.matcherHint)(
'[.not].toContainEqual',
'collection',
'value'
) +
'\n\n' +
`Expected ${(0, _jestMatcherUtils.RECEIVED_COLOR)(
'collection'
)} to be an array-like structure.\n` +
(0, _jestMatcherUtils.printWithType)(
'Received',
collection,
_jestMatcherUtils.printReceived
)
);
}
}
// At this point, we're either a string or an Array,
// which was converted from an array-like structure.
const pass = converted.indexOf(value) != -1;
const message = pass
? () =>
(0, _jestMatcherUtils.matcherHint)(
'.not.toContain',
collectionType,
'value'
) +
'\n\n' +
`Expected ${collectionType}:\n` +
` ${(0, _jestMatcherUtils.printReceived)(collection)}\n` +
`Not to contain value:\n` +
` ${(0, _jestMatcherUtils.printExpected)(value)}\n`
: () => {
const suggestToContainEqual =
converted !== null &&
typeof converted !== 'string' &&
converted instanceof Array &&
converted.findIndex(item =>
(0, _jasmine_utils.equals)(item, value, [_utils.iterableEquality])
) !== -1;
return (
(0, _jestMatcherUtils.matcherHint)(
'.toContain',
collectionType,
'value'
) +
'\n\n' +
`Expected ${collectionType}:\n` +
` ${(0, _jestMatcherUtils.printReceived)(collection)}\n` +
`To contain value:\n` +
` ${(0, _jestMatcherUtils.printExpected)(value)}` +
(suggestToContainEqual
? `\n\n${_jestMatcherUtils.SUGGEST_TO_CONTAIN_EQUAL}`
: '')
);
};
return {message: message, pass: pass};
},
toContainEqual: function(collection, value) {
const collectionType = (0, _jestGetType2.default)(collection);
let converted = null;
if (Array.isArray(collection)) {
converted = collection;
} else {
try {
converted = Array.from(collection);
} catch (e) {
throw new Error(
(0, _jestMatcherUtils.matcherHint)(
'[.not].toContainEqual',
'collection',
'value'
) +
'\n\n' +
`Expected ${(0, _jestMatcherUtils.RECEIVED_COLOR)(
'collection'
)} to be an array-like structure.\n` +
(0, _jestMatcherUtils.printWithType)(
'Received',
collection,
_jestMatcherUtils.printReceived
)
);
}
}
const pass =
converted.findIndex(item =>
(0, _jasmine_utils.equals)(item, value, [_utils.iterableEquality])
) !== -1;
const message = pass
? () =>
(0, _jestMatcherUtils.matcherHint)(
'.not.toContainEqual',
collectionType,
'value'
) +
'\n\n' +
`Expected ${collectionType}:\n` +
` ${(0, _jestMatcherUtils.printReceived)(collection)}\n` +
`Not to contain a value equal to:\n` +
` ${(0, _jestMatcherUtils.printExpected)(value)}\n`
: () =>
(0, _jestMatcherUtils.matcherHint)(
'.toContainEqual',
collectionType,
'value'
) +
'\n\n' +
`Expected ${collectionType}:\n` +
` ${(0, _jestMatcherUtils.printReceived)(collection)}\n` +
`To contain a value equal to:\n` +
` ${(0, _jestMatcherUtils.printExpected)(value)}`;
return {message: message, pass: pass};
},
toEqual: function(received, expected) {
const pass = (0, _jasmine_utils.equals)(received, expected, [
_utils.iterableEquality
]);
const message = pass
? () =>
(0, _jestMatcherUtils.matcherHint)('.not.toEqual') +
'\n\n' +
`Expected value to not equal:\n` +
` ${(0, _jestMatcherUtils.printExpected)(expected)}\n` +
`Received:\n` +
` ${(0, _jestMatcherUtils.printReceived)(received)}`
: () => {
const oneline = (0, _utils.isOneline)(expected, received);
const diffString = (0, _jestDiff2.default)(expected, received, {
expand: this.expand
});
return (
(0, _jestMatcherUtils.matcherHint)('.toEqual') +
'\n\n' +
`Expected value to equal:\n` +
` ${(0, _jestMatcherUtils.printExpected)(expected)}\n` +
`Received:\n` +
` ${(0, _jestMatcherUtils.printReceived)(received)}` +
(diffString && !oneline ? `\n\nDifference:\n\n${diffString}` : '')
);
};
// Passing the the actual and expected objects so that a custom reporter
// could access them, for example in order to display a custom visual diff,
// or create a different error message
return {
actual: received,
expected: expected,
message: message,
name: 'toEqual',
pass: pass
};
},
toHaveLength: function(received, length) {
if (
typeof received !== 'string' &&
(!received || typeof received.length !== 'number')
) {
throw new Error(
(0, _jestMatcherUtils.matcherHint)(
'[.not].toHaveLength',
'received',
'length'
) +
'\n\n' +
`Expected value to have a 'length' property that is a number. ` +
`Received:\n` +
` ${(0, _jestMatcherUtils.printReceived)(received)}\n` +
(received
? `received.length:\n ${(0, _jestMatcherUtils.printReceived)(
received.length
)}`
: '')
);
}
const pass = received.length === length;
const message = pass
? () =>
(0, _jestMatcherUtils.matcherHint)(
'.not.toHaveLength',
'received',
'length'
) +
'\n\n' +
`Expected value to not have length:\n` +
` ${(0, _jestMatcherUtils.printExpected)(length)}\n` +
`Received:\n` +
` ${(0, _jestMatcherUtils.printReceived)(received)}\n` +
`received.length:\n` +
` ${(0, _jestMatcherUtils.printReceived)(received.length)}`
: () =>
(0, _jestMatcherUtils.matcherHint)(
'.toHaveLength',
'received',
'length'
) +
'\n\n' +
`Expected value to have length:\n` +
` ${(0, _jestMatcherUtils.printExpected)(length)}\n` +
`Received:\n` +
` ${(0, _jestMatcherUtils.printReceived)(received)}\n` +
`received.length:\n` +
` ${(0, _jestMatcherUtils.printReceived)(received.length)}`;
return {message: message, pass: pass};
},
toHaveProperty: function(object, keyPath, value) {
const valuePassed = arguments.length === 3;
const secondArgument = valuePassed ? 'value' : null;
if (!object && typeof object !== 'string' && typeof object !== 'number') {
throw new Error(
(0, _jestMatcherUtils.matcherHint)(
'[.not].toHaveProperty',
'object',
'path',
{
secondArgument: secondArgument
}
) +
'\n\n' +
`Expected ${(0, _jestMatcherUtils.RECEIVED_COLOR)(
'object'
)} to be an object. Received:\n` +
` ${(0, _jestGetType2.default)(object)}: ${(0,
_jestMatcherUtils.printReceived)(object)}`
);
}
const keyPathType = (0, _jestGetType2.default)(keyPath);
if (keyPathType !== 'string' && keyPathType !== 'array') {
throw new Error(
(0, _jestMatcherUtils.matcherHint)(
'[.not].toHaveProperty',
'object',
'path',
{
secondArgument: secondArgument
}
) +
'\n\n' +
`Expected ${(0, _jestMatcherUtils.EXPECTED_COLOR)(
'path'
)} to be a string or an array. Received:\n` +
` ${(0, _jestGetType2.default)(keyPath)}: ${(0,
_jestMatcherUtils.printReceived)(keyPath)}`
);
}
const result = (0, _utils.getPath)(object, keyPath);
const lastTraversedObject = result.lastTraversedObject,
hasEndProp = result.hasEndProp;
const pass = valuePassed
? (0, _jasmine_utils.equals)(result.value, value, [
_utils.iterableEquality
])
: hasEndProp;
const traversedPath = result.traversedPath.join('.');
const message = pass
? () =>
(0, _jestMatcherUtils.matcherHint)(
'.not.toHaveProperty',
'object',
'path',
{
secondArgument: secondArgument
}
) +
'\n\n' +
`Expected the object:\n` +
` ${(0, _jestMatcherUtils.printReceived)(object)}\n` +
`Not to have a nested property:\n` +
` ${(0, _jestMatcherUtils.printExpected)(keyPath)}\n` +
(valuePassed
? `With a value of:\n ${(0, _jestMatcherUtils.printExpected)(
value
)}\n`
: '')
: () => {
const diffString =
valuePassed && hasEndProp
? (0, _jestDiff2.default)(value, result.value, {
expand: this.expand
})
: '';
return (
(0, _jestMatcherUtils.matcherHint)(
'.toHaveProperty',
'object',
'path',
{
secondArgument: secondArgument
}
) +
'\n\n' +
`Expected the object:\n` +
` ${(0, _jestMatcherUtils.printReceived)(object)}\n` +
`To have a nested property:\n` +
` ${(0, _jestMatcherUtils.printExpected)(keyPath)}\n` +
(valuePassed
? `With a value of:\n ${(0, _jestMatcherUtils.printExpected)(
value
)}\n`
: '') +
(hasEndProp
? `Received:\n` +
` ${(0, _jestMatcherUtils.printReceived)(result.value)}` +
(diffString ? `\n\nDifference:\n\n${diffString}` : '')
: traversedPath
? `Received:\n ${(0, _jestMatcherUtils.RECEIVED_COLOR)(
'object'
)}.${traversedPath}: ${(0, _jestMatcherUtils.printReceived)(
lastTraversedObject
)}`
: '')
);
};
if (pass === undefined) {
throw new Error('pass must be initialized');
}
return {message: message, pass: pass};
},
toMatch: function(received, expected) {
if (typeof received !== 'string') {
throw new Error(
(0, _jestMatcherUtils.matcherHint)(
'[.not].toMatch',
'string',
'expected'
) +
'\n\n' +
`${(0, _jestMatcherUtils.RECEIVED_COLOR)(
'string'
)} value must be a string.\n` +
(0, _jestMatcherUtils.printWithType)(
'Received',
received,
_jestMatcherUtils.printReceived
)
);
}
if (
!(expected && typeof expected.test === 'function') &&
!(typeof expected === 'string')
) {
throw new Error(
(0, _jestMatcherUtils.matcherHint)(
'[.not].toMatch',
'string',
'expected'
) +
'\n\n' +
`${(0, _jestMatcherUtils.EXPECTED_COLOR)(
'expected'
)} value must be a string or a regular expression.\n` +
(0, _jestMatcherUtils.printWithType)(
'Expected',
expected,
_jestMatcherUtils.printExpected
)
);
}
const pass = new RegExp(
typeof expected === 'string'
? (0, _jestRegexUtil.escapeStrForRegex)(expected)
: expected
).test(received);
const message = pass
? () =>
(0, _jestMatcherUtils.matcherHint)('.not.toMatch') +
`\n\nExpected value not to match:\n` +
` ${(0, _jestMatcherUtils.printExpected)(expected)}` +
`\nReceived:\n` +
` ${(0, _jestMatcherUtils.printReceived)(received)}`
: () =>
(0, _jestMatcherUtils.matcherHint)('.toMatch') +
`\n\nExpected value to match:\n` +
` ${(0, _jestMatcherUtils.printExpected)(expected)}` +
`\nReceived:\n` +
` ${(0, _jestMatcherUtils.printReceived)(received)}`;
return {message: message, pass: pass};
},
toMatchObject: function(receivedObject, expectedObject) {
if (typeof receivedObject !== 'object' || receivedObject === null) {
throw new Error(
(0, _jestMatcherUtils.matcherHint)(
'[.not].toMatchObject',
'object',
'expected'
) +
'\n\n' +
`${(0, _jestMatcherUtils.RECEIVED_COLOR)(
'received'
)} value must be an object.\n` +
(0, _jestMatcherUtils.printWithType)(
'Received',
receivedObject,
_jestMatcherUtils.printReceived
)
);
}
if (typeof expectedObject !== 'object' || expectedObject === null) {
throw new Error(
(0, _jestMatcherUtils.matcherHint)(
'[.not].toMatchObject',
'object',
'expected'
) +
'\n\n' +
`${(0, _jestMatcherUtils.EXPECTED_COLOR)(
'expected'
)} value must be an object.\n` +
(0, _jestMatcherUtils.printWithType)(
'Expected',
expectedObject,
_jestMatcherUtils.printExpected
)
);
}
const pass = (0, _jasmine_utils.equals)(receivedObject, expectedObject, [
_utils.iterableEquality,
_utils.subsetEquality
]);
const message = pass
? () =>
(0, _jestMatcherUtils.matcherHint)('.not.toMatchObject') +
`\n\nExpected value not to match object:\n` +
` ${(0, _jestMatcherUtils.printExpected)(expectedObject)}` +
`\nReceived:\n` +
` ${(0, _jestMatcherUtils.printReceived)(receivedObject)}`
: () => {
const diffString = (0, _jestDiff2.default)(
expectedObject,
(0, _utils.getObjectSubset)(receivedObject, expectedObject),
{
expand: this.expand
}
);
return (
(0, _jestMatcherUtils.matcherHint)('.toMatchObject') +
`\n\nExpected value to match object:\n` +
` ${(0, _jestMatcherUtils.printExpected)(expectedObject)}` +
`\nReceived:\n` +
` ${(0, _jestMatcherUtils.printReceived)(receivedObject)}` +
(diffString ? `\nDifference:\n${diffString}` : '')
);
};
return {message: message, pass: pass};
},
toStrictEqual: function(received, expected) {
const pass = (0, _jasmine_utils.equals)(
received,
expected,
[_utils.iterableEquality, _utils.typeEquality],
true
);
const message = pass
? () =>
(0, _jestMatcherUtils.matcherHint)('.not.toStrictEqual') +
'\n\n' +
`Expected value to not equal:\n` +
` ${(0, _jestMatcherUtils.printExpected)(expected)}\n` +
`Received:\n` +
` ${(0, _jestMatcherUtils.printReceived)(received)}`
: () => {
const diffString = (0, _jestDiff2.default)(expected, received, {
expand: this.expand
});
return (
(0, _jestMatcherUtils.matcherHint)('.toStrictEqual') +
'\n\n' +
`Expected value to equal:\n` +
` ${(0, _jestMatcherUtils.printExpected)(expected)}\n` +
`Received:\n` +
` ${(0, _jestMatcherUtils.printReceived)(received)}` +
(diffString ? `\n\nDifference:\n\n${diffString}` : '')
);
};
// Passing the the actual and expected objects so that a custom reporter
// could access them, for example in order to display a custom visual diff,
// or create a different error message
return {
actual: received,
expected: expected,
message: message,
name: 'toStrictEqual',
pass: pass
};
}
};
/**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
exports.default = matchers;
|
galenscook/algorithms
|
javascript/node_modules/expect/build/matchers.js
|
JavaScript
|
mit
| 27,128
|
##tomieric.github.io
前端分享园
> 基于hexo
[博客](http://getf2e.com/)
[旧博客](http://tomieric.github.io/old-blog)
[笔记](https://github.com/tomieric/tomieric.github.io/issues)
[案例列表](https://github.com/tomieric/tomieric.github.io/wiki/%E9%A1%B9%E7%9B%AEdemo)
|
tomieric/tomieric.github.io
|
README.md
|
Markdown
|
mit
| 289
|
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<div class="wk-progress">
<div class="col-sm-12 col-md-12">
<h1><a href="<?php echo base_url()?>usuario/index">Usuarios</a>/Nuevo</h1>
</div>
</div>
<?php
$atributos = array('id' => 'guardar','name' =>'Guardar');
echo form_open(null,$atributos);
?>
<section class="panel">
<div class="panel-body">
<div class="top-stats-panel">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<section class="panel">
<div class="wk-progress pf-status">
<div class="col-sm-2 col-md-2">
<p>Nombre</p>
</div>
<div class="col-sm-5 col-md-5">
<input class="form-control" type="text" name="nom" required="true" value="<?php echo set_value("nom") ?>">
<?php echo form_error('nom'); ?>
</div>
</div>
<div class="wk-progress pf-status">
<div class="col-sm-2 col-md-2">
<p>Usuario</p>
</div>
<div class="col-sm-5 col-md-5">
<input class="form-control" type="text" name="usua" required="true" value="<?php echo set_value("usua") ?>">
<?php echo form_error('usua'); ?>
</div>
</div>
<div class="wk-progress pf-status">
<div class="col-sm-2 col-md-2">
<p>Contraseña</p>
</div>
<div class="col-sm-5 col-md-5">
<input class="form-control" type="password" name="pass" required="true" value="<?php echo set_value("pass") ?>">
<?php echo form_error('pass'); ?>
</div>
</div>
<div class="wk-progress pf-status">
<div class="col-sm-2 col-sm-offset-3 col-md-2 col-md-offset-3">
<input class="btn btn-round btn-primary" type="submit"" value="Guardar" title="Guardar">
</div>
</div>
</section>
</div>
</div>
<?php echo form_close(); ?>
</div>
</div>
</section>
|
RosaGarcia/panelwd
|
application/views/usuario/new.php
|
PHP
|
mit
| 2,307
|
# Sean Faulkner Portfolio
A website to showcase my skills and projects.
Cloned from the Agency free Bootstrap theme.
## Theme Creator
Start Bootstrap was created by and is maintained by **[David Miller](http://davidmiller.io/)**, Owner of [Blackrock Digital](http://blackrockdigital.io/).
* https://twitter.com/davidmillerskt
* https://github.com/davidtmiller
Start Bootstrap is based on the [Bootstrap](http://getbootstrap.com/) framework created by [Mark Otto](https://twitter.com/mdo) and [Jacob Thorton](https://twitter.com/fat).
## Copyright and License
Copyright 2013-2016 Blackrock Digital LLC. Code released under the [MIT](https://github.com/BlackrockDigital/startbootstrap-agency/blob/gh-pages/LICENSE) license.
|
sjf125/portfolio-site
|
README.md
|
Markdown
|
mit
| 730
|
<!DOCTYPE HTML>
<!--
Fractal by HTML5 UP
html5up.net | @n33co
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
<head>
<title>Hub of Internet Things</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
<link rel="stylesheet" href="assets/css/main.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
<!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
<link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
</head>
<body id="top">
<!-- Header -->
<header id="header">
<div class="content">
<h1><a href="#">Hub of Internet Things</a></h1>
<p>The simplest solution to triggering <br />
one connected device to another.</p>
<ul class="actions">
<li><a href="https://github.com/amin10/hoit" class="button special icon fa-download">Download</a></li>
<li><a href="#one" class="button icon fa-chevron-down scrolly">Learn More</a></li>
</ul>
</div>
<div class="image phone"><div class="inner"><img src="images/screen.jpg" alt="" /></div></div>
</header>
<!-- One -->
<section id="one" class="wrapper style2 special">
<header class="major">
<h2>Link your smart devices <br />
elegantly and seamlessly.</h2>
</header>
<ul class="icons major">
<li><span class="icon fa fa-server"><span class="label">Shoot</span></span></li>
<li><span class="icon fa fa-arrows-h"><span class="label">Process</span></span></li>
<li><span class="icon fa-bullhorn"><span class="label">Upload</span></span></li>
</ul>
</section>
<!-- Two -->
<section id="two" class="wrapper">
<div class="inner alt">
<section class="spotlight">
<div class="image"><img src="images/pic01.png" alt="Input"/></div>
<div class="content">
<h3>Choose your input.</h3>
<p>Sound sensor. Thermometer. Ambiant light meter. Choose your input (or inputs) that will be used as triggers in one tap.</p>
</div>
</section>
<section class="spotlight">
<div class="image"><img src="images/pic02.png" alt="Output" /></div>
<div class="content">
<h3>Choose your output.</h3>
<p>Speaker. Notifications. Text messages. Choose your output (or outputs) that will be triggered by your input sources.</p>
</div>
</section>
<section class="spotlight">
<div class="image"><img src="images/pic03.png" alt="Link" /></div>
<div class="content">
<h3>Link them together.</h3>
<p>Graph the temperature in your backyard. Get text notifications when your computer overheats. Receive a notification when an unusual sound is detected while away from home. This is where the true power of HoIT lies.</p>
</div>
</section>
<section class="special">
<ul class="icons labeled">
<li><span class="icon fa-check-circle"><span class="label">Simple</span></span></li>
<li><span class="icon fa-refresh"><span class="label">Interactive</span></span></li>
<li><span class="icon fa-cloud"><span class="label">Cloud-based</span></span></li>
<li><span class="icon fa-code"><span class="label">No code required</span></span></li>
<li></li>
</ul>
</section>
</div>
</section>
<!-- Three -->
<section id="three" class="wrapper style2 special">
<header class="major">
<h2>Meet the team</h2>
<p>A competent mix of hipsters, hackers and hustlers are behind this app.</p>
</header>
</section>
<!-- Four -->
<section id="two" class="wrapper">
<div class="inner alt">
<section class="spotlight">
<div class="image"><img src="images/jack.jpg" alt="Jack Luo" /></div>
<div class="content">
<a href="https://www.linkedin.com/in/thejackluo"><h3>Jack Luo</h3></a>
<p>Front-end designer and web developer, UI/UX design and Mac fanboy... </p>
</div>
</section>
<section class="spotlight">
<div class="image"><img src="images/amin.jpg" alt="Amin Manna" /></div>
<div class="content">
<a href="https://www.linkedin.com/in/aminmanna"><h3>Amin Manna</h3></a>
<p>Full stack engineer, Android developer and Penguin enthusiast :)</p>
</div>
</section>
<section class="spotlight">
<div class="image"><img src="images/simon.jpg" alt="Simon Tran" /></div>
<div class="content">
<a href="https://www.linkedin.com/in/smn1022"><h3>Simon Tran</h3></a>
<p>Full stack developer, software consultant and impulsive person ;)</p>
</div>
</section>
</div>
</section>
<!-- Five-->
<section id="three" class="wrapper style2 special">
<header class="major">
<h2>Get the App</h2>
<p>With such endless possibilities, why don't you just download it right away?</p>
</header>
<ul class="actions">
<li><a href="https://github.com/amin10/hoit" class="button special icon fa-download">Download</a></li>
</ul>
</section>
<!-- Footer -->
<footer id="footer">
<!--
<ul class="icons">
<li><a href="#" class="icon fa-facebook"><span class="label">Facebook</span></a></li>
<li><a href="#" class="icon fa-twitter"><span class="label">Twitter</span></a></li>
<li><a href="#" class="icon fa-instagram"><span class="label">Instagram</span></a></li>
</ul>
-->
<p class="copyright">© Hub of Internet Things. Credits: Amin Manna, <a href="http://thejackluo.com">Jack Luo</a>, Simon Tran</p>
</footer>
<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/jquery.scrolly.min.js"></script>
<script src="assets/js/skel.min.js"></script>
<script src="assets/js/util.js"></script>
<!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
<script src="assets/js/main.js"></script>
</body>
</html>
|
amin10/hoit
|
www/index.html
|
HTML
|
mit
| 7,305
|
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace Treehopper.Libraries.Sensors.Optical
{
/// <summary>
/// Rohm Semiconductor BH1750FVI ambient light sensor
/// </summary>
[Supports("Rohm Semiconductor", "BH1750FVI")]
public class Bh1750 : AmbientLightSensor
{
/// <summary>
/// Probes the specified I2C bus to discover any BH1750s attacked.
/// </summary>
/// <param name="i2c">The bus to probe</param>
/// <param name="rate">The rate, in kHz</param>
/// <returns></returns>
public static async Task<IList<Bh1750>> ProbeAsync(I2C i2c, int rate=100)
{
List<Bh1750> devs = new List<Bh1750>();
i2c.Enabled = true;
bool oldExceptionsValue = TreehopperUsb.Settings.ThrowExceptions;
TreehopperUsb.Settings.ThrowExceptions = true;
try
{
var response = await i2c.SendReceiveAsync(0x23, null, 1).ConfigureAwait(false);
devs.Add(new Bh1750(i2c, false, rate));
}
catch (Exception) { }
try
{
var response = await i2c.SendReceiveAsync(0x5C, null, 1).ConfigureAwait(false);
devs.Add(new Bh1750(i2c, true, rate));
}
catch (Exception) { }
TreehopperUsb.Settings.ThrowExceptions = false;
TreehopperUsb.Settings.ThrowExceptions = oldExceptionsValue;
return devs;
}
public enum LuxResolution
{
Medium,
High,
Low
}
private LuxResolution resolution;
private SMBusDevice dev;
public LuxResolution Resolution
{
get { return resolution; }
set {
if (resolution == value) return;
resolution = value;
Task.Run(() => dev.WriteByteAsync((byte)(0x10 | (byte)resolution))).Wait();
}
}
public Bh1750(I2C i2c, bool addressPin = false, int rate=100)
{
this.dev = new SMBusDevice((byte)(addressPin ? 0x5C : 0x23), i2c, rate);
Task.Run(() => dev.WriteByteAsync(0x07)).Wait(); // reset
Resolution = LuxResolution.High;
}
/// <summary>
/// Requests a reading from the sensor and updates its data properties with the gathered values.
/// </summary>
/// <returns>An awaitable Task</returns>
/// <remarks>
/// Note that when #AutoUpdateWhenPropertyRead is `true` (which it is, by default), this method is implicitly
/// called when any sensor data property is read from --- there's no need to call this method unless you set
/// AutoUpdateWhenPropertyRead to `false`.
///
/// Unless otherwise noted, this method updates all sensor data simultaneously, which can often lead to more efficient
/// bus usage (as well as reducing USB chattiness).
/// </remarks>
public override async Task UpdateAsync()
{
_lux = await dev.ReadWordBEAsync().ConfigureAwait(false) / 1.2;
RaisePropertyChanged(this);
}
}
}
|
treehopper-electronics/treehopper-sdk
|
NET/API/Treehopper.Libraries/Sensors/Optical/Bh1750.cs
|
C#
|
mit
| 3,266
|
<!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/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>V8 API Reference Guide for node.js v4.2.4: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v4.2.4
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1SymbolObject.html">SymbolObject</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">v8::SymbolObject Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classv8_1_1SymbolObject.html">v8::SymbolObject</a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>BooleanValue</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>CallAsConstructor</b>(Local< Context > context, int argc, Local< Value > argv[]) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>CallAsFunction</b>(Local< Context > context, Local< Value > recv, int argc, Local< Value > argv[]) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Cast</b>(v8::Value *obj) (defined in <a class="el" href="classv8_1_1SymbolObject.html">v8::SymbolObject</a>)</td><td class="entry"><a class="el" href="classv8_1_1SymbolObject.html">v8::SymbolObject</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Cast</b>(T *value) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#a5018c9d085aa71f65530cf1e073a04ad">Clone</a>()</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>CreateDataProperty</b>(Local< Context > context, Local< Name > key, Local< Value > value) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>CreateDataProperty</b>(Local< Context > context, uint32_t index, Local< Value > value) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#af6966283a7d7e20779961eed434db04d">CreationContext</a>()</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>DefineOwnProperty</b>(Local< Context > context, Local< Name > key, Local< Value > value, PropertyAttribute attributes=None) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Delete</b>(Local< Context > context, Local< Value > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Delete</b>(Local< Context > context, uint32_t index) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>DeleteHiddenValue</b>(Local< String > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Equals</b>(Local< Context > context, Local< Value > that) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#ae2ad9fee9db6e0e5da56973ebb8ea2bc">FindInstanceInPrototypeChain</a>(Local< FunctionTemplate > tmpl)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Get</b>(Local< Context > context, Local< Value > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Get</b>(Local< Context > context, uint32_t index) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#a435f68bb7ef0f64dd522c5c910682448">GetAlignedPointerFromInternalField</a>(int index)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#a65b5a3dc93c0774594f8b0f2ab5481c8">GetAlignedPointerFromInternalField</a>(const PersistentBase< Object > &object, int index)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#a7bbe987794658f20a3ec1b68326305e6">GetConstructorName</a>()</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>GetHiddenValue</b>(Local< String > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#ac1ece41e81a499920ec3a2a3471653bc">GetIdentityHash</a>()</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#aa3324fdf652d8ac3b2f27faa0559231d">GetInternalField</a>(int index)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>GetOwnPropertyDescriptor</b>(Local< Context > context, Local< String > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>GetOwnPropertyNames</b>(Local< Context > context) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>GetPropertyAttributes</b>(Local< Context > context, Local< Value > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>GetPropertyNames</b>(Local< Context > context) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#ae8d3fed7d6dbd667c29cabb3039fe7af">GetPrototype</a>()</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>GetRealNamedProperty</b>(Local< Context > context, Local< Name > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>GetRealNamedPropertyAttributes</b>(Local< Context > context, Local< Name > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>GetRealNamedPropertyAttributesInPrototypeChain</b>(Local< Context > context, Local< Name > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>GetRealNamedPropertyInPrototypeChain</b>(Local< Context > context, Local< Name > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Has</b>(Local< Context > context, Local< Value > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Has</b>(Local< Context > context, uint32_t index) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#a278913bcd203434870ce5184a538a9af">HasIndexedLookupInterceptor</a>()</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#a1e96fcb9ee17101c0299ec68f2cf8610">HasNamedLookupInterceptor</a>()</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>HasOwnProperty</b>(Local< Context > context, Local< Name > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>HasRealIndexedProperty</b>(Local< Context > context, uint32_t index) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>HasRealNamedCallbackProperty</b>(Local< Context > context, Local< Name > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>HasRealNamedProperty</b>(Local< Context > context, Local< Name > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Int32Value</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>IntegerValue</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#aaec28576353eebe6fee113bce2718ecc">InternalFieldCount</a>()</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#a324a71142f621a32bfe5738648718370">InternalFieldCount</a>(const PersistentBase< Object > &object)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#ad06a4b1f7215d852c367df390491ac84">IsArgumentsObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#aaee0b144087d20eae02314c9393ff80f">IsArray</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a65f9dad740f2468b44dc16349611c351">IsArrayBuffer</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#ad54475d15b7e6b6e17fc80fb4570cdf2">IsArrayBufferView</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a0aceb7645e71b096df5cd73d1252b1b0">IsBoolean</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#abe7bc06283e5e66013f2f056a943168b">IsBooleanObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#a23c2c1f23b50fab4a02e2f819641b865">IsCallable</a>()</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#afd20ab51e79658acc405c12dad2260ab">IsDataView</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a8bc11fab0aded4a805722ab6df173cae">IsDate</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a7ac61a325c18af8dcb6d7d5bf47d2503">IsExternal</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a68c0296071d01ca899825d7643cf495a">IsFalse</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a4effc7ca1a221dd8c1e23c0f28145ef0">IsFloat32Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#ab071bf567d89c8ce1489b1b7d93abc36">IsFloat32x4</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a293f140b81b0219d1497e937ed948b1e">IsFloat64Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a05532a34cdd215f273163830ed8b77e7">IsFunction</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a1cbbebde8c256d051c4606a7300870c6">IsGeneratorFunction</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a72982768acdadd82d1df02a452251d14">IsGeneratorObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a928c586639dd75ae4efdaa66b1fc4d50">IsInt16Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a01e1db51c65b2feace248b7acbf71a2c">IsInt32</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a48eac78a49c8b42d9f8cf05c514b3750">IsInt32Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a10a88a2794271dfcd9c3abd565e8f28a">IsInt8Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a71ef50f22d6bb4a093cc931b3d981c08">IsMap</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#af9c52a0668fa3260a0d12a2cdf895b4e">IsMapIterator</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a8829b16b442a6231499c89fd5a6f8049">IsName</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a579fb52e893cdc24f8b77e5acc77d06d">IsNativeError</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#aa2c6ed8ef832223a7e2cd81e6ac61c78">IsNull</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a1bd51e3e55f67c65b9a8f587fbffb7c7">IsNumber</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a5f4aa9504a6d8fc3af9489330179fe14">IsNumberObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a355b7991c5c978c0341f6f961b63c5a2">IsObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a93d6a0817b15a1d28050ba16e131e6b4">IsPromise</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#aae41e43486937d6122c297a0d43ac0b8">IsRegExp</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a220bd4056471ee1dda8ab9565517edd7">IsSet</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#addbae0104e07b990ee1af0bd7927824b">IsSetIterator</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#aa4ce26f174a4c1823dec56eb946d3134">IsSharedArrayBuffer</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#ab23a34b7df62806808e01b0908bf5f00">IsString</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a3e0f2727455fd01a39a60b92f77e28e0">IsStringObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#af3e6081c22d09a7bbc0a2aff59ed60a5">IsSymbol</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a867baa94cb8f1069452359e6cef6751e">IsSymbolObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a8f27462322186b295195eecb3e81d6d7">IsTrue</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#ac2f2f6c39f14a39fbb5b43577125dfe4">IsTypedArray</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a4a45fabf58b241f5de3086a3dd0a09ae">IsUint16Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a783c89631bac4ef3c4b909f40cc2b8d8">IsUint32</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a5e39229dc74d534835cf4ceba10676f4">IsUint32Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#acbe2cd9c9cce96ee498677ba37c8466d">IsUint8Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#ad3cb464ab5ef0215bd2cbdd4eb2b7e3d">IsUint8ClampedArray</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#aea287b745656baa8a12a2ae1d69744b6">IsUndefined</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#aab0297b39ed8e2a71b5dca7950228a36">IsWeakMap</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a6f5a238206cbd95f98e2da92cab72e80">IsWeakSet</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>New</b>(Isolate *isolate, Local< Symbol > value) (defined in <a class="el" href="classv8_1_1SymbolObject.html">v8::SymbolObject</a>)</td><td class="entry"><a class="el" href="classv8_1_1SymbolObject.html">v8::SymbolObject</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>New</b>(Isolate *isolate) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>NumberValue</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ObjectProtoToString</b>(Local< Context > context) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>SameValue</b>(Local< Value > that) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Set</b>(Local< Context > context, Local< Value > key, Local< Value > value) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Set</b>(Local< Context > context, uint32_t index, Local< Value > value) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>SetAccessor</b>(Local< Context > context, Local< Name > name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter=0, MaybeLocal< Value > data=MaybeLocal< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>SetAccessorProperty</b>(Local< Name > name, Local< Function > getter, Local< Function > setter=Local< Function >(), PropertyAttribute attribute=None, AccessControl settings=DEFAULT) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#a0ccba69581f0b5e4e672bab90f26879b">SetAlignedPointerInInternalField</a>(int index, void *value)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#ac27b823248165acf5284a7086dfed34b">SetHiddenValue</a>(Local< String > key, Local< Value > value)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#aebf949a0592cebc144bb2f96bfb7ec72">SetInternalField</a>(int index, Local< Value > value)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>SetPrototype</b>(Local< Context > context, Local< Value > prototype) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>StrictEquals</b>(Local< Value > that) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToArrayIndex</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToBoolean</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToDetailString</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToInt32</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToInteger</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToNumber</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToObject</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToString</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToUint32</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Uint32Value</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool Set(Local< Value > key, Local< Value > value)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool Set(uint32_t index, Local< Value > value)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use CreateDataProperty", bool ForceSet(Local< Value > key, Local< Value > value, PropertyAttribute attribs=None)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use CreateDataProperty", Maybe< bool > ForceSet(Local< Context > context, Local< Value > key, Local< Value > value, PropertyAttribute attribs=None)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Value > Get(Local< Value > key)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Value > Get(uint32_t index)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#a45c99c5e2b16425b4e92c88d49463e5f">V8_DEPRECATE_SOON</a>("Use maybe version", PropertyAttribute GetPropertyAttributes(Local< Value > key))</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#ac5503b0a8e861ec721c680eccf5aec2d">V8_DEPRECATE_SOON</a>("Use maybe version", Local< Value > GetOwnPropertyDescriptor(Local< String > key))</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool Has(Local< Value > key)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool Delete(Local< Value > key)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool Has(uint32_t index)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool Delete(uint32_t index)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool SetAccessor(Local< String > name, AccessorGetterCallback getter, AccessorSetterCallback setter=0, Local< Value > data=Local< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool SetAccessor(Local< Name > name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter=0, Local< Value > data=Local< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#a3f735ad2eab826ddc5eba467ce624acb">V8_DEPRECATE_SOON</a>("Use maybe version", Local< Array > GetPropertyNames())</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#aa72e9d0d22d1d4a4c4b63827a5469d40">V8_DEPRECATE_SOON</a>("Use maybe version", Local< Array > GetOwnPropertyNames())</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#a34e1ca49ed4944009d8d289e5530dabd">V8_DEPRECATE_SOON</a>("Use maybe version", bool SetPrototype(Local< Value > prototype))</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#abc26147d5f501bf30217f227c9be4922">V8_DEPRECATE_SOON</a>("Use maybe version", Local< String > ObjectProtoToString())</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool HasOwnProperty(Local< String > key)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool HasRealNamedProperty(Local< String > key)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool HasRealIndexedProperty(uint32_t index)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool HasRealNamedCallbackProperty(Local< String > key)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#a2451d74f20c3c8c5792d2179df34d2de">V8_DEPRECATE_SOON</a>("Use maybe version", Local< Value > GetRealNamedPropertyInPrototypeChain(Local< String > key))</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#ac5755869ab0b95f6c1bbd3dd123e5cf4">V8_DEPRECATE_SOON</a>("Use maybe version", Maybe< PropertyAttribute > GetRealNamedPropertyAttributesInPrototypeChain(Local< String > key))</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#a82e0bc7d399264127f911e4167d730b1">V8_DEPRECATE_SOON</a>("Use maybe version", Local< Value > GetRealNamedProperty(Local< String > key))</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#a9bc9b05ff7a9a8ad4e1977524b79da6f">V8_DEPRECATE_SOON</a>("Use maybe version", Maybe< PropertyAttribute > GetRealNamedPropertyAttributes(Local< String > key))</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#a5aa2616e9deaf26533c3870df2925530">V8_DEPRECATE_SOON</a>("Use maybe version", Local< Value > CallAsFunction(Local< Value > recv, int argc, Local< Value > argv[]))</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#a10222e80df73aaa0b381f4dabe6b5dd7">V8_DEPRECATE_SOON</a>("Use maybe version", Local< Value > CallAsConstructor(int argc, Local< Value > argv[]))</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#a5e7199a517d980396bb86f876b5bae0a">V8_DEPRECATE_SOON</a>("Keep track of isolate correctly", Isolate *GetIsolate())</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Boolean > ToBoolean(Isolate *isolate) const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Number > ToNumber(Isolate *isolate) const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< String > ToString(Isolate *isolate) const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< String > ToDetailString(Isolate *isolate) const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Object > ToObject(Isolate *isolate) const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Integer > ToInteger(Isolate *isolate) const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Uint32 > ToUint32(Isolate *isolate) const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Int32 > ToInt32(Isolate *isolate) const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Boolean > ToBoolean() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Number > ToNumber() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< String > ToString() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< String > ToDetailString() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Object > ToObject() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Integer > ToInteger() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Uint32 > ToUint32() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Int32 > ToInt32() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a48ae008760161c7ae7fd54a9db9cffcf">v8::Value::V8_DEPRECATE_SOON</a>("Use maybe version", Local< Uint32 > ToArrayIndex() const)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool BooleanValue() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", double NumberValue() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", int64_t IntegerValue() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", uint32_t Uint32Value() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", int32_t Int32Value() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#ae3528a485935d1b19a0e007cd5a06799">v8::Value::V8_DEPRECATE_SOON</a>("Use maybe version", bool Equals(Local< Value > that) const)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ValueOf</b>() const (defined in <a class="el" href="classv8_1_1SymbolObject.html">v8::SymbolObject</a>)</td><td class="entry"><a class="el" href="classv8_1_1SymbolObject.html">v8::SymbolObject</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
|
v8-dox/v8-dox.github.io
|
aa575b8/html/classv8_1_1SymbolObject-members.html
|
HTML
|
mit
| 55,402
|
// PLForm
//
// Created by Ash Thwaites on 11/12/2015.
// Copyright (c) 2015 Pitch Labs. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "PLValidator.h"
#pragma mark - Validator interface
@interface PLValidatorAlphabetic : PLValidatorSingleCondition
{
}
@property (nonatomic) BOOL allowWhitespace;
@end
|
PitchLabsAsh/PLForm
|
Pod/Classes/PLFormValidation/PLValidatorAlphabetic.h
|
C
|
mit
| 330
|
/*
* Copyright (c) Fundacion Jala. All rights reserved.
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
package org.fundacionjala.oblivion.apex.grammar.parser.exceptions;
import org.fundacionjala.oblivion.apex.grammar.jcclexer.ParseException;
/**
* Represents an exception when a class is not well defined.
*
* @author Maria Garcia
*/
public class ClassTypeException extends ContextParseException {
private static final String WITH = "with";
private static final String WITHOUT = "without";
private static final String SHARING = "sharing";
public ClassTypeException(ParseException originalError) {
super(originalError);
}
@Override
public void init() {
String key;
currentToken = originalToken.next;
if (originalToken.image.equalsIgnoreCase(WITH) || originalToken.image.equalsIgnoreCase(WITHOUT)) {
key = "grammar.error.class.sharing";
} else if (originalToken.image.equalsIgnoreCase(SHARING)){
key = "grammar.error.class";
} else {
key = "grammar.error.unexpected";
}
message = String.format(bundle.getString(key), currentToken.image, currentToken.beginLine, currentToken.beginColumn);
}
}
|
fundacionjala/oblivion-netbeans-plugin
|
Grammar/src/org/fundacionjala/oblivion/apex/grammar/parser/exceptions/ClassTypeException.java
|
Java
|
mit
| 1,294
|
@import url(http://fonts.googleapis.com/css?family=Open+Sans);
@media print {
/* Hide containers in print mode */
#buzzWords, #output, #cardCreator, #printCards {
display: none !important;
}
div{
page-break-inside: avoid;
}
@page {
text-align: center;
margin-top: 100px;
}
}
body {
margin: 0;
padding: 0;
font-family: "Open Sans", "Helvetica", "Arial", "Lucida Grande", sans-serif;
min-width: 1000px;
width: 1200px;
margin-left: auto;
margin-right: auto;
}
#buzzBox {
margin-top: 50px;
}
#buzzWords {
width: 100%;
height: 150px;
font-size: 25px;
padding: 15px 15px 15px 15px;
color: #003047;
text-align: center;
/*border: 1px solid #eee;*/
border: 0;
background-color: #eee;
line-height: 1.5em;
font-family: "Open Sans", "Helvetica", "Arial", "Lucida Grande", sans-serif;
}
#buzzWords:focus {
/*border: 1px solid #90c4f4;*/
background-color: #049DD9;
}
#generateCards {
margin: 15px auto 15px auto;
background-color: #90c4f4;
padding: 15px;
text-align: center;
width: 70px;
color: #fff;
font-size: 19px;
cursor: pointer;
}
#generateCards:hover {
background-color: #5093d1;
}
#output {
text-align: center;
margin-top: 40px;
}
.term {
background-color: #4ED963;
display: inline-block;
margin: 5px 10px 5px 0;
padding: 10px;
cursor: default;
color: #23612c;
}
#cardCreator {
text-align: center;
margin-top: 40px;
}
#goButton {
padding: 15px;
margin-top: 40px;
background-color: #049DD9;
border: 0;
cursor: pointer;
color: #fff;
font-size: 19px;
display: inline-block;
text-decoration: none;
}
#goButton:hover {
background-color: #00729f;
color: #fff;
}
#cards {
margin-top: 50px;
text-align: center;
}
.card {
border: 2px solid #333;
padding: 25px;
border-radius: 15px;
margin: 50px 0;
display: inline-block;
font-family: 'Open Sans', cursive;
}
.card td {
text-align: center;
}
.card th {
font-size: 39px;
padding: 5px 15px 30px;
font-weight: 100;
}
#classFooter {
font-size: 10px;
padding-top: 25px;
}
#classFooter a {
color: #bbb;
text-decoration: none;
}
.buzzWord {
height: 100px;
border: 1px solid #333;
padding: 15px;
font-size: 19px;
}
.term {
line-height:40px;
list-style:none;
box-sizing:border-box;
}
#printCards {
width: 250px;
text-align: center;
cursor: pointer;
display: inline-block;
padding: 15px;
background-color: #008E74;
color: #fff;
margin-top: 30px;
}
#printCards:hover {
background-color: #00c09d;
}
|
janwieners/BuBi
|
css/style.css
|
CSS
|
mit
| 2,755
|
<?xml version="1.0" ?><!DOCTYPE TS><TS language="hr" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About YardSaleCoin</source>
<translation>O YardSaleCoin-u</translation>
</message>
<message>
<location line="+39"/>
<source><b>YardSaleCoin</b> version</source>
<translation><b>YardSaleCoin</b> verzija</translation>
</message>
<message>
<location line="+57"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../aboutdialog.cpp" line="+14"/>
<source>Copyright</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The YardSaleCoin developers</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>Adresar</translation>
</message>
<message>
<location line="+19"/>
<source>Double-click to edit address or label</source>
<translation>Dvostruki klik za uređivanje adrese ili oznake</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Dodajte novu adresu</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Kopiraj trenutno odabranu adresu u međuspremnik</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation>&Nova adresa</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+63"/>
<source>These are your YardSaleCoin 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>Ovo su vaše YardSaleCoin adrese za primanje isplate. Možda želite dati drukčiju adresu svakom primatelju tako da možete pratiti tko je platio.</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>&Copy Address</source>
<translation>&Kopirati adresu</translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation>Prikaži &QR Kôd</translation>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a YardSaleCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Export the data in the current tab to a file</source>
<translation>Izvoz podataka iz trenutnog taba u datoteku</translation>
</message>
<message>
<location line="+3"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Verify a message to ensure it was signed with a specified YardSaleCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>&Brisanje</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="-5"/>
<source>These are your YardSaleCoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Copy &Label</source>
<translation>Kopirati &oznaku</translation>
</message>
<message>
<location line="+1"/>
<source>&Edit</source>
<translation>&Izmjeniti</translation>
</message>
<message>
<location line="+1"/>
<source>Send &Coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+260"/>
<source>Export Address Book Data</source>
<translation>Izvoz podataka adresara</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Datoteka vrijednosti odvojenih zarezom (*. csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation>Pogreška kod izvoza</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Ne mogu pisati u datoteku %1.</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>Oznaka</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adresa</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(bez oznake)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>Unesite lozinku</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>Nova lozinka</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>Ponovite novu lozinku</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+33"/>
<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>Unesite novi lozinku za novčanik. <br/> Molimo Vas da koristite zaporku od <b>10 ili više slučajnih znakova,</b> ili <b>osam ili više riječi.</b></translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>Šifriranje novčanika</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Ova operacija treba lozinku vašeg novčanika kako bi se novčanik otključao.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>Otključaj novčanik</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Ova operacija treba lozinku vašeg novčanika kako bi se novčanik dešifrirao.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Dešifriranje novčanika.</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Promjena lozinke</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Unesite staru i novu lozinku za novčanik.</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>Potvrdi šifriranje novčanika</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR LITECOINS</b>!</source>
<translation>Upozorenje: Ako šifrirate vaš novčanik i izgubite lozinku, <b>IZGUBIT ĆETE SVE SVOJE LITECOINSE!</b></translation>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>Jeste li sigurni da želite šifrirati svoj novčanik?</translation>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-130"/>
<location line="+58"/>
<source>Wallet encrypted</source>
<translation>Novčanik šifriran</translation>
</message>
<message>
<location line="-56"/>
<source>YardSaleCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your yardsalecoins from being stolen by malware infecting your computer.</source>
<translation>YardSaleCoin će se sada zatvoriti kako bi dovršio postupak šifriranja. Zapamtite da šifriranje vašeg novčanika ne može u potpunosti zaštititi vaše yardsalecoine od krađe preko zloćudnog softvera koji bi bio na vašem računalu.</translation>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+42"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Šifriranje novčanika nije uspjelo</translation>
</message>
<message>
<location line="-54"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Šifriranje novčanika nije uspjelo zbog interne pogreške. Vaš novčanik nije šifriran.</translation>
</message>
<message>
<location line="+7"/>
<location line="+48"/>
<source>The supplied passphrases do not match.</source>
<translation>Priložene lozinke se ne podudaraju.</translation>
</message>
<message>
<location line="-37"/>
<source>Wallet unlock failed</source>
<translation>Otključavanje novčanika nije uspjelo</translation>
</message>
<message>
<location line="+1"/>
<location line="+11"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Lozinka za dešifriranje novčanika nije točna.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Dešifriranje novčanika nije uspjelo</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation>Lozinka novčanika je uspješno promijenjena.</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+233"/>
<source>Sign &message...</source>
<translation>&Potpišite poruku...</translation>
</message>
<message>
<location line="+280"/>
<source>Synchronizing with network...</source>
<translation>Usklađivanje s mrežom ...</translation>
</message>
<message>
<location line="-349"/>
<source>&Overview</source>
<translation>&Pregled</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>Prikaži opći pregled novčanika</translation>
</message>
<message>
<location line="+20"/>
<source>&Transactions</source>
<translation>&Transakcije</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>Pretraži povijest transakcija</translation>
</message>
<message>
<location line="+7"/>
<source>Edit the list of stored addresses and labels</source>
<translation>Uređivanje popisa pohranjenih adresa i oznaka</translation>
</message>
<message>
<location line="-14"/>
<source>Show the list of addresses for receiving payments</source>
<translation>Prikaži popis adresa za primanje isplate</translation>
</message>
<message>
<location line="+31"/>
<source>E&xit</source>
<translation>&Izlaz</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Izlazak iz programa</translation>
</message>
<message>
<location line="+4"/>
<source>Show information about YardSaleCoin</source>
<translation>Prikaži informacije o YardSaleCoinu</translation>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>Više o &Qt</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>Prikaži informacije o Qt</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&Postavke</translation>
</message>
<message>
<location line="+6"/>
<source>&Encrypt Wallet...</source>
<translation>&Šifriraj novčanik...</translation>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation>&Backup novčanika...</translation>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>&Promijena lozinke...</translation>
</message>
<message>
<location line="+285"/>
<source>Importing blocks from disk...</source>
<translation>Importiranje blokova sa diska...</translation>
</message>
<message>
<location line="+3"/>
<source>Reindexing blocks on disk...</source>
<translation>Re-indeksiranje blokova na disku...</translation>
</message>
<message>
<location line="-347"/>
<source>Send coins to a YardSaleCoin address</source>
<translation>Slanje novca na yardsalecoin adresu</translation>
</message>
<message>
<location line="+49"/>
<source>Modify configuration options for YardSaleCoin</source>
<translation>Promijeni postavke konfiguracije za yardsalecoin</translation>
</message>
<message>
<location line="+9"/>
<source>Backup wallet to another location</source>
<translation>Napravite sigurnosnu kopiju novčanika na drugoj lokaciji</translation>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Promijenite lozinku za šifriranje novčanika</translation>
</message>
<message>
<location line="+6"/>
<source>&Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-4"/>
<source>&Verify message...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-165"/>
<location line="+530"/>
<source>YardSaleCoin</source>
<translation>YardSaleCoin</translation>
</message>
<message>
<location line="-530"/>
<source>Wallet</source>
<translation>Novčanik</translation>
</message>
<message>
<location line="+101"/>
<source>&Send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Receive</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>&About YardSaleCoin</source>
<translation>&O YardSaleCoinu</translation>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show or hide the main Window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Encrypt the private keys that belong to your wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Sign messages with your YardSaleCoin addresses to prove you own them</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Verify messages to ensure they were signed with specified YardSaleCoin addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>&File</source>
<translation>&Datoteka</translation>
</message>
<message>
<location line="+7"/>
<source>&Settings</source>
<translation>&Konfiguracija</translation>
</message>
<message>
<location line="+6"/>
<source>&Help</source>
<translation>&Pomoć</translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation>Traka kartica</translation>
</message>
<message>
<location line="+17"/>
<location line="+10"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
<message>
<location line="+47"/>
<source>YardSaleCoin client</source>
<translation>YardSaleCoin klijent</translation>
</message>
<message numerus="yes">
<location line="+141"/>
<source>%n active connection(s) to YardSaleCoin network</source>
<translation><numerusform>%n aktivna veza na YardSaleCoin mrežu</numerusform><numerusform>%n aktivne veze na YardSaleCoin mrežu</numerusform><numerusform>%n aktivnih veza na YardSaleCoin mrežu</numerusform></translation>
</message>
<message>
<location line="+22"/>
<source>No block source available...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Processed %1 of %2 (estimated) blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Processed %1 blocks of transaction history.</source>
<translation>Obrađeno %1 blokova povijesti transakcije.</translation>
</message>
<message numerus="yes">
<location line="+20"/>
<source>%n hour(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n week(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>%1 behind</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Last received block was generated %1 ago.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Transactions after this will not yet be visible.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Error</source>
<translation>Greška</translation>
</message>
<message>
<location line="+3"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+70"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-140"/>
<source>Up to date</source>
<translation>Ažurno</translation>
</message>
<message>
<location line="+31"/>
<source>Catching up...</source>
<translation>Ažuriranje...</translation>
</message>
<message>
<location line="+113"/>
<source>Confirm transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Sent transaction</source>
<translation>Poslana transakcija</translation>
</message>
<message>
<location line="+0"/>
<source>Incoming transaction</source>
<translation>Dolazna transakcija</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Datum:%1
Iznos:%2
Tip:%3
Adresa:%4
</translation>
</message>
<message>
<location line="+33"/>
<location line="+23"/>
<source>URI handling</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-23"/>
<location line="+23"/>
<source>URI can not be parsed! This can be caused by an invalid YardSaleCoin address or malformed URI parameters.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Novčanik je <b>šifriran</b> i trenutno <b>otključan</b></translation>
</message>
<message>
<location line="+8"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Novčanik je <b>šifriran</b> i trenutno <b>zaključan</b></translation>
</message>
<message>
<location filename="../bitcoin.cpp" line="+111"/>
<source>A fatal error occurred. YardSaleCoin can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+104"/>
<source>Network Alert</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Izmjeni adresu</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>&Oznaka</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation>Oznaka ovog upisa u adresar</translation>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>&Adresa</translation>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation>Adresa ovog upisa u adresar. Može se mjenjati samo kod adresa za slanje.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+21"/>
<source>New receiving address</source>
<translation>Nova adresa za primanje</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>Nova adresa za slanje</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>Uredi adresu za primanje</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>Uredi adresu za slanje</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Upisana adresa "%1" je već u adresaru.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid YardSaleCoin address.</source>
<translation>Upisana adresa "%1" nije valjana yardsalecoin adresa.</translation>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>Ne mogu otključati novčanik.</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>Stvaranje novog ključa nije uspjelo.</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+424"/>
<location line="+12"/>
<source>YardSaleCoin-Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation>verzija</translation>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation>Upotreba:</translation>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation>UI postavke</translation>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation>Pokreni minimiziran</translation>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation>Postavke</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation>&Glavno</translation>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation>Plati &naknadu za transakciju</translation>
</message>
<message>
<location line="+31"/>
<source>Automatically start YardSaleCoin after logging in to the system.</source>
<translation>Automatski pokreni YardSaleCoin kad se uključi računalo</translation>
</message>
<message>
<location line="+3"/>
<source>&Start YardSaleCoin on system login</source>
<translation>&Pokreni YardSaleCoin kod pokretanja sustava</translation>
</message>
<message>
<location line="+35"/>
<source>Reset all client options to default.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Reset Options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>&Network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Automatically open the YardSaleCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>Automatski otvori port YardSaleCoin klijenta na ruteru. To radi samo ako ruter podržava UPnP i ako je omogućen.</translation>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation>Mapiraj port koristeći &UPnP</translation>
</message>
<message>
<location line="+7"/>
<source>Connect to the YardSaleCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation>Spojite se na Bitcon mrežu putem SOCKS proxy-a (npr. kod povezivanja kroz Tor)</translation>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation>&Povezivanje putem SOCKS proxy-a:</translation>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation>IP adresa proxy-a (npr. 127.0.0.1)</translation>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation>Port od proxy-a (npr. 9050)</translation>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation>Prikaži samo ikonu u sistemskoj traci nakon minimiziranja prozora</translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&Minimiziraj u sistemsku traku umjesto u traku programa</translation>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation>Minimizirati umjesto izaći iz aplikacije kada je prozor zatvoren. Kada je ova opcija omogućena, aplikacija će biti zatvorena tek nakon odabira Izlaz u izborniku.</translation>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation>M&inimiziraj kod zatvaranja</translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation>&Prikaz</translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting YardSaleCoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation>&Jedinica za prikazivanje iznosa:</translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>Izaberite željeni najmanji dio yardsalecoina koji će biti prikazan u sučelju i koji će se koristiti za plaćanje.</translation>
</message>
<message>
<location line="+9"/>
<source>Whether to show YardSaleCoin addresses in the transaction list or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation>&Prikaži adrese u popisu transakcija</translation>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+53"/>
<source>default</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+130"/>
<source>Confirm options reset</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Some settings may require a client restart to take effect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Do you want to proceed?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<location line="+9"/>
<source>Warning</source>
<translation>Upozorenje</translation>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting YardSaleCoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>Oblik</translation>
</message>
<message>
<location line="+50"/>
<location line="+166"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the YardSaleCoin network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-124"/>
<source>Balance:</source>
<translation>Stanje:</translation>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation>Nepotvrđene:</translation>
</message>
<message>
<location line="-78"/>
<source>Wallet</source>
<translation>Novčanik</translation>
</message>
<message>
<location line="+107"/>
<source>Immature:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation><b>Nedavne transakcije</b></translation>
</message>
<message>
<location line="-101"/>
<source>Your current balance</source>
<translation>Vaše trenutno stanje računa</translation>
</message>
<message>
<location line="+29"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation>Ukupni iznos transakcija koje tek trebaju biti potvrđene, i još uvijek nisu uračunate u trenutni saldo</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="+116"/>
<location line="+1"/>
<source>out of sync</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<location filename="../paymentserver.cpp" line="+107"/>
<source>Cannot start yardsalecoin: click-to-pay handler</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation>QR Code Dijalog</translation>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation>Zatraži plaćanje</translation>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation>Iznos:</translation>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation>Oznaka</translation>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation>Poruka:</translation>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation>&Spremi kao...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation>Rezultirajući URI je predug, probajte umanjiti tekst za naslov / poruku.</translation>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation>PNG slike (*.png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+339"/>
<source>N/A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation>Lanac blokova</translation>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation>Trenutni broj blokova</translation>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation>Procjenjeni ukupni broj blokova</translation>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation>Posljednje vrijeme bloka</translation>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Show the YardSaleCoin-Qt help message to get a list with possible YardSaleCoin command-line options.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-104"/>
<source>YardSaleCoin - Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>YardSaleCoin Core</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Open the YardSaleCoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-30"/>
<source>Welcome to the YardSaleCoin RPC console.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+124"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>Slanje novca</translation>
</message>
<message>
<location line="+50"/>
<source>Send to multiple recipients at once</source>
<translation>Pošalji k nekoliko primatelja odjednom</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation>&Dodaj primatelja</translation>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation>Obriši sva polja transakcija</translation>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>Obriši &sve</translation>
</message>
<message>
<location line="+22"/>
<source>Balance:</source>
<translation>Stanje:</translation>
</message>
<message>
<location line="+10"/>
<source>123.456 BTC</source>
<translation>123,456 BTC</translation>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation>Potvrdi akciju slanja</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>&Pošalji</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-59"/>
<source><b>%1</b> to %2 (%3)</source>
<translation><b>%1</b> do %2 (%3)</translation>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation>Potvrdi slanje novca</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation>Jeste li sigurni da želite poslati %1?</translation>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation>i</translation>
</message>
<message>
<location line="+23"/>
<source>The recipient address is not valid, please recheck.</source>
<translation>Adresa primatelja je nevaljala, molimo provjerite je ponovo.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>Iznos mora biti veći od 0.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation>Iznos je veći od stanja računa.</translation>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>Iznos je veći od stanja računa kad se doda naknada za transakcije od %1.</translation>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>Pronašli smo adresu koja se ponavlja. U svakom plaćanju program može svaku adresu koristiti samo jedanput.</translation>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation>Generirani novčići moraju pričekati nastanak 120 blokova prije nego što ih je moguće potrošiti. Kad ste generirali taj blok, on je bio emitiran u mrežu kako bi bio dodan postojećim lancima blokova. Ako ne uspije biti dodan, njegov status bit će promijenjen u "nije prihvatljiv" i on neće biti potrošiv. S vremena na vrijeme tako nešto se može desiti ako neki drugi nod približno istovremeno generira blok.</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation>Oblik</translation>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>&Iznos:</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>&Primatelj plaćanja:</translation>
</message>
<message>
<location line="+34"/>
<source>The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+60"/>
<location filename="../sendcoinsentry.cpp" line="+26"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>Unesite oznaku za ovu adresu kako bi ju dodali u vaš adresar</translation>
</message>
<message>
<location line="-78"/>
<source>&Label:</source>
<translation>&Oznaka:</translation>
</message>
<message>
<location line="+28"/>
<source>Choose address from address book</source>
<translation>Odaberite adresu iz adresara</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation>Zalijepi adresu iz međuspremnika</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation>Ukloni ovog primatelja</translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a YardSaleCoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation>Unesite YardSaleCoin adresu (npr. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>&Sign Message</source>
<translation>&Potpišite poruku</translation>
</message>
<message>
<location line="+6"/>
<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>Možete potpisati poruke sa svojom adresom kako bi dokazali da ih posjedujete. Budite oprezni da ne potpisujete ništa mutno, jer bi vas phishing napadi mogli na prevaru natjerati da prepišete svoj identitet njima. Potpisujte samo detaljno objašnjene izjave sa kojima se slažete.</translation>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation>Unesite YardSaleCoin adresu (npr. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation>
</message>
<message>
<location line="+10"/>
<location line="+213"/>
<source>Choose an address from the address book</source>
<translation>Odaberite adresu iz adresara</translation>
</message>
<message>
<location line="-203"/>
<location line="+213"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="-203"/>
<source>Paste address from clipboard</source>
<translation>Zalijepi adresu iz međuspremnika</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation>Upišite poruku koju želite potpisati ovdje</translation>
</message>
<message>
<location line="+7"/>
<source>Signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Copy the current signature to the system clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this YardSaleCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all sign message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>Obriši &sve</translation>
</message>
<message>
<location line="-87"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation>Unesite YardSaleCoin adresu (npr. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified YardSaleCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Verify &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a YardSaleCoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation>Unesite YardSaleCoin adresu (npr. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Enter YardSaleCoin signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<location filename="../splashscreen.cpp" line="+22"/>
<source>The YardSaleCoin developers</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+20"/>
<source>Open until %1</source>
<translation>Otvoren do %1</translation>
</message>
<message>
<location line="+6"/>
<source>%1/offline</source>
<translation>%1 nije dostupan</translation>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1/nepotvrđeno</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>%1 potvrda</translation>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation>Status</translation>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Datum</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation>Generiran</translation>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation>Od</translation>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation>Za</translation>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation>oznaka</translation>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation>Uplaćeno</translation>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation>Nije prihvaćeno</translation>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation>Zaduženje</translation>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation>Naknada za transakciju</translation>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation>Neto iznos</translation>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>Poruka</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation>Komentar</translation>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 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, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation>Generirani novčići moraju pričekati nastanak 120 blokova prije nego što ih je moguće potrošiti. Kad ste generirali taj blok, on je bio emitiran u mrežu kako bi bio dodan postojećim lancima blokova. Ako ne uspije biti dodan, njegov status bit će promijenjen u "nije prihvaćen" i on neće biti potrošiv. S vremena na vrijeme tako nešto se može desiti ako neki drugi nod generira blok u približno isto vrijeme.</translation>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Inputs</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>Iznos</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-209"/>
<source>, has not been successfully broadcast yet</source>
<translation>, još nije bio uspješno emitiran</translation>
</message>
<message numerus="yes">
<location line="-35"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+70"/>
<source>unknown</source>
<translation>nepoznato</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation>Detalji transakcije</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Ova panela prikazuje detaljni opis transakcije</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+225"/>
<source>Date</source>
<translation>Datum</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>Tip</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adresa</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>Iznos</translation>
</message>
<message numerus="yes">
<location line="+57"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+3"/>
<source>Open until %1</source>
<translation>Otvoren do %1</translation>
</message>
<message>
<location line="+3"/>
<source>Offline (%1 confirmations)</source>
<translation>Nije na mreži (%1 potvrda)</translation>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation>Nepotvrđen (%1 od %2 potvrda)</translation>
</message>
<message>
<location line="+3"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Potvrđen (%1 potvrda)</translation>
</message>
<message numerus="yes">
<location line="+8"/>
<source>Mined balance will be available when it matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+5"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Generirano - Upozorenje: ovaj blok nije bio primljen od strane bilo kojeg drugog noda i vjerojatno neće biti prihvaćen!</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>Generirano, ali nije prihvaćeno</translation>
</message>
<message>
<location line="+43"/>
<source>Received with</source>
<translation>Primljeno s</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation>Primljeno od</translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>Poslano za</translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>Plaćanje samom sebi</translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>Rudareno</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>(n/d)</translation>
</message>
<message>
<location line="+199"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Status transakcije</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>Datum i vrijeme kad je transakcija primljena</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>Vrsta transakcije.</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>Odredište transakcije</translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>Iznos odbijen od ili dodan k saldu.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+52"/>
<location line="+16"/>
<source>All</source>
<translation>Sve</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>Danas</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>Ovaj tjedan</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>Ovaj mjesec</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>Prošli mjesec</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>Ove godine</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>Raspon...</translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>Primljeno s</translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>Poslano za</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>Tebi</translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>Rudareno</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>Ostalo</translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation>Unesite adresu ili oznaku za pretraživanje</translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation>Min iznos</translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>Kopirati adresu</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Kopirati oznaku</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Kopiraj iznos</translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>Izmjeniti oznaku</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+139"/>
<source>Export Transaction Data</source>
<translation>Izvoz podataka transakcija</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Datoteka podataka odvojenih zarezima (*.csv)</translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation>Potvrđeno</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Datum</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>Tip</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>Oznaka</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Adresa</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>Iznos</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation>Izvoz pogreške</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Ne mogu pisati u datoteku %1.</translation>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation>Raspon:</translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation>za</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+193"/>
<source>Send Coins</source>
<translation>Slanje novca</translation>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<location filename="../walletview.cpp" line="+42"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Export the data in the current tab to a file</source>
<translation>Izvoz podataka iz trenutnog taba u datoteku</translation>
</message>
<message>
<location line="+193"/>
<source>Backup Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Backup Successful</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The wallet data was successfully saved to the new location.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+94"/>
<source>YardSaleCoin version</source>
<translation>YardSaleCoin verzija</translation>
</message>
<message>
<location line="+102"/>
<source>Usage:</source>
<translation>Upotreba:</translation>
</message>
<message>
<location line="-29"/>
<source>Send command to -server or yardsalecoind</source>
<translation>Pošalji komandu usluzi -server ili yardsalecoind</translation>
</message>
<message>
<location line="-23"/>
<source>List commands</source>
<translation>Prikaži komande</translation>
</message>
<message>
<location line="-12"/>
<source>Get help for a command</source>
<translation>Potraži pomoć za komandu</translation>
</message>
<message>
<location line="+24"/>
<source>Options:</source>
<translation>Postavke:</translation>
</message>
<message>
<location line="+24"/>
<source>Specify configuration file (default: yardsalecoin.conf)</source>
<translation>Odredi konfiguracijsku datoteku (ugrađeni izbor: yardsalecoin.conf)</translation>
</message>
<message>
<location line="+3"/>
<source>Specify pid file (default: yardsalecoind.pid)</source>
<translation>Odredi proces ID datoteku (ugrađeni izbor: yardsalecoin.pid)</translation>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation>Odredi direktorij za datoteke</translation>
</message>
<message>
<location line="-9"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation>Postavi cache za bazu podataka u MB (zadano:25)</translation>
</message>
<message>
<location line="-28"/>
<source>Listen for connections on <port> (default: 9555 or testnet: 19333)</source>
<translation>Slušaj na <port>u (default: 9555 ili testnet: 19333)</translation>
</message>
<message>
<location line="+5"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>Održavaj najviše <n> veza sa članovima (default: 125)</translation>
</message>
<message>
<location line="-48"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<source>Specify your own public address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Prag za odspajanje članova koji se čudno ponašaju (default: 100)</translation>
</message>
<message>
<location line="-134"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Broj sekundi koliko se članovima koji se čudno ponašaju neće dopustiti da se opet spoje (default: 86400)</translation>
</message>
<message>
<location line="-29"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Listen for JSON-RPC connections on <port> (default: 9554 or testnet: 19332)</source>
<translation>Prihvaćaj JSON-RPC povezivanje na portu broj <port> (ugrađeni izbor: 9554 or testnet: 19332)</translation>
</message>
<message>
<location line="+37"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Prihvati komande iz tekst moda i JSON-RPC</translation>
</message>
<message>
<location line="+76"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Izvršavaj u pozadini kao uslužnik i prihvaćaj komande</translation>
</message>
<message>
<location line="+37"/>
<source>Use the test network</source>
<translation>Koristi test mrežu</translation>
</message>
<message>
<location line="-112"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-80"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=yardsalecoinrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "YardSaleCoin Alert" admin@foo.com
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Cannot obtain a lock on data directory %s. YardSaleCoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation>Upozorenje: -paytxfee je podešen na preveliki iznos. To je iznos koji ćete platiti za obradu transakcije.</translation>
</message>
<message>
<location line="+3"/>
<source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong YardSaleCoin will not work properly.</source>
<translation>Upozorenje: Molimo provjerite jesu li datum i vrijeme na vašem računalu točni. Ako vaš sat ide krivo, YardSaleCoin neće raditi ispravno.</translation>
</message>
<message>
<location line="+3"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Block creation options:</source>
<translation>Opcije za kreiranje bloka:</translation>
</message>
<message>
<location line="+5"/>
<source>Connect only to the specified node(s)</source>
<translation>Poveži se samo sa određenim nodom</translation>
</message>
<message>
<location line="+3"/>
<source>Corrupted block database detected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Do you want to rebuild the block database now?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error initializing block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error initializing wallet database environment %s!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error opening block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: Wallet locked, unable to create transaction!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: system error: </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to sync block index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write file info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write to coin database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write transaction index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write undo data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Find peers using DNS lookup (default: 1 unless -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Generate coins (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 288, 0 = all)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-4, default: 3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Not enough file descriptors available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Rebuild block chain index from current blk000??.dat files</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Set the number of threads to service RPC calls (default: 4)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+26"/>
<source>Verifying blocks...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Verifying wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-69"/>
<source>Imports blocks from external blk000??.dat file</source>
<translation>Importiraj blokove sa vanjskog blk000??.dat fajla</translation>
</message>
<message>
<location line="-76"/>
<source>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+77"/>
<source>Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Invalid -tor address: '%s'</source>
<translation>Nevaljala -tor adresa: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -minrelaytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -mintxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Maintain a full transaction index (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Only accept block chain matching built-in checkpoints (default: 1)</source>
<translation>Prihvati samo lance blokova koji se podudaraju sa ugrađenim checkpoint-ovima (default: 1)</translation>
</message>
<message>
<location line="+1"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Prepend debug output with timestamp</source>
<translation>Dodaj izlaz debuga na početak sa vremenskom oznakom</translation>
</message>
<message>
<location line="+5"/>
<source>SSL options: (see the YardSaleCoin Wiki for SSL setup instructions)</source>
<translation>SSL postavke: (za detalje o podešavanju SSL opcija vidi YardSaleCoin Wiki)</translation>
</message>
<message>
<location line="+1"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Šalji trace/debug informacije na konzolu umjesto u debug.log datoteku</translation>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation>Pošalji trace/debug informacije u debugger</translation>
</message>
<message>
<location line="+5"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation>Podesite maksimalnu veličinu bloka u bajtovima (default: 250000)</translation>
</message>
<message>
<location line="+1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation>Podesite minimalnu veličinu bloka u bajtovima (default: 0)</translation>
</message>
<message>
<location line="+2"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Signing transaction failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation>Odredi vremenski prozor za spajanje na mrežu u milisekundama (ugrađeni izbor: 5000)</translation>
</message>
<message>
<location line="+4"/>
<source>System error: </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Transaction amount too small</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transaction amounts must be positive</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transaction too large</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation>Pokušaj koristiti UPnP da otvoriš port za uslugu (default: 0)</translation>
</message>
<message>
<location line="+1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>Pokušaj koristiti UPnP da otvoriš port za uslugu (default: 1 when listening)</translation>
</message>
<message>
<location line="+1"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Username for JSON-RPC connections</source>
<translation>Korisničko ime za JSON-RPC veze</translation>
</message>
<message>
<location line="+4"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>You need to rebuild the databases using -reindex to change -txindex</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-50"/>
<source>Password for JSON-RPC connections</source>
<translation>Lozinka za JSON-RPC veze</translation>
</message>
<message>
<location line="-67"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Dozvoli JSON-RPC povezivanje s određene IP adrese</translation>
</message>
<message>
<location line="+76"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Pošalji komande nodu na adresi <ip> (ugrađeni izbor: 127.0.0.1)</translation>
</message>
<message>
<location line="-120"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>Izvršite naredbu kada se najbolji blok promjeni (%s u cmd je zamjenjen sa block hash)</translation>
</message>
<message>
<location line="+147"/>
<source>Upgrade wallet to latest format</source>
<translation>Nadogradite novčanik u posljednji format.</translation>
</message>
<message>
<location line="-21"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>Podesi memorijski prostor za ključeve na <n> (ugrađeni izbor: 100)</translation>
</message>
<message>
<location line="-12"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Ponovno pretraži lanac blokova za transakcije koje nedostaju</translation>
</message>
<message>
<location line="+35"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Koristi OpenSSL (https) za JSON-RPC povezivanje</translation>
</message>
<message>
<location line="-26"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Uslužnikov SSL certifikat (ugrađeni izbor: server.cert)</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>Uslužnikov privatni ključ (ugrađeni izbor: server.pem)</translation>
</message>
<message>
<location line="-151"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation>Prihvaljivi načini šifriranja (ugrađeni izbor: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation>
</message>
<message>
<location line="+165"/>
<source>This help message</source>
<translation>Ova poruka za pomoć</translation>
</message>
<message>
<location line="+6"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation>Program ne može koristiti %s na ovom računalu (bind returned error %d, %s)</translation>
</message>
<message>
<location line="-91"/>
<source>Connect through socks proxy</source>
<translation>Poveži se kroz socks proxy</translation>
</message>
<message>
<location line="-10"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>Dozvoli DNS upite za dodavanje nodova i povezivanje</translation>
</message>
<message>
<location line="+55"/>
<source>Loading addresses...</source>
<translation>Učitavanje adresa...</translation>
</message>
<message>
<location line="-35"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>Greška kod učitavanja wallet.dat: Novčanik pokvaren</translation>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat: Wallet requires newer version of YardSaleCoin</source>
<translation>Greška kod učitavanja wallet.dat: Novčanik zahtjeva noviju verziju YardSaleCoina</translation>
</message>
<message>
<location line="+93"/>
<source>Wallet needed to be rewritten: restart YardSaleCoin to complete</source>
<translation>Novčanik je trebao prepravak: ponovo pokrenite YardSaleCoin</translation>
</message>
<message>
<location line="-95"/>
<source>Error loading wallet.dat</source>
<translation>Greška kod učitavanja wallet.dat</translation>
</message>
<message>
<location line="+28"/>
<source>Invalid -proxy address: '%s'</source>
<translation>Nevaljala -proxy adresa: '%s'</translation>
</message>
<message>
<location line="+56"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-96"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>Nevaljali iznos za opciju -paytxfee=<amount>: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount</source>
<translation>Nevaljali iznos za opciju</translation>
</message>
<message>
<location line="-6"/>
<source>Insufficient funds</source>
<translation>Nedovoljna sredstva</translation>
</message>
<message>
<location line="+10"/>
<source>Loading block index...</source>
<translation>Učitavanje indeksa blokova...</translation>
</message>
<message>
<location line="-57"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Unesite nod s kojim se želite spojiti and attempt to keep the connection open</translation>
</message>
<message>
<location line="-25"/>
<source>Unable to bind to %s on this computer. YardSaleCoin is probably already running.</source>
<translation>Program ne može koristiti %s na ovom računalu. YardSaleCoin program je vjerojatno već pokrenut.</translation>
</message>
<message>
<location line="+64"/>
<source>Fee per KB to add to transactions you send</source>
<translation>Naknada posredniku po KB-u koja će biti dodana svakoj transakciji koju pošalješ</translation>
</message>
<message>
<location line="+19"/>
<source>Loading wallet...</source>
<translation>Učitavanje novčanika...</translation>
</message>
<message>
<location line="-52"/>
<source>Cannot downgrade wallet</source>
<translation>Nije moguće novčanik vratiti na prijašnju verziju.</translation>
</message>
<message>
<location line="+3"/>
<source>Cannot write default address</source>
<translation>Nije moguće upisati zadanu adresu.</translation>
</message>
<message>
<location line="+64"/>
<source>Rescanning...</source>
<translation>Rescaniranje</translation>
</message>
<message>
<location line="-57"/>
<source>Done loading</source>
<translation>Učitavanje gotovo</translation>
</message>
<message>
<location line="+82"/>
<source>To use the %s option</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-74"/>
<source>Error</source>
<translation>Greška</translation>
</message>
<message>
<location line="-31"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation type="unfinished"/>
</message>
</context>
</TS>
|
yardsalecoin/yardsalecoin
|
src/qt/locale/bitcoin_hr.ts
|
TypeScript
|
mit
| 107,476
|
from copy import deepcopy
import settings
from twitch.player_manager import PlayerManager
class QuestPlayerManager(PlayerManager):
"""
Functions like add_gold perform a raw store action and then save. __add_gold is the raw store action in this case.
Properties of raw store actions:
- Call username.lower()
- Touch self.players with that name
- Do not save to file
Properties of store actions:
- Do nothing other than call a raw action and then save
Some actions can also take a list of elements. These are all of the form:
def foo(username **kwargs):
if not (isinstance(username), str):
for user in username:
foo(username, **kwargs)
else:
ORIGINAL FUNCTION BODY
Note that both store actions and raw store actions qualify for this.
"""
default_player = deepcopy(PlayerManager.default_player)
default_player.update({
'exp': 0,
'prestige': 0,
'gold': 0,
'items': {}
})
def __add_gold(self, username, gold, prestige_benefits=True):
"""
Gives gold to the specified player.
:param username: str - The player who you are modifying
:param gold: float - How much gold to give that player
:param prestige_benefits: bool - Whether this gold increase is affected by prestige bonuses
"""
# Don't magnify negative amounts of gold
if prestige_benefits and gold > 0:
gold *= 1 + self.players[username]['prestige'] * settings.PRESTIGE_GOLD_AMP
self.players[username]['gold'] += gold
if self.players[username]['gold'] < 0:
self.players[username]['gold'] = 0
def add_gold(self, username, gold, prestige_benefits=True):
"""
Gives gold to the specified player.
:param username: str - The player who you are modifying
:param gold: float - How much gold to give that player
:param prestige_benefits: bool - Whether this gold increase is affected by prestige bonuses
"""
self.__add_gold(username, gold, prestige_benefits=prestige_benefits)
self.save_player(username)
def __add_exp(self, username, exp):
"""
Gives exp to the specified player.
:param username: str - The player who you are modifying
:param exp: float - How much exp to give that player
"""
self.players[username]['exp'] += exp
def add_exp(self, username, exp):
"""
Gives exp to the specified player.
:param username: str - The player who you are modifying
:param exp: float - How much exp to give that player
"""
self.__add_exp(username, exp)
self.save_player(username)
def __add_item(self, username, item):
"""
Item to give to the specified player.
:param username: str - The player who you are modifying
:param item: str or list<str> - The name of the item(s) we are giving to the player
"""
if not isinstance(item, str):
# We must be a list of items
for single_item in item:
self.__add_item(username, single_item)
else:
if item not in self.players[username]['items']:
self.players[username]['items'][item] = 1
else:
self.players[username]['items'][item] += 1
def add_item(self, username, item):
"""
Item to give to the specified player.
:param username: str - The player who you are modifying
:param item: str or list<str> - The name of the item(s) we are giving to the player
"""
self.__add_item(username, item)
self.save_player(username)
def __remove_item(self, username, item):
"""
Item to take from the specified player.
:param username: str - The player who you are modifying
:param item: str or list<str> - The name of the item(s) we are giving to the player
"""
if not isinstance(item, str):
# We must be a list of items
for single_item in item:
self.__remove_item(username, single_item)
else:
# If we don't have the item, do nothing
if item in self.players[username]['items']:
self.players[username]['items'][item] -= 1
if self.players[username]['items'][item] <= 0:
del self.players[username]['items'][item]
def remove_item(self, username, item):
"""
Item to take from the specified player.
:param username: str - The player who you are modifying
:param item: str or list<str> - The name of the item(s) we are giving to the player
"""
self.__remove_item(username, item)
self.save_player(username)
def __reward(self, username, gold=0, exp=0, item=None, prestige_benefits=True):
"""
Gives gold and exp to the specified player.
:param username: str - The player who you are modifying
:param gold: float - How much gold to give that player
:param exp: float - How much exp to give that player
"""
if not isinstance(username, str):
# We must be a list of users
for user in username:
self.__reward(user, gold=gold, exp=exp, item=item, prestige_benefits=prestige_benefits)
else:
self.__add_gold(username, gold, prestige_benefits=prestige_benefits)
self.__add_exp(username, exp)
if item:
self.__add_item(username, item)
def reward(self, username, gold=0, exp=0, item=None, prestige_benefits=True):
"""
Gives gold and exp to the specified player(s).
:param username: str or list<str> - The player(s) who you are modifying
:param gold: float - How much gold to give that player
:param exp: float - How much exp to give that player
"""
if not isinstance(username, str):
# We must be a list of users
for user in username:
self.reward(user, gold=gold, exp=exp, item=item, prestige_benefits=prestige_benefits)
else:
self.__reward(username, gold=gold, exp=exp, item=item, prestige_benefits=prestige_benefits)
self.save_player(username)
def __penalize(self, username, gold=0, exp=0, item=None, prestige_benefits=True):
"""
Gives gold and exp to the specified player(s).
:param username: str or list<str> - The player(s) who you are modifying
:param gold: float - How much gold to give that player
:param exp: float - How much exp to give that player
"""
if not isinstance(username, str):
# We must be a list of users
for user in username:
self.__penalize(user, gold=gold, exp=exp, item=item, prestige_benefits=prestige_benefits)
else:
self.__reward(username, gold=-gold, exp=-exp, item=None, prestige_benefits=prestige_benefits)
if item:
self.__remove_item(username, item)
def penalize(self, username, gold=0, exp=0, item=None, prestige_benefits=True):
"""
Gives gold and exp to the specified player(s).
:param username: str or list<str> - The player(s) who you are modifying
:param gold: float - How much gold to give that player
:param exp: float - How much exp to give that player
"""
if not isinstance(username, str):
# We must be a list of users
for user in username:
self.penalize(user, gold=gold, exp=exp, item=item, prestige_benefits=prestige_benefits)
else:
self.__penalize(username, gold=gold, exp=exp, item=item, prestige_benefits=prestige_benefits)
self.save_player(username)
def get_gold(self, username):
"""
Gets how much gold a given player has.
:param username: str - The player who you are modifying
"""
return self.players[username]['gold']
def get_exp(self, username):
"""
Gets how much exp a given player has.
:param username: str - The player who you are modifying
"""
return self.players[username]['exp']
@staticmethod
def exp_to_level(exp):
# The value for every member of the list is the minimum experience to be a given level
for level, exp_req in enumerate(settings.EXP_LEVELS, start=-1):
if exp < exp_req:
return level
return settings.LEVEL_CAP
def get_level(self, username):
"""
Gets what level a given player is.
:param username: str - The player who you are modifying
"""
exp = self.players[username]['exp']
return self.exp_to_level(exp)
def get_prestige(self, username):
"""
Gets what prestige level a given player is.
:param username: str - The player who you are modifying
"""
return self.players[username]['prestige']
def get_items(self, username):
"""
Gets the items of a given player.
:param username: str - The player who you are modifying
"""
return self.players[username]['items']
def prestige(self, username):
"""
Prestige advances a player.
:param username: str - The player who you are modifying
:return: bool - True if successfully prestiged, False if no change
"""
if self.players[username]['exp'] >= settings.EXP_LEVELS[settings.LEVEL_CAP] and (
self.players[username]['gold'] >= settings.PRESTIGE_COST):
self.players[username]['exp'] -= settings.EXP_LEVELS[settings.LEVEL_CAP]
self.players[username]['gold'] -= settings.PRESTIGE_COST
self.players[username]['prestige'] += 1
self.save_player(username)
return True
else:
return False
@staticmethod
def list_items(items):
msg = ''
for item, quantity in items.items():
if quantity <= 0:
continue
if quantity == 1:
msg += '{}, '.format(item)
else:
msg += '{} ({}), '.format(item, quantity)
msg = msg.rstrip(', ')
return msg
def whisper_stats(self, username):
"""
Whispers a player their relevant stats.
:param username: str - The player who is requesting stat information
"""
player = self.players[username]
msg = '{}Level: {} ({} Exp), Gold: {}{}'.format(
'Prestige: {}, '.format(player['prestige']) if player['prestige'] else '',
self.get_level(username), round(player['exp'], 1), round(player['gold'], 1),
', Items: {}'.format(self.list_items(player['items'])) if player['items'] else '')
self.bot.send_whisper(username, msg)
def save_player(self, username):
"""
Saves a specific player's data to persistent storage. Deletes items with quantity 0 or less.
:param username: str - The player whose data you want to save
"""
# Remove duplicate items. Doesn't use a dict comprehension because items is a custom dict type
remove_items = []
for item, quantity in self.players[username]['items'].items():
if quantity <= 0:
remove_items.append(item)
for remove_item in remove_items:
del self.players[username]['items'][remove_item]
super().save_player(username)
|
Xelaadryth/Xelabot
|
quest_bot/quest_player_manager.py
|
Python
|
mit
| 11,668
|
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace WestBlueGolfLeagueWeb.Controllers.Filters
{
public class WestBlueHandleErrorAttribute : HandleErrorAttribute
{
private static readonly ILog Logger = LogManager.GetLogger(typeof(WestBlueHandleErrorAttribute));
public override void OnException(ExceptionContext filterContext)
{
base.OnException(filterContext);
if (filterContext != null && filterContext.Exception != null)
{
Logger.Error("Exception executing controller action", filterContext.Exception);
}
}
}
}
|
tahoeWolverine/WestBlueGolfLeague
|
WestBlueGolfLeagueWeb/WestBlueGolfLeagueWeb/Controllers/Filters/WestBlueHandleErrorAttribute.cs
|
C#
|
mit
| 706
|
# Change Log
## 0.0.5 (2015-07-17)
* Add support for `403` Fobidden response.
* Update testcases with Express 4.x changes (body-parser).
* Bump dependencies - express 3.4.8 → 4.13.1, mocha 1.17.1 → 2.2.5, supertest 0.9.0 → 1.0.1.
* Add Travis builds for Node 0.12 and iojs.
## 0.0.4 (2014-12-24)
* Fix deprecation warnings thrown by Express 4.
* Add requireHeaders() method to support checking for headers.
## 0.0.3 (2014-03-08)
* When testing for required params in `requireParams()`, use `hasOwnProperty()` and check for params in `req.params` in addition to `req.body` and `req.query`
## 0.0.2 (2014-03-06)
* Fix bug in `requireParams()` (Issue #1)
* Upgrade dependency versions
## 0.0.1 (2013-03-10)
* First version
|
paambaati/express-api-helper
|
CHANGELOG.md
|
Markdown
|
mit
| 750
|
import polarToCartesian from '../src/utils/polarToCartesian';
describe('GridUtils', () => {
describe('polarToCartesian', () => {
const config = {
radius: 20,
angle: 20,
};
it('should return cartesian output for the given polar input config', () => {
const expected = {
x: config.radius * Math.cos(config.angle),
y: config.radius * Math.sin(config.angle),
};
expect(polarToCartesian(config)).toEqual(expected);
});
});
});
|
hshoff/vx
|
packages/visx-grid/test/utils.test.ts
|
TypeScript
|
mit
| 489
|
/*
notes
getBoolPref is not a function
http://comments.gmane.org/gmane.comp.mozilla.project-owners/241
*/
//*********** export named single global object while using shorthand internally
var spenibus_zoomMonitor = (function() {
//************************************************************** run on load
window.addEventListener('load', (function f(){
// remove init listener
window.removeEventListener('load', f, false);
// init
//s.init.call(s);
s.init();
}), false);
//******************************************************* internal shorthand
var s = {};
//***************************************************************** elements
s.nodeMain = null;
s.nodeLabel = null;
s.nodeMenu = null;
//************************************************************ prefs service
s.ps = null;
//************************************************************** node getter
s.nodeGet = function(id) {
// try document first
var n = document.getElementById(id);
// try toolbar palette if document yielded nothing
if(n == null) {
n = gNavToolbox.palette.querySelector('#'+id);
}
return n;
};
//***************************************************** check full-page mode
s.fullGet = function() {
return s.ps.getBoolPref("browser.zoom.full");
};
//******************************************************* zoom values getter
s.zoomValuesGet = function() {
return s.ps.getCharPref("toolkit.zoomManager.zoomValues")
.split(",")
.reverse();
};
//************************************************************** zoom setter
s.zoomSet = function(z) {
// change relevant zoom value
s.fullGet()
? gBrowser.selectedBrowser.markupDocumentViewer.fullZoom = z
: gBrowser.selectedBrowser.markupDocumentViewer.textZoom = z;
// update ui
s.updateUI();
};
//*************************************************************** ui updater
s.updateUI = function(e) {
// main display
s.nodeLabel.innerHTML = s.fullGet()
? 'F'+Math.round(gBrowser.selectedBrowser.markupDocumentViewer.fullZoom * 100)+'%'
: 'T'+Math.round(gBrowser.selectedBrowser.markupDocumentViewer.textZoom * 100)+'%';
// get current zoom level
var currentZoom = s.fullGet()
? gBrowser.selectedBrowser.markupDocumentViewer.fullZoom
: gBrowser.selectedBrowser.markupDocumentViewer.textZoom;
var currentZoomPercentage = Math.round(currentZoom*100);
// get zoom values
var list = s.zoomValuesGet();
// clear menu
s.nodeMenu.innerHTML = '';
// build menu
for(var i=0; i<list.length; ++i) {
var zoomFactor = list[i];
var zoomPercentage = Math.round(zoomFactor*100);
// create menu item
var item = document.createElement('menuitem');
// set attributes
item.setAttribute('label', zoomPercentage+'%');
item.setAttribute('data-zoom', zoomFactor);
// highlight current zoom
if(currentZoomPercentage == zoomPercentage) {
item.classList.add("current");
}
// set command
item.addEventListener("command", function(e){
s.zoomSet(e.target.getAttribute('data-zoom'));
}, false);
// add item to menu
s.nodeMenu.appendChild(item);
}
};
//********************************************************************* init
s.init = function() {
// prefs service
s.ps = Components
.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService)
.QueryInterface(Components.interfaces.nsIPrefBranch);
// get elements
s.nodeMain = s.nodeGet('spenibus_zoom_monitor_main');
s.nodeLabel = s.nodeGet('spenibus_zoom_monitor_label');
s.nodeMenu = s.nodeGet('spenibus_zoom_monitor_menu');
// override native function: enlarge/reduce
FullZoom._applyZoomToPrefOriginal = FullZoom._applyZoomToPref;
FullZoom._applyZoomToPref = function() {
FullZoom._applyZoomToPrefOriginal.apply(this, arguments);
s.updateUI();
}
// override native function: reset
FullZoom._removePrefOriginal = FullZoom._removePref;
FullZoom._removePref = function() {
FullZoom._removePrefOriginal.apply(this, arguments);
s.updateUI();
}
// event callback
var callback = function(){
s.updateUI.call(s);
}
// observe certain events
gBrowser.tabContainer.addEventListener("TabOpen", callback, false);
gBrowser.tabContainer.addEventListener("TabSelect", callback, false);
gBrowser.addEventListener("pageshow", callback, false);
gBrowser.addEventListener("click", callback, false);
// update ui
s.updateUI();
};
//******************************************************************* export
return s;
})();
|
spenibus/zoom-monitor-firefox-addon
|
content/overlay.js
|
JavaScript
|
mit
| 5,593
|
//==============================================================================
// TorqueLab -> MeshRoadEditor - Road Manager - NodeData
// Copyright (c) 2015 All Right Reserved, http://nordiklab.com/
//------------------------------------------------------------------------------
//==============================================================================
//==============================================================================
// TerrainObject Functions
//==============================================================================
//==============================================================================
//RoadManager.updateNodeStack();
function RoadManager::updateNodeStack(%this) {
REP_NodePillSampleStack.visible = 0;
REP_NodePillStack.visible = 1;
%stack = REP_NodePillStack;
%stack.visible = 1;
%stack.clear();
for(%i=0; %i<RoadManager.nodeCount; %i++) {
%this.addNodePillToStack(%i);
}
}
function RoadManager::addNodePillToStack(%this,%nodeId) {
%fieldData = RoadManager.nodeData[%nodeId];
%pos = getField(%fieldData,0);
%width = getField(%fieldData,1);
RoadManager.nodeListModeId = 1;
switch$(RoadManager.nodeListModeId) {
case "0":
%pill = cloneObject(REP_NodePillLinkSample);
case "1":
%pill = cloneObject(REP_NodePillSample);
%pill-->Width.setText(%width);
%pill-->Width.updateFriends();
%pill-->Width.pill = %pill;
%pill-->Width_slider.pill = %pill;
%pill-->PosX.text = %pos.x;
%pill-->PosY.text = %pos.y;
%pill-->PosZ.text = %pos.z;
%pill-->PosX.pill = %pill;
%pill-->PosY.pill = %pill;
%pill-->PosZ.pill = %pill;
}
%pill-->Linked.text = " ";
%pill-->buttonNode.text = "Node #\c1"@%nodeId;
%pill-->buttonNode.command = "RoadManager.selectNode("@%nodeId@");";
%pill-->deleteButton.command = "RoadManager.deleteNodeId("@%nodeId@");";
%pill-->Linked.setStateOn(false);
%pill.superClass = "REP_NodePill";
%pill.internalName = "NodePill_"@%nodeId;
%pill.nodeId = %nodeId;
%pill-->Linked.pill = %pill;
%pill.linkCheck = %pill-->Linked;
REP_NodePillStack.add(%pill);
RoadEd_TabPageNode-->roadNodePageTitle.setText("Road have \c1"@RoadManager.nodeCount@"\c0 Nodes");
}
//==============================================================================
// Update Node
//==============================================================================
//==============================================================================
function REP_SingleNodeEdit::onValidate(%this) {
%type = %this.internalName;
RoadManager.updateNodeSetting("",%type,%this.getText());
}
//------------------------------------------------------------------------------
//==============================================================================
function RoadManager::updateNodeSetting(%this,%node,%field,%value,%isLink) {
%this.noNodeUpdate = true;
if (%node $= "")
%node = RoadEditorGui.getSelectedNode();
else
RoadEditorGui.setSelectedNode(%node);
switch$(%field) {
case "width":
RoadEditorGui.setNodeWidth(%value);
case "PosX":
%posDiff = %position.x - %value;
%position = RoadEditorGui.getNodePosition();
if (%isLink)
%position.x = %position.x + %value;
else
%position.x = %value;
RoadEditorGui.setNodePosition(%position);
case "PosY":
%posDiff = %position.y - %value;
%position = RoadEditorGui.getNodePosition();
if (%isLink)
%position.y = %position.y + %value;
else
%position.y = %value;
RoadEditorGui.setNodePosition(%position);
case "PosZ":
%posDiff = %position.z - %value;
%position = RoadEditorGui.getNodePosition();
if (%isLink)
%position.z = %position.z + %value;
else
%position.z = %value;
RoadEditorGui.setNodePosition(%position);
case "position":
if (%isLink) {
%position = RoadEditorGui.getNodePosition();
%value = VectorAdd(%position,%value);
} else {
%position = RoadEditorGui.getNodePosition();
%posDiff = VectorSub(%value,%position);
}
RoadEditorGui.setNodePosition(%value);
}
if ($REP_UpdateLinkedNodes && !%isLink) {
foreach$(%nodeLink in RoadManager.linkedList) {
if (%nodeLink $= %node)
continue;
if (%posDiff !$= "") {
%value = %posDiff;
}
%this.updateNodeSetting(%nodeLink,%field,%value,true);
}
RoadEditorGui.setSelectedNode(%node);
}
%this.noNodeUpdate = false;
}
//------------------------------------------------------------------------------
//==============================================================================
function RoadManager::updateNodeCtrlSetting(%this,%ctrl) {
//%pill = RoadManager.getParentPill(%ctrl);
%pill = %ctrl.pill;
%node = %pill.nodeId;
%fields = strreplace(%ctrl.internalName,"_"," ");
%field = getWord(%fields,0);
%value = %ctrl.getTypeValue();
%ctrl.updateFriends();
%this.updateNodeSetting(%node,%field,%value);
}
//------------------------------------------------------------------------------
//==============================================================================
function RoadManager::getParentPill(%this,%ctrl) {
%attempt = 0;
while(%attempt < 10) {
%parent = %ctrl.parentGroup;
if (%parent.superClass $= "REP_NodePill")
return %parent;
%ctrl = %parent;
%attempt++;
}
return "";
}
//------------------------------------------------------------------------------
//==============================================================================
function REP_NodeSlider::onMouseDragged(%this) {
%value = mFloatLength(%this.getValue(),3);
%this.setValue(%value);
RoadManager.updateNodeCtrlSetting(%this);
}
//------------------------------------------------------------------------------
//==============================================================================
function REP_NodeEdit::onValidate(%this) {
RoadManager.updateNodeCtrlSetting(%this);
}
//------------------------------------------------------------------------------
//==============================================================================
function REP_NodeListCheck::onClick(%this) {
RoadManager.onNodeSelected();
}
//------------------------------------------------------------------------------
//==============================================================================
function REP_MaterialSelect::setMaterial(%this,%materialName,%a1,%a2) {
devLog("REP_MaterialSelect::setMaterial(%this,%materialName,%a1,%a2)",%this,%materialName,%a1,%a2);
%type = %this.internalName;
%road = RoadManager.currentRoad;
if (!isObject(%road))
return;
MeshRoadInspector.inspect(%road);
%road.setFieldValue(%type@"Material",%materialName);
MeshRoadInspector.refresh();
MeshRoadInspector.apply();
%textEdit = MeshRoadEditorOptionsWindow.findObjectByInternalName(%type@"Material",true);
%textEdit.setText(%materialName);
}
//------------------------------------------------------------------------------
//==============================================================================
function REP_MaterialEdit::onValidate(%this) {
%type = %this.internalName;
}
//------------------------------------------------------------------------------
|
NordikLab/TorqueLab
|
tlab/roadEditor/nodeManager/nodeStack.cs
|
C#
|
mit
| 7,044
|
# 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::Appconfiguration::Mgmt::V2019_11_01_preview
module Models
#
# Defines values for ProvisioningState
#
module ProvisioningState
Creating = "Creating"
Updating = "Updating"
Deleting = "Deleting"
Succeeded = "Succeeded"
Failed = "Failed"
Canceled = "Canceled"
end
end
end
|
Azure/azure-sdk-for-ruby
|
management/azure_mgmt_appconfiguration/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/provisioning_state.rb
|
Ruby
|
mit
| 506
|
# 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::Security::Mgmt::V2019_01_01_preview
module Models
#
# Security assessment on a resource
#
class SecurityAssessment < Resource
include MsRestAzure
# @return [ResourceDetails]
attr_accessor :resource_details
# @return [String] User friendly display name of the assessment
attr_accessor :display_name
# @return [AssessmentStatus]
attr_accessor :status
# @return [Hash{String => String}] Additional data regarding the
# assessment
attr_accessor :additional_data
# @return [AssessmentLinks]
attr_accessor :links
#
# Mapper for SecurityAssessment class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'SecurityAssessment',
type: {
name: 'Composite',
class_name: 'SecurityAssessment',
model_properties: {
id: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'id',
type: {
name: 'String'
}
},
name: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'name',
type: {
name: 'String'
}
},
type: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'type',
type: {
name: 'String'
}
},
resource_details: {
client_side_validation: true,
required: true,
serialized_name: 'properties.resourceDetails',
type: {
name: 'Composite',
polymorphic_discriminator: 'source',
uber_parent: 'ResourceDetails',
class_name: 'ResourceDetails'
}
},
display_name: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'properties.displayName',
type: {
name: 'String'
}
},
status: {
client_side_validation: true,
required: true,
serialized_name: 'properties.status',
type: {
name: 'Composite',
class_name: 'AssessmentStatus'
}
},
additional_data: {
client_side_validation: true,
required: false,
serialized_name: 'properties.additionalData',
type: {
name: 'Dictionary',
value: {
client_side_validation: true,
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
links: {
client_side_validation: true,
required: false,
serialized_name: 'properties.links',
type: {
name: 'Composite',
class_name: 'AssessmentLinks'
}
}
}
}
}
end
end
end
end
|
Azure/azure-sdk-for-ruby
|
management/azure_mgmt_security/lib/2019-01-01-preview/generated/azure_mgmt_security/models/security_assessment.rb
|
Ruby
|
mit
| 3,934
|
<?php
namespace Controller;
use Framework\Helper\MainControllerHelper as Helper;
use Framework\Helper\Paginator;
class MainController extends AbstractController
{
/**
* Renders previously retrieved movie data or gets new data.
*
* @return string
*/
public function showMovies()
{
$context = $this->session->get('movie_data');
$page = $this->getQueryParam(
'page'
); // if there is no session data or nobody tried to go to a different page, show existing data
if (is_null($context) || !is_null($page) || !empty($page)) {
return $this->getFilteredMovies();
} else {
$html = $this->render('index', array('context' => $context));
$this->session->set('movie_data', null);
return $html;
}
}
/**
* Returns conditions for the repository query.
*
* @return array|null
*/
private function getConditions()
{
// if we have post data, return those
if ($this->request->isMethod('POST')) {
$conditions = $this->getPostParam('conditions');
$this->session->set('movie_query_conditions', $conditions);
return $conditions;
}
// else try getting them from session
$lastForm = $this->session->get('movie_query_conditions');
if (!is_null($lastForm)) {
return $lastForm;
}
// else, no data
return null;
}
/**
* Retrieves movies for displaying the main page.
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse|html
*/
public function getFilteredMovies()
{
$context = [
'movieList' => '',
'genreList' => '',
'conditions' => '',
'paginator' => '',
];
// get the repository
$movieRepository = $this->getRepository('movie');
// get the conditions for the query, if any
$conditions = $this->getConditions();
// structure data for running the query (no pagination just yet)
$queryConditions = Helper::prepareQueryData($conditions);
try {
// set default parameters for pagination
$currentPage = $this->getQueryParam('page');
$moviesPerPage = $conditions['pagination']['movies_per_page'];
// but if the get parameter for pagination is not empty, use that one instead
$moviesPerPageParam = $this->getQueryParam('movies_per_page');
if (!empty($moviesPerPageParam)) {
$moviesPerPage = $moviesPerPageParam;
}
// get results count for (potentially) filtered search
$totalMovies = $movieRepository->getFilteredMovieCount($queryConditions);
// get paginator and valid values for pagination
$paginator = new Paginator($currentPage, $totalMovies, $moviesPerPage);
$currentPage = $paginator->getCurrentPage();
$moviesPerPage = $paginator->getResultsPerPage();
// add pagination to query conditions
$queryConditions['pagination'] = array('page' => $currentPage, 'per_page' => $moviesPerPage);
// get results
$movies = $movieRepository->loadFilteredMovies($queryConditions);
// also get genres for displaying in the filters
$genreRepository = $this->getRepository('genre');
$genres = $genreRepository->loadAll();
// set context for rendering
$context = [
'movieList' => $movies,
'genreList' => $genres,
'conditions' => $conditions,
'paginator' => $paginator,
];
// store the results for later use
$this->session->set('movie_data', $context);
// go to/show homepage
if ($this->request->isMethod('POST')) {
return $this->redirectRoute('homepage');
} else {
return $this->render('index', $context);
}
} catch (Exception $ex) {
$this->addErrorMessage('Something went wrong while trying to talk to the database.');
return $this->render('index', $context);
}
}
}
|
noonlit/cinema
|
src/Controller/MainController.php
|
PHP
|
mit
| 4,320
|
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.42000
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My.Resources
'This class was auto-generated by the StronglyTypedResourceBuilder
'class via a tool like ResGen or Visual Studio.
'To add or remove a member, edit your .ResX file then rerun ResGen
'with the /str option, or rebuild your VS project.
'''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Returns the cached ResourceManager instance used by this class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Humidity_Calculator.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<summary>
''' Overrides the current thread's CurrentUICulture property for all
''' resource lookups using this strongly typed resource class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set(ByVal value As Global.System.Globalization.CultureInfo)
resourceCulture = value
End Set
End Property
End Module
End Namespace
|
haxtivitiez/Humidity_Calculator
|
My Project/Resources.Designer.vb
|
Visual Basic
|
mit
| 2,728
|
package com.alos.productcatalog.services;
import com.alos.productcatalog.exceptions.FailureException;
import com.alos.productcatalog.model.LocationIdentifier;
public interface CustomerLocationService {
/**
* Takes a customerID and returns a String that represents a location identifier.
* @param customerID
* @return a LocationIdentifier LONDON if the number is between 0 and 500 and LIVERPOOL if its between 501 and 1000
* @throws FailureException for numbers greater then 1000
*/
LocationIdentifier getCustomerLocationIdentifier(long customerID) throws FailureException;
}
|
Alos/product_catalogue
|
product-catalog/src/main/java/com/alos/productcatalog/services/CustomerLocationService.java
|
Java
|
mit
| 593
|
---
title: Clojure's forgotten for loop
labels: [clojure, tutorial]
tags: [clojure, functional, programming, tutorial]
---
Higher order functions in Clojure get a great deal of attention, and for good
reason. Clojure has a [rich standard library](http://www.clojureatlas.com/org.clojure:clojure:1.4.0.html) of functions which focus on purely transforming data. To those studying Clojure, the [for](https://www.conj.io/store/v1/org.clojure/clojure/1.8.0/clj/clojure.core/for) macro for list comprehension may stand out as verbose and awkward; it may also go entirely unnoticed.
### List comprehension
Many popular languages these days have [list comprehension](https://en.wikipedia.org/wiki/List_comprehension), more commonly [dynamic](https://en.wikipedia.org/wiki/Dynamic_programming_language) ones, and some are even rather [imperative](https://en.wikipedia.org/wiki/Imperative_programming), like Python. Here are some examples of how `for` can be used in Clojure.
#### Map
```clojure
(for [x (range 10 15)]
(str "|" x "|"))
; => ("|10|" "|11|" "|12|" "|13|" "|14|")
```
#### Filter
The `:when` modifier allows filtering, based on a predicate. Iteration won't be
stopped, but any iteration which doesn't yield truthy from the predicate will be
skipped. In contrast, the `:while` modifier allows early termination, based on a
predicate. The `:while` predicate can only return false once, since `for` will
stop iterating immediately and return the accumulated result.
```clojure
(for [x {:a 1 "b" 2 :c 3}
:when (-> x first keyword?)]
x)
; => ([:a 1] [:c 3])
(for [x (range 3)
y (range 3)
:when (not= x y)]
[x y])
; => ([0 1] [0 2] [1 0] [1 2] [2 0] [2 1])
(for [x (range 3)
y (range 3)
:while (not= x y)]
[x y])
; => ([1 0] [2 0] [2 1])
```
#### Create intermediate bindings
It's possible to create bindings per-iteration; they have access to all bindings
above them.
```clojure
(for [i (range 1 10)
:when (even? i)
:let [inverse (/ 1 i)]]
[i inverse])
; => ([2 1/2] [4 1/4] [6 1/6] [8 1/8])
```
#### Extract map values
It's possible to destructure within the bindings of `for`, allowing for easy
access to nested values.
```clojure
(for [[k v] {:a 1 :b 2 :c 3}]
v)
; => (1 2 3)
```
#### Nested iteration
Subsequent bindings in the `for` macro will cause nested iteration, each
subsequent binding iterating more quickly than the former.
```clojure
(for [c [:2 :3 :4 :5 :6 :7 :8 :9 :10 :J :Q :K :A]
s [:♠ :♥ :♣ :♦]]
[c s])
; => ([:2 :♠] [:2 :♥] [:2 :♣] [:2 :♦]
; [:3 :♠] [:3 :♥] [:3 :♣] [:3 :♦]
; [:4 :♠] [:4 :♥] [:4 :♣] [:4 :♦]
; [:5 :♠] [:5 :♥] [:5 :♣] [:5 :♦]
; [:6 :♠] [:6 :♥] [:6 :♣] [:6 :♦]
; [:7 :♠] [:7 :♥] [:7 :♣] [:7 :♦]
; [:8 :♠] [:8 :♥] [:8 :♣] [:8 :♦]
; [:9 :♠] [:9 :♥] [:9 :♣] [:9 :♦]
; [:10 :♠] [:10 :♥] [:10 :♣] [:10 :♦]
; [:J :♠] [:J :♥] [:J :♣] [:J :♦]
; [:Q :♠] [:Q :♥] [:Q :♣] [:Q :♦]
; [:K :♠] [:K :♥] [:K :♣] [:K :♦]
; [:A :♠] [:A :♥] [:A :♣] [:A :♦])
```
#### Pairwise disjoint sets
The nested looping can be used to flatten nested sequences.
```clojure
(defn pairwise-disjoint? [s]
(->> (for [s' s
r s']
r)
(apply distinct?)))
(pairwise-disjoint? #{#{:a :b :c :d :e}
#{:a :b :c :d}
#{:a :b :c}
#{:a :b}
#{:a}})
; => false
```
### Worth noting
Those coming from the imperative camp may look to `for` to achieve [side-effects](https://en.wikipedia.org/wiki/Side_effect_%28computer_science%29). That won't work well, since Clojure's `for` is lazy; if it's not consumed, it'll never be realized. It may also only be partially consumed. Instead, consider [doseq](https://www.conj.io/store/v1/org.clojure/clojure/1.8.0/clj/clojure.core/doseq).
Most of the time, using `map` or `filter` will be not only more clear, but also
more concise. If you want early termination, however, or nested iterations, it's
worthwhile to know the semantics of Clojure's `for`.
|
jeaye/jeaye.github.io
|
_posts/2016-07-27-clojure-for.md
|
Markdown
|
mit
| 4,190
|
# 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::IotHub::Mgmt::V2017_07_01
module Models
#
# The properties of an IoT hub.
#
class IotHubProperties
include MsRestAzure
# @return [Array<SharedAccessSignatureAuthorizationRule>] The shared
# access policies you can use to secure a connection to the IoT hub.
attr_accessor :authorization_policies
# @return [Array<IpFilterRule>] The IP filter rules.
attr_accessor :ip_filter_rules
# @return [String] The provisioning state.
attr_accessor :provisioning_state
# @return [String] The name of the host.
attr_accessor :host_name
# @return [Hash{String => EventHubProperties}] The Event Hub-compatible
# endpoint properties. The possible keys to this dictionary are events
# and operationsMonitoringEvents. Both of these keys have to be present
# in the dictionary while making create or update calls for the IoT hub.
attr_accessor :event_hub_endpoints
# @return [RoutingProperties]
attr_accessor :routing
# @return [Hash{String => StorageEndpointProperties}] The list of Azure
# Storage endpoints where you can upload files. Currently you can
# configure only one Azure Storage account and that MUST have its key as
# $default. Specifying more than one storage account causes an error to
# be thrown. Not specifying a value for this property when the
# enableFileUploadNotifications property is set to True, causes an error
# to be thrown.
attr_accessor :storage_endpoints
# @return [Hash{String => MessagingEndpointProperties}] The messaging
# endpoint properties for the file upload notification queue.
attr_accessor :messaging_endpoints
# @return [Boolean] If True, file upload notifications are enabled.
attr_accessor :enable_file_upload_notifications
# @return [CloudToDeviceProperties]
attr_accessor :cloud_to_device
# @return [String] IoT hub comments.
attr_accessor :comments
# @return [OperationsMonitoringProperties]
attr_accessor :operations_monitoring_properties
# @return [Capabilities] The capabilities and features enabled for the
# IoT hub. Possible values include: 'None', 'DeviceManagement'
attr_accessor :features
#
# Mapper for IotHubProperties class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'IotHubProperties',
type: {
name: 'Composite',
class_name: 'IotHubProperties',
model_properties: {
authorization_policies: {
client_side_validation: true,
required: false,
serialized_name: 'authorizationPolicies',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'SharedAccessSignatureAuthorizationRuleElementType',
type: {
name: 'Composite',
class_name: 'SharedAccessSignatureAuthorizationRule'
}
}
}
},
ip_filter_rules: {
client_side_validation: true,
required: false,
serialized_name: 'ipFilterRules',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'IpFilterRuleElementType',
type: {
name: 'Composite',
class_name: 'IpFilterRule'
}
}
}
},
provisioning_state: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'provisioningState',
type: {
name: 'String'
}
},
host_name: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'hostName',
type: {
name: 'String'
}
},
event_hub_endpoints: {
client_side_validation: true,
required: false,
serialized_name: 'eventHubEndpoints',
type: {
name: 'Dictionary',
value: {
client_side_validation: true,
required: false,
serialized_name: 'EventHubPropertiesElementType',
type: {
name: 'Composite',
class_name: 'EventHubProperties'
}
}
}
},
routing: {
client_side_validation: true,
required: false,
serialized_name: 'routing',
type: {
name: 'Composite',
class_name: 'RoutingProperties'
}
},
storage_endpoints: {
client_side_validation: true,
required: false,
serialized_name: 'storageEndpoints',
type: {
name: 'Dictionary',
value: {
client_side_validation: true,
required: false,
serialized_name: 'StorageEndpointPropertiesElementType',
type: {
name: 'Composite',
class_name: 'StorageEndpointProperties'
}
}
}
},
messaging_endpoints: {
client_side_validation: true,
required: false,
serialized_name: 'messagingEndpoints',
type: {
name: 'Dictionary',
value: {
client_side_validation: true,
required: false,
serialized_name: 'MessagingEndpointPropertiesElementType',
type: {
name: 'Composite',
class_name: 'MessagingEndpointProperties'
}
}
}
},
enable_file_upload_notifications: {
client_side_validation: true,
required: false,
serialized_name: 'enableFileUploadNotifications',
type: {
name: 'Boolean'
}
},
cloud_to_device: {
client_side_validation: true,
required: false,
serialized_name: 'cloudToDevice',
type: {
name: 'Composite',
class_name: 'CloudToDeviceProperties'
}
},
comments: {
client_side_validation: true,
required: false,
serialized_name: 'comments',
type: {
name: 'String'
}
},
operations_monitoring_properties: {
client_side_validation: true,
required: false,
serialized_name: 'operationsMonitoringProperties',
type: {
name: 'Composite',
class_name: 'OperationsMonitoringProperties'
}
},
features: {
client_side_validation: true,
required: false,
serialized_name: 'features',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end
|
Azure/azure-sdk-for-ruby
|
management/azure_mgmt_iot_hub/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/iot_hub_properties.rb
|
Ruby
|
mit
| 8,458
|
Recipes::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both thread web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Enable Rack::Cache to put a simple HTTP cache in front of your application
# Add `rack-cache` to your Gemfile before enabling this.
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
# config.action_dispatch.rack_cache = true
# Disable Rails's static asset server (Apache or nginx will already do this).
config.serve_static_assets = false
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
# Generate digests for assets URLs.
config.assets.digest = true
# Version of your assets, change this if you want to expire all your assets.
config.assets.version = '1.0'
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
# Set to :debug to see everything in the log.
config.log_level = :info
# Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ]
# Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = "http://assets.example.com"
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# config.assets.precompile += %w( search.js )
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
# Disable automatic flushing of the log to improve performance.
# config.autoflush_log = false
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
end
|
danielwanja/recipes
|
config/environments/production.rb
|
Ruby
|
mit
| 3,251
|
<?php
// @expectedError Exclamationmarks are not allowed in Exceptionmessages
class ExclamationException
{
public function foobar()
{
echo 'Hi';
echo 'Wrong!';
echo 'Bye';
echo "Hola";
}
}
|
flyeralarm/php-code-validator
|
tests/rules/classes/not-allowed/ExclamationException.php
|
PHP
|
mit
| 234
|
### Set up APNS: Certificates for push notifications
Matchmore iOS SDK uses Apple Push Notification Service (APNS) to deliver notifications to your iOS users.
In order to get the certificates and upload them to our portal.
**A membership in the Apple iOS developer program is required.**
#### 1. Enabling the Push Notification Service via Xcode
First, go to App Settings -> General and change Bundle Identifier to something unique.
Right below this, select your development Team. **This must be a paid developer account**.
After that, you need to create an App ID in your developer account that has the push notification entitlement enabled. Xcode has a simple way to do this. Go to App Settings -> Capabilities and flip the switch for Push Notifications to On.

Note: If any issues occur, visit the Apple Developer Center. You may simply need to agree to a new developer license.
At this point, you should have the App ID created and the push notifications entitlement should be added to your project. You can log into the Apple Developer Center and verify this.

#### 2. Enable Remote Push Notifications on your App ID
Sign in to your account in the **Apple developer center**, and then go to Certificates, Identifiers & Profiles
Go to Identifiers -> App IDs. If you followed previous instructions, you should be able to see the App ID of your application( create it if you don't see it). Click on your application and ensure that the Push Notifications service is enabled.

Click on the Development or Production certificate button and follow the steps. We recommend you for a Production push certificate. It works for most general cases and is the required certificate for Apple store.
##### Difference between Development and Production certificate
The choice of APNs host depends on which kinds of iOS app you wish to send push notifications to. There are two kinds of iOS app:
Published apps. These are published to the App Store and installed from there. These apps go through the usual App Store publication process, such as code-signing.
Development apps. These are “everything else”, such as apps installed from Xcode, or through private app publication systems.
**Warning**
Do not submit Apps to Apple with Development certificates.
#### 3. Exporting certificates
After completing the steps to generate a Development SSL or Production SSL certificat and downloading the certificate.
From Finder, double-click the ~/certificate.cer file, or run open ~/certificate.cer. This will open Keychain Access. The certificate should now be added to the list under “My Certificates”.
Right click on the certificate, and select "Export ....". Select the p12 format and create a password for the file, do not lose this password as you will need it a next step.
**For now : Leave this password blank.**
Upload the generated certificate to Matchmore Portal.
#### 4. Enable Push Notification in Application
Add the following lines to your appDelegate.
```swift
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
// Convert token to string
let deviceTokenString = deviceToken.reduce("", {$0 + String(format: "%02X", $1)})
Matchmore.registerDeviceToken(deviceToken: deviceTokenString)
createApnsSubscription()
}
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) {
Matchmore.processPushNotification(pushNotification: userInfo)
}
```
You can now start sending notifications to your users using Matchmore SDK.
|
matchmore/alps-ios-sdk
|
ApnsSetup.md
|
Markdown
|
mit
| 3,895
|
<?php
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class DatabaseSeeder extends Seeder {
/**
* Seed the application's database.
*
* @return void
*/
public function run()
{
Model::unguard();
// $this->call('UserSeeder');
}
}
|
neonbug/meexo
|
database/seeds/DatabaseSeeder.php
|
PHP
|
mit
| 272
|
class ProjectsRepository
def all
Project.where(archived_at: nil).order(:name)
end
def archived
Project.where.not(archived_at: nil)
end
def add(params)
Project.create(params)
end
def find(project_id)
Project.find_by(id: project_id)
end
def with_archived
Project.all.order(:name)
end
def with_done_checks
with_archived.includes(:checked_reviews)
end
def persist(entity)
entity.save
end
def for_reminder(reminder)
reminder.projects
end
def for_reminder_with_checks(reminder)
reminder.projects
.includes(project_checks: [:reminder, :last_check_user])
.distinct
end
def update(project, update_params)
project.update_attributes(update_params)
end
delegate :find_by_name, to: :all
end
|
netguru/reminders
|
app/repositories/projects_repository.rb
|
Ruby
|
mit
| 794
|
require 'fog/glesys/core'
module Fog
module Compute
class Glesys < Fog::Service
requires :glesys_username, :glesys_api_key
API_URL = "https://api.glesys.com"
model_path 'fog/glesys/models/compute'
collection :servers
model :server
collection :templates
model :template
collection :ips
model :ip
request_path 'fog/glesys/requests/compute'
# Server
request :create
request :edit
request :destroy
request :list_servers
request :server_details
request :server_status
request :start
request :reboot
request :stop
# Templates
request :template_list
# IP
request :ip_list_free
request :ip_list_own
request :ip_details
request :ip_take
request :ip_release
request :ip_add
request :ip_remove
class Mock
def initialize(options={})
@api_url = options[:glesys_api_url] || API_URL
@glesys_username = options[:glesys_username]
@glesys_api_key = options[:glesys_api_key]
@connection_options = options[:connection_options] || {}
end
def self.data
@data ||= {
}
end
def self.reset
@data = nil
end
def data
self.class.data
end
def reset_data
self.class.reset
end
end
class Real
def initialize(options)
require 'base64'
@api_url = options[:glesys_api_url] || API_URL
@glesys_username = options[:glesys_username]
@glesys_api_key = options[:glesys_api_key]
@connection_options = options[:connection_options] || {}
@persistent = options[:persistent] || false
@connection = Fog::XML::Connection.new(@api_url, @persistent, @connection_options)
end
def request(method_name, options = {})
options.merge!( {:format => 'json'})
begin
parser = options.delete(:parser)
data = @connection.request(
:expects => 200,
:method => "POST",
:body => urlencode(options),
:parser => parser,
:path => method_name,
:headers => {
'Authorization' => "Basic #{encoded_api_auth}",
'Content-Type' => 'application/x-www-form-urlencoded'
}
)
data.body = Fog::JSON.decode(data.body)
response_code = data.body['response']['status']['code']
unless response_code.to_i == 200
raise Fog::Compute::Glesys::Error, "#{data.body['response']['status']['text']}"
end
data
rescue Excon::Errors::HTTPStatusError => error
raise case error
when Excon::Errors::NotFound
Fog::Compute::Glesys::NotFound.slurp(error)
else
error
end
end
end
private
def encoded_api_auth
token = [@glesys_username, @glesys_api_key].join(':')
Base64.encode64(token).delete("\r\n")
end
def urlencode(hash)
hash.to_a.map! { |k, v| "#{k}=#{v.to_s}" }.join("&")
end
end
end
end
end
|
zephyrean/fog
|
lib/fog/glesys/compute.rb
|
Ruby
|
mit
| 3,400
|
/**
* @author Amazzing
* @copyright Amazzing
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)*
*/
var ajax_action_path;
var blockAjax = false;
$(document).ready(function(){
ajax_action_path = window.location.href.replace('#', '')+'&ajax=1';
activateSortable();
$(document).on('change', '.hookSelector', function(){
var hook_name = $(this).val();
$('.hook_content#'+hook_name).addClass('active').siblings().removeClass('active');
$('#settings_content').hide().html('');
$('.callSettings').removeClass('active');
});
$('.hookSelector').change();
$(document).on('click', '.callSettings', function(e){
e.preventDefault();
$el = $(this);
if ($el.hasClass('active'))
{
$('#settings-content').slideUp(function(){
$(this).html('');
$('.callSettings').removeClass('active');
});
return;
}
$('#settings-content').hide().html('');
$('.callSettings').removeClass('active');
var settings_type = $(this).data('settings');
var hook_name = $(this).closest('form').find('.hookSelector').val();
$.ajax({
type: 'POST',
url: ajax_action_path+'&action=CallSettingsForm&settings_type='+settings_type+'&hook_name='+hook_name,
dataType : 'json',
success: function(r)
{
console.dir(r);
if ('form_html' in r){
$('#settings-content').html(utf8_decode(r.form_html)).slideDown().tooltip({selector: '.label-tooltip'});
$el.addClass('active');
}
},
error: function(r)
{
$('#settings-content').hide().html('');
$('.callSettings').removeClass('active');
console.warn(r.responseText);
}
});
});
$(document).on('click', '.chk-action', function(e){
e.preventDefault();
var $checkboxes = $(this).closest('#settings_content').find('input[type="checkbox"]');
if ($(this).hasClass('checkall')){
$checkboxes.each(function(){
$(this).prop('checked', true);
});
}
else if ($(this).hasClass('uncheckall')){
$checkboxes.each(function(){
$(this).prop('checked', false);
});
}
else if ($(this).hasClass('invert')){
$checkboxes.each(function(){
$(this).prop('checked', !$(this).prop('checked'));
});
}
});
$(document).on('click', '.saveHookSettings', function(e){
e.preventDefault();
var hook_name = $(this).attr('data-hook');
var data = $(this).closest('form').serialize();
$.ajax({
type: 'POST',
url: ajax_action_path+'&action=SaveHookSettings&'+data,
dataType : 'json',
success: function(r)
{
console.dir(r);
if (r.saved){
$('#settings-content').slideUp(function(){
$('.callSettings').removeClass('active');
$(this).html('');
$.growl.notice({ title: '', message: savedTxt});
});
}
},
error: function(r)
{
console.warn(r.responseText);
}
});
});
$(document).on('click', '.hide-settings', function(){
$('.callSettings.active').click();
});
$(document).on('click', '.chk-action', function(e){
e.preventDefault();
var $checkboxes = $(this).closest('#settings-content').find('input[type="checkbox"]');
if ($(this).hasClass('checkall')){
$checkboxes.each(function(){
$(this).prop('checked', true);
});
}
else if ($(this).hasClass('uncheckall')){
$checkboxes.each(function(){
$(this).prop('checked', false);
});
}
else if ($(this).hasClass('invert')){
$checkboxes.each(function(){
$(this).prop('checked', !$(this).prop('checked'));
});
}
});
$(document).on('click', '.bulk-select, .bulk-unselect', function(e){
e.preventDefault();
var checked = $(this).hasClass('bulk-select');
$('.carousel-item:visible .carousel-box').prop('checked', checked);
});
$(document).on('click', '[data-bulk-act]', function(e){
e.preventDefault();
$('.bulk-actions-error').remove();
var ids = [];
$('.carousel-box:checked').each(function(){
ids.push($(this).val());
});
var act = $(this).data('bulk-act');
if (act == 'delete' && ids.length && !confirm(areYouSureTxt))
return;
$.ajax({
type: 'POST',
url: ajax_action_path+'&action=BulkAction',
dataType : 'json',
data: {
act : act,
ids : ids
},
success: function(r)
{
if ('errors' in r){
var err = '<div class="bulk-actions-error" style="display:none;">'+utf8_decode(r.errors)+'</div>';
$('.bulk-actions').removeClass('open').before(err);
$('.bulk-actions-error').slideDown();
}
else if (r.success){
$.growl.notice({ title: '', message: r.reponseText});
blockAjax = true;
switch (act){
case 'enable':
for (var i in ids)
$('.carousel-item[data-id="'+ids[i]+'"] .activateCarousel').addClass('action-enabled').removeClass('action-disabled').find('input').prop('checked', true);
break;
case 'disable':
for (var i in ids)
$('.carousel-item[data-id="'+ids[i]+'"] .activateCarousel').removeClass('action-enabled').addClass('action-disabled').find('input').prop('checked', false);
break;
case 'group_in_tabs':
case 'ungroup':
var checked = act == 'group_in_tabs';
for (var i in ids)
$('.carousel-item[data-id="'+ids[i]+'"] [name="in_tabs"]').prop('checked', checked);
break;
case 'delete':
removeCarouselRows(ids);
break;
}
blockAjax = false;
}
},
error: function(r)
{
console.warn(r.responseText);
}
});
});
$(document).on('click', '.addCarousel', function(e){
e.preventDefault();
scrollUpAllCarousels();
var $carousel_list = $(this).closest('.hook_content').find('.carousel_list');
var hook_name = $(this).closest('.hook_content').attr('id');
$.ajax({
type: 'POST',
url: ajax_action_path+'&action=CallCarouselForm&id_carousel=0&hook_name='+hook_name,
dataType : 'json',
success: function(r)
{
$newItem = $(utf8_decode(r));
$newItem.appendTo($carousel_list).addClass('open').find('.carousel-details').slideDown().find('#carousel_type').change();
$newItem.tooltip({selector: '.label-tooltip'});
var carousels_num = $('#'+hook_name+' .carousel-item:visible').length;
$('.hookSelector').find('option[value="'+hook_name+'"]').text(hook_name+' ('+carousels_num+')');
},
error: function(r)
{
console.warn(r.responseText);
}
});
});
$(document).on('click', '.activateCarousel', function(e){
e.preventDefault();
$checkbox = $(this).find('input[type="checkbox"]');
$checkbox.prop('checked', !$checkbox.prop('checked')).change();
if ($(this).closest('.carousel-item').attr('data-id') == 0)
$(this).toggleClass('action-enabled action-disabled');
});
$(document).on('change', '.toggleable_param', function(e){
var $parent = $(this).closest('.carousel-item');
var id_carousel = $parent.attr('data-id');
if (blockAjax || id_carousel == 0)
return;
var param_name = $(this).attr('name');
var param_value = $(this).prop('checked') ? 1 : 0;
$.ajax({
type: 'POST',
url: ajax_action_path+'&action=ToggleParam¶m_name='+param_name+'¶m_value='+param_value+'&id_carousel='+id_carousel,
dataType : 'json',
success: function(r)
{
console.dir(r);
if(r.success){
$.growl.notice({ title: '', message: savedTxt});
if (param_name == 'active')
$parent.find('.activateCarousel').toggleClass('action-enabled action-disabled');
}
else
$.growl.error({ title: '', message: failedTxt});
},
error: function(r)
{
console.warn(r.responseText);
}
});
});
$(document).on('click', '.editCarousel', function(e){
e.preventDefault();
scrollUpAllCarousels();
var $item = $(this).closest('.carousel-item');
id = $item.attr('data-id');
$.ajax({
type: 'POST',
url: ajax_action_path+'&action=CallCarouselForm&id_carousel='+id,
dataType : 'json',
success: function(r)
{
// console.dir(r);
var newItemHTML = $(utf8_decode(r)).html();
$item.html(newItemHTML).addClass('open').find('.carousel-details').slideDown().find('#carousel_type').change();
$item.tooltip({selector: '.label-tooltip'});
},
error: function(r)
{
console.warn(r.responseText);
}
});
});
$(document).on('click', '.scrollUp', function(e){
e.preventDefault();
scrollUpAllCarousels();
});
$(document).on('click', '.deleteCarousel', function(){
if (!confirm(areYouSureTxt))
return;
var $item = $(this).closest('.carousel-item');
id = $item.attr('data-id');
$.ajax({
type: 'POST',
url: ajax_action_path+'&action=DeleteCarousel&id_carousel='+id,
dataType : 'json',
success: function(r)
{
if (r.deleted)
removeCarouselRows(id);
},
error: function(r)
{
console.warn(r.responseText);
}
});
});
$(document).on('change', '#carousel_type', function(){
// special options for products/manufacturers/suppliers
var show_hide = ['product', 'manufacturer', 'supplier'];
if ($(this).val() == 'manufacturers')
show_hide = ['manufacturer', 'supplier', 'product'];
else if ($(this).val() == 'suppliers')
show_hide = ['supplier', 'manufacturer', 'product'];
$('.'+show_hide[0]+'_option').removeClass('hidden');
$('.'+show_hide[1]+'_option, .'+show_hide[2]+'_option').addClass('hidden');
var img_type = $('select[name="tpl_settings[image_type]"] option.saved').not('.hidden').first().val();
if (!img_type)
img_type = $('select[name="tpl_settings[image_type]"] option').not('.hidden').first().val();
$('select[name="tpl_settings[image_type]"]').val(img_type).change();
// special options for some carousel types
$('.special_option').addClass('hidden').closest('.special').hide();
$('.special_option.'+$(this).val()).removeClass('hidden').closest('.special').show();
// update name field if it is not saved yet
var carousel_name = $.trim($(this).find('option:selected').text());
$('input[data-saved="false"]').val(carousel_name);
});
$(document).on('click', '#saveCarousel', function(e){
e.preventDefault();
var $item = $(this).closest('.carousel-item');
$item.find('.ajax_errors').slideUp().html('');
$.ajax({
type: 'POST',
url: ajax_action_path+'&action=saveCarousel',
data: {
id_carousel: $item.attr('data-id'),
hook_name: $item.closest('.hook_content').attr('id'),
carousel_data: $item.find('form').serialize(),
},
dataType : 'json',
success: function(r)
{
// console.dir(r);
if ('errors' in r){
$item.prepend(utf8_decode(r.errors));
$('html, body').animate({
scrollTop: $item.offset().top - 100
}, 500);
return;
}
else{
$.growl.notice({ title: '', message: r.responseText});
$item.find('form').slideUp(function(){
$item.replaceWith(utf8_decode(r.updated_form_header));
});
}
},
error: function(r)
{
$item.find('.ajax_errors').slideDown().append('<div>'+r.responseText+'</div>');
}
});
});
$(document).on('click', '.lang_switcher', function(){
var id_lang = $(this).attr('data-id-lang');
$('.multilang').hide();
$('.multilang.lang_'+id_lang).show();
});
$(document).on('click', '.importer .import', function(){
$('input[name="carousels_data_file"]').click();
}).on('change', 'input[name="carousels_data_file"]', function(){
if (!this.files || this.files[0].type != 'text/plain')
return;
$('.importer .import i').toggleClass('icon-cloud-upload icon-refresh icon-spin');
var data = new FormData();
data.append($(this).attr('name'), $(this).prop('files')[0]);
$.ajax({
type: 'POST',
url: ajax_action_path+'&action=ImportCarousels',
dataType : 'json',
processData: false,
contentType: false,
data: data,
success: function(r)
{
if ('errors' in r)
$('.importer').closest('.panel').before(utf8_decode(r.errors));
else if ('upd_html' in r){
$upd = $('<div>'+utf8_decode(r.upd_html)+'</div>');
$('.all-carousels').replaceWith($upd.find('.all-carousels'));
$('.all-carousels').find('.hookSelector').change();
$('.all-carousels').before($upd.find('.module_confirmation'));
activateSortable();
}
$('.importer .import i').toggleClass('icon-cloud-upload icon-refresh icon-spin');
},
error: function(r)
{
console.warn(r.responseText);
$('.importer .import i').toggleClass('icon-cloud-upload icon-refresh icon-spin');
}
});
});
// ajax progress
$('body').append('<div id="re-progress"><div class="progress-inner"></div></div>');
$(document).ajaxStart(function(){
$('#re-progress .progress-inner').width(0).fadeIn('fast').animate({'width':'70%'},500);
})
.ajaxSuccess(function(){
$('#re-progress .progress-inner').animate({'width':'100%'},500,function(){
$(this).fadeOut('fast');
});
})
});
function scrollUpAllCarousels(){
$('.carousel-item').removeClass('open').find('.carousel-details').slideUp(function(){$(this).html('')});
}
function removeCarouselRows(ids){
if (!$.isArray(ids))
ids = [ids];
for (var i in ids){
$('.carousel-item[data-id="'+ids[i]+'"]').fadeOut(function(){
if (!$(this).closest('.carousel-item').next().length) {
var hook_name = $('.hookSelector').val();
var carousels_num = $('#'+hook_name+' .carousel-item:visible').length;
$('.hookSelector').find('option[value="'+hook_name+'"]').text(hook_name+' ('+carousels_num+')');
}
});
}
}
function activateSortable(){
$('.carousel_list').sortable({
placeholder: 'new_position_placeholder',
handle: '.dragger',
update: function(event, ui) {
var ordered_ids = [];
ui.item.closest('.carousel_list').find('.carousel-item').each(function(){
ordered_ids.push($(this).attr('data-id'));
});
$.ajax({
type: 'POST',
url: ajax_action_path+'&action=UpdatePositionsInHook',
dataType : 'json',
data: {
ordered_ids: ordered_ids,
},
success: function(r)
{
if('successText' in r)
$.growl.notice({ title: '', message: r.successText});
},
error: function(r)
{
$.growl.notice({ title: '', message: r.responseText});
}
});
}
});
}
function utf8_decode(utfstr) {
var res = '';
for (var i = 0; i < utfstr.length;) {
var c = utfstr.charCodeAt(i);
if (c < 128)
{
res += String.fromCharCode(c);
i++;
}
else if((c > 191) && (c < 224))
{
var c1 = utfstr.charCodeAt(i+1);
res += String.fromCharCode(((c & 31) << 6) | (c1 & 63));
i += 2;
}
else
{
var c1 = utfstr.charCodeAt(i+1);
var c2 = utfstr.charCodeAt(i+2);
res += String.fromCharCode(((c & 15) << 12) | ((c1 & 63) << 6) | (c2 & 63));
i += 3;
}
}
return res;
}
|
amicavi/grupo-ochoa
|
prestashop/modules/easycarousels/views/js/back.js
|
JavaScript
|
mit
| 14,501
|
#include <Source/Headers.h>
#include <Source/TextDoc.h>
#include <Source/TokenizedFile.h>
void parseTextDoc(const TextDoc& doc);
// ============================================================================
int main(int argc, char* argv[])
{
if (argc != 2) {
return -1;
}
TextDoc doc = loadTextDoc(argv[1]);
parseTextDoc(doc);
return 0;
}
|
steschu77/Coder
|
Source/Parser.cpp
|
C++
|
mit
| 363
|
/**
* Created by Pencroff on 04-Sep-16.
*/
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var dotify = require('gulp-dotify');
var watch = require('gulp-watch');
var transform = require('gulp-transform');
var wrapper = require('gulp-wrapper');
var destination = 'assets';
gulp.task('generate-data-file', function() {
global.window = {};
return gulp.src('tests/*.js')
.pipe(plumber())
.pipe(transform(function (content) {
eval(content);
var test = global.window.test;
return [
'{ ',
'id:\'', test.id, '\',',
'name:\'', test.name, '\',',
'description:\'', test.description, '\',',
'tags:', '[\'', test.tags.join('\',\''), '\'],',
'url:\'', test.url, '\'',
' }'
].join('');
}, {encoding: 'utf8'}))
.pipe(concat('data.js', {newLine: ','}))
.pipe(wrapper({
header: '(function (r) {r.data=[',
footer: '];})(window.PerformanceJs);'
}))
.pipe(gulp.dest(destination));
});
gulp.task('templates', function() {
return gulp.src('src/views/**/*.html')
.pipe(plumber())
.pipe(dotify({
dictionary: 'r.JST'
}))
.pipe(concat('templates.min.js'))
.pipe(uglify())
.pipe(wrapper({
header: '(function (r) {r.JST={},',
footer: '})(window.PerformanceJs);'
}))
.pipe(gulp.dest(destination));
});
gulp.task('templates-watch', function () {
watch('src/views/**/*.html', function () {
gulp.start('templates')
})
}
);
makeTask({
name: 'app',
files: 'src/**/*.js',
destination: destination,
uglify: true
});
makeTask({
name: 'vendor',
files: ['assets/js/lodash.min.js', 'assets/js/bluebird.min.js',
'assets/js/domtastic.min.js', 'assets/js/grapnel.min.js'],
destination: destination,
});
makeTask({
name: 'benchmark',
files: ['assets/js/benchmark.js', 'assets/js/platform.js'],
destination: destination
});
gulp.task('engine', ['app', 'vendor', 'benchmark', 'templates', 'generate-data-file']);
gulp.task('engine-watch', ['app-watch', 'templates-watch']);
function makeTask(options) {
gulp.task(options.name, function() {
var stream = gulp.src(options.files)
.pipe(plumber())
.pipe(concat(options.name + '.js'))
.pipe(gulp.dest(options.destination));
if (options.uglify) {
stream.pipe(rename(options.name + '.min.js'))
.pipe(uglify())
.pipe(gulp.dest(options.destination));
}
return stream;
});
gulp.task(options.name + '-watch', function () {
watch(options.files, function () {
gulp.start(options.name)
})
}
);
}
|
Pencroff/PerfJS
|
origin/gulpfile.js
|
JavaScript
|
mit
| 3,057
|
import pyactiveresource.connection
from pyactiveresource.activeresource import ActiveResource, ResourceMeta, formats
import shopify.yamlobjects
import shopify.mixins as mixins
import shopify
import threading
import sys
from six.moves import urllib
import six
from shopify.collection import PaginatedCollection
from pyactiveresource.collection import Collection
# Store the response from the last request in the connection object
class ShopifyConnection(pyactiveresource.connection.Connection):
response = None
def __init__(self, site, user=None, password=None, timeout=None, format=formats.JSONFormat):
super(ShopifyConnection, self).__init__(site, user, password, timeout, format)
def _open(self, *args, **kwargs):
self.response = None
try:
self.response = super(ShopifyConnection, self)._open(*args, **kwargs)
except pyactiveresource.connection.ConnectionError as err:
self.response = err.response
raise
return self.response
# Inherit from pyactiveresource's metaclass in order to use ShopifyConnection
class ShopifyResourceMeta(ResourceMeta):
@property
def connection(cls):
"""HTTP connection for the current thread"""
local = cls._threadlocal
if not getattr(local, "connection", None):
# Make sure these variables are no longer affected by other threads.
local.user = cls.user
local.password = cls.password
local.site = cls.site
local.timeout = cls.timeout
local.headers = cls.headers
local.format = cls.format
local.version = cls.version
local.url = cls.url
if cls.site is None:
raise ValueError("No shopify session is active")
local.connection = ShopifyConnection(cls.site, cls.user, cls.password, cls.timeout, cls.format)
return local.connection
def get_user(cls):
return getattr(cls._threadlocal, "user", ShopifyResource._user)
def set_user(cls, value):
cls._threadlocal.connection = None
ShopifyResource._user = cls._threadlocal.user = value
user = property(get_user, set_user, None, "The username for HTTP Basic Auth.")
def get_password(cls):
return getattr(cls._threadlocal, "password", ShopifyResource._password)
def set_password(cls, value):
cls._threadlocal.connection = None
ShopifyResource._password = cls._threadlocal.password = value
password = property(get_password, set_password, None, "The password for HTTP Basic Auth.")
def get_site(cls):
return getattr(cls._threadlocal, "site", ShopifyResource._site)
def set_site(cls, value):
cls._threadlocal.connection = None
ShopifyResource._site = cls._threadlocal.site = value
if value is not None:
parts = urllib.parse.urlparse(value)
host = parts.hostname
if parts.port:
host += ":" + str(parts.port)
new_site = urllib.parse.urlunparse((parts.scheme, host, parts.path, "", "", ""))
ShopifyResource._site = cls._threadlocal.site = new_site
if parts.username:
cls.user = urllib.parse.unquote(parts.username)
if parts.password:
cls.password = urllib.parse.unquote(parts.password)
site = property(get_site, set_site, None, "The base REST site to connect to.")
def get_timeout(cls):
return getattr(cls._threadlocal, "timeout", ShopifyResource._timeout)
def set_timeout(cls, value):
cls._threadlocal.connection = None
ShopifyResource._timeout = cls._threadlocal.timeout = value
timeout = property(get_timeout, set_timeout, None, "Socket timeout for HTTP requests")
def get_headers(cls):
if not hasattr(cls._threadlocal, "headers"):
cls._threadlocal.headers = ShopifyResource._headers.copy()
return cls._threadlocal.headers
def set_headers(cls, value):
cls._threadlocal.headers = value
headers = property(get_headers, set_headers, None, "The headers sent with HTTP requests")
def get_format(cls):
return getattr(cls._threadlocal, "format", ShopifyResource._format)
def set_format(cls, value):
cls._threadlocal.connection = None
ShopifyResource._format = cls._threadlocal.format = value
format = property(get_format, set_format, None, "Encoding used for request and responses")
def get_prefix_source(cls):
"""Return the prefix source, by default derived from site."""
try:
return cls.override_prefix()
except AttributeError:
if hasattr(cls, "_prefix_source"):
return cls.site + cls._prefix_source
else:
return cls.site
def set_prefix_source(cls, value):
"""Set the prefix source, which will be rendered into the prefix."""
cls._prefix_source = value
prefix_source = property(get_prefix_source, set_prefix_source, None, "prefix for lookups for this type of object.")
def get_version(cls):
if hasattr(cls._threadlocal, "version") or ShopifyResource._version:
return getattr(cls._threadlocal, "version", ShopifyResource._version)
elif ShopifyResource._site is not None:
return ShopifyResource._site.split("/")[-1]
def set_version(cls, value):
ShopifyResource._version = cls._threadlocal.version = value
version = property(get_version, set_version, None, "Shopify Api Version")
def get_url(cls):
return getattr(cls._threadlocal, "url", ShopifyResource._url)
def set_url(cls, value):
ShopifyResource._url = cls._threadlocal.url = value
url = property(get_url, set_url, None, "Base URL including protocol and shopify domain")
@six.add_metaclass(ShopifyResourceMeta)
class ShopifyResource(ActiveResource, mixins.Countable):
_format = formats.JSONFormat
_threadlocal = threading.local()
_headers = {"User-Agent": "ShopifyPythonAPI/%s Python/%s" % (shopify.VERSION, sys.version.split(" ", 1)[0])}
_version = None
_url = None
def __init__(self, attributes=None, prefix_options=None):
if attributes is not None and prefix_options is None:
prefix_options, attributes = self.__class__._split_options(attributes)
return super(ShopifyResource, self).__init__(attributes, prefix_options)
def is_new(self):
return not self.id
def _load_attributes_from_response(self, response):
if response.body.strip():
self._update(self.__class__.format.decode(response.body))
@classmethod
def activate_session(cls, session):
cls.site = session.site
cls.url = session.url
cls.user = None
cls.password = None
cls.version = session.api_version.name
cls.headers["X-Shopify-Access-Token"] = session.token
@classmethod
def clear_session(cls):
cls.site = None
cls.url = None
cls.user = None
cls.password = None
cls.version = None
cls.headers.pop("X-Shopify-Access-Token", None)
@classmethod
def find(cls, id_=None, from_=None, **kwargs):
"""Checks the resulting collection for pagination metadata."""
collection = super(ShopifyResource, cls).find(id_=id_, from_=from_, **kwargs)
if isinstance(collection, Collection) and "headers" in collection.metadata:
return PaginatedCollection(collection, metadata={"resource_class": cls}, **kwargs)
return collection
|
Shopify/shopify_python_api
|
shopify/base.py
|
Python
|
mit
| 7,625
|
'use strict' ;
var Emitter = require('events').EventEmitter ;
var util = require('util') ;
var outboundCallProcessor = require('./outbound-call-processor') ;
var inboundCallProcessor = require('./inbound-call-processor') ;
var spawn = require('child_process').spawn;
var iptables = require('iptables') ;
var parseUri = require('drachtio-sip').parser.parseUri ;
var ban = true ;
var chain = 'LOGDROP';
// verify the chain exists
var cmd = spawn('sudo', ['iptables','-S', chain]);
cmd.stderr.on('data', function(buf) {
console.error('NB: blacklisting is disabled, error listing chain LOGs: ', chain, String(buf)) ;
ban = false ;
}) ;
module.exports = exports = CallProcessor ;
function CallProcessor( srf, mediaServer, registrar ){
if (!(this instanceof CallProcessor)) { return new CallProcessor(srf, mediaServer, registrar); }
Emitter.call(this);
console.log('mediaServer: ', mediaServer);
this.srf = srf ;
this.mediaServer = mediaServer ;
this.registrar = registrar ;
this.calls = new Map() ;
}
util.inherits(CallProcessor, Emitter) ;
CallProcessor.prototype.start = function() {
this.srf.invite( ( req, res ) => {
console.log(`received invite from ${req.protocol}/${req.source_address}:${req.uri} with request uri %s` ) ;
var user = parseUri( req.uri ).user ;
if( this.registrar.hasUser( user ) ) {
var details = this.registrar.getUser( user ) ;
console.log(`inbound call with details: ${JSON.stringify(details)}`) ;
inboundCallProcessor( this.srf, req, res, details.uri, this.mediaServer, this.registrar, (err, uas, uac, ms, ep1, ep2) => {
if( err ) {
console.error(`${req.get('Call-Id')}: error connecting call: ${err.message}`) ;
return ;
}
this.setHandlers( uas, uac, ms, ep1, ep2 ) ;
}) ;
}
else if( 'udp' === req.protocol ) {
// outbound call, but it is coming via UDP. We only allow outbound calls via WSS
console.error(`banning ${req.source_address}:${req.source_port} due to unauthorized attempt to ${req.uri}`) ;
if( ban ) {
iptables.drop({
chain: chain,
src: req.source_address,
sudo: true
}) ;
}
}
else {
outboundCallProcessor( this.srf, req, res, req.uri, this.mediaServer, this.registrar, (err, uas, uac, ms, ep1, ep2) => {
if( err ) {
if( err.status !== 401 && err.status !== 407 ) {
console.error(`${req.get('Call-Id')}: error connecting call: ${err.status}`) ;
}
return ;
}
this.setHandlers( uas, uac, ms, ep1, ep2 ) ;
}) ;
}
});
} ;
CallProcessor.prototype.setHandlers = function( uas, uac, ms, ep1, ep2 ) {
var key = makeReplacesStr(uas) ;
var value = makeReplacesStr(uac) ;
this.calls.set(key, value) ;
console.log(`after adding call there are now ${this.calls.size} calls in progress`);
uas.on('destroy', this._onDestroy.bind( this, uas, uac, ms, ep1, ep2 )) ;
uac.on('destroy', this._onDestroy.bind( this, uac, uas, ms, ep1, ep2 )) ;
uas.once('refer', this._handleRefer.bind( this, uas, uac ) ) ;
uac.once('refer', this._handleRefer.bind( this, uac, uas ) ) ;
uas.on('hold', this._hold.bind( this, uas, uac, ep1, ep2 )) ;
uac.on('hold', this._hold.bind( this, uac, uas, ep1, ep2 )) ;
uas.on('unhold', this._unhold.bind( this, uas, uac, ep1, ep2 )) ;
uac.on('unhold', this._unhold.bind( this, uac, uas, ep1, ep2 )) ;
uas.on('info', this._handleInfo.bind( this, uas, uac, ep1, ep2 ) ) ;
uac.on('info', this._handleInfo.bind( this, uac, uas, ep2, ep1 ) ) ;
} ;
CallProcessor.prototype._onDestroy = function( dlg, dlgOther, ms, ep1, ep2 ) {
var key = makeReplacesStr(dlg) ;
if( this.calls.has( key ) ) {
this.calls.delete( key );
}
else {
key = makeReplacesStr(dlgOther) ;
if( this.calls.has( key ) ) {
this.calls.delete( key );
}
else {
console.error(`key ${key} not found`);
}
}
[dlgOther, ep1, ep2].forEach( function(e) { e.destroy(); }) ;
ms.disconnect() ;
console.log(`after ending call there are now ${this.calls.size} calls in progress`);
} ;
CallProcessor.prototype._handleRefer = function( dlg, dlgOther, req, res ) {
var referTo = req.get('Refer-To') ;
var arr = /(.*)Replaces=(.*)>/.exec(referTo) ;
if( arr && arr.length > 1 ) {
// attended transfer: fixup the Replaces part of the Refer-To header
var key = arr[2] ;
if( key in this._calls ) {
referTo = arr[1] + 'Replaces=' + this._calls[key] + '>' ;
}
else {
console.error(`attended transfer but we cant find ${key}`);
}
}
dlgOther.request({
method: 'REFER',
headers: {
'Refer-To': referTo
}
});
res.send(202);
} ;
CallProcessor.prototype._hold = function( dlg, dlgOther, ep1 /*, ep2 */) {
ep1.unbridge( function(err) {
if( err ) {
console.error(`Error unbridging endpoints when going on hold: ${err}`) ;
}
});
} ;
CallProcessor.prototype._unhold = function( dlg, dlgOther, ep1, ep2 ) {
ep1.bridge( ep2, function(err) {
if( err ) {
console.error(`Error bridging endpoints back together after unhold: ${err}`) ;
}
});
} ;
CallProcessor.prototype._handleInfo = function( dlg, dlgOther, ep1, ep2, req, res ) {
console.log('received info with content-type: %s', req.get('Content-Type'));
res.send(200) ;
if( req.get('Content-Type') === 'application/media_control+xml' ) {
console.log('forwarding to freeswitch ');
dlgOther.request({
method: 'INFO',
headers: {
'Content-Type': req.get('Content-Type'),
},
body: req.body
});
}
} ;
function makeReplacesStr( dlg ) {
var s = '';
if( dlg.type === 'uas') {
s = encodeURIComponent( dlg.sip.callId + ';to-tag=' + dlg.sip.localTag + ';from-tag=' + dlg.sip.remoteTag ) ;
}
else {
s = encodeURIComponent( dlg.sip.callId + ';to-tag=' + dlg.sip.remoteTag + ';from-tag=' + dlg.sip.localTag ) ;
}
return s ;
}
|
davehorton/ws-proxy
|
lib/call-processor.js
|
JavaScript
|
mit
| 6,015
|
using System;
using System.Text;
using System.IO;
/// <summary>
/// C# implementation of ASCII85 encoding.
/// Based on C code from http://www.stillhq.com/cgi-bin/cvsweb/ascii85/
/// </summary>
/// <remarks>
/// Jeff Atwood
/// http://www.codinghorror.com/blog/archives/000410.html
/// </remarks>
namespace Graphs
{
public class Ascii85
{
/// <summary>
/// Prefix mark that identifies an encoded ASCII85 string, traditionally '<~'
/// </summary>
public string PrefixMark = "";
/// <summary>
/// Suffix mark that identifies an encoded ASCII85 string, traditionally '~>'
/// </summary>
public string SuffixMark = "";
/// <summary>
/// Maximum line length for encoded ASCII85 string;
/// set to zero for one unbroken line.
/// </summary>
public int LineLength = 0;
/// <summary>
/// Add the Prefix and Suffix marks when encoding, and enforce their presence for decoding
/// </summary>
public bool EnforceMarks = false;
private const int _asciiOffset = 33;
private byte[] _encodedBlock = new byte[5];
private byte[] _decodedBlock = new byte[4];
private uint _tuple = 0;
private int _linePos = 0;
private uint[] pow85 = { 85 * 85 * 85 * 85, 85 * 85 * 85, 85 * 85, 85, 1 };
/// <summary>
/// Decodes an ASCII85 encoded string into the original binary data
/// </summary>
/// <param name="s">ASCII85 encoded string</param>
/// <returns>byte array of decoded binary data</returns>
public byte[] Decode(string s)
{
if (EnforceMarks)
{
if (!s.StartsWith(PrefixMark) | !s.EndsWith(SuffixMark))
{
throw new Exception("ASCII85 encoded data should begin with '" + PrefixMark +
"' and end with '" + SuffixMark + "'");
}
}
// strip prefix and suffix if present
if (s.StartsWith(PrefixMark))
{
s = s.Substring(PrefixMark.Length);
}
if (s.EndsWith(SuffixMark))
{
s = s.Substring(0, s.Length - SuffixMark.Length);
}
MemoryStream ms = new MemoryStream();
int count = 0;
bool processChar = false;
foreach (char c in s)
{
switch (c)
{
case 'z':
if (count != 0)
{
throw new Exception("The character 'z' is invalid inside an ASCII85 block.");
}
_decodedBlock[0] = 0;
_decodedBlock[1] = 0;
_decodedBlock[2] = 0;
_decodedBlock[3] = 0;
ms.Write(_decodedBlock, 0, _decodedBlock.Length);
processChar = false;
break;
case '\n':
case '\r':
case '\t':
case '\0':
case '\f':
case '\b':
processChar = false;
break;
default:
if (c < '!' || c > 'u')
{
throw new Exception("Bad character '" + c + "' found. ASCII85 only allows characters '!' to 'u'.");
}
processChar = true;
break;
}
if (processChar)
{
_tuple += ((uint)(c - _asciiOffset) * pow85[count]);
count++;
if (count == _encodedBlock.Length)
{
DecodeBlock();
ms.Write(_decodedBlock, 0, _decodedBlock.Length);
_tuple = 0;
count = 0;
}
}
}
// if we have some bytes left over at the end..
if (count != 0)
{
if (count == 1)
{
throw new Exception("The last block of ASCII85 data cannot be a single byte.");
}
count--;
_tuple += pow85[count];
DecodeBlock(count);
for (int i = 0; i < count; i++)
{
ms.WriteByte(_decodedBlock[i]);
}
}
return ms.ToArray();
}
/// <summary>
/// Encodes binary data into a plaintext ASCII85 format string
/// </summary>
/// <param name="ba">binary data to encode</param>
/// <returns>ASCII85 encoded string</returns>
public string Encode(byte[] ba)
{
StringBuilder sb = new StringBuilder((int)(ba.Length * (_encodedBlock.Length / _decodedBlock.Length)));
_linePos = 0;
if (EnforceMarks)
{
AppendString(sb, PrefixMark);
}
int count = 0;
_tuple = 0;
foreach (byte b in ba)
{
if (count >= _decodedBlock.Length - 1)
{
_tuple |= b;
if (_tuple == 0)
{
AppendChar(sb, 'z');
}
else
{
EncodeBlock(sb);
}
_tuple = 0;
count = 0;
}
else
{
_tuple |= (uint)(b << (24 - (count * 8)));
count++;
}
}
// if we have some bytes left over at the end..
if (count > 0)
{
EncodeBlock(count + 1, sb);
}
if (EnforceMarks)
{
AppendString(sb, SuffixMark);
}
return sb.ToString();
}
private void EncodeBlock(StringBuilder sb)
{
EncodeBlock(_encodedBlock.Length, sb);
}
private void EncodeBlock(int count, StringBuilder sb)
{
for (int i = _encodedBlock.Length - 1; i >= 0; i--)
{
_encodedBlock[i] = (byte)((_tuple % 85) + _asciiOffset);
_tuple /= 85;
}
for (int i = 0; i < count; i++)
{
char c = (char)_encodedBlock[i];
AppendChar(sb, c);
}
}
private void DecodeBlock()
{
DecodeBlock(_decodedBlock.Length);
}
private void DecodeBlock(int bytes)
{
for (int i = 0; i < bytes; i++)
{
_decodedBlock[i] = (byte)(_tuple >> 24 - (i * 8));
}
}
private void AppendString(StringBuilder sb, string s)
{
if (LineLength > 0 && (_linePos + s.Length > LineLength))
{
_linePos = 0;
sb.Append('\r');
sb.Append('\n');
}
else
{
_linePos += s.Length;
}
sb.Append(s);
}
private void AppendChar(StringBuilder sb, char c)
{
sb.Append(c);
_linePos++;
if (LineLength > 0 && (_linePos >= LineLength))
{
_linePos = 0;
sb.Append('\r');
sb.Append('\n');
}
}
}
}
|
landon/WebGraphs
|
GraphsCore/Ascii85.cs
|
C#
|
mit
| 7,813
|
from django.conf import settings
from images.models import S3Connection
from shutil import copyfileobj
import tinys3
import os
import urllib
class LocalStorage(object):
def __init__(self, filename):
self.filename = filename
def get_file_data(self):
"""
Returns the raw data for the specified file
"""
image_path = os.path.join(settings.MEDIA_ROOT, self.filename)
# TODO: do you need to close this?
data = open(image_path, 'r').read()
return data
def get_remote_path(self):
"""
Builds a relative remote path by combining the MEDIA_URL setting and the filename
"""
return '%s%s' % (settings.MEDIA_URL, self.filename)
def store(self, file_instance, content_type=None):
"""
Copy over the `file_instance` to the local storage
"""
image_path = os.path.join(settings.MEDIA_ROOT, self.filename)
with open(image_path, 'w') as fw:
copyfileobj(file_instance, fw)
@staticmethod
def create_argument_slug(arguments_dict):
"""
Converts an arguments dictionary into a string that can be stored in a filename
"""
# TODO: is there a possible bug if an invalid key/value is presented?
args_list = ['%s-%s' % (key, value) for key, value in arguments_dict.items()]
return '--'.join(args_list)
class S3Storage(LocalStorage):
def __init__(self, *args, **kwargs):
"""
Overrides the LocalStorage and initializes a shared S3 connection
"""
super(S3Storage, self).__init__(*args, **kwargs)
self.conn = tinys3.Connection(self.S3_ACCESS_KEY, self.S3_SECRET_KEY, default_bucket=self.S3_BUCKET, tls=True)
def get_remote_path(self):
"""
Returns an absolute remote path for the filename from the S3 bucket
"""
return 'https://%s.%s/%s' % (self.conn.default_bucket, self.conn.endpoint, self.filename)
def get_file_data(self):
"""
Returns the raw data for the specific file, downloading it from S3
"""
path = self.get_remote_path()
data = urllib.urlopen(path).read()
return data
def store(self, file_instance, content_type=None):
"""
Copy over the `file_instance` from memory to S3
"""
self.conn.upload(self.filename, file_instance, content_type=content_type)
@property
def S3_BUCKET(self):
"""
Returns the S3_BUCKET. Checks local environment variables first, database-stored settings second
"""
return os.environ.get('S3_BUCKET', self.database_settings.bucket)
@property
def S3_ACCESS_KEY(self):
"""
Returns the S3_ACCESS_KEY. Checks local environment variables first, database-stored settings second
"""
return os.environ.get('S3_ACCESS_KEY', self.database_settings.access_key)
@property
def S3_SECRET_KEY(self):
"""
Returns the S3_SECRET_KEY. Checks local environment variables first, database-stored settings second
"""
return os.environ.get('S3_SECRET_KEY', self.database_settings.secret_key)
@property
def database_settings(self):
"""
Pulls an S3Connection instance, which contains S3 connection settings, from the databas. Result is cached locally
"""
if not getattr(self, '__database_settings', None):
self.__database_settings = S3Connection.objects.get()
return self.__database_settings
|
sokanu/frame
|
images/storage.py
|
Python
|
mit
| 3,547
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Thu Jan 03 13:25:28 EST 2013 -->
<TITLE>
BufferedOutputStream (2013 FRC Java API)
</TITLE>
<META NAME="date" CONTENT="2013-01-03">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="BufferedOutputStream (2013 FRC Java API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/BufferedOutputStream.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
"<p style=\"background-color:${javadoc.bgcolor}; color:${javadoc.fgcolor}; padding:4px 5px 2px 3px; margin-top:-1px\"><b>2013 FRC Java API</b></p>"</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../java/io/BufferedInputStream.html" title="class in java.io"><B>PREV CLASS</B></A>
<A HREF="../../java/io/ByteArrayInputStream.html" title="class in java.io"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?java/io/BufferedOutputStream.html" target="_top"><B>FRAMES</B></A>
<A HREF="BufferedOutputStream.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
java.io</FONT>
<BR>
Class BufferedOutputStream</H2>
<PRE>
<A HREF="../../java/lang/Object.html" title="class in java.lang">java.lang.Object</A>
<IMG SRC="../../resources/inherit.gif" ALT="extended by "><A HREF="../../java/io/OutputStream.html" title="class in java.io">java.io.OutputStream</A>
<IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>java.io.BufferedOutputStream</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>BufferedOutputStream</B><DT>extends <A HREF="../../java/io/OutputStream.html" title="class in java.io">OutputStream</A></DL>
</PRE>
<P>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../java/io/BufferedOutputStream.html#BufferedOutputStream(java.io.OutputStream)">BufferedOutputStream</A></B>(<A HREF="../../java/io/OutputStream.html" title="class in java.io">OutputStream</A> out)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../java/io/BufferedOutputStream.html#BufferedOutputStream(java.io.OutputStream, int)">BufferedOutputStream</A></B>(<A HREF="../../java/io/OutputStream.html" title="class in java.io">OutputStream</A> out,
int size)</CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/BufferedOutputStream.html#close()">close</A></B>()</CODE>
<BR>
Closes this output stream and releases any system resources
associated with this stream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/BufferedOutputStream.html#flush()">flush</A></B>()</CODE>
<BR>
Flushes this output stream and forces any buffered output bytes
to be written out.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/BufferedOutputStream.html#write(byte[], int, int)">write</A></B>(byte[] b,
int off,
int len)</CODE>
<BR>
Writes <code>len</code> bytes from the specified byte array
starting at offset <code>off</code> to this output stream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/BufferedOutputStream.html#write(int)">write</A></B>(int b)</CODE>
<BR>
Writes the specified byte to this output stream.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.io.OutputStream"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.io.<A HREF="../../java/io/OutputStream.html" title="class in java.io">OutputStream</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../java/io/OutputStream.html#write(byte[])">write</A></CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#toString()">toString</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD>
</TR>
</TABLE>
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="BufferedOutputStream(java.io.OutputStream)"><!-- --></A><H3>
BufferedOutputStream</H3>
<PRE>
public <B>BufferedOutputStream</B>(<A HREF="../../java/io/OutputStream.html" title="class in java.io">OutputStream</A> out)</PRE>
<DL>
</DL>
<HR>
<A NAME="BufferedOutputStream(java.io.OutputStream, int)"><!-- --></A><H3>
BufferedOutputStream</H3>
<PRE>
public <B>BufferedOutputStream</B>(<A HREF="../../java/io/OutputStream.html" title="class in java.io">OutputStream</A> out,
int size)</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="write(int)"><!-- --></A><H3>
write</H3>
<PRE>
public void <B>write</B>(int b)
throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="../../java/io/OutputStream.html#write(int)">OutputStream</A></CODE></B></DD>
<DD>Writes the specified byte to this output stream. The general
contract for <code>write</code> is that one byte is written
to the output stream. The byte to be written is the eight
low-order bits of the argument <code>b</code>. The 24
high-order bits of <code>b</code> are ignored.
<p>
Subclasses of <code>OutputStream</code> must provide an
implementation for this method.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../java/io/OutputStream.html#write(int)">write</A></CODE> in class <CODE><A HREF="../../java/io/OutputStream.html" title="class in java.io">OutputStream</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>b</CODE> - the <code>byte</code>.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs. In particular,
an <code>IOException</code> may be thrown if the
output stream has been closed.</DL>
</DD>
</DL>
<HR>
<A NAME="write(byte[], int, int)"><!-- --></A><H3>
write</H3>
<PRE>
public void <B>write</B>(byte[] b,
int off,
int len)
throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="../../java/io/OutputStream.html#write(byte[], int, int)">OutputStream</A></CODE></B></DD>
<DD>Writes <code>len</code> bytes from the specified byte array
starting at offset <code>off</code> to this output stream.
The general contract for <code>write(b, off, len)</code> is that
some of the bytes in the array <code>b</code> are written to the
output stream in order; element <code>b[off]</code> is the first
byte written and <code>b[off+len-1]</code> is the last byte written
by this operation.
<p>
The <code>write</code> method of <code>OutputStream</code> calls
the write method of one argument on each of the bytes to be
written out. Subclasses are encouraged to override this method and
provide a more efficient implementation.
<p>
If <code>b</code> is <code>null</code>, a
<code>NullPointerException</code> is thrown.
<p>
If <code>off</code> is negative, or <code>len</code> is negative, or
<code>off+len</code> is greater than the length of the array
<code>b</code>, then an <tt>IndexOutOfBoundsException</tt> is thrown.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/OutputStream.html#write(byte[], int, int)">write</A></CODE> in class <CODE><A HREF="../../java/io/OutputStream.html" title="class in java.io">OutputStream</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>b</CODE> - the data.<DD><CODE>off</CODE> - the start offset in the data.<DD><CODE>len</CODE> - the number of bytes to write.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs. In particular,
an <code>IOException</code> is thrown if the output
stream is closed.</DL>
</DD>
</DL>
<HR>
<A NAME="flush()"><!-- --></A><H3>
flush</H3>
<PRE>
public void <B>flush</B>()
throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="../../java/io/OutputStream.html#flush()">OutputStream</A></CODE></B></DD>
<DD>Flushes this output stream and forces any buffered output bytes
to be written out. The general contract of <code>flush</code> is
that calling it is an indication that, if any bytes previously
written have been buffered by the implementation of the output
stream, such bytes should immediately be written to their
intended destination.
<p>
The <code>flush</code> method of <code>OutputStream</code> does nothing.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/OutputStream.html#flush()">flush</A></CODE> in class <CODE><A HREF="../../java/io/OutputStream.html" title="class in java.io">OutputStream</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.</DL>
</DD>
</DL>
<HR>
<A NAME="close()"><!-- --></A><H3>
close</H3>
<PRE>
public void <B>close</B>()
throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="../../java/io/OutputStream.html#close()">OutputStream</A></CODE></B></DD>
<DD>Closes this output stream and releases any system resources
associated with this stream. The general contract of <code>close</code>
is that it closes the output stream. A closed stream cannot perform
output operations and cannot be reopened.
<p>
The <code>close</code> method of <code>OutputStream</code> does nothing.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/OutputStream.html#close()">close</A></CODE> in class <CODE><A HREF="../../java/io/OutputStream.html" title="class in java.io">OutputStream</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/BufferedOutputStream.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
"<p style=\"background-color:${javadoc.bgcolor}; color:${javadoc.fgcolor}; padding:4px 5px 2px 3px; margin-top:-1px\"><b>2013 FRC Java API</b></p>"</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../java/io/BufferedInputStream.html" title="class in java.io"><B>PREV CLASS</B></A>
<A HREF="../../java/io/ByteArrayInputStream.html" title="class in java.io"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?java/io/BufferedOutputStream.html" target="_top"><B>FRAMES</B></A>
<A HREF="BufferedOutputStream.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
"<center><i><font size=\"-1\">For updated information see the <a href=\"http://www.usfirst.org/roboticsprograms/frc/\">Java FRC site</a></font></i></center>"
</BODY>
</HTML>
|
arithehun/frc
|
java/2013/java/io/BufferedOutputStream.html
|
HTML
|
mit
| 19,450
|
[Source](http://dotnetcodr.com/2013/02/04/web-security-in-net4-5-cookie-stealing/ "Permalink to Web security in .NET4.5: cookie stealing")
# Web security in .NET4.5: cookie stealing
|
forcewake/articles-for-translation
|
en/Security and cryptography/Web_security_in_.NET4.5_MVC4_with_C#/Cookie_stealing.md
|
Markdown
|
mit
| 184
|
SublimeLinter-contrib-xsvlog
================================
Work/test in progress 4-Jun-2015 -- Leon Woestenberg
Simple modification from the original xvhdl to xvlog, then just added the -sv flag to xvlog.
[](https://travis-ci.org/BrunoJJE/SublimeLinter-contrib-xvhdl)
This linter plugin for [SublimeLinter][docs] provides an interface to [xvhdl (from Xilinx Vivado Simulator)](http://www.xilinx.com/products/design-tools/vivado.html). It will be used with files that have the “VHDL” syntax.
## Installation
SublimeLinter 3 must be installed in order to use this plugin. If SublimeLinter 3 is not installed, please follow the instructions [here][installation].
### Linter installation
Before using this plugin, you must ensure that `xvhdl` is installed on your system. To install `xvhdl`, follow the instruction given in [this PDF document](http://www.xilinx.com/support/documentation/sw_manuals/xilinx2014_4/ug973-vivado-release-notes-install-license.pdf) page.
**Note:** This plugin requires `xvhdl` from Xilinx Vivado 2014.4 or later.
### Linter configuration
In order for `xvhdl` to be executed by SublimeLinter, you must ensure that its path is available to SublimeLinter. Before going any further, please read and follow the steps in [“Finding a linter executable”](http://sublimelinter.readthedocs.org/en/latest/troubleshooting.html#finding-a-linter-executable) through “Validating your PATH” in the documentation.
Once you have installed and configured `xvhdl`, you can proceed to install the SublimeLinter-contrib-xvhdl plugin if it is not yet installed.
### Plugin installation
Please use [Package Control][pc] to install the linter plugin. This will ensure that the plugin will be updated when new versions are available. If you want to install from source so you can modify the source code, you probably know what you are doing so we won’t cover that here.
To install via Package Control, do the following:
1. Within Sublime Text, bring up the [Command Palette][cmd] and type `install`. Among the commands you should see `Package Control: Install Package`. If that command is not highlighted, use the keyboard or mouse to select it. There will be a pause of a few seconds while Package Control fetches the list of available plugins.
1. When the plugin list appears, type `xvhdl`. Among the entries you should see `SublimeLinter-contrib-xvhdl`. If that entry is not highlighted, use the keyboard or mouse to select it.
## Settings
For general information on how SublimeLinter works with settings, please see [Settings][settings]. For information on generic linter settings, please see [Linter Settings][linter-settings].
## Contributing
If you would like to contribute enhancements or fixes, please do the following:
1. Fork the plugin repository.
1. Hack on a separate topic branch created from the latest `master`.
1. Commit and push the topic branch.
1. Make a pull request.
1. Be patient. ;-)
Please note that modifications should follow these coding guidelines:
- Indent is 4 spaces.
- Code should pass flake8 and pep257 linters.
- Vertical whitespace helps readability, don’t be afraid to use it.
- Please use descriptive variable names, no abbreviations unless they are very well known.
Thank you for helping out!
[docs]: http://sublimelinter.readthedocs.org
[installation]: http://sublimelinter.readthedocs.org/en/latest/installation.html
[locating-executables]: http://sublimelinter.readthedocs.org/en/latest/usage.html#how-linter-executables-are-located
[pc]: https://sublime.wbond.net/installation
[cmd]: http://docs.sublimetext.info/en/sublime-text-3/extensibility/command_palette.html
[settings]: http://sublimelinter.readthedocs.org/en/latest/settings.html
[linter-settings]: http://sublimelinter.readthedocs.org/en/latest/linter_settings.html
[inline-settings]: http://sublimelinter.readthedocs.org/en/latest/settings.html#inline-settings
|
likewise/SublimeLinter-contrib-xsvlog
|
README.md
|
Markdown
|
mit
| 3,997
|
<?php
namespace Oro\Bundle\CalendarBundle\Handler;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityNotFoundException;
use Symfony\Component\HttpFoundation\RequestStack;
use Oro\Bundle\CalendarBundle\Entity\CalendarEvent;
use Oro\Bundle\SecurityBundle\Exception\ForbiddenException;
use Oro\Bundle\SecurityBundle\SecurityFacade;
use Oro\Bundle\SoapBundle\Handler\DeleteHandler;
use Oro\Bundle\CalendarBundle\Entity\SystemCalendar;
use Oro\Bundle\CalendarBundle\Provider\SystemCalendarConfig;
use Oro\Bundle\CalendarBundle\Model\Email\EmailSendProcessor;
use Oro\Bundle\SoapBundle\Entity\Manager\ApiEntityManager;
class CalendarEventDeleteHandler extends DeleteHandler
{
/** @var RequestStack */
protected $requestStack;
/** @var SystemCalendarConfig */
protected $calendarConfig;
/** @var SecurityFacade */
protected $securityFacade;
/** @var EmailSendProcessor */
protected $emailSendProcessor;
/**
* @param RequestStack $requestStack
*
* @return CalendarEventDeleteHandler
*/
public function setRequestStack(RequestStack $requestStack)
{
$this->requestStack = $requestStack;
return $this;
}
/**
* @param EmailSendProcessor $emailSendProcessor
*
* @return CalendarEventDeleteHandler
*/
public function setEmailSendProcessor(EmailSendProcessor $emailSendProcessor)
{
$this->emailSendProcessor = $emailSendProcessor;
return $this;
}
/**
* @param SystemCalendarConfig $calendarConfig
*
* @return CalendarEventDeleteHandler
*/
public function setCalendarConfig(SystemCalendarConfig $calendarConfig)
{
$this->calendarConfig = $calendarConfig;
return $this;
}
/**
* @param SecurityFacade $securityFacade
*
* @return CalendarEventDeleteHandler
*/
public function setSecurityFacade(SecurityFacade $securityFacade)
{
$this->securityFacade = $securityFacade;
return $this;
}
/**
* {@inheritdoc}
*/
protected function checkPermissions($entity, ObjectManager $em)
{
/** @var SystemCalendar|null $calendar */
$calendar = $entity->getSystemCalendar();
if ($calendar) {
if ($calendar->isPublic()) {
if (!$this->calendarConfig->isPublicCalendarEnabled()) {
throw new ForbiddenException('Public calendars are disabled.');
}
if (!$this->securityFacade->isGranted('oro_public_calendar_event_management')) {
throw new ForbiddenException('Access denied.');
}
} else {
if (!$this->calendarConfig->isSystemCalendarEnabled()) {
throw new ForbiddenException('System calendars are disabled.');
}
if (!$this->securityFacade->isGranted('oro_system_calendar_event_management')) {
throw new ForbiddenException('Access denied.');
}
}
} else {
parent::checkPermissions($entity, $em);
}
}
/**
* {@inheritdoc}
*/
public function handleDelete($id, ApiEntityManager $manager)
{
/** @var CalendarEvent $entity */
$entity = $manager->find($id);
if (!$entity) {
throw new EntityNotFoundException();
}
$em = $manager->getObjectManager();
$this->processDelete($entity, $em);
}
/**
* @param CalendarEvent $entity
*
* {@inheritdoc}
*/
public function processDelete($entity, ObjectManager $em)
{
$this->checkPermissions($entity, $em);
if ($this->shouldCancelInsteadDelete() && $entity->getRecurringEvent()) {
$event = $entity->getRealCalendarEvent();
$event->setCancelled(true);
$childEvents = $event->getChildEvents();
foreach ($childEvents as $childEvent) {
$childEvent->setCancelled(true);
}
} else {
if ($entity->getRecurrence() && $entity->getRecurrence()->getId()) {
$em->remove($entity->getRecurrence());
}
if ($entity->getRecurringEvent()) {
$event = $entity->getRealCalendarEvent();
$childEvents = $event->getChildEvents();
foreach ($childEvents as $childEvent) {
$this->deleteEntity($childEvent, $em);
}
}
$this->deleteEntity($entity, $em);
}
$em->flush();
if ($this->shouldSendNotification()) {
$this->emailSendProcessor->sendDeleteEventNotification($entity);
}
}
/**
* @return bool
*/
protected function shouldSendNotification()
{
$request = $this->requestStack->getCurrentRequest();
return !$request || (bool) $request->query->get('notifyInvitedUsers', false);
}
/**
* @return bool
*/
protected function shouldCancelInsteadDelete()
{
$request = $this->requestStack->getCurrentRequest();
return $request && (bool) $request->query->get('isCancelInsteadDelete', false);
}
}
|
trustify/oroplatform
|
src/Oro/Bundle/CalendarBundle/Handler/CalendarEventDeleteHandler.php
|
PHP
|
mit
| 5,276
|
# Console Cowboy
> [Can You Jam With The Console Cowboys in Cyberspace?](https://www.youtube.com/watch?v=bLlj_GeKniA)
My carefully curated Vim and Tmux config files. Made for Mac OS X.
## What's in it?
* [iTerm 2](http://www.iterm2.com/)
* [tmux](http://tmux.sourceforge.net/)
* [MacVim](https://code.google.com/p/macvim/)
* [Ocean Dark Base16 theme](http://chriskempson.github.io/base16/#ocean)
## Why You Should Use Vim and TMUX
* Watch [Chris Hunt's great intro talk](https://www.youtube.com/watch?v=9jzWDr24UHQ) about the benefits of using both Vim and TMUX
* Read this great article explaining [why VIM and TMUX are better together](https://blog.bugsnag.com/tmux-and-vim/)
* Check out [Gary Bernhardt quickly switching between VIM and the terminal](https://youtu.be/tdNnN5yTIeM?t=3m05s) so you can get motivated
### Vim
* `,d` brings up [NERDTree](https://github.com/scrooloose/nerdtree), a sidebar buffer for navigating and manipulating files
* `,t` brings up [ctrlp.vim](https://github.com/kien/ctrlp.vim), a project file filter for easily opening specific files
* `,b` restricts ctrlp.vim to open buffers
* `,a` starts project search with [ag.vim](https://github.com/rking/ag.vim) using [the silver searcher](https://github.com/ggreer/the_silver_searcher) (like ack, but faster)
* `ds`/`cs` delete/change surrounding characters (e.g. `"Hey!"` + `ds"` = `Hey!`, `"Hey!"` + `cs"'` = `'Hey!'`) with [vim-surround](https://github.com/tpope/vim-surround)
* `\\\` toggles current line comment
* `\\` toggles visual selection comment lines
* `vii`/`vai` visually select *in* or *around* the cursor's indent
* `,[space]` strips trailing whitespace
* `,l` begins aligning lines on a string, usually used as `,l=` to align assignments
* `<C-hjkl>` move between windows, shorthand for `<C-w> hjkl`
* `<C-]>` & `<C-[>` to move between vim tab
* `s` and `i` to open vertical and horizontal windows from [NERDTree](https://github.com/scrooloose/nerdtree)
* `<C-v>` and `<C-x>` to open vertical and horizontal windows from [ctrlp.vim](https://github.com/kien/ctrlp.vim)
### Tmux
* `<C-a>` is the prefix
* mouse scroll initiates tmux scroll
* `prefix v` makes a vertical split
* `prefix s` makes a horizontal split
If you have three or more panes:
* `prefix +` opens up the main-horizontal-layout
* `prefix =` opens up the main-vertical-layout
You can adjust the size of the smaller panes in `tmux.conf` by lowering or increasing the `other-pane-height` and `other-pane-width` options.
## Install
rake
## Customize
In your home directory, Console Cowboy creates a `.vimrc.local` file where you can customize
Vim to your heart’s content.
## ZSH Theme
Colors are a tricky beast. First install [this shell script](https://github.com/chriskempson/base16-shell):
```
git clone https://github.com/chriskempson/base16-shell.git ~/.config/base16-shell
```
In order to make iTerm and Vim work add the bottom of your `.zshrc` file:
```
# Base16 Shell
BASE16_SHELL=$HOME/.config/base16-shell/
[ -n "$PS1" ] && [ -s $BASE16_SHELL/profile_helper.sh ] && eval "$($BASE16_SHELL/profile_helper.sh)"
```
Start a new shell and then type `base16_ocean` (hit enter)
## Configuring Your Keyboard
It's common and often recommended to reassign the caps lock key to be your modifier key instead. To do this
System Preferences > Keyboard > Modifier Keys (bottom right) > assign Caps Lock to use ^Control instead
Next, set Key Repeat and Delay Until Repeat all the way to the right ("fast" and "short" respectively).
## Configuring iTerm
Preferences > Profiles > [Select Your Profile] > Terminal
Silence the Bell, Enable the flash and disable the Growl messages.
## Uninstall
rake uninstall
Note that this won't remove everything, but your vim configuration should be reset to whatever it was before installing. Some uninstallation steps will be manual.
|
lokimeyburg/console-cowboy
|
README.md
|
Markdown
|
mit
| 3,875
|
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class CuotasCredito extends CI_Controller {
//public function costruct
public function __construct() {
parent:: __construct();
$this->load->helper(array('url', 'form', 'array', 'html'));
$this->load->model(array('CuotasCreditoModel', '', ''));
}
//
public function index() {
session_start();
$this->load->view('cuotasCredito');
}
//llamo vista de formulirio para perfiles
public function listProductoClientes() {
session_start();
$this->load->view('clientes');
}
public function distriCuotasCredito() {
session_start();
$this->load->view('cuotasCobrar');
}
//
public function listarClientes() {
$lista = $this->CuotasCreditoModel->listarClientes();
header('Content-type: application/json; charset=utf-8');
echo json_encode($lista);
}
//
public function listarProductosClientes() {
$idCliente = $_GET['idCliente'];
$lista = $this->CuotasCreditoModel->listarProductosClientes($idCliente);
header('Content-type: application/json; charset=utf-8');
echo json_encode($lista);
}
//
public function listarCuotasXCliente() {
$idpedido = $_POST['idPedido'];
$lista = $this->CuotasCreditoModel->listarCuotasClientes($idpedido);
header('Content-type: application/json; charset=utf-8');
echo json_encode($lista);
}
}
|
AL3X09/gestionpedidos
|
application/controllers/CuotasCredito.php
|
PHP
|
mit
| 1,406
|
// RUN: %clang_pgogen -O2 -o %t.0 %s
// RUN: %clang_pgogen=%t.d1 -O2 -o %t.1 %s
// RUN: %clang_pgogen=%t.d1/%t.d2 -O2 -o %t.2 %s
//
// RUN: %run %t.0 ""
// RUN: env LLVM_PROFILE_FILE=%t.d1/default.profraw %run %t.0 %t.d1/
// RUN: env LLVM_PROFILE_FILE=%t.d1/%t.d2/default.profraw %run %t.0 %t.d1/%t.d2/
// RUN: %run %t.1 %t.d1/
// RUN: %run %t.2 %t.d1/%t.d2/
// RUN: %run %t.2 %t.d1/%t.d2/ %t.d1/%t.d2/%t.d3/blah.profraw %t.d1/%t.d2/%t.d3/
#include <string.h>
const char *__llvm_profile_get_path_prefix();
void __llvm_profile_set_filanem(const char*);
int main(int argc, const char *argv[]) {
int i;
const char *expected;
const char *prefix;
if (argc < 2)
return 1;
expected = argv[1];
prefix = __llvm_profile_get_path_prefix();
if (strcmp(prefix, expected))
return 1;
if (argc == 4) {
__llvm_profile_set_filename(argv[2]);
prefix = __llvm_profile_get_path_prefix();
expected = argv[3];
if (strcmp(prefix, expected))
return 1;
}
return 0;
}
|
ensemblr/llvm-project-boilerplate
|
include/llvm/projects/compiler-rt/test/profile/instrprof-path.c
|
C
|
mit
| 1,000
|
Close button:
<ButtonClose callback={()=>{alert("hello")}}/>
|
leonidax/styleguidist-ts-less-example
|
src/components/commons/buttons/buttonClose.md
|
Markdown
|
mit
| 65
|
# Sound: Disable Startup Sound
Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" "DisableStartupSound" 1
Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\BootAnimation" "DisableStartupSound" 1
### Explorer, Taskbar, and System Tray
### --------------------------
if (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer")) {New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Type Folder | Out-Null}
# Explorer: Show hidden files by default (1: Show Files, 2: Hide Files)
Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "Hidden" 1
# Explorer: show file extensions by default (0: Show Extensions, 1: Hide Extensions)
Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "HideFileExt" 0
# Explorer: show path in title bar
Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState" "FullPath" 1
# Explorer: Avoid creating Thumbs.db files on network volumes
Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" "DisableThumbnailsOnNetworkFolders" 1
# Taskbar: use small icons (0: Large Icons, 1: Small Icons)
Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "TaskbarSmallIcons" 1
# Taskbar: Don't show Windows Store Apps on Taskbar
Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "StoreAppsOnTaskbar" 0
# Taskbar: Always Show Tray Icons
Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" "EnableAutoTray" 0
# SysTray: hide the Action Center, Network, and Volume icons
Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" "HideSCAHealth" 1
#Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" "HideSCANetwork" 1
#Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" "HideSCAVolume" 1
#Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" "HideSCAPower" 1
# Recycle Bin: Disable Delete Confirmation Dialog
Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" "ConfirmFileDelete" 0
# Start Menu: Disable Highlight Newly Installed Applications
Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "Start_NotifyNewApps" 0
### Charm Bar
### --------------------------
# Disable Bing Search
Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\ConnectedSearch" "ConnectedSearchUseWeb" 0
### SSD Specific Tweaks
### --------------------------
# Disable SuperFetch
Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters" "EnableSuperfetch" 0
### Accessibility
### --------------------------
# Turn Off Windows Narrator
if (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Narrator.exe")) {New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Narrator.exe" -Type Folder | Out-Null}
Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Narrator.exe" "Debugger" "%1"
|
khornberg/dotfiles
|
os/windows/tweaks.ps1
|
PowerShell
|
mit
| 3,321
|
using Avalonia.Platform;
namespace Avalonia.Media
{
/// <summary>
/// Describes a geometry using drawing commands.
/// </summary>
/// <remarks>
/// This class is used to define the geometry of a <see cref="StreamGeometry"/>. An instance
/// of <see cref="StreamGeometryContext"/> is obtained by calling
/// <see cref="StreamGeometry.Open"/>.
/// </remarks>
/// TODO: This class is just a wrapper around IStreamGeometryContextImpl: is it needed?
public class StreamGeometryContext : IGeometryContext
{
private readonly IStreamGeometryContextImpl _impl;
private Point _currentPoint;
/// <summary>
/// Initializes a new instance of the <see cref="StreamGeometryContext"/> class.
/// </summary>
/// <param name="impl">The platform-specific implementation.</param>
public StreamGeometryContext(IStreamGeometryContextImpl impl)
{
_impl = impl;
}
/// <summary>
/// Sets path's winding rule (default is EvenOdd). You should call this method before any calls to BeginFigure. If you wonder why, ask Direct2D guys about their design decisions.
/// </summary>
/// <param name="fillRule"></param>
public void SetFillRule(FillRule fillRule)
{
_impl.SetFillRule(fillRule);
}
/// <summary>
/// Draws an arc to the specified point.
/// </summary>
/// <param name="point">The destination point.</param>
/// <param name="size">The radii of an oval whose perimeter is used to draw the angle.</param>
/// <param name="rotationAngle">The rotation angle of the oval that specifies the curve.</param>
/// <param name="isLargeArc">true to draw the arc greater than 180 degrees; otherwise, false.</param>
/// <param name="sweepDirection">
/// A value that indicates whether the arc is drawn in the Clockwise or Counterclockwise direction.
/// </param>
public void ArcTo(Point point, Size size, double rotationAngle, bool isLargeArc, SweepDirection sweepDirection)
{
_impl.ArcTo(point, size, rotationAngle, isLargeArc, sweepDirection);
_currentPoint = point;
}
/// <summary>
/// Draws an arc to the specified point using polylines, quadratic or cubic Bezier curves
/// Significantly more precise when drawing elliptic arcs with extreme width:height ratios.
/// </summary>
/// <param name="point">The destination point.</param>
/// <param name="size">The radii of an oval whose perimeter is used to draw the angle.</param>
/// <param name="rotationAngle">The rotation angle of the oval that specifies the curve.</param>
/// <param name="isLargeArc">true to draw the arc greater than 180 degrees; otherwise, false.</param>
/// <param name="sweepDirection">
/// A value that indicates whether the arc is drawn in the Clockwise or Counterclockwise direction.
/// </param>
public void PreciseArcTo(Point point, Size size, double rotationAngle, bool isLargeArc, SweepDirection sweepDirection)
{
PreciseEllipticArcHelper.ArcTo(this, _currentPoint, point, size, rotationAngle, isLargeArc, sweepDirection);
}
/// <summary>
/// Begins a new figure.
/// </summary>
/// <param name="startPoint">The starting point for the figure.</param>
/// <param name="isFilled">Whether the figure is filled.</param>
public void BeginFigure(Point startPoint, bool isFilled)
{
_impl.BeginFigure(startPoint, isFilled);
_currentPoint = startPoint;
}
/// <summary>
/// Draws a Bezier curve to the specified point.
/// </summary>
/// <param name="point1">The first control point used to specify the shape of the curve.</param>
/// <param name="point2">The second control point used to specify the shape of the curve.</param>
/// <param name="point3">The destination point for the end of the curve.</param>
public void CubicBezierTo(Point point1, Point point2, Point point3)
{
_impl.CubicBezierTo(point1, point2, point3);
_currentPoint = point3;
}
/// <summary>
/// Draws a quadratic Bezier curve to the specified point
/// </summary>
/// <param name="control">The control point used to specify the shape of the curve.</param>
/// <param name="endPoint">The destination point for the end of the curve.</param>
public void QuadraticBezierTo(Point control, Point endPoint)
{
_impl.QuadraticBezierTo(control, endPoint);
_currentPoint = endPoint;
}
/// <summary>
/// Draws a line to the specified point.
/// </summary>
/// <param name="point">The destination point.</param>
public void LineTo(Point point)
{
_impl.LineTo(point);
_currentPoint = point;
}
/// <summary>
/// Ends the figure started by <see cref="BeginFigure(Point, bool)"/>.
/// </summary>
/// <param name="isClosed">Whether the figure is closed.</param>
public void EndFigure(bool isClosed)
{
_impl.EndFigure(isClosed);
}
/// <summary>
/// Finishes the drawing session.
/// </summary>
public void Dispose()
{
_impl.Dispose();
}
}
}
|
AvaloniaUI/Avalonia
|
src/Avalonia.Visuals/Media/StreamGeometryContext.cs
|
C#
|
mit
| 5,597
|
class Language < ActiveRecord::Base
has_many :user_languages
has_many :users, through: :user_languages
has_many :messages
validates_presence_of :name
end
|
andarcabrera/NoFences
|
app/models/language.rb
|
Ruby
|
mit
| 163
|
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = python-simple-rest-client
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
allisson/python-simple-rest-client
|
docs/Makefile
|
Makefile
|
mit
| 623
|
/*using Discord;
using Discord.Commands;
using Discord.Commands.Permissions.Levels;
using Discord.Modules;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Scripting;
using Microsoft.CodeAnalysis.Scripting;
using Microsoft.Dnx.Compilation;
using Microsoft.Dnx.Compilation.CSharp;
using Microsoft.Extensions.PlatformAbstractions;
using System;
using System.IO;
using System.Linq;
using System.Reflection.PortableExecutable;
namespace DiscordBot.Modules.Execute
{
public class ScriptGlobals
{
public CommandEventArgs e { get; internal set; }
public DiscordClient client { get; internal set; }
}
/// <summary> Allows the execution of scripts from within Discord. Be very careful with the permissions of this module - allowing remote execution for anyone but the bot owner is generally a bad idea. </summary>
internal class ExecuteModule : IModule
{
private readonly IApplicationEnvironment _dnxEnvironment;
private readonly ILibraryExporter _libExporter;
private ModuleManager _manager;
private DiscordClient _client;
public ExecuteModule(IApplicationEnvironment env, ILibraryExporter libEx)
{
_dnxEnvironment = env;
_libExporter = libEx;
}
void IModule.Install(ModuleManager manager)
{
_manager = manager;
_client = manager.Client;
var references = _libExporter.GetAllExports(_dnxEnvironment.ApplicationName).MetadataReferences;
var options = ScriptOptions.Default
.AddReferences(references.Select(x => ConvertMetadataReference(x)))
.AddImports("System.Collections.Generic", "System.Linq");
manager.CreateCommands("", group =>
{
group.MinPermissions((int)PermissionLevel.BotOwner);
group.CreateCommand("eval")
.Description("Runs a C# sniplet and returns the result")
.Parameter("code", ParameterType.Unparsed)
.Do(async e =>
{
var globals = new ScriptGlobals { e = e, client = _client };
var text = e.Args[0].Trim('`'); //Remove code block tags
try
{
var script = CSharpScript.Create(text, options, typeof(ScriptGlobals));
var scriptState = await script.RunAsync(globals);
var returnValue = scriptState.ReturnValue;
if (returnValue != null)
await _client.Reply(e, returnValue.ToString());
}
catch (Exception ex)
{
await _client.ReplyError(e, ex);
}
});
group.CreateCommand("exec")
.Alias("run")
.Description("Runs a C# sniplet")
.Parameter("code", ParameterType.Unparsed)
.Do(async e =>
{
var globals = new ScriptGlobals { e = e, client = _client };
var text = e.Args[0].Trim('`'); //Remove code block tags
try
{
var script = CSharpScript.Create(text, options, typeof(ScriptGlobals));
await script.RunAsync(globals);
}
catch (Exception ex)
{
await _client.ReplyError(e, ex);
}
});
});
}
//Source: https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNet.Mvc.Razor/Compilation/RoslynCompilationService.cs
private MetadataReference ConvertMetadataReference(IMetadataReference metadataReference)
{
var roslynReference = metadataReference as IRoslynMetadataReference;
if (roslynReference != null)
return roslynReference.MetadataReference;
var embeddedReference = metadataReference as IMetadataEmbeddedReference;
if (embeddedReference != null)
return MetadataReference.CreateFromImage(embeddedReference.Contents);
var fileMetadataReference = metadataReference as IMetadataFileReference;
if (fileMetadataReference != null)
{
using (var stream = File.OpenRead(fileMetadataReference.Path))
{
var moduleMetadata = ModuleMetadata.CreateFromStream(stream, PEStreamOptions.PrefetchMetadata);
return AssemblyMetadata.Create(moduleMetadata).GetReference(filePath: fileMetadataReference.Path);
}
}
var projectReference = metadataReference as IMetadataProjectReference;
if (projectReference != null)
{
using (var ms = new MemoryStream())
{
projectReference.EmitReferenceAssembly(ms);
return MetadataReference.CreateFromImage(ms.ToArray());
}
}
throw new NotSupportedException();
}
}
}
*/
|
Techbot121/DiscordBot
|
src/DiscordBot/Modules/Execute/ExecuteModule.cs
|
C#
|
mit
| 4,304
|
// Regular expression that matches all symbols in the `Deseret` script as per Unicode v5.0.0:
/\uD801[\uDC00-\uDC4F]/;
|
mathiasbynens/unicode-data
|
5.0.0/scripts/Deseret-regex.js
|
JavaScript
|
mit
| 118
|
---
layout: post
title: "idea plugin folder"
description: ""
category: idea
tags: [idea]
---
{% include JB/setup %}
###IDEA中插件安装位置###
用IDEA [安装jrebel插件][install jrebel plugin]后,找不到安装位置
on Mac OS X
目录为:
####~/Library/Application Support/IntelliJIdea13####
通过Activity Monitor -> open files and ports 发现
[install jrebel plugin]:http://manuals.zeroturnaround.com/jrebel/ide/intellij.html 'idea 安装jrebel插件'
|
kennedy-han/blog
|
_posts/2014-07-07-idea-plugin-folder.md
|
Markdown
|
mit
| 473
|
class User < ApplicationRecord
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :omniauthable, :omniauth_providers => [:google]
has_many :rabbis, through: :appointments
has_many :appointments
has_many :ChatMessages
enum role: [:normal, :admin]
validates :name, presence: true
def serializer_fields_for_index
"attributes :name"
end
def self.from_omniauth(auth)
where(email: auth.info.email).first_or_create do |user|
user.email = auth.info.email
user.password = Devise.friendly_token[0,20]
user.name = auth.info.name
user.provider = auth.provider
end
end
end
|
peacestone/chat-with-the-rabbi
|
app/models/user.rb
|
Ruby
|
mit
| 687
|
//
// MGWatchdogPlatformIOS.h
// Pods
//
// Created by Max Gordeev on 31/05/15.
//
//
#include <TargetConditionals.h>
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
@import Foundation;
#import "MGWatchdogPlatform.h"
@interface MGWatchdogPlatformIOS : NSObject <MGWatchdogPlatform>
@end
#endif
|
RyanTech/MGWatchdog
|
MGWatchdog/MGWatchdog/Sources/MGWatchdogPlatformIOS.h
|
C
|
mit
| 302
|
define([
'jquery',
'underscore',
'backbone',
'scripts/main/models/forum',
], function($, _, Backbone, ForumModel){
var ForumCollection = Backbone.Collection.extend({
model : ForumModel,
url : ForumModel.prototype.urlRoot,
});
return ForumCollection;
});
|
houssemFat/MeeM-Dev
|
teacher/static/js/main/collections/forum.js
|
JavaScript
|
mit
| 296
|
import { ACTIONS, TYPE } from './constants';
import { CalendarViewEvent } from '../../../containers/calendar/interface';
export interface EventDownAction {
action: ACTIONS.EVENT_DOWN;
payload: {
type: TYPE;
idx: number;
event: CalendarViewEvent;
};
}
export interface CreateDownAction {
action: ACTIONS.CREATE_DOWN;
payload: {
type: TYPE;
idx: number | Date;
};
}
export interface MoreDownAction {
action: ACTIONS.MORE_DOWN;
payload: {
type: TYPE;
date: Date;
events: Set<string>;
idx: number;
row: number;
};
}
export type MouseDownAction = MoreDownAction | EventDownAction | CreateDownAction;
export const isMoreDownAction = (action: MouseDownAction): action is MoreDownAction => {
return action.action === ACTIONS.MORE_DOWN;
};
export const isEventDownAction = (action: MouseDownAction): action is EventDownAction => {
return action.action === ACTIONS.EVENT_DOWN;
};
export const isCreateDownAction = (action: MouseDownAction): action is CreateDownAction => {
return action.action === ACTIONS.CREATE_DOWN;
};
export interface MoreUpAction {
action: ACTIONS.MORE_UP;
}
export interface EventUpAction {
action: ACTIONS.EVENT_UP;
payload: {
type: TYPE;
idx: number;
event?: CalendarViewEvent;
};
}
export interface StartEndResult {
start: Date;
end: Date;
}
export interface EventMoveAction {
action: ACTIONS.EVENT_MOVE | ACTIONS.EVENT_MOVE_UP;
payload: {
type: TYPE;
idx?: number;
result: StartEndResult;
day?: number;
};
}
export interface CreateUpAction {
action: ACTIONS.CREATE_UP | ACTIONS.CREATE_MOVE | ACTIONS.CREATE_MOVE_UP;
payload: {
type: TYPE;
idx: number;
result: StartEndResult;
};
}
export type MouseUpAction = MoreUpAction | EventUpAction | EventMoveAction | CreateUpAction;
export type OnMouseDown = (action: MouseDownAction) => undefined | ((action: MouseUpAction) => void);
|
ProtonMail/WebClient
|
applications/calendar/src/app/components/calendar/interactions/interface.ts
|
TypeScript
|
mit
| 2,057
|
# -*- coding: utf-8 -*-
#
# powerschool_apps documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
from __future__ import unicode_literals
import os
import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('.'))
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = []
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
# source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'powerschool_apps'
copyright = """2017, Iron County School District"""
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1'
# The full version, including alpha/beta/rc tags.
release = '0.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
# language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
# today = ''
# Else, today_fmt is used as the format for a strftime call.
# today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
# The reST default role (used for this markup: `text`) to use for all documents.
# default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
# add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
# add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
# show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
# html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
# html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
# html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
# html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
# html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
# html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
# html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
# html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
# html_additional_pages = {}
# If false, no module index is generated.
# html_domain_indices = True
# If false, no index is generated.
# html_use_index = True
# If true, the index is split into individual pages for each letter.
# html_split_index = False
# If true, links to the reST sources are added to the pages.
# html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
# html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
# html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
# html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
# html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'powerschool_appsdoc'
# -- Options for LaTeX output --------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
# 'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index',
'powerschool_apps.tex',
'powerschool_apps Documentation',
"""Iron County School District""", 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
# latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
# latex_use_parts = False
# If true, show page references after internal links.
# latex_show_pagerefs = False
# If true, show URL addresses after external links.
# latex_show_urls = False
# Documents to append as an appendix to all manuals.
# latex_appendices = []
# If false, no module index is generated.
# latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'powerschool_apps', 'powerschool_apps Documentation',
["""Iron County School District"""], 1)
]
# If true, show URL addresses after external links.
# man_show_urls = False
# -- Options for Texinfo output ------------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'powerschool_apps', 'powerschool_apps Documentation',
"""Iron County School District""", 'powerschool_apps',
"""PowerSchool customizations written in Django""", 'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
# texinfo_appendices = []
# If false, no module index is generated.
# texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
# texinfo_show_urls = 'footnote'
|
IronCountySchoolDistrict/powerschool_apps
|
docs/conf.py
|
Python
|
mit
| 8,001
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.