text
stringlengths 2
100k
| meta
dict |
---|---|
from .base import FieldType
from dedupe import predicates
class ExactType(FieldType):
_predicate_functions = [predicates.wholeFieldPredicate]
type = "Exact"
@staticmethod
def comparator(field_1, field_2):
if field_1 == field_2:
return 1
else:
return 0
| {
"pile_set_name": "Github"
} |
---
description: "updateString Method (java.lang.String, java.lang.String)"
title: "updateString Method (java.lang.String, java.lang.String) | Microsoft Docs"
ms.custom: ""
ms.date: "01/19/2017"
ms.prod: sql
ms.prod_service: connectivity
ms.reviewer: ""
ms.technology: connectivity
ms.topic: conceptual
apiname:
- "SQLServerResultSet.updateString (java.lang.String, java.lang.String)"
apilocation:
- "sqljdbc.jar"
apitype: "Assembly"
ms.assetid: 3a9236bb-a307-45a8-b7d2-c4cbd9b3cb35
author: David-Engel
ms.author: v-daenge
---
# updateString Method (java.lang.String, java.lang.String)
[!INCLUDE[Driver_JDBC_Download](../../../includes/driver_jdbc_download.md)]
Updates the designated column with a **String** value given the column name.
## Syntax
```
public void updateString(java.lang.String columnName,
java.lang.String x)
```
#### Parameters
*columnName*
A **String** that contains the column name.
*x*
A **String** object.
## Exceptions
[SQLServerException](../../../connect/jdbc/reference/sqlserverexception-class.md)
## Remarks
This updateString method is specified by the updateString method in the java.sql.ResultSet interface.
## See Also
[updateString Method (SQLServerResultSet)](../../../connect/jdbc/reference/updatestring-method-sqlserverresultset.md)
[SQLServerResultSet Members](../../../connect/jdbc/reference/sqlserverresultset-members.md)
[SQLServerResultSet Class](../../../connect/jdbc/reference/sqlserverresultset-class.md)
| {
"pile_set_name": "Github"
} |
/*
* This file is part of the UCB release of Plan 9. It is subject to the license
* terms in the LICENSE file found in the top-level directory of this
* distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
* part of the UCB release of Plan 9, including this file, may be copied,
* modified, propagated, or distributed except according to the terms contained
* in the LICENSE file.
*/
/*
*
* debugger
*
*/
#include "defs.h"
#include "fns.h"
Rune line[LINSIZ];
extern int infile;
Rune *lp;
int peekc,lastc = EOR;
int eof;
/* input routines */
eol(int c)
{
return(c==EOR || c==';');
}
int
rdc(void)
{
do {
readchar();
} while (lastc==SPC || lastc==TB);
return(lastc);
}
void
reread(void)
{
peekc = lastc;
}
void
clrinp(void)
{
flush();
lp = 0;
peekc = 0;
}
int
readrune(int fd, Rune *r)
{
char buf[UTFmax+1];
int i;
for(i=0; i<UTFmax && !fullrune(buf, i); i++)
if(read(fd, buf+i, 1) <= 0)
return -1;
buf[i] = 0;
chartorune(r, buf);
return 1;
}
int
readchar(void)
{
Rune *p;
if (eof)
lastc=0;
else if (peekc) {
lastc = peekc;
peekc = 0;
}
else {
if (lp==0) {
for (p = line; p < &line[LINSIZ-1]; p++) {
eof = readrune(infile, p) <= 0;
if (mkfault) {
eof = 0;
error(0);
}
if (eof) {
p--;
break;
}
if (*p == EOR) {
if (p <= line)
break;
if (p[-1] != '\\')
break;
p -= 2;
}
}
p[1] = 0;
lp = line;
}
if ((lastc = *lp) != 0)
lp++;
}
return(lastc);
}
nextchar(void)
{
if (eol(rdc())) {
reread();
return(0);
}
return(lastc);
}
quotchar(void)
{
if (readchar()=='\\')
return(readchar());
else if (lastc=='\'')
return(0);
else
return(lastc);
}
void
getformat(char *deformat)
{
char *fptr;
BOOL quote;
Rune r;
fptr=deformat;
quote=FALSE;
while ((quote ? readchar()!=EOR : !eol(readchar()))){
r = lastc;
fptr += runetochar(fptr, &r);
if (lastc == '"')
quote = ~quote;
}
lp--;
if (fptr!=deformat)
*fptr = '\0';
}
/*
* check if the input line if of the form:
* <filename>:<digits><verb> ...
*
* we handle this case specially because we have to look ahead
* at the token after the colon to decide if it is a file reference
* or a colon-command with a symbol name prefix.
*/
int
isfileref(void)
{
Rune *cp;
for (cp = lp-1; *cp && !strchr(CMD_VERBS, *cp); cp++)
if (*cp == '\\' && cp[1]) /* escape next char */
cp++;
if (*cp && cp > lp-1) {
while (*cp == ' ' || *cp == '\t')
cp++;
if (*cp++ == ':') {
while (*cp == ' ' || *cp == '\t')
cp++;
if (isdigit(*cp))
return 1;
}
}
return 0;
}
| {
"pile_set_name": "Github"
} |
package core.org.akaza.openclinica.service.crfdata.xform;
public class EnketoAccountResponse {
private String server_url = null;
private String api_key = null;
private int code = 0;
public String getServer_url() {
return server_url;
}
public void setServer_url(String server_url) {
this.server_url = server_url;
}
public String getApi_key() {
return api_key;
}
public void setApi_key(String api_key) {
this.api_key = api_key;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
}
| {
"pile_set_name": "Github"
} |
cheat0_address = "2769152"
cheat0_address_bit_position = "0"
cheat0_big_endian = "false"
cheat0_cheat_type = "1"
cheat0_code = ""
cheat0_desc = "P1 Only One Shot Recorded"
cheat0_enable = "false"
cheat0_handler = "1"
cheat0_memory_search_size = "4"
cheat0_rumble_port = "0"
cheat0_rumble_primary_duration = "0"
cheat0_rumble_primary_strength = "0"
cheat0_rumble_secondary_duration = "0"
cheat0_rumble_secondary_strength = "0"
cheat0_rumble_type = "0"
cheat0_rumble_value = "0"
cheat0_value = "1"
cheat0_repeat_count = "1"
cheat0_repeat_add_to_value = "0"
cheat0_repeat_add_to_address = "0"
cheat1_address = "2769156"
cheat1_address_bit_position = "0"
cheat1_big_endian = "false"
cheat1_cheat_type = "1"
cheat1_code = ""
cheat1_desc = "P2 Only One Shot Recorded"
cheat1_enable = "false"
cheat1_handler = "1"
cheat1_memory_search_size = "4"
cheat1_rumble_port = "0"
cheat1_rumble_primary_duration = "0"
cheat1_rumble_primary_strength = "0"
cheat1_rumble_secondary_duration = "0"
cheat1_rumble_secondary_strength = "0"
cheat1_rumble_type = "0"
cheat1_rumble_value = "0"
cheat1_value = "1"
cheat1_repeat_count = "1"
cheat1_repeat_add_to_value = "0"
cheat1_repeat_add_to_address = "0"
cheat2_address = "2769160"
cheat2_address_bit_position = "0"
cheat2_big_endian = "false"
cheat2_cheat_type = "1"
cheat2_code = ""
cheat2_desc = "P3 Only One Shot Recorded"
cheat2_enable = "false"
cheat2_handler = "1"
cheat2_memory_search_size = "4"
cheat2_rumble_port = "0"
cheat2_rumble_primary_duration = "0"
cheat2_rumble_primary_strength = "0"
cheat2_rumble_secondary_duration = "0"
cheat2_rumble_secondary_strength = "0"
cheat2_rumble_type = "0"
cheat2_rumble_value = "0"
cheat2_value = "1"
cheat2_repeat_count = "1"
cheat2_repeat_add_to_value = "0"
cheat2_repeat_add_to_address = "0"
cheat3_address = "2769164"
cheat3_address_bit_position = "0"
cheat3_big_endian = "false"
cheat3_cheat_type = "1"
cheat3_code = ""
cheat3_desc = "P4 Only One Shot Recorded"
cheat3_enable = "false"
cheat3_handler = "1"
cheat3_memory_search_size = "4"
cheat3_rumble_port = "0"
cheat3_rumble_primary_duration = "0"
cheat3_rumble_primary_strength = "0"
cheat3_rumble_secondary_duration = "0"
cheat3_rumble_secondary_strength = "0"
cheat3_rumble_type = "0"
cheat3_rumble_value = "0"
cheat3_value = "1"
cheat3_repeat_count = "1"
cheat3_repeat_add_to_value = "0"
cheat3_repeat_add_to_address = "0"
cheat4_address = "2769152"
cheat4_address_bit_position = "0"
cheat4_big_endian = "false"
cheat4_cheat_type = "1"
cheat4_code = ""
cheat4_desc = "P1 Hella Shots Recorded"
cheat4_enable = "false"
cheat4_handler = "1"
cheat4_memory_search_size = "4"
cheat4_rumble_port = "0"
cheat4_rumble_primary_duration = "0"
cheat4_rumble_primary_strength = "0"
cheat4_rumble_secondary_duration = "0"
cheat4_rumble_secondary_strength = "0"
cheat4_rumble_type = "0"
cheat4_rumble_value = "0"
cheat4_value = "9"
cheat4_repeat_count = "1"
cheat4_repeat_add_to_value = "0"
cheat4_repeat_add_to_address = "0"
cheat5_address = "2769156"
cheat5_address_bit_position = "0"
cheat5_big_endian = "false"
cheat5_cheat_type = "1"
cheat5_code = ""
cheat5_desc = "P2 Hella Shots Recorded"
cheat5_enable = "false"
cheat5_handler = "1"
cheat5_memory_search_size = "4"
cheat5_rumble_port = "0"
cheat5_rumble_primary_duration = "0"
cheat5_rumble_primary_strength = "0"
cheat5_rumble_secondary_duration = "0"
cheat5_rumble_secondary_strength = "0"
cheat5_rumble_type = "0"
cheat5_rumble_value = "0"
cheat5_value = "9"
cheat5_repeat_count = "1"
cheat5_repeat_add_to_value = "0"
cheat5_repeat_add_to_address = "0"
cheat6_address = "2769160"
cheat6_address_bit_position = "0"
cheat6_big_endian = "false"
cheat6_cheat_type = "1"
cheat6_code = ""
cheat6_desc = "P3 Hella Shots Recorded"
cheat6_enable = "false"
cheat6_handler = "1"
cheat6_memory_search_size = "4"
cheat6_rumble_port = "0"
cheat6_rumble_primary_duration = "0"
cheat6_rumble_primary_strength = "0"
cheat6_rumble_secondary_duration = "0"
cheat6_rumble_secondary_strength = "0"
cheat6_rumble_type = "0"
cheat6_rumble_value = "0"
cheat6_value = "9"
cheat6_repeat_count = "1"
cheat6_repeat_add_to_value = "0"
cheat6_repeat_add_to_address = "0"
cheat7_address = "2769164"
cheat7_address_bit_position = "0"
cheat7_big_endian = "false"
cheat7_cheat_type = "1"
cheat7_code = ""
cheat7_desc = "P4 Hella Shots Recorded"
cheat7_enable = "false"
cheat7_handler = "1"
cheat7_memory_search_size = "4"
cheat7_rumble_port = "0"
cheat7_rumble_primary_duration = "0"
cheat7_rumble_primary_strength = "0"
cheat7_rumble_secondary_duration = "0"
cheat7_rumble_secondary_strength = "0"
cheat7_rumble_type = "0"
cheat7_rumble_value = "0"
cheat7_value = "9"
cheat7_repeat_count = "1"
cheat7_repeat_add_to_value = "0"
cheat7_repeat_add_to_address = "0"
cheat8_address = "2821144"
cheat8_address_bit_position = "0"
cheat8_big_endian = "false"
cheat8_cheat_type = "1"
cheat8_code = ""
cheat8_desc = "Always No Wind"
cheat8_enable = "false"
cheat8_handler = "1"
cheat8_memory_search_size = "5"
cheat8_rumble_port = "0"
cheat8_rumble_primary_duration = "0"
cheat8_rumble_primary_strength = "0"
cheat8_rumble_secondary_duration = "0"
cheat8_rumble_secondary_strength = "0"
cheat8_rumble_type = "0"
cheat8_rumble_value = "0"
cheat8_value = "0"
cheat8_repeat_count = "1"
cheat8_repeat_add_to_value = "0"
cheat8_repeat_add_to_address = "0"
cheat9_address = "547136"
cheat9_address_bit_position = "0"
cheat9_big_endian = "false"
cheat9_cheat_type = "1"
cheat9_code = ""
cheat9_desc = "Have All Characters"
cheat9_enable = "false"
cheat9_handler = "1"
cheat9_memory_search_size = "4"
cheat9_rumble_port = "0"
cheat9_rumble_primary_duration = "0"
cheat9_rumble_primary_strength = "0"
cheat9_rumble_secondary_duration = "0"
cheat9_rumble_secondary_strength = "0"
cheat9_rumble_type = "0"
cheat9_rumble_value = "0"
cheat9_value = "65535"
cheat9_repeat_count = "1"
cheat9_repeat_add_to_value = "0"
cheat9_repeat_add_to_address = "0"
cheat10_address = "1393136"
cheat10_address_bit_position = "0"
cheat10_big_endian = "false"
cheat10_cheat_type = "1"
cheat10_code = ""
cheat10_desc = "P1 Character Modifier (Replace FF's with below code)"
cheat10_enable = "false"
cheat10_handler = "1"
cheat10_memory_search_size = "4"
cheat10_rumble_port = "0"
cheat10_rumble_primary_duration = "0"
cheat10_rumble_primary_strength = "0"
cheat10_rumble_secondary_duration = "0"
cheat10_rumble_secondary_strength = "0"
cheat10_rumble_type = "0"
cheat10_rumble_value = "0"
cheat10_value = "255"
cheat10_repeat_count = "1"
cheat10_repeat_add_to_value = "0"
cheat10_repeat_add_to_address = "0"
cheat11_address = "1393140"
cheat11_address_bit_position = "0"
cheat11_big_endian = "false"
cheat11_cheat_type = "1"
cheat11_code = ""
cheat11_desc = "P2 Character Modifier (Replace FF's with below code)"
cheat11_enable = "false"
cheat11_handler = "1"
cheat11_memory_search_size = "4"
cheat11_rumble_port = "0"
cheat11_rumble_primary_duration = "0"
cheat11_rumble_primary_strength = "0"
cheat11_rumble_secondary_duration = "0"
cheat11_rumble_secondary_strength = "0"
cheat11_rumble_type = "0"
cheat11_rumble_value = "0"
cheat11_value = "255"
cheat11_repeat_count = "1"
cheat11_repeat_add_to_value = "0"
cheat11_repeat_add_to_address = "0"
cheat12_address = "1393144"
cheat12_address_bit_position = "0"
cheat12_big_endian = "false"
cheat12_cheat_type = "1"
cheat12_code = ""
cheat12_desc = "P3 Character Modifier (Replace FF's with below code)"
cheat12_enable = "false"
cheat12_handler = "1"
cheat12_memory_search_size = "4"
cheat12_rumble_port = "0"
cheat12_rumble_primary_duration = "0"
cheat12_rumble_primary_strength = "0"
cheat12_rumble_secondary_duration = "0"
cheat12_rumble_secondary_strength = "0"
cheat12_rumble_type = "0"
cheat12_rumble_value = "0"
cheat12_value = "255"
cheat12_repeat_count = "1"
cheat12_repeat_add_to_value = "0"
cheat12_repeat_add_to_address = "0"
cheat13_address = "1393148"
cheat13_address_bit_position = "0"
cheat13_big_endian = "false"
cheat13_cheat_type = "1"
cheat13_code = ""
cheat13_desc = "P4 Character Modifier (Replace FF's with below code)"
cheat13_enable = "false"
cheat13_handler = "1"
cheat13_memory_search_size = "4"
cheat13_rumble_port = "0"
cheat13_rumble_primary_duration = "0"
cheat13_rumble_primary_strength = "0"
cheat13_rumble_secondary_duration = "0"
cheat13_rumble_secondary_strength = "0"
cheat13_rumble_type = "0"
cheat13_rumble_value = "0"
cheat13_value = "255"
cheat13_repeat_count = "1"
cheat13_repeat_add_to_value = "0"
cheat13_repeat_add_to_address = "0"
cheat14_address = "1392168"
cheat14_address_bit_position = "0"
cheat14_big_endian = "false"
cheat14_cheat_type = "1"
cheat14_code = ""
cheat14_desc = "P1 Only One Shot Recorded Codes-1st Hole"
cheat14_enable = "false"
cheat14_handler = "1"
cheat14_memory_search_size = "4"
cheat14_rumble_port = "0"
cheat14_rumble_primary_duration = "0"
cheat14_rumble_primary_strength = "0"
cheat14_rumble_secondary_duration = "0"
cheat14_rumble_secondary_strength = "0"
cheat14_rumble_type = "0"
cheat14_rumble_value = "0"
cheat14_value = "1"
cheat14_repeat_count = "1"
cheat14_repeat_add_to_value = "0"
cheat14_repeat_add_to_address = "0"
cheat15_address = "1392172"
cheat15_address_bit_position = "0"
cheat15_big_endian = "false"
cheat15_cheat_type = "1"
cheat15_code = ""
cheat15_desc = "P1 Only One Shot Recorded Codes-2nd Hole"
cheat15_enable = "false"
cheat15_handler = "1"
cheat15_memory_search_size = "4"
cheat15_rumble_port = "0"
cheat15_rumble_primary_duration = "0"
cheat15_rumble_primary_strength = "0"
cheat15_rumble_secondary_duration = "0"
cheat15_rumble_secondary_strength = "0"
cheat15_rumble_type = "0"
cheat15_rumble_value = "0"
cheat15_value = "1"
cheat15_repeat_count = "1"
cheat15_repeat_add_to_value = "0"
cheat15_repeat_add_to_address = "0"
cheat16_address = "1392176"
cheat16_address_bit_position = "0"
cheat16_big_endian = "false"
cheat16_cheat_type = "1"
cheat16_code = ""
cheat16_desc = "P1 Only One Shot Recorded Codes-3rd Hole"
cheat16_enable = "false"
cheat16_handler = "1"
cheat16_memory_search_size = "4"
cheat16_rumble_port = "0"
cheat16_rumble_primary_duration = "0"
cheat16_rumble_primary_strength = "0"
cheat16_rumble_secondary_duration = "0"
cheat16_rumble_secondary_strength = "0"
cheat16_rumble_type = "0"
cheat16_rumble_value = "0"
cheat16_value = "1"
cheat16_repeat_count = "1"
cheat16_repeat_add_to_value = "0"
cheat16_repeat_add_to_address = "0"
cheat17_address = "1392180"
cheat17_address_bit_position = "0"
cheat17_big_endian = "false"
cheat17_cheat_type = "1"
cheat17_code = ""
cheat17_desc = "P1 Only One Shot Recorded Codes-4th Hole"
cheat17_enable = "false"
cheat17_handler = "1"
cheat17_memory_search_size = "4"
cheat17_rumble_port = "0"
cheat17_rumble_primary_duration = "0"
cheat17_rumble_primary_strength = "0"
cheat17_rumble_secondary_duration = "0"
cheat17_rumble_secondary_strength = "0"
cheat17_rumble_type = "0"
cheat17_rumble_value = "0"
cheat17_value = "1"
cheat17_repeat_count = "1"
cheat17_repeat_add_to_value = "0"
cheat17_repeat_add_to_address = "0"
cheat18_address = "1392184"
cheat18_address_bit_position = "0"
cheat18_big_endian = "false"
cheat18_cheat_type = "1"
cheat18_code = ""
cheat18_desc = "P1 Only One Shot Recorded Codes-5th Hole"
cheat18_enable = "false"
cheat18_handler = "1"
cheat18_memory_search_size = "4"
cheat18_rumble_port = "0"
cheat18_rumble_primary_duration = "0"
cheat18_rumble_primary_strength = "0"
cheat18_rumble_secondary_duration = "0"
cheat18_rumble_secondary_strength = "0"
cheat18_rumble_type = "0"
cheat18_rumble_value = "0"
cheat18_value = "1"
cheat18_repeat_count = "1"
cheat18_repeat_add_to_value = "0"
cheat18_repeat_add_to_address = "0"
cheat19_address = "1392188"
cheat19_address_bit_position = "0"
cheat19_big_endian = "false"
cheat19_cheat_type = "1"
cheat19_code = ""
cheat19_desc = "P1 Only One Shot Recorded Codes-6th Hole"
cheat19_enable = "false"
cheat19_handler = "1"
cheat19_memory_search_size = "4"
cheat19_rumble_port = "0"
cheat19_rumble_primary_duration = "0"
cheat19_rumble_primary_strength = "0"
cheat19_rumble_secondary_duration = "0"
cheat19_rumble_secondary_strength = "0"
cheat19_rumble_type = "0"
cheat19_rumble_value = "0"
cheat19_value = "1"
cheat19_repeat_count = "1"
cheat19_repeat_add_to_value = "0"
cheat19_repeat_add_to_address = "0"
cheat20_address = "1392192"
cheat20_address_bit_position = "0"
cheat20_big_endian = "false"
cheat20_cheat_type = "1"
cheat20_code = ""
cheat20_desc = "P1 Only One Shot Recorded Codes-7th Hole"
cheat20_enable = "false"
cheat20_handler = "1"
cheat20_memory_search_size = "4"
cheat20_rumble_port = "0"
cheat20_rumble_primary_duration = "0"
cheat20_rumble_primary_strength = "0"
cheat20_rumble_secondary_duration = "0"
cheat20_rumble_secondary_strength = "0"
cheat20_rumble_type = "0"
cheat20_rumble_value = "0"
cheat20_value = "1"
cheat20_repeat_count = "1"
cheat20_repeat_add_to_value = "0"
cheat20_repeat_add_to_address = "0"
cheat21_address = "1392196"
cheat21_address_bit_position = "0"
cheat21_big_endian = "false"
cheat21_cheat_type = "1"
cheat21_code = ""
cheat21_desc = "P1 Only One Shot Recorded Codes-8th Hole"
cheat21_enable = "false"
cheat21_handler = "1"
cheat21_memory_search_size = "4"
cheat21_rumble_port = "0"
cheat21_rumble_primary_duration = "0"
cheat21_rumble_primary_strength = "0"
cheat21_rumble_secondary_duration = "0"
cheat21_rumble_secondary_strength = "0"
cheat21_rumble_type = "0"
cheat21_rumble_value = "0"
cheat21_value = "1"
cheat21_repeat_count = "1"
cheat21_repeat_add_to_value = "0"
cheat21_repeat_add_to_address = "0"
cheat22_address = "1392200"
cheat22_address_bit_position = "0"
cheat22_big_endian = "false"
cheat22_cheat_type = "1"
cheat22_code = ""
cheat22_desc = "P1 Only One Shot Recorded Codes-9th Hole"
cheat22_enable = "false"
cheat22_handler = "1"
cheat22_memory_search_size = "4"
cheat22_rumble_port = "0"
cheat22_rumble_primary_duration = "0"
cheat22_rumble_primary_strength = "0"
cheat22_rumble_secondary_duration = "0"
cheat22_rumble_secondary_strength = "0"
cheat22_rumble_type = "0"
cheat22_rumble_value = "0"
cheat22_value = "1"
cheat22_repeat_count = "1"
cheat22_repeat_add_to_value = "0"
cheat22_repeat_add_to_address = "0"
cheat23_address = "1392204"
cheat23_address_bit_position = "0"
cheat23_big_endian = "false"
cheat23_cheat_type = "1"
cheat23_code = ""
cheat23_desc = "P1 Only One Shot Recorded Codes-10th Hole"
cheat23_enable = "false"
cheat23_handler = "1"
cheat23_memory_search_size = "4"
cheat23_rumble_port = "0"
cheat23_rumble_primary_duration = "0"
cheat23_rumble_primary_strength = "0"
cheat23_rumble_secondary_duration = "0"
cheat23_rumble_secondary_strength = "0"
cheat23_rumble_type = "0"
cheat23_rumble_value = "0"
cheat23_value = "1"
cheat23_repeat_count = "1"
cheat23_repeat_add_to_value = "0"
cheat23_repeat_add_to_address = "0"
cheat24_address = "1392208"
cheat24_address_bit_position = "0"
cheat24_big_endian = "false"
cheat24_cheat_type = "1"
cheat24_code = ""
cheat24_desc = "P1 Only One Shot Recorded Codes-11th Hole"
cheat24_enable = "false"
cheat24_handler = "1"
cheat24_memory_search_size = "4"
cheat24_rumble_port = "0"
cheat24_rumble_primary_duration = "0"
cheat24_rumble_primary_strength = "0"
cheat24_rumble_secondary_duration = "0"
cheat24_rumble_secondary_strength = "0"
cheat24_rumble_type = "0"
cheat24_rumble_value = "0"
cheat24_value = "1"
cheat24_repeat_count = "1"
cheat24_repeat_add_to_value = "0"
cheat24_repeat_add_to_address = "0"
cheat25_address = "1392212"
cheat25_address_bit_position = "0"
cheat25_big_endian = "false"
cheat25_cheat_type = "1"
cheat25_code = ""
cheat25_desc = "P1 Only One Shot Recorded Codes-12th Hole"
cheat25_enable = "false"
cheat25_handler = "1"
cheat25_memory_search_size = "4"
cheat25_rumble_port = "0"
cheat25_rumble_primary_duration = "0"
cheat25_rumble_primary_strength = "0"
cheat25_rumble_secondary_duration = "0"
cheat25_rumble_secondary_strength = "0"
cheat25_rumble_type = "0"
cheat25_rumble_value = "0"
cheat25_value = "1"
cheat25_repeat_count = "1"
cheat25_repeat_add_to_value = "0"
cheat25_repeat_add_to_address = "0"
cheat26_address = "1392216"
cheat26_address_bit_position = "0"
cheat26_big_endian = "false"
cheat26_cheat_type = "1"
cheat26_code = ""
cheat26_desc = "P1 Only One Shot Recorded Codes-13th Hole"
cheat26_enable = "false"
cheat26_handler = "1"
cheat26_memory_search_size = "4"
cheat26_rumble_port = "0"
cheat26_rumble_primary_duration = "0"
cheat26_rumble_primary_strength = "0"
cheat26_rumble_secondary_duration = "0"
cheat26_rumble_secondary_strength = "0"
cheat26_rumble_type = "0"
cheat26_rumble_value = "0"
cheat26_value = "1"
cheat26_repeat_count = "1"
cheat26_repeat_add_to_value = "0"
cheat26_repeat_add_to_address = "0"
cheat27_address = "1392220"
cheat27_address_bit_position = "0"
cheat27_big_endian = "false"
cheat27_cheat_type = "1"
cheat27_code = ""
cheat27_desc = "P1 Only One Shot Recorded Codes-14th Hole"
cheat27_enable = "false"
cheat27_handler = "1"
cheat27_memory_search_size = "4"
cheat27_rumble_port = "0"
cheat27_rumble_primary_duration = "0"
cheat27_rumble_primary_strength = "0"
cheat27_rumble_secondary_duration = "0"
cheat27_rumble_secondary_strength = "0"
cheat27_rumble_type = "0"
cheat27_rumble_value = "0"
cheat27_value = "1"
cheat27_repeat_count = "1"
cheat27_repeat_add_to_value = "0"
cheat27_repeat_add_to_address = "0"
cheat28_address = "1392224"
cheat28_address_bit_position = "0"
cheat28_big_endian = "false"
cheat28_cheat_type = "1"
cheat28_code = ""
cheat28_desc = "P1 Only One Shot Recorded Codes-15th Hole"
cheat28_enable = "false"
cheat28_handler = "1"
cheat28_memory_search_size = "4"
cheat28_rumble_port = "0"
cheat28_rumble_primary_duration = "0"
cheat28_rumble_primary_strength = "0"
cheat28_rumble_secondary_duration = "0"
cheat28_rumble_secondary_strength = "0"
cheat28_rumble_type = "0"
cheat28_rumble_value = "0"
cheat28_value = "1"
cheat28_repeat_count = "1"
cheat28_repeat_add_to_value = "0"
cheat28_repeat_add_to_address = "0"
cheat29_address = "1392228"
cheat29_address_bit_position = "0"
cheat29_big_endian = "false"
cheat29_cheat_type = "1"
cheat29_code = ""
cheat29_desc = "P1 Only One Shot Recorded Codes-16th Hole"
cheat29_enable = "false"
cheat29_handler = "1"
cheat29_memory_search_size = "4"
cheat29_rumble_port = "0"
cheat29_rumble_primary_duration = "0"
cheat29_rumble_primary_strength = "0"
cheat29_rumble_secondary_duration = "0"
cheat29_rumble_secondary_strength = "0"
cheat29_rumble_type = "0"
cheat29_rumble_value = "0"
cheat29_value = "1"
cheat29_repeat_count = "1"
cheat29_repeat_add_to_value = "0"
cheat29_repeat_add_to_address = "0"
cheat30_address = "1392232"
cheat30_address_bit_position = "0"
cheat30_big_endian = "false"
cheat30_cheat_type = "1"
cheat30_code = ""
cheat30_desc = "P1 Only One Shot Recorded Codes-17th Hole"
cheat30_enable = "false"
cheat30_handler = "1"
cheat30_memory_search_size = "4"
cheat30_rumble_port = "0"
cheat30_rumble_primary_duration = "0"
cheat30_rumble_primary_strength = "0"
cheat30_rumble_secondary_duration = "0"
cheat30_rumble_secondary_strength = "0"
cheat30_rumble_type = "0"
cheat30_rumble_value = "0"
cheat30_value = "1"
cheat30_repeat_count = "1"
cheat30_repeat_add_to_value = "0"
cheat30_repeat_add_to_address = "0"
cheat31_address = "1392236"
cheat31_address_bit_position = "0"
cheat31_big_endian = "false"
cheat31_cheat_type = "1"
cheat31_code = ""
cheat31_desc = "P1 Only One Shot Recorded Codes-18th Hole"
cheat31_enable = "false"
cheat31_handler = "1"
cheat31_memory_search_size = "4"
cheat31_rumble_port = "0"
cheat31_rumble_primary_duration = "0"
cheat31_rumble_primary_strength = "0"
cheat31_rumble_secondary_duration = "0"
cheat31_rumble_secondary_strength = "0"
cheat31_rumble_type = "0"
cheat31_rumble_value = "0"
cheat31_value = "1"
cheat31_repeat_count = "1"
cheat31_repeat_add_to_value = "0"
cheat31_repeat_add_to_address = "0"
cheat32_address = "1392424"
cheat32_address_bit_position = "0"
cheat32_big_endian = "false"
cheat32_cheat_type = "1"
cheat32_code = ""
cheat32_desc = "P2 Only One Shot Recorded Codes-1st Hole"
cheat32_enable = "false"
cheat32_handler = "1"
cheat32_memory_search_size = "4"
cheat32_rumble_port = "0"
cheat32_rumble_primary_duration = "0"
cheat32_rumble_primary_strength = "0"
cheat32_rumble_secondary_duration = "0"
cheat32_rumble_secondary_strength = "0"
cheat32_rumble_type = "0"
cheat32_rumble_value = "0"
cheat32_value = "1"
cheat32_repeat_count = "1"
cheat32_repeat_add_to_value = "0"
cheat32_repeat_add_to_address = "0"
cheat33_address = "1392428"
cheat33_address_bit_position = "0"
cheat33_big_endian = "false"
cheat33_cheat_type = "1"
cheat33_code = ""
cheat33_desc = "P2 Only One Shot Recorded Codes-2nd Hole"
cheat33_enable = "false"
cheat33_handler = "1"
cheat33_memory_search_size = "4"
cheat33_rumble_port = "0"
cheat33_rumble_primary_duration = "0"
cheat33_rumble_primary_strength = "0"
cheat33_rumble_secondary_duration = "0"
cheat33_rumble_secondary_strength = "0"
cheat33_rumble_type = "0"
cheat33_rumble_value = "0"
cheat33_value = "1"
cheat33_repeat_count = "1"
cheat33_repeat_add_to_value = "0"
cheat33_repeat_add_to_address = "0"
cheat34_address = "1392432"
cheat34_address_bit_position = "0"
cheat34_big_endian = "false"
cheat34_cheat_type = "1"
cheat34_code = ""
cheat34_desc = "P2 Only One Shot Recorded Codes-3rd Hole"
cheat34_enable = "false"
cheat34_handler = "1"
cheat34_memory_search_size = "4"
cheat34_rumble_port = "0"
cheat34_rumble_primary_duration = "0"
cheat34_rumble_primary_strength = "0"
cheat34_rumble_secondary_duration = "0"
cheat34_rumble_secondary_strength = "0"
cheat34_rumble_type = "0"
cheat34_rumble_value = "0"
cheat34_value = "1"
cheat34_repeat_count = "1"
cheat34_repeat_add_to_value = "0"
cheat34_repeat_add_to_address = "0"
cheat35_address = "1392436"
cheat35_address_bit_position = "0"
cheat35_big_endian = "false"
cheat35_cheat_type = "1"
cheat35_code = ""
cheat35_desc = "P2 Only One Shot Recorded Codes-4th Hole"
cheat35_enable = "false"
cheat35_handler = "1"
cheat35_memory_search_size = "4"
cheat35_rumble_port = "0"
cheat35_rumble_primary_duration = "0"
cheat35_rumble_primary_strength = "0"
cheat35_rumble_secondary_duration = "0"
cheat35_rumble_secondary_strength = "0"
cheat35_rumble_type = "0"
cheat35_rumble_value = "0"
cheat35_value = "1"
cheat35_repeat_count = "1"
cheat35_repeat_add_to_value = "0"
cheat35_repeat_add_to_address = "0"
cheat36_address = "1392440"
cheat36_address_bit_position = "0"
cheat36_big_endian = "false"
cheat36_cheat_type = "1"
cheat36_code = ""
cheat36_desc = "P2 Only One Shot Recorded Codes-5th Hole"
cheat36_enable = "false"
cheat36_handler = "1"
cheat36_memory_search_size = "4"
cheat36_rumble_port = "0"
cheat36_rumble_primary_duration = "0"
cheat36_rumble_primary_strength = "0"
cheat36_rumble_secondary_duration = "0"
cheat36_rumble_secondary_strength = "0"
cheat36_rumble_type = "0"
cheat36_rumble_value = "0"
cheat36_value = "1"
cheat36_repeat_count = "1"
cheat36_repeat_add_to_value = "0"
cheat36_repeat_add_to_address = "0"
cheat37_address = "1392444"
cheat37_address_bit_position = "0"
cheat37_big_endian = "false"
cheat37_cheat_type = "1"
cheat37_code = ""
cheat37_desc = "P2 Only One Shot Recorded Codes-6th Hole"
cheat37_enable = "false"
cheat37_handler = "1"
cheat37_memory_search_size = "4"
cheat37_rumble_port = "0"
cheat37_rumble_primary_duration = "0"
cheat37_rumble_primary_strength = "0"
cheat37_rumble_secondary_duration = "0"
cheat37_rumble_secondary_strength = "0"
cheat37_rumble_type = "0"
cheat37_rumble_value = "0"
cheat37_value = "1"
cheat37_repeat_count = "1"
cheat37_repeat_add_to_value = "0"
cheat37_repeat_add_to_address = "0"
cheat38_address = "1392448"
cheat38_address_bit_position = "0"
cheat38_big_endian = "false"
cheat38_cheat_type = "1"
cheat38_code = ""
cheat38_desc = "P2 Only One Shot Recorded Codes-7th Hole"
cheat38_enable = "false"
cheat38_handler = "1"
cheat38_memory_search_size = "4"
cheat38_rumble_port = "0"
cheat38_rumble_primary_duration = "0"
cheat38_rumble_primary_strength = "0"
cheat38_rumble_secondary_duration = "0"
cheat38_rumble_secondary_strength = "0"
cheat38_rumble_type = "0"
cheat38_rumble_value = "0"
cheat38_value = "1"
cheat38_repeat_count = "1"
cheat38_repeat_add_to_value = "0"
cheat38_repeat_add_to_address = "0"
cheat39_address = "1392452"
cheat39_address_bit_position = "0"
cheat39_big_endian = "false"
cheat39_cheat_type = "1"
cheat39_code = ""
cheat39_desc = "P2 Only One Shot Recorded Codes-8th Hole"
cheat39_enable = "false"
cheat39_handler = "1"
cheat39_memory_search_size = "4"
cheat39_rumble_port = "0"
cheat39_rumble_primary_duration = "0"
cheat39_rumble_primary_strength = "0"
cheat39_rumble_secondary_duration = "0"
cheat39_rumble_secondary_strength = "0"
cheat39_rumble_type = "0"
cheat39_rumble_value = "0"
cheat39_value = "1"
cheat39_repeat_count = "1"
cheat39_repeat_add_to_value = "0"
cheat39_repeat_add_to_address = "0"
cheat40_address = "1392456"
cheat40_address_bit_position = "0"
cheat40_big_endian = "false"
cheat40_cheat_type = "1"
cheat40_code = ""
cheat40_desc = "P2 Only One Shot Recorded Codes-9th Hole"
cheat40_enable = "false"
cheat40_handler = "1"
cheat40_memory_search_size = "4"
cheat40_rumble_port = "0"
cheat40_rumble_primary_duration = "0"
cheat40_rumble_primary_strength = "0"
cheat40_rumble_secondary_duration = "0"
cheat40_rumble_secondary_strength = "0"
cheat40_rumble_type = "0"
cheat40_rumble_value = "0"
cheat40_value = "1"
cheat40_repeat_count = "1"
cheat40_repeat_add_to_value = "0"
cheat40_repeat_add_to_address = "0"
cheat41_address = "1392460"
cheat41_address_bit_position = "0"
cheat41_big_endian = "false"
cheat41_cheat_type = "1"
cheat41_code = ""
cheat41_desc = "P2 Only One Shot Recorded Codes-10th Hole"
cheat41_enable = "false"
cheat41_handler = "1"
cheat41_memory_search_size = "4"
cheat41_rumble_port = "0"
cheat41_rumble_primary_duration = "0"
cheat41_rumble_primary_strength = "0"
cheat41_rumble_secondary_duration = "0"
cheat41_rumble_secondary_strength = "0"
cheat41_rumble_type = "0"
cheat41_rumble_value = "0"
cheat41_value = "1"
cheat41_repeat_count = "1"
cheat41_repeat_add_to_value = "0"
cheat41_repeat_add_to_address = "0"
cheat42_address = "1392464"
cheat42_address_bit_position = "0"
cheat42_big_endian = "false"
cheat42_cheat_type = "1"
cheat42_code = ""
cheat42_desc = "P2 Only One Shot Recorded Codes-11th Hole"
cheat42_enable = "false"
cheat42_handler = "1"
cheat42_memory_search_size = "4"
cheat42_rumble_port = "0"
cheat42_rumble_primary_duration = "0"
cheat42_rumble_primary_strength = "0"
cheat42_rumble_secondary_duration = "0"
cheat42_rumble_secondary_strength = "0"
cheat42_rumble_type = "0"
cheat42_rumble_value = "0"
cheat42_value = "1"
cheat42_repeat_count = "1"
cheat42_repeat_add_to_value = "0"
cheat42_repeat_add_to_address = "0"
cheat43_address = "1392468"
cheat43_address_bit_position = "0"
cheat43_big_endian = "false"
cheat43_cheat_type = "1"
cheat43_code = ""
cheat43_desc = "P2 Only One Shot Recorded Codes-12th Hole"
cheat43_enable = "false"
cheat43_handler = "1"
cheat43_memory_search_size = "4"
cheat43_rumble_port = "0"
cheat43_rumble_primary_duration = "0"
cheat43_rumble_primary_strength = "0"
cheat43_rumble_secondary_duration = "0"
cheat43_rumble_secondary_strength = "0"
cheat43_rumble_type = "0"
cheat43_rumble_value = "0"
cheat43_value = "1"
cheat43_repeat_count = "1"
cheat43_repeat_add_to_value = "0"
cheat43_repeat_add_to_address = "0"
cheat44_address = "1392472"
cheat44_address_bit_position = "0"
cheat44_big_endian = "false"
cheat44_cheat_type = "1"
cheat44_code = ""
cheat44_desc = "P2 Only One Shot Recorded Codes-13th Hole"
cheat44_enable = "false"
cheat44_handler = "1"
cheat44_memory_search_size = "4"
cheat44_rumble_port = "0"
cheat44_rumble_primary_duration = "0"
cheat44_rumble_primary_strength = "0"
cheat44_rumble_secondary_duration = "0"
cheat44_rumble_secondary_strength = "0"
cheat44_rumble_type = "0"
cheat44_rumble_value = "0"
cheat44_value = "1"
cheat44_repeat_count = "1"
cheat44_repeat_add_to_value = "0"
cheat44_repeat_add_to_address = "0"
cheat45_address = "1392476"
cheat45_address_bit_position = "0"
cheat45_big_endian = "false"
cheat45_cheat_type = "1"
cheat45_code = ""
cheat45_desc = "P2 Only One Shot Recorded Codes-14th Hole"
cheat45_enable = "false"
cheat45_handler = "1"
cheat45_memory_search_size = "4"
cheat45_rumble_port = "0"
cheat45_rumble_primary_duration = "0"
cheat45_rumble_primary_strength = "0"
cheat45_rumble_secondary_duration = "0"
cheat45_rumble_secondary_strength = "0"
cheat45_rumble_type = "0"
cheat45_rumble_value = "0"
cheat45_value = "1"
cheat45_repeat_count = "1"
cheat45_repeat_add_to_value = "0"
cheat45_repeat_add_to_address = "0"
cheat46_address = "1392480"
cheat46_address_bit_position = "0"
cheat46_big_endian = "false"
cheat46_cheat_type = "1"
cheat46_code = ""
cheat46_desc = "P2 Only One Shot Recorded Codes-15th Hole"
cheat46_enable = "false"
cheat46_handler = "1"
cheat46_memory_search_size = "4"
cheat46_rumble_port = "0"
cheat46_rumble_primary_duration = "0"
cheat46_rumble_primary_strength = "0"
cheat46_rumble_secondary_duration = "0"
cheat46_rumble_secondary_strength = "0"
cheat46_rumble_type = "0"
cheat46_rumble_value = "0"
cheat46_value = "1"
cheat46_repeat_count = "1"
cheat46_repeat_add_to_value = "0"
cheat46_repeat_add_to_address = "0"
cheat47_address = "1392484"
cheat47_address_bit_position = "0"
cheat47_big_endian = "false"
cheat47_cheat_type = "1"
cheat47_code = ""
cheat47_desc = "P2 Only One Shot Recorded Codes-16th Hole"
cheat47_enable = "false"
cheat47_handler = "1"
cheat47_memory_search_size = "4"
cheat47_rumble_port = "0"
cheat47_rumble_primary_duration = "0"
cheat47_rumble_primary_strength = "0"
cheat47_rumble_secondary_duration = "0"
cheat47_rumble_secondary_strength = "0"
cheat47_rumble_type = "0"
cheat47_rumble_value = "0"
cheat47_value = "1"
cheat47_repeat_count = "1"
cheat47_repeat_add_to_value = "0"
cheat47_repeat_add_to_address = "0"
cheat48_address = "1392488"
cheat48_address_bit_position = "0"
cheat48_big_endian = "false"
cheat48_cheat_type = "1"
cheat48_code = ""
cheat48_desc = "P2 Only One Shot Recorded Codes-17th Hole"
cheat48_enable = "false"
cheat48_handler = "1"
cheat48_memory_search_size = "4"
cheat48_rumble_port = "0"
cheat48_rumble_primary_duration = "0"
cheat48_rumble_primary_strength = "0"
cheat48_rumble_secondary_duration = "0"
cheat48_rumble_secondary_strength = "0"
cheat48_rumble_type = "0"
cheat48_rumble_value = "0"
cheat48_value = "1"
cheat48_repeat_count = "1"
cheat48_repeat_add_to_value = "0"
cheat48_repeat_add_to_address = "0"
cheat49_address = "1392492"
cheat49_address_bit_position = "0"
cheat49_big_endian = "false"
cheat49_cheat_type = "1"
cheat49_code = ""
cheat49_desc = "P2 Only One Shot Recorded Codes-18th Hole"
cheat49_enable = "false"
cheat49_handler = "1"
cheat49_memory_search_size = "4"
cheat49_rumble_port = "0"
cheat49_rumble_primary_duration = "0"
cheat49_rumble_primary_strength = "0"
cheat49_rumble_secondary_duration = "0"
cheat49_rumble_secondary_strength = "0"
cheat49_rumble_type = "0"
cheat49_rumble_value = "0"
cheat49_value = "1"
cheat49_repeat_count = "1"
cheat49_repeat_add_to_value = "0"
cheat49_repeat_add_to_address = "0"
cheat50_address = "1392680"
cheat50_address_bit_position = "0"
cheat50_big_endian = "false"
cheat50_cheat_type = "1"
cheat50_code = ""
cheat50_desc = "P3 Only One Shot Recorded Codes-1st Hole"
cheat50_enable = "false"
cheat50_handler = "1"
cheat50_memory_search_size = "4"
cheat50_rumble_port = "0"
cheat50_rumble_primary_duration = "0"
cheat50_rumble_primary_strength = "0"
cheat50_rumble_secondary_duration = "0"
cheat50_rumble_secondary_strength = "0"
cheat50_rumble_type = "0"
cheat50_rumble_value = "0"
cheat50_value = "1"
cheat50_repeat_count = "1"
cheat50_repeat_add_to_value = "0"
cheat50_repeat_add_to_address = "0"
cheat51_address = "1392684"
cheat51_address_bit_position = "0"
cheat51_big_endian = "false"
cheat51_cheat_type = "1"
cheat51_code = ""
cheat51_desc = "P3 Only One Shot Recorded Codes-2nd Hole"
cheat51_enable = "false"
cheat51_handler = "1"
cheat51_memory_search_size = "4"
cheat51_rumble_port = "0"
cheat51_rumble_primary_duration = "0"
cheat51_rumble_primary_strength = "0"
cheat51_rumble_secondary_duration = "0"
cheat51_rumble_secondary_strength = "0"
cheat51_rumble_type = "0"
cheat51_rumble_value = "0"
cheat51_value = "1"
cheat51_repeat_count = "1"
cheat51_repeat_add_to_value = "0"
cheat51_repeat_add_to_address = "0"
cheat52_address = "1392688"
cheat52_address_bit_position = "0"
cheat52_big_endian = "false"
cheat52_cheat_type = "1"
cheat52_code = ""
cheat52_desc = "P3 Only One Shot Recorded Codes-3rd Hole"
cheat52_enable = "false"
cheat52_handler = "1"
cheat52_memory_search_size = "4"
cheat52_rumble_port = "0"
cheat52_rumble_primary_duration = "0"
cheat52_rumble_primary_strength = "0"
cheat52_rumble_secondary_duration = "0"
cheat52_rumble_secondary_strength = "0"
cheat52_rumble_type = "0"
cheat52_rumble_value = "0"
cheat52_value = "1"
cheat52_repeat_count = "1"
cheat52_repeat_add_to_value = "0"
cheat52_repeat_add_to_address = "0"
cheat53_address = "1392692"
cheat53_address_bit_position = "0"
cheat53_big_endian = "false"
cheat53_cheat_type = "1"
cheat53_code = ""
cheat53_desc = "P3 Only One Shot Recorded Codes-4th Hole"
cheat53_enable = "false"
cheat53_handler = "1"
cheat53_memory_search_size = "4"
cheat53_rumble_port = "0"
cheat53_rumble_primary_duration = "0"
cheat53_rumble_primary_strength = "0"
cheat53_rumble_secondary_duration = "0"
cheat53_rumble_secondary_strength = "0"
cheat53_rumble_type = "0"
cheat53_rumble_value = "0"
cheat53_value = "1"
cheat53_repeat_count = "1"
cheat53_repeat_add_to_value = "0"
cheat53_repeat_add_to_address = "0"
cheat54_address = "1392696"
cheat54_address_bit_position = "0"
cheat54_big_endian = "false"
cheat54_cheat_type = "1"
cheat54_code = ""
cheat54_desc = "P3 Only One Shot Recorded Codes-5th Hole"
cheat54_enable = "false"
cheat54_handler = "1"
cheat54_memory_search_size = "4"
cheat54_rumble_port = "0"
cheat54_rumble_primary_duration = "0"
cheat54_rumble_primary_strength = "0"
cheat54_rumble_secondary_duration = "0"
cheat54_rumble_secondary_strength = "0"
cheat54_rumble_type = "0"
cheat54_rumble_value = "0"
cheat54_value = "1"
cheat54_repeat_count = "1"
cheat54_repeat_add_to_value = "0"
cheat54_repeat_add_to_address = "0"
cheat55_address = "1392700"
cheat55_address_bit_position = "0"
cheat55_big_endian = "false"
cheat55_cheat_type = "1"
cheat55_code = ""
cheat55_desc = "P3 Only One Shot Recorded Codes-6th Hole"
cheat55_enable = "false"
cheat55_handler = "1"
cheat55_memory_search_size = "4"
cheat55_rumble_port = "0"
cheat55_rumble_primary_duration = "0"
cheat55_rumble_primary_strength = "0"
cheat55_rumble_secondary_duration = "0"
cheat55_rumble_secondary_strength = "0"
cheat55_rumble_type = "0"
cheat55_rumble_value = "0"
cheat55_value = "1"
cheat55_repeat_count = "1"
cheat55_repeat_add_to_value = "0"
cheat55_repeat_add_to_address = "0"
cheat56_address = "1392704"
cheat56_address_bit_position = "0"
cheat56_big_endian = "false"
cheat56_cheat_type = "1"
cheat56_code = ""
cheat56_desc = "P3 Only One Shot Recorded Codes-7th Hole"
cheat56_enable = "false"
cheat56_handler = "1"
cheat56_memory_search_size = "4"
cheat56_rumble_port = "0"
cheat56_rumble_primary_duration = "0"
cheat56_rumble_primary_strength = "0"
cheat56_rumble_secondary_duration = "0"
cheat56_rumble_secondary_strength = "0"
cheat56_rumble_type = "0"
cheat56_rumble_value = "0"
cheat56_value = "1"
cheat56_repeat_count = "1"
cheat56_repeat_add_to_value = "0"
cheat56_repeat_add_to_address = "0"
cheat57_address = "1392708"
cheat57_address_bit_position = "0"
cheat57_big_endian = "false"
cheat57_cheat_type = "1"
cheat57_code = ""
cheat57_desc = "P3 Only One Shot Recorded Codes-8th Hole"
cheat57_enable = "false"
cheat57_handler = "1"
cheat57_memory_search_size = "4"
cheat57_rumble_port = "0"
cheat57_rumble_primary_duration = "0"
cheat57_rumble_primary_strength = "0"
cheat57_rumble_secondary_duration = "0"
cheat57_rumble_secondary_strength = "0"
cheat57_rumble_type = "0"
cheat57_rumble_value = "0"
cheat57_value = "1"
cheat57_repeat_count = "1"
cheat57_repeat_add_to_value = "0"
cheat57_repeat_add_to_address = "0"
cheat58_address = "1392712"
cheat58_address_bit_position = "0"
cheat58_big_endian = "false"
cheat58_cheat_type = "1"
cheat58_code = ""
cheat58_desc = "P3 Only One Shot Recorded Codes-9th Hole"
cheat58_enable = "false"
cheat58_handler = "1"
cheat58_memory_search_size = "4"
cheat58_rumble_port = "0"
cheat58_rumble_primary_duration = "0"
cheat58_rumble_primary_strength = "0"
cheat58_rumble_secondary_duration = "0"
cheat58_rumble_secondary_strength = "0"
cheat58_rumble_type = "0"
cheat58_rumble_value = "0"
cheat58_value = "1"
cheat58_repeat_count = "1"
cheat58_repeat_add_to_value = "0"
cheat58_repeat_add_to_address = "0"
cheat59_address = "1392716"
cheat59_address_bit_position = "0"
cheat59_big_endian = "false"
cheat59_cheat_type = "1"
cheat59_code = ""
cheat59_desc = "P3 Only One Shot Recorded Codes-10th Hole"
cheat59_enable = "false"
cheat59_handler = "1"
cheat59_memory_search_size = "4"
cheat59_rumble_port = "0"
cheat59_rumble_primary_duration = "0"
cheat59_rumble_primary_strength = "0"
cheat59_rumble_secondary_duration = "0"
cheat59_rumble_secondary_strength = "0"
cheat59_rumble_type = "0"
cheat59_rumble_value = "0"
cheat59_value = "1"
cheat59_repeat_count = "1"
cheat59_repeat_add_to_value = "0"
cheat59_repeat_add_to_address = "0"
cheat60_address = "1392720"
cheat60_address_bit_position = "0"
cheat60_big_endian = "false"
cheat60_cheat_type = "1"
cheat60_code = ""
cheat60_desc = "P3 Only One Shot Recorded Codes-11th Hole"
cheat60_enable = "false"
cheat60_handler = "1"
cheat60_memory_search_size = "4"
cheat60_rumble_port = "0"
cheat60_rumble_primary_duration = "0"
cheat60_rumble_primary_strength = "0"
cheat60_rumble_secondary_duration = "0"
cheat60_rumble_secondary_strength = "0"
cheat60_rumble_type = "0"
cheat60_rumble_value = "0"
cheat60_value = "1"
cheat60_repeat_count = "1"
cheat60_repeat_add_to_value = "0"
cheat60_repeat_add_to_address = "0"
cheat61_address = "1392724"
cheat61_address_bit_position = "0"
cheat61_big_endian = "false"
cheat61_cheat_type = "1"
cheat61_code = ""
cheat61_desc = "P3 Only One Shot Recorded Codes-12th Hole"
cheat61_enable = "false"
cheat61_handler = "1"
cheat61_memory_search_size = "4"
cheat61_rumble_port = "0"
cheat61_rumble_primary_duration = "0"
cheat61_rumble_primary_strength = "0"
cheat61_rumble_secondary_duration = "0"
cheat61_rumble_secondary_strength = "0"
cheat61_rumble_type = "0"
cheat61_rumble_value = "0"
cheat61_value = "1"
cheat61_repeat_count = "1"
cheat61_repeat_add_to_value = "0"
cheat61_repeat_add_to_address = "0"
cheat62_address = "1392728"
cheat62_address_bit_position = "0"
cheat62_big_endian = "false"
cheat62_cheat_type = "1"
cheat62_code = ""
cheat62_desc = "P3 Only One Shot Recorded Codes-13th Hole"
cheat62_enable = "false"
cheat62_handler = "1"
cheat62_memory_search_size = "4"
cheat62_rumble_port = "0"
cheat62_rumble_primary_duration = "0"
cheat62_rumble_primary_strength = "0"
cheat62_rumble_secondary_duration = "0"
cheat62_rumble_secondary_strength = "0"
cheat62_rumble_type = "0"
cheat62_rumble_value = "0"
cheat62_value = "1"
cheat62_repeat_count = "1"
cheat62_repeat_add_to_value = "0"
cheat62_repeat_add_to_address = "0"
cheat63_address = "1392732"
cheat63_address_bit_position = "0"
cheat63_big_endian = "false"
cheat63_cheat_type = "1"
cheat63_code = ""
cheat63_desc = "P3 Only One Shot Recorded Codes-14th Hole"
cheat63_enable = "false"
cheat63_handler = "1"
cheat63_memory_search_size = "4"
cheat63_rumble_port = "0"
cheat63_rumble_primary_duration = "0"
cheat63_rumble_primary_strength = "0"
cheat63_rumble_secondary_duration = "0"
cheat63_rumble_secondary_strength = "0"
cheat63_rumble_type = "0"
cheat63_rumble_value = "0"
cheat63_value = "1"
cheat63_repeat_count = "1"
cheat63_repeat_add_to_value = "0"
cheat63_repeat_add_to_address = "0"
cheat64_address = "1392736"
cheat64_address_bit_position = "0"
cheat64_big_endian = "false"
cheat64_cheat_type = "1"
cheat64_code = ""
cheat64_desc = "P3 Only One Shot Recorded Codes-15th Hole"
cheat64_enable = "false"
cheat64_handler = "1"
cheat64_memory_search_size = "4"
cheat64_rumble_port = "0"
cheat64_rumble_primary_duration = "0"
cheat64_rumble_primary_strength = "0"
cheat64_rumble_secondary_duration = "0"
cheat64_rumble_secondary_strength = "0"
cheat64_rumble_type = "0"
cheat64_rumble_value = "0"
cheat64_value = "1"
cheat64_repeat_count = "1"
cheat64_repeat_add_to_value = "0"
cheat64_repeat_add_to_address = "0"
cheat65_address = "1392740"
cheat65_address_bit_position = "0"
cheat65_big_endian = "false"
cheat65_cheat_type = "1"
cheat65_code = ""
cheat65_desc = "P3 Only One Shot Recorded Codes-16th Hole"
cheat65_enable = "false"
cheat65_handler = "1"
cheat65_memory_search_size = "4"
cheat65_rumble_port = "0"
cheat65_rumble_primary_duration = "0"
cheat65_rumble_primary_strength = "0"
cheat65_rumble_secondary_duration = "0"
cheat65_rumble_secondary_strength = "0"
cheat65_rumble_type = "0"
cheat65_rumble_value = "0"
cheat65_value = "1"
cheat65_repeat_count = "1"
cheat65_repeat_add_to_value = "0"
cheat65_repeat_add_to_address = "0"
cheat66_address = "1392744"
cheat66_address_bit_position = "0"
cheat66_big_endian = "false"
cheat66_cheat_type = "1"
cheat66_code = ""
cheat66_desc = "P3 Only One Shot Recorded Codes-17th Hole"
cheat66_enable = "false"
cheat66_handler = "1"
cheat66_memory_search_size = "4"
cheat66_rumble_port = "0"
cheat66_rumble_primary_duration = "0"
cheat66_rumble_primary_strength = "0"
cheat66_rumble_secondary_duration = "0"
cheat66_rumble_secondary_strength = "0"
cheat66_rumble_type = "0"
cheat66_rumble_value = "0"
cheat66_value = "1"
cheat66_repeat_count = "1"
cheat66_repeat_add_to_value = "0"
cheat66_repeat_add_to_address = "0"
cheat67_address = "1392748"
cheat67_address_bit_position = "0"
cheat67_big_endian = "false"
cheat67_cheat_type = "1"
cheat67_code = ""
cheat67_desc = "P3 Only One Shot Recorded Codes-18th Hole"
cheat67_enable = "false"
cheat67_handler = "1"
cheat67_memory_search_size = "4"
cheat67_rumble_port = "0"
cheat67_rumble_primary_duration = "0"
cheat67_rumble_primary_strength = "0"
cheat67_rumble_secondary_duration = "0"
cheat67_rumble_secondary_strength = "0"
cheat67_rumble_type = "0"
cheat67_rumble_value = "0"
cheat67_value = "1"
cheat67_repeat_count = "1"
cheat67_repeat_add_to_value = "0"
cheat67_repeat_add_to_address = "0"
cheat68_address = "1392936"
cheat68_address_bit_position = "0"
cheat68_big_endian = "false"
cheat68_cheat_type = "1"
cheat68_code = ""
cheat68_desc = "P4 Only One Shot Recorded Codes-1st Hole"
cheat68_enable = "false"
cheat68_handler = "1"
cheat68_memory_search_size = "4"
cheat68_rumble_port = "0"
cheat68_rumble_primary_duration = "0"
cheat68_rumble_primary_strength = "0"
cheat68_rumble_secondary_duration = "0"
cheat68_rumble_secondary_strength = "0"
cheat68_rumble_type = "0"
cheat68_rumble_value = "0"
cheat68_value = "1"
cheat68_repeat_count = "1"
cheat68_repeat_add_to_value = "0"
cheat68_repeat_add_to_address = "0"
cheat69_address = "1392940"
cheat69_address_bit_position = "0"
cheat69_big_endian = "false"
cheat69_cheat_type = "1"
cheat69_code = ""
cheat69_desc = "P4 Only One Shot Recorded Codes-2nd Hole"
cheat69_enable = "false"
cheat69_handler = "1"
cheat69_memory_search_size = "4"
cheat69_rumble_port = "0"
cheat69_rumble_primary_duration = "0"
cheat69_rumble_primary_strength = "0"
cheat69_rumble_secondary_duration = "0"
cheat69_rumble_secondary_strength = "0"
cheat69_rumble_type = "0"
cheat69_rumble_value = "0"
cheat69_value = "1"
cheat69_repeat_count = "1"
cheat69_repeat_add_to_value = "0"
cheat69_repeat_add_to_address = "0"
cheat70_address = "1392944"
cheat70_address_bit_position = "0"
cheat70_big_endian = "false"
cheat70_cheat_type = "1"
cheat70_code = ""
cheat70_desc = "P4 Only One Shot Recorded Codes-3rd Hole"
cheat70_enable = "false"
cheat70_handler = "1"
cheat70_memory_search_size = "4"
cheat70_rumble_port = "0"
cheat70_rumble_primary_duration = "0"
cheat70_rumble_primary_strength = "0"
cheat70_rumble_secondary_duration = "0"
cheat70_rumble_secondary_strength = "0"
cheat70_rumble_type = "0"
cheat70_rumble_value = "0"
cheat70_value = "1"
cheat70_repeat_count = "1"
cheat70_repeat_add_to_value = "0"
cheat70_repeat_add_to_address = "0"
cheat71_address = "1392948"
cheat71_address_bit_position = "0"
cheat71_big_endian = "false"
cheat71_cheat_type = "1"
cheat71_code = ""
cheat71_desc = "P4 Only One Shot Recorded Codes-4th Hole"
cheat71_enable = "false"
cheat71_handler = "1"
cheat71_memory_search_size = "4"
cheat71_rumble_port = "0"
cheat71_rumble_primary_duration = "0"
cheat71_rumble_primary_strength = "0"
cheat71_rumble_secondary_duration = "0"
cheat71_rumble_secondary_strength = "0"
cheat71_rumble_type = "0"
cheat71_rumble_value = "0"
cheat71_value = "1"
cheat71_repeat_count = "1"
cheat71_repeat_add_to_value = "0"
cheat71_repeat_add_to_address = "0"
cheat72_address = "1392952"
cheat72_address_bit_position = "0"
cheat72_big_endian = "false"
cheat72_cheat_type = "1"
cheat72_code = ""
cheat72_desc = "P4 Only One Shot Recorded Codes-5th Hole"
cheat72_enable = "false"
cheat72_handler = "1"
cheat72_memory_search_size = "4"
cheat72_rumble_port = "0"
cheat72_rumble_primary_duration = "0"
cheat72_rumble_primary_strength = "0"
cheat72_rumble_secondary_duration = "0"
cheat72_rumble_secondary_strength = "0"
cheat72_rumble_type = "0"
cheat72_rumble_value = "0"
cheat72_value = "1"
cheat72_repeat_count = "1"
cheat72_repeat_add_to_value = "0"
cheat72_repeat_add_to_address = "0"
cheat73_address = "1392956"
cheat73_address_bit_position = "0"
cheat73_big_endian = "false"
cheat73_cheat_type = "1"
cheat73_code = ""
cheat73_desc = "P4 Only One Shot Recorded Codes-6th Hole"
cheat73_enable = "false"
cheat73_handler = "1"
cheat73_memory_search_size = "4"
cheat73_rumble_port = "0"
cheat73_rumble_primary_duration = "0"
cheat73_rumble_primary_strength = "0"
cheat73_rumble_secondary_duration = "0"
cheat73_rumble_secondary_strength = "0"
cheat73_rumble_type = "0"
cheat73_rumble_value = "0"
cheat73_value = "1"
cheat73_repeat_count = "1"
cheat73_repeat_add_to_value = "0"
cheat73_repeat_add_to_address = "0"
cheat74_address = "1392960"
cheat74_address_bit_position = "0"
cheat74_big_endian = "false"
cheat74_cheat_type = "1"
cheat74_code = ""
cheat74_desc = "P4 Only One Shot Recorded Codes-7th Hole"
cheat74_enable = "false"
cheat74_handler = "1"
cheat74_memory_search_size = "4"
cheat74_rumble_port = "0"
cheat74_rumble_primary_duration = "0"
cheat74_rumble_primary_strength = "0"
cheat74_rumble_secondary_duration = "0"
cheat74_rumble_secondary_strength = "0"
cheat74_rumble_type = "0"
cheat74_rumble_value = "0"
cheat74_value = "1"
cheat74_repeat_count = "1"
cheat74_repeat_add_to_value = "0"
cheat74_repeat_add_to_address = "0"
cheat75_address = "1392964"
cheat75_address_bit_position = "0"
cheat75_big_endian = "false"
cheat75_cheat_type = "1"
cheat75_code = ""
cheat75_desc = "P4 Only One Shot Recorded Codes-8th Hole"
cheat75_enable = "false"
cheat75_handler = "1"
cheat75_memory_search_size = "4"
cheat75_rumble_port = "0"
cheat75_rumble_primary_duration = "0"
cheat75_rumble_primary_strength = "0"
cheat75_rumble_secondary_duration = "0"
cheat75_rumble_secondary_strength = "0"
cheat75_rumble_type = "0"
cheat75_rumble_value = "0"
cheat75_value = "1"
cheat75_repeat_count = "1"
cheat75_repeat_add_to_value = "0"
cheat75_repeat_add_to_address = "0"
cheat76_address = "1392968"
cheat76_address_bit_position = "0"
cheat76_big_endian = "false"
cheat76_cheat_type = "1"
cheat76_code = ""
cheat76_desc = "P4 Only One Shot Recorded Codes-9th Hole"
cheat76_enable = "false"
cheat76_handler = "1"
cheat76_memory_search_size = "4"
cheat76_rumble_port = "0"
cheat76_rumble_primary_duration = "0"
cheat76_rumble_primary_strength = "0"
cheat76_rumble_secondary_duration = "0"
cheat76_rumble_secondary_strength = "0"
cheat76_rumble_type = "0"
cheat76_rumble_value = "0"
cheat76_value = "1"
cheat76_repeat_count = "1"
cheat76_repeat_add_to_value = "0"
cheat76_repeat_add_to_address = "0"
cheat77_address = "1392972"
cheat77_address_bit_position = "0"
cheat77_big_endian = "false"
cheat77_cheat_type = "1"
cheat77_code = ""
cheat77_desc = "P4 Only One Shot Recorded Codes-10th Hole"
cheat77_enable = "false"
cheat77_handler = "1"
cheat77_memory_search_size = "4"
cheat77_rumble_port = "0"
cheat77_rumble_primary_duration = "0"
cheat77_rumble_primary_strength = "0"
cheat77_rumble_secondary_duration = "0"
cheat77_rumble_secondary_strength = "0"
cheat77_rumble_type = "0"
cheat77_rumble_value = "0"
cheat77_value = "1"
cheat77_repeat_count = "1"
cheat77_repeat_add_to_value = "0"
cheat77_repeat_add_to_address = "0"
cheat78_address = "1392976"
cheat78_address_bit_position = "0"
cheat78_big_endian = "false"
cheat78_cheat_type = "1"
cheat78_code = ""
cheat78_desc = "P4 Only One Shot Recorded Codes-11th Hole"
cheat78_enable = "false"
cheat78_handler = "1"
cheat78_memory_search_size = "4"
cheat78_rumble_port = "0"
cheat78_rumble_primary_duration = "0"
cheat78_rumble_primary_strength = "0"
cheat78_rumble_secondary_duration = "0"
cheat78_rumble_secondary_strength = "0"
cheat78_rumble_type = "0"
cheat78_rumble_value = "0"
cheat78_value = "1"
cheat78_repeat_count = "1"
cheat78_repeat_add_to_value = "0"
cheat78_repeat_add_to_address = "0"
cheat79_address = "1392980"
cheat79_address_bit_position = "0"
cheat79_big_endian = "false"
cheat79_cheat_type = "1"
cheat79_code = ""
cheat79_desc = "P4 Only One Shot Recorded Codes-12th Hole"
cheat79_enable = "false"
cheat79_handler = "1"
cheat79_memory_search_size = "4"
cheat79_rumble_port = "0"
cheat79_rumble_primary_duration = "0"
cheat79_rumble_primary_strength = "0"
cheat79_rumble_secondary_duration = "0"
cheat79_rumble_secondary_strength = "0"
cheat79_rumble_type = "0"
cheat79_rumble_value = "0"
cheat79_value = "1"
cheat79_repeat_count = "1"
cheat79_repeat_add_to_value = "0"
cheat79_repeat_add_to_address = "0"
cheat80_address = "1392984"
cheat80_address_bit_position = "0"
cheat80_big_endian = "false"
cheat80_cheat_type = "1"
cheat80_code = ""
cheat80_desc = "P4 Only One Shot Recorded Codes-13th Hole"
cheat80_enable = "false"
cheat80_handler = "1"
cheat80_memory_search_size = "4"
cheat80_rumble_port = "0"
cheat80_rumble_primary_duration = "0"
cheat80_rumble_primary_strength = "0"
cheat80_rumble_secondary_duration = "0"
cheat80_rumble_secondary_strength = "0"
cheat80_rumble_type = "0"
cheat80_rumble_value = "0"
cheat80_value = "1"
cheat80_repeat_count = "1"
cheat80_repeat_add_to_value = "0"
cheat80_repeat_add_to_address = "0"
cheat81_address = "1392988"
cheat81_address_bit_position = "0"
cheat81_big_endian = "false"
cheat81_cheat_type = "1"
cheat81_code = ""
cheat81_desc = "P4 Only One Shot Recorded Codes-14th Hole"
cheat81_enable = "false"
cheat81_handler = "1"
cheat81_memory_search_size = "4"
cheat81_rumble_port = "0"
cheat81_rumble_primary_duration = "0"
cheat81_rumble_primary_strength = "0"
cheat81_rumble_secondary_duration = "0"
cheat81_rumble_secondary_strength = "0"
cheat81_rumble_type = "0"
cheat81_rumble_value = "0"
cheat81_value = "1"
cheat81_repeat_count = "1"
cheat81_repeat_add_to_value = "0"
cheat81_repeat_add_to_address = "0"
cheat82_address = "1392992"
cheat82_address_bit_position = "0"
cheat82_big_endian = "false"
cheat82_cheat_type = "1"
cheat82_code = ""
cheat82_desc = "P4 Only One Shot Recorded Codes-15th Hole"
cheat82_enable = "false"
cheat82_handler = "1"
cheat82_memory_search_size = "4"
cheat82_rumble_port = "0"
cheat82_rumble_primary_duration = "0"
cheat82_rumble_primary_strength = "0"
cheat82_rumble_secondary_duration = "0"
cheat82_rumble_secondary_strength = "0"
cheat82_rumble_type = "0"
cheat82_rumble_value = "0"
cheat82_value = "1"
cheat82_repeat_count = "1"
cheat82_repeat_add_to_value = "0"
cheat82_repeat_add_to_address = "0"
cheat83_address = "1392996"
cheat83_address_bit_position = "0"
cheat83_big_endian = "false"
cheat83_cheat_type = "1"
cheat83_code = ""
cheat83_desc = "P4 Only One Shot Recorded Codes-16th Hole"
cheat83_enable = "false"
cheat83_handler = "1"
cheat83_memory_search_size = "4"
cheat83_rumble_port = "0"
cheat83_rumble_primary_duration = "0"
cheat83_rumble_primary_strength = "0"
cheat83_rumble_secondary_duration = "0"
cheat83_rumble_secondary_strength = "0"
cheat83_rumble_type = "0"
cheat83_rumble_value = "0"
cheat83_value = "1"
cheat83_repeat_count = "1"
cheat83_repeat_add_to_value = "0"
cheat83_repeat_add_to_address = "0"
cheat84_address = "1393000"
cheat84_address_bit_position = "0"
cheat84_big_endian = "false"
cheat84_cheat_type = "1"
cheat84_code = ""
cheat84_desc = "P4 Only One Shot Recorded Codes-17th Hole"
cheat84_enable = "false"
cheat84_handler = "1"
cheat84_memory_search_size = "4"
cheat84_rumble_port = "0"
cheat84_rumble_primary_duration = "0"
cheat84_rumble_primary_strength = "0"
cheat84_rumble_secondary_duration = "0"
cheat84_rumble_secondary_strength = "0"
cheat84_rumble_type = "0"
cheat84_rumble_value = "0"
cheat84_value = "1"
cheat84_repeat_count = "1"
cheat84_repeat_add_to_value = "0"
cheat84_repeat_add_to_address = "0"
cheat85_address = "1393004"
cheat85_address_bit_position = "0"
cheat85_big_endian = "false"
cheat85_cheat_type = "1"
cheat85_code = ""
cheat85_desc = "P4 Only One Shot Recorded Codes-18th Hole"
cheat85_enable = "false"
cheat85_handler = "1"
cheat85_memory_search_size = "4"
cheat85_rumble_port = "0"
cheat85_rumble_primary_duration = "0"
cheat85_rumble_primary_strength = "0"
cheat85_rumble_secondary_duration = "0"
cheat85_rumble_secondary_strength = "0"
cheat85_rumble_type = "0"
cheat85_rumble_value = "0"
cheat85_value = "1"
cheat85_repeat_count = "1"
cheat85_repeat_add_to_value = "0"
cheat85_repeat_add_to_address = "0"
cheat86_address = "0"
cheat86_address_bit_position = "0"
cheat86_big_endian = "false"
cheat86_cheat_type = "1"
cheat86_code = ""
cheat86_desc = "Character Modifier Codes"
cheat86_enable = "false"
cheat86_handler = "1"
cheat86_memory_search_size = "4"
cheat86_rumble_port = "0"
cheat86_rumble_primary_duration = "0"
cheat86_rumble_primary_strength = "0"
cheat86_rumble_secondary_duration = "0"
cheat86_rumble_secondary_strength = "0"
cheat86_rumble_type = "0"
cheat86_rumble_value = "0"
cheat86_value = "0"
cheat86_repeat_count = "1"
cheat86_repeat_add_to_value = "0"
cheat86_repeat_add_to_address = "0"
cheat87_address = "0"
cheat87_address_bit_position = "0"
cheat87_big_endian = "false"
cheat87_cheat_type = "1"
cheat87_code = ""
cheat87_desc = "00 - Nick"
cheat87_enable = "false"
cheat87_handler = "1"
cheat87_memory_search_size = "4"
cheat87_rumble_port = "0"
cheat87_rumble_primary_duration = "0"
cheat87_rumble_primary_strength = "0"
cheat87_rumble_secondary_duration = "0"
cheat87_rumble_secondary_strength = "0"
cheat87_rumble_type = "0"
cheat87_rumble_value = "0"
cheat87_value = "0"
cheat87_repeat_count = "1"
cheat87_repeat_add_to_value = "0"
cheat87_repeat_add_to_address = "0"
cheat88_address = "0"
cheat88_address_bit_position = "0"
cheat88_big_endian = "false"
cheat88_cheat_type = "1"
cheat88_code = ""
cheat88_desc = "01 - Jose"
cheat88_enable = "false"
cheat88_handler = "1"
cheat88_memory_search_size = "4"
cheat88_rumble_port = "0"
cheat88_rumble_primary_duration = "0"
cheat88_rumble_primary_strength = "0"
cheat88_rumble_secondary_duration = "0"
cheat88_rumble_secondary_strength = "0"
cheat88_rumble_type = "0"
cheat88_rumble_value = "0"
cheat88_value = "0"
cheat88_repeat_count = "1"
cheat88_repeat_add_to_value = "0"
cheat88_repeat_add_to_address = "0"
cheat89_address = "0"
cheat89_address_bit_position = "0"
cheat89_big_endian = "false"
cheat89_cheat_type = "1"
cheat89_code = ""
cheat89_desc = "02 - Randy"
cheat89_enable = "false"
cheat89_handler = "1"
cheat89_memory_search_size = "4"
cheat89_rumble_port = "0"
cheat89_rumble_primary_duration = "0"
cheat89_rumble_primary_strength = "0"
cheat89_rumble_secondary_duration = "0"
cheat89_rumble_secondary_strength = "0"
cheat89_rumble_type = "0"
cheat89_rumble_value = "0"
cheat89_value = "0"
cheat89_repeat_count = "1"
cheat89_repeat_add_to_value = "0"
cheat89_repeat_add_to_address = "0"
cheat90_address = "0"
cheat90_address_bit_position = "0"
cheat90_big_endian = "false"
cheat90_cheat_type = "1"
cheat90_code = ""
cheat90_desc = "03 - Akio"
cheat90_enable = "false"
cheat90_handler = "1"
cheat90_memory_search_size = "4"
cheat90_rumble_port = "0"
cheat90_rumble_primary_duration = "0"
cheat90_rumble_primary_strength = "0"
cheat90_rumble_secondary_duration = "0"
cheat90_rumble_secondary_strength = "0"
cheat90_rumble_type = "0"
cheat90_rumble_value = "0"
cheat90_value = "0"
cheat90_repeat_count = "1"
cheat90_repeat_add_to_value = "0"
cheat90_repeat_add_to_address = "0"
cheat91_address = "0"
cheat91_address_bit_position = "0"
cheat91_big_endian = "false"
cheat91_cheat_type = "1"
cheat91_code = ""
cheat91_desc = "04 - William"
cheat91_enable = "false"
cheat91_handler = "1"
cheat91_memory_search_size = "4"
cheat91_rumble_port = "0"
cheat91_rumble_primary_duration = "0"
cheat91_rumble_primary_strength = "0"
cheat91_rumble_secondary_duration = "0"
cheat91_rumble_secondary_strength = "0"
cheat91_rumble_type = "0"
cheat91_rumble_value = "0"
cheat91_value = "0"
cheat91_repeat_count = "1"
cheat91_repeat_add_to_value = "0"
cheat91_repeat_add_to_address = "0"
cheat92_address = "0"
cheat92_address_bit_position = "0"
cheat92_big_endian = "false"
cheat92_cheat_type = "1"
cheat92_code = ""
cheat92_desc = "05 - Robert"
cheat92_enable = "false"
cheat92_handler = "1"
cheat92_memory_search_size = "4"
cheat92_rumble_port = "0"
cheat92_rumble_primary_duration = "0"
cheat92_rumble_primary_strength = "0"
cheat92_rumble_secondary_duration = "0"
cheat92_rumble_secondary_strength = "0"
cheat92_rumble_type = "0"
cheat92_rumble_value = "0"
cheat92_value = "0"
cheat92_repeat_count = "1"
cheat92_repeat_add_to_value = "0"
cheat92_repeat_add_to_address = "0"
cheat93_address = "0"
cheat93_address_bit_position = "0"
cheat93_big_endian = "false"
cheat93_cheat_type = "1"
cheat93_code = ""
cheat93_desc = "06 - Julian"
cheat93_enable = "false"
cheat93_handler = "1"
cheat93_memory_search_size = "4"
cheat93_rumble_port = "0"
cheat93_rumble_primary_duration = "0"
cheat93_rumble_primary_strength = "0"
cheat93_rumble_secondary_duration = "0"
cheat93_rumble_secondary_strength = "0"
cheat93_rumble_type = "0"
cheat93_rumble_value = "0"
cheat93_value = "0"
cheat93_repeat_count = "1"
cheat93_repeat_add_to_value = "0"
cheat93_repeat_add_to_address = "0"
cheat94_address = "0"
cheat94_address_bit_position = "0"
cheat94_big_endian = "false"
cheat94_cheat_type = "1"
cheat94_code = ""
cheat94_desc = "07 - Leopold"
cheat94_enable = "false"
cheat94_handler = "1"
cheat94_memory_search_size = "4"
cheat94_rumble_port = "0"
cheat94_rumble_primary_duration = "0"
cheat94_rumble_primary_strength = "0"
cheat94_rumble_secondary_duration = "0"
cheat94_rumble_secondary_strength = "0"
cheat94_rumble_type = "0"
cheat94_rumble_value = "0"
cheat94_value = "0"
cheat94_repeat_count = "1"
cheat94_repeat_add_to_value = "0"
cheat94_repeat_add_to_address = "0"
cheat95_address = "0"
cheat95_address_bit_position = "0"
cheat95_big_endian = "false"
cheat95_cheat_type = "1"
cheat95_code = ""
cheat95_desc = "08 - Katherine"
cheat95_enable = "false"
cheat95_handler = "1"
cheat95_memory_search_size = "4"
cheat95_rumble_port = "0"
cheat95_rumble_primary_duration = "0"
cheat95_rumble_primary_strength = "0"
cheat95_rumble_secondary_duration = "0"
cheat95_rumble_secondary_strength = "0"
cheat95_rumble_type = "0"
cheat95_rumble_value = "0"
cheat95_value = "0"
cheat95_repeat_count = "1"
cheat95_repeat_add_to_value = "0"
cheat95_repeat_add_to_address = "0"
cheat96_address = "0"
cheat96_address_bit_position = "0"
cheat96_big_endian = "false"
cheat96_cheat_type = "1"
cheat96_code = ""
cheat96_desc = "09 - Elizabeth"
cheat96_enable = "false"
cheat96_handler = "1"
cheat96_memory_search_size = "4"
cheat96_rumble_port = "0"
cheat96_rumble_primary_duration = "0"
cheat96_rumble_primary_strength = "0"
cheat96_rumble_secondary_duration = "0"
cheat96_rumble_secondary_strength = "0"
cheat96_rumble_type = "0"
cheat96_rumble_value = "0"
cheat96_value = "0"
cheat96_repeat_count = "1"
cheat96_repeat_add_to_value = "0"
cheat96_repeat_add_to_address = "0"
cheat97_address = "0"
cheat97_address_bit_position = "0"
cheat97_big_endian = "false"
cheat97_cheat_type = "1"
cheat97_code = ""
cheat97_desc = "0A - Deborah"
cheat97_enable = "false"
cheat97_handler = "1"
cheat97_memory_search_size = "4"
cheat97_rumble_port = "0"
cheat97_rumble_primary_duration = "0"
cheat97_rumble_primary_strength = "0"
cheat97_rumble_secondary_duration = "0"
cheat97_rumble_secondary_strength = "0"
cheat97_rumble_type = "0"
cheat97_rumble_value = "0"
cheat97_value = "0"
cheat97_repeat_count = "1"
cheat97_repeat_add_to_value = "0"
cheat97_repeat_add_to_address = "0"
cheat98_address = "0"
cheat98_address_bit_position = "0"
cheat98_big_endian = "false"
cheat98_cheat_type = "1"
cheat98_code = ""
cheat98_desc = "0B - Swyong"
cheat98_enable = "false"
cheat98_handler = "1"
cheat98_memory_search_size = "4"
cheat98_rumble_port = "0"
cheat98_rumble_primary_duration = "0"
cheat98_rumble_primary_strength = "0"
cheat98_rumble_secondary_duration = "0"
cheat98_rumble_secondary_strength = "0"
cheat98_rumble_type = "0"
cheat98_rumble_value = "0"
cheat98_value = "0"
cheat98_repeat_count = "1"
cheat98_repeat_add_to_value = "0"
cheat98_repeat_add_to_address = "0"
cheat99_address = "0"
cheat99_address_bit_position = "0"
cheat99_big_endian = "false"
cheat99_cheat_type = "1"
cheat99_code = ""
cheat99_desc = "0C - Jeena"
cheat99_enable = "false"
cheat99_handler = "1"
cheat99_memory_search_size = "4"
cheat99_rumble_port = "0"
cheat99_rumble_primary_duration = "0"
cheat99_rumble_primary_strength = "0"
cheat99_rumble_secondary_duration = "0"
cheat99_rumble_secondary_strength = "0"
cheat99_rumble_type = "0"
cheat99_rumble_value = "0"
cheat99_value = "0"
cheat99_repeat_count = "1"
cheat99_repeat_add_to_value = "0"
cheat99_repeat_add_to_address = "0"
cheat100_address = "0"
cheat100_address_bit_position = "0"
cheat100_big_endian = "false"
cheat100_cheat_type = "1"
cheat100_code = ""
cheat100_desc = "0D - Christine"
cheat100_enable = "false"
cheat100_handler = "1"
cheat100_memory_search_size = "4"
cheat100_rumble_port = "0"
cheat100_rumble_primary_duration = "0"
cheat100_rumble_primary_strength = "0"
cheat100_rumble_secondary_duration = "0"
cheat100_rumble_secondary_strength = "0"
cheat100_rumble_type = "0"
cheat100_rumble_value = "0"
cheat100_value = "0"
cheat100_repeat_count = "1"
cheat100_repeat_add_to_value = "0"
cheat100_repeat_add_to_address = "0"
cheat101_address = "0"
cheat101_address_bit_position = "0"
cheat101_big_endian = "false"
cheat101_cheat_type = "1"
cheat101_code = ""
cheat101_desc = "0E - Midori"
cheat101_enable = "false"
cheat101_handler = "1"
cheat101_memory_search_size = "4"
cheat101_rumble_port = "0"
cheat101_rumble_primary_duration = "0"
cheat101_rumble_primary_strength = "0"
cheat101_rumble_secondary_duration = "0"
cheat101_rumble_secondary_strength = "0"
cheat101_rumble_type = "0"
cheat101_rumble_value = "0"
cheat101_value = "0"
cheat101_repeat_count = "1"
cheat101_repeat_add_to_value = "0"
cheat101_repeat_add_to_address = "0"
cheat102_address = "0"
cheat102_address_bit_position = "0"
cheat102_big_endian = "false"
cheat102_cheat_type = "1"
cheat102_code = ""
cheat102_desc = "0F - Mary"
cheat102_enable = "false"
cheat102_handler = "1"
cheat102_memory_search_size = "4"
cheat102_rumble_port = "0"
cheat102_rumble_primary_duration = "0"
cheat102_rumble_primary_strength = "0"
cheat102_rumble_secondary_duration = "0"
cheat102_rumble_secondary_strength = "0"
cheat102_rumble_type = "0"
cheat102_rumble_value = "0"
cheat102_value = "0"
cheat102_repeat_count = "1"
cheat102_repeat_add_to_value = "0"
cheat102_repeat_add_to_address = "0"
cheats = "103"
| {
"pile_set_name": "Github"
} |
module('NoConflict', {
setup: function(){
var datepicker = $.fn.datepicker.noConflict();
$.fn.bootstrapDP = datepicker;
},
teardown: function(){
$.fn.datepicker = $.fn.bootstrapDP;
delete $.fn.bootstrapDP;
}
});
test('Datepicker starts after calling noConflict() (no undefined defaults or locale_opts)', function(){
$('<div class="input-append date" id="datepicker">'+
'<input size="16" type="text" value="12-02-2012" readonly>'+
'<span class="add-on"><i class="icon-th"></i></span>'+
'</div>')
.appendTo('#qunit-fixture')
.bootstrapDP();
expect(0);
});
| {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package gobblin.data.management.conversion.hive.source;
import gobblin.source.workunit.WorkUnit;
/***
* Shim layer for org.apache.gobblin.data.management.conversion.hive.source.HiveWorkUnit
*/
public class HiveWorkUnit extends org.apache.gobblin.data.management.conversion.hive.source.HiveWorkUnit {
public HiveWorkUnit() {
super();
}
public HiveWorkUnit(WorkUnit workunit) {
super(workunit);
}
}
| {
"pile_set_name": "Github"
} |
/*
* SNAP data link layer. Derived from 802.2
*
* Alan Cox <[email protected]>,
* from the 802.2 layer by Greg Page.
* Merged in additions from Greg Page's psnap.c.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/slab.h>
#include <net/datalink.h>
#include <net/llc.h>
#include <net/psnap.h>
#include <linux/mm.h>
#include <linux/in.h>
#include <linux/init.h>
#include <linux/rculist.h>
static LIST_HEAD(snap_list);
static DEFINE_SPINLOCK(snap_lock);
static struct llc_sap *snap_sap;
/*
* Find a snap client by matching the 5 bytes.
*/
static struct datalink_proto *find_snap_client(const unsigned char *desc)
{
struct datalink_proto *proto = NULL, *p;
list_for_each_entry_rcu(p, &snap_list, node) {
if (!memcmp(p->type, desc, 5)) {
proto = p;
break;
}
}
return proto;
}
/*
* A SNAP packet has arrived
*/
static int snap_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt, struct net_device *orig_dev)
{
int rc = 1;
struct datalink_proto *proto;
static struct packet_type snap_packet_type = {
.type = cpu_to_be16(ETH_P_SNAP),
};
if (unlikely(!pskb_may_pull(skb, 5)))
goto drop;
rcu_read_lock();
proto = find_snap_client(skb_transport_header(skb));
if (proto) {
/* Pass the frame on. */
skb->transport_header += 5;
skb_pull_rcsum(skb, 5);
rc = proto->rcvfunc(skb, dev, &snap_packet_type, orig_dev);
}
rcu_read_unlock();
if (unlikely(!proto))
goto drop;
out:
return rc;
drop:
kfree_skb(skb);
goto out;
}
/*
* Put a SNAP header on a frame and pass to 802.2
*/
static int snap_request(struct datalink_proto *dl,
struct sk_buff *skb, u8 *dest)
{
memcpy(skb_push(skb, 5), dl->type, 5);
llc_build_and_send_ui_pkt(snap_sap, skb, dest, snap_sap->laddr.lsap);
return 0;
}
/*
* Set up the SNAP layer
*/
EXPORT_SYMBOL(register_snap_client);
EXPORT_SYMBOL(unregister_snap_client);
static const char snap_err_msg[] __initconst =
KERN_CRIT "SNAP - unable to register with 802.2\n";
static int __init snap_init(void)
{
snap_sap = llc_sap_open(0xAA, snap_rcv);
if (!snap_sap) {
printk(snap_err_msg);
return -EBUSY;
}
return 0;
}
module_init(snap_init);
static void __exit snap_exit(void)
{
llc_sap_put(snap_sap);
}
module_exit(snap_exit);
/*
* Register SNAP clients. We don't yet use this for IP.
*/
struct datalink_proto *register_snap_client(const unsigned char *desc,
int (*rcvfunc)(struct sk_buff *,
struct net_device *,
struct packet_type *,
struct net_device *))
{
struct datalink_proto *proto = NULL;
spin_lock_bh(&snap_lock);
if (find_snap_client(desc))
goto out;
proto = kmalloc(sizeof(*proto), GFP_ATOMIC);
if (proto) {
memcpy(proto->type, desc, 5);
proto->rcvfunc = rcvfunc;
proto->header_length = 5 + 3; /* snap + 802.2 */
proto->request = snap_request;
list_add_rcu(&proto->node, &snap_list);
}
out:
spin_unlock_bh(&snap_lock);
return proto;
}
/*
* Unregister SNAP clients. Protocols no longer want to play with us ...
*/
void unregister_snap_client(struct datalink_proto *proto)
{
spin_lock_bh(&snap_lock);
list_del_rcu(&proto->node);
spin_unlock_bh(&snap_lock);
synchronize_net();
kfree(proto);
}
MODULE_LICENSE("GPL");
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2002-2020 "Neo4j,"
* Neo4j Sweden AB [http://neo4j.com]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.neo4j.cypher.internal.rewriting.rewriters
import org.neo4j.cypher.internal.ast.ProcedureResult
import org.neo4j.cypher.internal.ast.ReturnItems
import org.neo4j.cypher.internal.ast.SingleQuery
import org.neo4j.cypher.internal.ast.UnresolvedCall
import org.neo4j.cypher.internal.ast.With
import org.neo4j.cypher.internal.util.Rewriter
import org.neo4j.cypher.internal.util.bottomUp
// Rewrites CALL proc WHERE <p> ==> CALL proc WITH * WHERE <p>
case object expandCallWhere extends Rewriter {
private val instance = bottomUp(Rewriter.lift {
case query@SingleQuery(clauses) =>
val newClauses = clauses.flatMap {
case unresolved@UnresolvedCall(_, _, _, Some(result@ProcedureResult(_, optWhere@Some(where)))) =>
val newResult = result.copy(where = None)(result.position)
val newUnresolved = unresolved.copy(declaredResult = Some(newResult))(unresolved.position)
val newItems = ReturnItems(includeExisting = true, Seq.empty)(where.position)
val newWith = With(distinct = false, newItems, None, None, None, optWhere)(where.position)
Seq(newUnresolved, newWith)
case clause =>
Some(clause)
}
query.copy(clauses = newClauses)(query.position)
})
override def apply(v: AnyRef): AnyRef =
instance(v)
}
| {
"pile_set_name": "Github"
} |
/* iCheck plugin Flat skin, red
----------------------------------- */
.icheckbox_flat-red,
.iradio_flat-red {
display: inline-block;
*display: inline;
vertical-align: middle;
margin: 0;
padding: 0;
width: 20px;
height: 20px;
background: url(red.png) no-repeat;
border: none;
cursor: pointer;
}
.icheckbox_flat-red {
background-position: 0 0;
}
.icheckbox_flat-red.checked {
background-position: -22px 0;
}
.icheckbox_flat-red.disabled {
background-position: -44px 0;
cursor: default;
}
.icheckbox_flat-red.checked.disabled {
background-position: -66px 0;
}
.iradio_flat-red {
background-position: -88px 0;
}
.iradio_flat-red.checked {
background-position: -110px 0;
}
.iradio_flat-red.disabled {
background-position: -132px 0;
cursor: default;
}
.iradio_flat-red.checked.disabled {
background-position: -154px 0;
}
/* Retina support */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (-moz-min-device-pixel-ratio: 1.5),
only screen and (-o-min-device-pixel-ratio: 3/2),
only screen and (min-device-pixel-ratio: 1.5) {
.icheckbox_flat-red,
.iradio_flat-red {
background-image: url([email protected]);
-webkit-background-size: 176px 22px;
background-size: 176px 22px;
}
} | {
"pile_set_name": "Github"
} |
{
"data": {
"costs": [
{
"id": "6bd89c43-abdd-47e6-bda0-d2c598792d4c",
"name": "Lorem",
"yearMonth": "2020-04",
"currency": "USD",
"availability": "HIGH",
"hitCost": 786.81,
"hitCostFormula": "(200 + 1956022) X 0.0003 ( (Hit Tier Base + Hits in Tier) X Hit Costs in Tier)",
"storageCost": 0,
"storageCostFormula": "No storage costs",
"environmentCost": {
"prod": 288.36,
"dev": 28.86
},
"environmentCostFormula": {
"prod": "(692 X 0.1389) + (692 X 0.1389) + (692 X 0.1389) (Sum of Project Production Hours X Production Environment Cost Per Hour)",
"dev": "Math.max((Total Dev Environment Hours: 3460 - (Total Prod Environment Hours: 692 * 2)) * Dev Cost Per Hour: 0.0139, 0)Math.max((Total Dev Environment Hours: 1384 - (Total Prod Environment Hours: 692 * 2)) * Dev Cost Per Hour: 0.0139, 0)Math.max((Total Dev Environment Hours: 1384 - (Total Prod Environment Hours: 692 * 2)) * Dev Cost Per Hour: 0.0139, 0)"
},
"total": 3161.0299999999997,
"modifiers": [
{
"id": "25",
"groupId": "6bd89c43-abdd-47e6-bda0-d2c598792d4c",
"startDate": "2020-04-01 00:00:00",
"endDate": "2020-04-30 00:00:00",
"customerComments": "Per email with Alex and Jennifer, correction for Jan/Feb/Mar hits calculation",
"adminComments": "Back-billing for incorrect hits calculation",
"group": {
"id": "6bd89c43-abdd-47e6-bda0-d2c598792d4c",
"name": "Accruent",
"type": "billing",
"currency": "USD",
"billingSoftware": "null",
"path": "/Accruent",
"attributes": {
"currency": [
"USD"
],
"lagoon-projects": [
"590,580,600"
],
"type": [
"billing"
]
},
"subGroups": [],
"groups": [],
"members": []
},
"weight": 0,
"discountFixed": 0,
"discountPercentage": 0,
"extraFixed": 1517,
"extraPercentage": 0,
"min": 0,
"max": 0
},
{
"id": "18",
"groupId": "6bd89c43-abdd-47e6-bda0-d2c598792d4c",
"startDate": "2020-03-01 00:00:00",
"endDate": "2999-03-02 00:00:00",
"customerComments": "Rocket Chat",
"adminComments": "Rocket Chat",
"group": {
"id": "6bd89c43-abdd-47e6-bda0-d2c598792d4c",
"name": "Accruent",
"type": "billing",
"currency": "USD",
"billingSoftware": "null",
"path": "/Accruent",
"attributes": {
"currency": [
"USD"
],
"lagoon-projects": [
"590,580,600"
],
"type": [
"billing"
]
},
"subGroups": [],
"groups": [],
"members": []
},
"weight": 0,
"discountFixed": 0,
"discountPercentage": 0,
"extraFixed": 540,
"extraPercentage": 0,
"min": 0,
"max": 0
}
],
"projects": [
{
"id": "580",
"name": "accruent-com",
"availability": "HIGH",
"month": "04",
"year": "2020",
"hits": 2043832,
"storageDays": 265.277876,
"prodHours": 692,
"devHours": 3460,
"environments": [
{
"id": "98930",
"name": "dev",
"type": "development",
"hits": {
"total": 7831
},
"storage": {
"bytesUsed": "66849832",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
},
{
"id": "97078",
"name": "dev",
"type": "development",
"hits": {
"total": 7831
},
"storage": {
"bytesUsed": null,
"month": null
},
"hours": {
"month": "2020-04",
"hours": 0
}
},
{
"id": "98917",
"name": "dev",
"type": "development",
"hits": {
"total": 7831
},
"storage": {
"bytesUsed": null,
"month": null
},
"hours": {
"month": "2020-04",
"hours": 0
}
},
{
"id": "98931",
"name": "dev2",
"type": "development",
"hits": {
"total": 5451
},
"storage": {
"bytesUsed": "41853648",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
},
{
"id": "98918",
"name": "dev2",
"type": "development",
"hits": {
"total": 5451
},
"storage": {
"bytesUsed": null,
"month": null
},
"hours": {
"month": "2020-04",
"hours": 0
}
},
{
"id": "98932",
"name": "dev3",
"type": "development",
"hits": {
"total": 320
},
"storage": {
"bytesUsed": "14597884",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
},
{
"id": "98919",
"name": "dev3",
"type": "development",
"hits": {
"total": 320
},
"storage": {
"bytesUsed": null,
"month": null
},
"hours": {
"month": "2020-04",
"hours": 0
}
},
{
"id": "108036",
"name": "dev4",
"type": "development",
"hits": {
"total": 0
},
"storage": {
"bytesUsed": "13188",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
},
{
"id": "98426",
"name": "develop",
"type": "development",
"hits": {
"total": 0
},
"storage": {
"bytesUsed": null,
"month": null
},
"hours": {
"month": "2020-04",
"hours": 0
}
},
{
"id": "96184",
"name": "lagoon",
"type": "development",
"hits": {
"total": 0
},
"storage": {
"bytesUsed": null,
"month": null
},
"hours": {
"month": "2020-04",
"hours": 0
}
},
{
"id": "97083",
"name": "prod",
"type": "production",
"hits": {
"total": 2043832
},
"storage": {
"bytesUsed": "96933008",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
},
{
"id": "97081",
"name": "stage",
"type": "development",
"hits": {
"total": 0
},
"storage": {
"bytesUsed": null,
"month": null
},
"hours": {
"month": "2020-04",
"hours": 0
}
},
{
"id": "98920",
"name": "test",
"type": "development",
"hits": {
"total": 7426
},
"storage": {
"bytesUsed": "45030316",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
}
]
},
{
"id": "590",
"name": "ipsum",
"availability": "HIGH",
"month": "04",
"year": "2020",
"hits": 186470,
"storageDays": 2.5444,
"prodHours": 692,
"devHours": 1384,
"environments": [
{
"id": "104046",
"name": "dev",
"type": "development",
"hits": {
"total": 3614
},
"storage": {
"bytesUsed": "1775440",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
},
{
"id": "104036",
"name": "master",
"type": "production",
"hits": {
"total": 186470
},
"storage": {
"bytesUsed": "93732",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
},
{
"id": "104057",
"name": "stage",
"type": "development",
"hits": {
"total": 1085
},
"storage": {
"bytesUsed": "675228",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
}
]
},
{
"id": "600",
"name": "ipsum-front",
"availability": "HIGH",
"month": "04",
"year": "2020",
"hits": 25720,
"storageDays": 0,
"prodHours": 692,
"devHours": 1384,
"environments": [
{
"id": "106049",
"name": "dev",
"type": "development",
"hits": {
"total": 1889
},
"storage": {
"bytesUsed": "0",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
},
{
"id": "106035",
"name": "master",
"type": "production",
"hits": {
"total": 25720
},
"storage": {
"bytesUsed": "0",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
},
{
"id": "106058",
"name": "stage",
"type": "development",
"hits": {
"total": 414
},
"storage": {
"bytesUsed": "0",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
}
]
}
]
},
{
"id": "6bd89c43-abdd-47e6-bda0-d2c598792d4c",
"name": "Lorem",
"yearMonth": "2020-03",
"currency": "USD",
"availability": "HIGH",
"hitCost": 786.81,
"hitCostFormula": "(200 + 1956022) X 0.0003 ( (Hit Tier Base + Hits in Tier) X Hit Costs in Tier)",
"storageCost": 0,
"storageCostFormula": "No storage costs",
"environmentCost": {
"prod": 288.36,
"dev": 28.86
},
"environmentCostFormula": {
"prod": "(692 X 0.1389) + (692 X 0.1389) + (692 X 0.1389) (Sum of Project Production Hours X Production Environment Cost Per Hour)",
"dev": "Math.max((Total Dev Environment Hours: 3460 - (Total Prod Environment Hours: 692 * 2)) * Dev Cost Per Hour: 0.0139, 0)Math.max((Total Dev Environment Hours: 1384 - (Total Prod Environment Hours: 692 * 2)) * Dev Cost Per Hour: 0.0139, 0)Math.max((Total Dev Environment Hours: 1384 - (Total Prod Environment Hours: 692 * 2)) * Dev Cost Per Hour: 0.0139, 0)"
},
"total": 500.0299999999997,
"modifiers": [
{
"id": "25",
"groupId": "6bd89c43-abdd-47e6-bda0-d2c598792d4c",
"startDate": "2020-04-01 00:00:00",
"endDate": "2020-04-30 00:00:00",
"customerComments": "Per email with Alex and Jennifer, correction for Jan/Feb/Mar hits calculation",
"adminComments": "Back-billing for incorrect hits calculation",
"group": {
"id": "6bd89c43-abdd-47e6-bda0-d2c598792d4c",
"name": "Accruent",
"type": "billing",
"currency": "USD",
"billingSoftware": "null",
"path": "/Accruent",
"attributes": {
"currency": [
"USD"
],
"lagoon-projects": [
"590,580,600"
],
"type": [
"billing"
]
},
"subGroups": [],
"groups": [],
"members": []
},
"weight": 0,
"discountFixed": 0,
"discountPercentage": 0,
"extraFixed": 1517,
"extraPercentage": 0,
"min": 0,
"max": 0
},
{
"id": "18",
"groupId": "6bd89c43-abdd-47e6-bda0-d2c598792d4c",
"startDate": "2020-03-01 00:00:00",
"endDate": "2999-03-02 00:00:00",
"customerComments": "Rocket Chat",
"adminComments": "Rocket Chat",
"group": {
"id": "6bd89c43-abdd-47e6-bda0-d2c598792d4c",
"name": "Accruent",
"type": "billing",
"currency": "USD",
"billingSoftware": "null",
"path": "/Accruent",
"attributes": {
"currency": [
"USD"
],
"lagoon-projects": [
"590,580,600"
],
"type": [
"billing"
]
},
"subGroups": [],
"groups": [],
"members": []
},
"weight": 0,
"discountFixed": 0,
"discountPercentage": 0,
"extraFixed": 540,
"extraPercentage": 0,
"min": 0,
"max": 0
}
],
"projects": [
{
"id": "580",
"name": "accruent-com",
"availability": "HIGH",
"month": "04",
"year": "2020",
"hits": 2043832,
"storageDays": 265.277876,
"prodHours": 692,
"devHours": 3460,
"environments": [
{
"id": "98930",
"name": "dev",
"type": "development",
"hits": {
"total": 7831
},
"storage": {
"bytesUsed": "66849832",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
},
{
"id": "97078",
"name": "dev",
"type": "development",
"hits": {
"total": 7831
},
"storage": {
"bytesUsed": null,
"month": null
},
"hours": {
"month": "2020-04",
"hours": 0
}
},
{
"id": "98917",
"name": "dev",
"type": "development",
"hits": {
"total": 7831
},
"storage": {
"bytesUsed": null,
"month": null
},
"hours": {
"month": "2020-04",
"hours": 0
}
},
{
"id": "98931",
"name": "dev2",
"type": "development",
"hits": {
"total": 5451
},
"storage": {
"bytesUsed": "41853648",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
},
{
"id": "98918",
"name": "dev2",
"type": "development",
"hits": {
"total": 5451
},
"storage": {
"bytesUsed": null,
"month": null
},
"hours": {
"month": "2020-04",
"hours": 0
}
},
{
"id": "98932",
"name": "dev3",
"type": "development",
"hits": {
"total": 320
},
"storage": {
"bytesUsed": "14597884",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
},
{
"id": "98919",
"name": "dev3",
"type": "development",
"hits": {
"total": 320
},
"storage": {
"bytesUsed": null,
"month": null
},
"hours": {
"month": "2020-04",
"hours": 0
}
},
{
"id": "108036",
"name": "dev4",
"type": "development",
"hits": {
"total": 0
},
"storage": {
"bytesUsed": "13188",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
},
{
"id": "98426",
"name": "develop",
"type": "development",
"hits": {
"total": 0
},
"storage": {
"bytesUsed": null,
"month": null
},
"hours": {
"month": "2020-04",
"hours": 0
}
},
{
"id": "96184",
"name": "lagoon",
"type": "development",
"hits": {
"total": 0
},
"storage": {
"bytesUsed": null,
"month": null
},
"hours": {
"month": "2020-04",
"hours": 0
}
},
{
"id": "97083",
"name": "prod",
"type": "production",
"hits": {
"total": 2043832
},
"storage": {
"bytesUsed": "96933008",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
},
{
"id": "97081",
"name": "stage",
"type": "development",
"hits": {
"total": 0
},
"storage": {
"bytesUsed": null,
"month": null
},
"hours": {
"month": "2020-04",
"hours": 0
}
},
{
"id": "98920",
"name": "test",
"type": "development",
"hits": {
"total": 7426
},
"storage": {
"bytesUsed": "45030316",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
}
]
},
{
"id": "590",
"name": "ipsum",
"availability": "HIGH",
"month": "04",
"year": "2020",
"hits": 186470,
"storageDays": 2.5444,
"prodHours": 692,
"devHours": 1384,
"environments": [
{
"id": "104046",
"name": "dev",
"type": "development",
"hits": {
"total": 3614
},
"storage": {
"bytesUsed": "1775440",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
},
{
"id": "104036",
"name": "master",
"type": "production",
"hits": {
"total": 186470
},
"storage": {
"bytesUsed": "93732",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
},
{
"id": "104057",
"name": "stage",
"type": "development",
"hits": {
"total": 1085
},
"storage": {
"bytesUsed": "675228",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
}
]
},
{
"id": "600",
"name": "ipsum-front",
"availability": "HIGH",
"month": "04",
"year": "2020",
"hits": 25720,
"storageDays": 0,
"prodHours": 692,
"devHours": 1384,
"environments": [
{
"id": "106049",
"name": "dev",
"type": "development",
"hits": {
"total": 1889
},
"storage": {
"bytesUsed": "0",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
},
{
"id": "106035",
"name": "master",
"type": "production",
"hits": {
"total": 25720
},
"storage": {
"bytesUsed": "0",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
},
{
"id": "106058",
"name": "stage",
"type": "development",
"hits": {
"total": 414
},
"storage": {
"bytesUsed": "0",
"month": "2020-04"
},
"hours": {
"month": "2020-04",
"hours": 692
}
}
]
}
]
}
]
}
} | {
"pile_set_name": "Github"
} |
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Player for HL2.
//
//=============================================================================//
#include "cbase.h"
#include "weapon_hl2mpbasehlmpcombatweapon.h"
#include "hl2mp_player.h"
#include "globalstate.h"
#include "game.h"
#include "gamerules.h"
#include "hl2mp_player_shared.h"
#include "predicted_viewmodel.h"
#include "in_buttons.h"
#include "hl2mp_gamerules.h"
#include "KeyValues.h"
#include "team.h"
#include "weapon_hl2mpbase.h"
#include "grenade_satchel.h"
#include "eventqueue.h"
#include "gamestats.h"
#include "engine/IEngineSound.h"
#include "SoundEmitterSystem/isoundemittersystembase.h"
#include "ilagcompensationmanager.h"
int g_iLastCitizenModel = 0;
int g_iLastCombineModel = 0;
CBaseEntity *g_pLastCombineSpawn = NULL;
CBaseEntity *g_pLastRebelSpawn = NULL;
extern CBaseEntity *g_pLastSpawn;
#define HL2MP_COMMAND_MAX_RATE 0.3
void DropPrimedFragGrenade( CHL2MP_Player *pPlayer, CBaseCombatWeapon *pGrenade );
LINK_ENTITY_TO_CLASS( player, CHL2MP_Player );
LINK_ENTITY_TO_CLASS( info_player_combine, CPointEntity );
LINK_ENTITY_TO_CLASS( info_player_rebel, CPointEntity );
IMPLEMENT_SERVERCLASS_ST(CHL2MP_Player, DT_HL2MP_Player)
SendPropAngle( SENDINFO_VECTORELEM(m_angEyeAngles, 0), 11, SPROP_CHANGES_OFTEN ),
SendPropAngle( SENDINFO_VECTORELEM(m_angEyeAngles, 1), 11, SPROP_CHANGES_OFTEN ),
SendPropEHandle( SENDINFO( m_hRagdoll ) ),
SendPropInt( SENDINFO( m_iSpawnInterpCounter), 4 ),
SendPropInt( SENDINFO( m_iPlayerSoundType), 3 ),
SendPropExclude( "DT_BaseAnimating", "m_flPoseParameter" ),
SendPropExclude( "DT_BaseFlex", "m_viewtarget" ),
// SendPropExclude( "DT_ServerAnimationData" , "m_flCycle" ),
// SendPropExclude( "DT_AnimTimeMustBeFirst" , "m_flAnimTime" ),
END_SEND_TABLE()
BEGIN_DATADESC( CHL2MP_Player )
END_DATADESC()
const char *g_ppszRandomCitizenModels[] =
{
"models/humans/group03/male_01.mdl",
"models/humans/group03/male_02.mdl",
"models/humans/group03/female_01.mdl",
"models/humans/group03/male_03.mdl",
"models/humans/group03/female_02.mdl",
"models/humans/group03/male_04.mdl",
"models/humans/group03/female_03.mdl",
"models/humans/group03/male_05.mdl",
"models/humans/group03/female_04.mdl",
"models/humans/group03/male_06.mdl",
"models/humans/group03/female_06.mdl",
"models/humans/group03/male_07.mdl",
"models/humans/group03/female_07.mdl",
"models/humans/group03/male_08.mdl",
"models/humans/group03/male_09.mdl",
};
const char *g_ppszRandomCombineModels[] =
{
"models/combine_soldier.mdl",
"models/combine_soldier_prisonguard.mdl",
"models/combine_super_soldier.mdl",
"models/police.mdl",
};
#define MAX_COMBINE_MODELS 4
#define MODEL_CHANGE_INTERVAL 5.0f
#define TEAM_CHANGE_INTERVAL 5.0f
#define HL2MPPLAYER_PHYSDAMAGE_SCALE 4.0f
#pragma warning( disable : 4355 )
CHL2MP_Player::CHL2MP_Player() : m_PlayerAnimState( this )
{
m_angEyeAngles.Init();
m_iLastWeaponFireUsercmd = 0;
m_flNextModelChangeTime = 0.0f;
m_flNextTeamChangeTime = 0.0f;
m_iSpawnInterpCounter = 0;
m_bEnterObserver = false;
m_bReady = false;
BaseClass::ChangeTeam( 0 );
// UseClientSideAnimation();
}
CHL2MP_Player::~CHL2MP_Player( void )
{
}
void CHL2MP_Player::UpdateOnRemove( void )
{
if ( m_hRagdoll )
{
UTIL_RemoveImmediate( m_hRagdoll );
m_hRagdoll = NULL;
}
BaseClass::UpdateOnRemove();
}
void CHL2MP_Player::Precache( void )
{
BaseClass::Precache();
PrecacheModel ( "sprites/glow01.vmt" );
//Precache Citizen models
int nHeads = ARRAYSIZE( g_ppszRandomCitizenModels );
int i;
for ( i = 0; i < nHeads; ++i )
PrecacheModel( g_ppszRandomCitizenModels[i] );
//Precache Combine Models
nHeads = ARRAYSIZE( g_ppszRandomCombineModels );
for ( i = 0; i < nHeads; ++i )
PrecacheModel( g_ppszRandomCombineModels[i] );
PrecacheFootStepSounds();
PrecacheScriptSound( "NPC_MetroPolice.Die" );
PrecacheScriptSound( "NPC_CombineS.Die" );
PrecacheScriptSound( "NPC_Citizen.die" );
}
void CHL2MP_Player::GiveAllItems( void )
{
EquipSuit();
CBasePlayer::GiveAmmo( 255, "Pistol");
CBasePlayer::GiveAmmo( 255, "AR2" );
CBasePlayer::GiveAmmo( 5, "AR2AltFire" );
CBasePlayer::GiveAmmo( 255, "SMG1");
CBasePlayer::GiveAmmo( 1, "smg1_grenade");
CBasePlayer::GiveAmmo( 255, "Buckshot");
CBasePlayer::GiveAmmo( 32, "357" );
CBasePlayer::GiveAmmo( 3, "rpg_round");
CBasePlayer::GiveAmmo( 1, "grenade" );
CBasePlayer::GiveAmmo( 2, "slam" );
GiveNamedItem( "weapon_crowbar" );
GiveNamedItem( "weapon_stunstick" );
GiveNamedItem( "weapon_pistol" );
GiveNamedItem( "weapon_357" );
GiveNamedItem( "weapon_smg1" );
GiveNamedItem( "weapon_ar2" );
GiveNamedItem( "weapon_shotgun" );
GiveNamedItem( "weapon_frag" );
GiveNamedItem( "weapon_crossbow" );
GiveNamedItem( "weapon_rpg" );
GiveNamedItem( "weapon_slam" );
GiveNamedItem( "weapon_physcannon" );
}
void CHL2MP_Player::GiveDefaultItems( void )
{
EquipSuit();
CBasePlayer::GiveAmmo( 255, "Pistol");
CBasePlayer::GiveAmmo( 45, "SMG1");
CBasePlayer::GiveAmmo( 1, "grenade" );
CBasePlayer::GiveAmmo( 6, "Buckshot");
CBasePlayer::GiveAmmo( 6, "357" );
if ( GetPlayerModelType() == PLAYER_SOUNDS_METROPOLICE || GetPlayerModelType() == PLAYER_SOUNDS_COMBINESOLDIER )
{
GiveNamedItem( "weapon_stunstick" );
}
else if ( GetPlayerModelType() == PLAYER_SOUNDS_CITIZEN )
{
GiveNamedItem( "weapon_crowbar" );
}
GiveNamedItem( "weapon_pistol" );
GiveNamedItem( "weapon_smg1" );
GiveNamedItem( "weapon_frag" );
GiveNamedItem( "weapon_physcannon" );
const char *szDefaultWeaponName = engine->GetClientConVarValue( engine->IndexOfEdict( edict() ), "cl_defaultweapon" );
CBaseCombatWeapon *pDefaultWeapon = Weapon_OwnsThisType( szDefaultWeaponName );
if ( pDefaultWeapon )
{
Weapon_Switch( pDefaultWeapon );
}
else
{
Weapon_Switch( Weapon_OwnsThisType( "weapon_physcannon" ) );
}
}
void CHL2MP_Player::PickDefaultSpawnTeam( void )
{
if ( GetTeamNumber() == 0 )
{
if ( HL2MPRules()->IsTeamplay() == false )
{
if ( GetModelPtr() == NULL )
{
const char *szModelName = NULL;
szModelName = engine->GetClientConVarValue( engine->IndexOfEdict( edict() ), "cl_playermodel" );
if ( ValidatePlayerModel( szModelName ) == false )
{
char szReturnString[512];
Q_snprintf( szReturnString, sizeof (szReturnString ), "cl_playermodel models/combine_soldier.mdl\n" );
engine->ClientCommand ( edict(), szReturnString );
}
ChangeTeam( TEAM_UNASSIGNED );
}
}
else
{
CTeam *pCombine = g_Teams[TEAM_COMBINE];
CTeam *pRebels = g_Teams[TEAM_REBELS];
if ( pCombine == NULL || pRebels == NULL )
{
ChangeTeam( random->RandomInt( TEAM_COMBINE, TEAM_REBELS ) );
}
else
{
if ( pCombine->GetNumPlayers() > pRebels->GetNumPlayers() )
{
ChangeTeam( TEAM_REBELS );
}
else if ( pCombine->GetNumPlayers() < pRebels->GetNumPlayers() )
{
ChangeTeam( TEAM_COMBINE );
}
else
{
ChangeTeam( random->RandomInt( TEAM_COMBINE, TEAM_REBELS ) );
}
}
}
}
}
//-----------------------------------------------------------------------------
// Purpose: Sets HL2 specific defaults.
//-----------------------------------------------------------------------------
void CHL2MP_Player::Spawn(void)
{
m_flNextModelChangeTime = 0.0f;
m_flNextTeamChangeTime = 0.0f;
PickDefaultSpawnTeam();
BaseClass::Spawn();
if ( !IsObserver() )
{
pl.deadflag = false;
RemoveSolidFlags( FSOLID_NOT_SOLID );
RemoveEffects( EF_NODRAW );
GiveDefaultItems();
}
SetNumAnimOverlays( 3 );
ResetAnimation();
m_nRenderFX = kRenderNormal;
m_Local.m_iHideHUD = 0;
AddFlag(FL_ONGROUND); // set the player on the ground at the start of the round.
m_impactEnergyScale = HL2MPPLAYER_PHYSDAMAGE_SCALE;
if ( HL2MPRules()->IsIntermission() )
{
AddFlag( FL_FROZEN );
}
else
{
RemoveFlag( FL_FROZEN );
}
m_iSpawnInterpCounter = (m_iSpawnInterpCounter + 1) % 8;
m_Local.m_bDucked = false;
SetPlayerUnderwater(false);
m_bReady = false;
}
void CHL2MP_Player::PickupObject( CBaseEntity *pObject, bool bLimitMassAndSize )
{
}
bool CHL2MP_Player::ValidatePlayerModel( const char *pModel )
{
int iModels = ARRAYSIZE( g_ppszRandomCitizenModels );
int i;
for ( i = 0; i < iModels; ++i )
{
if ( !Q_stricmp( g_ppszRandomCitizenModels[i], pModel ) )
{
return true;
}
}
iModels = ARRAYSIZE( g_ppszRandomCombineModels );
for ( i = 0; i < iModels; ++i )
{
if ( !Q_stricmp( g_ppszRandomCombineModels[i], pModel ) )
{
return true;
}
}
return false;
}
void CHL2MP_Player::SetPlayerTeamModel( void )
{
const char *szModelName = NULL;
szModelName = engine->GetClientConVarValue( engine->IndexOfEdict( edict() ), "cl_playermodel" );
int modelIndex = modelinfo->GetModelIndex( szModelName );
if ( modelIndex == -1 || ValidatePlayerModel( szModelName ) == false )
{
szModelName = "models/Combine_Soldier.mdl";
m_iModelType = TEAM_COMBINE;
char szReturnString[512];
Q_snprintf( szReturnString, sizeof (szReturnString ), "cl_playermodel %s\n", szModelName );
engine->ClientCommand ( edict(), szReturnString );
}
if ( GetTeamNumber() == TEAM_COMBINE )
{
if ( Q_stristr( szModelName, "models/human") )
{
int nHeads = ARRAYSIZE( g_ppszRandomCombineModels );
g_iLastCombineModel = ( g_iLastCombineModel + 1 ) % nHeads;
szModelName = g_ppszRandomCombineModels[g_iLastCombineModel];
}
m_iModelType = TEAM_COMBINE;
}
else if ( GetTeamNumber() == TEAM_REBELS )
{
if ( !Q_stristr( szModelName, "models/human") )
{
int nHeads = ARRAYSIZE( g_ppszRandomCitizenModels );
g_iLastCitizenModel = ( g_iLastCitizenModel + 1 ) % nHeads;
szModelName = g_ppszRandomCitizenModels[g_iLastCitizenModel];
}
m_iModelType = TEAM_REBELS;
}
SetModel( szModelName );
SetupPlayerSoundsByModel( szModelName );
m_flNextModelChangeTime = gpGlobals->curtime + MODEL_CHANGE_INTERVAL;
}
void CHL2MP_Player::SetPlayerModel( void )
{
const char *szModelName = NULL;
const char *pszCurrentModelName = modelinfo->GetModelName( GetModel());
szModelName = engine->GetClientConVarValue( engine->IndexOfEdict( edict() ), "cl_playermodel" );
if ( ValidatePlayerModel( szModelName ) == false )
{
char szReturnString[512];
if ( ValidatePlayerModel( pszCurrentModelName ) == false )
{
pszCurrentModelName = "models/Combine_Soldier.mdl";
}
Q_snprintf( szReturnString, sizeof (szReturnString ), "cl_playermodel %s\n", pszCurrentModelName );
engine->ClientCommand ( edict(), szReturnString );
szModelName = pszCurrentModelName;
}
if ( GetTeamNumber() == TEAM_COMBINE )
{
int nHeads = ARRAYSIZE( g_ppszRandomCombineModels );
g_iLastCombineModel = ( g_iLastCombineModel + 1 ) % nHeads;
szModelName = g_ppszRandomCombineModels[g_iLastCombineModel];
m_iModelType = TEAM_COMBINE;
}
else if ( GetTeamNumber() == TEAM_REBELS )
{
int nHeads = ARRAYSIZE( g_ppszRandomCitizenModels );
g_iLastCitizenModel = ( g_iLastCitizenModel + 1 ) % nHeads;
szModelName = g_ppszRandomCitizenModels[g_iLastCitizenModel];
m_iModelType = TEAM_REBELS;
}
else
{
if ( Q_strlen( szModelName ) == 0 )
{
szModelName = g_ppszRandomCitizenModels[0];
}
if ( Q_stristr( szModelName, "models/human") )
{
m_iModelType = TEAM_REBELS;
}
else
{
m_iModelType = TEAM_COMBINE;
}
}
int modelIndex = modelinfo->GetModelIndex( szModelName );
if ( modelIndex == -1 )
{
szModelName = "models/Combine_Soldier.mdl";
m_iModelType = TEAM_COMBINE;
char szReturnString[512];
Q_snprintf( szReturnString, sizeof (szReturnString ), "cl_playermodel %s\n", szModelName );
engine->ClientCommand ( edict(), szReturnString );
}
SetModel( szModelName );
SetupPlayerSoundsByModel( szModelName );
m_flNextModelChangeTime = gpGlobals->curtime + MODEL_CHANGE_INTERVAL;
}
void CHL2MP_Player::SetupPlayerSoundsByModel( const char *pModelName )
{
if ( Q_stristr( pModelName, "models/human") )
{
m_iPlayerSoundType = (int)PLAYER_SOUNDS_CITIZEN;
}
else if ( Q_stristr(pModelName, "police" ) )
{
m_iPlayerSoundType = (int)PLAYER_SOUNDS_METROPOLICE;
}
else if ( Q_stristr(pModelName, "combine" ) )
{
m_iPlayerSoundType = (int)PLAYER_SOUNDS_COMBINESOLDIER;
}
}
void CHL2MP_Player::ResetAnimation( void )
{
if ( IsAlive() )
{
SetSequence ( -1 );
SetActivity( ACT_INVALID );
if (!GetAbsVelocity().x && !GetAbsVelocity().y)
SetAnimation( PLAYER_IDLE );
else if ((GetAbsVelocity().x || GetAbsVelocity().y) && ( GetFlags() & FL_ONGROUND ))
SetAnimation( PLAYER_WALK );
else if (GetWaterLevel() > 1)
SetAnimation( PLAYER_WALK );
}
}
bool CHL2MP_Player::Weapon_Switch( CBaseCombatWeapon *pWeapon, int viewmodelindex )
{
bool bRet = BaseClass::Weapon_Switch( pWeapon, viewmodelindex );
if ( bRet == true )
{
ResetAnimation();
}
return bRet;
}
void CHL2MP_Player::PreThink( void )
{
QAngle vOldAngles = GetLocalAngles();
QAngle vTempAngles = GetLocalAngles();
vTempAngles = EyeAngles();
if ( vTempAngles[PITCH] > 180.0f )
{
vTempAngles[PITCH] -= 360.0f;
}
SetLocalAngles( vTempAngles );
BaseClass::PreThink();
State_PreThink();
//Reset bullet force accumulator, only lasts one frame
m_vecTotalBulletForce = vec3_origin;
SetLocalAngles( vOldAngles );
}
void CHL2MP_Player::PostThink( void )
{
BaseClass::PostThink();
if ( GetFlags() & FL_DUCKING )
{
SetCollisionBounds( VEC_CROUCH_TRACE_MIN, VEC_CROUCH_TRACE_MAX );
}
m_PlayerAnimState.Update();
// Store the eye angles pitch so the client can compute its animation state correctly.
m_angEyeAngles = EyeAngles();
QAngle angles = GetLocalAngles();
angles[PITCH] = 0;
SetLocalAngles( angles );
}
void CHL2MP_Player::PlayerDeathThink()
{
if( !IsObserver() )
{
BaseClass::PlayerDeathThink();
}
}
void CHL2MP_Player::FireBullets ( const FireBulletsInfo_t &info )
{
// Move other players back to history positions based on local player's lag
lagcompensation->StartLagCompensation( this, this->GetCurrentCommand() );
FireBulletsInfo_t modinfo = info;
CWeaponHL2MPBase *pWeapon = dynamic_cast<CWeaponHL2MPBase *>( GetActiveWeapon() );
if ( pWeapon )
{
modinfo.m_iPlayerDamage = modinfo.m_flDamage = pWeapon->GetHL2MPWpnData().m_iPlayerDamage;
}
NoteWeaponFired();
BaseClass::FireBullets( modinfo );
// Move other players back to history positions based on local player's lag
lagcompensation->FinishLagCompensation( this );
}
void CHL2MP_Player::NoteWeaponFired( void )
{
Assert( m_pCurrentCommand );
if( m_pCurrentCommand )
{
m_iLastWeaponFireUsercmd = m_pCurrentCommand->command_number;
}
}
extern ConVar sv_maxunlag;
bool CHL2MP_Player::WantsLagCompensationOnEntity( const CBasePlayer *pPlayer, const CUserCmd *pCmd, const CBitVec<MAX_EDICTS> *pEntityTransmitBits ) const
{
// No need to lag compensate at all if we're not attacking in this command and
// we haven't attacked recently.
if ( !( pCmd->buttons & IN_ATTACK ) && (pCmd->command_number - m_iLastWeaponFireUsercmd > 5) )
return false;
// If this entity hasn't been transmitted to us and acked, then don't bother lag compensating it.
if ( pEntityTransmitBits && !pEntityTransmitBits->Get( pPlayer->entindex() ) )
return false;
const Vector &vMyOrigin = GetAbsOrigin();
const Vector &vHisOrigin = pPlayer->GetAbsOrigin();
// get max distance player could have moved within max lag compensation time,
// multiply by 1.5 to to avoid "dead zones" (sqrt(2) would be the exact value)
float maxDistance = 1.5 * pPlayer->MaxSpeed() * sv_maxunlag.GetFloat();
// If the player is within this distance, lag compensate them in case they're running past us.
if ( vHisOrigin.DistTo( vMyOrigin ) < maxDistance )
return true;
// If their origin is not within a 45 degree cone in front of us, no need to lag compensate.
Vector vForward;
AngleVectors( pCmd->viewangles, &vForward );
Vector vDiff = vHisOrigin - vMyOrigin;
VectorNormalize( vDiff );
float flCosAngle = 0.707107f; // 45 degree angle
if ( vForward.Dot( vDiff ) < flCosAngle )
return false;
return true;
}
Activity CHL2MP_Player::TranslateTeamActivity( Activity ActToTranslate )
{
if ( m_iModelType == TEAM_COMBINE )
return ActToTranslate;
if ( ActToTranslate == ACT_RUN )
return ACT_RUN_AIM_AGITATED;
if ( ActToTranslate == ACT_IDLE )
return ACT_IDLE_AIM_AGITATED;
if ( ActToTranslate == ACT_WALK )
return ACT_WALK_AIM_AGITATED;
return ActToTranslate;
}
extern ConVar hl2_normspeed;
// Set the activity based on an event or current state
void CHL2MP_Player::SetAnimation( PLAYER_ANIM playerAnim )
{
int animDesired;
float speed;
speed = GetAbsVelocity().Length2D();
// bool bRunning = true;
//Revisit!
/* if ( ( m_nButtons & ( IN_FORWARD | IN_BACK | IN_MOVELEFT | IN_MOVERIGHT ) ) )
{
if ( speed > 1.0f && speed < hl2_normspeed.GetFloat() - 20.0f )
{
bRunning = false;
}
}*/
if ( GetFlags() & ( FL_FROZEN | FL_ATCONTROLS ) )
{
speed = 0;
playerAnim = PLAYER_IDLE;
}
Activity idealActivity = ACT_HL2MP_RUN;
// This could stand to be redone. Why is playerAnim abstracted from activity? (sjb)
if ( playerAnim == PLAYER_JUMP )
{
idealActivity = ACT_HL2MP_JUMP;
}
else if ( playerAnim == PLAYER_DIE )
{
if ( m_lifeState == LIFE_ALIVE )
{
return;
}
}
else if ( playerAnim == PLAYER_ATTACK1 )
{
if ( GetActivity( ) == ACT_HOVER ||
GetActivity( ) == ACT_SWIM ||
GetActivity( ) == ACT_HOP ||
GetActivity( ) == ACT_LEAP ||
GetActivity( ) == ACT_DIESIMPLE )
{
idealActivity = GetActivity( );
}
else
{
idealActivity = ACT_HL2MP_GESTURE_RANGE_ATTACK;
}
}
else if ( playerAnim == PLAYER_RELOAD )
{
idealActivity = ACT_HL2MP_GESTURE_RELOAD;
}
else if ( playerAnim == PLAYER_IDLE || playerAnim == PLAYER_WALK )
{
if ( !( GetFlags() & FL_ONGROUND ) && GetActivity( ) == ACT_HL2MP_JUMP ) // Still jumping
{
idealActivity = GetActivity( );
}
/*
else if ( GetWaterLevel() > 1 )
{
if ( speed == 0 )
idealActivity = ACT_HOVER;
else
idealActivity = ACT_SWIM;
}
*/
else
{
if ( GetFlags() & FL_DUCKING )
{
if ( speed > 0 )
{
idealActivity = ACT_HL2MP_WALK_CROUCH;
}
else
{
idealActivity = ACT_HL2MP_IDLE_CROUCH;
}
}
else
{
if ( speed > 0 )
{
/*
if ( bRunning == false )
{
idealActivity = ACT_WALK;
}
else
*/
{
idealActivity = ACT_HL2MP_RUN;
}
}
else
{
idealActivity = ACT_HL2MP_IDLE;
}
}
}
idealActivity = TranslateTeamActivity( idealActivity );
}
if ( idealActivity == ACT_HL2MP_GESTURE_RANGE_ATTACK )
{
RestartGesture( Weapon_TranslateActivity( idealActivity ) );
// FIXME: this seems a bit wacked
Weapon_SetActivity( Weapon_TranslateActivity( ACT_RANGE_ATTACK1 ), 0 );
return;
}
else if ( idealActivity == ACT_HL2MP_GESTURE_RELOAD )
{
RestartGesture( Weapon_TranslateActivity( idealActivity ) );
return;
}
else
{
SetActivity( idealActivity );
animDesired = SelectWeightedSequence( Weapon_TranslateActivity ( idealActivity ) );
if (animDesired == -1)
{
animDesired = SelectWeightedSequence( idealActivity );
if ( animDesired == -1 )
{
animDesired = 0;
}
}
// Already using the desired animation?
if ( GetSequence() == animDesired )
return;
m_flPlaybackRate = 1.0;
ResetSequence( animDesired );
SetCycle( 0 );
return;
}
// Already using the desired animation?
if ( GetSequence() == animDesired )
return;
//Msg( "Set animation to %d\n", animDesired );
// Reset to first frame of desired animation
ResetSequence( animDesired );
SetCycle( 0 );
}
extern int gEvilImpulse101;
//-----------------------------------------------------------------------------
// Purpose: Player reacts to bumping a weapon.
// Input : pWeapon - the weapon that the player bumped into.
// Output : Returns true if player picked up the weapon
//-----------------------------------------------------------------------------
bool CHL2MP_Player::BumpWeapon( CBaseCombatWeapon *pWeapon )
{
CBaseCombatCharacter *pOwner = pWeapon->GetOwner();
// Can I have this weapon type?
if ( !IsAllowedToPickupWeapons() )
return false;
if ( pOwner || !Weapon_CanUse( pWeapon ) || !g_pGameRules->CanHavePlayerItem( this, pWeapon ) )
{
if ( gEvilImpulse101 )
{
UTIL_Remove( pWeapon );
}
return false;
}
// Don't let the player fetch weapons through walls (use MASK_SOLID so that you can't pickup through windows)
if( !pWeapon->FVisible( this, MASK_SOLID ) && !(GetFlags() & FL_NOTARGET) )
{
return false;
}
bool bOwnsWeaponAlready = !!Weapon_OwnsThisType( pWeapon->GetClassname(), pWeapon->GetSubType());
if ( bOwnsWeaponAlready == true )
{
//If we have room for the ammo, then "take" the weapon too.
if ( Weapon_EquipAmmoOnly( pWeapon ) )
{
pWeapon->CheckRespawn();
UTIL_Remove( pWeapon );
return true;
}
else
{
return false;
}
}
pWeapon->CheckRespawn();
Weapon_Equip( pWeapon );
return true;
}
void CHL2MP_Player::ChangeTeam( int iTeam )
{
/* if ( GetNextTeamChangeTime() >= gpGlobals->curtime )
{
char szReturnString[128];
Q_snprintf( szReturnString, sizeof( szReturnString ), "Please wait %d more seconds before trying to switch teams again.\n", (int)(GetNextTeamChangeTime() - gpGlobals->curtime) );
ClientPrint( this, HUD_PRINTTALK, szReturnString );
return;
}*/
bool bKill = false;
if ( HL2MPRules()->IsTeamplay() != true && iTeam != TEAM_SPECTATOR )
{
//don't let them try to join combine or rebels during deathmatch.
iTeam = TEAM_UNASSIGNED;
}
if ( HL2MPRules()->IsTeamplay() == true )
{
if ( iTeam != GetTeamNumber() && GetTeamNumber() != TEAM_UNASSIGNED )
{
bKill = true;
}
}
BaseClass::ChangeTeam( iTeam );
m_flNextTeamChangeTime = gpGlobals->curtime + TEAM_CHANGE_INTERVAL;
if ( HL2MPRules()->IsTeamplay() == true )
{
SetPlayerTeamModel();
}
else
{
SetPlayerModel();
}
if ( iTeam == TEAM_SPECTATOR )
{
RemoveAllItems( true );
State_Transition( STATE_OBSERVER_MODE );
}
if ( bKill == true )
{
CommitSuicide();
}
}
bool CHL2MP_Player::HandleCommand_JoinTeam( int team )
{
if ( !GetGlobalTeam( team ) || team == 0 )
{
Warning( "HandleCommand_JoinTeam( %d ) - invalid team index.\n", team );
return false;
}
if ( team == TEAM_SPECTATOR )
{
// Prevent this is the cvar is set
if ( !mp_allowspectators.GetInt() )
{
ClientPrint( this, HUD_PRINTCENTER, "#Cannot_Be_Spectator" );
return false;
}
if ( GetTeamNumber() != TEAM_UNASSIGNED && !IsDead() )
{
m_fNextSuicideTime = gpGlobals->curtime; // allow the suicide to work
CommitSuicide();
// add 1 to frags to balance out the 1 subtracted for killing yourself
IncrementFragCount( 1 );
}
ChangeTeam( TEAM_SPECTATOR );
return true;
}
else
{
StopObserverMode();
State_Transition(STATE_ACTIVE);
}
// Switch their actual team...
ChangeTeam( team );
return true;
}
bool CHL2MP_Player::ClientCommand( const CCommand &args )
{
if ( FStrEq( args[0], "spectate" ) )
{
if ( ShouldRunRateLimitedCommand( args ) )
{
// instantly join spectators
HandleCommand_JoinTeam( TEAM_SPECTATOR );
}
return true;
}
else if ( FStrEq( args[0], "jointeam" ) )
{
if ( args.ArgC() < 2 )
{
Warning( "Player sent bad jointeam syntax\n" );
}
if ( ShouldRunRateLimitedCommand( args ) )
{
int iTeam = atoi( args[1] );
HandleCommand_JoinTeam( iTeam );
}
return true;
}
else if ( FStrEq( args[0], "joingame" ) )
{
return true;
}
return BaseClass::ClientCommand( args );
}
void CHL2MP_Player::CheatImpulseCommands( int iImpulse )
{
switch ( iImpulse )
{
case 101:
{
if( sv_cheats->GetBool() )
{
GiveAllItems();
}
}
break;
default:
BaseClass::CheatImpulseCommands( iImpulse );
}
}
bool CHL2MP_Player::ShouldRunRateLimitedCommand( const CCommand &args )
{
int i = m_RateLimitLastCommandTimes.Find( args[0] );
if ( i == m_RateLimitLastCommandTimes.InvalidIndex() )
{
m_RateLimitLastCommandTimes.Insert( args[0], gpGlobals->curtime );
return true;
}
else if ( (gpGlobals->curtime - m_RateLimitLastCommandTimes[i]) < HL2MP_COMMAND_MAX_RATE )
{
// Too fast.
return false;
}
else
{
m_RateLimitLastCommandTimes[i] = gpGlobals->curtime;
return true;
}
}
void CHL2MP_Player::CreateViewModel( int index /*=0*/ )
{
Assert( index >= 0 && index < MAX_VIEWMODELS );
if ( GetViewModel( index ) )
return;
CPredictedViewModel *vm = ( CPredictedViewModel * )CreateEntityByName( "predicted_viewmodel" );
if ( vm )
{
vm->SetAbsOrigin( GetAbsOrigin() );
vm->SetOwner( this );
vm->SetIndex( index );
DispatchSpawn( vm );
vm->FollowEntity( this, false );
m_hViewModel.Set( index, vm );
}
}
bool CHL2MP_Player::BecomeRagdollOnClient( const Vector &force )
{
return true;
}
// -------------------------------------------------------------------------------- //
// Ragdoll entities.
// -------------------------------------------------------------------------------- //
class CHL2MPRagdoll : public CBaseAnimatingOverlay
{
public:
DECLARE_CLASS( CHL2MPRagdoll, CBaseAnimatingOverlay );
DECLARE_SERVERCLASS();
// Transmit ragdolls to everyone.
virtual int UpdateTransmitState()
{
return SetTransmitState( FL_EDICT_ALWAYS );
}
public:
// In case the client has the player entity, we transmit the player index.
// In case the client doesn't have it, we transmit the player's model index, origin, and angles
// so they can create a ragdoll in the right place.
CNetworkHandle( CBaseEntity, m_hPlayer ); // networked entity handle
CNetworkVector( m_vecRagdollVelocity );
CNetworkVector( m_vecRagdollOrigin );
};
LINK_ENTITY_TO_CLASS( hl2mp_ragdoll, CHL2MPRagdoll );
IMPLEMENT_SERVERCLASS_ST_NOBASE( CHL2MPRagdoll, DT_HL2MPRagdoll )
SendPropVector( SENDINFO(m_vecRagdollOrigin), -1, SPROP_COORD ),
SendPropEHandle( SENDINFO( m_hPlayer ) ),
SendPropModelIndex( SENDINFO( m_nModelIndex ) ),
SendPropInt ( SENDINFO(m_nForceBone), 8, 0 ),
SendPropVector ( SENDINFO(m_vecForce), -1, SPROP_NOSCALE ),
SendPropVector( SENDINFO( m_vecRagdollVelocity ) )
END_SEND_TABLE()
void CHL2MP_Player::CreateRagdollEntity( void )
{
if ( m_hRagdoll )
{
UTIL_RemoveImmediate( m_hRagdoll );
m_hRagdoll = NULL;
}
// If we already have a ragdoll, don't make another one.
CHL2MPRagdoll *pRagdoll = dynamic_cast< CHL2MPRagdoll* >( m_hRagdoll.Get() );
if ( !pRagdoll )
{
// create a new one
pRagdoll = dynamic_cast< CHL2MPRagdoll* >( CreateEntityByName( "hl2mp_ragdoll" ) );
}
if ( pRagdoll )
{
pRagdoll->m_hPlayer = this;
pRagdoll->m_vecRagdollOrigin = GetAbsOrigin();
pRagdoll->m_vecRagdollVelocity = GetAbsVelocity();
pRagdoll->m_nModelIndex = m_nModelIndex;
pRagdoll->m_nForceBone = m_nForceBone;
pRagdoll->m_vecForce = m_vecTotalBulletForce;
pRagdoll->SetAbsOrigin( GetAbsOrigin() );
}
// ragdolls will be removed on round restart automatically
m_hRagdoll = pRagdoll;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
int CHL2MP_Player::FlashlightIsOn( void )
{
return IsEffectActive( EF_DIMLIGHT );
}
extern ConVar flashlight;
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void CHL2MP_Player::FlashlightTurnOn( void )
{
if( flashlight.GetInt() > 0 && IsAlive() )
{
AddEffects( EF_DIMLIGHT );
EmitSound( "HL2Player.FlashlightOn" );
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void CHL2MP_Player::FlashlightTurnOff( void )
{
RemoveEffects( EF_DIMLIGHT );
if( IsAlive() )
{
EmitSound( "HL2Player.FlashlightOff" );
}
}
void CHL2MP_Player::Weapon_Drop( CBaseCombatWeapon *pWeapon, const Vector *pvecTarget, const Vector *pVelocity )
{
//Drop a grenade if it's primed.
if ( GetActiveWeapon() )
{
CBaseCombatWeapon *pGrenade = Weapon_OwnsThisType("weapon_frag");
if ( GetActiveWeapon() == pGrenade )
{
if ( ( m_nButtons & IN_ATTACK ) || (m_nButtons & IN_ATTACK2) )
{
DropPrimedFragGrenade( this, pGrenade );
return;
}
}
}
BaseClass::Weapon_Drop( pWeapon, pvecTarget, pVelocity );
}
void CHL2MP_Player::DetonateTripmines( void )
{
CBaseEntity *pEntity = NULL;
while ((pEntity = gEntList.FindEntityByClassname( pEntity, "npc_satchel" )) != NULL)
{
CSatchelCharge *pSatchel = dynamic_cast<CSatchelCharge *>(pEntity);
if (pSatchel->m_bIsLive && pSatchel->GetThrower() == this )
{
g_EventQueue.AddEvent( pSatchel, "Explode", 0.20, this, this );
}
}
// Play sound for pressing the detonator
EmitSound( "Weapon_SLAM.SatchelDetonate" );
}
void CHL2MP_Player::Event_Killed( const CTakeDamageInfo &info )
{
//update damage info with our accumulated physics force
CTakeDamageInfo subinfo = info;
subinfo.SetDamageForce( m_vecTotalBulletForce );
SetNumAnimOverlays( 0 );
// Note: since we're dead, it won't draw us on the client, but we don't set EF_NODRAW
// because we still want to transmit to the clients in our PVS.
CreateRagdollEntity();
DetonateTripmines();
BaseClass::Event_Killed( subinfo );
if ( info.GetDamageType() & DMG_DISSOLVE )
{
if ( m_hRagdoll )
{
m_hRagdoll->GetBaseAnimating()->Dissolve( NULL, gpGlobals->curtime, false, ENTITY_DISSOLVE_NORMAL );
}
}
CBaseEntity *pAttacker = info.GetAttacker();
if ( pAttacker )
{
int iScoreToAdd = 1;
if ( pAttacker == this )
{
iScoreToAdd = -1;
}
GetGlobalTeam( pAttacker->GetTeamNumber() )->AddScore( iScoreToAdd );
}
FlashlightTurnOff();
m_lifeState = LIFE_DEAD;
RemoveEffects( EF_NODRAW ); // still draw player body
StopZooming();
}
int CHL2MP_Player::OnTakeDamage( const CTakeDamageInfo &inputInfo )
{
//return here if the player is in the respawn grace period vs. slams.
if ( gpGlobals->curtime < m_flSlamProtectTime && (inputInfo.GetDamageType() == DMG_BLAST ) )
return 0;
m_vecTotalBulletForce += inputInfo.GetDamageForce();
gamestats->Event_PlayerDamage( this, inputInfo );
return BaseClass::OnTakeDamage( inputInfo );
}
void CHL2MP_Player::DeathSound( const CTakeDamageInfo &info )
{
if ( m_hRagdoll && m_hRagdoll->GetBaseAnimating()->IsDissolving() )
return;
char szStepSound[128];
Q_snprintf( szStepSound, sizeof( szStepSound ), "%s.Die", GetPlayerModelSoundPrefix() );
const char *pModelName = STRING( GetModelName() );
CSoundParameters params;
if ( GetParametersForSound( szStepSound, params, pModelName ) == false )
return;
Vector vecOrigin = GetAbsOrigin();
CRecipientFilter filter;
filter.AddRecipientsByPAS( vecOrigin );
EmitSound_t ep;
ep.m_nChannel = params.channel;
ep.m_pSoundName = params.soundname;
ep.m_flVolume = params.volume;
ep.m_SoundLevel = params.soundlevel;
ep.m_nFlags = 0;
ep.m_nPitch = params.pitch;
ep.m_pOrigin = &vecOrigin;
EmitSound( filter, entindex(), ep );
}
CBaseEntity* CHL2MP_Player::EntSelectSpawnPoint( void )
{
CBaseEntity *pSpot = NULL;
CBaseEntity *pLastSpawnPoint = g_pLastSpawn;
edict_t *player = edict();
const char *pSpawnpointName = "info_player_deathmatch";
if ( HL2MPRules()->IsTeamplay() == true )
{
if ( GetTeamNumber() == TEAM_COMBINE )
{
pSpawnpointName = "info_player_combine";
pLastSpawnPoint = g_pLastCombineSpawn;
}
else if ( GetTeamNumber() == TEAM_REBELS )
{
pSpawnpointName = "info_player_rebel";
pLastSpawnPoint = g_pLastRebelSpawn;
}
if ( gEntList.FindEntityByClassname( NULL, pSpawnpointName ) == NULL )
{
pSpawnpointName = "info_player_deathmatch";
pLastSpawnPoint = g_pLastSpawn;
}
}
pSpot = pLastSpawnPoint;
// Randomize the start spot
for ( int i = random->RandomInt(1,5); i > 0; i-- )
pSpot = gEntList.FindEntityByClassname( pSpot, pSpawnpointName );
if ( !pSpot ) // skip over the null point
pSpot = gEntList.FindEntityByClassname( pSpot, pSpawnpointName );
CBaseEntity *pFirstSpot = pSpot;
do
{
if ( pSpot )
{
// check if pSpot is valid
if ( g_pGameRules->IsSpawnPointValid( pSpot, this ) )
{
if ( pSpot->GetLocalOrigin() == vec3_origin )
{
pSpot = gEntList.FindEntityByClassname( pSpot, pSpawnpointName );
continue;
}
// if so, go to pSpot
goto ReturnSpot;
}
}
// increment pSpot
pSpot = gEntList.FindEntityByClassname( pSpot, pSpawnpointName );
} while ( pSpot != pFirstSpot ); // loop if we're not back to the start
// we haven't found a place to spawn yet, so kill any guy at the first spawn point and spawn there
if ( pSpot )
{
CBaseEntity *ent = NULL;
for ( CEntitySphereQuery sphere( pSpot->GetAbsOrigin(), 128 ); (ent = sphere.GetCurrentEntity()) != NULL; sphere.NextEntity() )
{
// if ent is a client, kill em (unless they are ourselves)
if ( ent->IsPlayer() && !(ent->edict() == player) )
ent->TakeDamage( CTakeDamageInfo( GetContainingEntity(INDEXENT(0)), GetContainingEntity(INDEXENT(0)), 300, DMG_GENERIC ) );
}
goto ReturnSpot;
}
if ( !pSpot )
{
pSpot = gEntList.FindEntityByClassname( pSpot, "info_player_start" );
if ( pSpot )
goto ReturnSpot;
}
ReturnSpot:
if ( HL2MPRules()->IsTeamplay() == true )
{
if ( GetTeamNumber() == TEAM_COMBINE )
{
g_pLastCombineSpawn = pSpot;
}
else if ( GetTeamNumber() == TEAM_REBELS )
{
g_pLastRebelSpawn = pSpot;
}
}
g_pLastSpawn = pSpot;
m_flSlamProtectTime = gpGlobals->curtime + 0.5;
return pSpot;
}
CON_COMMAND( timeleft, "prints the time remaining in the match" )
{
CHL2MP_Player *pPlayer = ToHL2MPPlayer( UTIL_GetCommandClient() );
int iTimeRemaining = (int)HL2MPRules()->GetMapRemainingTime();
if ( iTimeRemaining == 0 )
{
if ( pPlayer )
{
ClientPrint( pPlayer, HUD_PRINTTALK, "This game has no timelimit." );
}
else
{
Msg( "* No Time Limit *\n" );
}
}
else
{
int iMinutes, iSeconds;
iMinutes = iTimeRemaining / 60;
iSeconds = iTimeRemaining % 60;
char minutes[8];
char seconds[8];
Q_snprintf( minutes, sizeof(minutes), "%d", iMinutes );
Q_snprintf( seconds, sizeof(seconds), "%2.2d", iSeconds );
if ( pPlayer )
{
ClientPrint( pPlayer, HUD_PRINTTALK, "Time left in map: %s1:%s2", minutes, seconds );
}
else
{
Msg( "Time Remaining: %s:%s\n", minutes, seconds );
}
}
}
void CHL2MP_Player::Reset()
{
ResetDeathCount();
ResetFragCount();
}
bool CHL2MP_Player::IsReady()
{
return m_bReady;
}
void CHL2MP_Player::SetReady( bool bReady )
{
m_bReady = bReady;
}
void CHL2MP_Player::CheckChatText( char *p, int bufsize )
{
//Look for escape sequences and replace
char *buf = new char[bufsize];
int pos = 0;
// Parse say text for escape sequences
for ( char *pSrc = p; pSrc != NULL && *pSrc != 0 && pos < bufsize-1; pSrc++ )
{
// copy each char across
buf[pos] = *pSrc;
pos++;
}
buf[pos] = '\0';
// copy buf back into p
Q_strncpy( p, buf, bufsize );
delete[] buf;
const char *pReadyCheck = p;
HL2MPRules()->CheckChatForReadySignal( this, pReadyCheck );
}
void CHL2MP_Player::State_Transition( HL2MPPlayerState newState )
{
State_Leave();
State_Enter( newState );
}
void CHL2MP_Player::State_Enter( HL2MPPlayerState newState )
{
m_iPlayerState = newState;
m_pCurStateInfo = State_LookupInfo( newState );
// Initialize the new state.
if ( m_pCurStateInfo && m_pCurStateInfo->pfnEnterState )
(this->*m_pCurStateInfo->pfnEnterState)();
}
void CHL2MP_Player::State_Leave()
{
if ( m_pCurStateInfo && m_pCurStateInfo->pfnLeaveState )
{
(this->*m_pCurStateInfo->pfnLeaveState)();
}
}
void CHL2MP_Player::State_PreThink()
{
if ( m_pCurStateInfo && m_pCurStateInfo->pfnPreThink )
{
(this->*m_pCurStateInfo->pfnPreThink)();
}
}
CHL2MPPlayerStateInfo *CHL2MP_Player::State_LookupInfo( HL2MPPlayerState state )
{
// This table MUST match the
static CHL2MPPlayerStateInfo playerStateInfos[] =
{
{ STATE_ACTIVE, "STATE_ACTIVE", &CHL2MP_Player::State_Enter_ACTIVE, NULL, &CHL2MP_Player::State_PreThink_ACTIVE },
{ STATE_OBSERVER_MODE, "STATE_OBSERVER_MODE", &CHL2MP_Player::State_Enter_OBSERVER_MODE, NULL, &CHL2MP_Player::State_PreThink_OBSERVER_MODE }
};
for ( int i=0; i < ARRAYSIZE( playerStateInfos ); i++ )
{
if ( playerStateInfos[i].m_iPlayerState == state )
return &playerStateInfos[i];
}
return NULL;
}
bool CHL2MP_Player::StartObserverMode(int mode)
{
//we only want to go into observer mode if the player asked to, not on a death timeout
if ( m_bEnterObserver == true )
{
VPhysicsDestroyObject();
return BaseClass::StartObserverMode( mode );
}
return false;
}
void CHL2MP_Player::StopObserverMode()
{
m_bEnterObserver = false;
BaseClass::StopObserverMode();
}
void CHL2MP_Player::State_Enter_OBSERVER_MODE()
{
int observerMode = m_iObserverLastMode;
if ( IsNetClient() )
{
const char *pIdealMode = engine->GetClientConVarValue( engine->IndexOfEdict( edict() ), "cl_spec_mode" );
if ( pIdealMode )
{
observerMode = atoi( pIdealMode );
if ( observerMode <= OBS_MODE_FIXED || observerMode > OBS_MODE_ROAMING )
{
observerMode = m_iObserverLastMode;
}
}
}
m_bEnterObserver = true;
StartObserverMode( observerMode );
}
void CHL2MP_Player::State_PreThink_OBSERVER_MODE()
{
// Make sure nobody has changed any of our state.
// Assert( GetMoveType() == MOVETYPE_FLY );
Assert( m_takedamage == DAMAGE_NO );
Assert( IsSolidFlagSet( FSOLID_NOT_SOLID ) );
// Assert( IsEffectActive( EF_NODRAW ) );
// Must be dead.
Assert( m_lifeState == LIFE_DEAD );
Assert( pl.deadflag );
}
void CHL2MP_Player::State_Enter_ACTIVE()
{
SetMoveType( MOVETYPE_WALK );
// md 8/15/07 - They'll get set back to solid when they actually respawn. If we set them solid now and mp_forcerespawn
// is false, then they'll be spectating but blocking live players from moving.
// RemoveSolidFlags( FSOLID_NOT_SOLID );
m_Local.m_iHideHUD = 0;
}
void CHL2MP_Player::State_PreThink_ACTIVE()
{
//we don't really need to do anything here.
//This state_prethink structure came over from CS:S and was doing an assert check that fails the way hl2dm handles death
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool CHL2MP_Player::CanHearAndReadChatFrom( CBasePlayer *pPlayer )
{
// can always hear the console unless we're ignoring all chat
if ( !pPlayer )
return false;
return true;
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2018 Red Hat Inc., Durham, North Carolina.
* All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Authors:
* Jan Černý <[email protected]>
*/
#ifndef OPENSCAP_TEXTFILECONTENT54_PROBE_H
#define OPENSCAP_TEXTFILECONTENT54_PROBE_H
#include "probe-api.h"
int textfilecontent54_probe_offline_mode_supported(void);
int textfilecontent54_probe_main(probe_ctx *ctx, void *arg);
#endif /* OPENSCAP_TEXTFILECONTENT54_PROBE_H */
| {
"pile_set_name": "Github"
} |
// ---------------------------------------------------------------------
//
// Copyright (C) 2013 - 2018 by the deal.II authors
//
// This file is part of the deal.II library.
//
// The deal.II library is free software; you can use it, redistribute
// it, and/or modify it under the terms of the GNU Lesser General
// Public License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// The full text of the license can be found in the file LICENSE.md at
// the top level directory of deal.II.
//
// ---------------------------------------------------------------------
#include <deal.II/base/point.h>
#include <deal.II/base/tensor.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_out.h>
#include <deal.II/grid/grid_tools.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
#include <iostream>
#include "../tests.h"
// As sketched in the deal.II docs, the parallelepiped class is just a
// hyper_rectangle in 1d and a parallelogram in 2d. That can checked
// by simple comparison to a reference triangulation.
// Here is the implementation in 1d:
void
check_1d_parallelepiped_by_comparison(bool log)
{
// Data structure defining dim coordinates that make up a
// parallelepiped.
Point<1>(corners)[1];
corners[0] = Point<1>(0.5);
Triangulation<1> triangulation_parallelepiped;
GridGenerator::parallelepiped(triangulation_parallelepiped, corners, false);
Triangulation<1> triangulation_cube;
GridGenerator::hyper_cube(triangulation_cube, 0., 0.5);
if (log)
{
std::ostream &logfile = deallog.get_file_stream();
logfile << "\ncheck 1d parallelepiped (hyper_cube): ";
if (GridTools::have_same_coarse_mesh(triangulation_parallelepiped,
triangulation_cube))
logfile << "OK";
else
logfile
<< "not OK... coarse grids are different but they should be the same";
}
}
// Here is the implementation in 2d:
void
check_2d_parallelepiped_by_comparison(bool log)
{
// build corners for this particular dim that are known to give the
// same output order as parallelogram:
Point<2>(corners)[2];
corners[0] = Point<2>(0.5, 0.0);
corners[1] = Point<2>(0.0, 0.5);
Triangulation<2> triangulation_parallelepiped;
GridGenerator::parallelepiped(triangulation_parallelepiped, corners, false);
Triangulation<2> triangulation_parallelogram;
GridGenerator::parallelogram(triangulation_parallelogram, corners, false);
if (log)
{
std::ostream &logfile = deallog.get_file_stream();
logfile << "\ncheck 2d parallelepiped (parallelogram): ";
if (GridTools::have_same_coarse_mesh(triangulation_parallelepiped,
triangulation_parallelogram))
logfile << "OK";
else
logfile
<< "not OK... coarse grids are different but they should be the same";
}
}
int
main()
{
initlog();
// Check parallelepiped
check_1d_parallelepiped_by_comparison(true);
check_2d_parallelepiped_by_comparison(true);
deallog.get_file_stream() << "\n";
}
| {
"pile_set_name": "Github"
} |
Copyright (C) 2008-12, Michal Perdoch
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the
distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: 00feaf55af2487d44a72c94cda8b4884
timeCreated: 1548368541
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
export class LoginEntity {
login : string;
password : string;
public constructor() {
this.login = '';
this.password = '';
}
}
| {
"pile_set_name": "Github"
} |
# -*- coding: utf-8 -*-
#
# This file is part of NINJA-IDE (http://ninja-ide.org).
#
# NINJA-IDE is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# any later version.
#
# NINJA-IDE is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with NINJA-IDE; If not, see <http://www.gnu.org/licenses/>.
from PyQt4.QtGui import QFrame
from PyQt4.QtGui import QPainter
from PyQt4.QtGui import QPen
from PyQt4.QtGui import QColor
from PyQt4.QtGui import QBrush
from PyQt4.QtCore import QPropertyAnimation
from PyQt4.QtGui import QGraphicsOpacityEffect
from PyQt4.QtCore import Qt
from PyQt4.Qsci import QsciScintilla
from ninja_ide.core import settings
from ninja_ide import resources
ACTIVATE_OPACITY = True if not settings.IS_MAC_OS else False
class MiniMap(QsciScintilla):
def __init__(self, editor):
super(MiniMap, self).__init__(editor)
self._editor = editor
self.SendScintilla(QsciScintilla.SCI_SETCARETSTYLE, 0)
self.SendScintilla(QsciScintilla.SCI_SETBUFFEREDDRAW, 0)
self.SendScintilla(QsciScintilla.SCI_SETHSCROLLBAR, 0)
self.SendScintilla(QsciScintilla.SCI_SETVSCROLLBAR, 0)
self.SendScintilla(QsciScintilla.SCI_SETZOOM, -10)
self.SendScintilla(QsciScintilla.SCI_SETREADONLY, 1)
self.SendScintilla(QsciScintilla.SCI_HIDESELECTION, 1)
self.SendScintilla(QsciScintilla.SCI_SETCURSOR, 8)
# Hide markers
for i in range(1, 5):
self.SendScintilla(
QsciScintilla.SCI_MARKERDEFINE, i, QsciScintilla.SC_MARK_EMPTY)
self.SendScintilla(QsciScintilla.SCI_SETMARGINWIDTHN, 1, 0)
self.setMouseTracking(True)
if ACTIVATE_OPACITY:
self.goe = QGraphicsOpacityEffect()
self.setGraphicsEffect(self.goe)
self.goe.setOpacity(settings.MINIMAP_MIN_OPACITY)
self.animation = QPropertyAnimation(self.goe, "opacity")
self.animation.setDuration(300)
self.slider = SliderArea(self)
self.slider.show()
def adjust_to_parent(self):
self.setFixedHeight(self._editor.height())
self.setFixedWidth(self._editor.width() * settings.SIZE_PROPORTION)
x = self._editor.width() - self.width()
self.move(x, 0)
self.slider.update_position()
def shutdown(self):
self._editor.SCN_UPDATEUI.disconnect()
self._editor.SCN_ZOOM.disconnect()
def fold(self, line):
self.foldLine(line)
def scroll_map(self):
first_visible_line = self._editor.SendScintilla(
QsciScintilla.SCI_GETFIRSTVISIBLELINE)
num_doc_lines = self._editor.SendScintilla(
QsciScintilla.SCI_GETLINECOUNT)
num_visible_lines = self._editor.SendScintilla(
QsciScintilla.SCI_DOCLINEFROMVISIBLE, num_doc_lines)
lines_on_screen = self._editor.SendScintilla(
QsciScintilla.SCI_LINESONSCREEN)
if num_visible_lines > lines_on_screen:
last_top_visible_line = num_visible_lines - lines_on_screen
num_map_visible_lines = self.SendScintilla(
QsciScintilla.SCI_DOCLINEFROMVISIBLE, num_doc_lines)
# Lines on screen map
lines_on_screenm = self.SendScintilla(
QsciScintilla.SCI_LINESONSCREEN)
# Last top visible line on map
last_top_visible_linem = num_map_visible_lines - lines_on_screenm
# Portion covered
portion = first_visible_line / last_top_visible_line
first_visible_linem = round(last_top_visible_linem * portion)
# Scroll
self.verticalScrollBar().setValue(first_visible_linem)
# Move slider
higher_pos = self._editor.SendScintilla(
QsciScintilla.SCI_POSITIONFROMPOINT, 0, 0)
y = self.SendScintilla(
QsciScintilla.SCI_POINTYFROMPOSITION, 0, higher_pos)
self.slider.move(0, y)
self._current_scroll_value = self._editor.verticalScrollBar().value()
def scroll_area(self, pos_parent, line_area):
line = self.__line_from_position(pos_parent)
self._editor.verticalScrollBar().setValue(line - line_area)
def mousePressEvent(self, event):
super(MiniMap, self).mousePressEvent(event)
line = self.__line_from_position(event.pos())
self._editor.jump_to_line(line)
# Go to center
los = self._editor.SendScintilla(QsciScintilla.SCI_LINESONSCREEN) / 2
scroll_value = self._editor.verticalScrollBar().value()
if self._current_scroll_value < scroll_value:
self._editor.verticalScrollBar().setValue(scroll_value + los)
else:
self._editor.verticalScrollBar().setValue(scroll_value - los)
def __line_from_position(self, point):
position = self.SendScintilla(QsciScintilla.SCI_POSITIONFROMPOINT,
point.x(), point.y())
return self.SendScintilla(QsciScintilla.SCI_LINEFROMPOSITION, position)
def enterEvent(self, event):
if ACTIVATE_OPACITY:
self.animation.setStartValue(settings.MINIMAP_MIN_OPACITY)
self.animation.setEndValue(settings.MINIMAP_MAX_OPACITY)
self.animation.start()
def leaveEvent(self, event):
if ACTIVATE_OPACITY:
self.animation.setStartValue(settings.MINIMAP_MAX_OPACITY)
self.animation.setEndValue(settings.MINIMAP_MIN_OPACITY)
self.animation.start()
def wheelEvent(self, event):
super(MiniMap, self).wheelEvent(event)
self._editor.wheelEvent(event)
def resizeEvent(self, event):
super(MiniMap, self).resizeEvent(event)
self.slider.update_position()
class SliderArea(QFrame):
def __init__(self, minimap):
super(SliderArea, self).__init__(minimap)
self._minimap = minimap
self.pressed = False
self.setMouseTracking(True)
self.setCursor(Qt.OpenHandCursor)
color = resources.CUSTOM_SCHEME.get(
'MinimapVisibleArea', resources.COLOR_SCHEME['MinimapVisibleArea'])
if ACTIVATE_OPACITY:
self.setStyleSheet("background: %s;" % color)
self.goe = QGraphicsOpacityEffect()
self.setGraphicsEffect(self.goe)
self.goe.setOpacity(settings.MINIMAP_MAX_OPACITY / 2)
else:
self.setStyleSheet("background: transparent;")
def mousePressEvent(self, event):
super(SliderArea, self).mousePressEvent(event)
self.pressed = True
self.setCursor(Qt.ClosedHandCursor)
# Get line number from lines on screen
# This is to moving the slider from the point where you clicked
first_visible_line = self._minimap._editor.SendScintilla(
QsciScintilla.SCI_GETFIRSTVISIBLELINE)
pos_parent = self.mapToParent(event.pos())
position = self._minimap.SendScintilla(
QsciScintilla.SCI_POSITIONFROMPOINT, pos_parent.x(), pos_parent.y())
line = self._minimap.SendScintilla(
QsciScintilla.SCI_LINEFROMPOSITION, position)
self.line_on_visible_area = (line - first_visible_line) + 1
def mouseReleaseEvent(self, event):
super(SliderArea, self).mouseReleaseEvent(event)
self.pressed = False
self.setCursor(Qt.OpenHandCursor)
def update_position(self):
font_size = round(self._minimap.font().pointSize() / 2.5)
lines_count = self._minimap._editor.SendScintilla(
QsciScintilla.SCI_LINESONSCREEN)
height = lines_count * font_size
self.setFixedHeight(height)
self.setFixedWidth(self._minimap.width())
def paintEvent(self, event):
"""Paint over the widget to overlay its content."""
if not ACTIVATE_OPACITY:
painter = QPainter()
painter.begin(self)
painter.setRenderHint(QPainter.TextAntialiasing, True)
painter.setRenderHint(QPainter.Antialiasing, True)
painter.fillRect(event.rect(), QBrush(
QColor(226, 0, 0, 80)))
painter.setPen(QPen(Qt.NoPen))
painter.end()
super(SliderArea, self).paintEvent(event)
def mouseMoveEvent(self, event):
super(SliderArea, self).mouseMoveEvent(event)
if self.pressed:
pos = self.mapToParent(event.pos())
self._minimap.scroll_area(pos, self.line_on_visible_area)
| {
"pile_set_name": "Github"
} |
/****************************************************************************
* arch/mips/src/common/mips_interruptcontext.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <[email protected]>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdbool.h>
#include <nuttx/arch.h>
#include <nuttx/irq.h>
#include "mips_internal.h"
/****************************************************************************
* Private Types
****************************************************************************/
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: up_interrupt_context
*
* Description: Return true is we are currently executing in
* the interrupt handler context.
****************************************************************************/
bool up_interrupt_context(void)
{
return CURRENT_REGS != NULL;
}
| {
"pile_set_name": "Github"
} |
import Ionicons from './build/Ionicons';
export default Ionicons;
| {
"pile_set_name": "Github"
} |
# https://github.com/cheshirekow/cmake_format
find_program(
CMAKE_FORMAT_EXE
NAMES cmake-format
PATHS /usr/bin/
PATH_SUFFIXES bin
DOC "cmake formater"
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CMakeFormat DEFAULT_MSG CMAKE_FORMAT_EXE)
mark_as_advanced(CMAKE_FORMAT_EXE)
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: 77a72946dababd840806f46d1679e85b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
{
"http_interactions": [
{
"recorded_at": "2016-11-27T23:24:36",
"request": {
"body": {
"encoding": "utf-8",
"string": ""
},
"headers": {
"Accept": "*/*",
"Accept-Encoding": "identity",
"Authorization": "Basic Tm9uZTpOb25l",
"Connection": "keep-alive",
"PRIVATE-TOKEN": "<PRIVATE_KEY_GITLAB>",
"User-Agent": "python-requests/2.10.0"
},
"method": "GET",
"uri": "https://gitlab.com/api/v3/user"
},
"response": {
"body": {
"encoding": null,
"string": "{\"name\":\"Guyzmo\",\"username\":\"<GITLAB_NAMESPACE>\",\"id\":459552,\"state\":\"active\",\"avatar_url\":\"https://secure.gravatar.com/avatar/917dc55c63895af9953df7d798cdd5f8?s=80&d=identicon\",\"web_url\":\"https://gitlab.com/<GITLAB_NAMESPACE>\",\"created_at\":\"2016-03-21T12:52:59.859Z\",\"is_admin\":false,\"bio\":\": :(){ :|:& };:\",\"location\":\"Earth, Solar system, Milkyway, Universe\",\"skype\":\"\",\"linkedin\":\"\",\"twitter\":\"\",\"website_url\":\"http://i.got.nothing.to/blog\",\"organization\":null,\"last_sign_in_at\":\"2016-11-05T15:04:27.341Z\",\"confirmed_at\":\"2016-03-21T13:48:05.234Z\",\"email\":\"<GITLAB_NAMESPACE>[email protected]\",\"theme_id\":4,\"color_scheme_id\":4,\"projects_limit\":100000,\"current_sign_in_at\":\"2016-11-25T02:04:59.533Z\",\"identities\":[],\"can_create_group\":true,\"can_create_project\":true,\"two_factor_enabled\":false,\"external\":false}"
},
"headers": {
"Cache-Control": "max-age=0, private, must-revalidate",
"Content-Length": "775",
"Content-Type": "application/json",
"Date": "Sun, 27 Nov 2016 23:24:36 GMT",
"Etag": "W/\"757252f72cad7c2cbb99b765d65cc424\"",
"Server": "nginx",
"Vary": "Origin",
"X-Request-Id": "3f6fd065-9b51-4c01-9501-8e811aa80ce1",
"X-Runtime": "0.040289"
},
"status": {
"code": 200,
"message": "OK"
},
"url": "https://gitlab.com/api/v3/user"
}
},
{
"recorded_at": "2016-11-27T23:24:36",
"request": {
"body": {
"encoding": "utf-8",
"string": ""
},
"headers": {
"Accept": "*/*",
"Accept-Encoding": "identity",
"Authorization": "Basic Tm9uZTpOb25l",
"Connection": "keep-alive",
"PRIVATE-TOKEN": "<PRIVATE_KEY_GITLAB>",
"User-Agent": "python-requests/2.10.0"
},
"method": "GET",
"uri": "https://gitlab.com/api/v3/projects/git-repo-test%2Fgit-repo"
},
"response": {
"body": {
"encoding": null,
"string": "{\"id\":1848932,\"description\":null,\"default_branch\":null,\"tag_list\":[],\"public\":false,\"archived\":false,\"visibility_level\":0,\"ssh_url_to_repo\":\"[email protected]:git-repo-test/git-repo.git\",\"http_url_to_repo\":\"https://gitlab.com/git-repo-test/git-repo.git\",\"web_url\":\"https://gitlab.com/git-repo-test/git-repo\",\"name\":\"git-repo\",\"name_with_namespace\":\"git-repo-test / git-repo\",\"path\":\"git-repo\",\"path_with_namespace\":\"git-repo-test/git-repo\",\"container_registry_enabled\":true,\"issues_enabled\":true,\"merge_requests_enabled\":true,\"wiki_enabled\":true,\"builds_enabled\":true,\"snippets_enabled\":true,\"created_at\":\"2016-10-15T20:46:59.928Z\",\"last_activity_at\":\"2016-11-27T23:15:41.019Z\",\"shared_runners_enabled\":true,\"lfs_enabled\":true,\"creator_id\":459552,\"namespace\":{\"id\":938543,\"name\":\"git-repo-test\",\"path\":\"git-repo-test\",\"owner_id\":null,\"created_at\":\"2016-10-15T20:32:52.148Z\",\"updated_at\":\"2016-10-15T20:32:52.148Z\",\"description\":\"\",\"avatar\":{\"url\":null},\"membership_lock\":false,\"share_with_group_lock\":false,\"visibility_level\":20,\"request_access_enabled\":true,\"ldap_sync_status\":\"ready\",\"ldap_sync_error\":null,\"ldap_sync_last_update_at\":null,\"ldap_sync_last_successful_update_at\":null,\"ldap_sync_last_sync_at\":null,\"deleted_at\":null,\"lfs_enabled\":null,\"repository_size_limit\":null},\"avatar_url\":null,\"star_count\":0,\"forks_count\":0,\"open_issues_count\":0,\"runners_token\":\"-vyTKYjbGYAP8GA3zDfz\",\"public_builds\":true,\"shared_with_groups\":[],\"only_allow_merge_if_build_succeeds\":false,\"request_access_enabled\":true,\"only_allow_merge_if_all_discussions_are_resolved\":null,\"approvals_before_merge\":0,\"permissions\":{\"project_access\":null,\"group_access\":{\"access_level\":50,\"notification_level\":3}}}"
},
"headers": {
"Cache-Control": "max-age=0, private, must-revalidate",
"Content-Length": "1685",
"Content-Type": "application/json",
"Date": "Sun, 27 Nov 2016 23:24:36 GMT",
"Etag": "W/\"84e604b8c9a6fd763bbef4d5b5376541\"",
"Server": "nginx",
"Vary": "Origin",
"X-Request-Id": "675a130b-4f94-42ef-80e3-43b34c07f116",
"X-Runtime": "0.103667"
},
"status": {
"code": 200,
"message": "OK"
},
"url": "https://gitlab.com/api/v3/projects/git-repo-test%2Fgit-repo"
}
},
{
"recorded_at": "2016-11-27T23:24:36",
"request": {
"body": {
"encoding": "utf-8",
"string": ""
},
"headers": {
"Accept": "*/*",
"Accept-Encoding": "identity",
"Authorization": "Basic Tm9uZTpOb25l",
"Connection": "keep-alive",
"PRIVATE-TOKEN": "<PRIVATE_KEY_GITLAB>",
"User-Agent": "python-requests/2.10.0"
},
"method": "GET",
"uri": "https://gitlab.com/api/v3/projects/1848932/merge_requests?project_id=1848932"
},
"response": {
"body": {
"encoding": null,
"string": "[{\"id\":1312801,\"iid\":1,\"project_id\":1848932,\"title\":\"Adding gitlab gists and requests feature\",\"description\":null,\"state\":\"opened\",\"created_at\":\"2016-11-27T23:15:40.809Z\",\"updated_at\":\"2016-11-27T23:15:40.809Z\",\"target_branch\":\"master\",\"source_branch\":\"features/gitlab-gists-requests\",\"upvotes\":0,\"downvotes\":0,\"author\":{\"name\":\"Guyzmo\",\"username\":\"<GITLAB_NAMESPACE>\",\"id\":459552,\"state\":\"active\",\"avatar_url\":\"https://secure.gravatar.com/avatar/917dc55c63895af9953df7d798cdd5f8?s=80\\u0026d=identicon\",\"web_url\":\"https://gitlab.com/<GITLAB_NAMESPACE>\"},\"assignee\":null,\"source_project_id\":1848932,\"target_project_id\":1848932,\"labels\":[],\"work_in_progress\":false,\"milestone\":null,\"merge_when_build_succeeds\":false,\"merge_status\":\"unchecked\",\"sha\":null,\"merge_commit_sha\":null,\"subscribed\":true,\"user_notes_count\":0,\"approvals_before_merge\":null,\"should_remove_source_branch\":null,\"force_remove_source_branch\":null,\"web_url\":\"https://gitlab.com/git-repo-test/git-repo/merge_requests/1\"}]"
},
"headers": {
"Cache-Control": "max-age=0, private, must-revalidate",
"Content-Length": "962",
"Content-Type": "application/json",
"Date": "Sun, 27 Nov 2016 23:24:36 GMT",
"Etag": "W/\"bcf79763bb9afe38fa490c987521049c\"",
"Link": "<https://gitlab.com/api/v3/projects/1848932/merge_requests?id=1848932&order_by=created_at&page=1&per_page=20&project_id=1848932&sort=desc&state=all>; rel=\"first\", <https://gitlab.com/api/v3/projects/1848932/merge_requests?id=1848932&order_by=created_at&page=1&per_page=20&project_id=1848932&sort=desc&state=all>; rel=\"last\"",
"Server": "nginx",
"Vary": "Origin",
"X-Next-Page": "",
"X-Page": "1",
"X-Per-Page": "20",
"X-Prev-Page": "",
"X-Request-Id": "f82ed847-135f-4b50-a4bf-2e554f627102",
"X-Runtime": "0.207915",
"X-Total": "1",
"X-Total-Pages": "1"
},
"status": {
"code": 200,
"message": "OK"
},
"url": "https://gitlab.com/api/v3/projects/1848932/merge_requests?project_id=1848932"
}
}
],
"recorded_with": "betamax/0.5.1"
} | {
"pile_set_name": "Github"
} |
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import <Notes/ICNFIMAPResponse.h>
@class NSSet;
@interface ICNFIMAPFlagsResponse : ICNFIMAPResponse
{
NSSet *_flags;
}
+ (BOOL)handlesResponseWithName:(const char *)arg1 ofLength:(unsigned long long)arg2;
- (void).cxx_destruct;
@property(copy, nonatomic) NSSet *flags; // @synthesize flags=_flags;
- (id)description;
@end
| {
"pile_set_name": "Github"
} |
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
| {
"pile_set_name": "Github"
} |
# $NetBSD: Makefile,v 1.26 2020/09/03 07:29:46 bsiegert Exp $
DISTNAME= mapstructure-0.0.20160212
PKGNAME= go-${DISTNAME}
PKGREVISION= 22
MASTER_SITES= ${MASTER_SITE_GITHUB:=mitchellh/}
CATEGORIES= devel
GITHUB_TAG= d2dd0262208475919e1a362f675cfc0e7c10e905
GITHUB_PROJECT= ${PKGBASE:S/^go-//}
MAINTAINER= [email protected]
HOMEPAGE= https://github.com/mitchellh/mapstructure
COMMENT= Library for decoding generic map values into native structures
LICENSE= mit
GO_DIST_BASE= ${GITHUB_PROJECT}-${GITHUB_TAG}
GO_SRCPATH= github.com/mitchellh/mapstructure
.include "../../lang/go/go-package.mk"
.include "../../mk/bsd.pkg.mk"
| {
"pile_set_name": "Github"
} |
# Merely Kay
# A Fluxbox theme by: skypher of perplexity
# 2001
# (Not created from scratch, basicly a modification of "Simple Elegance"
# by Pax, thanks!)
# update: added *.tab.* stuff to make fluxbox look real cool :)
toolbar: Raised Gradient Vertical
toolbar.color: rgb:62/70/85
toolbar.colorTo: rgb:56/66/75
toolbar.button: Raised Gradient Horizontal Interlaced
toolbar.button.color: rgb:62/70/85
toolbar.button.colorTo: rgb:56/66/75
toolbar.button.picColor: rgb:FF/FF/FF
toolbar.button.pressed: Sunken Gradient Horizontal
toolbar.button.pressed.color: rgb:42/50/65
toolbar.button.pressed.colorTo: rgb:36/46/55
toolbar.clock: Sunken Gradient Vertical Interlaced
toolbar.clock.color: rgb:62/70/85
toolbar.clock.colorTo: rgb:56/66/75
toolbar.clock.textColor: rgb:FF/FF/FF
toolbar.label: Sunken Gradient Vertical Interlaced
toolbar.label.color: rgb:62/70/85
toolbar.label.colorTo: rgb:56/66/75
toolbar.label.textColor: rgb:FF/FF/FF
toolbar.windowLabel: Raised Gradient Vertical Interlaced
toolbar.windowLabel.color: rgb:62/70/85
toolbar.windowLabel.colorTo: rgb:56/66/75
toolbar.windowLabel.textColor: rgb:FF/FF/FF
toolbar.justify: center
menu.title: Raised Gradient Horizontal Interlaced
menu.title.color: rgb:62/66/70
menu.title.colorTo: rgb:56/60/68
menu.title.textColor: rgb:E9/E9/E9
menu.title.justify: Center
menu.frame: Sunken Gradient PipeCross
menu.frame.color: rgb:62/70/85
menu.frame.colorTo: rgb:56/66/75
menu.frame.textColor: rgb:E2/E2/E2
menu.frame.justify: Left
menu.hilite: Raised Gradient PipeCross
menu.hilite.color: rgb:50/50/50
menu.hilite.colorTo: rgb:42/42/42
menu.hilite.textColor: rgb:FF/FF/FF
menu.bullet: Triangle
menu.bullet.position: Right
window.title.focus: Raised Gradient Vertical Interlaced
window.title.focus.color: rgb:62/70/85
window.title.focus.colorTo: rgb:56/66/75
window.title.unfocus: Raised Gradient Vertical
window.title.unfocus.color: rgb:60/66/70
window.title.unfocus.colorTo: rgb:54/60/68
window.label.focus: Flat Gradient Vertical Interlaced
window.label.focus.color: rgb:62/70/85
window.label.focus.colorTo: rgb:56/66/75
window.label.focus.textColor: rgb:FF/FF/FF
window.label.unfocus: Flat Gradient Vertical
window.label.unfocus.color: rgb:60/66/70
window.label.unfocus.colorTo: rgb:54/60/68
window.label.unfocus.textColor: rgb:C1/C1/C1
window.button.focus: Raised Gradient Diagonal Bevel1
window.button.focus.color: rgb:9B/9B/9B
window.button.focus.colorTo: rgb:42/42/42
window.button.focus.picColor: rgb:E2/E2/E2
window.button.unfocus: Raised Gradient Diagonal Bevel1
window.button.unfocus.color: rgb:9B/9B/9B
window.button.unfocus.colorTo: rgb:42/42/42
window.button.unfocus.picColor: rgb:C1/C1/C1
window.button.pressed: Sunken Gradient Diagonal Bevel1
window.button.pressed.color: rgb:9B/9B/9B
window.button.pressed.colorTo: rgb:42/42/42
window.frame.focus: Sunken
window.frame.focus.color: rgb:87/99/9F
window.frame.unfocus: Sunken
window.frame.unfocus.color: rgb:87/99/9F
window.handle.focus: Raised Gradient Diagonal
window.handle.focus.color: rgb:62/70/85
window.handle.focus.colorTo: rgb:56/66/75
window.handle.unfocus: Raised Gradient Diagonal
window.handle.unfocus.color: rgb:60/66/70
window.handle.unfocus.colorTo: rgb:54/60/68
window.grip.focus: Raised Gradient Diagonal Interlaced
window.grip.focus.color: rgb:9B/9B/9B
window.grip.focus.colorTo: rgb:42/42/42
window.grip.unfocus: Raised Gradient Diagonal
window.grip.unfocus.color: rgb:9B/9B/9B
window.grip.unfocus.colorTo: rgb:42/42/42
! ----------- tab - explicit for fluxbox, the best wm out there[tm] (;
window.tab.justify: Left
window.tab.label.unfocus: Sunken Gradient Vertical
window.tab.label.unfocus.color: rgb:50/50/50
window.tab.label.unfocus.colorTo: rgb:54/60/68
window.tab.label.unfocus.textColor: rgb:AA/AA/AA
window.tab.label.focus: Raised Gradient Vertical
window.tab.label.focus.color: rgb:62/70/85
window.tab.label.focus.colorTo: rgb:556/66/75
window.tab.label.focus.textColor: #FFFFFF
window.tab.borderWidth: 2
window.tab.borderColor: black
! ----------- (fluxbox.sourceforge.net)
window.justify: Center
window.tab.font: -*-clean-medium-r-*-*-12-*-*-*-*-60-iso8859-*
toolbar.font: -*-lucida-bold-r-*-*-*-100-*-*-*-*-*-*
window.font: -*-helvetica-medium-r-normal-*-12-*-*-*-*-*-iso8859-*
#menu.title.font: -*-lucida-bold-r-*-*-*-100-*-*-*-*-*-*
menu.title.font: -*-lucida-bold-r-*-*-*-100-*-*-*-*-*-*
menu.frame.font: -*-lucida-medium-r-*-*-*-100-*-*-*-*-*-*
borderColor: rgb:00/00/00
bevelWidth: 2
borderWidth: 2
handleWidth: 3
background: mod
background.modX: 5
background.modY: 5
background.color: rgb:52/60/75
background.colorTo: rgb:62/70/85
| {
"pile_set_name": "Github"
} |
# RUN: yaml-bench -canonical %s
# ASCII Art
--- |
\//||\/||
// || ||__
| {
"pile_set_name": "Github"
} |
#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass beamer
\begin_preamble
\usetheme{CambridgeUS}
\beamertemplatenavigationsymbolsempty
% Set Color ==============================
\definecolor{NYUPurple}{RGB}{87,6,140}
\definecolor{LightPurple}{RGB}{165,11,255}
\setbeamercolor{title}{fg=NYUPurple}
%\setbeamercolor{frametitle}{fg=NYUPurple}
\setbeamercolor{frametitle}{fg=NYUPurple}
\setbeamercolor{background canvas}{fg=NYUPurple, bg=white}
\setbeamercolor{background}{fg=black, bg=NYUPurple}
\setbeamercolor{palette primary}{fg=black, bg=gray!30!white}
\setbeamercolor{palette secondary}{fg=black, bg=gray!20!white}
\setbeamercolor{palette tertiary}{fg=gray!20!white, bg=NYUPurple}
\setbeamertemplate{headline}{}
\setbeamercolor{parttitle}{fg=NYUPurple}
\setbeamercolor{sectiontitle}{fg=NYUPurple}
\setbeamercolor{sectionname}{fg=NYUPurple}
\setbeamercolor{section page}{fg=NYUPurple}
\AtBeginSection[]{
\begin{frame}
\vfill
\centering
\setbeamercolor{section title}{fg=NYUPurple}
\begin{beamercolorbox}[sep=8pt,center,shadow=true,rounded=true]{title}
\usebeamerfont{title}\usebeamercolor[fg]{title}\insertsectionhead\par%
\end{beamercolorbox}
\vfill
\end{frame}
}
\end_preamble
\options aspectratio=169,handout
\use_default_options false
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "times" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "eulervm" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref true
\pdf_bookmarks true
\pdf_bookmarksnumbered false
\pdf_bookmarksopen false
\pdf_bookmarksopenlevel 1
\pdf_breaklinks false
\pdf_pdfborder true
\pdf_colorlinks true
\pdf_backref false
\pdf_pdfusetitle true
\pdf_quoted_options "allcolors=NYUPurple,urlcolor=LightPurple"
\papersize default
\use_geometry true
\use_package amsmath 2
\use_package amssymb 2
\use_package cancel 0
\use_package esint 0
\use_package mathdots 0
\use_package mathtools 0
\use_package mhchem 0
\use_package stackrel 0
\use_package stmaryrd 0
\use_package undertilde 0
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 0
\use_minted 0
\boxbgcolor #ff31d8
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 2
\tocdepth 2
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header
\begin_body
\begin_layout Standard
\begin_inset FormulaMacro
\newcommand{\reals}{\mathbf{R}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\integers}{\mathbf{Z}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\naturals}{\mathbf{N}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\rationals}{\mathbf{Q}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\ca}{\mathcal{A}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\cb}{\mathcal{B}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\cc}{\mathcal{C}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\cd}{\mathcal{D}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\ce}{\mathcal{E}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\cf}{\mathcal{F}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\cg}{\mathcal{G}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\ch}{\mathcal{H}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\ci}{\mathcal{I}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\cj}{\mathcal{J}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\ck}{\mathcal{K}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\cl}{\mathcal{L}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\cm}{\mathcal{M}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\cn}{\mathcal{N}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\co}{\mathcal{O}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\cp}{\mathcal{P}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\cq}{\mathcal{Q}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\calr}{\mathcal{R}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\cs}{\mathcal{S}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\ct}{\mathcal{T}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\cu}{\mathcal{U}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\cv}{\mathcal{V}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\cw}{\mathcal{W}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\cx}{\mathcal{X}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\cy}{\mathcal{Y}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\cz}{\mathcal{Z}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\ind}[1]{1(#1)}
\end_inset
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
%
\backslash
newcommand{
\backslash
pr}{P}
\end_layout
\begin_layout Plain Layout
\end_layout
\end_inset
\begin_inset FormulaMacro
\newcommand{\pr}{\mathbb{P}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\predsp}{\cy}
\end_inset
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
%{
\backslash
hat{
\backslash
cy}}
\end_layout
\begin_layout Plain Layout
\end_layout
\end_inset
\begin_inset FormulaMacro
\newcommand{\outsp}{\cy}
\end_inset
\end_layout
\begin_layout Standard
\begin_inset FormulaMacro
\newcommand{\prxy}{P_{\cx\times\cy}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\prx}{P_{\cx}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\prygivenx}{P_{\cy\mid\cx}}
\end_inset
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
%
\backslash
newcommand{
\backslash
ex}{E}
\end_layout
\begin_layout Plain Layout
\end_layout
\end_inset
\begin_inset FormulaMacro
\newcommand{\ex}{\mathbb{E}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\var}{\textrm{Var}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\cov}{\textrm{Cov}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\sgn}{\textrm{sgn}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\sign}{\textrm{sign}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\kl}{\textrm{KL}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\law}{\mathcal{L}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\eps}{\varepsilon}
\end_inset
\begin_inset FormulaMacro
\newcommand{\as}{\textrm{ a.s.}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\io}{\textrm{ i.o.}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\ev}{\textrm{ ev.}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\convd}{\stackrel{d}{\to}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\eqd}{\stackrel{d}{=}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\del}{\nabla}
\end_inset
\begin_inset FormulaMacro
\newcommand{\loss}{\ell}
\end_inset
\begin_inset FormulaMacro
\newcommand{\risk}{R}
\end_inset
\begin_inset FormulaMacro
\newcommand{\emprisk}{\hat{R}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\lossfnl}{L}
\end_inset
\begin_inset FormulaMacro
\newcommand{\emplossfnl}{\hat{L}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\empminimizer}[1]{\hat{#1}^{*}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\minimizer}[1]{#1^{*}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\optimizer}[1]{#1^{*}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\etal}{\textrm{et. al.}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\tr}{\operatorname{tr}}
\end_inset
\end_layout
\begin_layout Standard
\begin_inset FormulaMacro
\newcommand{\trace}{\operatorname{trace}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\diag}{\text{diag}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\rank}{\text{rank}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\linspan}{\text{span}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\spn}{\text{span}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\proj}{\text{Proj}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\argmax}{\operatornamewithlimits{arg\, max}}
{\text{argmax}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\argmin}{\operatornamewithlimits{arg\, min}}
{\text{argmin}}
\end_inset
\end_layout
\begin_layout Standard
\begin_inset FormulaMacro
\newcommand{\bfx}{\mathbf{x}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\bfy}{\mathbf{y}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\bfl}{\mathbf{\lambda}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\bfm}{\mathbf{\mu}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\calL}{\mathcal{L}}
\end_inset
\end_layout
\begin_layout Standard
\begin_inset FormulaMacro
\newcommand{\vw}{\boldsymbol{w}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\vx}{\boldsymbol{x}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\vxi}{\boldsymbol{\xi}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\valpha}{\boldsymbol{\alpha}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\vbeta}{\boldsymbol{\beta}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\vsigma}{\boldsymbol{\sigma}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\vtheta}{\boldsymbol{\theta}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\vd}{\boldsymbol{d}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\vs}{\boldsymbol{s}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\vt}{\boldsymbol{t}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\vh}{\boldsymbol{h}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\ve}{\boldsymbol{e}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\vf}{\boldsymbol{f}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\vg}{\boldsymbol{g}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\vz}{\boldsymbol{z}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\vk}{\boldsymbol{k}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\va}{\boldsymbol{a}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\vb}{\boldsymbol{b}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\vv}{\boldsymbol{v}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\vy}{\boldsymbol{y}}
\end_inset
\end_layout
\begin_layout Standard
\begin_inset FormulaMacro
\newcommand{\dom}{\textrm{\textbf{dom} }}
\end_inset
\begin_inset FormulaMacro
\renewcommand{\rank}{\text{\textbf{rank }}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\conv}{\textrm{\textbf{conv} }}
\end_inset
\begin_inset FormulaMacro
\newcommand{\relint}{\text{\textbf{relint }}}
\end_inset
\begin_inset FormulaMacro
\newcommand{\aff}{\text{\textbf{aff }}}
\end_inset
\end_layout
\begin_layout Standard
\begin_inset FormulaMacro
\newcommand{\hil}{\ch}
\end_inset
\begin_inset FormulaMacro
\newcommand{\rkhs}{\hil}
\end_inset
\begin_inset FormulaMacro
\newcommand{\ber}{\text{Ber}}
\end_inset
\end_layout
\begin_layout Title
Basic Statistics and a Bit of Bootstrap
\begin_inset Argument 1
status open
\begin_layout Plain Layout
DS-GA 1003
\begin_inset Note Note
status open
\begin_layout Plain Layout
optional, use only with long paper titles
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Author
David S.
Rosenberg
\end_layout
\begin_layout Date
April 16, 2019
\end_layout
\begin_layout Institute
CDS, NYU
\end_layout
\begin_layout Standard
\begin_inset Flex ArticleMode
status open
\begin_layout Plain Layout
Just in article version
\end_layout
\end_inset
\end_layout
\begin_layout Standard
\begin_inset Note Note
status open
\begin_layout Plain Layout
TODO: when doing bootstrapping, should we just use
\begin_inset Formula $\alpha\left(\hat{\cd}\right)$
\end_inset
as our point estimate, or should we use
\begin_inset Formula $\frac{1}{B}\sum_{i=1}^{B}\alpha\left(\hat{\cd}^{(B)}\right)$
\end_inset
? How could we decide which is better? We'd need to set up criteria, etc.
This was in fact never the question.
The question is, given an estimator, what are some parameters of its sampling
distribution.
We can estimate its mean with
\begin_inset Formula $\frac{1}{B}\sum_{i=1}^{B}\alpha\left(\hat{\cd}^{(B)}\right)$
\end_inset
.
And thus we can use
\begin_inset Formula $\frac{1}{B}\sum_{i=1}^{B}\alpha\left(\hat{\cd}^{(B)}\right)-\alpha\left(\hat{\cd}\right)$
\end_inset
as a bootstrap estimate for the bias of
\begin_inset Formula $\alpha(\hat{\cd})$
\end_inset
as an estimator for
\begin_inset Formula $\alpha\left(\cd\right)$
\end_inset
:
\begin_inset Formula $\ex\alpha(\hat{\cd})-\alpha(\cd)$
\end_inset
.
\end_layout
\end_inset
\end_layout
\begin_layout Frame
\begin_inset Argument 4
status open
\begin_layout Plain Layout
Contents
\end_layout
\end_inset
\end_layout
\begin_deeper
\begin_layout Standard
\begin_inset CommandInset toc
LatexCommand tableofcontents
\end_inset
\end_layout
\end_deeper
\begin_layout Section
Bias and Variance
\end_layout
\begin_layout Frame
\begin_inset Argument 4
status open
\begin_layout Plain Layout
Parameters
\end_layout
\end_inset
\end_layout
\begin_deeper
\begin_layout Itemize
Suppose we have a probability distribution
\begin_inset Formula $P$
\end_inset
.
\end_layout
\begin_layout Itemize
Often we want to estimate some characteristic of
\begin_inset Formula $P$
\end_inset
.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\begin_layout Itemize
e.g.
expected value, variance, kurtosis, median, etc...
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\end_deeper
\begin_layout Itemize
These things are called
\series bold
parameters
\series default
of
\begin_inset Formula $P$
\end_inset
.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
A
\series bold
parameter
\series default
\begin_inset Formula $\mu=\mu(P)$
\end_inset
is any function of the distribution
\begin_inset Formula $P$
\end_inset
.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
Question: Is
\begin_inset Formula $\mu$
\end_inset
random?
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
Answer: Nope.
For example if
\begin_inset Formula $P$
\end_inset
has density
\begin_inset Formula $f(x)$
\end_inset
on
\begin_inset Formula $\reals$
\end_inset
, then mean is
\begin_inset Formula
\[
\mu=\int_{-\infty}^{\infty}xf(x)\,dx,
\]
\end_inset
which is just an integral - nothing random.
\end_layout
\end_deeper
\begin_layout Standard
\begin_inset Separator plain
\end_inset
\end_layout
\begin_layout Frame
\begin_inset Argument 4
status open
\begin_layout Plain Layout
Statistics and Estimators
\end_layout
\end_inset
\end_layout
\begin_deeper
\begin_layout Itemize
Suppose
\begin_inset Formula $\cd_{n}=\left(x_{1},x_{2},\ldots,x_{n}\right)$
\end_inset
is an i.i.d.
sample from
\begin_inset Formula $P$
\end_inset
.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
A
\series bold
statistic
\series default
\begin_inset Formula $s=s(\cd_{n})$
\end_inset
is any function of the data.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
A statistic
\begin_inset Formula $\hat{\mu}=\hat{\mu}(\cd_{n})$
\end_inset
is a
\series bold
point estimator
\series default
of
\begin_inset Formula $\mu$
\end_inset
if
\begin_inset Formula $\hat{\mu}\approx\mu$
\end_inset
.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
Question: Are statistics and/or point estimators random?
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
Answer: Yes, since we're considering the data to be random.
\end_layout
\begin_deeper
\begin_layout Itemize
The function
\begin_inset Formula $s(\cdot)$
\end_inset
isn't random, but we're plugging in random inputs.
\end_layout
\end_deeper
\end_deeper
\begin_layout Standard
\begin_inset Separator plain
\end_inset
\end_layout
\begin_layout Frame
\begin_inset Argument 4
status open
\begin_layout Plain Layout
Examples of Statistics
\end_layout
\end_inset
\end_layout
\begin_deeper
\begin_layout Itemize
Mean:
\begin_inset Formula $\bar{x}(\cd_{n})=\frac{1}{n}\sum_{i=1}^{n}x_{i}$
\end_inset
.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
Median:
\begin_inset Formula $m(\cd_{n})=\text{median}(x_{1},\ldots,x_{n})$
\end_inset
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
Sample variance:
\begin_inset Formula $\sigma^{2}(\cd_{n})=\frac{1}{n-1}\sum_{i=1}^{n}\left(x_{i}-\bar{x}(\cd_{n})\right)^{2}$
\end_inset
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Standard
Fancier:
\end_layout
\begin_layout Itemize
A data histogram
\series bold
\series default
is a statistic.
\end_layout
\begin_layout Itemize
Empirical distribution function.
\end_layout
\begin_layout Itemize
A confidence interval.
\end_layout
\end_deeper
\begin_layout Standard
\begin_inset Separator plain
\end_inset
\end_layout
\begin_layout Frame
\begin_inset Argument 4
status open
\begin_layout Plain Layout
Statistics are Random
\end_layout
\end_inset
\end_layout
\begin_deeper
\begin_layout Itemize
Statistics are random, so they have probability distributions.
\end_layout
\begin_layout Pause
\end_layout
\begin_layout Itemize
The distribution of a statistic is called a
\series bold
sampling distribution
\series default
.
\end_layout
\begin_layout Pause
\end_layout
\begin_layout Itemize
We often want to know some
\series bold
parameters
\series default
of the sampling distribution.
\end_layout
\begin_deeper
\begin_layout Itemize
Most commonly the mean and the standard deviation.
\end_layout
\end_deeper
\begin_layout Pause
\end_layout
\begin_layout Itemize
The standard deviation of the sampling distribution is called the
\series bold
standard error
\series default
.
\end_layout
\begin_layout Pause
\end_layout
\begin_layout Itemize
Question: Is standard error random?
\end_layout
\begin_layout Pause
\end_layout
\begin_layout Itemize
Answer: Nope.
It's a parameter of a distribution.
\end_layout
\end_deeper
\begin_layout Standard
\begin_inset Separator plain
\end_inset
\end_layout
\begin_layout Frame
\begin_inset Argument 4
status open
\begin_layout Plain Layout
Bias and Variance for Real-Valued Estimators
\end_layout
\end_inset
\end_layout
\begin_deeper
\begin_layout Itemize
Let
\begin_inset Formula $\mu=\mu(P)$
\end_inset
be a real-valued parameter of distribution
\begin_inset Formula $P$
\end_inset
.
\end_layout
\begin_layout Itemize
Let
\begin_inset Formula $\hat{\mu}=\hat{\mu}(\cd_{n})$
\end_inset
be a point estimator of
\begin_inset Formula $\mu$
\end_inset
.
\end_layout
\begin_layout Pause
\end_layout
\begin_layout Itemize
We define the
\series bold
bias
\series default
of
\begin_inset Formula $\hat{\mu}$
\end_inset
to be
\begin_inset Formula $\mbox{Bias}(\hat{\mu})=\ex\hat{\mu}-\mu$
\end_inset
.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
An estimator is
\series bold
unbiased
\series default
if
\begin_inset Formula $\mbox{Bias}(\hat{\mu})=\ex\hat{\mu}-\mu=0$
\end_inset
.
\end_layout
\begin_layout Itemize
We define the
\series bold
variance
\series default
of
\begin_inset Formula $\hat{\mu}$
\end_inset
to be
\begin_inset Formula $\mbox{Var}(\hat{\mu})=\ex\hat{\mu}^{2}-\left(\ex\hat{\mu}\right)^{2}$
\end_inset
.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout AlertBlock
\begin_inset Argument 2
status open
\begin_layout Plain Layout
Neither bias nor variance depend on a specific sample
\begin_inset Formula $\cd_{n}$
\end_inset
.
We are taking expectation over
\begin_inset Formula $\cd_{n}$
\end_inset
.
\end_layout
\end_inset
\end_layout
\begin_layout Pause
\end_layout
\begin_layout Itemize
Why might we care about the bias and variance of an estimator?
\end_layout
\end_deeper
\begin_layout Standard
\begin_inset Separator plain
\end_inset
\end_layout
\begin_layout Frame
\begin_inset Argument 4
status open
\begin_layout Plain Layout
Putting
\begin_inset Quotes eld
\end_inset
Error Bars
\begin_inset Quotes erd
\end_inset
on Estimators
\end_layout
\end_inset
\end_layout
\begin_deeper
\begin_layout Itemize
Why do we even care about estimating variance?
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
May want to report a confidence interval for our point estimate, e.g.
\begin_inset Formula
\[
\hat{\mu}\pm\sqrt{\widehat{\var(\hat{\mu})}}
\]
\end_inset
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
Where
\begin_inset Formula $\sqrt{\widehat{\var(\hat{\mu})}}$
\end_inset
is our
\series bold
estimate of the standard error
\series default
of
\begin_inset Formula $\hat{\mu}$
\end_inset
.
\end_layout
\end_deeper
\begin_layout Standard
\begin_inset Separator plain
\end_inset
\end_layout
\begin_layout Frame
\begin_inset Argument 4
status open
\begin_layout Plain Layout
Estimating Variance of an Estimator
\end_layout
\end_inset
\end_layout
\begin_deeper
\begin_layout Itemize
To estimate
\begin_inset Formula $\mbox{Var}(\hat{\mu})$
\end_inset
, we can use estimates of
\begin_inset Formula $\ex\hat{\mu}$
\end_inset
and
\begin_inset Formula $\ex\hat{\mu}^{2}$
\end_inset
.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
Instead of a single sample
\begin_inset Formula $\cd_{n}$
\end_inset
of size
\begin_inset Formula $n$
\end_inset
, suppose we had
\end_layout
\begin_deeper
\begin_layout Itemize
\begin_inset Formula $B$
\end_inset
independent samples of size
\begin_inset Formula $n$
\end_inset
:
\begin_inset Formula $\cd_{n}^{1},\cd_{n}^{2},\ldots,\cd_{n}^{B}$
\end_inset
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\end_deeper
\begin_layout Itemize
Can then estimate
\begin_inset Formula
\begin{eqnarray*}
\ex\hat{\mu} & \approx & \pause\frac{1}{B}\sum_{i=1}^{B}\hat{\mu}\left(\cd_{n}^{i}\right)\\
\pause\ex\hat{\mu}^{2} & \approx & \pause\frac{1}{B}\sum_{i=1}^{B}\left[\hat{\mu}\left(\cd_{n}^{i}\right)\right]^{2}\pause
\end{eqnarray*}
\end_inset
and
\begin_inset Formula
\[
\var\left(\hat{\mu}\right)\approx\frac{1}{B}\sum_{i=1}^{B}\left[\hat{\mu}\left(\cd_{n}^{i}\right)\right]^{2}-\left[\frac{1}{B}\sum_{i=1}^{B}\hat{\mu}\left(\cd_{n}^{i}\right)\right]^{2}.
\]
\end_inset
\end_layout
\end_deeper
\begin_layout Standard
\begin_inset Separator plain
\end_inset
\end_layout
\begin_layout Frame
\begin_inset Argument 4
status open
\begin_layout Plain Layout
Histogram of Estimator
\end_layout
\end_inset
\end_layout
\begin_deeper
\begin_layout Itemize
Want to estimate
\begin_inset Formula $\alpha=\alpha(P)\in\reals$
\end_inset
for some unknown
\begin_inset Formula $P$
\end_inset
, and some complicated
\begin_inset Formula $\alpha$
\end_inset
.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
Point estimator
\begin_inset Formula $\hat{\alpha}=\hat{\alpha}(\cd_{100})$
\end_inset
for samples of size
\begin_inset Formula $100$
\end_inset
.
\end_layout
\begin_layout Itemize
How to get error bars on
\begin_inset Formula $\hat{\alpha}$
\end_inset
?
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
Histogram of
\begin_inset Formula $\hat{\alpha}$
\end_inset
for
\begin_inset Formula $1000$
\end_inset
random datasets of size
\begin_inset Formula $100$
\end_inset
(estimates sampling distribution of
\begin_inset Formula $\hat{\alpha}$
\end_inset
):
\end_layout
\begin_deeper
\begin_layout Standard
\align left
\begin_inset Graphics
filename independent-estimates.png
lyxscale 30
height 45theight%
\end_inset
\end_layout
\end_deeper
\begin_layout Standard
\align left
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
let
\backslash
thefootnote
\backslash
relax
\backslash
footnotetext{
\backslash
tiny{Pink line indicates true value of $
\backslash
alpha$.
This is Figure 5.10 from
\backslash
emph{An Introduction to Statistical Learning, with applications in R} (Springer,
2013) with permission from the authors: G.
James, D.
Witten, T.
Hastie and R.
Tibshirani.}}
\end_layout
\end_inset
\end_layout
\end_deeper
\begin_layout Standard
\begin_inset Separator plain
\end_inset
\end_layout
\begin_layout Frame
\begin_inset Argument 4
status open
\begin_layout Plain Layout
Practical Issue
\end_layout
\end_inset
\end_layout
\begin_deeper
\begin_layout Itemize
We typically get only one sample
\begin_inset Formula $\cd_{n}$
\end_inset
.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
We could divide it into
\begin_inset Formula $B$
\end_inset
groups.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
Could use first group as point estimator
\begin_inset Formula $\hat{\mu}=\hat{\mu}\left(\cd_{n/B}^{(1)}\right)$
\end_inset
,
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
And use the remaining groups
\begin_inset Formula $\cd_{n/B}^{(2)},\ldots,\cd_{n/B}^{(B)}$
\end_inset
to get a variance estimate for
\begin_inset Formula $\hat{\mu}(\cd_{n/B}^{(1)})$
\end_inset
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
But then our point estimate only uses a fraction of the data.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
Would be much better if we used all the data:
\begin_inset Formula $\hat{\mu}=\hat{\mu}(\cd_{n}).$
\end_inset
\end_layout
\begin_layout Pause
\end_layout
\begin_layout Itemize
Can we get the best of both worlds?
\end_layout
\begin_deeper
\begin_layout Itemize
A good point estimate AND a variance estimate?
\end_layout
\end_deeper
\end_deeper
\begin_layout Standard
\begin_inset Separator plain
\end_inset
\end_layout
\begin_layout Section
The Bootstrap
\end_layout
\begin_layout Frame
\begin_inset Argument 4
status open
\begin_layout Plain Layout
The Bootstrap Sample
\end_layout
\end_inset
\end_layout
\begin_deeper
\begin_layout Itemize
A
\series bold
bootstrap sample
\series default
from
\begin_inset Formula $\cd_{n}=\left(x_{1},\ldots,x_{n}\right)$
\end_inset
is a sample of size
\begin_inset Formula $n$
\end_inset
drawn
\emph on
with replacement
\emph default
from
\begin_inset Formula $\cd_{n}$
\end_inset
.
\end_layout
\begin_layout Pause
\end_layout
\begin_layout Itemize
In a bootstrap sample, some elements of
\begin_inset Formula $\cd_{n}$
\end_inset
\end_layout
\begin_deeper
\begin_layout Itemize
will show up multiple times, and
\end_layout
\begin_layout Itemize
some won't show up at all.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\end_deeper
\begin_layout Itemize
Each
\begin_inset Formula $x_{i}$
\end_inset
has a probability of
\begin_inset Formula $\pause(1-1/n)^{n}$
\end_inset
of not being selected.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
Recall from analysis that for large
\begin_inset Formula $n$
\end_inset
,
\begin_inset Formula
\[
\left(1-\frac{1}{n}\right)^{n}\approx\frac{1}{e}\approx.368.
\]
\end_inset
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
So we expect ~63.2% of elements of
\begin_inset Formula $\cd$
\end_inset
will show up at least once.
\end_layout
\end_deeper
\begin_layout Standard
\begin_inset Separator plain
\end_inset
\end_layout
\begin_layout Frame
\begin_inset Argument 4
status open
\begin_layout Plain Layout
The Bootstrap Sample
\end_layout
\end_inset
\end_layout
\begin_deeper
\begin_layout Standard
\align left
\begin_inset Graphics
filename bootstrap.pdf
lyxscale 50
height 75theight%
\end_inset
\end_layout
\begin_layout Standard
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
let
\backslash
thefootnote
\backslash
relax
\backslash
footnotetext{
\backslash
tiny{From
\backslash
emph{An Introduction to Statistical Learning, with applications in R} (Springer,
2013) with permission from the authors: G.
James, D.
Witten, T.
Hastie and R.
Tibshirani.}}
\end_layout
\end_inset
\end_layout
\end_deeper
\begin_layout Standard
\begin_inset Separator plain
\end_inset
\end_layout
\begin_layout Frame
\begin_inset Argument 4
status open
\begin_layout Plain Layout
The Bootstrap Method
\end_layout
\end_inset
\end_layout
\begin_deeper
\begin_layout Definition
A
\series bold
bootstrap method
\series default
is when you
\emph on
simulate
\emph default
having
\begin_inset Formula $B$
\end_inset
independent samples from
\begin_inset Formula $P$
\end_inset
by taking
\begin_inset Formula $B$
\end_inset
bootstrap samples from the sample
\begin_inset Formula $\cd_{n}$
\end_inset
.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
Given original data
\begin_inset Formula $\cd_{n}$
\end_inset
, compute
\begin_inset Formula $B$
\end_inset
bootstrap samples
\begin_inset Formula $D_{n}^{1},\ldots,D_{n}^{B}$
\end_inset
.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
For each bootstrap sample, compute some function
\begin_inset Formula
\[
\phi(D_{n}^{1}),\ldots,\phi(D_{n}^{B})
\]
\end_inset
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
Work with these values as though
\begin_inset Formula $D_{n}^{1},\ldots,D_{n}^{B}$
\end_inset
were i.i.d.
\begin_inset Formula $P$
\end_inset
.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
\series bold
Amazing fact:
\series default
Things often come out very close to what we'd get with independent samples
from
\begin_inset Formula $P$
\end_inset
.
\end_layout
\end_deeper
\begin_layout Standard
\begin_inset Separator plain
\end_inset
\end_layout
\begin_layout Frame
\begin_inset Argument 4
status open
\begin_layout Plain Layout
Independent vs Bootstrap Samples
\end_layout
\end_inset
\end_layout
\begin_deeper
\begin_layout Itemize
Want to estimate
\begin_inset Formula $\alpha=\alpha(P)$
\end_inset
for some unknown
\begin_inset Formula $P$
\end_inset
and some complicated
\begin_inset Formula $\alpha$
\end_inset
.
\end_layout
\begin_layout Itemize
Point estimator
\begin_inset Formula $\hat{\alpha}=\hat{\alpha}(\cd_{100})$
\end_inset
for samples of size
\begin_inset Formula $100$
\end_inset
.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
Histogram of
\begin_inset Formula $\hat{\alpha}$
\end_inset
based on
\end_layout
\begin_deeper
\begin_layout Itemize
1000 independent samples of size 100, vs
\end_layout
\begin_layout Itemize
1000 bootstrap samples of size 100
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\end_deeper
\begin_layout Standard
\align left
\begin_inset Graphics
filename independentVsBootstrap.png
lyxscale 50
height 40theight%
\end_inset
\end_layout
\begin_layout Standard
\align left
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
let
\backslash
thefootnote
\backslash
relax
\backslash
footnotetext{
\backslash
tiny{Figure 5.10 from
\backslash
emph{ISLR} (Springer, 2013) with permission from the authors: G.
James, D.
Witten, T.
Hastie and R.
Tibshirani.}}
\end_layout
\end_inset
\end_layout
\end_deeper
\begin_layout Standard
\begin_inset Separator plain
\end_inset
\end_layout
\begin_layout Frame
\begin_inset Argument 4
status open
\begin_layout Plain Layout
The Bootstrap in Practice
\end_layout
\end_inset
\end_layout
\begin_deeper
\begin_layout Itemize
Suppose we have an estimator
\begin_inset Formula $\hat{\mu}=\hat{\mu}(\cd_{n})$
\end_inset
.
\end_layout
\begin_layout Pause
\end_layout
\begin_layout Itemize
To get error bars, we can compute the
\begin_inset Quotes eld
\end_inset
bootstrap variance
\begin_inset Quotes erd
\end_inset
.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\begin_layout Itemize
Draw
\begin_inset Formula $B$
\end_inset
bootstrap samples.
\end_layout
\begin_layout Itemize
Compute sample or empirical variance of
\begin_inset Formula $\hat{\mu}(\cd_{n}^{1}),\ldots,\hat{\mu}(\cd_{n}^{B})$
\end_inset
..
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\end_deeper
\begin_layout Itemize
Could report
\begin_inset Formula
\[
\hat{\mu}(\cd_{n})\pm\sqrt{\mbox{Bootstrap Variance}}
\]
\end_inset
\begin_inset Note Note
status open
\begin_layout Itemize
.
\end_layout
\begin_deeper
\begin_layout Pause
\end_layout
\end_deeper
\begin_layout Itemize
For our point estimate, could also report
\begin_inset Formula
\[
\frac{1}{B}\sum_{i=1}^{B}\hat{\mu}\left(\cd_{n}^{i}\right)
\]
\end_inset
\end_layout
\end_inset
\end_layout
\end_deeper
\end_body
\end_document
| {
"pile_set_name": "Github"
} |
// This file is a wrapper around malloc.c, which is the upstream source file.
// It sets configuration flags and controls which symbols are exported.
#include <stddef.h>
#include <malloc.h>
// Define configuration macros for dlmalloc.
// WebAssembly doesn't have mmap-style memory allocation.
#define HAVE_MMAP 0
// WebAssembly doesn't support shrinking linear memory.
#define MORECORE_CANNOT_TRIM 1
// Disable sanity checks to reduce code size.
#define ABORT __builtin_unreachable()
// If threads are enabled, enable support for threads.
#ifdef _REENTRANT
#define USE_LOCKS 1
#endif
// Make malloc deterministic.
#define LACKS_TIME_H 1
// Disable malloc statistics generation to reduce code size.
#define NO_MALLINFO 1
#define NO_MALLOC_STATS 1
// Align malloc regions to 16, to avoid unaligned SIMD accesses.
#define MALLOC_ALIGNMENT 16
// Declare errno values used by dlmalloc. We define them like this to avoid
// putting specific errno values in the ABI.
extern const int __ENOMEM;
#define ENOMEM __ENOMEM
extern const int __EINVAL;
#define EINVAL __EINVAL
// Define USE_DL_PREFIX so that we leave dlmalloc's names prefixed with 'dl'.
// We define them as "static", and we wrap them with public names below. This
// serves two purposes:
//
// One is to make it easy to control which symbols are exported; dlmalloc
// defines several non-standard functions and we wish to explicitly control
// which functions are part of our public-facing interface.
//
// The other is to protect against compilers optimizing based on the assumption
// that they know what functions with names like "malloc" do. Code in the
// implementation will call functions like "dlmalloc" and assume it can use
// the resulting pointers to access the metadata outside of the nominally
// allocated objects. However, if the function were named "malloc", compilers
// might see code like that and assume it has undefined behavior and can be
// optimized away. By using "dlmalloc" in the implementation, we don't need
// -fno-builtin to avoid this problem.
#define USE_DL_PREFIX 1
#define DLMALLOC_EXPORT static inline
// This isn't declared with DLMALLOC_EXPORT so make it static explicitly.
static size_t dlmalloc_usable_size(void*);
// Include the upstream dlmalloc's malloc.c.
#include "malloc.c"
// Export the public names.
void *malloc(size_t size) {
return dlmalloc(size);
}
void free(void *ptr) {
dlfree(ptr);
}
void *calloc(size_t nmemb, size_t size) {
return dlcalloc(nmemb, size);
}
void *realloc(void *ptr, size_t size) {
return dlrealloc(ptr, size);
}
int posix_memalign(void **memptr, size_t alignment, size_t size) {
return dlposix_memalign(memptr, alignment, size);
}
void* aligned_alloc(size_t alignment, size_t bytes) {
return dlmemalign(alignment, bytes);
}
size_t malloc_usable_size(void *ptr) {
return dlmalloc_usable_size(ptr);
}
| {
"pile_set_name": "Github"
} |
#
# Makefile for Red Hat Linux AFS client.
#
afs-cache-$(CONFIG_AFS_FSCACHE) := cache.o
kafs-objs := \
$(afs-cache-y) \
callback.o \
cell.o \
cmservice.o \
dir.o \
file.o \
flock.o \
fsclient.o \
inode.o \
main.o \
misc.o \
mntpt.o \
proc.o \
rxrpc.o \
security.o \
server.o \
super.o \
netdevices.o \
vlclient.o \
vlocation.o \
vnode.o \
volume.o \
write.o
obj-$(CONFIG_AFS_FS) := kafs.o
| {
"pile_set_name": "Github"
} |
# Catalan translation for pingus
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the pingus package.
#
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
# Marc Coll, 2012.
# Marc Coll Carrillo, 2012.
msgid ""
msgstr ""
"Project-Id-Version: pingus\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-13 03:15+0100\n"
"PO-Revision-Date: 2012-03-03 19:21+0000\n"
"Last-Translator: Marc Coll Carrillo <Unknown>\n"
"Language-Team: Catalan <[email protected]>\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2013-02-10 19:40+0000\n"
"X-Generator: Launchpad (build 16482)\n"
#: src/editor/object_properties.cpp:87 src/editor/object_properties.cpp:515
msgid "Object:"
msgstr "Objecte:"
#: src/editor/object_properties.cpp:88 src/editor/object_properties.cpp:516
msgid "Nothing selected"
msgstr "No s'ha seleccionat res"
#: src/editor/object_properties.cpp:97
msgid "Transparent"
msgstr "Transparent"
#: src/editor/object_properties.cpp:98
msgid "Solid"
msgstr "Sòlid"
#: src/editor/object_properties.cpp:99
msgid "Ground"
msgstr "Terra"
#: src/editor/object_properties.cpp:100
msgid "Bridge"
msgstr "Pont"
#: src/editor/object_properties.cpp:101
msgid "Water"
msgstr "Aigua"
#: src/editor/object_properties.cpp:102
msgid "Lava"
msgstr "Lava"
#: src/editor/object_properties.cpp:103
msgid "Remove"
msgstr "Elimina"
#: src/editor/object_properties.cpp:108
msgid "Direction:"
msgstr "Direcció:"
#: src/editor/object_properties.cpp:110
msgid "Left"
msgstr "Esquerra"
#: src/editor/object_properties.cpp:111
msgid "Misc"
msgstr "Miscel·lània"
#: src/editor/object_properties.cpp:112
msgid "Right"
msgstr "Dreta"
#: src/editor/object_properties.cpp:117
msgid "ReleaseRate:"
msgstr "Rati d'alliberament:"
#: src/editor/object_properties.cpp:140
msgid "Para-X:"
msgstr ""
#: src/editor/object_properties.cpp:141
msgid "Para-Y:"
msgstr ""
#: src/editor/object_properties.cpp:149
msgid "Scroll-X:"
msgstr ""
#: src/editor/object_properties.cpp:150
msgid "Scroll-Y:"
msgstr ""
#: src/editor/object_properties.cpp:158
msgid "Owner Id:"
msgstr "Id propietari:"
#: src/editor/object_properties.cpp:162
msgid "Z-Pos:"
msgstr "Posició Z"
#: src/editor/object_properties.cpp:169
msgid "Color:"
msgstr "Color:"
#: src/editor/object_properties.cpp:181
msgid "Small Stars:"
msgstr "Estrelles petites:"
#: src/editor/object_properties.cpp:184
msgid "Middle Stars:"
msgstr "Estrelles mitjanes:"
#: src/editor/object_properties.cpp:187
msgid "Large Stars:"
msgstr "Estrelles grans:"
#: src/editor/object_properties.cpp:195
msgid "Repeat:"
msgstr "Repeteix:"
#: src/editor/object_properties.cpp:211
msgid "Id:"
msgstr "Id:"
#: src/editor/object_properties.cpp:215
msgid "Target Id:"
msgstr "Id objectiu:"
#: src/editor/object_properties.cpp:220 src/editor/level_properties.cpp:74
msgid "Height:"
msgstr "Alçada:"
#: src/editor/object_properties.cpp:521
msgid "Object: [Group]"
msgstr "Objecte: [Grup]"
#: src/editor/object_properties.cpp:522
msgid "Group not supported"
msgstr "Grup no permès"
#: src/editor/object_properties.cpp:527
msgid "Object: "
msgstr "Objecte: "
#: src/editor/panel.cpp:171
msgid "New level"
msgstr "Nou nivell"
#: src/editor/panel.cpp:173
msgid "Open level..."
msgstr "Obre un nivell..."
#: src/editor/panel.cpp:175
msgid "Save level..."
msgstr "Desa el nivell..."
#: src/editor/panel.cpp:177
msgid "Save level as..."
msgstr "Desa el nivell com..."
#: src/editor/panel.cpp:180
msgid "Play level..."
msgstr "Juga el nivell..."
#: src/editor/panel.cpp:183
msgid "Configure actions"
msgstr "Configura les accions"
#: src/editor/panel.cpp:185
msgid "Configure level"
msgstr "Configura el nivell"
#: src/editor/panel.cpp:187
msgid "Display object properties"
msgstr "Mostra les propietats de l'objecte"
#: src/editor/panel.cpp:189
msgid "Show object insertion window"
msgstr "Mostra la finestra d'inserció d'objectes"
#: src/editor/panel.cpp:191
msgid "Show minimap"
msgstr "Mostra el mapa en miniatura"
#: src/editor/panel.cpp:194
msgid "Duplicate the selected objects"
msgstr "Duplica els objectes seleccionats"
#: src/editor/panel.cpp:196
msgid "Delete the selected objects"
msgstr "Elimina els objectes seleccionats"
#: src/editor/panel.cpp:199
msgid "Raise object to top"
msgstr "Eleva l'objecte fins al primer pla"
#: src/editor/panel.cpp:201
msgid "Raise object"
msgstr "Eleva l'objecte"
#: src/editor/panel.cpp:203
msgid "Lower object"
msgstr "Abaixa l'objecte"
#: src/editor/panel.cpp:205
msgid "Lower object to bottom"
msgstr "Abaixa l'objecte fins al fons"
#: src/editor/panel.cpp:211
msgid "Flip object horizontally"
msgstr "Inverteix l'objecte horitzontalment"
#: src/editor/panel.cpp:213
msgid "Flip object vertically"
msgstr "Inverteix l'objecte verticalment"
#: src/editor/panel.cpp:216
msgid "Rotate object -90 degree"
msgstr "Gira l'objecte -90 graus"
#: src/editor/panel.cpp:218
msgid "Rotate object 90 degree"
msgstr "Gira l'objecte 90 graus"
#: src/editor/panel.cpp:227
msgid "Display help"
msgstr "Mostra l'ajuda"
#: src/editor/panel.cpp:229 src/editor/object_selector.cpp:174
#: src/pingus/screens/pingus_menu.cpp:74
msgid "Exit"
msgstr "Sortir"
#: src/editor/file_dialog.cpp:58
msgid "Datadir"
msgstr "Directori de dades"
#: src/editor/file_dialog.cpp:60
msgid "Userdir"
msgstr "Directori d'usuari"
#: src/editor/file_dialog.cpp:63
msgid "Open"
msgstr "Obre"
#: src/editor/file_dialog.cpp:63
msgid "Save"
msgstr "Desa"
#: src/editor/file_dialog.cpp:66 src/editor/message_box.cpp:35
msgid "Cancel"
msgstr "Cancel·la"
#: src/editor/file_dialog.cpp:77
msgid "Filename:"
msgstr "Nom del fitxer:"
#: src/editor/file_dialog.cpp:78
msgid "Pathname:"
msgstr "Ubicació:"
#: src/editor/file_dialog.cpp:98
msgid "Open a level"
msgstr "Obre un nivell"
#: src/editor/file_dialog.cpp:98
msgid "Save your level"
msgstr "Desa el teu nivell"
#: src/editor/level_properties.cpp:52
#, fuzzy
msgid "Author:"
msgstr "Autor/a: "
#: src/editor/level_properties.cpp:55
#, fuzzy
msgid "Levelname:"
msgstr "Nom del fitxer:"
#: src/editor/level_properties.cpp:58
#, fuzzy
msgid "Description:"
msgstr "Direcció:"
#: src/editor/level_properties.cpp:62
#, fuzzy
msgid "Pingus Count:"
msgstr "Expedició de pingus"
#: src/editor/level_properties.cpp:65
#, fuzzy
msgid "Pingus to Save:"
msgstr "Nombre a salvar: "
#: src/editor/level_properties.cpp:68
#, fuzzy
msgid "Time:"
msgstr "Temps: "
#: src/editor/level_properties.cpp:71
msgid "Width:"
msgstr ""
#: src/editor/level_properties.cpp:77
#, fuzzy
msgid "Music:"
msgstr "-Música"
#: src/editor/editor_screen.cpp:230
msgid "== Editor Help =="
msgstr "== Ajuda de l'editor =="
#: src/editor/editor_screen.cpp:248
msgid ""
"Select all\n"
"Clear Selection\n"
"Raise objects\n"
"Lower objects\n"
"Raise objects to top\n"
"Lower objects to bottom\n"
"Rotate 90 degree\n"
"Rotate 270 degree\n"
"Group selected objects\n"
"Ungroup selected objects\n"
msgstr ""
"Selecciona-ho tot\n"
"Neteja la selecció\n"
"Eleva objectes\n"
"Abaixa objectes\n"
"Eleva objectes fins dalt de tot\n"
"Abaixa objectes fins al fons\n"
"Gira 90 graus\n"
"Gira 270 graus\n"
"Agrupa els objectes seleccionats\n"
"Desagrupa els objectes seleccionats\n"
#: src/editor/editor_screen.cpp:271
msgid ""
"Flip object horizontally\n"
"Flip object vertically\n"
"Delete all marked objects\n"
"Move objects by one pixel\n"
"Move objects by 32 pixel\n"
"Toggle background color\n"
"Increase/lower repeat\n"
msgstr ""
"Inverteix l'objecte horitzontalment\n"
"Inverteix l'objecte verticalment\n"
"Esborra tots els objectes marcats\n"
"Mou els objectes un píxel\n"
"Mou els objectes 32 píxels\n"
"Canvia el color de fons\n"
"Incrementa/disminueix la repetició\n"
#: src/editor/editor_screen.cpp:282
msgid ""
"You should name your level files systematically, i.e. by their theme, their "
"number and your nickname:\n"
"\n"
" <levelname><number>-<creator>.pingus\n"
"\n"
"So if you create your second level with a stone theme, call it: stone2-"
"yourname.pingus\n"
"\n"
"When you have created a level and want to have it included in the game mail "
"it to:\n"
"\n"
" [email protected]\n"
"\n"
"Only levels published under the GPL are allowed into the game. The editor "
"automatically inserts a reference \n"
"to the GPL, if you want to have your level under a different license, you "
"have to change that reference.\n"
msgstr ""
"Hauries d'anomenar els teus fitxers de nivell de manera sistemàtica, p.e. "
"pel seu tema, el seu número i el teu sobrenom:\n"
"\n"
" <nom><número>-<creador>.pingus\n"
"\n"
"De manera que si crees el teu segon nivell amb un tema de pedres, anomena'l: "
"pedres2-elteunom.pingus\n"
"\n"
"Quan hagis creat un nivell i el vulguis incloure al joc envia'l per correu "
"a:\n"
"\n"
" [email protected]\n"
"\n"
"Només els nivells publicats sota la GPL estan permesos en el joc. L'editor "
"insereix automàticament una referència \n"
"a la GPL, si vols tenir el teu nivell sota una llicència diferent hauràs de "
"canviar aquesta referència.\n"
#: src/editor/message_box.cpp:37
msgid "Replace"
msgstr "Reemplaça"
#: src/editor/object_selector.cpp:165
msgid "Entrance"
msgstr "Entrada"
#: src/editor/object_selector.cpp:166
msgid "Groundpiece (ground)"
msgstr "Terra (terreny)"
#: src/editor/object_selector.cpp:167
msgid "Groundpiece (solid)"
msgstr "Terra (sòlid)"
#: src/editor/object_selector.cpp:168
msgid "Groundpiece (bridge)"
msgstr "Terra (pont)"
#: src/editor/object_selector.cpp:169
msgid "Groundpiece (transparent)"
msgstr "Terra (transparent)"
#: src/editor/object_selector.cpp:170
msgid "Groundpiece (remove)"
msgstr "Terra (esborrar)"
#: src/editor/object_selector.cpp:171
msgid "Hotspot"
msgstr "Punt calent"
#: src/editor/object_selector.cpp:172
msgid "Background"
msgstr "Fons"
#: src/editor/object_selector.cpp:175
msgid "Liquid"
msgstr "Líquid"
#: src/editor/object_selector.cpp:176
msgid "Trap"
msgstr "Trampa"
#: src/editor/object_selector.cpp:177
msgid "Weather"
msgstr "Clima"
#: src/editor/object_selector.cpp:178
msgid "Special Object"
msgstr "Objecte especial"
#: src/editor/object_selector.cpp:179
msgid "Prefab Object"
msgstr "Objecte prefabricat"
#: src/pingus/components/pingus_counter.cpp:43
#, c-format, boost-format
msgid "Released:%3d/%d Out:%3d Saved:%3d/%d"
msgstr "Alliberats:%3d/%d Fora:%3d Salvats:%3d/%d"
#: src/pingus/action_name.cpp:27
msgid "Angel"
msgstr "Àngel"
#: src/pingus/action_name.cpp:28
msgid "Basher"
msgstr "Excavador"
#: src/pingus/action_name.cpp:29
msgid "Blocker"
msgstr "Bloquejador"
#: src/pingus/action_name.cpp:30
msgid "Boarder"
msgstr ""
#: src/pingus/action_name.cpp:31
msgid "Bomber"
msgstr "Bombarder"
#: src/pingus/action_name.cpp:32 src/pingus/actions/bridger.cpp:38
#: src/pingus/actions/bridger.cpp:196
msgid "Bridger"
msgstr "Enginyer"
#: src/pingus/action_name.cpp:33
msgid "Climber"
msgstr "Escalador"
#: src/pingus/action_name.cpp:34
msgid "Digger"
msgstr "Perforador"
#: src/pingus/action_name.cpp:35
msgid "Drown"
msgstr "Ofegat"
#: src/pingus/action_name.cpp:36
msgid "Exiter"
msgstr "Salvat"
#: src/pingus/action_name.cpp:37
msgid "Faller"
msgstr "Caient"
#: src/pingus/action_name.cpp:38
msgid "Floater"
msgstr "Flotador"
#: src/pingus/action_name.cpp:39
msgid "Jumper"
msgstr "Saltador"
#: src/pingus/action_name.cpp:40
msgid "Laserkill"
msgstr "Làser"
#: src/pingus/action_name.cpp:41
msgid "Miner"
msgstr "Miner"
#: src/pingus/action_name.cpp:42
msgid "Slider"
msgstr "Lliscador"
#: src/pingus/action_name.cpp:43
msgid "Smashed"
msgstr "Esclafat"
#: src/pingus/action_name.cpp:44
msgid "Splashed"
msgstr "Esquitxat"
#: src/pingus/action_name.cpp:45
msgid "Superman"
msgstr "Superman"
#: src/pingus/action_name.cpp:46
msgid "Teleported"
msgstr "Teleportat"
#: src/pingus/action_name.cpp:47
msgid "Waiter"
msgstr "Esperant"
#: src/pingus/action_name.cpp:48
msgid "Walker"
msgstr "Caminant"
#: src/pingus/screens/story_screen.cpp:108
#: src/pingus/screens/story_screen.cpp:114
msgid "skip"
msgstr "omet"
#: src/pingus/screens/start_screen.cpp:67
msgid "Play"
msgstr "Jugar"
#: src/pingus/screens/start_screen.cpp:111
#: src/pingus/screens/level_menu.cpp:50
msgid "Back"
msgstr "Tornar"
#: src/pingus/screens/start_screen.cpp:166
msgid "Number of Pingus: "
msgstr "Nombre de pingus: "
#: src/pingus/screens/start_screen.cpp:169
msgid "Number to Save: "
msgstr "Nombre a salvar: "
#: src/pingus/screens/start_screen.cpp:172
msgid "Time: "
msgstr "Temps: "
#: src/pingus/screens/start_screen.cpp:178
msgid "Author: "
msgstr "Autor/a: "
#: src/pingus/screens/addon_menu.cpp:53 src/pingus/screens/option_menu.cpp:336
msgid "Close"
msgstr "Tanca"
#: src/pingus/screens/option_menu.cpp:208
msgid "Fullscreen"
msgstr "Pantalla completa"
#: src/pingus/screens/option_menu.cpp:209
msgid "Mouse Grab"
msgstr "Captura el ratolí"
#: src/pingus/screens/option_menu.cpp:211
msgid "Software Cursor"
msgstr "Cursor per programari"
#: src/pingus/screens/option_menu.cpp:212
msgid "Autoscrolling"
msgstr "Desplaçament automàtic"
#: src/pingus/screens/option_menu.cpp:213
msgid "Drag&Drop Scrolling"
msgstr "Desplaçar arrossegant"
#: src/pingus/screens/option_menu.cpp:215
msgid "Print FPS"
msgstr "Mostra els FPS"
#: src/pingus/screens/option_menu.cpp:219
msgid "Resolution:"
msgstr "Resolució:"
#: src/pingus/screens/option_menu.cpp:220
msgid "Renderer:"
msgstr "Renderitzador:"
#: src/pingus/screens/option_menu.cpp:222
msgid "Language:"
msgstr "Idioma:"
#: src/pingus/screens/option_menu.cpp:224
msgid "Master Volume:"
msgstr "Volum mestre:"
#: src/pingus/screens/option_menu.cpp:225
msgid "Sound Volume:"
msgstr "So:"
#: src/pingus/screens/option_menu.cpp:226
msgid "Music Volume:"
msgstr "Música:"
#: src/pingus/screens/option_menu.cpp:334
msgid "Option Menu"
msgstr "Menú d'opcions"
#: src/pingus/screens/option_menu.cpp:340
msgid "Some options require a restart of the game to take effect."
msgstr "Algunes opcions requereixen reiniciar el joc per fer efecte."
#: src/pingus/screens/pingus_menu.cpp:54
msgid "Story"
msgstr "Història"
#: src/pingus/screens/pingus_menu.cpp:55
msgid "..:: Start the game ::.."
msgstr "..:: Comença el joc ::.."
#: src/pingus/screens/pingus_menu.cpp:59
msgid "Editor"
msgstr "Editor"
#: src/pingus/screens/pingus_menu.cpp:60
msgid "..:: Create your own levels ::.."
msgstr "..:: Crea els teus propis nivells ::.."
#: src/pingus/screens/pingus_menu.cpp:64
msgid "Options"
msgstr "Opcions"
#: src/pingus/screens/pingus_menu.cpp:65
msgid "..:: Configure the game ::.."
msgstr "..:: Configura el joc ::.."
#: src/pingus/screens/pingus_menu.cpp:69 src/pingus/screens/level_menu.cpp:177
msgid "Levelsets"
msgstr "Nivells"
#: src/pingus/screens/pingus_menu.cpp:70
msgid "..:: Play User Built levels ::.."
msgstr "..:: Juga a nivells creats pels usuaris ::.."
#: src/pingus/screens/pingus_menu.cpp:75
msgid "..:: Bye, bye ::.."
msgstr "..:: A reveure ::.."
#: src/pingus/screens/pingus_menu.cpp:87
msgid ""
"..:: Ctrl-g: mouse grab :: F10: fps counter :: F11: "
"fullscreen :: F12: screenshot ::.."
msgstr ""
"..:: Ctrl-g: captura el ratolí :: F10: FPS :: F11: pantalla completa :: F12: "
"captura ::.."
#: src/pingus/screens/result_screen.cpp:91
msgid "Give up"
msgstr "Abandonar"
#: src/pingus/screens/result_screen.cpp:126
msgid "Retry"
msgstr "Tornar a provar"
#: src/pingus/screens/result_screen.cpp:183
msgid "Success!"
msgstr "Ho has aconseguit!"
#: src/pingus/screens/result_screen.cpp:191
msgid "Failure!"
msgstr "Has fracassat!"
#: src/pingus/screens/result_screen.cpp:200
msgid "Perfect! You saved everyone possible - great!"
msgstr "Perfecte! Has salvat a tothom - fantàstic!"
#: src/pingus/screens/result_screen.cpp:202
msgid "No-one got killed, pretty good work."
msgstr "Ningú s'ha mort, molt bona feina."
#: src/pingus/screens/result_screen.cpp:204
msgid ""
"You saved exactly what you needed - you made it, but\n"
"maybe you can do better?"
msgstr ""
"Has salvat exactament els que necessitaves - ho has\n"
"aconseguit, però potser ho podries fer millor?"
#: src/pingus/screens/result_screen.cpp:207
msgid "Not everybody was saved, but still good work!"
msgstr "No tothom s'ha salvat, però tot i així bona feina!"
#: src/pingus/screens/result_screen.cpp:209
msgid "What can I say, you made it - congratulations!"
msgstr "Què puc dir, ho has aconseguit - enhorabona!"
#: src/pingus/screens/result_screen.cpp:214
msgid "You killed everybody, not good."
msgstr "Has matat a tothom, molt malament."
#: src/pingus/screens/result_screen.cpp:216
msgid "No-one got saved - I know you can do better."
msgstr "No s'ha salvat ningú - sé que ho pots fer millor."
#: src/pingus/screens/result_screen.cpp:218
msgid ""
"You didn't save enough, but you saved a few. Next\n"
"time you might do better."
msgstr ""
"No n'has salvat prous, però n'has salvat alguns. La\n"
"propera vegada ho faràs millor."
#: src/pingus/screens/result_screen.cpp:221
msgid "Only one more and you would have made it - try again!"
msgstr "Només un més i ho hauries aconseguit - torna a provar-ho!"
#: src/pingus/screens/result_screen.cpp:223
msgid "Only a handful more and you would have made it - try again!"
msgstr "Només un grapat més i ho hauries aconseguit - torna a provar-ho!"
#: src/pingus/screens/result_screen.cpp:225
msgid "Better luck next time!"
msgstr "Més sort la propera vegada!"
#: src/pingus/screens/result_screen.cpp:233
msgid "Saved: "
msgstr "Salvats: "
#: src/pingus/screens/result_screen.cpp:237
msgid "Died: "
msgstr "Morts: "
#: src/pingus/screens/result_screen.cpp:240
msgid "Time left: "
msgstr "Temps restant: "
#: src/pingus/screens/level_menu.cpp:155
msgid "Under Construction"
msgstr "En construcció"
#: src/pingus/screens/level_menu.cpp:156
msgid "Untested, unpolished and broken levels"
msgstr "Nivells no provats, poc polits i trencats"
#: src/pingus/screens/level_menu.cpp:192
msgid "Solved:"
msgstr "Resolts:"
#: src/pingus/screens/level_menu.cpp:193
msgid "levels"
msgstr "nivells"
#: src/pingus/worldmap/level_dot.cpp:134
msgid "???"
msgstr "???"
#: src/pingus/worldmap/worldmap_screen.cpp:84
msgid "Show Ending?"
msgstr "Mostrar el final?"
#: src/pingus/worldmap/worldmap_screen.cpp:113
msgid "Leave?"
msgstr "Sortir?"
#: src/pingus/pingus_main.cpp:175
msgid "[OPTIONS]... [FILE]"
msgstr "[OPCIONS]... [FITXER]"
#: src/pingus/pingus_main.cpp:176
msgid ""
"Pingus is a puzzle game where you need to guide a bunch of little penguins "
"around the world."
msgstr ""
"Pingus és un joc de trencaclosques on has de guiar un grapat de pingüinets "
"al voltant del món."
#: src/pingus/pingus_main.cpp:178
msgid "General Options:"
msgstr "Opcions generals:"
#: src/pingus/pingus_main.cpp:180
msgid "Displays this help"
msgstr "Mostra aquesta ajuda"
#: src/pingus/pingus_main.cpp:182
msgid "Print version number and exit"
msgstr "Mostra la versió i surt"
#: src/pingus/pingus_main.cpp:184
msgid "Enable info level log output"
msgstr "Habilita el nivell de registre d'informació"
#: src/pingus/pingus_main.cpp:186
msgid "Enable debug level log output"
msgstr "Habilita el nivell de registre de depuració"
#: src/pingus/pingus_main.cpp:188
msgid "Disable all log output"
msgstr "Deshabilita el registre"
#: src/pingus/pingus_main.cpp:190
msgid "Display Options:"
msgstr "Opcions de pantalla:"
#: src/pingus/pingus_main.cpp:192
msgid "Start in Window Mode"
msgstr "Engega en mode de finestra"
#: src/pingus/pingus_main.cpp:194
msgid "Start in Fullscreen"
msgstr "Engega en mode de pantalla completa"
#: src/pingus/pingus_main.cpp:196
msgid "Use the given renderer (default: sdl)"
msgstr "Fes servir el renderitzador indicat (per defecte: sdl)"
#: src/pingus/pingus_main.cpp:198
msgid "Set the window resolution for pingus (default: 800x600)"
msgstr "Estableix la resolució del joc (per defecte: 800x600)"
#: src/pingus/pingus_main.cpp:200
msgid "Set the resolution used in fullscreen mode (default: 800x600)"
msgstr ""
"Estableix la resolució emprada en el mode de pantalla completa (per defecte: "
"800x600)"
#: src/pingus/pingus_main.cpp:202
msgid "Enable software cursor"
msgstr "Habilita el cursor per programari"
#: src/pingus/pingus_main.cpp:204
msgid "Game Options:"
msgstr "Opcions de joc:"
#: src/pingus/pingus_main.cpp:206
msgid "Disable automatic scrolling"
msgstr "Desactiva l'autodesplaçament"
#: src/pingus/pingus_main.cpp:208
msgid "Enable drag'n drop scrolling"
msgstr "Habilita el desplaçament arrossegant"
#: src/pingus/pingus_main.cpp:210
msgid "Sound Options:"
msgstr "Opcions de so:"
#: src/pingus/pingus_main.cpp:212
msgid "Disable sound"
msgstr "Desactiva el so"
#: src/pingus/pingus_main.cpp:214
msgid "Disable music"
msgstr "Desactiva la música"
#: src/pingus/pingus_main.cpp:218
msgid "Select language to use with Pingus"
msgstr "Selecciona l'idioma del joc"
#: src/pingus/pingus_main.cpp:220
msgid "List all available languages"
msgstr "Mostra tots els idiomes disponibles"
#: src/pingus/pingus_main.cpp:224
msgid "Loads the level editor"
msgstr "Carrega l'editor de nivells"
#: src/pingus/pingus_main.cpp:226
msgid "Directory Options:"
msgstr "Opcions de directori:"
#: src/pingus/pingus_main.cpp:227 src/pingus/pingus_main.cpp:229
#: src/pingus/pingus_main.cpp:231
msgid "DIR"
msgstr "DIRECTORI"
#: src/pingus/pingus_main.cpp:228
msgid "Load game datafiles from DIR"
msgstr "Carrega els fitxers de dades del joc des de DIRECTORI"
#: src/pingus/pingus_main.cpp:230
msgid "Load config files and store savegames in DIR"
msgstr "Carrega els fitxers de configuració i desa les partides a DIRECTORI"
#: src/pingus/pingus_main.cpp:232
msgid "Load game modifications from DIR"
msgstr "Carrega les modificacions del joc des de DIRECTORI"
#: src/pingus/pingus_main.cpp:234
msgid "Don't read ~/.pingus/config"
msgstr "No llegeixis ~/.pingus/config"
#: src/pingus/pingus_main.cpp:235
msgid "FILE"
msgstr "FITXER"
#: src/pingus/pingus_main.cpp:236
msgid "Read config options from FILE"
msgstr "Llegeix les opcions de configuració des de FITXER"
#: src/pingus/pingus_main.cpp:238
msgid "Uses the controller given in FILE"
msgstr "Fa servir el controlador indicat a FITXER"
#: src/pingus/pingus_main.cpp:240
msgid "Debug Options:"
msgstr "Opcions de depuració:"
#: src/pingus/pingus_main.cpp:242
msgid "Enables some special features for developers"
msgstr "Habilita algunes característiques especials per als desenvolupadors"
#: src/pingus/pingus_main.cpp:244
msgid "Set the game speed (0=fastest, >0=slower)"
msgstr "Estableix la velocitat del joc (0=la més ràpida, >0=més lenta)"
#: src/pingus/pingus_main.cpp:246
msgid "Set the desired game framerate (frames per second)"
msgstr "Estableix les imatges per segon desitjades"
#: src/pingus/pingus_main.cpp:248
msgid "Set the size of the map tiles (default: 32)"
msgstr "Estableix la mida de les rajoles del mapa (per defecte: 32)"
#: src/pingus/pingus_main.cpp:688
msgid "Pingus: Out of memory!"
msgstr "Pingus: Sense memòria!"
#: src/pingus/pingus_main.cpp:692
msgid "Pingus: Standard exception caught!:\n"
msgstr "Pingus: Excepció estàndard capturada!:\n"
#: src/pingus/pingus_main.cpp:696
msgid "Pingus: Unknown throw caught!"
msgstr "Pingus: S'ha capturat una excepció desconeguda!"
#: src/pingus/game_time.cpp:29
msgid "unlimited"
msgstr "il·limitat"
#: src/engine/display/screenshot.cpp:37
msgid "Screenshot: Saving screenshot to: "
msgstr "Captura de pantalla: desant la captura a: "
#: src/engine/display/screenshot.cpp:39
msgid "Screenshot: Screenshot is done."
msgstr "Captura de pantalla: s'ha fet la captura."
#: src/engine/display/screenshot.cpp:124 src/engine/display/screenshot.cpp:152
msgid "Screenshot: Couldn't write file: "
msgstr "Captura de pantalla: no s'ha pogut escriure el fitxer: "
#: data/levels/tutorial/basher-tutorial-grumbel.pingus:5
msgid "If the way is blocked, bash away"
msgstr "Si el camí està bloquejat, excava"
#: data/levels/tutorial/basher-tutorial-grumbel.pingus:6
msgid ""
"Similar to the Digger action that you already know from previous levels, "
"there is also an action that allows the Pingus to dig horizontally, as "
"opposed to the vertical dig ability the Digger action provides. This new "
"action is called Basher. "
msgstr ""
"Similar a l'acció de perforar que ja coneixes de nivells anteriors, també hi "
"una acció que permet als pingus foradar de manera horitzontal, al contrari "
"que l'habilitat de perforació vertical. Aquesta nova acció s'anomena "
"excavar. "
#: data/levels/tutorial/bomber-tutorial2-grumbel.pingus:5
msgid "Sacrifice a few and save the rest"
msgstr "Sacrifica'n uns pocs i salva la resta"
#: data/levels/tutorial/bomber-tutorial2-grumbel.pingus:6
msgid ""
"Sometimes no other actions are available, so you have to bomb your way "
"through the ground. The Pingus can do this by actually self- destructing. "
"This will kill them, but it is sometimes necessary to sacrifice a few to "
"save the rest. "
msgstr ""
"A vegades no hi ha més accions disponibles, o sigui que t'has d'obrir camí a "
"base d'explosions. Els pingus poden fer això autodestruint-se. Això els "
"matarà, però a vegades és necessari sacrificar-ne uns pocs per salvar la "
"resta. "
#: data/levels/tutorial/digger-tutorial2-grumbel.pingus:5
msgid "Learning to dig"
msgstr "Aprenent a perforar"
#: data/levels/tutorial/digger-tutorial2-grumbel.pingus:6
msgid ""
"This is your first mission. As always, it's pretty easy. All you have to do "
"is to give a Pingu the command to dig a hole into the ground so that they "
"can reach the exit. This can be accomplished simply by clicking on a Pingu. "
msgstr ""
"Aquesta és la teva nova missió. Com sempre, és força fàcil. Tot el que has "
"de fer és donar-li l'ordre a un pingu de que faci un forat a terra de manera "
"que tots puguin arribar a la sortida. Això es pot aconseguir simplement fent "
"clic sobre un pingu. "
#: data/levels/tutorial/floater-tutorial-grumbel.pingus:5
msgid "Float or Die"
msgstr "Flota o mor"
#: data/levels/tutorial/floater-tutorial-grumbel.pingus:6
msgid ""
"Well done in mission one! Now let's start the next one. This time you will "
"need to equip your Pingus with a little propeller, so that they can float to "
"the ground smoothly. If Pingus fall too far, they will not be able to "
"survive the fall, so keep your eyes open! "
msgstr ""
"Ben fet a la missió u! Ara anem a començar la següent. Aquesta vegada "
"necessitaràs equipar els teus pingus amb una petita hèlix, de manera que "
"puguin flotar suaument fins al terra. Si els pingus cauen des de massa "
"amunt, no seran capaços de sobreviure a la caiguda, o sigui que mantingues "
"els ulls oberts! "
#: data/levels/tutorial/jumper-tutorial-grumbel.pingus:5
msgid "Jump for joy"
msgstr "Salta per divertir-te"
#: data/levels/tutorial/jumper-tutorial-grumbel.pingus:6
msgid ""
"Sometimes a Pingu needs to reach a platform that is far away, but not "
"reachable by walking. That's when the Jumper comes in handy - it allows the "
"Pingu to make a small jump and so enables him to reach the platform. "
msgstr ""
"A vegades un pingu necessita accedir a una plataforma que està lluny, però a "
"la que no s'hi pot arribar caminant. Aquí és on va bé tenir un saltador a mà "
"- permet al pingu fer un petit salt i així arribar a la plataforma. "
#: data/levels/tutorial/miner-tutorial2-grumbel.pingus:5
msgid "Miner's heaven"
msgstr "El paradís dels miners"
#: data/levels/tutorial/miner-tutorial2-grumbel.pingus:6
msgid ""
"Another action hits the street - another digging action, this time a "
"diagonal one. It allows a Pingu to dig diagonally through ground, thus "
"creating a path for following Pingus. The action is called Miner. "
msgstr ""
"Una altra acció entra en escena - una altra acció per fer forats, aquesta "
"vegada una de diagonal. Permet a un pingu excavar diagonalment a través del "
"terra, creant així un camí per als altres pingus. L'acció s'anomena miner. "
#: data/levels/tutorial/snow10-grumbel.pingus:5
msgid "Panic Island (float/bash)"
msgstr "L'illa del pànic (flota/excava)"
#: data/levels/tutorial/snow10-grumbel.pingus:6
msgid ""
"While the previous levels have not required much quick action from you, this "
"one gets a bit trickier. The Pingus are coming out of two entrances in "
"parallel and it is your job to coordinate the two groups wisely. "
msgstr ""
"Mentre que els nivells anteriors no han requerit gaire acció ràpida per part "
"teva, aquest es complica una mica. Els pingus vindran de dues entrades en "
"paral·lel, i és la teva feina coordinar els dos grups amb seny. "
#: data/levels/tutorial/snow11-grumbel.pingus:5
msgid "Jump'n Bump... and Bash..."
msgstr "Salta i bota... i excava..."
#: data/levels/tutorial/snow11-grumbel.pingus:6
msgid ""
"It's panic time again. The Pingus will not come out very fast, but since "
"they turn around when they hit walls you will soon have some trouble "
"coordinating them all. Since you only need to save 5 it should be doable, "
"but if all else fails use the pause-mode ('p') to get an overview again. "
msgstr ""
"És l'hora del pànic una altra vegada. Els pingus no sortiran gaire ràpid, "
"però com que donen mitja volta quan arriben a la paret aviat tindràs "
"problemes coordinant-los a tots. Com que només en necessites salvar 5 hauria "
"de ser possible, però si tot falla fes servir la pausa ('p') per tornar a "
"examinar la situació. "
#: data/levels/tutorial/snow12-grumbel.pingus:5
msgid "Two groups in parallel, coordinate wisely"
msgstr "Dos grups en paral·lel, coordina'ls sàviament"
#: data/levels/tutorial/snow12-grumbel.pingus:6
msgid ""
"You have two groups to coordinate this time. No need to panic, since this "
"level gives you enough time to think your actions through. No more tips this "
"time, but good luck! "
msgstr ""
"Aquesta vegada tens dos grups per coordinar. Però no t'espantis, ja que "
"aquest nivell et dóna prou temps per pensar bé les teves accions. No més "
"pistes aquesta vegada, però bona sort! "
#: data/levels/tutorial/snow14-grumbel.pingus:5
msgid "Block'a Rock"
msgstr "Bloca la roca"
#: data/levels/tutorial/snow14-grumbel.pingus:6
msgid ""
"Once again it's time to combine the things you have learned in your previous "
"levels. Blast your way free and make sure you also keep the rest of the "
"Pingus under control. The Blocker action will be helpful."
msgstr ""
"Un cop més és hora de combinar les coses que has après en els nivells "
"anteriors. Barrina fins a alliberar el camí, i assegura't de mantenir a la "
"resta de pingus sota control. L'acció de blocar et serà útil."
#: data/levels/tutorial/snow15-grumbel.pingus:5
msgid "Climb, Climber,... Boom!"
msgstr "Escala, escalador,... Boom!"
#: data/levels/tutorial/snow15-grumbel.pingus:6
msgid ""
"As you might have already figured out from previous levels, you often have "
"to combine different actions to get the job done. Due to the lack of a "
"Digger action in this level the Bomber needs to jump in, but how can it "
"reach the place to bomb? "
msgstr ""
"Tal i com ja deus haver deduït a partir dels nivells anteriors, sovint has "
"de combinar diferents accions per fer la feina. Degut a la falta de "
"perforadors en aquest nivell cal que el bombarder entri en escena. Però com "
"pot arribar fins al lloc que cal fer explotar? "
#: data/levels/tutorial/snow16-grumbel.pingus:5
msgid "Bridging gets more complicated..."
msgstr "Els ponts es compliquen..."
#: data/levels/tutorial/snow16-grumbel.pingus:6
msgid ""
"Once again you have to combine actions carefully and wisely. If you don't "
"you could end up in the hole just before the exit, so think about how to "
"avoid that. "
msgstr ""
"Un cop més has de combinar les accions amb compte i amb seny. Si no, podries "
"acabar en el forat que hi ha just abans de la sortida, o sigui que rumia bé "
"com evitar-ho. "
#: data/levels/tutorial/snow17-grumbel.pingus:5
msgid "If too high, your Pingu will die..."
msgstr "Si és massa alt, el teu Pingu morirà..."
#: data/levels/tutorial/snow17-grumbel.pingus:6
msgid ""
"Teamwork is the way to the exit this time. You don't have enough Floaters to "
"reach the exit, so just send a few and let them prepare the path for the "
"rest. "
msgstr ""
"El treball en equip és la clau aquesta vegada. No tens prou flotadors per "
"arribar fins a la sortida, o sigui que envia'n uns quants i deixa que "
"preparin el camí per a la resta. "
#: data/levels/tutorial/snow19-grumbel.pingus:5
msgid "Learn to use the bridge"
msgstr "Aprèn a fer servir el pont"
#: data/levels/tutorial/snow19-grumbel.pingus:6
msgid ""
"If no Jumper is at hand and a large hole needs to be passed, a bridge can be "
"pretty helpful. It takes some time to build, but unlike the jumper action it "
"allows following Pingus to reach the other end too. "
msgstr ""
"Si no tens cap saltador a mà i hi ha un gran forat que cal passar, un "
"constructor de ponts pot ser força útil. Triga una mica a construir-se, però "
"al contrari que l'acció de saltar permet que els pingus següents també "
"arribin a l'altre costat. "
#: data/levels/tutorial/snow20-grumbel.pingus:5
msgid "Three solutions, it's up to you"
msgstr "Tres solucions, tu decideixes"
#: data/levels/tutorial/snow20-grumbel.pingus:6
msgid ""
"Now that you've learned all the actions, it's time for some more practice. "
"This level presents you with at least three different ways to solve it. It's "
"up to you which one you pick. "
msgstr ""
"Ara que ja has aprés totes les accions, és hora de practicar una mica més. "
"Aquest nivell té almenys tres possibles solucions. Tu decideixes quina "
"triar. "
#: data/levels/tutorial/snow21-grumbel.pingus:5
msgid "Climb, Climber, climb... and build a bridge"
msgstr "Escala, escalador, escala... i construeix un pont"
#: data/levels/tutorial/snow21-grumbel.pingus:6
msgid ""
"Once again you get access to a new action. The Climber action allows a Pingu "
"to climb up straight walls, thus allowing him to reach stuff that might be "
"too high to reach by other means. "
msgstr ""
"Un cop més tens accés a una nova acció. L'escalador permet a un pingu "
"escalar parets, podent així arribar a coses que estan massa amunt com per "
"arribar-hi d'altres maneres. "
#: data/levels/tutorial/snow22-grumbel.pingus:5
msgid "Entrance high, Exit low"
msgstr "Entrada alta, sortida baixa"
#: data/levels/tutorial/snow22-grumbel.pingus:6
msgid ""
"If you don't have enough floaters to bring all the Pingus down to the exit - "
"you have to find other ways to guide them down. You should have learned all "
"the stuff you need for this level in previous levels, so this shouldn't be "
"too much of a problem for you. "
msgstr ""
"Si no tens prou flotadors per portar a tots els pingus fins a la sortida, "
"has de trobar altres maneres de guiar-los fins abaix. Hauries d'haver après "
"tot el que necessites saber en nivells anteriors, o sigui que aquest no "
"hauria de suposar un gran problema. "
#: data/levels/tutorial/snow7-grumbel.pingus:5
msgid "One must prepare, the rest must follow"
msgstr "Un ha de preparar, la resta l'ha de seguir"
#: data/levels/tutorial/snow7-grumbel.pingus:6
msgid ""
"Sometimes there are situations where you don't have a Blocker at hand to "
"coordinate your Pingus. You'll have to find other ways to keep them under "
"control while a single one prepares the path for the rest. "
msgstr ""
"A vegades hi ha situacions on no tens un bloquejador a mà per coordinar els "
"teus pingus. Hauràs de trobar altres maneres de mantenir-los sota control "
"mentre un de sol prepara el camí per a la resta. "
#: data/levels/tutorial/snow8-grumbel.pingus:5
msgid "Dig and float, just don't fall and smash"
msgstr "Perfora i flota, procura no caure i esclafar-te"
#: data/levels/tutorial/snow8-grumbel.pingus:6
msgid ""
"Unlike the first two levels, you have two actions available in this level. "
"Your job is again simple: select an action at the panel on the left and "
"apply it to the Pingus so that they will be able to reach the exit. Make "
"sure that not too many of them die. "
msgstr ""
"A diferència dels dos primers nivells, tens dues accions disponibles en "
"aquest nivell. La teva feina torna a ser senzilla: selecciona una acció des "
"del panell de l'esquerra i aplica-la als pingus de manera que puguin arribar "
"a la sortida. Assegura't de que no en morin gaires. "
#: data/levels/tutorial/snow9-grumbel.pingus:5
msgid "Dig, bash and other problems"
msgstr "Perforar, excavar i altres problemes"
#: data/levels/tutorial/snow9-grumbel.pingus:6
msgid ""
"The more levels you master, the more difficult they will get, but don't "
"panic, as this one is still pretty easy. Just use the stuff that you've "
"learned in the previous levels and you shouldn't have many problems. If you "
"think you've reached a situation from which you can no longer solve the "
"level, double click the armageddon button at the lower right. "
msgstr ""
"Quants més nivells superis, més difícils es tornaran, però no pateixis, "
"doncs aquest és força fàcil. Simplement fes servir el que has aprés en els "
"nivells anteriors i no hauries de tenir gaires problemes. Si creus que has "
"arribat a una situació a partir de la qual ja no pots solucionar el nivell, "
"fes doble clic al botó de l'Apocalipsi que hi ha a baix a la dreta. "
#: data/levels/tutorial/solid-tutorial-grumbel.pingus:5
msgid "Solid ground can block the path"
msgstr "El terra sòlid pot bloquejar el camí"
#: data/levels/tutorial/solid-tutorial-grumbel.pingus:6
msgid ""
"As you have learned in earlier levels your Pingus can dig through basically "
"any terrain, but there is one material which they can't penetrate: steel. "
"These regions are marked dark grey on the level map and cannot be destroyed, "
"so you must find a way around them. "
msgstr ""
"Tal i com has aprés en nivells anteriors, els teus pingus poden excavar a "
"través de bàsicament qualsevol terreny, però hi ha un material que no poden "
"penetrar: l'acer. Aquestes regions estan marcades en gris fosc al mapa del "
"nivell i no poden ser destruïdes, o sigui que hauràs de trobar la manera "
"d'evitar-les. "
#: data/levels/halloween/halloween1-grumbel.pingus:5
msgid "One jump to catch them all"
msgstr "Un salt per agafar-los a tots"
#: data/levels/halloween/halloween1-grumbel.pingus:6
msgid ""
"The pingus have found themselves lost on their journey. What is this "
"mysterious place? Smiling pumpkins, giant candlesticks, and some boiling "
"soup below... what wizardry is this? Now, facing a deadly abyss right in "
"front of them it's your job to save them. Can you save them from a terrible "
"fate?"
msgstr ""
"Els pingus s'han trobat perduts en el seu viatge. Què és aquest lloc "
"misteriós? Carbasses somrients, palmatòries gegants, i una mica de sopa "
"bullent a sota... Quina mena de bruixeria és aquesta? Ara, enfrontats amb un "
"abisme mortal just davant d'ells, la teva feina és salvar-los. Pots lliurar-"
"los del seu terrible destí?"
#: data/levels/halloween/halloween2-grumbel.pingus:5
msgid "One Thousand and One Jumps"
msgstr "Mil i un salts"
#: data/levels/halloween/halloween2-grumbel.pingus:6
msgid ""
"With the exit so high above and far out of reach for a normal Pingu, what "
"options are there? Perhaps a jumper can rescue them? Or will he simply slow "
"their inevitable demise? It's your job to find out, but are you good enough "
"to save them all?"
msgstr ""
"Amb la sortida tant amunt i fora de l'abast d'un pingu normal, quines "
"opcions hi ha? Potser un saltador els pot rescatar? O simplement endarrerirà "
"el seu inevitable destí? Descobrir-ho és la teva feina, però ets prou bo per "
"salvar-los a tots?"
#: data/levels/halloween/halloween3-grumbel.pingus:5
msgid "Boom Boom"
msgstr "Boom boom"
#: data/levels/halloween/halloween3-grumbel.pingus:6
msgid ""
"You've mastered the last challenge and now face the next. Their path to "
"salvation seems to be cursed, but by whom? There is no time to think about "
"it, since the next deadly challenge already awaits the Pingus. Two mighty "
"roots block the way, but without a basher at hand to bash them away, "
"sacrifice might be the only option..."
msgstr ""
"Has superat el darrer repte i ara t'enfrontes al següent. El seu camí cap a "
"la salvació sembla estar maleit, però per qui? No hi ha temps per pensar-hi, "
"doncs el proper desafiament mortífer ja espera als pingus. Dues enormes "
"arrels bloquegen el camí, però sense un excavador a mà per foradar-les el "
"sacrifici podria ser l'única opció..."
#: data/levels/halloween/halloween4-grumbel.pingus:5
msgid "Full Circle"
msgstr "Cercle complet"
#: data/levels/halloween/halloween4-grumbel.pingus:6
msgid ""
"The exit is so close, yet out of reach. A step in the wrong direction and "
"the Pingus will fall to a terrible fate. You must do something to help them, "
"but is there enough time? You have to hurry and can't allow yourself any "
"mistakes. The Pingus are counting on you!"
msgstr ""
"La sortida és tan a prop, i alhora fora del vostre abast. Un pas en la "
"direcció equivocada, i els pingus cauran cap a un terrible destí. Has de fer "
"alguna cosa per ajudar-los, però hi ha prou temps? T'has de donar pressa i "
"no et pots permetre cap error. Els pingus compten amb tu!"
#: data/levels/halloween/halloween5-grumbel.pingus:5
msgid "Bridgers Nightmare"
msgstr "El malson dels enginyers"
#: data/levels/halloween/halloween5-grumbel.pingus:6
msgid ""
"Who placed this monstrous wall here? This terrible blockade separates your "
"Pingus from the exit. Destruction of its awful construction seems an "
"impossibility, but perhaps the bridger can come to the rescue? Can they "
"build their bridges high enough to guide the group yet again safely to the "
"exit? Or is somebody playing evil mind tricks with you?\n"
"\n"
"Yet again the solution is your call... your gray matter is the key to the "
"Pingus' success, so don't let yourself get confused and misguided from the "
"true path."
msgstr ""
"Qui ha posat aquesta monstruosa paret aquí? Aquest terrible bloc separa els "
"teus pingus de la sortida. La destrucció d'aquesta horrible construcció "
"sembla una impossibilitat, però potser el creador de ponts pot acudir al "
"rescat? Poden construir els seus ponts prou amunt com per guiar al grup sa i "
"estalvi un cop més cap a la sortida? O algú està jugant amb tu?\n"
"\n"
"Un cop més la solució és cosa teva... la teva matèria gris és la clau de "
"l'èxit dels pingus, o sigui que no et deixis confondre i apartar del "
"veritable camí."
#: data/levels/halloween/halloween6-grumbel.pingus:5
msgid "Locked up by the witch"
msgstr "Empresonats per la bruixa"
#: data/levels/halloween/halloween6-grumbel.pingus:6
msgid ""
"Is this a prison? Blocked by solid walls all around, there doesn't seem to "
"be a way to escape. Salvation seems impossible. But wait... the wall to the "
"right seems weak... perhaps this is a way to escape? Or is it a false path "
"that will lead to the Pingus' doom?\n"
"\n"
"This is a risky trip, but you must take it to find out how to bring them all "
"to freedom once again."
msgstr ""
"Això és una presó? Bloquejats per parets sòlides al voltant, no sembla que "
"hi hagi manera d'escapar. La salvació sembla impossible. Però espera... la "
"paret de la dreta sembla dèbil... potser hi ha una manera d'escapar? O és un "
"fals camí que conduirà als pingus a la seva perdició?\n"
"\n"
"Aquest és un viatge arriscat, però l'hauràs de fer per descobrir com "
"alliberar-los a tots un cop més."
#: data/levels/halloween/halloween7-grumbel.pingus:5
msgid "Splatterfest"
msgstr "Festival d'esclafades"
#: data/levels/halloween/halloween7-grumbel.pingus:6
msgid ""
"This is by far the deepest pit the Pingus have yet encountered. Building a "
"bridge across it seems obvious but that won't help since the exit is deep "
"down in the pit itself. Pingus who try to go down the pit will just end up "
"splattered all over the ground. You have two groups of Pingus at your "
"disposal, can you make them work together to reach even an exit this well "
"hidden?"
msgstr ""
"Aquest és, de lluny, el pou més profund que els pingus s'han trobat fins "
"ara. Construir un pont per creuar-lo sembla obvi, però això no ajudarà, ja "
"que la sortida està ben avall dins del mateix pou. Els pingus que intentin "
"baixar-hi acabaran esclafats contra el terra. Tens dos grups de pingus a la "
"teva disposició. Pots fer que treballin junts per arribar fins i tot a una "
"sortida tan ben amagada com aquesta?"
#: data/levels/halloween/halloween8-plouj.pingus:5
msgid "Staircase Maintenance"
msgstr "Manteniment de l'escala"
#: data/levels/halloween/halloween8-plouj.pingus:6
msgid ""
"It seems we are up again against a mighty wall, and it is blocking the exit! "
"But wait, some good soul has built a staircase around it. It seems, however, "
"that the poor fool's efforts didn't last long, as the staircase is destroyed "
"and full of holes. Can you fix it and make it over the wall? Yet of course "
"you know that the right solution might not be the obvious one. But your "
"Pingus are almost free, and they trust in your skill to guide them to safety "
"once more. Succeed and you will have freed them once and for all from "
"whatever evildoer that placed them in this nightmare... at least for this "
"year."
msgstr ""
"Sembla que hem tornat a topar amb una paret imponent, i està bloquejant la "
"sortida! Però espera, un bon samarità ha construït una escala al seu "
"voltant. Sembla, tanmateix, que els esforços del pobre beneit no han durat "
"gaire, doncs l'escala està destruïda i plena de forats. Pots arreglar-la i "
"arribar fins dalt de la paret? És clar que tu ja saps que la solució "
"correcta pot no ser la més òbvia. Però els teus pingus ja gairebé són "
"lliures, i confien en la teva habilitat per guiar-los de nou. Si ho "
"aconsegueixes els hauràs alliberat d'una vegada per totes del malfactor que "
"els va posar en aquest malson... al menys durant aquest any."
#: data/levels/halloween2011/halloween10-grumbel.pingus:5
msgid "Down Into The Cave"
msgstr "Dins de la cova"
#: data/levels/halloween2011/halloween10-grumbel.pingus:6
msgid ""
"The exit is far below and the pingus are separated from it by quite a "
"distance. The path down is riddled with gulfs, so jumping and bridging will "
"be the primary tool to get down there. But be careful, the last few steps "
"require some extra cleverness."
msgstr ""
"La sortida es troba ben avall, i els pingus estan separats d'ella per una "
"distància considerable. El camí cap avall és ple d'abismes, o sigui que "
"saltar i fer ponts seran les eines principals per arribar-hi. Però ves amb "
"compte, les últimes passes requereixen una dosi extra d'intel·ligència."
#: data/levels/halloween2011/halloween11-grumbel.pingus:5
msgid "Round and Round"
msgstr "Volta i volta"
#: data/levels/halloween2011/halloween11-grumbel.pingus:6
msgid ""
"Trapped in an eternal loop one brave pingu has to break out and go on a "
"journey in search for the exit, but he mustn't be too happy once he found "
"it, as there is still one last challenge he must solve before being allowed "
"to enter it, otherwise all his friends might perish."
msgstr ""
"Atrapats en un bucle sense fi, un pingu ha de sortir i embarcar-se en un "
"viatge a la recerca de la sortida. Però que no s'alegri gaire quan la trobi, "
"doncs encara hi ha un últim repte que haurà de resoldre abans que se li "
"permeti l'entrada. En cas contrari, tots els seus amics periran."
#: data/levels/halloween2011/halloween12-grumbel.pingus:5
msgid "Red Herring Cave"
msgstr "La cova de l'arengada vermella"
#: data/levels/halloween2011/halloween12-grumbel.pingus:6
msgid ""
"The exit is right above the pingus heads, with a few friendly arrows "
"pointing the way. With jumpers around the solution should be obvious. But "
"wait, can anything you find in a dark cave be trusted or is there some more "
"going on which might slip your view? Thinking outside the box might be "
"required."
msgstr ""
"La sortida és just damunt dels caps dels pingus, amb unes amistoses fletxes "
"assenyalant el camí. Tenint saltadors a mà la solució hauria de ser òbvia. "
"Però espera, pots confiar en qualsevol cosa que trobis en una cova fosca, o "
"hi ha alguna cosa més que podria despistar-te? Pensar de manera diferent "
"podria ser necessari."
#: data/levels/halloween2011/halloween13-grumbel.pingus:5
msgid "Group Coordination"
msgstr "Coordinació del grup"
#: data/levels/halloween2011/halloween13-grumbel.pingus:6
msgid ""
"Three groups are on their way to the exit, one of them trapped right above "
"it, but locked into a box. None of them can make it alone, coordinate them "
"wisely and everybody should be able to make it safely to the exit. "
msgstr ""
"Tres grups es dirigeixen cap a la sortida, un d'ells atrapat just a sobre "
"d'ella però tancat en una capsa. Cap d'ells pot arribar-hi sol. Coordina'ls "
"amb saviesa i tothom hauria de ser capaç d'arribar sa i estalvi a la "
"sortida. "
#: data/levels/halloween2011/halloween14-grumbel.pingus:5
msgid "Traps, Dangers and other Problems"
msgstr "Trampes, perills, i altres problemes"
#: data/levels/halloween2011/halloween14-grumbel.pingus:6
msgid ""
"The path to the exit lays below, shimmering through the planks. But the fall "
"is too high, deadly for sure. Can one pingu alone make it's way through the "
"dangerous traps and secure the path to the exit?"
msgstr ""
"El camí fins a la sortida s'estén per sota, brillant a través dels taulons. "
"Però la caiguda és massa alta, mortal de necessitat. Pot un sol pingu obrir-"
"se camí a través de perilloses trampes i assegurar el camí fins a la sortida?"
#: data/levels/halloween2011/halloween15-grumbel.pingus:5
msgid "Reach that Switch"
msgstr "Arriba a aquell interruptor"
#: data/levels/halloween2011/halloween15-grumbel.pingus:6
msgid ""
"The path to the exit is straight, flat and simple, but wait a solid door "
"blocking the way? How can the pingus open it? Is that a switch there on the "
"hill to the right? Might that be the solution to opening the door and "
"freeing the pingus? But how can they reach that switch?"
msgstr ""
"El camí fins a la sortida és recte, pla i simple. Però espera, una porta "
"sòlida bloquejant el camí? Com poden els pingus obrir-la? Allò que hi ha "
"allà a la dreta del turó és un interruptor? Podria ser la solució per obrir "
"la porta i alliberar els pingus? Però com poden arribar-hi?"
#: data/levels/halloween2011/halloween16-grumbel.pingus:5
msgid "The Collapsed Column"
msgstr "La columna esfondrada"
#: data/levels/halloween2011/halloween16-grumbel.pingus:6
msgid ""
"High up above the green slime the pingus are moving from column to column, "
"getting closer to the exit with each step, but wait, there is a second group "
"of pingus, they are stuck. The column next to them has collapsed making "
"getting to the exit impossible. Can you find a way around the abyss?"
msgstr ""
"Molt amunt per sobre del llim verd els pingus es mouen de columna a columna, "
"acostant-se a la sortida a cada pas. Però espera, hi ha un segon grup de "
"pingus, estan encallats. La columna que hi ha al seu costat s'ha ensorrat, "
"fent que sigui impossible arribar fins a la sortida. Pots trobar una manera "
"d'evitar l'abisme?"
#: data/levels/halloween2011/halloween17-grumbel.pingus:5
msgid "Island of Doom"
msgstr "L'illa de la fatalitat"
#: data/levels/halloween2011/halloween17-grumbel.pingus:6
msgid ""
"The pingus are released close together, but split up by a solid metal column "
"with seemingly no way to join them back up. The journey will be dangerous "
"and some height has be crossed with the exit hidden below. With some "
"cleverness it should be possible to join those two groups back together."
msgstr ""
"Els pingus són alliberats molt junts, però separats per una columna de "
"metall sòlida sense cap manera evident d'ajuntar-los de nou. El viatge serà "
"perillós i certa alçada ha de ser creuada amb la sortida amagada a sota. Amb "
"una mica d'intel·ligència hauria de ser possible tornar a unir els dos grups."
#: data/levels/halloween2011/halloween18-grumbel.pingus:5
msgid "Tower of Death"
msgstr "La torre de la mort"
#: data/levels/halloween2011/halloween18-grumbel.pingus:6
msgid ""
"The pingus are at the top of the tower, with no stairway around. The exit is "
"deep down, hidden at the foot of the tower. How shall they make it down all "
"that height with no floaters sight? A few well placed diggers should be "
"enough to get the job done, but wait, no, their direction isn't quite right. "
"You have to give them directions or it will be their doom."
msgstr ""
"Els pingus són a dalt de tot de la torre, sense cap escala al seu voltant. "
"La sortida és molt avall, amagada al peu de la torre. Com podran baixar tota "
"aquesta alçada sense cap flotador a la vista? Uns pocs perforadors ben "
"situats haurien de ser suficients per aconseguir-ho. Però espera... no, la "
"seva direcció no és del tot correcta. Els has de donar indicacions, o serà "
"la seva perdició."
#: data/levels/halloween2011/halloween19-rz.pingus:5
msgid "The Ones"
msgstr ""
#: data/levels/halloween2011/halloween19-rz.pingus:6
msgid ""
"This is the last stage the pingus have to pass during this Halloween. Two "
"oddly familiar column are in the way. What do they mean? The two groups of "
"pingus have to work together to make it down the columns to the exit far "
"below."
msgstr ""
"Aquesta és la darrera etapa que els pingus han de superar durant aquest "
"Halloween. Dues columnes estranyament familiars estan al mig del camí. Què "
"signifiquen? Els dos grups de pingus han de treballar junts per baixar per "
"elles fins arribar a la sortida."
#: data/levels/desert/desert1-janne.pingus:5
msgid "Down the valley and up again"
msgstr "Baixant per la vall, i pujant de nou"
#: data/levels/desert/desert1-janne.pingus:6
msgid ""
"There is a large valley between the entrance and the exit. No bridge will be "
"long enough to cross the valley, but can you find a way back up once you "
"lead the Pingus down into the valley?"
msgstr ""
"Hi ha una gran vall entre l'entrada i la sortida. Cap pont serà prou llarg "
"per creuar-la, però... pots trobar una manera de tornar a pujar un cop hagis "
"fet baixar els pingus per la vall?"
#: data/levels/desert/desert1.pingus:5
msgid "Entering the pyramid"
msgstr "Entrant a la piràmide"
#: data/levels/desert/desert1.pingus:6
msgid ""
"After their long and dangerous journey through the desert the Pingus finally "
"reach the large pyramid, but there is still a pedestal blocking their way."
msgstr ""
"Després del seu llarg i perillós viatge a través del desert els pingus "
"finalment arriben a la gran piràmide. Però encara hi ha un pedestal "
"bloquejant el seu camí."
#: data/levels/desert/desert2.pingus:5
msgid "The window room"
msgstr "L'habitació de la finestra"
#: data/levels/desert/desert2.pingus:6
msgid ""
"After the Pingus have entered the pyramid, they reach a large room with a "
"large window. The only problem they have is that the entrance to the room is "
"much too high to survive the landing. Can you help them?"
msgstr ""
"Després de que els pingus hagin entrat a la piràmide, arriben a una gran "
"habitació amb una gran finestra. L'únic problema que tenen és que l'entrada "
"a l'habitació és massa amunt com per sobreviure a l'aterratge. Pots ajudar-"
"los?"
#: data/levels/desert/desert3-jings.pingus:5
msgid "Grand Hall"
msgstr "La gran sala"
#: data/levels/desert/desert3-jings.pingus:6
msgid ""
"The pingus have found themselves in the grand hall, a hall full of wonder "
"and treasures. The exit however is high up and won't be easy to reach. Guide "
"the pingus around the hall and maybe you will find a way."
msgstr ""
"Els pingus s'han trobat a la gran sala, una habitació plena de meravelles i "
"tresors. La sortida, tanmateix, està a dalt, i no serà fàcil arribar-hi. "
"Guia els pingus per la sala i potser trobaràs una manera."
#: data/levels/desert/desert3.pingus:5
msgid "Pass the pedestal"
msgstr "Passa el pedestal"
#: data/levels/desert/desert3.pingus:6
msgid ""
"A large pedestal is blocking the way to the exit and there aren't enough "
"bashers available to dig it away. Can you find a way to make it past the "
"pedestal?"
msgstr ""
"Un gran pedestal bloqueja el camí cap a la sortida i no hi ha prou "
"excavadors disponibles per cavar-hi un forat. Pots trobar una manera de "
"travessar el pedestal?"
#: data/levels/desert/desert4.pingus:5
msgid "The excavation of the pyramid"
msgstr "L'excavació de la piràmide"
#: data/levels/desert/desert4.pingus:6
msgid ""
"The excavations are open to reach the pyramid for his redeeming content. "
"Some excavations, however, is best done with two competitors. Who comes "
"first?"
msgstr ""
"Les excavacions estan obertes per arribar a la piràmide a buscar el seu "
"contingut redemptor. Algunes excavacions, tanmateix, és millor fer-les amb "
"dos competidors. Qui va primer?"
#: data/levels/desert/desert5.pingus:5
msgid "Catch them at the half way point"
msgstr "Atrapa'ls a mig camí"
#: data/levels/desert/desert5.pingus:6
msgid ""
"The Pingus are separated from the exit by large abyss. A simple bridge won't "
"be enough to catch them safely, unless of course you find the right place to "
"put it. Can you uncover that spot?"
msgstr ""
"Els pingus estan separats de la sortida per un gran abisme. Un simple pont "
"no serà suficient per atrapar-los sense perill. A no ser, és clar, que "
"trobis el lloc adequat per posar-lo. Sabràs trobar aquest punt?"
#: data/levels/desert/desert5-tflavel.pingus:5
msgid "Claustrophobia"
msgstr "Claustrofòbia"
#: data/levels/desert/desert5-tflavel.pingus:6
msgid ""
"Hidden deep below the pyramid the pingus come across a small underground "
"room, but unfortunately a large tree root blocks their path..."
msgstr ""
"Amagada en el racó més profund de la piràmide els pingus troben una petita "
"habitació subterrània, però malauradament una gran arrel d'arbre bloqueja el "
"seu camí..."
#: data/levels/desert/desert6-grumbel.pingus:5
msgid "A bit to the right a bit to left"
msgstr "Una mica a la dreta, una mica a l'esquerra"
#: data/levels/desert/desert6-grumbel.pingus:6
msgid "Only the most audacious Pingus will be allowed to continue."
msgstr "Només els pingus més audaços podran continuar."
#: data/levels/desert/desert7-grumbel.pingus:5
msgid "25 Pingus free and 25 in the box"
msgstr "25 pingus lliures i 25 a la capsa"
#: data/levels/desert/desert7-grumbel.pingus:6
msgid ""
"Okay for the Bridger but what can I do with Digger? You should save at least "
"one Pingu trapped in the box above the exit."
msgstr ""
"L'enginyer ja m'està bé, però què puc fer amb el perforador? Hauries de "
"salvar al menys un dels pingus atrapats a la capsa que hi ha a sobre de la "
"sortida."
#: data/levels/desert/desert8-grumbel.pingus:5
msgid "Tunnel Time"
msgstr "L'hora del túnel"
#: data/levels/desert/desert8-grumbel.pingus:6
msgid ""
"Dig a tunnel and you might make it to the exit. Digger and miners and stuff "
"have to work together."
msgstr ""
"Excava un túnel i potser arribaràs a la sortida. Perforadors i miners i "
"similars han de treballar junts."
#: data/levels/desert/desert-crawl-timpany.pingus:5
msgid "Crawlspace"
msgstr "Espai confinat"
#: data/levels/desert/desert-crawl-timpany.pingus:6
msgid ""
"The path to the exit is blocked and many small tunnels lead the way, but be "
"careful some of those lead to certain death. Or is there something you can "
"do about that and create a save passage for all the Pingus and lead them "
"safely to the exit?"
msgstr ""
"El camí fins a la sortida està bloquejat i molts túnels petits indiquen el "
"camí a seguir. Però ves amb compte, alguns porten a una mort segura. O hi ha "
"alguna cosa que pugis fer-hi per crear un passadís segur per a tots els "
"pingus i portar-los sans i estalvis fins a la sortida?"
#: data/levels/desert/desertwaste1-grumbel.pingus:5
msgid "The Roof"
msgstr "La teulada"
#: data/levels/desert/desertwaste1-grumbel.pingus:6
msgid ""
"Sometimes the roofs are not good for refuge, sometimes it should be "
"demolished! But be careful if you aren't precise enough, you might lead the "
"Pingus straight to certain death."
msgstr ""
"A vegades les teulades no són bones per refugiar-se, a vegades s'haurien de "
"demolir! Però ves amb compte. Si no ets prou precís, podries guiar als "
"pingus directament cap a una mort segura."
#: data/levels/desert/indiana-yingwan.pingus:5
msgid "Pingus Jones and the Last Exit"
msgstr "Pingus Jones i l'última sortida"
#: data/levels/desert/indiana-yingwan.pingus:6
msgid ""
"Dr. Jones' notebook:\n"
"\n"
" (1) the breath of God: only the penitent pingus will pass;\n"
" (2) the word of God... in reverse;\n"
" (3) the path of God: leap from the head of something like a cat."
msgstr ""
"Llibre de notes del doctor Jones:\n"
"\n"
" (1) l'alè de Déu: només els pingus penitents passaran\n"
" (2) la paraula de Déu... a l'inrevés\n"
" (3) el camí de Déu: salta des del cap d'alguna cosa, \n"
" com ara un gat"
#: data/levels/mysteryisland/cave1-marcotte.pingus:5
msgid "Near can mean far"
msgstr "A prop pot voler dir lluny"
#: data/levels/mysteryisland/cave1-marcotte.pingus:6
msgid ""
"What do you do when you're going in the wrong direction ? Simple: walk into "
"a wall. But it is easier said than done..."
msgstr ""
"Què fas quan vas en la direcció equivocada? Simple: topar contra una paret. "
"Però és més fàcil de dir que de fer..."
#: data/levels/mysteryisland/cave-lac.pingus:7
msgid "Trapped Underground"
msgstr "Atrapats sota terra"
#: data/levels/mysteryisland/cave-lac.pingus:8
msgid ""
"The penguins escaped the mad scientist, but now they were trapped deep "
"underground. They had no food or water, so they had to move fast."
msgstr ""
"Els pingüins s'han escapat del científic boig, però ara estan atrapats sota "
"terra. No tenen menjar ni aigua, o sigui que s'han de moure ràpid."
#: data/levels/mysteryisland/emperiment-lac.pingus:5
msgid "Experimentation"
msgstr "Experimentació"
#: data/levels/mysteryisland/emperiment-lac.pingus:6
msgid ""
"A mad scientist has captured the penguins and is experimenting on them. How "
"can the penguins escape the guillotine?"
msgstr ""
"Un científic boig ha capturat els pingus i està experimentant amb ells. Com "
"poden els pingüins escapar de la guillotina?"
#: data/levels/mysteryisland/hall-of-illusion-lac.pingus:5
msgid "Hall of Illusion"
msgstr "L'habitació de la il·lusió"
#: data/levels/mysteryisland/hall-of-illusion-lac.pingus:6
msgid ""
"The penguins stopped and stood in indecision. What was real and what was "
"not? Flame lanced from above and a guillotine glittered in the distance. "
"Almost all penguins must survive."
msgstr ""
"Els pingüins es van aturar indecisos. Què era real i què no? Flames "
"brollaven des de dalt i una guillotina lluïa en la distància. Gairebé tots "
"els pingüins han de sobreviure."
#: data/levels/mysteryisland/lavapit3.pingus:7
msgid "The Lava Pit"
msgstr "El pou de lava"
#: data/levels/mysteryisland/lavapit3.pingus:8
msgid ""
"The penguins had defeated the mad scientist, and were walking away from his "
"destroyed laboratory when a huge hole opened under their feet. The penguins "
"fell into an underground cave and the only way out was across the lava pit. "
"Luckily, it seemed someone had left some helpful signs."
msgstr ""
"Els pingüins havien derrotat finalment al científic boig, i estaven marxant "
"del seu malaguanyat laboratori quan un enorme forat es va obrir sota els "
"seus peus. Els pingüins van caure dins d'una cova subterrània, i la única "
"manera de sortir-ne era creuant un pou de lava. Per sort, sembla que algú "
"havia deixat algunes indicacions útils."
#: data/levels/mysteryisland/madscientist1-lac.pingus:7
msgid "At least the experiments are over..."
msgstr "Almenys s'han acabat els experiments..."
#: data/levels/mysteryisland/madscientist1-lac.pingus:8
msgid ""
"The good news was that the mad scientist had tired of his experiments, the "
"bad news was that now he was dumping them down a pit. A single flotation "
"device was all the penguins had. Save as many as possible."
msgstr ""
"La bona notícia és que el científic boig s'havia cansat dels seus "
"experiments, la mala notícia és que ara els estava llençant per un forat. Un "
"sol dispositiu de flotació és tot el que tenien els pingus. Salva'n tants "
"com puguis."
#: data/levels/mysteryisland/multi1-lac.pingus:7
msgid "Ghosting"
msgstr ""
#: data/levels/mysteryisland/multi1-lac.pingus:8
msgid ""
"The penguins came to a long pass. Acid bubbled underneath and it seemed a "
"climber or two were needed. Hint: slider can be used to stop the miner "
"ability."
msgstr ""
"Els pingus van arribar a una llarga gorja. Àcid bombollejava a sota, i "
"semblava que un escalador o dos eren necessaris. Pista: el lliscador es pot "
"fer servir per aturar al miner."
#: data/levels/mysteryisland/rainy1-lac.pingus:7
msgid "The Final (and surprisingly easy) Challenge"
msgstr "El darrer (i sorprenentment fàcil) repte"
#: data/levels/mysteryisland/rainy1-lac.pingus:8
msgid ""
"The penguins had reached the end of the island. In the water was a long "
"tree, perfect for the penguin's needs. Their journey was almost over."
msgstr ""
"Els pingüins havien arribat al final de l'illa. A l'aigua hi havia un gran "
"arbre, perfecte per a les seves necessitats. El viatge gairebé havia acabat."
#: data/levels/mysteryisland/revenge1-lac.pingus:7
#: data/levels/mysteryisland/revenge2-lac.pingus:7
msgid "Revenge is sweet"
msgstr "La venjança és dolça"
#: data/levels/mysteryisland/revenge1-lac.pingus:8
msgid ""
"The penguins had escaped the mad scientist but now they wanted revenge. They "
"intended to destroy the support structures, sending the evil laboratory "
"crashing down."
msgstr ""
"Els pingüins havien escapat del científic boig però ara volien venjança. "
"Pretenien destruir les estructures de suport, provocant que el malvat "
"laboratori s'ensorrés."
#: data/levels/mysteryisland/revenge2-lac.pingus:8
msgid ""
"The penguins had escaped the mad scientist but now they wanted revenge. They "
"intended to destroy the support structures, sending the evil laboratory "
"crashing down. They had to move fast though, because the mad scientist would "
"detect and recapture them if they weren't fast enough."
msgstr ""
"Els pingüins havien escapat del científic boig però ara volien venjança. "
"Pretenien destruir les estructures de suport, provocant que el malvat "
"laboratori caigués. Però s'havien de moure ràpid, doncs el científic boig "
"els detectaria i tornaria a capturar-los si no ho eren."
#: data/levels/mysteryisland/snow2-lac.pingus:7
msgid "Winter Wonderland"
msgstr "Hivern al país de les meravelles"
#: data/levels/mysteryisland/snow2-lac.pingus:8
msgid ""
"After getting past the lava pit, the penguins walked and walked until they "
"reached a snowed in exit. That would be relatively easy to tunnel through "
"but how would it be possible to tunnel through solid metal?"
msgstr ""
"Després de passar el pou de lava, els pingüins van caminar fins arribar a "
"una sortida nevada. Això seria relativament fàcil d'excavar, però com seria "
"possible fer un túnel a través de metall sòlid?"
#: data/levels/mysteryisland/theend-lac.pingus:7
msgid "The Journey Goes On"
msgstr "El viatge continua"
#: data/levels/mysteryisland/theend-lac.pingus:8
msgid ""
"And so the penguins continued on their journey, drawing ever closer to the "
"North Pole. They had escaped the guillotine, defeated the mad scientist and "
"got a new boat. And so this chapter in their voyage was over, but there "
"would be other obstacles. Nothing would stop the determined penguins from "
"reaching their goal."
msgstr ""
"I així els pingüins continuaren el seu viatge, acostant-se cada vegada més "
"al Pol Nord. S'havien escapat de la guillotina, derrotat al científic boig i "
"aconseguit un nou bot. Així acabava aquest capítol del seu viatge, però hi "
"haurà altres obstacles. Res evitarà que els decidits pingüins arribin al seu "
"objectiu."
#: data/levels/mysteryisland/use-the-slide-lac.pingus:7
msgid "Think fast (literally)"
msgstr "Pensa ràpid (literalment)"
#: data/levels/mysteryisland/use-the-slide-lac.pingus:8
msgid ""
"This would be simple but for one thing, there are no blockers. All the "
"penguins must survive."
msgstr ""
"Això seria fàcil si no fos per una cosa: no hi ha bloquejadors. Tots els "
"pingus han de sobreviure."
#: data/levels/mysteryisland/volcano1-grumbel.pingus:5
msgid "Shipwrecked"
msgstr "Nàufrags"
#: data/levels/mysteryisland/volcano1-grumbel.pingus:6
msgid ""
"The penguins were sailing along happily on their makeshift boat until "
"suddenly an island appeared. The penguins were drawn towards it and crashed, "
"destroying their boat. Now they must find their way across this strange "
"island."
msgstr ""
"Els pingüins estaven navegant feliçment en el seu improvisat bot fins que, "
"de cop, una illa aparegué. Els pingüins van ser arrossegats contra ella i "
"van xocar-hi, destruint el seu bot. Ara han de trobar un camí per creuar "
"aquesta estranya illa."
#: data/levels/alien/aliens1-phil.pingus:7
msgid "Escape from Aliens"
msgstr "Fugida dels alienígenes"
#: data/levels/alien/aliens1-phil.pingus:8
msgid ""
"Aliens invade our starship blocking entrance to the teleporter. Your crew is "
"well trained, like you they don't panic."
msgstr ""
"Els alienígenes envaeixen la nostra nau bloquejant l'entrada al "
"teleportador. La teva tripulació està ben entrenada, i al igual que tu no es "
"deixa dominar pel pànic."
#: data/levels/alien/aliens2-phil.pingus:7
msgid "Escape from Aliens 2"
msgstr "Fugida dels alienígenes 2"
#: data/levels/alien/aliens2-phil.pingus:8
msgid "Aliens are now closest making your escape harder. You must dig it up."
msgstr ""
"Els alienígenes estan ara més a prop, dificultant la teva escapada. Te "
"l'hauràs d'excavar."
#: data/levels/alien/aliens4-phil.pingus:5
msgid "Alien's nest"
msgstr "El niu dels alienígenes"
#: data/levels/alien/aliens4-phil.pingus:6
msgid "Pingus invade the nest. Take care of jaws. What's the matrix above?"
msgstr ""
#: data/levels/alien/aliens5-phil.pingus:5
msgid "Matrix of the death"
msgstr "La matriu de la mort"
#: data/levels/alien/aliens5-phil.pingus:6
msgid ""
"Take a piece of paper. Now pingus have to enter the matrix of the death. "
"This is a maze, bad ways are protect by jaws."
msgstr ""
#: data/levels/alien/aliens6-phil.pingus:7
msgid "Spy's pingus in the matrix of the death"
msgstr "Pingus espies a la matriu de la mort"
#: data/levels/alien/aliens6-phil.pingus:8
msgid ""
"Spy's pingus have marked the location of jaws in the matrix of the death. "
"Many died to gain that information :..( Perhaps this help. Perhaps..."
msgstr ""
#: data/levels/alien/aliens7-phil.pingus:7
msgid "Fourth dimension"
msgstr "Quarta dimensió"
#: data/levels/alien/aliens7-phil.pingus:8
msgid ""
"The defenses of the aliens get stronger. Now you have to jump in the fourth "
"dimension to win!"
msgstr ""
"Les defenses dels alienígenes és fan més fortes. Ara has de saltar a la "
"quarta dimensió per guanyar!"
#: data/levels/alien/space-11-rz+eriksoe.pingus:5
msgid "Set your watches"
msgstr "Sincronitzeu els vostres rellotges"
#: data/levels/alien/space-11-rz+eriksoe.pingus:6
msgid "Cooperation in space."
msgstr "Cooperació a l'espai."
#: data/levels/alien/space2.pingus:5
msgid "Lost in Space"
msgstr "Perduts a l'espai"
#: data/levels/alien/space2.pingus:6
msgid "We don't know where we are but we don't leave anybody behind."
msgstr "No sabem on som, però no deixem a ningú enrere."
#: data/levels/alien/space-9-tom.pingus:5
msgid "Outside In"
msgstr ""
#: data/levels/alien/space-9-tom.pingus:6
msgid "Can you help the pingus escape without getting their flippers wet?"
msgstr "Pots ajudar als pingus a escapar sense mullar-se les aletes?"
#: data/levels/alien/space-loop-timpany.pingus:5
msgid "Endless Loop"
msgstr "Bucle infinit"
#: data/levels/alien/space-loop-timpany.pingus:6
msgid ""
"To the right and to the left the Pingus will face certain death and you have "
"to save 50. Can you help them get out of this mess?"
msgstr ""
"Tant a la dreta com a l'esquerra els pingus s'enfronten a una mort segura, i "
"n'has de salvar 50. Pots ajudar-los a sortir d'aquest embolic?"
#: data/levels/alien/space-tom1.pingus:7
msgid "Up up in the space"
msgstr "Amunt amunt a l'espai"
#: data/levels/alien/space-tom1.pingus:8
msgid "What good is a pick in space? Certainly not to go to the stars."
msgstr ""
"De què serveix un pic a l'espai? Certament no per anar a les estrelles."
#: data/levels/factorycampaign/factory_campaign10.pingus:5
msgid "Jump"
msgstr "Salta"
#: data/levels/factorycampaign/factory_campaign10.pingus:6
msgid ""
"All Pingus need is to jump.... Hint: While pausing (press P key) you still "
"can control Pingus. "
msgstr ""
"Tot el que els pingus han de fer es saltar... Pista: mentre estàs en pausa "
"(tecla P) pots seguir controlant els pingus. "
#: data/levels/factorycampaign/factory_campaign11.pingus:5
msgid "Factory"
msgstr "Fàbrica"
#: data/levels/factorycampaign/factory_campaign11.pingus:6
msgid ""
"Finally you reached the factory. Watch out as there are many dangers. Use "
"bombers to destroy the basement of the factory. Good luck!"
msgstr ""
"Finalment has arribat a la fàbrica. Vigila, doncs hi ha molts perills. Fes "
"servir bombarders per destruir-ne els fonaments. Bona sort!"
#: data/levels/factorycampaign/factory_campaign12.pingus:5
msgid "Going back home"
msgstr "Tornant cap a casa"
#: data/levels/factorycampaign/factory_campaign12.pingus:6
msgid "Your mission is over. Pingus can go back home, but be careful!"
msgstr ""
"La teva missió ha acabat. Els pingus poden tornar a casa, però ves amb "
"compte!"
#: data/levels/factorycampaign/factory_campaign13.pingus:5
msgid "Bonus track"
msgstr "Missió extra"
#: data/levels/factorycampaign/factory_campaign13.pingus:6
msgid ""
"Pingus are at home, but after the climate change living on the South Pole "
"became more dangerous. There is one more mission for you."
msgstr ""
"Els pingus són a casa, però després del canvi climàtic viure al Pol Sud s'ha "
"tornat més perillós. Hi ha una missió més per a tu."
#: data/levels/factorycampaign/factory_campaign1.pingus:5
msgid "Falling down"
msgstr "Caient"
#: data/levels/factorycampaign/factory_campaign1.pingus:6
msgid ""
"Pingus intelligence reported that a huge factory located in the subtropical "
"zone might be a reason of a climate change. They decided to go there and "
"shut down the factory. This will be a long and dangerous expedition. "
"Pingus and you will have to face many difficulties on your way. As the ice "
"is melting, at first you have to build some bridges and watch out for the "
"cliff."
msgstr ""
"El servei d'intel·ligència dels pingus informa que hi ha una enorme fàbrica "
"localitzada en la zona subtropical que podria ser el motiu del canvi "
"climàtic. Han decidit anar allà i aturar-la. Aquesta serà una expedició "
"llarga i perillosa. Els pingus i tu us haureu d'enfrontar a nombroses "
"dificultats en el vostre camí. Com que el gel es va fonent, primer haureu de "
"construir alguns ponts i vigilar amb el penya-segat."
#: data/levels/factorycampaign/factory_campaign2.pingus:5
msgid "Destination North"
msgstr "Destinació nord"
#: data/levels/factorycampaign/factory_campaign2.pingus:6
msgid ""
"For now, Pingus are leaving South Pole and moving North. You have to help "
"them!"
msgstr ""
"De moment, els pingus marxen del Pol Sud en direcció nord. Els has d'ajudar!"
#: data/levels/factorycampaign/factory_campaign3.pingus:5
msgid "The Cave"
msgstr "La cova"
#: data/levels/factorycampaign/factory_campaign3.pingus:6
msgid ""
"Pingus on their way came across a huge cave. You have to lead them through. "
"Remember that sometimes there is more than one way out. Hint: To 'unlock' "
"blockers you can use bashers and jumpers."
msgstr ""
"Els pingus es van topar amb una cova en el seu camí. Els has de guiar a "
"través d'ella. Recorda que a vegades hi ha més d'una sortida. Pista: per "
"\"desbloquejar\" els bloquejadors pots fer servir excavadors i saltadors."
#: data/levels/factorycampaign/factory_campaign4.pingus:5
msgid "Difficulties on the way"
msgstr "Dificultats a mig camí"
#: data/levels/factorycampaign/factory_campaign4.pingus:6
msgid ""
"It looks you have encountered serious difficulties. But don't panic, Pingus "
"are waiting for your orders, they count on you so don't fail! Hint: Miners, "
"diggers and bashers are very important here!"
msgstr ""
"Sembla que t'has trobat amb dificultats. Però no pateixis, els pingus estan "
"esperant les teves ordres. Compten amb tu, o sigui que no fallis! Pista: "
"miners, perforadors i excavadors són molt importants aquí!"
#: data/levels/factorycampaign/factory_campaign5.pingus:5
msgid "Four ways out"
msgstr "Quatre sortides"
#: data/levels/factorycampaign/factory_campaign5.pingus:6
msgid ""
"It's getting warmer but Pingus are bravely moving North. This time it will "
"be much easier. There are at least four ways out. Could you find them?"
msgstr ""
"Fa més calor, però els pingus viatgen valerosament cap al nord. Aquesta "
"vegada serà molt més fàcil. Hi ha al menys quatre sortides. Sabràs trobar-"
"les?"
#: data/levels/factorycampaign/factory_campaign6.pingus:5
msgid "Egypt - So easy"
msgstr "Egipte - Molt fàcil"
#: data/levels/factorycampaign/factory_campaign6.pingus:6
msgid "Pingus reached Egypt. Looks easy, but is it really so easy? Try it out."
msgstr ""
"Els pingus han arribat a Egipte. Sembla fàcil, però ho és realment? Prova-ho."
#: data/levels/factorycampaign/factory_campaign7.pingus:5
msgid "Egypt - Oasis"
msgstr "Egipte - L'oasi"
#: data/levels/factorycampaign/factory_campaign7.pingus:6
msgid ""
"Last time it was easy. Now it will be a little bit harder. Pingus are "
"entering oasis. Watch out for the water."
msgstr ""
"L'última vegada era fàcil. Ara serà una mica més difícil. Els pingus estan "
"entrant a l'oasi. Ves amb compte amb l'aigua."
#: data/levels/factorycampaign/factory_campaign8.pingus:5
msgid "Egypt - The Maze"
msgstr "Egipte - El laberint"
#: data/levels/factorycampaign/factory_campaign8.pingus:6
msgid ""
"You came across a maze. Can you find the way out? Think twice before digging."
msgstr ""
"Has arribat a un laberint. Pots trobar la sortida? Pensa't-ho dues vegades "
"abans de perforar."
#: data/levels/factorycampaign/factory_campaign9.pingus:5
msgid "Egypt - Pyramids"
msgstr "Egipte - Piràmides"
#: data/levels/factorycampaign/factory_campaign9.pingus:6
msgid ""
"The maze led you to the big pyramids. Now you have 4 minutes to escape. "
"Hurry up!"
msgstr ""
"El laberint t'ha portat fins a les grans piràmides. Ara tens 4 minuts per "
"escapar. Espavila!"
#: data/levels/xmas2011/xmas01-grumbel.pingus:5
msgid "Bomb and Double Catch"
msgstr "Bombardeja i atrapa per partida doble"
#: data/levels/xmas2011/xmas01-grumbel.pingus:6
msgid ""
"Here you might have some time to relax. The path isn't complicated and a bit "
"of bombing and catching of Pingus should bring you to the end without much "
"trouble, but don't relax to much, your resources are limited, so be careful "
"when using them."
msgstr ""
"Aquí et pots relaxar. El camí no és complicat, i una mica de bombardeig i "
"atrapar els pingus t'hauria de dur a la sortida sense gaires problemes. Però "
"no et relaxis massa. Els teus recursos són limitats, o sigui que ves amb "
"compte quan els facis servir."
#: data/levels/xmas2011/xmas02-grumbel.pingus:5
msgid "Up, Up and Away"
msgstr "Amunt, amunt i fora"
#: data/levels/xmas2011/xmas02-grumbel.pingus:6
msgid ""
"The exit is in a weird spot here, straight above. A bridge won't get you "
"there, but your toolset allows an alternative way. Can you figure it out?"
msgstr ""
"La sortida es troba en un lloc estrany aquesta vegada, just al damunt. Un "
"pont no t'hi portarà, però les teves eines et permeten un camí alternatiu. "
"Pots descobrir-lo?"
#: data/levels/xmas2011/xmas03-grumbel.pingus:5
msgid "If only penguins could fly"
msgstr "Si els pingüins poguessin volar"
#: data/levels/xmas2011/xmas03-grumbel.pingus:6
msgid ""
"Bridges are kind of rare around here, so don't waste any. That aside, you "
"shouldn't have to much trouble here, everything to do here you should have "
"learned, but you might have to use all that knowledge at once."
msgstr ""
"Els ponts són una mica escadussers aquí, així que no en malbaratis cap. A "
"part d'això, no hauries de tenir gaires problemes. Tot el que s'ha de fer ja "
"ho hauries d'haver aprés. Però és possible que hagis de fer servir tot "
"aquest coneixement al mateix temps."
#: data/levels/xmas2011/xmas04-grumbel.pingus:5
msgid "Stairway to Heaven"
msgstr "Escala al cel"
#: data/levels/xmas2011/xmas04-grumbel.pingus:6
msgid ""
"Here things start to get a little complicated. Getting up to the exit is "
"hard enough with a single Pingu, but with all of them? Impossible! But wait, "
"who says they have to come the same way?"
msgstr ""
"Aquí la cosa es comença a complicar. Pujar fins a la sortida ja és prou "
"difícil amb un sol pingu, però amb tots? Impossible! Però espera, qui diu "
"que han d'anar pel mateix camí?"
#: data/levels/xmas2011/xmas05-grumbel.pingus:5
msgid "Misdirection Everywhere"
msgstr "Confusió per tot arreu"
#: data/levels/xmas2011/xmas05-grumbel.pingus:6
msgid ""
"The last level for this Xmas. Looks a little complicated, right? Don't worry "
"with all you have learned so far, you should be able to even solve this.\n"
"\n"
"Good Luck & a Merry Xmas 2011"
msgstr ""
"L'últim nivell per aquest Nadal. Sembla una mica complicat, oi? No "
"t'amoïnis, amb tot el que has aprés fins ara hauries de ser capaç de "
"solucionar-lo.\n"
"\n"
"Bona sort i bon Nadal 2011"
#: data/levels/xmas2011/xmas06-grumbel.pingus:5
msgid "The Big Jump"
msgstr "El gran salt"
#: data/levels/xmas2011/xmas06-grumbel.pingus:6
#, fuzzy
msgid ""
"Going in and out of the abyss with all Pingus isn't an option here, but a "
"small group preparing the path for the others should get you across."
msgstr ""
"Entrar i sortir de l'abisme amb tots els pingus no és una opció aquí, però "
"un petit grup preparant el camí per als altres t'hauria de permetre creuar."
#: data/levels/xmas2011/xmas07-grumbel.pingus:5
msgid "No Way to Stop"
msgstr "No hi ha manera de parar"
#: data/levels/xmas2011/xmas07-grumbel.pingus:6
msgid ""
"Here you don't have much time to waste. The path to the exit is clear and "
"straight, but you don't have the time to prepare it. Can you find a way to "
"leap ahead?"
msgstr ""
"Aquí no tens gaire temps per perdre. El camí fins a la sortida és clar i "
"recte, però no tens temps per preparar-lo. Pots trobar la manera d'avançar "
"ràpidament?"
#: data/levels/xmas2011/xmas08-grumbel.pingus:5
msgid "Ice Block Blockage"
msgstr "Blocats pel bloc de gel"
#: data/levels/xmas2011/xmas08-grumbel.pingus:6
msgid ""
"What's this? A gigantic ice block straight in the path? Where did that come "
"from? No time wondering about things like that. The Pingus need to get to "
"the exit and it's your job to find a way around the block."
msgstr ""
"Què és això? Un enorme bloc de gel al mig del camí? D'on ha sortit? No hi ha "
"temps per fer-se aquesta mena de preguntes. Els pingus necessiten arribar a "
"la sortida i és la teva feina trobar una manera d'evitar el bloc."
#: data/levels/xmas2011/xmas09-grumbel.pingus:5
msgid "The Impossible Bridge"
msgstr "El pont impossible"
#: data/levels/xmas2011/xmas09-grumbel.pingus:6
msgid ""
"Two groups of Pingus separated by a deep abyss, joining them by a bridge "
"seems impossible, but wise coordination of the two groups and a brave leap "
"should let you make it to the exit."
msgstr ""
"Dos grups de pingus separats per un profund abisme. Ajuntar-los mitjançant "
"un pont sembla impossible, però una sàvia coordinació dels dos grups i un "
"salt valent t'haurien de permetre arribar a la sortida."
#: data/levels/xmas2011/xmas10-grumbel.pingus:5
msgid "Spiraling Away"
msgstr "Fugint en espiral"
#: data/levels/xmas2011/xmas10-grumbel.pingus:6
msgid ""
"The exit is straight below, but the path is blocked by solid steel with no "
"way through. But the Pingus have a versatile toolset at hand, can you use it "
"to find a way around and make it to the exit?"
msgstr ""
"La sortida està just a sota, però el camí està bloquejat per acer sòlid "
"sense possibilitat de travessar-lo. Però els pingus tenen un conjunt d'eines "
"versàtil, pots fer-lo servir per trobar un camí i arribar a la sortida?"
#: data/worldmaps/tutorial.worldmap:4
msgid "Tutorial Island"
msgstr "Illa Tutorial"
#: data/worldmaps/tutorial.worldmap:6
msgid "Learn the basics"
msgstr "Aprèn l'essencial"
#: data/worldmaps/tutorial.worldmap:124
msgid "Watch Ending"
msgstr "Veure el final"
#: data/worldmaps/tutorial.worldmap:131
msgid "Watch Intro"
msgstr "Veure la introducció"
#: data/stories/tutorial_intro.story:2
msgid "The Journey Begins"
msgstr "Comença el viatge"
#: data/stories/tutorial_intro.story:9
msgid ""
"For a long time, the Pingus have lived happily in peace on the South Pole "
"along with all the other animals. Everything was in balance and it seemed "
"like nothing could disrupt their peace. The Pingus were happy and it seemed "
"like this could never end."
msgstr ""
"Durant molt de temps els pingus han viscut feliçment en pau al Pol Sud "
"juntament amb tots els altres animals. Tot estava en equilibri i semblava "
"que res podia destorbar la seva pau. Els pingus eren feliços i semblava que "
"això no acabaria mai."
#: data/stories/tutorial_intro.story:17
msgid ""
"But then one day, things began to change slowly: the sky got darker and the "
"earth got warmer. Firstly, they thought this was just a normal fluctuation "
"in the world's climate, but things seemed to get worse and worse with every "
"year."
msgstr ""
"Però un dia les coses van començar a canviar lentament: el cel es va "
"enfosquir i la terra es va escalfar. Al principi van pensar que això no era "
"més que una fluctuació normal en el clima mundial, però les coses semblaven "
"empitjorar més i més cada any."
#: data/stories/tutorial_intro.story:25
msgid ""
"The snow began to melt away in a few areas and food became an issue. Other "
"animals tried to leave the region to search for colder areas, but the Pingus "
"knew that this wouldn't help: they knew that they had to do something about "
"it."
msgstr ""
"La neu va començar a fondre's en algunes zones, i el menjar es va convertir "
"en un problema. Altres animals van intentar abandonar la regió en busca de "
"zones més fredes, però els pingus sabien que això no ajudaria: sabien que "
"havien de fer alguna cosa."
#: data/stories/tutorial_intro.story:33
msgid ""
"So the circle of the eldest came together to decide what to do about it. "
"They decided to send out an expedition around the world to find the cause of "
"this warming. The expedition consisted of hundreds of the bravest Pingus on "
"the South Pole."
msgstr ""
"Així que el cercle dels venerables ancians es va reunir per decidir què "
"s'havia de fer. Van decidir enviar una expedició al voltant del món per "
"trobar la causa de l'escalfament. L'expedició consistia en centenars dels "
"pingus més valents del Pol Sud."
#: data/stories/tutorial_intro.story:41
msgid ""
"And they picked you to lead them on their journey around the world. Since "
"the journey will be dangerous and difficult, your first goal is the Island "
"of Mogorok, also known as the Tutorial Island. According to the eldest, this "
"island has always been the first stop of Pingus that were sent out into the "
"world."
msgstr ""
"I et van triar a tu per liderar-los en el seu viatge al voltant del món. Com "
"que el viatge serà perillós i difícil, el teu primer objectiu es l'illa de "
"Mogorok, també coneguda com l'illa Tutorial. Segons els ancians, l'illa "
"sempre ha estat la primera parada dels pingus que eren enviats al món."
#: data/stories/tutorial_intro.story:50
msgid ""
"The island consists of many areas that are ideal to teach the Pingus their "
"abilities. The Pingus can learn to build bridges, climb, bash and use many "
"other talents which they will need on their long and dangerous journey."
msgstr ""
"L'illa consta de moltes zones que són ideals per ensenyar als pingus les "
"seves habilitats. Els pingus poden aprendre a construir ponts, escalar, "
"excavar i fer servir molts altres talents que necessitaran en el seu llarg i "
"perillós viatge."
#: data/stories/tutorial_intro.story:57
msgid ""
"While there, you can practice your abilities in commanding and guiding the "
"Pingus. You can also get familiar with all the abilities the Pingus provide "
"and learn to master them, since you will need all of them on your journey "
"around the world."
msgstr ""
"Mentre estiguis aquí, pots practicar les teves habilitats a l'hora de manar "
"i guiar els pingus. També et pots familiaritzar amb totes les habilitats que "
"tenen els pingus i aprendre a fer-les servir, doncs les necessitaràs totes "
"en el teu viatge al voltant del món."
#: data/stories/tutorial_intro.story:65
msgid ""
"Now that you and the Pingus have arrived at Tutorial Island it is time to "
"take command and begin your mission.\n"
"\n"
"Good Luck!"
msgstr ""
"Ara que tu i els pingus heu arribat a l'illa Tutorial és hora d'agafar el "
"comandament i començar la teva missió.\n"
"\n"
"Bona sort!"
#: data/stories/tutorial_outro.story:2
msgid "The Journey Continues"
msgstr "El viatge continua"
#: data/stories/tutorial_outro.story:9
msgid ""
"Now after you and the Pingus have learned the basics and practiced a bit it "
"is time to move on and begin the journey into the world. Since the ice floe "
"with which the Pingus traveled to the Tutorial Island isn't going to hold on "
"the whole way into the warmer climates the Pingus have to find something "
"else to guide them on their journey."
msgstr ""
"Ara que tu i els pingus heu aprés el més bàsic i practicat una mica és hora "
"de seguir endavant i començar el viatge cap al món. Com que la placa de gel "
"amb la que els pingus han viatjat a l'illa Tutorial no aguantarà tot el camí "
"a través de climes més càlids, els pingus han de trobar alguna altra cosa "
"per guiar-los en el seu viatge."
#: data/stories/tutorial_outro.story:18
msgid ""
"But as the eldest have said, the Tutorial Island provides not only a good "
"way to practice, but it is also the starting point into the world. After "
"some searching the Pingus discovered the meaning of this, and they found the "
"large tree at the end of the island which gave them wood to construct a "
"float."
msgstr ""
"Però tal i com els ancians han dit, l'illa Tutorial no només és una bona "
"manera de practicar, sinó que també és el punt de partida cap al món. "
"Després de buscar una mica els pingus van descobrir el significat d'això, i "
"van trobar el gran arbre al final de l'illa que els va donar fusta per "
"construir un bot."
#: data/stories/tutorial_outro.story:27
msgid ""
"So the Pingus set out and constructed some large rafts, enough to carry them "
"all. After also packing a bunch of provisions they were prepared to start "
"their journey and leave their familiar ground and enter the unknown parts of "
"the world."
msgstr ""
"Així que els pingus es van posar a construir uns grans rais, suficients per "
"transportar-los a tots. Després d'empaquetar també un grapat de provisions, "
"estaven preparats per començar el seu viatge i deixar la terra que els era "
"familiar i entrar a les parts desconegudes del món."
#: data/stories/tutorial_outro.story:35
msgid ""
"So the Pingus sit on their raft, worrying about what's to come and where to "
"go, while floating into the sunset.\n"
"\n"
"To be continued..."
msgstr ""
"Així que els pingus seuen al seu rai, preocupats pel que vindrà i a on "
"aniran, mentre suren sota la posta de sol.\n"
"\n"
"Continuarà..."
#: data/levelsets/alien.levelset:3
msgid "Alien by Josh Dye"
msgstr "Alienígena per Josh Dye"
#: data/levelsets/alien.levelset:4
msgid "Escape from alien"
msgstr "Fugida de l'alienígena"
#: data/levelsets/crystal.levelset:3
msgid "Crystal"
msgstr "Cristall"
#: data/levelsets/crystal.levelset:4
msgid "Crystaline sparkling full of danger"
msgstr ""
#: data/levelsets/desert.levelset:3
msgid "Desert"
msgstr "Desert"
#: data/levelsets/desert.levelset:4
msgid "Getting hot outside..."
msgstr "Fa calor allà a fora..."
#: data/levelsets/eyeland.levelset:2
msgid "Eye Land"
msgstr ""
#: data/levelsets/factory.levelset:3
msgid "Factory Campaign"
msgstr "Campanya de la fàbrica"
#: data/levelsets/factory.levelset:4
msgid "Pingus expedition"
msgstr "Expedició de pingus"
#: data/levelsets/halloween2011.levelset:2
msgid "Halloween 2011"
msgstr "Halloween 2011"
#: data/levelsets/halloween2011.levelset:3
msgid "Going Underground"
msgstr "Sota terra"
#: data/levelsets/halloween.levelset:3
msgid "Halloween 2007"
msgstr "Halloween 2007"
#: data/levelsets/halloween.levelset:4
msgid "Trapped at All Hallows Eve"
msgstr "Atrapats en la vigília de Halloween"
#: data/levelsets/hellmouth.levelset:3
msgid "Hellmouth"
msgstr "La boca de l'infern"
#: data/levelsets/hellmouth.levelset:4
msgid "A cave full of slime..."
msgstr "Una cova plena de llim"
#: data/levelsets/jungle.levelset:3
msgid "Jungle"
msgstr "Selva"
#: data/levelsets/mysteryisland.levelset:3
msgid "Island of Mystery"
msgstr "L'illa del misteri"
#: data/levelsets/mysteryisland.levelset:4
msgid "Marooned on an Uncharted Isle [by Lachlan McCubbin]"
msgstr "Aïllats en una illa deserta inexplorada [per Lachlan McCubbin]"
#: data/levelsets/pacman.levelset:3
msgid "Pac-Man"
msgstr "Pac-Man"
#: data/levelsets/pacman.levelset:4
msgid "Trapped in a video game"
msgstr "Atrapats en un videojoc"
#: data/levelsets/xmas2011.levelset:3
msgid "Xmas 2011"
msgstr "Nadal 2011"
#: data/levelsets/xmas2011.levelset:4
msgid "Merry Christmas and a Happy New Year"
msgstr "Bon Nadal i feliç any nou"
#~ msgid ""
#~ "Aliens invade our starship blocking intrance to the teleporter. Your crew "
#~ "is well trained, like you they don't panic."
#~ msgstr ""
#~ "Els alienígenes envaeixen la nostra nau bloquejant l'entrada al "
#~ "teleportador. La teva tripulació està ben entrenada, i al igual que tu no "
#~ "es deixa dominar pel pànic."
#~ msgid "-Porting (Win32)"
#~ msgstr "-Portabilitat (Win32)"
#~ msgid "Abort"
#~ msgstr "Avorta"
#~ msgid "-Porting (MacOSX)"
#~ msgstr "-Portabilitat (MacOSX)"
#~ msgid "-Programming"
#~ msgstr "-Programació"
#~ msgid "-Idea"
#~ msgstr "-Idea"
#~ msgid "-Maintaining"
#~ msgstr "-Manteniment"
#~ msgid "_to all the people who"
#~ msgstr "_per a tota la gent que"
#~ msgid "-Gfx"
#~ msgstr "-Efectes gràfics"
#~ msgid "-Level Design"
#~ msgstr "-Disseny de nivells"
#~ msgid "-Thanks to"
#~ msgstr "-Agraïments"
#~ msgid "-Special"
#~ msgstr "-Especial"
#~ msgid "-Translation"
#~ msgstr "-Traducció"
#~ msgid "-Story"
#~ msgstr "-Història"
#~ msgid "_And a very Special Thanks"
#~ msgstr "_I un agraïment molt especial"
#~ msgid "_contribute to"
#~ msgstr "_contribueix al"
#~ msgid "_Free Software!"
#~ msgstr "_programari lliure!"
#~ msgid "_playing!"
#~ msgstr "_jugar!"
#~ msgid "_Thank you for"
#~ msgstr "_Gràcies per"
#~ msgid "Autoscrolling:"
#~ msgstr "Autodesplaçament:"
#~ msgid "Print FPS:"
#~ msgstr "Mostra FPS:"
#~ msgid "Fullscreen:"
#~ msgstr "Pantalla completa:"
#~ msgid "Filename: "
#~ msgstr "Nom del fitxer: "
#~ msgid "Sound:"
#~ msgstr "So:"
#~ msgid "Software Cursor:"
#~ msgstr "Cursor per programari:"
#~ msgid "Display:"
#~ msgstr "Pantalla:"
#~ msgid "Shows the credits"
#~ msgstr "Mostra els crèdits"
#~ msgid "Mouse Grab:"
#~ msgstr "Captura del ratolí:"
#~ msgid "PATH"
#~ msgstr "CAMÍ"
#~ msgid "Misc Options:"
#~ msgstr "Opcions diverses:"
#~ msgid "Show Story?"
#~ msgstr "Mostrar la història?"
#~ msgid "Enter?"
#~ msgstr "Entrar?"
#~ msgid "...walking..."
#~ msgstr "...caminant..."
#~ msgid "locked"
#~ msgstr "bloquejat"
#~ msgid " New level"
#~ msgstr " Nou nivell"
#~ msgid "This level has no name "
#~ msgstr "Aquest nivell no té nom "
#~ msgid "Crawl space"
#~ msgstr "Espai confinat"
#~ msgid "The cave"
#~ msgstr "La cova"
#~ msgid "Egypt - Piramids"
#~ msgstr "Egipte - Piràmides"
#~ msgid "Rocketlauncher"
#~ msgstr "Llançacoets"
#~ msgid "Use the given renderer (default: delta)"
#~ msgstr "Fes servir el renderitzador indicat (per defecte:delta)"
#~ msgid "unsolved"
#~ msgstr "no solucionat"
#~ msgid "solved"
#~ msgstr "solucionat"
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2014, the Dart project authors.
*
* Licensed under the Eclipse Public License v1.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*
* This file has been automatically generated. Please do not edit it manually.
* To regenerate the file, use the script "pkg/analysis_server/tool/spec/generate_files".
*/
package com.google.dart.server.generated;
import com.google.dart.server.*;
import com.google.dart.server.generated.types.*;
import java.util.List;
import java.util.Map;
/**
* The interface {@code AnalysisServer} defines the behavior of objects that interface to an
* analysis server.
*
* @coverage dart.server
*/
public interface AnalysisServer {
/**
* Add the given listener to the list of listeners that will receive notification when new
* analysis results become available.
*
* @param listener the listener to be added
*/
public void addAnalysisServerListener(AnalysisServerListener listener);
/**
* Add the given listener to the list of listeners that will receive notification when the server
* is not active
*
* @param listener the listener to be added
*/
public void addStatusListener(AnalysisServerStatusListener listener);
/**
* {@code analysis.getErrors}
*
* Return the errors associated with the given file. If the errors for the given file have not yet
* been computed, or the most recently computed errors for the given file are out of date, then the
* response for this request will be delayed until they have been computed. If some or all of the
* errors for the file cannot be computed, then the subset of the errors that can be computed will
* be returned and the response will contain an error to indicate why the errors could not be
* computed. If the content of the file changes after this request was received but before a
* response could be sent, then an error of type CONTENT_MODIFIED will be generated.
*
* This request is intended to be used by clients that cannot asynchronously apply updated error
* information. Clients that can apply error information as it becomes available should use the
* information provided by the 'analysis.errors' notification.
*
* If a request is made for a file which does not exist, or which is not currently subject to
* analysis (e.g. because it is not associated with any analysis root specified to
* analysis.setAnalysisRoots), an error of type GET_ERRORS_INVALID_FILE will be generated.
*
* @param file The file for which errors are being requested.
*/
public void analysis_getErrors(String file, GetErrorsConsumer consumer);
/**
* {@code analysis.getHover}
*
* Return the hover information associate with the given location. If some or all of the hover
* information is not available at the time this request is processed the information will be
* omitted from the response.
*
* @param file The file in which hover information is being requested.
* @param offset The offset for which hover information is being requested.
*/
public void analysis_getHover(String file, int offset, GetHoverConsumer consumer);
/**
* {@code analysis.getLibraryDependencies}
*
* Return library dependency information for use in client-side indexing and package URI
* resolution.
*/
public void analysis_getLibraryDependencies(GetLibraryDependenciesConsumer consumer);
/**
* {@code analysis.getNavigation}
*
* Return the navigation information associated with the given region of the given file. If the
* navigation information for the given file has not yet been computed, or the most recently
* computed navigation information for the given file is out of date, then the response for this
* request will be delayed until it has been computed. If the content of the file changes after
* this request was received but before a response could be sent, then an error of type
* CONTENT_MODIFIED will be generated.
*
* If a navigation region overlaps (but extends either before or after) the given region of the
* file it will be included in the result. This means that it is theoretically possible to get the
* same navigation region in response to multiple requests. Clients can avoid this by always
* choosing a region that starts at the beginning of a line and ends at the end of a (possibly
* different) line in the file.
*
* @param file The file in which navigation information is being requested.
* @param offset The offset of the region for which navigation information is being requested.
* @param length The length of the region for which navigation information is being requested.
*/
public void analysis_getNavigation(String file, int offset, int length, GetNavigationConsumer consumer);
/**
* {@code analysis.reanalyze}
*
* Force the re-analysis of everything contained in the specified analysis roots. This will cause
* all previously computed analysis results to be discarded and recomputed, and will cause all
* subscribed notifications to be re-sent.
*
* If no analysis roots are provided, then all current analysis roots will be re-analyzed. If an
* empty list of analysis roots is provided, then nothing will be re-analyzed. If the list contains
* one or more paths that are not currently analysis roots, then an error of type
* INVALID_ANALYSIS_ROOT will be generated.
*
* @param roots A list of the analysis roots that are to be re-analyzed.
*/
public void analysis_reanalyze(List<String> roots);
/**
* {@code analysis.setAnalysisRoots}
*
* Sets the root paths used to determine which files to analyze. The set of files to be analyzed
* are all of the files in one of the root paths that are not either explicitly or implicitly
* excluded. A file is explicitly excluded if it is in one of the excluded paths. A file is
* implicitly excluded if it is in a subdirectory of one of the root paths where the name of the
* subdirectory starts with a period (that is, a hidden directory).
*
* Note that this request determines the set of requested analysis roots. The actual set of
* analysis roots at any given time is the intersection of this set with the set of files and
* directories actually present on the filesystem. When the filesystem changes, the actual set of
* analysis roots is automatically updated, but the set of requested analysis roots is unchanged.
* This means that if the client sets an analysis root before the root becomes visible to server in
* the filesystem, there is no error; once the server sees the root in the filesystem it will start
* analyzing it. Similarly, server will stop analyzing files that are removed from the file system
* but they will remain in the set of requested roots.
*
* If an included path represents a file, then server will look in the directory containing the
* file for a pubspec.yaml file. If none is found, then the parents of the directory will be
* searched until such a file is found or the root of the file system is reached. If such a file is
* found, it will be used to resolve package: URI’s within the file.
*
* @param included A list of the files and directories that should be analyzed.
* @param excluded A list of the files and directories within the included directories that should
* not be analyzed.
* @param packageRoots A mapping from source directories to target directories that should override
* the normal package: URI resolution mechanism. The analyzer will behave as though each
* source directory in the map contains a special pubspec.yaml file which resolves any
* package: URI to the corresponding path within the target directory. The effect is the
* same as specifying the target directory as a "--package_root" parameter to the Dart VM
* when executing any Dart file inside the source directory. Files in any directories that
* are not overridden by this mapping have their package: URI's resolved using the normal
* pubspec.yaml mechanism. If this field is absent, or the empty map is specified, that
* indicates that the normal pubspec.yaml mechanism should always be used.
*/
public void analysis_setAnalysisRoots(List<String> included, List<String> excluded, Map<String, String> packageRoots);
/**
* {@code analysis.setPriorityFiles}
*
* Set the priority files to the files in the given list. A priority file is a file that is given
* priority when scheduling which analysis work to do first. The list typically contains those
* files that are visible to the user and those for which analysis results will have the biggest
* impact on the user experience. The order of the files within the list is significant: the first
* file will be given higher priority than the second, the second higher priority than the third,
* and so on.
*
* Note that this request determines the set of requested priority files. The actual set of
* priority files is the intersection of the requested set of priority files with the set of files
* currently subject to analysis. (See analysis.setSubscriptions for a description of files that
* are subject to analysis.)
*
* If a requested priority file is a directory it is ignored, but remains in the set of requested
* priority files so that if it later becomes a file it can be included in the set of actual
* priority files.
*
* @param files The files that are to be a priority for analysis.
*/
public void analysis_setPriorityFiles(List<String> files);
/**
* {@code analysis.setSubscriptions}
*
* Subscribe for services. All previous subscriptions are replaced by the current set of
* subscriptions. If a given service is not included as a key in the map then no files will be
* subscribed to the service, exactly as if the service had been included in the map with an
* explicit empty list of files.
*
* Note that this request determines the set of requested subscriptions. The actual set of
* subscriptions at any given time is the intersection of this set with the set of files currently
* subject to analysis. The files currently subject to analysis are the set of files contained
* within an actual analysis root but not excluded, plus all of the files transitively reachable
* from those files via import, export and part directives. (See analysis.setAnalysisRoots for an
* explanation of how the actual analysis roots are determined.) When the actual analysis roots
* change, the actual set of subscriptions is automatically updated, but the set of requested
* subscriptions is unchanged.
*
* If a requested subscription is a directory it is ignored, but remains in the set of requested
* subscriptions so that if it later becomes a file it can be included in the set of actual
* subscriptions.
*
* It is an error if any of the keys in the map are not valid services. If there is an error, then
* the existing subscriptions will remain unchanged.
*
* @param subscriptions A table mapping services to a list of the files being subscribed to the
* service.
*/
public void analysis_setSubscriptions(Map<String, List<String>> subscriptions);
/**
* {@code analysis.updateContent}
*
* Update the content of one or more files. Files that were previously updated but not included in
* this update remain unchanged. This effectively represents an overlay of the filesystem. The
* files whose content is overridden are therefore seen by server as being files with the given
* content, even if the files do not exist on the filesystem or if the file path represents the
* path to a directory on the filesystem.
*
* @param files A table mapping the files whose content has changed to a description of the content
* change.
*/
public void analysis_updateContent(Map<String, Object> files, UpdateContentConsumer consumer);
/**
* {@code analysis.updateOptions}
*
* Update the options controlling analysis based on the given set of options. Any options that are
* not included in the analysis options will not be changed. If there are options in the analysis
* options that are not valid, they will be silently ignored.
*
* @param options The options that are to be used to control analysis.
*/
public void analysis_updateOptions(AnalysisOptions options);
/**
* {@code completion.getSuggestions}
*
* Request that completion suggestions for the given offset in the given file be returned.
*
* @param file The file containing the point at which suggestions are to be made.
* @param offset The offset within the file at which suggestions are to be made.
*/
public void completion_getSuggestions(String file, int offset, GetSuggestionsConsumer consumer);
/**
* {@code edit.format}
*
* Format the contents of a single file. The currently selected region of text is passed in so that
* the selection can be preserved across the formatting operation. The updated selection will be as
* close to matching the original as possible, but whitespace at the beginning or end of the
* selected region will be ignored. If preserving selection information is not required, zero (0)
* can be specified for both the selection offset and selection length.
*
* If a request is made for a file which does not exist, or which is not currently subject to
* analysis (e.g. because it is not associated with any analysis root specified to
* analysis.setAnalysisRoots), an error of type FORMAT_INVALID_FILE will be generated. If the
* source contains syntax errors, an error of type FORMAT_WITH_ERRORS will be generated.
*
* @param file The file containing the code to be formatted.
* @param selectionOffset The offset of the current selection in the file.
* @param selectionLength The length of the current selection in the file.
*/
public void edit_format(String file, int selectionOffset, int selectionLength, FormatConsumer consumer);
/**
* {@code edit.getAssists}
*
* Return the set of assists that are available at the given location. An assist is distinguished
* from a refactoring primarily by the fact that it affects a single file and does not require user
* input in order to be performed.
*
* @param file The file containing the code for which assists are being requested.
* @param offset The offset of the code for which assists are being requested.
* @param length The length of the code for which assists are being requested.
*/
public void edit_getAssists(String file, int offset, int length, GetAssistsConsumer consumer);
/**
* {@code edit.getAvailableRefactorings}
*
* Get a list of the kinds of refactorings that are valid for the given selection in the given
* file.
*
* @param file The file containing the code on which the refactoring would be based.
* @param offset The offset of the code on which the refactoring would be based.
* @param length The length of the code on which the refactoring would be based.
*/
public void edit_getAvailableRefactorings(String file, int offset, int length, GetAvailableRefactoringsConsumer consumer);
/**
* {@code edit.getFixes}
*
* Return the set of fixes that are available for the errors at a given offset in a given file.
*
* @param file The file containing the errors for which fixes are being requested.
* @param offset The offset used to select the errors for which fixes will be returned.
*/
public void edit_getFixes(String file, int offset, GetFixesConsumer consumer);
/**
* {@code edit.getRefactoring}
*
* Get the changes required to perform a refactoring.
*
* If another refactoring request is received during the processing of this one, an error of type
* REFACTORING_REQUEST_CANCELLED will be generated.
*
* @param kind The kind of refactoring to be performed.
* @param file The file containing the code involved in the refactoring.
* @param offset The offset of the region involved in the refactoring.
* @param length The length of the region involved in the refactoring.
* @param validateOnly True if the client is only requesting that the values of the options be
* validated and no change be generated.
* @param options Data used to provide values provided by the user. The structure of the data is
* dependent on the kind of refactoring being performed. The data that is expected is
* documented in the section titled Refactorings, labeled as “Options”. This field can be
* omitted if the refactoring does not require any options or if the values of those
* options are not known.
*/
public void edit_getRefactoring(String kind, String file, int offset, int length, boolean validateOnly, RefactoringOptions options, GetRefactoringConsumer consumer);
/**
* {@code edit.sortMembers}
*
* Sort all of the directives, unit and class members of the given Dart file.
*
* If a request is made for a file that does not exist, does not belong to an analysis root or is
* not a Dart file, SORT_MEMBERS_INVALID_FILE will be generated.
*
* If the Dart file has scan or parse errors, SORT_MEMBERS_PARSE_ERRORS will be generated.
*
* @param file The Dart file to sort.
*/
public void edit_sortMembers(String file, SortMembersConsumer consumer);
/**
* {@code execution.createContext}
*
* Create an execution context for the executable file with the given path. The context that is
* created will persist until execution.deleteContext is used to delete it. Clients, therefore, are
* responsible for managing the lifetime of execution contexts.
*
* @param contextRoot The path of the Dart or HTML file that will be launched, or the path of the
* directory containing the file.
*/
public void execution_createContext(String contextRoot, CreateContextConsumer consumer);
/**
* {@code execution.deleteContext}
*
* Delete the execution context with the given identifier. The context id is no longer valid after
* this command. The server is allowed to re-use ids when they are no longer valid.
*
* @param id The identifier of the execution context that is to be deleted.
*/
public void execution_deleteContext(String id);
/**
* {@code execution.mapUri}
*
* Map a URI from the execution context to the file that it corresponds to, or map a file to the
* URI that it corresponds to in the execution context.
*
* Exactly one of the file and uri fields must be provided. If both fields are provided, then an
* error of type INVALID_PARAMETER will be generated. Similarly, if neither field is provided, then
* an error of type INVALID_PARAMETER will be generated.
*
* If the file field is provided and the value is not the path of a file (either the file does not
* exist or the path references something other than a file), then an error of type
* INVALID_PARAMETER will be generated.
*
* If the uri field is provided and the value is not a valid URI or if the URI references something
* that is not a file (either a file that does not exist or something other than a file), then an
* error of type INVALID_PARAMETER will be generated.
*
* If the contextRoot used to create the execution context does not exist, then an error of type
* INVALID_EXECUTION_CONTEXT will be generated.
*
* @param id The identifier of the execution context in which the URI is to be mapped.
* @param file The path of the file to be mapped into a URI.
* @param uri The URI to be mapped into a file path.
*/
public void execution_mapUri(String id, String file, String uri, MapUriConsumer consumer);
/**
* {@code execution.setSubscriptions}
*
* Subscribe for services. All previous subscriptions are replaced by the given set of services.
*
* It is an error if any of the elements in the list are not valid services. If there is an error,
* then the current subscriptions will remain unchanged.
*
* @param subscriptions A list of the services being subscribed to.
*/
public void execution_setSubscriptions(List<String> subscriptions);
/**
* Return {@code true} if the socket is open.
*/
public boolean isSocketOpen();
/**
* Remove the given listener from the list of listeners that will receive notification when new
* analysis results become available.
*
* @param listener the listener to be removed
*/
public void removeAnalysisServerListener(AnalysisServerListener listener);
/**
* {@code search.findElementReferences}
*
* Perform a search for references to the element defined or referenced at the given offset in the
* given file.
*
* An identifier is returned immediately, and individual results will be returned via the
* search.results notification as they become available.
*
* @param file The file containing the declaration of or reference to the element used to define
* the search.
* @param offset The offset within the file of the declaration of or reference to the element.
* @param includePotential True if potential matches are to be included in the results.
*/
public void search_findElementReferences(String file, int offset, boolean includePotential, FindElementReferencesConsumer consumer);
/**
* {@code search.findMemberDeclarations}
*
* Perform a search for declarations of members whose name is equal to the given name.
*
* An identifier is returned immediately, and individual results will be returned via the
* search.results notification as they become available.
*
* @param name The name of the declarations to be found.
*/
public void search_findMemberDeclarations(String name, FindMemberDeclarationsConsumer consumer);
/**
* {@code search.findMemberReferences}
*
* Perform a search for references to members whose name is equal to the given name. This search
* does not check to see that there is a member defined with the given name, so it is able to find
* references to undefined members as well.
*
* An identifier is returned immediately, and individual results will be returned via the
* search.results notification as they become available.
*
* @param name The name of the references to be found.
*/
public void search_findMemberReferences(String name, FindMemberReferencesConsumer consumer);
/**
* {@code search.findTopLevelDeclarations}
*
* Perform a search for declarations of top-level elements (classes, typedefs, getters, setters,
* functions and fields) whose name matches the given pattern.
*
* An identifier is returned immediately, and individual results will be returned via the
* search.results notification as they become available.
*
* @param pattern The regular expression used to match the names of the declarations to be found.
*/
public void search_findTopLevelDeclarations(String pattern, FindTopLevelDeclarationsConsumer consumer);
/**
* {@code search.getTypeHierarchy}
*
* Return the type hierarchy of the class declared or referenced at the given location.
*
* @param file The file containing the declaration or reference to the type for which a hierarchy
* is being requested.
* @param offset The offset of the name of the type within the file.
*/
public void search_getTypeHierarchy(String file, int offset, GetTypeHierarchyConsumer consumer);
/**
* {@code server.getVersion}
*
* Return the version number of the analysis server.
*/
public void server_getVersion(GetVersionConsumer consumer);
/**
* {@code server.setSubscriptions}
*
* Subscribe for services. All previous subscriptions are replaced by the given set of services.
*
* It is an error if any of the elements in the list are not valid services. If there is an error,
* then the current subscriptions will remain unchanged.
*
* @param subscriptions A list of the services being subscribed to.
*/
public void server_setSubscriptions(List<String> subscriptions);
/**
* {@code server.shutdown}
*
* Cleanly shutdown the analysis server. Requests that are received after this request will not be
* processed. Requests that were received before this request, but for which a response has not yet
* been sent, will not be responded to. No further responses or notifications will be sent after
* the response to this request has been sent.
*/
public void server_shutdown();
/**
* Start the analysis server.
*/
public void start() throws Exception;
}
| {
"pile_set_name": "Github"
} |
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright 2015-16 Golden Delicious Computers
*
* Author: Nikolaus Schaller <[email protected]>
*
* LED driver for the IS31FL319{0,1,3,6,9} to drive 1, 3, 6 or 9 light
* effect LEDs.
*/
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/regmap.h>
#include <linux/slab.h>
/* register numbers */
#define IS31FL319X_SHUTDOWN 0x00
#define IS31FL319X_CTRL1 0x01
#define IS31FL319X_CTRL2 0x02
#define IS31FL319X_CONFIG1 0x03
#define IS31FL319X_CONFIG2 0x04
#define IS31FL319X_RAMP_MODE 0x05
#define IS31FL319X_BREATH_MASK 0x06
#define IS31FL319X_PWM(channel) (0x07 + channel)
#define IS31FL319X_DATA_UPDATE 0x10
#define IS31FL319X_T0(channel) (0x11 + channel)
#define IS31FL319X_T123_1 0x1a
#define IS31FL319X_T123_2 0x1b
#define IS31FL319X_T123_3 0x1c
#define IS31FL319X_T4(channel) (0x1d + channel)
#define IS31FL319X_TIME_UPDATE 0x26
#define IS31FL319X_RESET 0xff
#define IS31FL319X_REG_CNT (IS31FL319X_RESET + 1)
#define IS31FL319X_MAX_LEDS 9
/* CS (Current Setting) in CONFIG2 register */
#define IS31FL319X_CONFIG2_CS_SHIFT 4
#define IS31FL319X_CONFIG2_CS_MASK 0x7
#define IS31FL319X_CONFIG2_CS_STEP_REF 12
#define IS31FL319X_CURRENT_MIN ((u32)5000)
#define IS31FL319X_CURRENT_MAX ((u32)40000)
#define IS31FL319X_CURRENT_STEP ((u32)5000)
#define IS31FL319X_CURRENT_DEFAULT ((u32)20000)
/* Audio gain in CONFIG2 register */
#define IS31FL319X_AUDIO_GAIN_DB_MAX ((u32)21)
#define IS31FL319X_AUDIO_GAIN_DB_STEP ((u32)3)
/*
* regmap is used as a cache of chip's register space,
* to avoid reading back brightness values from chip,
* which is known to hang.
*/
struct is31fl319x_chip {
const struct is31fl319x_chipdef *cdef;
struct i2c_client *client;
struct regmap *regmap;
struct mutex lock;
u32 audio_gain_db;
struct is31fl319x_led {
struct is31fl319x_chip *chip;
struct led_classdev cdev;
u32 max_microamp;
bool configured;
} leds[IS31FL319X_MAX_LEDS];
};
struct is31fl319x_chipdef {
int num_leds;
};
static const struct is31fl319x_chipdef is31fl3190_cdef = {
.num_leds = 1,
};
static const struct is31fl319x_chipdef is31fl3193_cdef = {
.num_leds = 3,
};
static const struct is31fl319x_chipdef is31fl3196_cdef = {
.num_leds = 6,
};
static const struct is31fl319x_chipdef is31fl3199_cdef = {
.num_leds = 9,
};
static const struct of_device_id of_is31fl319x_match[] = {
{ .compatible = "issi,is31fl3190", .data = &is31fl3190_cdef, },
{ .compatible = "issi,is31fl3191", .data = &is31fl3190_cdef, },
{ .compatible = "issi,is31fl3193", .data = &is31fl3193_cdef, },
{ .compatible = "issi,is31fl3196", .data = &is31fl3196_cdef, },
{ .compatible = "issi,is31fl3199", .data = &is31fl3199_cdef, },
{ .compatible = "si-en,sn3199", .data = &is31fl3199_cdef, },
{ }
};
MODULE_DEVICE_TABLE(of, of_is31fl319x_match);
static int is31fl319x_brightness_set(struct led_classdev *cdev,
enum led_brightness brightness)
{
struct is31fl319x_led *led = container_of(cdev, struct is31fl319x_led,
cdev);
struct is31fl319x_chip *is31 = led->chip;
int chan = led - is31->leds;
int ret;
int i;
u8 ctrl1 = 0, ctrl2 = 0;
dev_dbg(&is31->client->dev, "%s %d: %d\n", __func__, chan, brightness);
mutex_lock(&is31->lock);
/* update PWM register */
ret = regmap_write(is31->regmap, IS31FL319X_PWM(chan), brightness);
if (ret < 0)
goto out;
/* read current brightness of all PWM channels */
for (i = 0; i < is31->cdef->num_leds; i++) {
unsigned int pwm_value;
bool on;
/*
* since neither cdev nor the chip can provide
* the current setting, we read from the regmap cache
*/
ret = regmap_read(is31->regmap, IS31FL319X_PWM(i), &pwm_value);
dev_dbg(&is31->client->dev, "%s read %d: ret=%d: %d\n",
__func__, i, ret, pwm_value);
on = ret >= 0 && pwm_value > LED_OFF;
if (i < 3)
ctrl1 |= on << i; /* 0..2 => bit 0..2 */
else if (i < 6)
ctrl1 |= on << (i + 1); /* 3..5 => bit 4..6 */
else
ctrl2 |= on << (i - 6); /* 6..8 => bit 0..2 */
}
if (ctrl1 > 0 || ctrl2 > 0) {
dev_dbg(&is31->client->dev, "power up %02x %02x\n",
ctrl1, ctrl2);
regmap_write(is31->regmap, IS31FL319X_CTRL1, ctrl1);
regmap_write(is31->regmap, IS31FL319X_CTRL2, ctrl2);
/* update PWMs */
regmap_write(is31->regmap, IS31FL319X_DATA_UPDATE, 0x00);
/* enable chip from shut down */
ret = regmap_write(is31->regmap, IS31FL319X_SHUTDOWN, 0x01);
} else {
dev_dbg(&is31->client->dev, "power down\n");
/* shut down (no need to clear CTRL1/2) */
ret = regmap_write(is31->regmap, IS31FL319X_SHUTDOWN, 0x00);
}
out:
mutex_unlock(&is31->lock);
return ret;
}
static int is31fl319x_parse_child_dt(const struct device *dev,
const struct device_node *child,
struct is31fl319x_led *led)
{
struct led_classdev *cdev = &led->cdev;
int ret;
if (of_property_read_string(child, "label", &cdev->name))
cdev->name = child->name;
ret = of_property_read_string(child, "linux,default-trigger",
&cdev->default_trigger);
if (ret < 0 && ret != -EINVAL) /* is optional */
return ret;
led->max_microamp = IS31FL319X_CURRENT_DEFAULT;
ret = of_property_read_u32(child, "led-max-microamp",
&led->max_microamp);
if (!ret) {
if (led->max_microamp < IS31FL319X_CURRENT_MIN)
return -EINVAL; /* not supported */
led->max_microamp = min(led->max_microamp,
IS31FL319X_CURRENT_MAX);
}
return 0;
}
static int is31fl319x_parse_dt(struct device *dev,
struct is31fl319x_chip *is31)
{
struct device_node *np = dev->of_node, *child;
const struct of_device_id *of_dev_id;
int count;
int ret;
if (!np)
return -ENODEV;
of_dev_id = of_match_device(of_is31fl319x_match, dev);
if (!of_dev_id) {
dev_err(dev, "Failed to match device with supported chips\n");
return -EINVAL;
}
is31->cdef = of_dev_id->data;
count = of_get_child_count(np);
dev_dbg(dev, "probe %s with %d leds defined in DT\n",
of_dev_id->compatible, count);
if (!count || count > is31->cdef->num_leds) {
dev_err(dev, "Number of leds defined must be between 1 and %u\n",
is31->cdef->num_leds);
return -ENODEV;
}
for_each_child_of_node(np, child) {
struct is31fl319x_led *led;
u32 reg;
ret = of_property_read_u32(child, "reg", ®);
if (ret) {
dev_err(dev, "Failed to read led 'reg' property\n");
goto put_child_node;
}
if (reg < 1 || reg > is31->cdef->num_leds) {
dev_err(dev, "invalid led reg %u\n", reg);
ret = -EINVAL;
goto put_child_node;
}
led = &is31->leds[reg - 1];
if (led->configured) {
dev_err(dev, "led %u is already configured\n", reg);
ret = -EINVAL;
goto put_child_node;
}
ret = is31fl319x_parse_child_dt(dev, child, led);
if (ret) {
dev_err(dev, "led %u DT parsing failed\n", reg);
goto put_child_node;
}
led->configured = true;
}
is31->audio_gain_db = 0;
ret = of_property_read_u32(np, "audio-gain-db", &is31->audio_gain_db);
if (!ret)
is31->audio_gain_db = min(is31->audio_gain_db,
IS31FL319X_AUDIO_GAIN_DB_MAX);
return 0;
put_child_node:
of_node_put(child);
return ret;
}
static bool is31fl319x_readable_reg(struct device *dev, unsigned int reg)
{ /* we have no readable registers */
return false;
}
static bool is31fl319x_volatile_reg(struct device *dev, unsigned int reg)
{ /* volatile registers are not cached */
switch (reg) {
case IS31FL319X_DATA_UPDATE:
case IS31FL319X_TIME_UPDATE:
case IS31FL319X_RESET:
return true; /* always write-through */
default:
return false;
}
}
static const struct reg_default is31fl319x_reg_defaults[] = {
{ IS31FL319X_CONFIG1, 0x00},
{ IS31FL319X_CONFIG2, 0x00},
{ IS31FL319X_PWM(0), 0x00},
{ IS31FL319X_PWM(1), 0x00},
{ IS31FL319X_PWM(2), 0x00},
{ IS31FL319X_PWM(3), 0x00},
{ IS31FL319X_PWM(4), 0x00},
{ IS31FL319X_PWM(5), 0x00},
{ IS31FL319X_PWM(6), 0x00},
{ IS31FL319X_PWM(7), 0x00},
{ IS31FL319X_PWM(8), 0x00},
};
static struct regmap_config regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = IS31FL319X_REG_CNT,
.cache_type = REGCACHE_FLAT,
.readable_reg = is31fl319x_readable_reg,
.volatile_reg = is31fl319x_volatile_reg,
.reg_defaults = is31fl319x_reg_defaults,
.num_reg_defaults = ARRAY_SIZE(is31fl319x_reg_defaults),
};
static inline int is31fl319x_microamp_to_cs(struct device *dev, u32 microamp)
{ /* round down to nearest supported value (range check done by caller) */
u32 step = microamp / IS31FL319X_CURRENT_STEP;
return ((IS31FL319X_CONFIG2_CS_STEP_REF - step) &
IS31FL319X_CONFIG2_CS_MASK) <<
IS31FL319X_CONFIG2_CS_SHIFT; /* CS encoding */
}
static inline int is31fl319x_db_to_gain(u32 dezibel)
{ /* round down to nearest supported value (range check done by caller) */
return dezibel / IS31FL319X_AUDIO_GAIN_DB_STEP;
}
static int is31fl319x_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct is31fl319x_chip *is31;
struct device *dev = &client->dev;
int err;
int i = 0;
u32 aggregated_led_microamp = IS31FL319X_CURRENT_MAX;
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
return -EIO;
is31 = devm_kzalloc(&client->dev, sizeof(*is31), GFP_KERNEL);
if (!is31)
return -ENOMEM;
mutex_init(&is31->lock);
err = is31fl319x_parse_dt(&client->dev, is31);
if (err)
goto free_mutex;
is31->client = client;
is31->regmap = devm_regmap_init_i2c(client, ®map_config);
if (IS_ERR(is31->regmap)) {
dev_err(&client->dev, "failed to allocate register map\n");
err = PTR_ERR(is31->regmap);
goto free_mutex;
}
i2c_set_clientdata(client, is31);
/* check for write-reply from chip (we can't read any registers) */
err = regmap_write(is31->regmap, IS31FL319X_RESET, 0x00);
if (err < 0) {
dev_err(&client->dev, "no response from chip write: err = %d\n",
err);
err = -EIO; /* does not answer */
goto free_mutex;
}
/*
* Kernel conventions require per-LED led-max-microamp property.
* But the chip does not allow to limit individual LEDs.
* So we take minimum from all subnodes for safety of hardware.
*/
for (i = 0; i < is31->cdef->num_leds; i++)
if (is31->leds[i].configured &&
is31->leds[i].max_microamp < aggregated_led_microamp)
aggregated_led_microamp = is31->leds[i].max_microamp;
regmap_write(is31->regmap, IS31FL319X_CONFIG2,
is31fl319x_microamp_to_cs(dev, aggregated_led_microamp) |
is31fl319x_db_to_gain(is31->audio_gain_db));
for (i = 0; i < is31->cdef->num_leds; i++) {
struct is31fl319x_led *led = &is31->leds[i];
if (!led->configured)
continue;
led->chip = is31;
led->cdev.brightness_set_blocking = is31fl319x_brightness_set;
err = devm_led_classdev_register(&client->dev, &led->cdev);
if (err < 0)
goto free_mutex;
}
return 0;
free_mutex:
mutex_destroy(&is31->lock);
return err;
}
static int is31fl319x_remove(struct i2c_client *client)
{
struct is31fl319x_chip *is31 = i2c_get_clientdata(client);
mutex_destroy(&is31->lock);
return 0;
}
/*
* i2c-core (and modalias) requires that id_table be properly filled,
* even though it is not used for DeviceTree based instantiation.
*/
static const struct i2c_device_id is31fl319x_id[] = {
{ "is31fl3190" },
{ "is31fl3191" },
{ "is31fl3193" },
{ "is31fl3196" },
{ "is31fl3199" },
{ "sn3199" },
{},
};
MODULE_DEVICE_TABLE(i2c, is31fl319x_id);
static struct i2c_driver is31fl319x_driver = {
.driver = {
.name = "leds-is31fl319x",
.of_match_table = of_match_ptr(of_is31fl319x_match),
},
.probe = is31fl319x_probe,
.remove = is31fl319x_remove,
.id_table = is31fl319x_id,
};
module_i2c_driver(is31fl319x_driver);
MODULE_AUTHOR("H. Nikolaus Schaller <[email protected]>");
MODULE_AUTHOR("Andrey Utkin <[email protected]>");
MODULE_DESCRIPTION("IS31FL319X LED driver");
MODULE_LICENSE("GPL v2");
| {
"pile_set_name": "Github"
} |
"""
(*)~---------------------------------------------------------------------------
Pupil - eye tracking platform
Copyright (C) 2012-2020 Pupil Labs
Distributed under the terms of the GNU
Lesser General Public License (LGPL v3.0).
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""
import numpy as np
from pyglui import ui
import os
import sys
import time
from ctypes import c_bool, c_int
from multiprocessing import cpu_count
import background_helper as bh
import logging
logger = logging.getLogger(__name__)
if __name__ == "__main__":
# Make all pupil shared_modules available to this Python session.
pupil_base_dir = os.path.abspath(__file__).rsplit("pupil_src", 1)[0]
sys.path.append(os.path.join(pupil_base_dir, "pupil_src", "shared_modules"))
from plugin import Plugin, System_Plugin_Base
from exporter import export as export_function
from player_methods import is_pupil_rec_dir
def get_recording_dirs(data_dir):
"""
You can supply a data folder or any folder
- all folders within will be checked for necessary files
- in order to make a visualization
"""
if is_pupil_rec_dir(data_dir):
yield data_dir
for root, dirs, files in os.walk(data_dir):
for d in dirs:
joined = os.path.join(root, d)
if not d.startswith(".") and is_pupil_rec_dir(joined):
yield joined
class Batch_Export(System_Plugin_Base):
"""Sub plugin that manages a single batch export"""
uniqueness = "not_unique"
icon_font = "pupil_icons"
icon_chr = chr(0xE2C4) # character shown in menu icon
def __init__(self, g_pool, rec_dir, out_file_path, frames_to_export):
super().__init__(g_pool)
self.rec_dir = rec_dir
self.out_file_path = out_file_path
self.plugins = self.g_pool.plugins.get_initializers()
self.process = None
self.status = "In queue"
self.progress = 0
self.frames_to_export = frames_to_export
self.in_queue = True
self._accelerate = True
self.notify_all(
{"subject": "batch_export.queued", "out_file_path": self.out_file_path}
)
def init_ui(self):
self.add_menu()
# uniqueness = 'not_unique' -> Automatic `Close` button
# -> Rename to `Cancel`
export_name = os.path.split(self.out_file_path)[-1]
self.menu.label = "Batch Export {}".format(export_name)
self.menu[0].label = "Cancel"
self.menu_icon.indicator_start = 0.0
self.menu_icon.indicator_stop = 0.1
self.menu_icon.tooltip = export_name
self.menu.append(
ui.Text_Input("rec_dir", self, label="Recording", setter=lambda x: None)
)
self.menu.append(
ui.Text_Input("out_file_path", self, label="Output", setter=lambda x: None)
)
self.menu.append(
ui.Text_Input("status", self, label="Status", setter=lambda x: None)
)
progress_bar = ui.Slider(
"progress", self, min=0, max=self.frames_to_export, label="Progress"
)
progress_bar.read_only = True
self.menu.append(progress_bar)
def recent_events(self, events):
if self.process:
try:
recent = [d for d in self.process.fetch()]
except Exception as e:
self.status, self.progress = "{}: {}".format(type(e).__name__, e), 0
else:
if recent:
self.status, self.progress = recent[-1]
# Update status if process has been canceled or completed
if self.process.canceled:
self.process = None
self.status = "Export has been canceled."
self.notify_all(
{
"subject": "batch_export.canceled",
"out_file_path": self.out_file_path,
}
)
self.menu[0].label = "Close" # change button label back to close
elif self.process.completed:
self.process = None
self.notify_all(
{
"subject": "batch_export.completed",
"out_file_path": self.out_file_path,
}
)
self.menu[0].label = "Close" # change button label back to close
if self.in_queue:
if self._accelerate:
self.menu_icon.indicator_start += 0.01
self.menu_icon.indicator_stop += 0.02
else:
self.menu_icon.indicator_start += 0.02
self.menu_icon.indicator_stop += 0.01
d = abs(self.menu_icon.indicator_start - self.menu_icon.indicator_stop)
if self._accelerate and d > 0.5:
self._accelerate = False
elif not self._accelerate and d < 0.1:
self._accelerate = True
else:
self.menu_icon.indicator_start = 0.0
self.menu_icon.indicator_stop = self.progress / self.frames_to_export
def on_notify(self, n):
if (
n["subject"] == "batch_export.should_start"
and n["out_file_path"] == self.out_file_path
):
self.init_export()
if (
n["subject"] == "batch_export.should_cancel"
and n.get("out_file_path", self.out_file_path) == self.out_file_path
):
self.cancel_export()
if n.get("remove_menu", False):
self.alive = False
def init_export(self):
self.in_queue = False
args = (
self.rec_dir,
self.g_pool.user_dir,
self.g_pool.min_data_confidence,
None,
None,
self.plugins,
self.out_file_path,
{},
)
self.process = bh.IPC_Logging_Task_Proxy(
"Pupil Batch Export {}".format(self.out_file_path),
export_function,
args=args,
)
self.notify_all(
{"subject": "batch_export.started", "out_file_path": self.out_file_path}
)
def cancel_export(self):
if self.process:
self.process.cancel()
self.notify_all(
{"subject": "batch_export.canceled", "out_file_path": self.out_file_path}
)
def get_init_dict(self):
# do not be session persistent
raise NotImplementedError()
def deinit_ui(self):
self.remove_menu()
def cleanup(self):
self.cancel_export()
self.notify_all(
{"subject": "batch_export.removed", "out_file_path": self.out_file_path}
)
class Batch_Exporter(Plugin):
"""The Batch_Exporter searches for available recordings and exports them to a common location"""
icon_chr = chr(0xEC05)
icon_font = "pupil_icons"
def __init__(self, g_pool, source_dir="~/", destination_dir="~/"):
super().__init__(g_pool)
self.available_exports = []
self.queued_exports = []
self.active_exports = []
self.destination_dir = os.path.expanduser(destination_dir)
self.source_dir = os.path.expanduser(source_dir)
self.search_task = None
self.worker_count = cpu_count() - 1
logger.info(
"Using a maximum of {} CPUs to process visualizations in parallel...".format(
cpu_count() - 1
)
)
def get_init_dict(self):
return {"source_dir": self.source_dir, "destination_dir": self.destination_dir}
def init_ui(self):
self.add_menu()
self.menu.label = "Batch Export Recordings"
self.menu.append(
ui.Info_Text(
"Search will walk through the source directory recursively and detect available Pupil recordings."
)
)
self.menu.append(
ui.Text_Input(
"source_dir", self, label="Source directory", setter=self.set_src_dir
)
)
self.search_button = ui.Button("Search", self.detect_recordings)
self.menu.append(self.search_button)
self.avail_recs_menu = ui.Growing_Menu("Available Recordings")
self._update_avail_recs_menu()
self.menu.append(self.avail_recs_menu)
self.menu.append(
ui.Text_Input(
"destination_dir",
self,
label="Destination directory",
setter=self.set_dest_dir,
)
)
self.menu.append(ui.Button("Export selected", self.queue_selected))
self.menu.append(ui.Button("Clear search results", self._clear_avail))
self.menu.append(ui.Separator())
self.menu.append(ui.Button("Cancel all exports", self.cancel_all))
def deinit_ui(self):
self.menu.remove(self.avail_recs_menu)
self.avail_recs_menu = None
self.remove_menu()
def detect_recordings(self):
if self.search_task:
self.search_task.cancel()
self.search_task = None
self.search_button.outer_label = ""
self.search_button.label = "Search"
else:
self.search_button.outer_label = "Searching..."
self.search_button.label = "Cancel"
self.search_task = bh.IPC_Logging_Task_Proxy(
"Searching recordings in {}".format(self.source_dir),
get_recording_dirs,
args=[self.source_dir],
)
def set_src_dir(self, new_dir):
new_dir = os.path.expanduser(new_dir)
if os.path.isdir(new_dir):
self.source_dir = new_dir
else:
logger.warning('"{}" is not a directory'.format(new_dir))
return
def set_dest_dir(self, new_dir):
new_dir = os.path.expanduser(new_dir)
if os.path.isdir(new_dir):
self.destination_dir = new_dir
else:
logger.warning('"{}" is not a directory'.format(new_dir))
return
def _clear_avail(self):
del self.available_exports[:]
self._update_avail_recs_menu()
def _update_avail_recs_menu(self):
del self.avail_recs_menu[:]
if self.available_exports:
for avail in self.available_exports:
self.avail_recs_menu.append(
ui.Switch("selected", avail, label=avail["source"])
)
else:
self.avail_recs_menu.append(
ui.Info_Text(
"No recordings available yet. Use Search to find recordings."
)
)
def queue_selected(self):
for avail in self.available_exports[:]:
if avail["selected"]:
try:
frames_to_export = len(
np.load(os.path.join(avail["source"], "world_timestamps.npy"))
)
except Exception:
logger.error("Invalid export directory: {}".format(avail["source"]))
self.available_exports.remove(avail)
continue
# make a unique name created from rec_session and dir name
rec_session, rec_dir = avail["source"].rsplit(os.path.sep, 2)[1:]
out_name = rec_session + "_" + rec_dir + ".mp4"
out_file_path = os.path.join(self.destination_dir, out_name)
if (
out_file_path in self.queued_exports
or out_file_path in self.active_exports
):
logger.error(
"This export setting would try to save {} at least twice please rename dirs to prevent this. Skipping recording.".format(
out_file_path
)
)
continue
self.notify_all(
{
"subject": "start_plugin",
"name": "Batch_Export",
"args": {
"out_file_path": out_file_path,
"rec_dir": avail["source"],
"frames_to_export": frames_to_export,
},
}
)
self.available_exports.remove(avail)
self.queued_exports.append(out_file_path)
self._update_avail_recs_menu()
def start_export(self, queued):
self.notify_all(
{"subject": "batch_export.should_start", "out_file_path": queued}
)
self.active_exports.append(queued)
self.queued_exports.remove(queued)
def on_notify(self, n):
if n["subject"] in ("batch_export.canceled", "batch_export.completed"):
if n["out_file_path"] in self.queued_exports:
self.queued_exports.remove(n["out_file_path"])
if n["out_file_path"] in self.active_exports:
self.active_exports.remove(n["out_file_path"])
# Add queued exports to active queue
for queued in self.queued_exports[
: self.worker_count - len(self.active_exports)
]:
self.start_export(queued)
def recent_events(self, events):
if self.search_task:
recent = [d for d in self.search_task.fetch()]
if recent:
currently_avail = [rec["source"] for rec in self.available_exports]
self.available_exports.extend(
[
{"source": rec, "selected": True}
for rec in recent
if rec not in currently_avail
]
)
self._update_avail_recs_menu()
if self.search_task.completed:
self.search_task = None
self.search_button.outer_label = ""
self.search_button.label = "Search"
def cancel_all(self):
self.notify_all({"subject": "batch_export.should_cancel", "remove_menu": True})
def cleanup(self):
self.cancel_all()
if self.search_task:
self.search_task.cancel()
def main():
import argparse
from textwrap import dedent
from file_methods import Persistent_Dict
def show_progess(jobs):
no_jobs = len(jobs)
width = 80
full = width / no_jobs
string = ""
for j in jobs:
try:
p = int(
width
* j.current_frame.value
/ float(j.frames_to_export.value * no_jobs)
)
except Exception:
p = 0
string += "[" + p * "|" + (full - p) * "-" + "]"
sys.stdout.write("\r" + string)
sys.stdout.flush()
"""Batch process recordings to produce visualizations
Using simple_circle as the default visualizations
Steps:
- User Supplies: Directory that contains many recording(s) dirs or just one recordings dir
- We walk the user supplied directory to get all data folders
- Data is the list we feed to our multiprocessed
- Error check -- do we have required files in each dir?: world.avi, gaze_positions.npy, timestamps.npy
- Result: world_viz.avi within each original data folder
"""
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description=dedent(
"""\
***************************************************
Batch process recordings to produce visualizations
The default visualization will use simple_circle
Usage Example:
python batch_exporter.py -d /path/to/folder-with-many-recordings -s ~/Pupil_Player/settings/user_settings -e ~/my_export_dir
Arguments:
-d : Specify a recording directory.
This could have one or many recordings contained within it.
We will recurse into the dir.
-s : Specify path to Pupil Player user_settings file to use last used vizualization settings.
-e : Specify export directory if you dont want the export saved within each recording dir.
-p : Export a 120 frame preview only.
***************************************************\
"""
),
)
parser.add_argument("-d", "--rec-dir", required=True)
parser.add_argument("-s", "--settings-file", required=True)
parser.add_argument("-e", "--export-to-dir", default=False)
parser.add_argument("-c", "--basic-color", default="red")
parser.add_argument("-p", "--preview", action="store_true")
if len(sys.argv) == 1:
print(parser.description)
return
args = parser.parse_args()
# get the top level data folder from terminal argument
data_dir = args.rec_dir
if args.settings_file and os.path.isfile(args.settings_file):
session_settings = Persistent_Dict(os.path.splitext(args.settings_file)[0])
# these are loaded based on user settings
plugin_initializers = session_settings.get("loaded_plugins", [])
session_settings.close()
else:
logger.error("Setting file not found or valid")
return
if args.export_to_dir:
export_dir = args.export_to_dir
if os.path.isdir(export_dir):
logger.info("Exporting all vids to {}".format(export_dir))
else:
logger.error("Exporting dir is not valid {}".format(export_dir))
return
else:
export_dir = None
logger.info("Exporting into the recording dirs.")
if args.preview:
preview = True
logger.info("Exporting first 120frames only")
else:
preview = False
class Temp(object):
pass
recording_dirs = get_recording_dirs(data_dir)
# start multiprocessing engine
n_cpu = mp.cpu_count()
logger.info(
"Using a maximum of {} CPUs to process visualizations in parallel...".format(
n_cpu
)
)
jobs = []
outfiles = set()
for d in recording_dirs:
j = Temp()
logger.info("Adding new export: {}".format(d))
j.should_terminate = mp.Value(c_bool, 0)
j.frames_to_export = mp.Value(c_int, 0)
j.current_frame = mp.Value(c_int, 0)
j.data_dir = d
j.user_dir = None
j.start_frame = None
if preview:
j.end_frame = 30
else:
j.end_frame = None
j.plugin_initializers = plugin_initializers[:]
if export_dir:
# make a unique name created from rec_session and dir name
rec_session, rec_dir = d.rsplit(os.path.sep, 2)[1:]
out_name = rec_session + "_" + rec_dir + ".mp4"
j.out_file_path = os.path.join(os.path.expanduser(export_dir), out_name)
if j.out_file_path in outfiles:
logger.error(
"This export setting would try to save {} at least twice pleace rename dirs to prevent this.".format(
j.out_file_path
)
)
return
outfiles.add(j.out_file_path)
logger.info("Exporting to: {}".format(j.out_file_path))
else:
j.out_file_path = None
j.args = (
j.should_terminate,
j.frames_to_export,
j.current_frame,
j.data_dir,
j.user_dir,
j.start_frame,
j.end_frame,
j.plugin_initializers,
j.out_file_path,
None,
)
jobs.append(j)
todo = jobs[:]
workers = [
Export_Process(target=export, args=todo.pop(0).args)
for i in range(min(len(todo), n_cpu))
]
for w in workers:
w.start()
working = True
while working: # cannot use pool as it does not allow shared memory
working = False
for i in range(len(workers)):
if workers[i].is_alive():
working = True
else:
if todo:
workers[i] = Export_Process(target=export, args=todo.pop(0).args)
workers[i].start()
working = True
show_progess(jobs)
time.sleep(0.25)
print("\n")
if __name__ == "__main__":
logging.basicConfig(level=logging.WARNING)
main()
| {
"pile_set_name": "Github"
} |
// <copyright file="UnixDirectoryEntry.cs" company="Fubar Development Junker">
// Copyright (c) Fubar Development Junker. All rights reserved.
// </copyright>
using System.Security.Claims;
using FubarDev.FtpServer.AccountManagement;
using Mono.Unix;
namespace FubarDev.FtpServer.FileSystem.Unix
{
internal class UnixDirectoryEntry : UnixFileSystemEntry, IUnixDirectoryEntry
{
public UnixDirectoryEntry(
UnixDirectoryInfo info,
ClaimsPrincipal user,
UnixUserInfo? userInfo,
IUnixDirectoryEntry? parent = null)
: base(info)
{
IsRoot = parent == null;
Info = info;
if (parent == null)
{
// Root user
IsDeletable = false;
}
else if (info.Parent == info)
{
// File system root
IsDeletable = false;
}
else if (userInfo != null && (userInfo.UserId == 0 || userInfo.GroupId == 0))
{
IsDeletable = true;
}
else
{
IsDeletable = parent.GetEffectivePermissions(user).Write;
}
}
/// <summary>
/// Gets the unix directory info.
/// </summary>
public UnixDirectoryInfo Info { get; }
/// <inheritdoc />
public bool IsRoot { get; }
/// <inheritdoc />
public bool IsDeletable { get; }
}
}
| {
"pile_set_name": "Github"
} |
---
layout: post
title: More Under-The-Hood Changes
date: 2014-06-26 11:00:00
category: Releases
permalink: /blog/2014/06/26/
---
v1.13.7 of PCjs contains a few minor improvements, mostly in terms of rendering video modes a little more
efficiently. The rest of the changes to the website involved beefing up support for both "software manifests"
and "document manifests."
To that end, there's a new [/pubs/](/pubs/) directory for old documents, and [/disks/pcx86/](/disks/pcx86/) contains
more disk images, with more on the way. I have a TON of old diskette images, and it has taken more time to organize
them and create manifests than I would like.
*[@jeffpar](https://jeffpar.com)*
*June 26, 2014*
| {
"pile_set_name": "Github"
} |
// Copyright 2008, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// This test verifies that it's possible to use Google Test by including
// the gtest.h header file alone.
#include "gtest/gtest.h"
namespace {
void Subroutine() {
EXPECT_EQ(42, 42);
}
TEST(NoFatalFailureTest, ExpectNoFatalFailure) {
EXPECT_NO_FATAL_FAILURE(;);
EXPECT_NO_FATAL_FAILURE(SUCCEED());
EXPECT_NO_FATAL_FAILURE(Subroutine());
EXPECT_NO_FATAL_FAILURE({ SUCCEED(); });
}
TEST(NoFatalFailureTest, AssertNoFatalFailure) {
ASSERT_NO_FATAL_FAILURE(;);
ASSERT_NO_FATAL_FAILURE(SUCCEED());
ASSERT_NO_FATAL_FAILURE(Subroutine());
ASSERT_NO_FATAL_FAILURE({ SUCCEED(); });
}
} // namespace
| {
"pile_set_name": "Github"
} |
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
{
func d {
{
}
{
{
{
}
(
let {
{
{
class B
{
{
}
extension NSSet {
deinit {
{
}
{
}
{
let a {
{
{
{
}
class
case ,
| {
"pile_set_name": "Github"
} |
/*!
* \file painter_shader_set.cpp
* \brief file painter_shader_set.cpp
*
* Copyright 2016 by Intel.
*
* Contact: [email protected]
*
* This Source Code Form is subject to the
* terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with
* this file, You can obtain one at
* http://mozilla.org/MPL/2.0/.
*
* \author Kevin Rogovin <[email protected]>
*
*/
#include <fastuidraw/painter/shader/painter_brush_shader_set.hpp>
#include <private/util_private.hpp>
namespace
{
class PainterBrushShaderSetPrivate
{
public:
fastuidraw::reference_counted_ptr<fastuidraw::PainterBrushShader> m_standard_brush;
fastuidraw::reference_counted_ptr<const fastuidraw::PainterImageBrushShader> m_image_brush;
fastuidraw::reference_counted_ptr<const fastuidraw::PainterGradientBrushShader> m_gradient_brush;
};
}
/////////////////////////////////////////////////
// fastuidraw::PainterBrushShaderSet methods
fastuidraw::PainterBrushShaderSet::
PainterBrushShaderSet(void)
{
m_d = FASTUIDRAWnew PainterBrushShaderSetPrivate();
}
fastuidraw::PainterBrushShaderSet::
PainterBrushShaderSet(const PainterBrushShaderSet &obj)
{
PainterBrushShaderSetPrivate *d;
d = static_cast<PainterBrushShaderSetPrivate*>(obj.m_d);
m_d = FASTUIDRAWnew PainterBrushShaderSetPrivate(*d);
}
fastuidraw::PainterBrushShaderSet::
~PainterBrushShaderSet()
{
PainterBrushShaderSetPrivate *d;
d = static_cast<PainterBrushShaderSetPrivate*>(m_d);
FASTUIDRAWdelete(d);
m_d = nullptr;
}
assign_swap_implement(fastuidraw::PainterBrushShaderSet)
setget_implement(fastuidraw::PainterBrushShaderSet, PainterBrushShaderSetPrivate,
const fastuidraw::reference_counted_ptr<fastuidraw::PainterBrushShader>&,
standard_brush)
setget_implement(fastuidraw::PainterBrushShaderSet, PainterBrushShaderSetPrivate,
const fastuidraw::reference_counted_ptr<const fastuidraw::PainterImageBrushShader>&,
image_brush)
setget_implement(fastuidraw::PainterBrushShaderSet, PainterBrushShaderSetPrivate,
const fastuidraw::reference_counted_ptr<const fastuidraw::PainterGradientBrushShader>&,
gradient_brush)
| {
"pile_set_name": "Github"
} |
//
// Mixins
// --------------------------------------------------
// Utilities
// -------------------------
// Clearfix
// Source: http://nicolasgallagher.com/micro-clearfix-hack/
//
// For modern browsers
// 1. The space content is one way to avoid an Opera bug when the
// contenteditable attribute is included anywhere else in the document.
// Otherwise it causes space to appear at the top and bottom of elements
// that are clearfixed.
// 2. The use of `table` rather than `block` is only necessary if using
// `:before` to contain the top-margins of child elements.
.clearfix() {
&:before,
&:after {
content: " "; /* 1 */
display: table; /* 2 */
}
&:after {
clear: both;
}
}
// Webkit-style focus
.tab-focus() {
// Default
outline: thin dotted #333;
// Webkit
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
// Center-align a block level element
.center-block() {
display: block;
margin-left: auto;
margin-right: auto;
}
// Sizing shortcuts
.size(@width; @height) {
width: @width;
height: @height;
}
.square(@size) {
.size(@size; @size);
}
// Placeholder text
.placeholder(@color: @input-color-placeholder) {
&:-moz-placeholder { color: @color; } // Firefox 4-18
&::-moz-placeholder { color: @color; } // Firefox 19+
&:-ms-input-placeholder { color: @color; } // Internet Explorer 10+
&::-webkit-input-placeholder { color: @color; } // Safari and Chrome
}
// Text overflow
// Requires inline-block or block for proper styling
.text-overflow() {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
// CSS image replacement
// Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
.hide-text() {
font: ~"0/0" a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
// CSS3 PROPERTIES
// --------------------------------------------------
// Single side border-radius
.border-top-radius(@radius) {
border-top-right-radius: @radius;
border-top-left-radius: @radius;
}
.border-right-radius(@radius) {
border-bottom-right-radius: @radius;
border-top-right-radius: @radius;
}
.border-bottom-radius(@radius) {
border-bottom-right-radius: @radius;
border-bottom-left-radius: @radius;
}
.border-left-radius(@radius) {
border-bottom-left-radius: @radius;
border-top-left-radius: @radius;
}
// Drop shadows
.box-shadow(@shadow) {
-webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1
box-shadow: @shadow;
}
// Transitions
.transition(@transition) {
-webkit-transition: @transition;
transition: @transition;
}
.transition-delay(@transition-delay) {
-webkit-transition-delay: @transition-delay;
transition-delay: @transition-delay;
}
.transition-duration(@transition-duration) {
-webkit-transition-duration: @transition-duration;
transition-duration: @transition-duration;
}
.transition-transform(@transition) {
-webkit-transition: -webkit-transform @transition;
-moz-transition: -moz-transform @transition;
-o-transition: -o-transform @transition;
transition: transform @transition;
}
// Transformations
.rotate(@degrees) {
-webkit-transform: rotate(@degrees);
-ms-transform: rotate(@degrees); // IE9+
transform: rotate(@degrees);
}
.scale(@ratio) {
-webkit-transform: scale(@ratio);
-ms-transform: scale(@ratio); // IE9+
transform: scale(@ratio);
}
.translate(@x; @y) {
-webkit-transform: translate(@x, @y);
-ms-transform: translate(@x, @y); // IE9+
transform: translate(@x, @y);
}
.skew(@x; @y) {
-webkit-transform: skew(@x, @y);
-ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
transform: skew(@x, @y);
}
.translate3d(@x; @y; @z) {
-webkit-transform: translate3d(@x, @y, @z);
transform: translate3d(@x, @y, @z);
}
// Backface visibility
// Prevent browsers from flickering when using CSS 3D transforms.
// Default value is `visible`, but can be changed to `hidden`
// See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples
.backface-visibility(@visibility){
-webkit-backface-visibility: @visibility;
-moz-backface-visibility: @visibility;
backface-visibility: @visibility;
}
// Box sizing
.box-sizing(@boxmodel) {
-webkit-box-sizing: @boxmodel;
-moz-box-sizing: @boxmodel;
box-sizing: @boxmodel;
}
// User select
// For selecting text on the page
.user-select(@select) {
-webkit-user-select: @select;
-moz-user-select: @select;
-ms-user-select: @select; // IE10+
-o-user-select: @select;
user-select: @select;
}
// Resize anything
.resizable(@direction) {
resize: @direction; // Options: horizontal, vertical, both
overflow: auto; // Safari fix
}
// CSS3 Content Columns
.content-columns(@column-count; @column-gap: @grid-gutter-width) {
-webkit-column-count: @column-count;
-moz-column-count: @column-count;
column-count: @column-count;
-webkit-column-gap: @column-gap;
-moz-column-gap: @column-gap;
column-gap: @column-gap;
}
// Optional hyphenation
.hyphens(@mode: auto) {
word-wrap: break-word;
-webkit-hyphens: @mode;
-moz-hyphens: @mode;
-ms-hyphens: @mode; // IE10+
-o-hyphens: @mode;
hyphens: @mode;
}
// Opacity
.opacity(@opacity) {
opacity: @opacity;
// IE8 filter
@opacity-ie: (@opacity * 100);
filter: ~"alpha(opacity=@{opacity-ie})";
}
// GRADIENTS
// --------------------------------------------------
#gradient {
// Horizontal gradient, from left to right
//
// Creates two color stops, start and end, by specifying a color and position for each color stop.
// Color stops are not available in IE9 and below.
.horizontal(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {
background-image: -webkit-gradient(linear, @start-percent top, @end-percent top, from(@start-color), to(@end-color)); // Safari 4+, Chrome 2+
background-image: -webkit-linear-gradient(left, color-stop(@start-color @start-percent), color-stop(@end-color @end-percent)); // Safari 5.1+, Chrome 10+
background-image: -moz-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // FF 3.6+
background-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent); // Standard, IE10
background-repeat: repeat-x;
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down
}
// Vertical gradient, from top to bottom
//
// Creates two color stops, start and end, by specifying a color and position for each color stop.
// Color stops are not available in IE9 and below.
.vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {
background-image: -webkit-gradient(linear, left @start-percent, left @end-percent, from(@start-color), to(@end-color)); // Safari 4+, Chrome 2+
background-image: -webkit-linear-gradient(top, @start-color, @start-percent, @end-color, @end-percent); // Safari 5.1+, Chrome 10+
background-image: -moz-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // FF 3.6+
background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent); // Standard, IE10
background-repeat: repeat-x;
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down
}
.directional(@start-color: #555; @end-color: #333; @deg: 45deg) {
background-repeat: repeat-x;
background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1+, Chrome 10+
background-image: -moz-linear-gradient(@deg, @start-color, @end-color); // FF 3.6+
background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10
}
.horizontal-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {
background-image: -webkit-gradient(left, linear, 0 0, 0 100%, from(@start-color), color-stop(@color-stop, @mid-color), to(@end-color));
background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);
background-image: -moz-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);
background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color);
background-repeat: no-repeat;
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback
}
.vertical-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@start-color), color-stop(@color-stop, @mid-color), to(@end-color));
background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color);
background-image: -moz-linear-gradient(top, @start-color, @mid-color @color-stop, @end-color);
background-image: linear-gradient(@start-color, @mid-color @color-stop, @end-color);
background-repeat: no-repeat;
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback
}
.radial(@inner-color: #555; @outer-color: #333) {
background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@inner-color), to(@outer-color));
background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color);
background-image: -moz-radial-gradient(circle, @inner-color, @outer-color);
background-image: radial-gradient(circle, @inner-color, @outer-color);
background-repeat: no-repeat;
}
.striped(@color: #555; @angle: 45deg) {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
}
}
// Reset filters for IE
//
// When you need to remove a gradient background, do not forget to use this to reset
// the IE filter for IE9 and below.
.reset-filter() {
filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
}
// Retina images
//
// Short retina mixin for setting background-image and -size
.img-retina(@file-1x; @file-2x; @width-1x; @height-1x) {
background-image: url("@{file-1x}");
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and ( min-device-pixel-ratio: 2),
only screen and ( min-resolution: 192dpi),
only screen and ( min-resolution: 2dppx) {
background-image: url("@{file-2x}");
background-size: @width-1x @height-1x;
}
}
// Responsive image
//
// Keep images from scaling beyond the width of their parents.
.img-responsive(@display: block;) {
display: @display;
max-width: 100%; // Part 1: Set a maximum relative to the parent
height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
}
// COMPONENT MIXINS
// --------------------------------------------------
// Horizontal dividers
// -------------------------
// Dividers (basically an hr) within dropdowns and nav lists
.nav-divider(@color: #e5e5e5) {
height: 1px;
margin: ((@line-height-computed / 2) - 1) 0;
overflow: hidden;
background-color: @color;
}
// Panels
// -------------------------
.panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border;) {
border-color: @border;
& > .panel-heading {
color: @heading-text-color;
background-color: @heading-bg-color;
border-color: @heading-border;
+ .panel-collapse .panel-body {
border-top-color: @border;
}
}
& > .panel-footer {
+ .panel-collapse .panel-body {
border-bottom-color: @border;
}
}
}
// Alerts
// -------------------------
.alert-variant(@background; @border; @text-color) {
background-color: @background;
border-color: @border;
color: @text-color;
hr {
border-top-color: darken(@border, 5%);
}
.alert-link {
color: darken(@text-color, 10%);
}
}
// Tables
// -------------------------
.table-row-variant(@state; @background; @border) {
// Exact selectors below required to override `.table-striped` and prevent
// inheritance to nested tables.
.table > thead > tr,
.table > tbody > tr,
.table > tfoot > tr {
> td.@{state},
> th.@{state},
&.@{state} > td,
&.@{state} > th {
background-color: @background;
border-color: @border;
}
}
// Hover states for `.table-hover`
// Note: this is not available for cells or rows within `thead` or `tfoot`.
.table-hover > tbody > tr {
> td.@{state}:hover,
> th.@{state}:hover,
&.@{state}:hover > td {
background-color: darken(@background, 5%);
border-color: darken(@border, 5%);
}
}
}
// Button variants
// -------------------------
// Easily pump out default styles, as well as :hover, :focus, :active,
// and disabled options for all buttons
.button-variant(@color; @background; @border) {
color: @color;
background-color: @background;
border-color: @border;
&:hover,
&:focus,
&:active,
&.active,
.open .dropdown-toggle& {
color: @color;
background-color: darken(@background, 8%);
border-color: darken(@border, 12%);
}
&:active,
&.active,
.open .dropdown-toggle& {
background-image: none;
}
&.disabled,
&[disabled],
fieldset[disabled] & {
&,
&:hover,
&:focus,
&:active,
&.active {
background-color: @background;
border-color: @border
}
}
}
// Button sizes
// -------------------------
.button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {
padding: @padding-vertical @padding-horizontal;
font-size: @font-size;
line-height: @line-height;
border-radius: @border-radius;
}
// Pagination
// -------------------------
.pagination-size(@padding-vertical; @padding-horizontal; @font-size; @border-radius) {
> li {
> a,
> span {
padding: @padding-vertical @padding-horizontal;
font-size: @font-size;
}
&:first-child {
> a,
> span {
.border-left-radius(@border-radius);
}
}
&:last-child {
> a,
> span {
.border-right-radius(@border-radius);
}
}
}
}
// Labels
// -------------------------
.label-variant(@color) {
background-color: @color;
&[href] {
&:hover,
&:focus {
background-color: darken(@color, 10%);
}
}
}
// Navbar vertical align
// -------------------------
// Vertically center elements in the navbar.
// Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.
.navbar-vertical-align(@element-height) {
margin-top: ((@navbar-height - @element-height) / 2);
margin-bottom: ((@navbar-height - @element-height) / 2);
}
// Progress bars
// -------------------------
.progress-bar-variant(@color) {
background-color: @color;
.progress-striped & {
#gradient > .striped(@color);
}
}
// Responsive utilities
// -------------------------
// More easily include all the states for responsive-utilities.less.
.responsive-visibility() {
display: block !important;
tr& { display: table-row !important; }
th&,
td& { display: table-cell !important; }
}
.responsive-invisibility() {
display: none !important;
tr& { display: none !important; }
th&,
td& { display: none !important; }
}
// Grid System
// -----------
// Centered container element
.container-fixed() {
margin-right: auto;
margin-left: auto;
padding-left: (@grid-gutter-width / 2);
padding-right: (@grid-gutter-width / 2);
.clearfix();
}
// Creates a wrapper for a series of columns
.make-row(@gutter: @grid-gutter-width) {
margin-left: (@gutter / -2);
margin-right: (@gutter / -2);
.clearfix();
}
// Generate the extra small columns
.make-xs-column(@columns; @gutter: @grid-gutter-width) {
position: relative;
float: left;
width: percentage((@columns / @grid-columns));
// Prevent columns from collapsing when empty
min-height: 1px;
// Inner gutter via padding
padding-left: (@gutter / 2);
padding-right: (@gutter / 2);
}
// Generate the small columns
.make-sm-column(@columns; @gutter: @grid-gutter-width) {
position: relative;
// Prevent columns from collapsing when empty
min-height: 1px;
// Inner gutter via padding
padding-left: (@gutter / 2);
padding-right: (@gutter / 2);
// Calculate width based on number of columns available
@media (min-width: @screen-sm) {
float: left;
width: percentage((@columns / @grid-columns));
}
}
// Generate the small column offsets
.make-sm-column-offset(@columns) {
@media (min-width: @screen-sm) {
margin-left: percentage((@columns / @grid-columns));
}
}
.make-sm-column-push(@columns) {
@media (min-width: @screen-sm) {
left: percentage((@columns / @grid-columns));
}
}
.make-sm-column-pull(@columns) {
@media (min-width: @screen-sm) {
right: percentage((@columns / @grid-columns));
}
}
// Generate the medium columns
.make-md-column(@columns; @gutter: @grid-gutter-width) {
position: relative;
// Prevent columns from collapsing when empty
min-height: 1px;
// Inner gutter via padding
padding-left: (@gutter / 2);
padding-right: (@gutter / 2);
// Calculate width based on number of columns available
@media (min-width: @screen-md) {
float: left;
width: percentage((@columns / @grid-columns));
}
}
// Generate the large column offsets
.make-md-column-offset(@columns) {
@media (min-width: @screen-md) {
margin-left: percentage((@columns / @grid-columns));
}
}
.make-md-column-push(@columns) {
@media (min-width: @screen-md) {
left: percentage((@columns / @grid-columns));
}
}
.make-md-column-pull(@columns) {
@media (min-width: @screen-md) {
right: percentage((@columns / @grid-columns));
}
}
// Generate the large columns
.make-lg-column(@columns; @gutter: @grid-gutter-width) {
position: relative;
// Prevent columns from collapsing when empty
min-height: 1px;
// Inner gutter via padding
padding-left: (@gutter / 2);
padding-right: (@gutter / 2);
// Calculate width based on number of columns available
@media (min-width: @screen-lg) {
float: left;
width: percentage((@columns / @grid-columns));
}
}
// Generate the large column offsets
.make-lg-column-offset(@columns) {
@media (min-width: @screen-lg) {
margin-left: percentage((@columns / @grid-columns));
}
}
.make-lg-column-push(@columns) {
@media (min-width: @screen-lg) {
left: percentage((@columns / @grid-columns));
}
}
.make-lg-column-pull(@columns) {
@media (min-width: @screen-lg) {
right: percentage((@columns / @grid-columns));
}
}
// Form validation states
//
// Used in forms.less to generate the form validation CSS for warnings, errors,
// and successes.
.form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) {
// Color the label and help text
.help-block,
.control-label {
color: @text-color;
}
// Set the border and box shadow on specific inputs to match
.form-control {
border-color: @border-color;
.box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
&:focus {
border-color: darken(@border-color, 10%);
@shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%);
.box-shadow(@shadow);
}
}
// Set validation states also for addons
.input-group-addon {
color: @text-color;
border-color: @border-color;
background-color: @background-color;
}
}
// Form control focus state
//
// Generate a customized focus state and for any input with the specified color,
// which defaults to the `@input-focus-border` variable.
//
// We highly encourage you to not customize the default value, but instead use
// this to tweak colors on an as-needed basis. This aesthetic change is based on
// WebKit's default styles, but applicable to a wider range of browsers. Its
// usability and accessibility should be taken into account with any change.
//
// Example usage: change the default blue border and shadow to white for better
// contrast against a dark gray background.
.form-control-focus(@color: @input-border-focus) {
@color-rgba: rgba(red(@color), green(@color), blue(@color), .6);
&:focus {
border-color: @color;
outline: 0;
.box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}");
}
}
// Form control sizing
//
// Relative text size, padding, and border-radii changes for form controls. For
// horizontal sizing, wrap controls in the predefined grid classes. `<select>`
// element gets special love because it's special, and that's a fact!
.input-size(@input-height; @padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {
height: @input-height;
padding: @padding-vertical @padding-horizontal;
font-size: @font-size;
line-height: @line-height;
border-radius: @border-radius;
select& {
height: @input-height;
line-height: @input-height;
}
textarea& {
height: auto;
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<resources>
<drawable name="locale_current_flag">@drawable/flag_israel</drawable>
</resources> | {
"pile_set_name": "Github"
} |
/*******************************************************************************
* You may amend and distribute as you like, but don't remove this header!
*
* EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
* See https://github.com/JanKallman/EPPlus for details.
*
* Copyright (C) 2011 Jan Källman
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
* If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
*
* All code and executables are provided "as is" with no warranty either express or implied.
* The author accepts no liability for any damage or loss of business that this product may cause.
*
* Code change notes:
*
* Author Change Date
* ******************************************************************************
* Jan Källman Initial Release 2009-10-01
* Jan Källman License changed GPL-->LGPL 2011-12-16
*******************************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using OfficeOpenXml.Style.XmlAccess;
using System.Globalization;
namespace OfficeOpenXml.Style
{
/// <summary>
/// The background fill of a cell
/// </summary>
public class ExcelGradientFill : StyleBase
{
internal ExcelGradientFill(ExcelStyles styles, OfficeOpenXml.XmlHelper.ChangedEventHandler ChangedEvent, int PositionID, string address, int index) :
base(styles, ChangedEvent, PositionID, address)
{
Index = index;
}
/// <summary>
/// Angle of the linear gradient
/// </summary>
public double Degree
{
get
{
return ((ExcelGradientFillXml)_styles.Fills[Index]).Degree;
}
set
{
_ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.GradientFill, eStyleProperty.GradientDegree, value, _positionID, _address));
}
}
/// <summary>
/// Linear or Path gradient
/// </summary>
public ExcelFillGradientType Type
{
get
{
return ((ExcelGradientFillXml)_styles.Fills[Index]).Type;
}
set
{
_ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.GradientFill, eStyleProperty.GradientType, value, _positionID, _address));
}
}
/// <summary>
/// Specifies in percentage format(from the top to the bottom) the position of the top edge of the inner rectangle (color 1). For top, 0 means the top edge of the inner rectangle is on the top edge of the cell, and 1 means it is on the bottom edge of the cell. (applies to From Corner and From Center gradients).
/// </summary>
public double Top
{
get
{
return ((ExcelGradientFillXml)_styles.Fills[Index]).Top;
}
set
{
if (value < 0 | value > 1)
{
throw (new ArgumentOutOfRangeException("Value must be between 0 and 1"));
}
_ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.GradientFill, eStyleProperty.GradientTop, value, _positionID, _address));
}
}
/// <summary>
/// Specifies in percentage format (from the top to the bottom) the position of the bottom edge of the inner rectangle (color 1). For bottom, 0 means the bottom edge of the inner rectangle is on the top edge of the cell, and 1 means it is on the bottom edge of the cell.
/// </summary>
public double Bottom
{
get
{
return ((ExcelGradientFillXml)_styles.Fills[Index]).Bottom;
}
set
{
if (value < 0 | value > 1)
{
throw (new ArgumentOutOfRangeException("Value must be between 0 and 1"));
}
_ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.GradientFill, eStyleProperty.GradientBottom, value, _positionID, _address));
}
}
/// <summary>
/// Specifies in percentage format (from the left to the right) the position of the left edge of the inner rectangle (color 1). For left, 0 means the left edge of the inner rectangle is on the left edge of the cell, and 1 means it is on the right edge of the cell. (applies to From Corner and From Center gradients).
/// </summary>
public double Left
{
get
{
return ((ExcelGradientFillXml)_styles.Fills[Index]).Left;
}
set
{
if (value < 0 | value > 1)
{
throw (new ArgumentOutOfRangeException("Value must be between 0 and 1"));
}
_ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.GradientFill, eStyleProperty.GradientLeft, value, _positionID, _address));
}
}
/// <summary>
/// Specifies in percentage format (from the left to the right) the position of the right edge of the inner rectangle (color 1). For right, 0 means the right edge of the inner rectangle is on the left edge of the cell, and 1 means it is on the right edge of the cell. (applies to From Corner and From Center gradients).
/// </summary>
public double Right
{
get
{
return ((ExcelGradientFillXml)_styles.Fills[Index]).Right;
}
set
{
if (value < 0 | value > 1)
{
throw (new ArgumentOutOfRangeException("Value must be between 0 and 1"));
}
_ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.GradientFill, eStyleProperty.GradientRight, value, _positionID, _address));
}
}
ExcelColor _gradientColor1 = null;
/// <summary>
/// Gradient Color 1
/// </summary>
public ExcelColor Color1
{
get
{
if (_gradientColor1 == null)
{
_gradientColor1 = new ExcelColor(_styles, _ChangedEvent, _positionID, _address, eStyleClass.FillGradientColor1, this);
}
return _gradientColor1;
}
}
ExcelColor _gradientColor2 = null;
/// <summary>
/// Gradient Color 2
/// </summary>
public ExcelColor Color2
{
get
{
if (_gradientColor2 == null)
{
_gradientColor2 = new ExcelColor(_styles, _ChangedEvent, _positionID, _address, eStyleClass.FillGradientColor2, this);
}
return _gradientColor2;
}
}
internal override string Id
{
get { return Degree.ToString() + Type + Color1.Id + Color2.Id + Top.ToString() + Bottom.ToString() + Left.ToString() + Right.ToString(); }
}
}
}
| {
"pile_set_name": "Github"
} |
<?php
namespace App\Http\Middleware;
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
class EncryptCookies extends Middleware
{
/**
* The names of the cookies that should not be encrypted.
*
* @var array
*/
protected $except = [
//
];
}
| {
"pile_set_name": "Github"
} |
#define STB_DEFINE
#include "stb.h"
#define STB_TRUETYPE_IMPLEMENTATION
#include "stb_truetype.h"
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "stb_image_write.h"
// used both to compute SDF and in 'shader'
float sdf_size = 32.0; // the larger this is, the better large font sizes look
float pixel_dist_scale = 64.0; // trades off precision w/ ability to handle *smaller* sizes
int onedge_value = 128;
int padding = 3; // not used in shader
typedef struct
{
float advance;
signed char xoff;
signed char yoff;
unsigned char w,h;
unsigned char *data;
} fontchar;
fontchar fdata[128];
#define BITMAP_W 1200
#define BITMAP_H 800
unsigned char bitmap[BITMAP_H][BITMAP_W][3];
char *sample = "This is goofy text, size %d!";
char *small_sample = "This is goofy text, size %d! Really needs in-shader supersampling to look good.";
void blend_pixel(int x, int y, int color, float alpha)
{
int i;
for (i=0; i < 3; ++i)
bitmap[y][x][i] = (unsigned char) (stb_lerp(alpha, bitmap[y][x][i], color)+0.5); // round
}
void draw_char(float px, float py, char c, float relative_scale)
{
int x,y;
fontchar *fc = &fdata[c];
float fx0 = px + fc->xoff*relative_scale;
float fy0 = py + fc->yoff*relative_scale;
float fx1 = fx0 + fc->w*relative_scale;
float fy1 = fy0 + fc->h*relative_scale;
int ix0 = (int) floor(fx0);
int iy0 = (int) floor(fy0);
int ix1 = (int) ceil(fx1);
int iy1 = (int) ceil(fy1);
// clamp to viewport
if (ix0 < 0) ix0 = 0;
if (iy0 < 0) iy0 = 0;
if (ix1 > BITMAP_W) ix1 = BITMAP_W;
if (iy1 > BITMAP_H) iy1 = BITMAP_H;
for (y=iy0; y < iy1; ++y) {
for (x=ix0; x < ix1; ++x) {
float sdf_dist, pix_dist;
float bmx = stb_linear_remap(x, fx0, fx1, 0, fc->w);
float bmy = stb_linear_remap(y, fy0, fy1, 0, fc->h);
int v00,v01,v10,v11;
float v0,v1,v;
int sx0 = (int) bmx;
int sx1 = sx0+1;
int sy0 = (int) bmy;
int sy1 = sy0+1;
// compute lerp weights
bmx = bmx - sx0;
bmy = bmy - sy0;
// clamp to edge
sx0 = stb_clamp(sx0, 0, fc->w-1);
sx1 = stb_clamp(sx1, 0, fc->w-1);
sy0 = stb_clamp(sy0, 0, fc->h-1);
sy1 = stb_clamp(sy1, 0, fc->h-1);
// bilinear texture sample
v00 = fc->data[sy0*fc->w+sx0];
v01 = fc->data[sy0*fc->w+sx1];
v10 = fc->data[sy1*fc->w+sx0];
v11 = fc->data[sy1*fc->w+sx1];
v0 = stb_lerp(bmx,v00,v01);
v1 = stb_lerp(bmx,v10,v11);
v = stb_lerp(bmy,v0 ,v1 );
#if 0
// non-anti-aliased
if (v > onedge_value)
blend_pixel(x,y,0,1.0);
#else
// Following math can be greatly simplified
// convert distance in SDF value to distance in SDF bitmap
sdf_dist = stb_linear_remap(v, onedge_value, onedge_value+pixel_dist_scale, 0, 1);
// convert distance in SDF bitmap to distance in output bitmap
pix_dist = sdf_dist * relative_scale;
// anti-alias by mapping 1/2 pixel around contour from 0..1 alpha
v = stb_linear_remap(pix_dist, -0.5f, 0.5f, 0, 1);
if (v > 1) v = 1;
if (v > 0)
blend_pixel(x,y,0,v);
#endif
}
}
}
void print_text(float x, float y, char *text, float scale)
{
int i;
for (i=0; text[i]; ++i) {
if (fdata[text[i]].data)
draw_char(x,y,text[i],scale);
x += fdata[text[i]].advance * scale;
}
}
int main(int argc, char **argv)
{
int ch;
float scale, ypos;
stbtt_fontinfo font;
void *data = stb_file("c:/windows/fonts/times.ttf", NULL);
stbtt_InitFont(&font, data, 0);
scale = stbtt_ScaleForPixelHeight(&font, sdf_size);
for (ch=32; ch < 127; ++ch) {
fontchar fc;
int xoff,yoff,w,h, advance;
fc.data = stbtt_GetCodepointSDF(&font, scale, ch, padding, onedge_value, pixel_dist_scale, &w, &h, &xoff, &yoff);
fc.xoff = xoff;
fc.yoff = yoff;
fc.w = w;
fc.h = h;
stbtt_GetCodepointHMetrics(&font, ch, &advance, NULL);
fc.advance = advance * scale;
fdata[ch] = fc;
}
ypos = 60;
memset(bitmap, 255, sizeof(bitmap));
print_text(400, ypos+30, stb_sprintf("sdf bitmap height %d", (int) sdf_size), 30/sdf_size);
ypos += 80;
for (scale = 8.0; scale < 120.0; scale *= 1.33f) {
print_text(80, ypos+scale, stb_sprintf(scale == 8.0 ? small_sample : sample, (int) scale), scale / sdf_size);
ypos += scale*1.05f + 20;
}
stbi_write_png("sdf_test.png", BITMAP_W, BITMAP_H, 3, bitmap, 0);
return 0;
}
| {
"pile_set_name": "Github"
} |
silk/float/schur_FLP.lo: silk/float/schur_FLP.c config.h \
silk/float/SigProc_FLP.h silk/SigProc_FIX.h /usr/include/string.h \
/usr/include/_types.h /usr/include/sys/_types.h \
/usr/include/sys/cdefs.h /usr/include/sys/_symbol_aliasing.h \
/usr/include/sys/_posix_availability.h /usr/include/machine/_types.h \
/usr/include/i386/_types.h /usr/include/sys/_pthread/_pthread_types.h \
/usr/include/Availability.h /usr/include/AvailabilityInternal.h \
/usr/include/sys/_types/_size_t.h /usr/include/sys/_types/_null.h \
/usr/include/sys/_types/_rsize_t.h /usr/include/sys/_types/_errno_t.h \
/usr/include/sys/_types/_ssize_t.h /usr/include/strings.h \
/usr/include/secure/_string.h /usr/include/secure/_common.h \
silk/typedef.h include/opus_types.h \
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.2/include/stdint.h \
/usr/include/stdint.h /usr/include/sys/_types/_int8_t.h \
/usr/include/sys/_types/_int16_t.h /usr/include/sys/_types/_int32_t.h \
/usr/include/sys/_types/_int64_t.h /usr/include/_types/_uint8_t.h \
/usr/include/_types/_uint16_t.h /usr/include/_types/_uint32_t.h \
/usr/include/_types/_uint64_t.h /usr/include/sys/_types/_intptr_t.h \
/usr/include/sys/_types/_uintptr_t.h /usr/include/_types/_intmax_t.h \
/usr/include/_types/_uintmax_t.h \
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.2/include/float.h \
silk/resampler_structs.h silk/macros.h silk/Inlines.h \
silk/MacroCount.h /usr/include/stdio.h \
/usr/include/sys/_types/_va_list.h /usr/include/sys/stdio.h \
/usr/include/sys/_types/_off_t.h /usr/include/secure/_stdio.h \
silk/MacroDebug.h celt/float_cast.h celt/arch.h /usr/include/math.h
config.h:
silk/float/SigProc_FLP.h:
silk/SigProc_FIX.h:
/usr/include/string.h:
/usr/include/_types.h:
/usr/include/sys/_types.h:
/usr/include/sys/cdefs.h:
/usr/include/sys/_symbol_aliasing.h:
/usr/include/sys/_posix_availability.h:
/usr/include/machine/_types.h:
/usr/include/i386/_types.h:
/usr/include/sys/_pthread/_pthread_types.h:
/usr/include/Availability.h:
/usr/include/AvailabilityInternal.h:
/usr/include/sys/_types/_size_t.h:
/usr/include/sys/_types/_null.h:
/usr/include/sys/_types/_rsize_t.h:
/usr/include/sys/_types/_errno_t.h:
/usr/include/sys/_types/_ssize_t.h:
/usr/include/strings.h:
/usr/include/secure/_string.h:
/usr/include/secure/_common.h:
silk/typedef.h:
include/opus_types.h:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.2/include/stdint.h:
/usr/include/stdint.h:
/usr/include/sys/_types/_int8_t.h:
/usr/include/sys/_types/_int16_t.h:
/usr/include/sys/_types/_int32_t.h:
/usr/include/sys/_types/_int64_t.h:
/usr/include/_types/_uint8_t.h:
/usr/include/_types/_uint16_t.h:
/usr/include/_types/_uint32_t.h:
/usr/include/_types/_uint64_t.h:
/usr/include/sys/_types/_intptr_t.h:
/usr/include/sys/_types/_uintptr_t.h:
/usr/include/_types/_intmax_t.h:
/usr/include/_types/_uintmax_t.h:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.2/include/float.h:
silk/resampler_structs.h:
silk/macros.h:
silk/Inlines.h:
silk/MacroCount.h:
/usr/include/stdio.h:
/usr/include/sys/_types/_va_list.h:
/usr/include/sys/stdio.h:
/usr/include/sys/_types/_off_t.h:
/usr/include/secure/_stdio.h:
silk/MacroDebug.h:
celt/float_cast.h:
celt/arch.h:
/usr/include/math.h:
| {
"pile_set_name": "Github"
} |
package dk.brics.soot.intermediate.translation;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import soot.ArrayType;
import soot.Hierarchy;
import soot.RefType;
import soot.Scene;
import soot.SootClass;
import soot.SootMethod;
import soot.Type;
import soot.Value;
import soot.jimple.InstanceInvokeExpr;
import soot.jimple.InvokeExpr;
import soot.jimple.Stmt;
import soot.toolkits.graph.CompleteUnitGraph;
import dk.brics.soot.intermediate.representation.Method;
import dk.brics.soot.intermediate.representation.Statement;
import dk.brics.soot.intermediate.representation.Variable;
@SuppressWarnings("unchecked")
public class JavaTranslator {
private Hierarchy h;
private List<Method> methods = new LinkedList<Method>();
StmtTranslator st;
Map<String,Method> methodsignaturToMethod = new HashMap<String, Method>();
public static final String FOOQUALIFIEDNAME = "dk.brics.soot.intermediate.foo.Foo";
public Method[] translateApplicationClasses() {
h = new Hierarchy();
makeMethods();
translate();
return methods.toArray(new Method[0]);
}
private void translate() {
st = new StmtTranslator(this);
Collection<SootClass> app = Scene.v().getApplicationClasses();
for (SootClass ac: app) {
st.setCurrentClass(ac);
List<SootMethod> sootMethods = ac.getMethods();
for (SootMethod sm: sootMethods) {
if (sm.isConcrete()) {
Method method = methodsignaturToMethod.get(sm.getSignature());
st.setCurrentMethod(sm);
CompleteUnitGraph cug = new CompleteUnitGraph(sm.retrieveActiveBody());
Iterator si = cug.iterator();
while (si.hasNext()) {
Stmt stmt = (Stmt)si.next();
st.translateStmt(stmt);
}
//System.err.println("Setting up link between entry and first stmt of the method...");
si = cug.getHeads().iterator();
while (si.hasNext()) {
Stmt stmt = (Stmt)si.next();
method.getEntry().addSucc(st.getFirst(stmt));
}
si = cug.iterator();
//System.err.println("Setting up link between the last statement and the first statement...");
while (si.hasNext()) {
Stmt stmt = (Stmt)si.next();
Iterator si2 = cug.getSuccsOf(stmt).iterator();
while (si2.hasNext()) {
Stmt stmt2 = (Stmt)si2.next();
st.getLast(stmt).addSucc(st.getFirst(stmt2));
}
}
// System.err.println("!!!!!!!!!!!!!!!!!!"+sm.getName()+"!!!!!!!!!!!!!!!!!!!!");
// si = cug.iterator();
// while (si.hasNext()) {
// Stmt stmt = (Stmt)si.next();
// System.err.println("The stmt: "+stmt+" translates to "+st.getFirst(stmt));
// //System.err.println(st.getFirst(stmt).getSuccs());
// }
// System.err.println("######################################");
}
}
}
}
void makeMethods() {
Collection<SootClass> app = Scene.v().getApplicationClasses();
for(SootClass ac: app) {
List<SootMethod> sootMethods = ac.getMethods();
for (SootMethod sm: sootMethods) {
List<Variable> vars = new LinkedList<Variable>();
List<Type> params = sm.getParameterTypes();
for (Type pt: params) {
Variable v = makeVariable(pt);
vars.add(v);
}
Variable[] var_array = (Variable[])vars.toArray(new Variable[0]);
Method m = new Method(sm.getName(), var_array);
methods.add(m);
methodsignaturToMethod.put(sm.getSignature(), m);
}
}
}
Variable makeVariable(Value v) {
return makeVariable(v.getType());
}
Variable makeVariable(Type t) {
Variable.Type type = getType(t);
return new Variable(type);
}
public boolean isFooType(Value v) {
return isFooType(v.getType());
}
public boolean isFooType(Type t) {
return getType(t) != Variable.Type.OTHER;
}
public List<SootMethod> getTargetsOf(InvokeExpr expr) {
if (expr instanceof InstanceInvokeExpr) {
return getTargetsOf(((InstanceInvokeExpr)expr).getBase(), expr.getMethod());
}
List<SootMethod> targets = new ArrayList(1);
targets.add(expr.getMethod());
return targets;
}
public List<SootMethod> getTargetsOf(Value v, SootMethod m) {
SootClass rc;
Type t = v.getType();
if (t instanceof ArrayType) {
rc = Scene.v().getSootClass("java.lang.Object");
} else {
rc = ((RefType)v.getType()).getSootClass();
}
List<SootMethod> targets = h.resolveAbstractDispatch(rc, m);
return targets;
}
private Variable.Type getType(Type t) {
if (t instanceof RefType) {
if (((RefType)t).getSootClass().getName().equals(FOOQUALIFIEDNAME)) {
return Variable.Type.FOO;
}
}
if (t instanceof ArrayType) {
return Variable.Type.OTHER;
}
return Variable.Type.OTHER;
}
boolean isApplicationClass(SootClass c) {
Iterator aci = Scene.v().getApplicationClasses().iterator();
while (aci.hasNext()) {
SootClass ac = (SootClass)aci.next();
if (c.getName().equals(ac.getName())) {
return true;
}
}
return false;
}
public void notSupported(String msg) {
System.err.println(msg);
System.exit(5);
}
}
| {
"pile_set_name": "Github"
} |
// Formatting library for C++ - time formatting
//
// Copyright (c) 2012 - present, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.
#ifndef FMT_TIME_H_
#define FMT_TIME_H_
#include "format.h"
#include <ctime>
#include <locale>
FMT_BEGIN_NAMESPACE
// Prevents expansion of a preceding token as a function-style macro.
// Usage: f FMT_NOMACRO()
#define FMT_NOMACRO
namespace internal{
inline null<> localtime_r FMT_NOMACRO(...) { return null<>(); }
inline null<> localtime_s(...) { return null<>(); }
inline null<> gmtime_r(...) { return null<>(); }
inline null<> gmtime_s(...) { return null<>(); }
} // namespace internal
// Thread-safe replacement for std::localtime
inline std::tm localtime(std::time_t time) {
struct dispatcher {
std::time_t time_;
std::tm tm_;
dispatcher(std::time_t t): time_(t) {}
bool run() {
using namespace fmt::internal;
return handle(localtime_r(&time_, &tm_));
}
bool handle(std::tm *tm) { return tm != FMT_NULL; }
bool handle(internal::null<>) {
using namespace fmt::internal;
return fallback(localtime_s(&tm_, &time_));
}
bool fallback(int res) { return res == 0; }
#if !FMT_MSC_VER
bool fallback(internal::null<>) {
using namespace fmt::internal;
std::tm *tm = std::localtime(&time_);
if (tm) tm_ = *tm;
return tm != FMT_NULL;
}
#endif
};
dispatcher lt(time);
// Too big time values may be unsupported.
if (!lt.run())
FMT_THROW(format_error("time_t value out of range"));
return lt.tm_;
}
// Thread-safe replacement for std::gmtime
inline std::tm gmtime(std::time_t time) {
struct dispatcher {
std::time_t time_;
std::tm tm_;
dispatcher(std::time_t t): time_(t) {}
bool run() {
using namespace fmt::internal;
return handle(gmtime_r(&time_, &tm_));
}
bool handle(std::tm *tm) { return tm != FMT_NULL; }
bool handle(internal::null<>) {
using namespace fmt::internal;
return fallback(gmtime_s(&tm_, &time_));
}
bool fallback(int res) { return res == 0; }
#if !FMT_MSC_VER
bool fallback(internal::null<>) {
std::tm *tm = std::gmtime(&time_);
if (tm) tm_ = *tm;
return tm != FMT_NULL;
}
#endif
};
dispatcher gt(time);
// Too big time values may be unsupported.
if (!gt.run())
FMT_THROW(format_error("time_t value out of range"));
return gt.tm_;
}
namespace internal {
inline std::size_t strftime(char *str, std::size_t count, const char *format,
const std::tm *time) {
return std::strftime(str, count, format, time);
}
inline std::size_t strftime(wchar_t *str, std::size_t count,
const wchar_t *format, const std::tm *time) {
return std::wcsftime(str, count, format, time);
}
}
template <typename Char>
struct formatter<std::tm, Char> {
template <typename ParseContext>
auto parse(ParseContext &ctx) -> decltype(ctx.begin()) {
auto it = ctx.begin();
if (it != ctx.end() && *it == ':')
++it;
auto end = it;
while (end != ctx.end() && *end != '}')
++end;
tm_format.reserve(internal::to_unsigned(end - it + 1));
tm_format.append(it, end);
tm_format.push_back('\0');
return end;
}
template <typename FormatContext>
auto format(const std::tm &tm, FormatContext &ctx) -> decltype(ctx.out()) {
basic_memory_buffer<Char> buf;
std::size_t start = buf.size();
for (;;) {
std::size_t size = buf.capacity() - start;
std::size_t count =
internal::strftime(&buf[start], size, &tm_format[0], &tm);
if (count != 0) {
buf.resize(start + count);
break;
}
if (size >= tm_format.size() * 256) {
// If the buffer is 256 times larger than the format string, assume
// that `strftime` gives an empty result. There doesn't seem to be a
// better way to distinguish the two cases:
// https://github.com/fmtlib/fmt/issues/367
break;
}
const std::size_t MIN_GROWTH = 10;
buf.reserve(buf.capacity() + (size > MIN_GROWTH ? size : MIN_GROWTH));
}
return std::copy(buf.begin(), buf.end(), ctx.out());
}
basic_memory_buffer<Char> tm_format;
};
FMT_END_NAMESPACE
#endif // FMT_TIME_H_
| {
"pile_set_name": "Github"
} |
package spdystream
import (
"errors"
"fmt"
"io"
"net"
"net/http"
"sync"
"time"
"github.com/docker/spdystream/spdy"
)
var (
ErrUnreadPartialData = errors.New("unread partial data")
)
type Stream struct {
streamId spdy.StreamId
parent *Stream
conn *Connection
startChan chan error
dataLock sync.RWMutex
dataChan chan []byte
unread []byte
priority uint8
headers http.Header
headerChan chan http.Header
finishLock sync.Mutex
finished bool
replyCond *sync.Cond
replied bool
closeLock sync.Mutex
closeChan chan bool
}
// WriteData writes data to stream, sending a dataframe per call
func (s *Stream) WriteData(data []byte, fin bool) error {
s.waitWriteReply()
var flags spdy.DataFlags
if fin {
flags = spdy.DataFlagFin
s.finishLock.Lock()
if s.finished {
s.finishLock.Unlock()
return ErrWriteClosedStream
}
s.finished = true
s.finishLock.Unlock()
}
dataFrame := &spdy.DataFrame{
StreamId: s.streamId,
Flags: flags,
Data: data,
}
debugMessage("(%p) (%d) Writing data frame", s, s.streamId)
return s.conn.framer.WriteFrame(dataFrame)
}
// Write writes bytes to a stream, calling write data for each call.
func (s *Stream) Write(data []byte) (n int, err error) {
err = s.WriteData(data, false)
if err == nil {
n = len(data)
}
return
}
// Read reads bytes from a stream, a single read will never get more
// than what is sent on a single data frame, but a multiple calls to
// read may get data from the same data frame.
func (s *Stream) Read(p []byte) (n int, err error) {
if s.unread == nil {
select {
case <-s.closeChan:
return 0, io.EOF
case read, ok := <-s.dataChan:
if !ok {
return 0, io.EOF
}
s.unread = read
}
}
n = copy(p, s.unread)
if n < len(s.unread) {
s.unread = s.unread[n:]
} else {
s.unread = nil
}
return
}
// ReadData reads an entire data frame and returns the byte array
// from the data frame. If there is unread data from the result
// of a Read call, this function will return an ErrUnreadPartialData.
func (s *Stream) ReadData() ([]byte, error) {
debugMessage("(%p) Reading data from %d", s, s.streamId)
if s.unread != nil {
return nil, ErrUnreadPartialData
}
select {
case <-s.closeChan:
return nil, io.EOF
case read, ok := <-s.dataChan:
if !ok {
return nil, io.EOF
}
return read, nil
}
}
func (s *Stream) waitWriteReply() {
if s.replyCond != nil {
s.replyCond.L.Lock()
for !s.replied {
s.replyCond.Wait()
}
s.replyCond.L.Unlock()
}
}
// Wait waits for the stream to receive a reply.
func (s *Stream) Wait() error {
return s.WaitTimeout(time.Duration(0))
}
// WaitTimeout waits for the stream to receive a reply or for timeout.
// When the timeout is reached, ErrTimeout will be returned.
func (s *Stream) WaitTimeout(timeout time.Duration) error {
var timeoutChan <-chan time.Time
if timeout > time.Duration(0) {
timeoutChan = time.After(timeout)
}
select {
case err := <-s.startChan:
if err != nil {
return err
}
break
case <-timeoutChan:
return ErrTimeout
}
return nil
}
// Close closes the stream by sending an empty data frame with the
// finish flag set, indicating this side is finished with the stream.
func (s *Stream) Close() error {
select {
case <-s.closeChan:
// Stream is now fully closed
s.conn.removeStream(s)
default:
break
}
return s.WriteData([]byte{}, true)
}
// Reset sends a reset frame, putting the stream into the fully closed state.
func (s *Stream) Reset() error {
s.conn.removeStream(s)
return s.resetStream()
}
func (s *Stream) resetStream() error {
// Always call closeRemoteChannels, even if s.finished is already true.
// This makes it so that stream.Close() followed by stream.Reset() allows
// stream.Read() to unblock.
s.closeRemoteChannels()
s.finishLock.Lock()
if s.finished {
s.finishLock.Unlock()
return nil
}
s.finished = true
s.finishLock.Unlock()
resetFrame := &spdy.RstStreamFrame{
StreamId: s.streamId,
Status: spdy.Cancel,
}
return s.conn.framer.WriteFrame(resetFrame)
}
// CreateSubStream creates a stream using the current as the parent
func (s *Stream) CreateSubStream(headers http.Header, fin bool) (*Stream, error) {
return s.conn.CreateStream(headers, s, fin)
}
// SetPriority sets the stream priority, does not affect the
// remote priority of this stream after Open has been called.
// Valid values are 0 through 7, 0 being the highest priority
// and 7 the lowest.
func (s *Stream) SetPriority(priority uint8) {
s.priority = priority
}
// SendHeader sends a header frame across the stream
func (s *Stream) SendHeader(headers http.Header, fin bool) error {
return s.conn.sendHeaders(headers, s, fin)
}
// SendReply sends a reply on a stream, only valid to be called once
// when handling a new stream
func (s *Stream) SendReply(headers http.Header, fin bool) error {
if s.replyCond == nil {
return errors.New("cannot reply on initiated stream")
}
s.replyCond.L.Lock()
defer s.replyCond.L.Unlock()
if s.replied {
return nil
}
err := s.conn.sendReply(headers, s, fin)
if err != nil {
return err
}
s.replied = true
s.replyCond.Broadcast()
return nil
}
// Refuse sends a reset frame with the status refuse, only
// valid to be called once when handling a new stream. This
// may be used to indicate that a stream is not allowed
// when http status codes are not being used.
func (s *Stream) Refuse() error {
if s.replied {
return nil
}
s.replied = true
return s.conn.sendReset(spdy.RefusedStream, s)
}
// Cancel sends a reset frame with the status canceled. This
// can be used at any time by the creator of the Stream to
// indicate the stream is no longer needed.
func (s *Stream) Cancel() error {
return s.conn.sendReset(spdy.Cancel, s)
}
// ReceiveHeader receives a header sent on the other side
// of the stream. This function will block until a header
// is received or stream is closed.
func (s *Stream) ReceiveHeader() (http.Header, error) {
select {
case <-s.closeChan:
break
case header, ok := <-s.headerChan:
if !ok {
return nil, fmt.Errorf("header chan closed")
}
return header, nil
}
return nil, fmt.Errorf("stream closed")
}
// Parent returns the parent stream
func (s *Stream) Parent() *Stream {
return s.parent
}
// Headers returns the headers used to create the stream
func (s *Stream) Headers() http.Header {
return s.headers
}
// String returns the string version of stream using the
// streamId to uniquely identify the stream
func (s *Stream) String() string {
return fmt.Sprintf("stream:%d", s.streamId)
}
// Identifier returns a 32 bit identifier for the stream
func (s *Stream) Identifier() uint32 {
return uint32(s.streamId)
}
// IsFinished returns whether the stream has finished
// sending data
func (s *Stream) IsFinished() bool {
return s.finished
}
// Implement net.Conn interface
func (s *Stream) LocalAddr() net.Addr {
return s.conn.conn.LocalAddr()
}
func (s *Stream) RemoteAddr() net.Addr {
return s.conn.conn.RemoteAddr()
}
// TODO set per stream values instead of connection-wide
func (s *Stream) SetDeadline(t time.Time) error {
return s.conn.conn.SetDeadline(t)
}
func (s *Stream) SetReadDeadline(t time.Time) error {
return s.conn.conn.SetReadDeadline(t)
}
func (s *Stream) SetWriteDeadline(t time.Time) error {
return s.conn.conn.SetWriteDeadline(t)
}
func (s *Stream) closeRemoteChannels() {
s.closeLock.Lock()
defer s.closeLock.Unlock()
select {
case <-s.closeChan:
default:
close(s.closeChan)
}
}
| {
"pile_set_name": "Github"
} |
<div id="sidebar-container">
<nav>
<a [routerLink]="['/designer']" routerLinkActive="active"><i class="fa fa-eye fa-lg"></i></a>
<a [routerLink]="['/editor']" routerLinkActive="active"><i class="fa fa-code fa-lg"></i></a>
</nav>
</div>
| {
"pile_set_name": "Github"
} |
package server
import (
"github.com/micro/go-micro/server/debug"
)
// We use this to wrap any debug handlers so we preserve the signature Debug.{Method}
type Debug struct {
debug.DebugHandler
}
func registerDebugHandler(s Server) {
s.Handle(s.NewHandler(&Debug{s.Options().DebugHandler}, InternalHandler(true)))
}
| {
"pile_set_name": "Github"
} |
#!/bin/bash
##
# @file build/create_tarball.sh
# @brief Generates MEGAsync and extensions tarballs
#
# (c) 2013-2014 by Mega Limited, Auckland, New Zealand
#
# This file is part of the MEGA SDK - Client Access Engine.
#
# Applications using the MEGA API must present a valid application key
# and comply with the the rules set forth in the Terms of Service.
#
# The MEGA SDK is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# @copyright Simplified (2-clause) BSD License.
#
# You should have received a copy of the license along with this
# program.
##
set -euo pipefail
IFS=$'\n\t'
# make sure the source tree is in "clean" state
cwd=$(pwd)
cd ../src
make distclean 2> /dev/null || true
cd MEGASync
make distclean 2> /dev/null || true
cd mega
make distclean 2> /dev/null || true
rm -fr bindings/qt/3rdparty || true
mv include/mega/config.h $cwd/config.h_bktarball || true
./clean.sh || true
cd $cwd
# download software archives
archives=$cwd/archives
rm -fr $archives
mkdir $archives
../src/MEGASync/mega/contrib/build_sdk.sh -q -n -e -f -g -w -s -v -u -W -o $archives
# get current version
MEGASYNC_VERSION=`grep -Po 'const QString Preferences::VERSION_STRING = QString::fromAscii\("\K[^"]*' ../src/MEGASync/control/Preferences.cpp`
export MEGASYNC_NAME=megasync-$MEGASYNC_VERSION
rm -rf $MEGASYNC_NAME.tar.gz
rm -rf $MEGASYNC_NAME
echo "MEGAsync version: $MEGASYNC_VERSION"
# delete previously generated files
rm -fr MEGAsync/MEGAsync/megasync*.dsc
# fix version number in template files and copy to appropriate directories
sed -e "s/MEGASYNC_VERSION/$MEGASYNC_VERSION/g" templates/MEGAsync/megasync.spec | sed "s#^ *##g" > MEGAsync/MEGAsync/megasync.spec
for dist in xUbuntu_{1,2}{0,1,2,3,4,5,6,7,8,9}.{04,10} Debian_{7,8,9,10}.0; do
if [ -f templates/MEGAsync/megasync-$dist.dsc ]; then
sed -e "s/MEGASYNC_VERSION/$MEGASYNC_VERSION/g" templates/MEGAsync/megasync-$dist.dsc > MEGAsync/MEGAsync/megasync-$dist.dsc
else
sed -e "s/MEGASYNC_VERSION/$MEGASYNC_VERSION/g" templates/MEGAsync/megasync.dsc > MEGAsync/MEGAsync/megasync-$dist.dsc
fi
done
sed -e "s/MEGASYNC_VERSION/$MEGASYNC_VERSION/g" templates/MEGAsync/PKGBUILD > MEGAsync/MEGAsync/PKGBUILD
#include license as copyright file
echo "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/" > MEGAsync/MEGAsync/debian.copyright
echo "Upstream-Name: megasync" >> MEGAsync/MEGAsync/debian.copyright
echo "Upstream-Contact: <[email protected]>" >> MEGAsync/MEGAsync/debian.copyright
echo "Source: https://github.com/meganz/MEGAsync" >> MEGAsync/MEGAsync/debian.copyright
echo "Files: *" >> MEGAsync/MEGAsync/debian.copyright
echo "Copyright: 2013, Mega Limited" >> MEGAsync/MEGAsync/debian.copyright
echo -n "License:" >> MEGAsync/MEGAsync/debian.copyright # Some software (e.g: gnome-software) would only recognized these licenses: http://spdx.org/licenses/
cat ../LICENCE.md | sed 's#^\s*$#\.#g' | sed 's#^# #' >> MEGAsync/MEGAsync/debian.copyright
cat ../LICENCE.md | sed 's#^\s*$#\.#g' | sed 's#^# #' >> MEGAsync/MEGAShellExtDolphin/debian.copyright
cat ../LICENCE.md | sed 's#^\s*$#\.#g' | sed 's#^# #' >> MEGAsync/MEGAShellExtNautilus/debian.copyright
cat ../LICENCE.md | sed 's#^\s*$#\.#g' | sed 's#^# #' >> MEGAsync/MEGAShellExtNemo/debian.copyright
cat ../LICENCE.md | sed 's#^\s*$#\.#g' | sed 's#^# #' >> MEGAsync/MEGAShellExtThunar/debian.copyright
# read the last generated ChangeLog version
version_file="version"
if [ -s "$version_file" ]; then
last_version=$(cat "$version_file")
else
last_version="none"
fi
if [ "$last_version" != "$MEGASYNC_VERSION" ]; then
# add RPM ChangeLog entry
changelog="MEGAsync/MEGAsync/megasync.changes"
changelogold="MEGAsync/MEGAsync/megasync.changes.old"
if [ -f $changelog ]; then
mv $changelog $changelogold
fi
./generate_rpm_changelog_entry.sh ../src/MEGASync/control/Preferences.cpp > $changelog
if [ -f $changelogold ]; then
cat $changelogold >> $changelog
rm $changelogold
fi
# add DEB ChangeLog entry
changelog="MEGAsync/MEGAsync/debian.changelog"
changelogold="MEGAsync/MEGAsync/debian.changelog.old"
if [ -f $changelog ]; then
mv $changelog $changelogold
fi
./generate_deb_changelog_entry.sh $MEGASYNC_VERSION ../src/MEGASync/control/Preferences.cpp > $changelog
if [ -f $changelogold ]; then
cat $changelogold >> $changelog
rm $changelogold
fi
# update version file
echo $MEGASYNC_VERSION > $version_file
fi
# create archive
mkdir $MEGASYNC_NAME
ln -s ../MEGAsync/MEGAsync/megasync.spec $MEGASYNC_NAME/megasync.spec
ln -s ../MEGAsync/MEGAsync/debian.postinst $MEGASYNC_NAME/debian.postinst
ln -s ../MEGAsync/MEGAsync/debian.prerm $MEGASYNC_NAME/debian.prerm
ln -s ../MEGAsync/MEGAsync/debian.postrm $MEGASYNC_NAME/debian.postrm
ln -s ../MEGAsync/MEGAsync/debian.copyright $MEGASYNC_NAME/debian.copyright
ln -s ../../src/configure $MEGASYNC_NAME/configure
ln -s ../../src/MEGA.pro $MEGASYNC_NAME/MEGA.pro
ln -s ../../src/MEGASync $MEGASYNC_NAME/MEGASync
ln -s $archives $MEGASYNC_NAME/archives
tar czfh $MEGASYNC_NAME.tar.gz $MEGASYNC_NAME
rm -rf $MEGASYNC_NAME
mv $cwd/config.h_bktarball $cwd/../src/MEGASync/mega/include/mega/config.h || true
# delete any previous archive
rm -fr MEGAsync/MEGAsync/megasync_*.tar.gz
# transform arch name, to satisfy Debian requirements
mv $MEGASYNC_NAME.tar.gz MEGAsync/MEGAsync/megasync_$MEGASYNC_VERSION.tar.gz
#get md5sum and replace in PKGBUILD
MD5SUM=`md5sum MEGAsync/MEGAsync/megasync_$MEGASYNC_VERSION.tar.gz | awk '{print $1}'`
sed "s/MD5SUM/$MD5SUM/g" -i MEGAsync/MEGAsync/PKGBUILD
#
# Nautilus
#
# make sure the source tree is in "clean" state
cd ../src/MEGAShellExtNautilus/
make distclean 2> /dev/null || true
cd ../../build
#Get current version
export EXT_VERSION=`cat MEGAsync/MEGAShellExtNautilus/debian.changelog | head -1 | sed -e 's#[^(]*(\([^)]*\))[^)]*#\1#g'`
export EXT_NAME=nautilus-megasync-$EXT_VERSION
rm -rf $EXT_NAME.tar.gz
rm -rf $EXT_NAME
# delete previously generated files
rm -fr MEGAsync/MEGAShellExtNautilus/nautilus-megasync_*.dsc
# fix version number in template files and copy to appropriate directories
sed -e "s/EXT_VERSION/$EXT_VERSION/g" templates/MEGAShellExtNautilus/nautilus-megasync.spec > MEGAsync/MEGAShellExtNautilus/nautilus-megasync.spec
sed -e "s/EXT_VERSION/$EXT_VERSION/g" templates/MEGAShellExtNautilus/nautilus-megasync.dsc > MEGAsync/MEGAShellExtNautilus/nautilus-megasync_$EXT_VERSION.dsc
sed -e "s/EXT_VERSION/$EXT_VERSION/g" templates/MEGAShellExtNautilus/PKGBUILD > MEGAsync/MEGAShellExtNautilus/PKGBUILD
# create archive
mkdir $EXT_NAME
ln -s ../MEGAsync/MEGAShellExtNautilus/nautilus-megasync.spec $EXT_NAME/nautilus-megasync.spec
ln -s ../MEGAsync/MEGAShellExtNautilus/debian.postinst $EXT_NAME/debian.postinst
ln -s ../../src/MEGAShellExtNautilus/mega_ext_client.c $EXT_NAME/mega_ext_client.c
ln -s ../../src/MEGAShellExtNautilus/mega_ext_client.h $EXT_NAME/mega_ext_client.h
ln -s ../../src/MEGAShellExtNautilus/mega_ext_module.c $EXT_NAME/mega_ext_module.c
ln -s ../../src/MEGAShellExtNautilus/mega_notify_client.h $EXT_NAME/mega_notify_client.h
ln -s ../../src/MEGAShellExtNautilus/mega_notify_client.c $EXT_NAME/mega_notify_client.c
ln -s ../../src/MEGAShellExtNautilus/MEGAShellExt.c $EXT_NAME/MEGAShellExt.c
ln -s ../../src/MEGAShellExtNautilus/MEGAShellExt.h $EXT_NAME/MEGAShellExt.h
ln -s ../../src/MEGAShellExtNautilus/MEGAShellExtNautilus.pro $EXT_NAME/MEGAShellExtNautilus.pro
ln -s ../../src/MEGAShellExtNautilus/data $EXT_NAME/data
ln -s ../MEGAsync/MEGAsync/debian.copyright $EXT_NAME/debian.copyright
export GZIP=-9
tar czfh $EXT_NAME.tar.gz --exclude Makefile --exclude '*.o' $EXT_NAME
rm -rf $EXT_NAME
# delete any previous archive
rm -fr MEGAsync/MEGAShellExtNautilus/nautilus-megasync_*.tar.gz
# transform arch name, to satisfy Debian requirements
mv $EXT_NAME.tar.gz MEGAsync/MEGAShellExtNautilus/nautilus-megasync_$EXT_VERSION.tar.gz
#get md5sum and replace in PKGBUILD
MD5SUM=`md5sum MEGAsync/MEGAShellExtNautilus/nautilus-megasync_$EXT_VERSION.tar.gz | awk '{print $1}'`
sed "s/MD5SUM/$MD5SUM/g" -i MEGAsync/MEGAShellExtNautilus/PKGBUILD
#
# Nemo
#
# make sure the source tree is in "clean" state
cd ../src/MEGAShellExtNemo/
make distclean 2> /dev/null || true
cd ../../build
#Get current version
export EXT_VERSION=`cat MEGAsync/MEGAShellExtNemo/debian.changelog | head -1 | sed -e 's#[^(]*(\([^)]*\))[^)]*#\1#g'`
export EXT_NAME=nemo-megasync-$EXT_VERSION
rm -rf $EXT_NAME.tar.gz
rm -rf $EXT_NAME
# delete previously generated files
rm -fr MEGAsync/MEGAShellExtNemo/nemo-megasync_*.dsc
# fix version number in template files and copy to appropriate directories
sed -e "s/EXT_VERSION/$EXT_VERSION/g" templates/MEGAShellExtNemo/nemo-megasync.spec > MEGAsync/MEGAShellExtNemo/nemo-megasync.spec
sed -e "s/EXT_VERSION/$EXT_VERSION/g" templates/MEGAShellExtNemo/nemo-megasync.dsc > MEGAsync/MEGAShellExtNemo/nemo-megasync_$EXT_VERSION.dsc
sed -e "s/EXT_VERSION/$EXT_VERSION/g" templates/MEGAShellExtNemo/PKGBUILD > MEGAsync/MEGAShellExtNemo/PKGBUILD
# create archive
mkdir $EXT_NAME
ln -s ../MEGAsync/MEGAShellExtNemo/nemo-megasync.spec $EXT_NAME/nemo-megasync.spec
ln -s ../MEGAsync/MEGAShellExtNemo/debian.postinst $EXT_NAME/debian.postinst
ln -s ../../src/MEGAShellExtNemo/mega_ext_client.c $EXT_NAME/mega_ext_client.c
ln -s ../../src/MEGAShellExtNemo/mega_ext_client.h $EXT_NAME/mega_ext_client.h
ln -s ../../src/MEGAShellExtNemo/mega_ext_module.c $EXT_NAME/mega_ext_module.c
ln -s ../../src/MEGAShellExtNemo/mega_notify_client.h $EXT_NAME/mega_notify_client.h
ln -s ../../src/MEGAShellExtNemo/mega_notify_client.c $EXT_NAME/mega_notify_client.c
ln -s ../../src/MEGAShellExtNemo/MEGAShellExt.c $EXT_NAME/MEGAShellExt.c
ln -s ../../src/MEGAShellExtNemo/MEGAShellExt.h $EXT_NAME/MEGAShellExt.h
ln -s ../../src/MEGAShellExtNemo/MEGAShellExtNemo.pro $EXT_NAME/MEGAShellExtNemo.pro
ln -s ../../src/MEGAShellExtNemo/data $EXT_NAME/data
ln -s ../MEGAsync/MEGAsync/debian.copyright $EXT_NAME/debian.copyright
export GZIP=-9
tar czfh $EXT_NAME.tar.gz --exclude Makefile --exclude '*.o' $EXT_NAME
rm -rf $EXT_NAME
# delete any previous archive
rm -fr MEGAsync/MEGAShellExtNemo/nemo-megasync_*.tar.gz
# transform arch name, to satisfy Debian requirements
mv $EXT_NAME.tar.gz MEGAsync/MEGAShellExtNemo/nemo-megasync_$EXT_VERSION.tar.gz
#get md5sum and replace in PKGBUILD
MD5SUM=`md5sum MEGAsync/MEGAShellExtNemo/nemo-megasync_$EXT_VERSION.tar.gz | awk '{print $1}'`
sed "s/MD5SUM/$MD5SUM/g" -i MEGAsync/MEGAShellExtNemo/PKGBUILD
#
# Thunar
#
# make sure the source tree is in "clean" state
cd ../src/MEGAShellExtThunar/
make distclean 2> /dev/null || true
cd ../../build
#Get current version
export EXT_VERSION=`cat MEGAsync/MEGAShellExtThunar/debian.changelog | head -1 | sed -e 's#[^(]*(\([^)]*\))[^)]*#\1#g'`
export EXT_NAME=thunar-megasync-$EXT_VERSION
rm -rf $EXT_NAME.tar.gz
rm -rf $EXT_NAME
# delete previously generated files
rm -fr MEGAsync/MEGAShellExtThunar/thunar-megasync_*.dsc
# fix version number in template files and copy to appropriate directories
sed -e "s/EXT_VERSION/$EXT_VERSION/g" templates/MEGAShellExtThunar/thunar-megasync.spec > MEGAsync/MEGAShellExtThunar/thunar-megasync.spec
sed -e "s/EXT_VERSION/$EXT_VERSION/g" templates/MEGAShellExtThunar/thunar-megasync.dsc > MEGAsync/MEGAShellExtThunar/thunar-megasync_$EXT_VERSION.dsc
sed -e "s/EXT_VERSION/$EXT_VERSION/g" templates/MEGAShellExtThunar/PKGBUILD > MEGAsync/MEGAShellExtThunar/PKGBUILD
# create archive
mkdir $EXT_NAME
ln -s ../MEGAsync/MEGAShellExtThunar/thunar-megasync.spec $EXT_NAME/thunar-megasync.spec
ln -s ../../src/MEGAShellExtThunar/mega_ext_client.c $EXT_NAME/mega_ext_client.c
ln -s ../../src/MEGAShellExtThunar/mega_ext_client.h $EXT_NAME/mega_ext_client.h
ln -s ../../src/MEGAShellExtThunar/MEGAShellExt.c $EXT_NAME/MEGAShellExt.c
ln -s ../../src/MEGAShellExtThunar/MEGAShellExt.h $EXT_NAME/MEGAShellExt.h
ln -s ../../src/MEGAShellExtThunar/MEGAShellExtThunar.pro $EXT_NAME/MEGAShellExtThunar.pro
ln -s ../MEGAsync/MEGAsync/debian.copyright $EXT_NAME/debian.copyright
export GZIP=-9
tar czfh $EXT_NAME.tar.gz --exclude Makefile --exclude '*.o' $EXT_NAME
rm -rf $EXT_NAME
# delete any previous archive
rm -fr MEGAsync/MEGAShellExtThunar/thunar-megasync_*.tar.gz
# transform arch name, to satisfy Debian requirements
mv $EXT_NAME.tar.gz MEGAsync/MEGAShellExtThunar/thunar-megasync_$EXT_VERSION.tar.gz
#get md5sum and replace in PKGBUILD
MD5SUM=`md5sum MEGAsync/MEGAShellExtThunar/thunar-megasync_$EXT_VERSION.tar.gz | awk '{print $1}'`
sed "s/MD5SUM/$MD5SUM/g" -i MEGAsync/MEGAShellExtThunar/PKGBUILD
rm -fr $archives
#
# Dolphin
#
# make sure the source tree is in "clean" state
cd ../src/MEGAShellExtDolphin/
make distclean 2> /dev/null || true
cd ../../build
#Get current version
export EXT_VERSION=`cat MEGAsync/MEGAShellExtDolphin/debian.changelog | head -1 | sed -e 's#[^(]*(\([^)]*\))[^)]*#\1#g'`
export EXT_NAME=dolphin-megasync-$EXT_VERSION
rm -rf $EXT_NAME.tar.gz
rm -rf $EXT_NAME
# delete previously generated files
rm -fr MEGAsync/MEGAShellExtDolphin/dolphin-megasync_*.dsc
# fix version number in template files and copy to appropriate directories
sed -e "s/EXT_VERSION/$EXT_VERSION/g" templates/MEGAShellExtDolphin/dolphin-megasync.spec > MEGAsync/MEGAShellExtDolphin/dolphin-megasync.spec
#sed -e "s/EXT_VERSION/$EXT_VERSION/g" templates/MEGAShellExtDolphin/dolphin-megasync.dsc > MEGAsync/MEGAShellExtDolphin/dolphin-megasync_$EXT_VERSION.dsc
for dist in xUbuntu_{1,2}{0,1,2,3,4,5,6,7,8,9}.{04,10} Debian_{7,8,9,10}.0; do
if [ -f templates/MEGAShellExtDolphin/dolphin-megasync-$dist.dsc ]; then
sed -e "s/EXT_VERSION/$EXT_VERSION/g" templates/MEGAShellExtDolphin/dolphin-megasync-$dist.dsc > MEGAsync/MEGAShellExtDolphin/dolphin-megasync-$dist.dsc
else
sed -e "s/EXT_VERSION/$EXT_VERSION/g" templates/MEGAShellExtDolphin/dolphin-megasync.dsc > MEGAsync/MEGAShellExtDolphin/dolphin-megasync-$dist.dsc
fi
done
sed -e "s/EXT_VERSION/$EXT_VERSION/g" templates/MEGAShellExtDolphin/PKGBUILD > MEGAsync/MEGAShellExtDolphin/PKGBUILD
# create archive
mkdir $EXT_NAME
ln -s ../MEGAsync/MEGAShellExtDolphin/dolphin-megasync.spec $EXT_NAME/dolphin-megasync.spec
ln -s ../../src/MEGAShellExtDolphin/megasync-plugin.cpp $EXT_NAME/megasync-plugin.cpp
ln -s ../../src/MEGAShellExtDolphin/megasync-plugin-overlay.cpp $EXT_NAME/megasync-plugin-overlay.cpp
ln -s ../../src/MEGAShellExtDolphin/megasync-plugin-overlay.json $EXT_NAME/megasync-plugin-overlay.json
touch $EXT_NAME/megasync-plugin-overlay.moc
touch $EXT_NAME/megasync-plugin.moc
ln -s ../../src/MEGAShellExtDolphin/data $EXT_NAME/data
ln -s ../../src/MEGAShellExtDolphin/CMakeLists.txt $EXT_NAME/CMakeLists.txt
ln -s ../../src/MEGAShellExtDolphin/CMakeLists_kde5.txt $EXT_NAME/CMakeLists_kde5.txt
ln -s ../../src/MEGAShellExtDolphin/megasync-plugin.h $EXT_NAME/megasync-plugin.h
ln -s ../../src/MEGAShellExtDolphin/megasync-plugin.desktop $EXT_NAME/megasync-plugin.desktop
ln -s ../../src/MEGAShellExtDolphin/MEGAShellExtDolphin.pro $EXT_NAME/MEGAShellExtDolphin.pro
ln -s /assets/precompiled/dolphinext/megasyncdolphinoverlayplugin.so_* $EXT_NAME/
ln -s ../MEGAsync/MEGAsync/debian.copyright $EXT_NAME/debian.copyright
export GZIP=-9
tar czfh $EXT_NAME.tar.gz --exclude Makefile --exclude '*.o' $EXT_NAME
rm -rf $EXT_NAME
# delete any previous archive
rm -fr MEGAsync/MEGAShellExtDolphin/dolphin-megasync_*.tar.gz
# transform arch name, to satisfy Debian requirements
mv $EXT_NAME.tar.gz MEGAsync/MEGAShellExtDolphin/dolphin-megasync_$EXT_VERSION.tar.gz
#get md5sum and replace in PKGBUILD
MD5SUM=`md5sum MEGAsync/MEGAShellExtDolphin/dolphin-megasync_$EXT_VERSION.tar.gz | awk '{print $1}'`
sed "s/MD5SUM/$MD5SUM/g" -i MEGAsync/MEGAShellExtDolphin/PKGBUILD
rm -fr $archives
| {
"pile_set_name": "Github"
} |
vec3 v_world : TEXCOORD0 = vec3(0.0, 0.0, 0.0);
vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0);
vec3 a_position : POSITION;
vec4 a_color0 : COLOR0;
| {
"pile_set_name": "Github"
} |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.io.erasurecode.rawcoder;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.io.erasurecode.ErasureCodeConstants;
import org.apache.hadoop.io.erasurecode.ErasureCoderOptions;
/**
* A raw erasure coder factory for dummy raw coders.
*/
@InterfaceAudience.Private
public class DummyRawErasureCoderFactory implements RawErasureCoderFactory {
public static final String CODER_NAME = "dummy_dummy";
@Override
public RawErasureEncoder createEncoder(ErasureCoderOptions coderOptions) {
return new DummyRawEncoder(coderOptions);
}
@Override
public RawErasureDecoder createDecoder(ErasureCoderOptions coderOptions) {
return new DummyRawDecoder(coderOptions);
}
@Override
public String getCoderName() {
return CODER_NAME;
}
@Override
public String getCodecName() {
return ErasureCodeConstants.DUMMY_CODEC_NAME;
}
}
| {
"pile_set_name": "Github"
} |
# Cryptograghy
## OpenPGP
To get Open PGP support we use GpgME >= 1.8.0. GpgME has now include Gpgme++ and QGpgME, that were living before in kdepim repositories.
GpgME gives us directly PGP and SMime support and needs gpg-agent, gpg2, gpgsm and a pinentry to be installed to work correctly. The package names differ between the distributions on Fedora the are named gnupg2, gnupg2-smime and pinentry-qt (there are several different flavours for diffrent environments. I think the Qt flavour matches best).
gnupg using ~/.gnupg as default homedir to store every file it uses. In our test docker environment, we setup all relevat files and added keys without passphrase to test PGP/SMime support. We also incuded one key `With Passphrase "test" <[email protected]>`, that has a phassphrase named `test`.
You can get all keys with secret key available via `gpg2 --list-secret-keys` all known keys with `gpg2 --list-keys`.
```
$ gpg2 --list-secret-keys
gpg: WARNING: unsafe permissions on homedir '/home/developer/.gnupg'
gpg: enabled debug flags: memstat
/home/developer/.gnupg/pubring.gpg
----------------------------------
sec rsa2048 2009-11-13 [SC]
1BA323932B3FAA826132C79E8D9860C58F246DE6
uid [ultimate] unittest key (no password) <[email protected]>
ssb rsa2048 2009-11-13 [E]
sec rsa1024 2009-11-25 [SC]
00949E2AF4A985AFB572FDD214B79E26050467AA
uid [ultimate] kdetest <[email protected]>
ssb rsa1024 2009-11-25 [E]
sec rsa1024 2009-11-25 [SC]
CA739AC832766152139B5C49FC4FAB94C727D4BB
uid [ultimate] kde testing <[email protected]>
ssb rsa1024 2009-11-25 [E]
sec rsa2048 2016-11-22 [SC]
4F7EE48F586A13D1397E91D270057E539B9DE64B
uid [ultimate] With Passphrase "test" <[email protected]>
ssb rsa2048 2016-11-22 [E]
```
### Testing OpenPGP support
We have many testmails, that are signed and encrypted with keys without a passphrase.
All testmails can be found in the folder [github:cmollekopf/docker](https://github.com/cmollekopf/docker/tree/master/kube/testmails/cur).
* With `openpgp-` prefix are PGP/Mime messages [RFC 3156](https://tools.ietf.org/html/rfc3156).
* With `openpgp-inline-` prefix are PGP inline messages [RFC 4880](https://tools.ietf.org/html/rfc4880).
* With `smime-` prefix are SMIME messages [RFC 2633](https://tools.ietf.org/html/rfc2633).
To be able to also test gpg errors, we created some test mails, that triggers known issues:
* `openpgp-keymissing.mbox` this key is missing in the test environment, so gpg returns a KeyMissing error.
* `openpgp-wrong_passphrase.mbox`, here a pinentry popups and if you press three time `Cancel` in a row, a Passphrase error is returned. If you enter the correct passphrase `test` you the content of the mail. But than you need wither restart the testenvironment, kill `gpg-agent` or simply wait 1h before you see the passphrase error again.
* you can unistall the `gnupg-smime` package, or delete `/usr/bin/gpgsm` by hand to trigger a UnknownError for smime encrypted messages. If delete all `gnupgp2` related pacakges the application may react with segfaults.
We also have a unittest for gnupg errors in a lower level [kde:kube/framework/domain/mimetreeparser/tests/gpgerrortest.cpp](https://cgit.kde.org/kube.git/tree/framework/domain/mimetreeparser/tests/gpgerrortest.cpp?h=develop).
| {
"pile_set_name": "Github"
} |
# Copyright 2017 The Sonnet Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""Stop gradient custom getter."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
def stop_gradient(getter, *args, **kwargs):
"""Custom getter which prevents variables being optimized.
Usage like:
with tf.variable_scope("", custom_getter=snt.custom_getters.stop_gradient):
net = snt.Linear(num_hidden)(net)
will result in the gradient with respect to the variables in the linear
module being `None`. By default, the variables will still be in the trainable
variables collection.
When used with a Sonnet module, the module must be constructed inside the
variable scope with the custom getter. Just building the module inside said
variable scope will not use the custom getter.
Args:
getter: The true getter to call.
*args: Arguments, in the same format as tf.get_variable.
**kwargs: Keyword arguments, in the same format as tf.get_variable.
Returns:
The return value of `getter(*args, **kwargs)` with a tf.stop_gradient.
"""
return tf.stop_gradient(getter(*args, **kwargs))
| {
"pile_set_name": "Github"
} |
# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
# This file is built by mktables from e.g. UnicodeData.txt.
# Any changes made here will be lost!
#
# This file supports:
# \p{InEthiopic} (and fuzzy permutations)
#
# Meaning: Block 'Ethiopic'
#
return <<'END';
1200 137F Ethiopic
END
| {
"pile_set_name": "Github"
} |
package org.cqframework.cql.cql2elm;
import org.hl7.elm_modelinfo.r1.ModelInfo;
import javax.xml.bind.JAXB;
public class QICoreModelInfoProvider implements ModelInfoProvider {
private String version;
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public QICoreModelInfoProvider withVersion(String version) {
setVersion(version);
return this;
}
public ModelInfo load() {
String localVersion = version == null ? "" : version;
switch (localVersion) {
case "4.0.0":
default:
return JAXB.unmarshal(QICoreModelInfoProvider.class.getResourceAsStream("/org/hl7/fhir/qicore-modelinfo-4.0.0.xml"),
ModelInfo.class);
}
}
}
| {
"pile_set_name": "Github"
} |
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 25 2017 03:49:04).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import "MacBuddyViewController.h"
#import "NSTableViewDelegate-Protocol.h"
@class NSArrayController, NSLayoutConstraint, NSObject, NSSecureTextField, NSString, NSTableColumn, NSTableView, NSTextField, NSView, NSWindow, WiFiManager;
@protocol OS_dispatch_queue;
@interface SelectWiFiController : MacBuddyViewController <NSTableViewDelegate>
{
float scrollViewInitialHeight;
float pwdContainerInitialHeight;
NSLayoutConstraint *networkListHeightConstraint;
NSLayoutConstraint *layoutControllerLeftConstraint;
NSLayoutConstraint *layoutControllerCenterConstraint;
NSTableColumn *networkNameColumn;
NSTableView *networkListTableView;
NSArrayController *networkListController;
NSObject<OS_dispatch_queue> *_animationQueue;
int _nextAnimation;
NSSecureTextField *passwordTextField;
NSTextField *enterpriseUsernameTextField;
id passwordWrongRedArrow;
NSWindow *joinSheet;
BOOL otherNetworkNameEmptyWarningImageVisible;
BOOL otherNetworkConnectingSpinnerVisible;
NSString *otherNetworkName;
NSString *otherNetworkPassword;
NSString *otherNetworkJoinErrorMessage;
BOOL didEmptySelectionNag;
BOOL _shouldShowScanningView;
BOOL _showingJoinSheet;
BOOL _showEnterpriseUsernameField;
BOOL _completedMandatoryUpdateCheck;
BOOL _shouldGoToNextPaneAfterMandatoryUpdateCheck;
BOOL _isAnimating;
NSView *_passwordEntryView;
NSLayoutConstraint *_showEnterpriseUsernameConstraint;
NSLayoutConstraint *_hideEnterpriseUsernameConstraint;
NSString *_enterpiseUsername;
double _originalLeftSpace;
double _leftSpaceForCenteredView;
}
+ (void)initialize;
@property BOOL isAnimating; // @synthesize isAnimating=_isAnimating;
@property double leftSpaceForCenteredView; // @synthesize leftSpaceForCenteredView=_leftSpaceForCenteredView;
@property double originalLeftSpace; // @synthesize originalLeftSpace=_originalLeftSpace;
@property BOOL shouldGoToNextPaneAfterMandatoryUpdateCheck; // @synthesize shouldGoToNextPaneAfterMandatoryUpdateCheck=_shouldGoToNextPaneAfterMandatoryUpdateCheck;
@property BOOL completedMandatoryUpdateCheck; // @synthesize completedMandatoryUpdateCheck=_completedMandatoryUpdateCheck;
@property(copy) NSString *enterpiseUsername; // @synthesize enterpiseUsername=_enterpiseUsername;
@property BOOL showEnterpriseUsernameField; // @synthesize showEnterpriseUsernameField=_showEnterpriseUsernameField;
@property(retain) NSLayoutConstraint *hideEnterpriseUsernameConstraint; // @synthesize hideEnterpriseUsernameConstraint=_hideEnterpriseUsernameConstraint;
@property(retain) NSLayoutConstraint *showEnterpriseUsernameConstraint; // @synthesize showEnterpriseUsernameConstraint=_showEnterpriseUsernameConstraint;
@property(retain) NSView *passwordEntryView; // @synthesize passwordEntryView=_passwordEntryView;
@property(readonly) BOOL showingJoinSheet; // @synthesize showingJoinSheet=_showingJoinSheet;
@property(readonly) BOOL shouldShowScanningView; // @synthesize shouldShowScanningView=_shouldShowScanningView;
@property BOOL otherNetworkConnectingSpinnerVisible; // @synthesize otherNetworkConnectingSpinnerVisible;
@property(copy) NSString *otherNetworkJoinErrorMessage; // @synthesize otherNetworkJoinErrorMessage;
@property BOOL otherNetworkNameEmptyWarningImageVisible; // @synthesize otherNetworkNameEmptyWarningImageVisible;
@property(copy) NSString *otherNetworkPassword; // @synthesize otherNetworkPassword;
@property(copy) NSString *otherNetworkName; // @synthesize otherNetworkName;
- (void).cxx_destruct;
- (void)_showEmptySelectionNag;
- (void)joinSheetDidEnd:(id)arg1 returnCode:(long long)arg2;
- (void)cancelOtherNetworkClicked:(id)arg1;
- (void)joinOtherNetworkClicked:(id)arg1;
- (void)_updateJoinSheetWithError:(long long)arg1;
- (void)_showJoinSheet;
- (void)didBecomeInvisible;
- (void)willBecomeInvisible;
- (void)didBecomeVisible;
- (void)willBecomeVisible;
- (void)returnPressedOnPasswordField:(id)arg1;
- (void)forwardPaneWithHandler:(CDUnknownBlockType)arg1;
- (void)startMandatoryUpdateCheck;
- (BOOL)validateInput;
- (void)tableViewSelectionDidChange:(id)arg1;
- (void)showHidePasswordView:(BOOL)arg1 animated:(BOOL)arg2;
- (void)showEnterpriseUsername:(BOOL)arg1;
- (BOOL)tableView:(id)arg1 shouldSelectRow:(long long)arg2;
- (BOOL)tableView:(id)arg1 shouldEditTableColumn:(id)arg2 row:(long long)arg3;
- (BOOL)isScanningRowAtIndex:(long long)arg1;
- (BOOL)isSeparatorRowAtIndex:(long long)arg1;
- (long long)numberOfNetworksShown;
- (BOOL)selectedNetworkIsOtherNetworkPlaceholder;
- (BOOL)selectedNetworkIsEnterprise;
- (BOOL)selectedNetworkRequiresPassword;
- (id)selectedNetwork;
- (void)awakeFromNib;
@property(readonly) WiFiManager *manager;
- (id)init;
- (BOOL)shouldReturnFromSidetrip;
- (id)alternateViewIdentifier;
- (id)nextViewIdentifier;
// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;
@end
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.GETFIELD;
import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType;
import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
/**
* @author Jacek Ambroziak
* @author Santiago Pericas-Geertsen
* @author Morten Jorgensen
* @author Erwin Bolwidt <[email protected]>
*/
final class ParameterRef extends VariableRefBase {
/**
* Name of param being referenced.
*/
QName _name = null;
public ParameterRef(Param param) {
super(param);
_name = param._name;
}
public String toString() {
return "parameter-ref("+_variable.getName()+'/'+_variable.getType()+')';
}
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
final ConstantPoolGen cpg = classGen.getConstantPool();
final InstructionList il = methodGen.getInstructionList();
/*
* To fix bug 24518 related to setting parameters of the form
* {namespaceuri}localName, which will get mapped to an instance
* variable in the class.
*/
final String name = BasisLibrary.mapQNameToJavaName (_name.toString());
final String signature = _type.toSignature();
if (_variable.isLocal()) {
if (classGen.isExternal()) {
Closure variableClosure = _closure;
while (variableClosure != null) {
if (variableClosure.inInnerClass()) break;
variableClosure = variableClosure.getParentClosure();
}
if (variableClosure != null) {
il.append(ALOAD_0);
il.append(new GETFIELD(
cpg.addFieldref(variableClosure.getInnerClassName(),
name, signature)));
}
else {
il.append(_variable.loadInstruction());
}
}
else {
il.append(_variable.loadInstruction());
}
}
else {
final String className = classGen.getClassName();
il.append(classGen.loadTranslet());
if (classGen.isExternal()) {
il.append(new CHECKCAST(cpg.addClass(className)));
}
il.append(new GETFIELD(cpg.addFieldref(className,name,signature)));
}
if (_variable.getType() instanceof NodeSetType) {
// The method cloneIterator() also does resetting
final int clone = cpg.addInterfaceMethodref(NODE_ITERATOR,
"cloneIterator",
"()" +
NODE_ITERATOR_SIG);
il.append(new INVOKEINTERFACE(clone, 1));
}
}
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title translate="yes">Feeler ${code}</title>
<link rel="stylesheet" href="/public/pure-min.css">
<link rel="stylesheet" href="/public/content.css">
<base target="_top" href="/">
</head>
<body>
<template id="navbar">
<a href="/home"><img src="/public/home.svg" alt="Application home"><span translate="yes">Doheem</span></a>
</template>
<h1 id="error-title">{code}</h1>
<p><span translate="yes">E Feeler ass geschitt. Dir kéint wëllt</span> <a href="/home" translate="yes">gitt op d'Homepage</a> <span translate="yes">oder</span> <a href="/account/signin">sign in again</a>.</p>
</body>
</html>
| {
"pile_set_name": "Github"
} |
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of the License "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// e32test/debug/d_context.h
//
//
#ifndef __D_CONTEXT_H__
#define __D_CONTEXT_H__
#include <e32cmn.h>
#ifndef __KLIB_H__
#include <e32std.h>
#endif
#include <kernel/arm/arm_types.h>
_LIT(KTestLddName, "TestContext");
enum TUserCallbackState
{
ENoCallback, // thread does nothing special
ESpinningCallback, // thread will be given a callback that spins forever
ESleepingCallback, // thread will be given a callback that sleeps for a long time
};
struct TArmFullContext
{
TArmRegSet iUserContext;
TUint32 iUserAvail;
TArmRegSet iSystemContext;
TUint32 iSystemAvail;
};
class RContextLdd : public RBusLogicalChannel
{
public:
enum
{
EHook,
EGetLastExc,
ETrapNextHwExc,
ETrapNextSwExc,
ETrapNextDeath,
ESetGetContext,
EGetContext,
EGetKernelContext,
ESpinInKernel,
ESetGetFullContext,
EAddUserCallback,
EResumeTrappedThread,
};
struct TTrapInfo
{
TUint iThreadId;
TAny* iContextPtr;
TRequestStatus* iStatusPtr;
TBool iKillThread;
};
public:
static inline TVersion Version() { return TVersion(1, 0, 1); }
#ifndef __KERNEL_MODE__
public:
inline RContextLdd();
inline TInt Open();
inline TInt Hook(TInt* aCounterPtr);
inline TExcType LastException();
inline TBool IsHooked() const;
inline void TrapNextHwExc(TThreadId aId, TAny* aContext, TRequestStatus& aStatus, TBool aKillThread);
inline void TrapNextSwExc(TThreadId aId, TAny* aContext, TRequestStatus& aStatus, TBool aKillThread);
inline void TrapNextDeath(TThreadId aId, TAny* aContext, TRequestStatus& aStatus);
inline TInt SetAndGetBackContext(TThreadId aId, TAny* aContext);
inline TInt SetAndGetFullContext(TThreadId aId, TArmFullContext* aContextData);
inline void GetContext(TThreadId aId, TAny* aContext);
inline void GetKernelContext(TThreadId aId, TAny* aContext);
inline TUint32 SpinInKernel(TBool aReallySpin);
inline void AddUserCallback(TThreadId aId, TUserCallbackState aCallback);
inline void ResumeTrappedThread(TThreadId aId);
private:
TBool iHooked;
#endif
};
#ifndef __KERNEL_MODE__
inline RContextLdd::RContextLdd()
: iHooked(EFalse)
{
}
inline TBool RContextLdd::IsHooked() const
{
return iHooked;
}
inline TInt RContextLdd::Open()
{
return DoCreate(KTestLddName, Version(), KNullUnit, NULL, NULL, EOwnerProcess);
}
inline TInt RContextLdd::Hook(TInt* aCounterPtr)
{
TInt r = DoControl(EHook, aCounterPtr);
iHooked = (r == KErrNone);
return r;
}
inline TExcType RContextLdd::LastException()
{
return static_cast<TExcType>(DoControl(EGetLastExc));
}
inline void RContextLdd::TrapNextHwExc(TThreadId aId, TAny* aExcContext, TRequestStatus& aStatus, TBool aKillThread)
{
aStatus = KRequestPending;
TTrapInfo info;
info.iThreadId = aId;
info.iContextPtr = aExcContext;
info.iStatusPtr = &aStatus;
info.iKillThread = aKillThread;
DoControl(ETrapNextHwExc, &info);
}
inline void RContextLdd::TrapNextSwExc(TThreadId aId, TAny* aContext, TRequestStatus& aStatus, TBool aKillThread)
{
aStatus = KRequestPending;
TTrapInfo info;
info.iThreadId = aId;
info.iContextPtr = aContext;
info.iStatusPtr = &aStatus;
info.iKillThread = aKillThread;
DoControl(ETrapNextSwExc, &info);
}
inline void RContextLdd::TrapNextDeath(TThreadId aId, TAny* aContext, TRequestStatus& aStatus)
{
aStatus = KRequestPending;
TTrapInfo info;
info.iThreadId = aId;
info.iContextPtr = aContext;
info.iStatusPtr = &aStatus;
DoControl(ETrapNextDeath, &info);
}
inline TInt RContextLdd::SetAndGetBackContext(TThreadId aId, TAny* aContext)
{
return DoControl(ESetGetContext, (TAny*)(TUint)aId, aContext);
}
inline TInt RContextLdd::SetAndGetFullContext(TThreadId aId, TArmFullContext* aContextData)
{
return DoControl(ESetGetFullContext, (TAny*)(TUint)aId, (TAny*)aContextData);
}
inline void RContextLdd::GetContext(TThreadId aId, TAny* aContext)
{
DoControl(EGetContext, (TAny*)(TUint)aId, aContext);
}
inline void RContextLdd::GetKernelContext(TThreadId aId, TAny* aContext)
{
DoControl(EGetKernelContext, (TAny*)(TUint)aId, aContext);
}
inline TUint32 RContextLdd::SpinInKernel(TBool aReallySpin)
{
return DoControl(ESpinInKernel, (TAny*)aReallySpin);
}
inline void RContextLdd::AddUserCallback(TThreadId aId, TUserCallbackState aCallback)
{
DoControl(EAddUserCallback, (TAny*)(TUint)aId, (TAny*)aCallback);
}
inline void RContextLdd::ResumeTrappedThread(TThreadId aId)
{
DoControl(EResumeTrappedThread, (TAny*)(TUint)aId);
}
#endif // __KERNEL_MODE__
#endif
| {
"pile_set_name": "Github"
} |
//
// EventBuilder.cs - NUnit Test Cases for the EventBuilder class
//
// Zoltan Varga ([email protected])
//
// (C) Ximian, Inc. http://www.ximian.com
using System;
using System.Threading;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using NUnit.Framework;
namespace MonoTests.System.Reflection.Emit
{
[TestFixture]
public class EventBuilderTest
{
public delegate void AnEvent (object o);
private TypeBuilder tb;
private ModuleBuilder module;
private EventBuilder eb;
private MethodBuilder mb;
[SetUp]
protected void SetUp () {
AssemblyName assemblyName = new AssemblyName();
assemblyName.Name = GetType().FullName;
AssemblyBuilder assembly
= Thread.GetDomain().DefineDynamicAssembly(
assemblyName, AssemblyBuilderAccess.Run);
module = assembly.DefineDynamicModule("module1");
tb = module.DefineType("class1",
TypeAttributes.Public);
eb = tb.DefineEvent ("event1", EventAttributes.None, typeof (AnEvent));
mb =
tb.DefineMethod ("OnAnEvent",
MethodAttributes.Public, typeof (void),
new Type [] { typeof (AnEvent) });
ILGenerator ilgen = mb.GetILGenerator();
ilgen.Emit (OpCodes.Ret);
// These two are required
eb.SetAddOnMethod (mb);
eb.SetRemoveOnMethod (mb);
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void TestSetAddOnMethod1 () {
eb.SetAddOnMethod (null);
}
[Test]
[ExpectedException (typeof (InvalidOperationException))]
public void TestSetAddOnMethod2 () {
tb.CreateType ();
eb.SetAddOnMethod (mb);
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void TestSetRaiseMethod1 () {
eb.SetRaiseMethod (null);
}
[Test]
[ExpectedException (typeof (InvalidOperationException))]
public void TestSetRaiseMethod2 () {
tb.CreateType ();
eb.SetRaiseMethod (mb);
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void TestSetRemoveAddOnMethod1 () {
eb.SetRemoveOnMethod (null);
}
[Test]
[ExpectedException (typeof (InvalidOperationException))]
public void TestSetRemoveAddOnMethod2 () {
tb.CreateType ();
eb.SetRemoveOnMethod (mb);
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void TestAddOtherMethod1 () {
eb.AddOtherMethod (null);
}
[Test]
[ExpectedException (typeof (InvalidOperationException))]
public void TestAddOtherMethod2 () {
tb.CreateType ();
eb.AddOtherMethod (mb);
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void TestSetCustomAttribute1 () {
eb.SetCustomAttribute (null);
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void TestSetCustomAttribute2 () {
eb.SetCustomAttribute (null, new byte [1]);
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void TestSetCustomAttribute3 () {
ConstructorInfo con = typeof (String).GetConstructors ()[0];
eb.SetCustomAttribute (con, null);
}
[Test]
[ExpectedException (typeof (InvalidOperationException))]
public void TestSetCustomAttribute4 () {
tb.CreateType ();
byte[] custAttrData = { 1, 0, 0, 0, 0};
Type attrType = Type.GetType
("System.Reflection.AssemblyKeyNameAttribute");
Type[] paramTypes = new Type[1];
paramTypes[0] = typeof(String);
ConstructorInfo ctorInfo =
attrType.GetConstructor(paramTypes);
eb.SetCustomAttribute (ctorInfo, custAttrData);
}
[Test]
[ExpectedException (typeof (InvalidOperationException))]
public void TestSetCustomAttribute5 () {
tb.CreateType ();
eb.SetCustomAttribute (new CustomAttributeBuilder (typeof (MethodImplAttribute).GetConstructor (new Type[1] { typeof (short) }), new object[1] {(short)MethodImplAttributes.Synchronized}));
}
[Test]
public void TestCreation () {
eb = tb.DefineEvent ("event2", EventAttributes.SpecialName, typeof (AnEvent));
eb.SetRaiseMethod (mb);
eb.SetAddOnMethod (mb);
eb.SetRemoveOnMethod (mb);
eb.AddOtherMethod (mb);
eb.AddOtherMethod (mb);
Type t = tb.CreateType ();
MethodInfo mi = t.GetMethod ("OnAnEvent");
EventInfo[] events = t.GetEvents ();
Assert.AreEqual (2, events.Length);
{
EventInfo ev = t.GetEvent ("event1");
Assert.AreEqual ("event1", ev.Name);
Assert.AreEqual (EventAttributes.None, ev.Attributes);
Assert.AreEqual (t, ev.DeclaringType);
Assert.AreEqual (typeof (AnEvent), ev.EventHandlerType);
Assert.AreEqual (true, ev.IsMulticast);
Assert.AreEqual (false, ev.IsSpecialName);
Assert.AreEqual (mi, ev.GetAddMethod ());
Assert.AreEqual (null, ev.GetRaiseMethod ());
Assert.AreEqual (mi, ev.GetRemoveMethod ());
}
{
EventInfo ev = t.GetEvent ("event2");
Assert.AreEqual ("event2", ev.Name);
Assert.AreEqual (EventAttributes.SpecialName, ev.Attributes);
Assert.AreEqual (t, ev.DeclaringType);
Assert.AreEqual (typeof (AnEvent), ev.EventHandlerType);
Assert.AreEqual (true, ev.IsMulticast);
Assert.AreEqual (true, ev.IsSpecialName);
Assert.AreEqual (mi, ev.GetAddMethod ());
Assert.AreEqual (mi, ev.GetRaiseMethod ());
Assert.AreEqual (mi, ev.GetRemoveMethod ());
}
}
}
}
| {
"pile_set_name": "Github"
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aurora.Devices.Drevo
{
public static class DrevoLayoutMap
{
public static readonly Dictionary<DeviceKeys, int[]> BMKeyboard = new Dictionary<DeviceKeys, int[]>
{
{DeviceKeys.ESC, new int [] {0,0} },
{DeviceKeys.F1, new int [] {0, 1} },
{DeviceKeys.F2, new int [] {0, 2} },
{DeviceKeys.F3, new int [] {0, 3} },
{DeviceKeys.F4, new int [] {0, 4} },
{DeviceKeys.F5, new int [] {0, 6} },
{DeviceKeys.F6, new int [] {0, 7} },
{DeviceKeys.F7, new int [] {0, 8} },
{DeviceKeys.F8, new int [] {0, 9} },
{DeviceKeys.F9, new int [] {0, 11} },
{DeviceKeys.F10, new int [] {0, 12} },
{DeviceKeys.F11, new int [] {0, 13} },
{DeviceKeys.F12, new int [] {0, 14} },
{DeviceKeys.PRINT_SCREEN, new int [] {0, 15} },
{DeviceKeys.SCROLL_LOCK, new int [] {0, 16} },
{DeviceKeys.PAUSE_BREAK, new int [] {0, 17} },
{DeviceKeys.TILDE, new int [] {1, 0} },
{DeviceKeys.ONE, new int [] {1, 1} },
{DeviceKeys.TWO, new int [] {1, 2} },
{DeviceKeys.THREE, new int [] {1, 3} },
{DeviceKeys.FOUR, new int [] {1, 4} },
{DeviceKeys.FIVE, new int [] {1, 5} },
{DeviceKeys.SIX, new int [] {1, 6} },
{DeviceKeys.SEVEN, new int [] {1, 7} },
{DeviceKeys.EIGHT, new int [] {1, 8} },
{DeviceKeys.NINE, new int [] {1, 9} },
{DeviceKeys.ZERO, new int [] {1, 10} },
{DeviceKeys.MINUS, new int [] {1, 11} },
{DeviceKeys.EQUALS, new int [] {1, 12} },
{DeviceKeys.BACKSPACE, new int [] {1, 14} },
{DeviceKeys.INSERT, new int [] {1, 15} },
{DeviceKeys.HOME, new int [] {1, 16} },
{DeviceKeys.TAB, new int [] {2, 0} },
{DeviceKeys.Q, new int [] {2, 1} },
{DeviceKeys.W, new int [] {2, 2} },
{DeviceKeys.E, new int [] {2, 3} },
{DeviceKeys.R, new int [] {2, 4} },
{DeviceKeys.T, new int [] {2, 5} },
{DeviceKeys.Y, new int [] {2, 6} },
{DeviceKeys.U, new int [] {2, 7} },
{DeviceKeys.I, new int [] {2, 8} },
{DeviceKeys.O, new int [] {2, 9} },
{DeviceKeys.P, new int [] {2, 10} },
{DeviceKeys.OPEN_BRACKET, new int [] {2, 11} },
{DeviceKeys.CLOSE_BRACKET, new int [] {2,12} },
{DeviceKeys.BACKSLASH, new int [] {2, 14} },
{DeviceKeys.DELETE, new int [] {2, 15} },
{DeviceKeys.END, new int [] {2, 16} },
{DeviceKeys.PAGE_DOWN, new int [] {2, 17} },
{DeviceKeys.A, new int [] {3, 1} },
{DeviceKeys.S, new int [] {3, 2} },
{DeviceKeys.D, new int [] {3, 3} },
{DeviceKeys.F, new int [] {3, 4} },
{DeviceKeys.G, new int [] {3, 5} },
{DeviceKeys.H, new int [] {3, 6} },
{DeviceKeys.J, new int [] {3, 7} },
{DeviceKeys.K, new int [] {3, 8} },
{DeviceKeys.L, new int [] {3, 9} },
{DeviceKeys.SEMICOLON, new int [] {3, 10} },
{DeviceKeys.APOSTROPHE, new int [] {3, 11} },
{DeviceKeys.HASHTAG, new int [] {3, 13} },
{DeviceKeys.ENTER, new int [] {3, 14} },
{DeviceKeys.LEFT_SHIFT, new int [] {4, 0} },
{DeviceKeys.BACKSLASH_UK, new int [] {4, 1} },
{DeviceKeys.Z, new int [] {4, 2} },
{DeviceKeys.X, new int [] {4, 3} },
{DeviceKeys.C, new int [] {4, 4} },
{DeviceKeys.V, new int [] {4, 5} },
{DeviceKeys.B, new int [] {4, 6} },
{DeviceKeys.N, new int [] {4, 7} },
{DeviceKeys.M, new int [] {4, 8} },
{DeviceKeys.COMMA, new int [] {4, 9} },
{DeviceKeys.PERIOD, new int [] {4, 10} },
{DeviceKeys.FORWARD_SLASH, new int [] {4, 11} },
{DeviceKeys.RIGHT_SHIFT, new int [] {4, 14} },
{DeviceKeys.ARROW_UP, new int [] {4, 16} },
{DeviceKeys.LEFT_CONTROL, new int [] {5, 0} },
{DeviceKeys.LEFT_WINDOWS, new int [] {5, 1} },
{DeviceKeys.LEFT_ALT, new int [] {5, 2} },
{DeviceKeys.SPACE, new int [] {5, 6} },
{DeviceKeys.RIGHT_ALT, new int [] {5, 10} },
{DeviceKeys.APPLICATION_SELECT, new int [] {5, 12} },
{DeviceKeys.FN_Key, new int [] {5, 11} },
{DeviceKeys.RIGHT_CONTROL, new int [] {5, 14} },
{DeviceKeys.ARROW_LEFT, new int [] {5, 15} },
{DeviceKeys.ARROW_DOWN, new int [] {5, 16} },
{DeviceKeys.ARROW_RIGHT, new int [] {5, 17} },
};
}
} | {
"pile_set_name": "Github"
} |
package socks5
// CredentialStore is used to support user/pass authentication
type CredentialStore interface {
Valid(user, password string) bool
}
// StaticCredentials enables using a map directly as a credential store
type StaticCredentials map[string]string
func (s StaticCredentials) Valid(user, password string) bool {
pass, ok := s[user]
if !ok {
return false
}
return password == pass
}
| {
"pile_set_name": "Github"
} |
// Signature format: 3.0
package androidx.car.app {
public class CarAlertDialog extends android.app.Dialog {
}
public static final class CarAlertDialog.Builder {
ctor public CarAlertDialog.Builder(android.content.Context);
method public androidx.car.app.CarAlertDialog create();
method public androidx.car.app.CarAlertDialog.Builder setBody(@StringRes int);
method public androidx.car.app.CarAlertDialog.Builder setBody(CharSequence);
method public androidx.car.app.CarAlertDialog.Builder setBodyMovementMethod(android.text.method.MovementMethod?);
method public androidx.car.app.CarAlertDialog.Builder setCancelable(boolean);
method public androidx.car.app.CarAlertDialog.Builder setHeaderIcon(@DrawableRes int);
method public androidx.car.app.CarAlertDialog.Builder setNegativeButton(@StringRes int, android.content.DialogInterface.OnClickListener?);
method public androidx.car.app.CarAlertDialog.Builder setNegativeButton(CharSequence, android.content.DialogInterface.OnClickListener?);
method public androidx.car.app.CarAlertDialog.Builder setOnCancelListener(android.content.DialogInterface.OnCancelListener);
method public androidx.car.app.CarAlertDialog.Builder setOnDismissListener(android.content.DialogInterface.OnDismissListener);
method public androidx.car.app.CarAlertDialog.Builder setPositiveButton(@StringRes int, android.content.DialogInterface.OnClickListener?);
method public androidx.car.app.CarAlertDialog.Builder setPositiveButton(CharSequence, android.content.DialogInterface.OnClickListener?);
method public androidx.car.app.CarAlertDialog.Builder setTitle(@StringRes int);
method public androidx.car.app.CarAlertDialog.Builder setTitle(CharSequence);
}
public class CarListDialog extends android.app.Dialog {
}
public static final class CarListDialog.Builder {
ctor public CarListDialog.Builder(android.content.Context!);
method public androidx.car.app.CarListDialog! create();
method public androidx.car.app.CarListDialog.Builder setCancelable(boolean);
method public androidx.car.app.CarListDialog.Builder setInitialPosition(int);
method public androidx.car.app.CarListDialog.Builder setItems(CharSequence![], android.content.DialogInterface.OnClickListener?);
method public androidx.car.app.CarListDialog.Builder setItems(androidx.car.app.CarListDialog.DialogSubSection![], android.content.DialogInterface.OnClickListener?);
method public androidx.car.app.CarListDialog.Builder setOnCancelListener(android.content.DialogInterface.OnCancelListener);
method public androidx.car.app.CarListDialog.Builder setOnDismissListener(android.content.DialogInterface.OnDismissListener);
method public androidx.car.app.CarListDialog.Builder setTitle(@StringRes int);
method public androidx.car.app.CarListDialog.Builder setTitle(CharSequence);
}
public static class CarListDialog.DialogSubSection {
ctor public CarListDialog.DialogSubSection(CharSequence, CharSequence![]);
method public int getItemCount();
method public CharSequence![] getItems();
method public CharSequence getTitle();
}
public final class CarMultipleChoiceDialog extends android.app.Dialog {
}
public static final class CarMultipleChoiceDialog.Builder {
ctor public CarMultipleChoiceDialog.Builder(android.content.Context);
method public android.app.Dialog create();
method public androidx.car.app.CarMultipleChoiceDialog.Builder setBody(@StringRes int);
method public androidx.car.app.CarMultipleChoiceDialog.Builder setBody(CharSequence);
method public androidx.car.app.CarMultipleChoiceDialog.Builder setCancelable(boolean);
method public androidx.car.app.CarMultipleChoiceDialog.Builder setItems(java.util.List<androidx.car.app.CarMultipleChoiceDialog.Item!>);
method public androidx.car.app.CarMultipleChoiceDialog.Builder setNegativeButton(@StringRes int);
method public androidx.car.app.CarMultipleChoiceDialog.Builder setNegativeButton(CharSequence);
method public androidx.car.app.CarMultipleChoiceDialog.Builder setOnCancelListener(android.content.DialogInterface.OnCancelListener);
method public androidx.car.app.CarMultipleChoiceDialog.Builder setOnDismissListener(android.content.DialogInterface.OnDismissListener);
method public androidx.car.app.CarMultipleChoiceDialog.Builder setPositiveButton(@StringRes int, androidx.car.app.CarMultipleChoiceDialog.OnMultiChoiceClickListener);
method public androidx.car.app.CarMultipleChoiceDialog.Builder setPositiveButton(CharSequence, androidx.car.app.CarMultipleChoiceDialog.OnMultiChoiceClickListener);
method public androidx.car.app.CarMultipleChoiceDialog.Builder setTitle(@StringRes int);
method public androidx.car.app.CarMultipleChoiceDialog.Builder setTitle(CharSequence);
}
public static class CarMultipleChoiceDialog.Item {
ctor public CarMultipleChoiceDialog.Item(CharSequence, boolean);
ctor public CarMultipleChoiceDialog.Item(CharSequence, CharSequence?, boolean);
}
public static interface CarMultipleChoiceDialog.OnMultiChoiceClickListener {
method public void onClick(android.content.DialogInterface, boolean[]);
}
public final class CarSingleChoiceDialog extends android.app.Dialog {
}
public static final class CarSingleChoiceDialog.Builder {
ctor public CarSingleChoiceDialog.Builder(android.content.Context);
method public android.app.Dialog create();
method public androidx.car.app.CarSingleChoiceDialog.Builder setBody(@StringRes int);
method public androidx.car.app.CarSingleChoiceDialog.Builder setBody(CharSequence);
method public androidx.car.app.CarSingleChoiceDialog.Builder setCancelable(boolean);
method public androidx.car.app.CarSingleChoiceDialog.Builder setItems(java.util.List<androidx.car.app.CarSingleChoiceDialog.Item!>, @IntRange(from=0) int);
method public androidx.car.app.CarSingleChoiceDialog.Builder setNegativeButton(@StringRes int);
method public androidx.car.app.CarSingleChoiceDialog.Builder setNegativeButton(CharSequence);
method public androidx.car.app.CarSingleChoiceDialog.Builder setOnCancelListener(android.content.DialogInterface.OnCancelListener);
method public androidx.car.app.CarSingleChoiceDialog.Builder setOnDismissListener(android.content.DialogInterface.OnDismissListener);
method public androidx.car.app.CarSingleChoiceDialog.Builder setPositiveButton(@StringRes int, android.content.DialogInterface.OnClickListener);
method public androidx.car.app.CarSingleChoiceDialog.Builder setPositiveButton(CharSequence, android.content.DialogInterface.OnClickListener);
method public androidx.car.app.CarSingleChoiceDialog.Builder setTitle(@StringRes int);
method public androidx.car.app.CarSingleChoiceDialog.Builder setTitle(CharSequence);
}
public static class CarSingleChoiceDialog.Item {
ctor public CarSingleChoiceDialog.Item(CharSequence);
ctor public CarSingleChoiceDialog.Item(CharSequence, CharSequence);
}
}
package androidx.car.drawer {
public abstract class CarDrawerAdapter extends androidx.recyclerview.widget.RecyclerView.Adapter<androidx.car.drawer.DrawerItemViewHolder> implements androidx.car.widget.PagedListView.ItemCap {
ctor protected CarDrawerAdapter(android.content.Context!, boolean);
method public void cleanup();
method protected abstract int getActualItemCount();
method public final int getItemCount();
method public final int getItemViewType(int);
method public final void onBindViewHolder(androidx.car.drawer.DrawerItemViewHolder!, int);
method public final androidx.car.drawer.DrawerItemViewHolder! onCreateViewHolder(android.view.ViewGroup!, int);
method protected abstract void populateViewHolder(androidx.car.drawer.DrawerItemViewHolder!, int);
method public final void setMaxItems(int);
method public final void setTitle(CharSequence?);
method public void start();
method public void stop();
method protected boolean usesSmallLayout(int);
}
public class CarDrawerController {
ctor public CarDrawerController(androidx.drawerlayout.widget.DrawerLayout, androidx.appcompat.app.ActionBarDrawerToggle);
method public void addDrawerListener(androidx.drawerlayout.widget.DrawerLayout.DrawerListener);
method public void closeDrawer();
method public void onConfigurationChanged(android.content.res.Configuration!);
method public boolean onOptionsItemSelected(android.view.MenuItem!);
method public void openDrawer();
method public final void pushAdapter(androidx.car.drawer.CarDrawerAdapter!);
method public void removeDrawerListener(androidx.drawerlayout.widget.DrawerLayout.DrawerListener);
method public void scrollToPosition(int);
method public void setRootAdapter(androidx.car.drawer.CarDrawerAdapter?);
method public void showLoadingProgressBar(boolean);
method public void syncState();
}
public class DrawerItemViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder implements androidx.car.uxrestrictions.OnUxRestrictionsChangedListener {
method public android.widget.TextView? getBodyView();
method public android.widget.ImageView? getEndIconView();
method public android.widget.ImageView getIconView();
method public android.widget.TextView getTitleView();
method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions!);
}
}
package androidx.car.util {
public class CarUxRestrictionsHelper {
ctor public CarUxRestrictionsHelper(android.content.Context, androidx.car.uxrestrictions.OnUxRestrictionsChangedListener);
method public androidx.car.uxrestrictions.CarUxRestrictions getCurrentCarUxRestrictions();
method public void start();
method public void stop();
}
public class ColumnCalculator {
method public int getColumnCount();
method @Px public int getColumnSpanWidth(int);
method @Px public int getColumnWidth();
method public int getGutterCount();
method @Px public int getGutterWidth();
method public static androidx.car.util.ColumnCalculator! getInstance(android.content.Context!);
}
}
package androidx.car.uxrestrictions {
public final class CarUxRestrictions {
ctor public CarUxRestrictions(androidx.car.uxrestrictions.CarUxRestrictions!);
method public int getActiveRestrictions();
method public int getMaxContentDepth();
method public int getMaxCumulativeContentItems();
method public int getMaxRestrictedStringLength();
method public long getTimestamp();
method public boolean hasSameRestrictionsAs(androidx.car.uxrestrictions.CarUxRestrictions!);
method public boolean isDistractionOptimizationRequired();
field public static final int UX_RESTRICTIONS_BASELINE = 0; // 0x0
field public static final int UX_RESTRICTIONS_FULLY_RESTRICTED = 511; // 0x1ff
field public static final int UX_RESTRICTIONS_LIMIT_CONTENT = 32; // 0x20
field public static final int UX_RESTRICTIONS_LIMIT_STRING_LENGTH = 4; // 0x4
field public static final int UX_RESTRICTIONS_NO_DIALPAD = 1; // 0x1
field public static final int UX_RESTRICTIONS_NO_FILTERING = 2; // 0x2
field public static final int UX_RESTRICTIONS_NO_KEYBOARD = 8; // 0x8
field public static final int UX_RESTRICTIONS_NO_SETUP = 64; // 0x40
field public static final int UX_RESTRICTIONS_NO_TEXT_MESSAGE = 128; // 0x80
field public static final int UX_RESTRICTIONS_NO_VIDEO = 16; // 0x10
field public static final int UX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION = 256; // 0x100
}
public static final class CarUxRestrictions.Builder {
ctor public CarUxRestrictions.Builder(boolean, int, long);
method public androidx.car.uxrestrictions.CarUxRestrictions build();
method public androidx.car.uxrestrictions.CarUxRestrictions.Builder setMaxContentDepth(int);
method public androidx.car.uxrestrictions.CarUxRestrictions.Builder setMaxCumulativeContentItems(int);
method public androidx.car.uxrestrictions.CarUxRestrictions.Builder setMaxStringLength(int);
}
public interface OnUxRestrictionsChangedListener {
method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions!);
}
}
package androidx.car.widget {
public final class ActionListItem extends androidx.car.widget.ListItem<androidx.car.widget.ActionListItem.ViewHolder> {
ctor public ActionListItem(android.content.Context);
method public static androidx.car.widget.ActionListItem.ViewHolder createViewHolder(android.view.View!);
method protected android.content.Context getContext();
method public int getViewType();
method public void onBind(androidx.car.widget.ActionListItem.ViewHolder!);
method protected void resolveDirtyState();
method @Deprecated public void setAction(String, boolean, android.view.View.OnClickListener);
method public void setActionBorderless(boolean);
method @Deprecated public void setActions(String, boolean, android.view.View.OnClickListener, String, boolean, android.view.View.OnClickListener);
method public void setBody(CharSequence);
method public void setEnabled(boolean);
method public void setOnClickListener(android.view.View.OnClickListener!);
method public void setPrimaryAction(String, boolean, android.view.View.OnClickListener);
method public void setPrimaryActionEmptyIcon();
method public void setPrimaryActionIcon(@DrawableRes int, int);
method public void setPrimaryActionIcon(android.graphics.drawable.Drawable?, int);
method public void setPrimaryActionNoIcon();
method public void setSecondaryAction(String, boolean, android.view.View.OnClickListener);
method public void setTitle(CharSequence);
field public static final int PRIMARY_ACTION_ICON_SIZE_LARGE = 2; // 0x2
field public static final int PRIMARY_ACTION_ICON_SIZE_MEDIUM = 1; // 0x1
field public static final int PRIMARY_ACTION_ICON_SIZE_SMALL = 0; // 0x0
}
public static final class ActionListItem.ViewHolder extends androidx.car.widget.ListItem.ViewHolder {
ctor public ActionListItem.ViewHolder(android.view.View);
method public android.widget.TextView getBody();
method public android.widget.Button getPrimaryAction();
method public android.view.View getPrimaryActionDivider();
method public android.widget.ImageView getPrimaryIcon();
method public android.widget.Button getSecondaryAction();
method public android.view.View getSecondaryActionDivider();
method public android.widget.TextView getTitle();
method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions);
method public void setActionBorderless(boolean);
}
public interface AlphaJumpAdapter {
method public java.util.List<androidx.car.widget.AlphaJumpBucket!>! getAlphaJumpBuckets();
method public void onAlphaJumpEnter();
method public void onAlphaJumpLeave(androidx.car.widget.AlphaJumpBucket!);
}
public interface AlphaJumpBucket {
method public int getIndex();
method public CharSequence! getLabel();
method public boolean isEmpty();
}
public class AlphaJumpBucketer {
ctor public AlphaJumpBucketer();
ctor public AlphaJumpBucketer(androidx.car.widget.AlphaJumpBucketer.Bucket![]!);
method public java.util.List<androidx.car.widget.AlphaJumpBucket!>! createBuckets(String![]!);
method public java.util.List<androidx.car.widget.AlphaJumpBucket!>! createBuckets(Iterable<java.lang.String!>!);
method public java.util.List<androidx.car.widget.AlphaJumpBucket!>! createBuckets(java.util.Iterator<java.lang.String!>!);
}
public static class AlphaJumpBucketer.Bucket implements androidx.car.widget.AlphaJumpBucket {
method public int getIndex();
method public CharSequence! getLabel();
method public boolean isEmpty();
}
public class AlphaJumpOverlayView extends androidx.gridlayout.widget.GridLayout {
ctor public AlphaJumpOverlayView(android.content.Context);
method public void hide();
method public void show();
}
public final class CarMenuItem {
method public androidx.car.widget.CarMenuItem.DisplayBehavior getDisplayBehavior();
method public android.graphics.drawable.Drawable? getIcon();
method @StyleRes public int getStyleResId();
method public CharSequence? getTitle();
method public boolean isCheckable();
method public boolean isChecked();
method public boolean isEnabled();
method public void setChecked(boolean);
method public void setEnabled(boolean);
method public void setTitle(CharSequence?);
}
public static final class CarMenuItem.Builder {
ctor public CarMenuItem.Builder();
method public androidx.car.widget.CarMenuItem build();
method public androidx.car.widget.CarMenuItem.Builder setCheckable(boolean);
method public androidx.car.widget.CarMenuItem.Builder setChecked(boolean);
method public androidx.car.widget.CarMenuItem.Builder setDisplayBehavior(androidx.car.widget.CarMenuItem.DisplayBehavior);
method public androidx.car.widget.CarMenuItem.Builder setEnabled(boolean);
method public androidx.car.widget.CarMenuItem.Builder setIcon(android.graphics.drawable.Drawable);
method public androidx.car.widget.CarMenuItem.Builder setIcon(android.content.Context, @DrawableRes int);
method public androidx.car.widget.CarMenuItem.Builder setOnClickListener(androidx.car.widget.CarMenuItem.OnClickListener);
method public androidx.car.widget.CarMenuItem.Builder setStyle(@StyleRes int);
method public androidx.car.widget.CarMenuItem.Builder setTitle(CharSequence);
}
public enum CarMenuItem.DisplayBehavior {
enum_constant public static final androidx.car.widget.CarMenuItem.DisplayBehavior ALWAYS;
enum_constant public static final androidx.car.widget.CarMenuItem.DisplayBehavior IF_ROOM;
enum_constant public static final androidx.car.widget.CarMenuItem.DisplayBehavior NEVER;
}
public static interface CarMenuItem.OnClickListener {
method public void onClick(androidx.car.widget.CarMenuItem!);
}
public class CarToolbar extends android.view.ViewGroup {
ctor public CarToolbar(android.content.Context!);
ctor public CarToolbar(android.content.Context!, android.util.AttributeSet!);
ctor public CarToolbar(android.content.Context!, android.util.AttributeSet!, int);
ctor public CarToolbar(android.content.Context!, android.util.AttributeSet!, int, int);
method public java.util.List<androidx.car.widget.CarMenuItem!>? getMenuItems();
method public CharSequence? getSubtitle();
method public CharSequence! getTitle();
method public boolean isOverflowMenuShowing();
method public void setMenuItems(java.util.List<androidx.car.widget.CarMenuItem!>?);
method public void setNavigationIcon(@DrawableRes int);
method public void setNavigationIcon(android.graphics.drawable.Drawable?);
method public void setNavigationIconContainerWidth(@Px int);
method public void setNavigationIconOnClickListener(android.view.View.OnClickListener?);
method public void setNavigationIconTint(@ColorInt int);
method public void setNavigationIconTint(android.graphics.ColorFilter?);
method public void setOverflowIcon(@DrawableRes int);
method public void setOverflowIcon(android.graphics.drawable.Drawable);
method public void setOverflowMenuShown(boolean);
method public void setSubtitle(@StringRes int);
method public void setSubtitle(CharSequence?);
method public void setSubtitleTextAppearance(@StyleRes int);
method public void setTitle(@StringRes int);
method public void setTitle(CharSequence?);
method public void setTitleIcon(@DrawableRes int);
method public void setTitleIcon(android.graphics.drawable.Drawable?);
method public void setTitleIconEndMargin(@Px int);
method public void setTitleIconSize(@Px int);
method public void setTitleIconStartMargin(@Px int);
method public void setTitleTextAppearance(@StyleRes int);
}
public final class CheckBoxListItem extends androidx.car.widget.CompoundButtonListItem<androidx.car.widget.CheckBoxListItem.ViewHolder> {
ctor public CheckBoxListItem(android.content.Context);
method public static androidx.car.widget.CheckBoxListItem.ViewHolder createViewHolder(android.view.View);
method public int getViewType();
method public boolean isCompoundButtonPositionEnd();
}
public static final class CheckBoxListItem.ViewHolder extends androidx.car.widget.CompoundButtonListItem.ViewHolder {
ctor public CheckBoxListItem.ViewHolder(android.view.View);
method public android.widget.TextView getBody();
method public android.widget.CompoundButton getCompoundButton();
method public android.view.View getCompoundButtonDivider();
method public android.view.ViewGroup getContainerLayout();
method public android.widget.ImageView getPrimaryIcon();
method public android.widget.TextView getTitle();
method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions);
}
public final class ColumnCardView extends androidx.cardview.widget.CardView {
ctor public ColumnCardView(android.content.Context!);
ctor public ColumnCardView(android.content.Context!, android.util.AttributeSet!);
ctor public ColumnCardView(android.content.Context!, android.util.AttributeSet!, int);
method public int getColumnSpan();
method public void onMeasure(int, int);
method public void setColumnSpan(int);
}
public abstract class CompoundButtonListItem<VH extends androidx.car.widget.CompoundButtonListItem.ViewHolder> extends androidx.car.widget.ListItem<VH> {
ctor public CompoundButtonListItem(android.content.Context);
method public abstract boolean isCompoundButtonPositionEnd();
method public boolean isEntireItemClickable();
method public void onBind(VH);
method @CallSuper protected void resolveDirtyState();
method public void setBody(CharSequence?);
method public void setChecked(boolean);
method @Deprecated public void setClickable(boolean);
method public void setEnabled(boolean);
method public void setEntireItemClickable(boolean);
method public void setOnCheckedChangeListener(android.widget.CompoundButton.OnCheckedChangeListener?);
method public void setPrimaryActionEmptyIcon();
method public void setPrimaryActionIcon(android.graphics.drawable.Drawable, int);
method public void setPrimaryActionIcon(@DrawableRes int, int);
method public void setPrimaryActionNoIcon();
method public void setShowCompoundButtonDivider(boolean);
method public void setTitle(CharSequence?);
field public static final int PRIMARY_ACTION_ICON_SIZE_LARGE = 2; // 0x2
field public static final int PRIMARY_ACTION_ICON_SIZE_MEDIUM = 1; // 0x1
field public static final int PRIMARY_ACTION_ICON_SIZE_SMALL = 0; // 0x0
}
public abstract static class CompoundButtonListItem.ViewHolder extends androidx.car.widget.ListItem.ViewHolder {
ctor public CompoundButtonListItem.ViewHolder(android.view.View);
method public abstract android.widget.TextView getBody();
method public abstract android.widget.CompoundButton getCompoundButton();
method public abstract android.view.View getCompoundButtonDivider();
method public abstract android.widget.ImageView getPrimaryIcon();
method public abstract android.widget.TextView getTitle();
}
public abstract class ListItem<VH extends androidx.car.widget.ListItem.ViewHolder> {
ctor public ListItem();
method public final void addViewBinder(androidx.car.widget.ListItem.ViewBinder<VH!>!);
method public final void addViewBinder(androidx.car.widget.ListItem.ViewBinder<VH!>!, androidx.car.widget.ListItem.ViewBinder<VH!>?);
method public boolean getShowDivider();
method public abstract int getViewType();
method protected boolean isDirty();
method protected void markClean();
method protected void markDirty();
method protected abstract void onBind(VH!);
method public boolean removeViewBinder(androidx.car.widget.ListItem.ViewBinder<VH!>!);
method protected abstract void resolveDirtyState();
method public abstract void setEnabled(boolean);
method public void setShowDivider(boolean);
}
public static interface ListItem.ViewBinder<VH> {
method public void bind(VH!);
}
public abstract static class ListItem.ViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder implements androidx.car.uxrestrictions.OnUxRestrictionsChangedListener {
ctor public ListItem.ViewHolder(android.view.View!);
method public final void addCleanUp(androidx.car.widget.ListItem.ViewBinder<androidx.car.widget.ListItem.ViewHolder!>?);
method public final void cleanUp();
}
public class ListItemAdapter extends androidx.recyclerview.widget.RecyclerView.Adapter<androidx.car.widget.ListItem.ViewHolder> implements androidx.car.widget.PagedListView.DividerVisibilityManager androidx.car.widget.PagedListView.ItemCap {
ctor public ListItemAdapter(android.content.Context, androidx.car.widget.ListItemProvider);
ctor public ListItemAdapter(android.content.Context, androidx.car.widget.ListItemProvider, int);
method public android.content.Context getContext();
method public int getItemCount();
method public boolean getShowDivider(@IntRange(from=0) int);
method public void onBindViewHolder(androidx.car.widget.ListItem.ViewHolder!, int);
method public androidx.car.widget.ListItem.ViewHolder! onCreateViewHolder(android.view.ViewGroup!, int);
method public void registerListItemViewType(@IntRange(from=java.lang.Integer.MIN_VALUE, to=0xffffffff) int, @LayoutRes int, androidx.arch.core.util.Function<android.view.View!,androidx.car.widget.ListItem.ViewHolder!>!);
method public void setMaxItems(int);
method public void start();
method public void stop();
field public static final int BACKGROUND_STYLE_CARD = 2; // 0x2
field public static final int BACKGROUND_STYLE_NONE = 1; // 0x1
field public static final int BACKGROUND_STYLE_PANEL = 3; // 0x3
field public static final int BACKGROUND_STYLE_SOLID = 0; // 0x0
}
@Deprecated public static final class ListItemAdapter.BackgroundStyle {
field @Deprecated public static final int CARD = 2; // 0x2
field @Deprecated public static final int NONE = 1; // 0x1
field @Deprecated public static final int PANEL = 3; // 0x3
field @Deprecated public static final int SOLID = 0; // 0x0
}
public abstract class ListItemProvider<VH extends androidx.car.widget.ListItem.ViewHolder> {
ctor public ListItemProvider();
method public abstract androidx.car.widget.ListItem<VH!> get(int);
method public abstract int size();
}
public static class ListItemProvider.ListProvider<VH extends androidx.car.widget.ListItem.ViewHolder> extends androidx.car.widget.ListItemProvider {
ctor public ListItemProvider.ListProvider(java.util.List<androidx.car.widget.ListItem<VH!>!>);
method public androidx.car.widget.ListItem<VH!> get(int);
method public int size();
}
public class PagedListView extends android.widget.FrameLayout {
ctor public PagedListView(android.content.Context!);
ctor public PagedListView(android.content.Context!, android.util.AttributeSet!);
ctor public PagedListView(android.content.Context!, android.util.AttributeSet!, int);
ctor public PagedListView(android.content.Context!, android.util.AttributeSet!, int, int);
method public void addItemDecoration(androidx.recyclerview.widget.RecyclerView.ItemDecoration);
method public void addOnItemTouchListener(androidx.recyclerview.widget.RecyclerView.OnItemTouchListener);
method public void addOnScrollListener(androidx.recyclerview.widget.RecyclerView.OnScrollListener);
method public androidx.recyclerview.widget.RecyclerView.Adapter<? extends androidx.recyclerview.widget.RecyclerView.ViewHolder>? getAdapter();
method public int getListContentBottomOffset();
method public int getListContentTopOffset();
method public int getMaxPages();
method public int getPage(int);
method public androidx.recyclerview.widget.RecyclerView getRecyclerView();
method public int getRowsPerPage();
method public boolean isAlphaJumpShown();
method public boolean isAtEnd();
method public boolean isAtStart();
method public final boolean isScrollBarEnabled();
method public boolean isScrollbarThumbEnabled();
method public void onLayout(boolean, int, int, int, int);
method public void onRestoreInstanceState(android.os.Parcelable!);
method public android.os.Parcelable! onSaveInstanceState();
method public void pageDown();
method public void pageUp();
method public int positionOf(android.view.View?);
method public void registerCallback(androidx.car.widget.PagedListView.Callback);
method public void removeItemDecoration(androidx.recyclerview.widget.RecyclerView.ItemDecoration);
method public void removeOnItemTouchListener(androidx.recyclerview.widget.RecyclerView.OnItemTouchListener);
method public void removeOnScrollListener(androidx.recyclerview.widget.RecyclerView.OnScrollListener);
method public void scrollToPosition(int);
method public void setAdapter(androidx.recyclerview.widget.RecyclerView.Adapter<? extends androidx.recyclerview.widget.RecyclerView.ViewHolder>);
method public void setAlphaJumpVisible(boolean);
method public void setDividerColor(@ColorInt int);
method public void setDividerVisibilityManager(androidx.car.widget.PagedListView.DividerVisibilityManager!);
method public void setDownButtonIcon(android.graphics.drawable.Drawable!);
method public void setGutter(@androidx.car.widget.PagedListView.Gutter int);
method public void setGutterSize(int);
method public void setItemSpacing(int);
method public void setListContentBottomOffset(@Px int);
method public void setListContentTopOffset(@Px int);
method public void setMaxPages(int);
method @Deprecated public void setOnScrollListener(androidx.car.widget.PagedListView.OnScrollListener!);
method public void setScrollBarButtonRippleBackground(@DrawableRes int);
method public void setScrollBarButtonTintColor(@ColorRes int);
method public void setScrollBarContainerWidth(int);
method public final void setScrollBarEnabled(boolean);
method public void setScrollBarGravity(int);
method public void setScrollBarTopMargin(int);
method public void setScrollbarThumbColor(@ColorRes int);
method public void setScrollbarThumbEnabled(boolean);
method public void setUpButtonIcon(android.graphics.drawable.Drawable!);
method public void snapToPosition(int);
method public void unregisterCallback(androidx.car.widget.PagedListView.Callback);
field public static final int UNLIMITED_PAGES = -1; // 0xffffffff
}
public static interface PagedListView.Callback {
method public default void onReachBottom();
method public default void onScrollDownButtonClicked();
method public default void onScrollUpButtonClicked();
}
public static interface PagedListView.DividerVisibilityManager {
method public boolean getShowDivider(int);
}
@IntDef({androidx.car.widget.PagedListView.Gutter.NONE, androidx.car.widget.PagedListView.Gutter.START, androidx.car.widget.PagedListView.Gutter.END, androidx.car.widget.PagedListView.Gutter.BOTH}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface PagedListView.Gutter {
field public static final int BOTH = 3; // 0x3
field public static final int END = 2; // 0x2
field public static final int NONE = 0; // 0x0
field public static final int START = 1; // 0x1
}
public static interface PagedListView.ItemCap {
method public void setMaxItems(int);
field public static final int UNLIMITED = -1; // 0xffffffff
}
public static interface PagedListView.ItemPositionOffset {
method public void setPositionOffset(int);
}
@Deprecated public abstract static class PagedListView.OnScrollListener {
ctor @Deprecated public PagedListView.OnScrollListener();
method @Deprecated public void onReachBottom();
method @Deprecated public void onScrollDownButtonClicked();
method @Deprecated public void onScrollStateChanged(androidx.recyclerview.widget.RecyclerView!, int);
method @Deprecated public void onScrollUpButtonClicked();
method @Deprecated public void onScrolled(androidx.recyclerview.widget.RecyclerView!, int, int);
}
public class PagedScrollBarView extends android.view.ViewGroup {
ctor public PagedScrollBarView(android.content.Context!);
ctor public PagedScrollBarView(android.content.Context!, android.util.AttributeSet!);
ctor public PagedScrollBarView(android.content.Context!, android.util.AttributeSet!, int);
ctor public PagedScrollBarView(android.content.Context!, android.util.AttributeSet!, int, int);
method public boolean isDownEnabled();
method public boolean isDownPressed();
method public boolean isScrollbarThumbEnabled();
method public boolean isUpPressed();
method public void onLayout(boolean, int, int, int, int);
method public void setButtonRippleBackground(@DrawableRes int);
method public void setButtonTintColor(@ColorRes int);
method public void setDownButtonIcon(android.graphics.drawable.Drawable!);
method public void setDownEnabled(boolean);
method public void setPaginationListener(androidx.car.widget.PagedScrollBarView.PaginationListener!);
method public void setParameters(@IntRange(from=0) int, @IntRange(from=0) int, @IntRange(from=0) int, boolean);
method public void setScrollbarThumbColor(@ColorRes int);
method public void setScrollbarThumbEnabled(boolean);
method public void setUpButtonIcon(android.graphics.drawable.Drawable!);
method public void setUpEnabled(boolean);
}
public static interface PagedScrollBarView.PaginationListener {
method public void onAlphaJump();
method public void onPaginate(int);
field public static final int PAGE_DOWN = 1; // 0x1
field public static final int PAGE_UP = 0; // 0x0
}
public final class RadioButtonListItem extends androidx.car.widget.CompoundButtonListItem<androidx.car.widget.RadioButtonListItem.ViewHolder> {
ctor public RadioButtonListItem(android.content.Context);
method public static androidx.car.widget.RadioButtonListItem.ViewHolder createViewHolder(android.view.View);
method public int getViewType();
method public boolean isCompoundButtonPositionEnd();
}
public static final class RadioButtonListItem.ViewHolder extends androidx.car.widget.CompoundButtonListItem.ViewHolder {
ctor public RadioButtonListItem.ViewHolder(android.view.View);
method public android.widget.TextView getBody();
method public android.widget.CompoundButton getCompoundButton();
method public android.view.View getCompoundButtonDivider();
method public android.view.ViewGroup getContainerLayout();
method public android.widget.ImageView getPrimaryIcon();
method public android.widget.TextView getTitle();
method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions);
}
public class SeekbarListItem extends androidx.car.widget.ListItem<androidx.car.widget.SeekbarListItem.ViewHolder> {
ctor public SeekbarListItem(android.content.Context);
method public static androidx.car.widget.SeekbarListItem.ViewHolder createViewHolder(android.view.View!);
method protected android.content.Context getContext();
method public int getViewType();
method protected void onBind(androidx.car.widget.SeekbarListItem.ViewHolder!);
method protected void resolveDirtyState();
method public void setEnabled(boolean);
method public void setMax(int);
method public void setOnSeekBarChangeListener(android.widget.SeekBar.OnSeekBarChangeListener!);
method public void setPrimaryActionEmptyIcon();
method public void setPrimaryActionIcon(@DrawableRes int);
method public void setPrimaryActionIcon(android.graphics.drawable.Drawable);
method public void setPrimaryActionIconListener(android.view.View.OnClickListener!);
method public void setProgress(int);
method public void setSecondaryProgress(int);
method public void setSupplementalEmptyIcon(boolean);
method public void setSupplementalIcon(@DrawableRes int, boolean);
method public void setSupplementalIcon(android.graphics.drawable.Drawable, boolean);
method public void setSupplementalIconListener(android.view.View.OnClickListener!);
method public void setText(CharSequence?);
}
public static final class SeekbarListItem.ViewHolder extends androidx.car.widget.ListItem.ViewHolder implements androidx.car.uxrestrictions.OnUxRestrictionsChangedListener {
ctor public SeekbarListItem.ViewHolder(android.view.View!);
method public android.view.ViewGroup getContainerLayout();
method public android.widget.ImageView getPrimaryIcon();
method public android.widget.SeekBar getSeekBar();
method public android.widget.ImageView getSupplementalIcon();
method public android.view.View getSupplementalIconDivider();
method public android.widget.TextView getText();
method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions!);
}
public class SubheaderListItem extends androidx.car.widget.ListItem<androidx.car.widget.SubheaderListItem.ViewHolder> {
ctor public SubheaderListItem(android.content.Context, CharSequence);
method public static androidx.car.widget.SubheaderListItem.ViewHolder createViewHolder(android.view.View!);
method protected android.content.Context getContext();
method public int getViewType();
method protected void onBind(androidx.car.widget.SubheaderListItem.ViewHolder!);
method protected void resolveDirtyState();
method public void setEnabled(boolean);
method public void setText(CharSequence);
method public void setTextStartMarginType(@androidx.car.widget.SubheaderListItem.TextStartMarginType int);
field public static final int TEXT_START_MARGIN_TYPE_LARGE = 2; // 0x2
field public static final int TEXT_START_MARGIN_TYPE_NONE = 0; // 0x0
field public static final int TEXT_START_MARGIN_TYPE_SMALL = 1; // 0x1
}
@IntDef({androidx.car.widget.SubheaderListItem.TEXT_START_MARGIN_TYPE_NONE, androidx.car.widget.SubheaderListItem.TEXT_START_MARGIN_TYPE_LARGE, androidx.car.widget.SubheaderListItem.TEXT_START_MARGIN_TYPE_SMALL}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface SubheaderListItem.TextStartMarginType {
}
public static final class SubheaderListItem.ViewHolder extends androidx.car.widget.ListItem.ViewHolder {
ctor public SubheaderListItem.ViewHolder(android.view.View!);
method public android.widget.TextView getText();
method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions!);
}
public final class SwitchListItem extends androidx.car.widget.CompoundButtonListItem<androidx.car.widget.SwitchListItem.ViewHolder> {
ctor public SwitchListItem(android.content.Context);
method public static androidx.car.widget.SwitchListItem.ViewHolder createViewHolder(android.view.View);
method public int getViewType();
method public boolean isCompoundButtonPositionEnd();
method @Deprecated public void setShowSwitchDivider(boolean);
method @Deprecated public void setSwitchOnCheckedChangeListener(android.widget.CompoundButton.OnCheckedChangeListener?);
method @Deprecated public void setSwitchState(boolean);
}
public static final class SwitchListItem.ViewHolder extends androidx.car.widget.CompoundButtonListItem.ViewHolder {
ctor public SwitchListItem.ViewHolder(android.view.View);
method public android.widget.TextView getBody();
method public android.widget.CompoundButton getCompoundButton();
method public android.view.View getCompoundButtonDivider();
method public android.view.ViewGroup getContainerLayout();
method public android.widget.ImageView getPrimaryIcon();
method @Deprecated public android.widget.Switch getSwitch();
method public android.widget.TextView getTitle();
method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions);
}
public class TextListItem extends androidx.car.widget.ListItem<androidx.car.widget.TextListItem.ViewHolder> {
ctor public TextListItem(android.content.Context);
method public static androidx.car.widget.TextListItem.ViewHolder createViewHolder(android.view.View!);
method protected android.content.Context getContext();
method public int getViewType();
method public void onBind(androidx.car.widget.TextListItem.ViewHolder!);
method protected void resolveDirtyState();
method public void setBody(CharSequence!);
method public void setEnabled(boolean);
method public void setOnClickListener(android.view.View.OnClickListener!);
method public void setPrimaryActionEmptyIcon();
method public void setPrimaryActionIcon(@DrawableRes int, int);
method public void setPrimaryActionIcon(android.graphics.drawable.Drawable, int);
method public void setPrimaryActionNoIcon();
method public void setSupplementalIcon(@DrawableRes int, boolean);
method public void setSupplementalIcon(android.graphics.drawable.Drawable, boolean);
method public void setSupplementalIcon(@DrawableRes int, boolean, android.view.View.OnClickListener!);
method public void setSupplementalIcon(android.graphics.drawable.Drawable!, boolean, android.view.View.OnClickListener!);
method public void setSupplementalIconOnClickListener(android.view.View.OnClickListener);
method @Deprecated public void setSwitch(boolean, boolean, android.widget.CompoundButton.OnCheckedChangeListener!);
method @Deprecated public void setSwitchState(boolean);
method public void setTitle(CharSequence!);
field public static final int PRIMARY_ACTION_ICON_SIZE_LARGE = 2; // 0x2
field public static final int PRIMARY_ACTION_ICON_SIZE_MEDIUM = 1; // 0x1
field public static final int PRIMARY_ACTION_ICON_SIZE_SMALL = 0; // 0x0
}
public static final class TextListItem.ViewHolder extends androidx.car.widget.ListItem.ViewHolder {
ctor public TextListItem.ViewHolder(android.view.View!);
method public android.widget.TextView getBody();
method public android.view.ViewGroup getContainerLayout();
method public android.widget.ImageView getPrimaryIcon();
method public android.widget.ImageView getSupplementalIcon();
method public android.view.View getSupplementalIconDivider();
method public android.widget.Switch getSwitch();
method public android.view.View getSwitchDivider();
method public android.widget.TextView getTitle();
method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions!);
}
}
| {
"pile_set_name": "Github"
} |
/* Base16 Atelier Savanna Dark - Theme */
/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/savanna) */
/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
/* Atelier-Savanna Comment */
.hljs-comment,
.hljs-quote {
color: #78877d;
}
/* Atelier-Savanna Red */
.hljs-variable,
.hljs-template-variable,
.hljs-attribute,
.hljs-tag,
.hljs-name,
.hljs-regexp,
.hljs-link,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class {
color: #b16139;
}
/* Atelier-Savanna Orange */
.hljs-number,
.hljs-meta,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params {
color: #9f713c;
}
/* Atelier-Savanna Green */
.hljs-string,
.hljs-symbol,
.hljs-bullet {
color: #489963;
}
/* Atelier-Savanna Blue */
.hljs-title,
.hljs-section {
color: #478c90;
}
/* Atelier-Savanna Purple */
.hljs-keyword,
.hljs-selector-tag {
color: #55859b;
}
.hljs-deletion,
.hljs-addition {
color: #171c19;
display: inline-block;
width: 100%;
}
.hljs-deletion {
background-color: #b16139;
}
.hljs-addition {
background-color: #489963;
}
.hljs {
display: block;
overflow-x: auto;
background: #171c19;
color: #87928a;
padding: 0.5em;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
| {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ignite.internal.processors.cache.datastructures.partitioned;
import org.apache.ignite.cache.CacheAtomicityMode;
import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
/**
* Queue multi node test.
*/
public class GridCachePartitionedAtomicQueueMultiNodeSelfTest extends GridCachePartitionedQueueMultiNodeSelfTest {
/** {@inheritDoc} */
@Override protected CacheAtomicityMode collectionCacheAtomicityMode() {
return ATOMIC;
}
}
| {
"pile_set_name": "Github"
} |
package jobapi
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job"
"github.com/Azure/go-autorest/autorest"
"github.com/satori/go.uuid"
)
// ClientAPI contains the set of methods on the Client type.
type ClientAPI interface {
Build(ctx context.Context, accountName string, parameters job.Information) (result job.Information, err error)
Cancel(ctx context.Context, accountName string, jobIdentity uuid.UUID) (result autorest.Response, err error)
Create(ctx context.Context, accountName string, jobIdentity uuid.UUID, parameters job.Information) (result job.Information, err error)
Get(ctx context.Context, accountName string, jobIdentity uuid.UUID) (result job.Information, err error)
GetDebugDataPath(ctx context.Context, accountName string, jobIdentity uuid.UUID) (result job.DataPath, err error)
GetStatistics(ctx context.Context, accountName string, jobIdentity uuid.UUID) (result job.Statistics, err error)
List(ctx context.Context, accountName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (result job.InfoListResultPage, err error)
ListComplete(ctx context.Context, accountName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (result job.InfoListResultIterator, err error)
}
var _ ClientAPI = (*job.Client)(nil)
| {
"pile_set_name": "Github"
} |
/**
* This method returns a new empty array.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {Array} Returns the new empty array.
* @example
*
* var arrays = _.times(2, _.stubArray);
*
* console.log(arrays);
* // => [[], []]
*
* console.log(arrays[0] === arrays[1]);
* // => false
*/
function stubArray() {
return [];
}
module.exports = stubArray;
| {
"pile_set_name": "Github"
} |
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
function write(v) { WScript.Echo(v + ""); }
function foo() {}
write(undefined | undefined);
write(undefined | null);
write(undefined | true);
write(undefined | false);
write(undefined | Boolean(true));
write(undefined | Boolean(false));
write(undefined | new Boolean(true));
write(undefined | new Boolean(false));
write(undefined | NaN);
write(undefined | +0);
write(undefined | -0);
write(undefined | 0);
write(undefined | 0.0);
write(undefined | -0.0);
write(undefined | +0.0);
write(undefined | 1);
write(undefined | 10);
write(undefined | 10.0);
write(undefined | 10.1);
write(undefined | -1);
write(undefined | -10);
write(undefined | -10.0);
write(undefined | -10.1);
write(undefined | Number.MAX_VALUE);
write(undefined | Number.MIN_VALUE);
write(undefined | Number.NaN);
write(undefined | Number.POSITIVE_INFINITY);
write(undefined | Number.NEGATIVE_INFINITY);
write(undefined | new Number(NaN));
write(undefined | new Number(+0));
write(undefined | new Number(-0));
write(undefined | new Number(0));
write(undefined | new Number(0.0));
write(undefined | new Number(-0.0));
write(undefined | new Number(+0.0));
write(undefined | new Number(1));
write(undefined | new Number(10));
write(undefined | new Number(10.0));
write(undefined | new Number(10.1));
write(undefined | new Number(-1));
write(undefined | new Number(-10));
write(undefined | new Number(-10.0));
write(undefined | new Number(-10.1));
write(undefined | new Number(Number.MAX_VALUE));
write(undefined | new Number(Number.MIN_VALUE));
write(undefined | new Number(Number.NaN));
write(undefined | new Number(Number.POSITIVE_INFINITY));
write(undefined | new Number(Number.NEGATIVE_INFINITY));
write(undefined | '');
write(undefined | 0xa);
write(undefined | 04);
write(undefined | 'hello');
write(undefined | 'hel' + 'lo');
write(undefined | String(''));
write(undefined | String('hello'));
write(undefined | String('h' + 'ello'));
write(undefined | new String(''));
write(undefined | new String('hello'));
write(undefined | new String('he' + 'llo'));
write(undefined | new Object());
write(undefined | new Object());
write(undefined | [1, 2, 3]);
write(undefined | [1 ,2 , 3]);
write(undefined | new Array(3));
write(undefined | Array(3));
write(undefined | new Array(1 ,2 ,3));
write(undefined | Array(1));
write(undefined | foo);
write(null | undefined);
write(null | null);
write(null | true);
write(null | false);
write(null | Boolean(true));
write(null | Boolean(false));
write(null | new Boolean(true));
write(null | new Boolean(false));
write(null | NaN);
write(null | +0);
write(null | -0);
write(null | 0);
write(null | 0.0);
write(null | -0.0);
write(null | +0.0);
write(null | 1);
write(null | 10);
write(null | 10.0);
write(null | 10.1);
write(null | -1);
write(null | -10);
write(null | -10.0);
write(null | -10.1);
write(null | Number.MAX_VALUE);
write(null | Number.MIN_VALUE);
write(null | Number.NaN);
write(null | Number.POSITIVE_INFINITY);
write(null | Number.NEGATIVE_INFINITY);
write(null | new Number(NaN));
write(null | new Number(+0));
write(null | new Number(-0));
write(null | new Number(0));
write(null | new Number(0.0));
write(null | new Number(-0.0));
write(null | new Number(+0.0));
write(null | new Number(1));
write(null | new Number(10));
write(null | new Number(10.0));
write(null | new Number(10.1));
write(null | new Number(-1));
write(null | new Number(-10));
write(null | new Number(-10.0));
write(null | new Number(-10.1));
write(null | new Number(Number.MAX_VALUE));
write(null | new Number(Number.MIN_VALUE));
write(null | new Number(Number.NaN));
write(null | new Number(Number.POSITIVE_INFINITY));
write(null | new Number(Number.NEGATIVE_INFINITY));
write(null | '');
write(null | 0xa);
write(null | 04);
write(null | 'hello');
write(null | 'hel' + 'lo');
write(null | String(''));
write(null | String('hello'));
write(null | String('h' + 'ello'));
write(null | new String(''));
write(null | new String('hello'));
write(null | new String('he' + 'llo'));
write(null | new Object());
write(null | new Object());
write(null | [1, 2, 3]);
write(null | [1 ,2 , 3]);
write(null | new Array(3));
write(null | Array(3));
write(null | new Array(1 ,2 ,3));
write(null | Array(1));
write(null | foo);
write(true | undefined);
write(true | null);
write(true | true);
write(true | false);
write(true | Boolean(true));
write(true | Boolean(false));
write(true | new Boolean(true));
write(true | new Boolean(false));
write(true | NaN);
write(true | +0);
write(true | -0);
write(true | 0);
write(true | 0.0);
write(true | -0.0);
write(true | +0.0);
write(true | 1);
write(true | 10);
write(true | 10.0);
write(true | 10.1);
write(true | -1);
write(true | -10);
write(true | -10.0);
write(true | -10.1);
write(true | Number.MAX_VALUE);
write(true | Number.MIN_VALUE);
write(true | Number.NaN);
write(true | Number.POSITIVE_INFINITY);
write(true | Number.NEGATIVE_INFINITY);
write(true | new Number(NaN));
write(true | new Number(+0));
write(true | new Number(-0));
write(true | new Number(0));
write(true | new Number(0.0));
write(true | new Number(-0.0));
write(true | new Number(+0.0));
write(true | new Number(1));
write(true | new Number(10));
write(true | new Number(10.0));
write(true | new Number(10.1));
write(true | new Number(-1));
write(true | new Number(-10));
write(true | new Number(-10.0));
write(true | new Number(-10.1));
write(true | new Number(Number.MAX_VALUE));
write(true | new Number(Number.MIN_VALUE));
write(true | new Number(Number.NaN));
write(true | new Number(Number.POSITIVE_INFINITY));
write(true | new Number(Number.NEGATIVE_INFINITY));
write(true | '');
write(true | 0xa);
write(true | 04);
write(true | 'hello');
write(true | 'hel' + 'lo');
write(true | String(''));
write(true | String('hello'));
write(true | String('h' + 'ello'));
write(true | new String(''));
write(true | new String('hello'));
write(true | new String('he' + 'llo'));
write(true | new Object());
write(true | new Object());
write(true | [1, 2, 3]);
write(true | [1 ,2 , 3]);
write(true | new Array(3));
write(true | Array(3));
write(true | new Array(1 ,2 ,3));
write(true | Array(1));
write(true | foo);
write(false | undefined);
write(false | null);
write(false | true);
write(false | false);
write(false | Boolean(true));
write(false | Boolean(false));
write(false | new Boolean(true));
write(false | new Boolean(false));
write(false | NaN);
write(false | +0);
write(false | -0);
write(false | 0);
write(false | 0.0);
write(false | -0.0);
write(false | +0.0);
write(false | 1);
write(false | 10);
write(false | 10.0);
write(false | 10.1);
write(false | -1);
write(false | -10);
write(false | -10.0);
write(false | -10.1);
write(false | Number.MAX_VALUE);
write(false | Number.MIN_VALUE);
write(false | Number.NaN);
write(false | Number.POSITIVE_INFINITY);
write(false | Number.NEGATIVE_INFINITY);
write(false | new Number(NaN));
write(false | new Number(+0));
write(false | new Number(-0));
write(false | new Number(0));
write(false | new Number(0.0));
write(false | new Number(-0.0));
write(false | new Number(+0.0));
write(false | new Number(1));
write(false | new Number(10));
write(false | new Number(10.0));
write(false | new Number(10.1));
write(false | new Number(-1));
write(false | new Number(-10));
write(false | new Number(-10.0));
write(false | new Number(-10.1));
write(false | new Number(Number.MAX_VALUE));
write(false | new Number(Number.MIN_VALUE));
write(false | new Number(Number.NaN));
write(false | new Number(Number.POSITIVE_INFINITY));
write(false | new Number(Number.NEGATIVE_INFINITY));
write(false | '');
write(false | 0xa);
write(false | 04);
write(false | 'hello');
write(false | 'hel' + 'lo');
write(false | String(''));
write(false | String('hello'));
write(false | String('h' + 'ello'));
write(false | new String(''));
write(false | new String('hello'));
write(false | new String('he' + 'llo'));
write(false | new Object());
write(false | new Object());
write(false | [1, 2, 3]);
write(false | [1 ,2 , 3]);
write(false | new Array(3));
write(false | Array(3));
write(false | new Array(1 ,2 ,3));
write(false | Array(1));
write(false | foo);
write(Boolean(true) | undefined);
write(Boolean(true) | null);
write(Boolean(true) | true);
write(Boolean(true) | false);
write(Boolean(true) | Boolean(true));
write(Boolean(true) | Boolean(false));
write(Boolean(true) | new Boolean(true));
write(Boolean(true) | new Boolean(false));
write(Boolean(true) | NaN);
write(Boolean(true) | +0);
write(Boolean(true) | -0);
write(Boolean(true) | 0);
write(Boolean(true) | 0.0);
write(Boolean(true) | -0.0);
write(Boolean(true) | +0.0);
write(Boolean(true) | 1);
write(Boolean(true) | 10);
write(Boolean(true) | 10.0);
write(Boolean(true) | 10.1);
write(Boolean(true) | -1);
write(Boolean(true) | -10);
write(Boolean(true) | -10.0);
write(Boolean(true) | -10.1);
write(Boolean(true) | Number.MAX_VALUE);
write(Boolean(true) | Number.MIN_VALUE);
write(Boolean(true) | Number.NaN);
write(Boolean(true) | Number.POSITIVE_INFINITY);
write(Boolean(true) | Number.NEGATIVE_INFINITY);
write(Boolean(true) | new Number(NaN));
write(Boolean(true) | new Number(+0));
write(Boolean(true) | new Number(-0));
write(Boolean(true) | new Number(0));
write(Boolean(true) | new Number(0.0));
write(Boolean(true) | new Number(-0.0));
write(Boolean(true) | new Number(+0.0));
write(Boolean(true) | new Number(1));
write(Boolean(true) | new Number(10));
write(Boolean(true) | new Number(10.0));
write(Boolean(true) | new Number(10.1));
write(Boolean(true) | new Number(-1));
write(Boolean(true) | new Number(-10));
write(Boolean(true) | new Number(-10.0));
write(Boolean(true) | new Number(-10.1));
write(Boolean(true) | new Number(Number.MAX_VALUE));
write(Boolean(true) | new Number(Number.MIN_VALUE));
write(Boolean(true) | new Number(Number.NaN));
write(Boolean(true) | new Number(Number.POSITIVE_INFINITY));
write(Boolean(true) | new Number(Number.NEGATIVE_INFINITY));
write(Boolean(true) | '');
write(Boolean(true) | 0xa);
write(Boolean(true) | 04);
write(Boolean(true) | 'hello');
write(Boolean(true) | 'hel' + 'lo');
write(Boolean(true) | String(''));
write(Boolean(true) | String('hello'));
write(Boolean(true) | String('h' + 'ello'));
write(Boolean(true) | new String(''));
write(Boolean(true) | new String('hello'));
write(Boolean(true) | new String('he' + 'llo'));
write(Boolean(true) | new Object());
write(Boolean(true) | new Object());
write(Boolean(true) | [1, 2, 3]);
write(Boolean(true) | [1 ,2 , 3]);
write(Boolean(true) | new Array(3));
write(Boolean(true) | Array(3));
write(Boolean(true) | new Array(1 ,2 ,3));
write(Boolean(true) | Array(1));
write(Boolean(true) | foo);
write(Boolean(false) | undefined);
write(Boolean(false) | null);
write(Boolean(false) | true);
write(Boolean(false) | false);
write(Boolean(false) | Boolean(true));
write(Boolean(false) | Boolean(false));
write(Boolean(false) | new Boolean(true));
write(Boolean(false) | new Boolean(false));
write(Boolean(false) | NaN);
write(Boolean(false) | +0);
write(Boolean(false) | -0);
write(Boolean(false) | 0);
write(Boolean(false) | 0.0);
write(Boolean(false) | -0.0);
write(Boolean(false) | +0.0);
write(Boolean(false) | 1);
write(Boolean(false) | 10);
write(Boolean(false) | 10.0);
write(Boolean(false) | 10.1);
write(Boolean(false) | -1);
write(Boolean(false) | -10);
write(Boolean(false) | -10.0);
write(Boolean(false) | -10.1);
write(Boolean(false) | Number.MAX_VALUE);
write(Boolean(false) | Number.MIN_VALUE);
write(Boolean(false) | Number.NaN);
write(Boolean(false) | Number.POSITIVE_INFINITY);
write(Boolean(false) | Number.NEGATIVE_INFINITY);
write(Boolean(false) | new Number(NaN));
write(Boolean(false) | new Number(+0));
write(Boolean(false) | new Number(-0));
write(Boolean(false) | new Number(0));
write(Boolean(false) | new Number(0.0));
write(Boolean(false) | new Number(-0.0));
write(Boolean(false) | new Number(+0.0));
write(Boolean(false) | new Number(1));
write(Boolean(false) | new Number(10));
write(Boolean(false) | new Number(10.0));
write(Boolean(false) | new Number(10.1));
write(Boolean(false) | new Number(-1));
write(Boolean(false) | new Number(-10));
write(Boolean(false) | new Number(-10.0));
write(Boolean(false) | new Number(-10.1));
write(Boolean(false) | new Number(Number.MAX_VALUE));
write(Boolean(false) | new Number(Number.MIN_VALUE));
write(Boolean(false) | new Number(Number.NaN));
write(Boolean(false) | new Number(Number.POSITIVE_INFINITY));
write(Boolean(false) | new Number(Number.NEGATIVE_INFINITY));
write(Boolean(false) | '');
write(Boolean(false) | 0xa);
write(Boolean(false) | 04);
write(Boolean(false) | 'hello');
write(Boolean(false) | 'hel' + 'lo');
write(Boolean(false) | String(''));
write(Boolean(false) | String('hello'));
write(Boolean(false) | String('h' + 'ello'));
write(Boolean(false) | new String(''));
write(Boolean(false) | new String('hello'));
write(Boolean(false) | new String('he' + 'llo'));
write(Boolean(false) | new Object());
write(Boolean(false) | new Object());
write(Boolean(false) | [1, 2, 3]);
write(Boolean(false) | [1 ,2 , 3]);
write(Boolean(false) | new Array(3));
write(Boolean(false) | Array(3));
write(Boolean(false) | new Array(1 ,2 ,3));
write(Boolean(false) | Array(1));
write(Boolean(false) | foo);
write(new Boolean(true) | undefined);
write(new Boolean(true) | null);
write(new Boolean(true) | true);
write(new Boolean(true) | false);
write(new Boolean(true) | Boolean(true));
write(new Boolean(true) | Boolean(false));
write(new Boolean(true) | new Boolean(true));
write(new Boolean(true) | new Boolean(false));
write(new Boolean(true) | NaN);
write(new Boolean(true) | +0);
write(new Boolean(true) | -0);
write(new Boolean(true) | 0);
write(new Boolean(true) | 0.0);
write(new Boolean(true) | -0.0);
write(new Boolean(true) | +0.0);
write(new Boolean(true) | 1);
write(new Boolean(true) | 10);
write(new Boolean(true) | 10.0);
write(new Boolean(true) | 10.1);
write(new Boolean(true) | -1);
write(new Boolean(true) | -10);
write(new Boolean(true) | -10.0);
write(new Boolean(true) | -10.1);
write(new Boolean(true) | Number.MAX_VALUE);
write(new Boolean(true) | Number.MIN_VALUE);
write(new Boolean(true) | Number.NaN);
write(new Boolean(true) | Number.POSITIVE_INFINITY);
write(new Boolean(true) | Number.NEGATIVE_INFINITY);
write(new Boolean(true) | new Number(NaN));
write(new Boolean(true) | new Number(+0));
write(new Boolean(true) | new Number(-0));
write(new Boolean(true) | new Number(0));
write(new Boolean(true) | new Number(0.0));
write(new Boolean(true) | new Number(-0.0));
write(new Boolean(true) | new Number(+0.0));
write(new Boolean(true) | new Number(1));
write(new Boolean(true) | new Number(10));
write(new Boolean(true) | new Number(10.0));
write(new Boolean(true) | new Number(10.1));
write(new Boolean(true) | new Number(-1));
write(new Boolean(true) | new Number(-10));
write(new Boolean(true) | new Number(-10.0));
write(new Boolean(true) | new Number(-10.1));
write(new Boolean(true) | new Number(Number.MAX_VALUE));
write(new Boolean(true) | new Number(Number.MIN_VALUE));
write(new Boolean(true) | new Number(Number.NaN));
write(new Boolean(true) | new Number(Number.POSITIVE_INFINITY));
write(new Boolean(true) | new Number(Number.NEGATIVE_INFINITY));
write(new Boolean(true) | '');
write(new Boolean(true) | 0xa);
write(new Boolean(true) | 04);
write(new Boolean(true) | 'hello');
write(new Boolean(true) | 'hel' + 'lo');
write(new Boolean(true) | String(''));
write(new Boolean(true) | String('hello'));
write(new Boolean(true) | String('h' + 'ello'));
write(new Boolean(true) | new String(''));
write(new Boolean(true) | new String('hello'));
write(new Boolean(true) | new String('he' + 'llo'));
write(new Boolean(true) | new Object());
write(new Boolean(true) | new Object());
write(new Boolean(true) | [1, 2, 3]);
write(new Boolean(true) | [1 ,2 , 3]);
write(new Boolean(true) | new Array(3));
write(new Boolean(true) | Array(3));
write(new Boolean(true) | new Array(1 ,2 ,3));
write(new Boolean(true) | Array(1));
write(new Boolean(true) | foo);
write(new Boolean(false) | undefined);
write(new Boolean(false) | null);
write(new Boolean(false) | true);
write(new Boolean(false) | false);
write(new Boolean(false) | Boolean(true));
write(new Boolean(false) | Boolean(false));
write(new Boolean(false) | new Boolean(true));
write(new Boolean(false) | new Boolean(false));
write(new Boolean(false) | NaN);
write(new Boolean(false) | +0);
write(new Boolean(false) | -0);
write(new Boolean(false) | 0);
write(new Boolean(false) | 0.0);
write(new Boolean(false) | -0.0);
write(new Boolean(false) | +0.0);
write(new Boolean(false) | 1);
write(new Boolean(false) | 10);
write(new Boolean(false) | 10.0);
write(new Boolean(false) | 10.1);
write(new Boolean(false) | -1);
write(new Boolean(false) | -10);
write(new Boolean(false) | -10.0);
write(new Boolean(false) | -10.1);
write(new Boolean(false) | Number.MAX_VALUE);
write(new Boolean(false) | Number.MIN_VALUE);
write(new Boolean(false) | Number.NaN);
write(new Boolean(false) | Number.POSITIVE_INFINITY);
write(new Boolean(false) | Number.NEGATIVE_INFINITY);
write(new Boolean(false) | new Number(NaN));
write(new Boolean(false) | new Number(+0));
write(new Boolean(false) | new Number(-0));
write(new Boolean(false) | new Number(0));
write(new Boolean(false) | new Number(0.0));
write(new Boolean(false) | new Number(-0.0));
write(new Boolean(false) | new Number(+0.0));
write(new Boolean(false) | new Number(1));
write(new Boolean(false) | new Number(10));
write(new Boolean(false) | new Number(10.0));
write(new Boolean(false) | new Number(10.1));
write(new Boolean(false) | new Number(-1));
write(new Boolean(false) | new Number(-10));
write(new Boolean(false) | new Number(-10.0));
write(new Boolean(false) | new Number(-10.1));
write(new Boolean(false) | new Number(Number.MAX_VALUE));
write(new Boolean(false) | new Number(Number.MIN_VALUE));
write(new Boolean(false) | new Number(Number.NaN));
write(new Boolean(false) | new Number(Number.POSITIVE_INFINITY));
write(new Boolean(false) | new Number(Number.NEGATIVE_INFINITY));
write(new Boolean(false) | '');
write(new Boolean(false) | 0xa);
write(new Boolean(false) | 04);
write(new Boolean(false) | 'hello');
write(new Boolean(false) | 'hel' + 'lo');
write(new Boolean(false) | String(''));
write(new Boolean(false) | String('hello'));
write(new Boolean(false) | String('h' + 'ello'));
write(new Boolean(false) | new String(''));
write(new Boolean(false) | new String('hello'));
write(new Boolean(false) | new String('he' + 'llo'));
write(new Boolean(false) | new Object());
write(new Boolean(false) | new Object());
write(new Boolean(false) | [1, 2, 3]);
write(new Boolean(false) | [1 ,2 , 3]);
write(new Boolean(false) | new Array(3));
write(new Boolean(false) | Array(3));
write(new Boolean(false) | new Array(1 ,2 ,3));
write(new Boolean(false) | Array(1));
write(new Boolean(false) | foo);
write(NaN | undefined);
write(NaN | null);
write(NaN | true);
write(NaN | false);
write(NaN | Boolean(true));
write(NaN | Boolean(false));
write(NaN | new Boolean(true));
write(NaN | new Boolean(false));
write(NaN | NaN);
write(NaN | +0);
write(NaN | -0);
write(NaN | 0);
write(NaN | 0.0);
write(NaN | -0.0);
write(NaN | +0.0);
write(NaN | 1);
write(NaN | 10);
write(NaN | 10.0);
write(NaN | 10.1);
write(NaN | -1);
write(NaN | -10);
write(NaN | -10.0);
write(NaN | -10.1);
write(NaN | Number.MAX_VALUE);
write(NaN | Number.MIN_VALUE);
write(NaN | Number.NaN);
write(NaN | Number.POSITIVE_INFINITY);
write(NaN | Number.NEGATIVE_INFINITY);
write(NaN | new Number(NaN));
write(NaN | new Number(+0));
write(NaN | new Number(-0));
write(NaN | new Number(0));
write(NaN | new Number(0.0));
write(NaN | new Number(-0.0));
write(NaN | new Number(+0.0));
write(NaN | new Number(1));
write(NaN | new Number(10));
write(NaN | new Number(10.0));
write(NaN | new Number(10.1));
write(NaN | new Number(-1));
write(NaN | new Number(-10));
write(NaN | new Number(-10.0));
write(NaN | new Number(-10.1));
write(NaN | new Number(Number.MAX_VALUE));
write(NaN | new Number(Number.MIN_VALUE));
write(NaN | new Number(Number.NaN));
write(NaN | new Number(Number.POSITIVE_INFINITY));
write(NaN | new Number(Number.NEGATIVE_INFINITY));
write(NaN | '');
write(NaN | 0xa);
write(NaN | 04);
write(NaN | 'hello');
write(NaN | 'hel' + 'lo');
write(NaN | String(''));
write(NaN | String('hello'));
write(NaN | String('h' + 'ello'));
write(NaN | new String(''));
write(NaN | new String('hello'));
write(NaN | new String('he' + 'llo'));
write(NaN | new Object());
write(NaN | new Object());
write(NaN | [1, 2, 3]);
write(NaN | [1 ,2 , 3]);
write(NaN | new Array(3));
write(NaN | Array(3));
write(NaN | new Array(1 ,2 ,3));
write(NaN | Array(1));
write(NaN | foo);
write(+0 | undefined);
write(+0 | null);
write(+0 | true);
write(+0 | false);
write(+0 | Boolean(true));
write(+0 | Boolean(false));
write(+0 | new Boolean(true));
write(+0 | new Boolean(false));
write(+0 | NaN);
write(+0 | +0);
write(+0 | -0);
write(+0 | 0);
write(+0 | 0.0);
write(+0 | -0.0);
write(+0 | +0.0);
write(+0 | 1);
write(+0 | 10);
write(+0 | 10.0);
write(+0 | 10.1);
write(+0 | -1);
write(+0 | -10);
write(+0 | -10.0);
write(+0 | -10.1);
write(+0 | Number.MAX_VALUE);
write(+0 | Number.MIN_VALUE);
write(+0 | Number.NaN);
write(+0 | Number.POSITIVE_INFINITY);
write(+0 | Number.NEGATIVE_INFINITY);
write(+0 | new Number(NaN));
write(+0 | new Number(+0));
write(+0 | new Number(-0));
write(+0 | new Number(0));
write(+0 | new Number(0.0));
write(+0 | new Number(-0.0));
write(+0 | new Number(+0.0));
write(+0 | new Number(1));
write(+0 | new Number(10));
write(+0 | new Number(10.0));
write(+0 | new Number(10.1));
write(+0 | new Number(-1));
write(+0 | new Number(-10));
write(+0 | new Number(-10.0));
write(+0 | new Number(-10.1));
write(+0 | new Number(Number.MAX_VALUE));
write(+0 | new Number(Number.MIN_VALUE));
write(+0 | new Number(Number.NaN));
write(+0 | new Number(Number.POSITIVE_INFINITY));
write(+0 | new Number(Number.NEGATIVE_INFINITY));
write(+0 | '');
write(+0 | 0xa);
write(+0 | 04);
write(+0 | 'hello');
write(+0 | 'hel' + 'lo');
write(+0 | String(''));
write(+0 | String('hello'));
write(+0 | String('h' + 'ello'));
write(+0 | new String(''));
write(+0 | new String('hello'));
write(+0 | new String('he' + 'llo'));
write(+0 | new Object());
write(+0 | new Object());
write(+0 | [1, 2, 3]);
write(+0 | [1 ,2 , 3]);
write(+0 | new Array(3));
write(+0 | Array(3));
write(+0 | new Array(1 ,2 ,3));
write(+0 | Array(1));
write(+0 | foo);
write(-0 | undefined);
write(-0 | null);
write(-0 | true);
write(-0 | false);
write(-0 | Boolean(true));
write(-0 | Boolean(false));
write(-0 | new Boolean(true));
write(-0 | new Boolean(false));
write(-0 | NaN);
write(-0 | +0);
write(-0 | -0);
write(-0 | 0);
write(-0 | 0.0);
write(-0 | -0.0);
write(-0 | +0.0);
write(-0 | 1);
write(-0 | 10);
write(-0 | 10.0);
write(-0 | 10.1);
write(-0 | -1);
write(-0 | -10);
write(-0 | -10.0);
write(-0 | -10.1);
write(-0 | Number.MAX_VALUE);
write(-0 | Number.MIN_VALUE);
write(-0 | Number.NaN);
write(-0 | Number.POSITIVE_INFINITY);
write(-0 | Number.NEGATIVE_INFINITY);
write(-0 | new Number(NaN));
write(-0 | new Number(+0));
write(-0 | new Number(-0));
write(-0 | new Number(0));
write(-0 | new Number(0.0));
write(-0 | new Number(-0.0));
write(-0 | new Number(+0.0));
write(-0 | new Number(1));
write(-0 | new Number(10));
write(-0 | new Number(10.0));
write(-0 | new Number(10.1));
write(-0 | new Number(-1));
write(-0 | new Number(-10));
write(-0 | new Number(-10.0));
write(-0 | new Number(-10.1));
write(-0 | new Number(Number.MAX_VALUE));
write(-0 | new Number(Number.MIN_VALUE));
write(-0 | new Number(Number.NaN));
write(-0 | new Number(Number.POSITIVE_INFINITY));
write(-0 | new Number(Number.NEGATIVE_INFINITY));
write(-0 | '');
write(-0 | 0xa);
write(-0 | 04);
write(-0 | 'hello');
write(-0 | 'hel' + 'lo');
write(-0 | String(''));
write(-0 | String('hello'));
write(-0 | String('h' + 'ello'));
write(-0 | new String(''));
write(-0 | new String('hello'));
write(-0 | new String('he' + 'llo'));
write(-0 | new Object());
write(-0 | new Object());
write(-0 | [1, 2, 3]);
write(-0 | [1 ,2 , 3]);
write(-0 | new Array(3));
write(-0 | Array(3));
write(-0 | new Array(1 ,2 ,3));
write(-0 | Array(1));
write(-0 | foo);
write(0 | undefined);
write(0 | null);
write(0 | true);
write(0 | false);
write(0 | Boolean(true));
write(0 | Boolean(false));
write(0 | new Boolean(true));
write(0 | new Boolean(false));
write(0 | NaN);
write(0 | +0);
write(0 | -0);
write(0 | 0);
write(0 | 0.0);
write(0 | -0.0);
write(0 | +0.0);
write(0 | 1);
write(0 | 10);
write(0 | 10.0);
write(0 | 10.1);
write(0 | -1);
write(0 | -10);
write(0 | -10.0);
write(0 | -10.1);
write(0 | Number.MAX_VALUE);
write(0 | Number.MIN_VALUE);
write(0 | Number.NaN);
write(0 | Number.POSITIVE_INFINITY);
write(0 | Number.NEGATIVE_INFINITY);
write(0 | new Number(NaN));
write(0 | new Number(+0));
write(0 | new Number(-0));
write(0 | new Number(0));
write(0 | new Number(0.0));
write(0 | new Number(-0.0));
write(0 | new Number(+0.0));
write(0 | new Number(1));
write(0 | new Number(10));
write(0 | new Number(10.0));
write(0 | new Number(10.1));
write(0 | new Number(-1));
write(0 | new Number(-10));
write(0 | new Number(-10.0));
write(0 | new Number(-10.1));
write(0 | new Number(Number.MAX_VALUE));
write(0 | new Number(Number.MIN_VALUE));
write(0 | new Number(Number.NaN));
write(0 | new Number(Number.POSITIVE_INFINITY));
write(0 | new Number(Number.NEGATIVE_INFINITY));
write(0 | '');
write(0 | 0xa);
write(0 | 04);
write(0 | 'hello');
write(0 | 'hel' + 'lo');
write(0 | String(''));
write(0 | String('hello'));
write(0 | String('h' + 'ello'));
write(0 | new String(''));
write(0 | new String('hello'));
write(0 | new String('he' + 'llo'));
write(0 | new Object());
write(0 | new Object());
write(0 | [1, 2, 3]);
write(0 | [1 ,2 , 3]);
write(0 | new Array(3));
write(0 | Array(3));
write(0 | new Array(1 ,2 ,3));
write(0 | Array(1));
write(0 | foo);
write(0.0 | undefined);
write(0.0 | null);
write(0.0 | true);
write(0.0 | false);
write(0.0 | Boolean(true));
write(0.0 | Boolean(false));
write(0.0 | new Boolean(true));
write(0.0 | new Boolean(false));
write(0.0 | NaN);
write(0.0 | +0);
write(0.0 | -0);
write(0.0 | 0);
write(0.0 | 0.0);
write(0.0 | -0.0);
write(0.0 | +0.0);
write(0.0 | 1);
write(0.0 | 10);
write(0.0 | 10.0);
write(0.0 | 10.1);
write(0.0 | -1);
write(0.0 | -10);
write(0.0 | -10.0);
write(0.0 | -10.1);
write(0.0 | Number.MAX_VALUE);
write(0.0 | Number.MIN_VALUE);
write(0.0 | Number.NaN);
write(0.0 | Number.POSITIVE_INFINITY);
write(0.0 | Number.NEGATIVE_INFINITY);
write(0.0 | new Number(NaN));
write(0.0 | new Number(+0));
write(0.0 | new Number(-0));
write(0.0 | new Number(0));
write(0.0 | new Number(0.0));
write(0.0 | new Number(-0.0));
write(0.0 | new Number(+0.0));
write(0.0 | new Number(1));
write(0.0 | new Number(10));
write(0.0 | new Number(10.0));
write(0.0 | new Number(10.1));
write(0.0 | new Number(-1));
write(0.0 | new Number(-10));
write(0.0 | new Number(-10.0));
write(0.0 | new Number(-10.1));
write(0.0 | new Number(Number.MAX_VALUE));
write(0.0 | new Number(Number.MIN_VALUE));
write(0.0 | new Number(Number.NaN));
write(0.0 | new Number(Number.POSITIVE_INFINITY));
write(0.0 | new Number(Number.NEGATIVE_INFINITY));
write(0.0 | '');
write(0.0 | 0xa);
write(0.0 | 04);
write(0.0 | 'hello');
write(0.0 | 'hel' + 'lo');
write(0.0 | String(''));
write(0.0 | String('hello'));
write(0.0 | String('h' + 'ello'));
write(0.0 | new String(''));
write(0.0 | new String('hello'));
write(0.0 | new String('he' + 'llo'));
write(0.0 | new Object());
write(0.0 | new Object());
write(0.0 | [1, 2, 3]);
write(0.0 | [1 ,2 , 3]);
write(0.0 | new Array(3));
write(0.0 | Array(3));
write(0.0 | new Array(1 ,2 ,3));
write(0.0 | Array(1));
write(0.0 | foo);
write(-0.0 | undefined);
write(-0.0 | null);
write(-0.0 | true);
write(-0.0 | false);
write(-0.0 | Boolean(true));
write(-0.0 | Boolean(false));
write(-0.0 | new Boolean(true));
write(-0.0 | new Boolean(false));
write(-0.0 | NaN);
write(-0.0 | +0);
write(-0.0 | -0);
write(-0.0 | 0);
write(-0.0 | 0.0);
write(-0.0 | -0.0);
write(-0.0 | +0.0);
write(-0.0 | 1);
write(-0.0 | 10);
write(-0.0 | 10.0);
write(-0.0 | 10.1);
write(-0.0 | -1);
write(-0.0 | -10);
write(-0.0 | -10.0);
write(-0.0 | -10.1);
write(-0.0 | Number.MAX_VALUE);
write(-0.0 | Number.MIN_VALUE);
write(-0.0 | Number.NaN);
write(-0.0 | Number.POSITIVE_INFINITY);
write(-0.0 | Number.NEGATIVE_INFINITY);
write(-0.0 | new Number(NaN));
write(-0.0 | new Number(+0));
write(-0.0 | new Number(-0));
write(-0.0 | new Number(0));
write(-0.0 | new Number(0.0));
write(-0.0 | new Number(-0.0));
write(-0.0 | new Number(+0.0));
write(-0.0 | new Number(1));
write(-0.0 | new Number(10));
write(-0.0 | new Number(10.0));
write(-0.0 | new Number(10.1));
write(-0.0 | new Number(-1));
write(-0.0 | new Number(-10));
write(-0.0 | new Number(-10.0));
write(-0.0 | new Number(-10.1));
write(-0.0 | new Number(Number.MAX_VALUE));
write(-0.0 | new Number(Number.MIN_VALUE));
write(-0.0 | new Number(Number.NaN));
write(-0.0 | new Number(Number.POSITIVE_INFINITY));
write(-0.0 | new Number(Number.NEGATIVE_INFINITY));
write(-0.0 | '');
write(-0.0 | 0xa);
write(-0.0 | 04);
write(-0.0 | 'hello');
write(-0.0 | 'hel' + 'lo');
write(-0.0 | String(''));
write(-0.0 | String('hello'));
write(-0.0 | String('h' + 'ello'));
write(-0.0 | new String(''));
write(-0.0 | new String('hello'));
write(-0.0 | new String('he' + 'llo'));
write(-0.0 | new Object());
write(-0.0 | new Object());
write(-0.0 | [1, 2, 3]);
write(-0.0 | [1 ,2 , 3]);
write(-0.0 | new Array(3));
write(-0.0 | Array(3));
write(-0.0 | new Array(1 ,2 ,3));
write(-0.0 | Array(1));
write(-0.0 | foo);
write(+0.0 | undefined);
write(+0.0 | null);
write(+0.0 | true);
write(+0.0 | false);
write(+0.0 | Boolean(true));
write(+0.0 | Boolean(false));
write(+0.0 | new Boolean(true));
write(+0.0 | new Boolean(false));
write(+0.0 | NaN);
write(+0.0 | +0);
write(+0.0 | -0);
write(+0.0 | 0);
write(+0.0 | 0.0);
write(+0.0 | -0.0);
write(+0.0 | +0.0);
write(+0.0 | 1);
write(+0.0 | 10);
write(+0.0 | 10.0);
write(+0.0 | 10.1);
write(+0.0 | -1);
write(+0.0 | -10);
write(+0.0 | -10.0);
write(+0.0 | -10.1);
write(+0.0 | Number.MAX_VALUE);
write(+0.0 | Number.MIN_VALUE);
write(+0.0 | Number.NaN);
write(+0.0 | Number.POSITIVE_INFINITY);
write(+0.0 | Number.NEGATIVE_INFINITY);
write(+0.0 | new Number(NaN));
write(+0.0 | new Number(+0));
write(+0.0 | new Number(-0));
write(+0.0 | new Number(0));
write(+0.0 | new Number(0.0));
write(+0.0 | new Number(-0.0));
write(+0.0 | new Number(+0.0));
write(+0.0 | new Number(1));
write(+0.0 | new Number(10));
write(+0.0 | new Number(10.0));
write(+0.0 | new Number(10.1));
write(+0.0 | new Number(-1));
write(+0.0 | new Number(-10));
write(+0.0 | new Number(-10.0));
write(+0.0 | new Number(-10.1));
write(+0.0 | new Number(Number.MAX_VALUE));
write(+0.0 | new Number(Number.MIN_VALUE));
write(+0.0 | new Number(Number.NaN));
write(+0.0 | new Number(Number.POSITIVE_INFINITY));
write(+0.0 | new Number(Number.NEGATIVE_INFINITY));
| {
"pile_set_name": "Github"
} |
defmodule Cog.Command.Service.Tokens do
@moduledoc """
Manages tokens used to mediate access to services. Each executor
process will obtain a unique, process-specific token, which commands
can use to access the service infrastructure.
Each token is associated to the calling process, which is also
monitored. When the process exits or crashes, the token is
automatically invalidated, preventing its further use.
"""
use GenServer
import Cog.Command.Service.PipelineMonitor
alias Cog.Util.ETSWrapper
require Logger
@dead_pipeline_cleanup_interval 30000 # 30 seconds
defstruct [:token_table, :monitor_table]
@doc """
Starts the #{inspect __MODULE__} service. Accepts two public ets table
ids: one for storing tokens and keeping track of monitored pids.
"""
def start_link(token_table, monitor_table),
do: GenServer.start_link(__MODULE__, [token_table, monitor_table], name: __MODULE__)
@doc """
Create a new service token, registered to the calling process.
"""
def new,
do: GenServer.call(__MODULE__, :new)
@doc """
Given a service token, obtain the process that registered it.
"""
def process_for_token(token),
do: GenServer.call(__MODULE__, {:process, token})
########################################################################
# GenServer Implementation
def init([token_table, monitor_table]) do
account_for_existing_pipelines(monitor_table, token_table)
schedule_dead_pipeline_cleanup(@dead_pipeline_cleanup_interval)
state = %__MODULE__{token_table: token_table, monitor_table: monitor_table}
{:ok, state}
end
def handle_call(:new, {pid, _ref}, state) do
result = case ETSWrapper.lookup(state.monitor_table, pid) do
{:ok, _pid} ->
{:error, :token_already_exists}
{:error, :unknown_key} ->
token = generate_token()
ETSWrapper.insert(state.token_table, token, pid)
monitor_pipeline(state.monitor_table, token, pid)
token
end
{:reply, result, state}
end
def handle_call({:process, token}, _from, state) do
result = case ETSWrapper.lookup(state.token_table, token) do
{:ok, pid} ->
pid
{:error, :unknown_key} ->
{:error, :unknown_token}
end
{:reply, result, state}
end
def handle_info({:DOWN, _monitor_ref, :process, pid, _reason}, state) do
case ETSWrapper.lookup(state.monitor_table, pid) do
{:ok, token} ->
cleanup_pipeline(state.monitor_table, state.token_table, pid, token)
{:error, :unknown_key} ->
Logger.warn("Unknown pid #{inspect pid} was monitored; ignoring")
end
{:noreply, state}
end
def handle_info(:dead_process_cleanup, state) do
dead_pipeline_cleanup(state.monitor_table, state.token_table)
schedule_dead_pipeline_cleanup(@dead_pipeline_cleanup_interval)
{:noreply, state}
end
########################################################################
# Helper Functions
defp generate_token,
do: UUID.uuid4(:hex)
end
| {
"pile_set_name": "Github"
} |
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package os
import (
"io"
"syscall"
)
func (file *File) readdir(n int) ([]FileInfo, error) {
// If this file has no dirinfo, create one.
if file.dirinfo == nil {
file.dirinfo = new(dirInfo)
}
d := file.dirinfo
size := n
if size <= 0 {
size = 100
n = -1
}
fi := make([]FileInfo, 0, size) // Empty with room to grow.
for n != 0 {
// Refill the buffer if necessary.
if d.bufp >= d.nbuf {
nb, err := file.Read(d.buf[:])
// Update the buffer state before checking for errors.
d.bufp, d.nbuf = 0, nb
if err != nil {
if err == io.EOF {
break
}
return fi, &PathError{"readdir", file.name, err}
}
if nb < syscall.STATFIXLEN {
return fi, &PathError{"readdir", file.name, syscall.ErrShortStat}
}
}
// Get a record from the buffer.
b := d.buf[d.bufp:]
m := int(uint16(b[0])|uint16(b[1])<<8) + 2
if m < syscall.STATFIXLEN {
return fi, &PathError{"readdir", file.name, syscall.ErrShortStat}
}
dir, err := syscall.UnmarshalDir(b[:m])
if err != nil {
return fi, &PathError{"readdir", file.name, err}
}
fi = append(fi, fileInfoFromStat(dir))
d.bufp += m
n--
}
if n >= 0 && len(fi) == 0 {
return fi, io.EOF
}
return fi, nil
}
func (file *File) readdirnames(n int) (names []string, err error) {
fi, err := file.Readdir(n)
names = make([]string, len(fi))
for i := range fi {
names[i] = fi[i].Name()
}
return
}
| {
"pile_set_name": "Github"
} |
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package openpgp
import (
"crypto/rsa"
"io"
"time"
"golang.org/x/crypto/openpgp/armor"
"golang.org/x/crypto/openpgp/errors"
"golang.org/x/crypto/openpgp/packet"
)
// PublicKeyType is the armor type for a PGP public key.
var PublicKeyType = "PGP PUBLIC KEY BLOCK"
// PrivateKeyType is the armor type for a PGP private key.
var PrivateKeyType = "PGP PRIVATE KEY BLOCK"
// An Entity represents the components of an OpenPGP key: a primary public key
// (which must be a signing key), one or more identities claimed by that key,
// and zero or more subkeys, which may be encryption keys.
type Entity struct {
PrimaryKey *packet.PublicKey
PrivateKey *packet.PrivateKey
Identities map[string]*Identity // indexed by Identity.Name
Revocations []*packet.Signature
Subkeys []Subkey
}
// An Identity represents an identity claimed by an Entity and zero or more
// assertions by other entities about that claim.
type Identity struct {
Name string // by convention, has the form "Full Name (comment) <[email protected]>"
UserId *packet.UserId
SelfSignature *packet.Signature
Signatures []*packet.Signature
}
// A Subkey is an additional public key in an Entity. Subkeys can be used for
// encryption.
type Subkey struct {
PublicKey *packet.PublicKey
PrivateKey *packet.PrivateKey
Sig *packet.Signature
}
// A Key identifies a specific public key in an Entity. This is either the
// Entity's primary key or a subkey.
type Key struct {
Entity *Entity
PublicKey *packet.PublicKey
PrivateKey *packet.PrivateKey
SelfSignature *packet.Signature
}
// A KeyRing provides access to public and private keys.
type KeyRing interface {
// KeysById returns the set of keys that have the given key id.
KeysById(id uint64) []Key
// KeysByIdAndUsage returns the set of keys with the given id
// that also meet the key usage given by requiredUsage.
// The requiredUsage is expressed as the bitwise-OR of
// packet.KeyFlag* values.
KeysByIdUsage(id uint64, requiredUsage byte) []Key
// DecryptionKeys returns all private keys that are valid for
// decryption.
DecryptionKeys() []Key
}
// primaryIdentity returns the Identity marked as primary or the first identity
// if none are so marked.
func (e *Entity) primaryIdentity() *Identity {
var firstIdentity *Identity
for _, ident := range e.Identities {
if firstIdentity == nil {
firstIdentity = ident
}
if ident.SelfSignature.IsPrimaryId != nil && *ident.SelfSignature.IsPrimaryId {
return ident
}
}
return firstIdentity
}
// encryptionKey returns the best candidate Key for encrypting a message to the
// given Entity.
func (e *Entity) encryptionKey(now time.Time) (Key, bool) {
candidateSubkey := -1
// Iterate the keys to find the newest key
var maxTime time.Time
for i, subkey := range e.Subkeys {
if subkey.Sig.FlagsValid &&
subkey.Sig.FlagEncryptCommunications &&
subkey.PublicKey.PubKeyAlgo.CanEncrypt() &&
!subkey.Sig.KeyExpired(now) &&
(maxTime.IsZero() || subkey.Sig.CreationTime.After(maxTime)) {
candidateSubkey = i
maxTime = subkey.Sig.CreationTime
}
}
if candidateSubkey != -1 {
subkey := e.Subkeys[candidateSubkey]
return Key{e, subkey.PublicKey, subkey.PrivateKey, subkey.Sig}, true
}
// If we don't have any candidate subkeys for encryption and
// the primary key doesn't have any usage metadata then we
// assume that the primary key is ok. Or, if the primary key is
// marked as ok to encrypt to, then we can obviously use it.
i := e.primaryIdentity()
if !i.SelfSignature.FlagsValid || i.SelfSignature.FlagEncryptCommunications &&
e.PrimaryKey.PubKeyAlgo.CanEncrypt() &&
!i.SelfSignature.KeyExpired(now) {
return Key{e, e.PrimaryKey, e.PrivateKey, i.SelfSignature}, true
}
// This Entity appears to be signing only.
return Key{}, false
}
// signingKey return the best candidate Key for signing a message with this
// Entity.
func (e *Entity) signingKey(now time.Time) (Key, bool) {
candidateSubkey := -1
for i, subkey := range e.Subkeys {
if subkey.Sig.FlagsValid &&
subkey.Sig.FlagSign &&
subkey.PublicKey.PubKeyAlgo.CanSign() &&
!subkey.Sig.KeyExpired(now) {
candidateSubkey = i
break
}
}
if candidateSubkey != -1 {
subkey := e.Subkeys[candidateSubkey]
return Key{e, subkey.PublicKey, subkey.PrivateKey, subkey.Sig}, true
}
// If we have no candidate subkey then we assume that it's ok to sign
// with the primary key.
i := e.primaryIdentity()
if !i.SelfSignature.FlagsValid || i.SelfSignature.FlagSign &&
!i.SelfSignature.KeyExpired(now) {
return Key{e, e.PrimaryKey, e.PrivateKey, i.SelfSignature}, true
}
return Key{}, false
}
// An EntityList contains one or more Entities.
type EntityList []*Entity
// KeysById returns the set of keys that have the given key id.
func (el EntityList) KeysById(id uint64) (keys []Key) {
for _, e := range el {
if e.PrimaryKey.KeyId == id {
var selfSig *packet.Signature
for _, ident := range e.Identities {
if selfSig == nil {
selfSig = ident.SelfSignature
} else if ident.SelfSignature.IsPrimaryId != nil && *ident.SelfSignature.IsPrimaryId {
selfSig = ident.SelfSignature
break
}
}
keys = append(keys, Key{e, e.PrimaryKey, e.PrivateKey, selfSig})
}
for _, subKey := range e.Subkeys {
if subKey.PublicKey.KeyId == id {
keys = append(keys, Key{e, subKey.PublicKey, subKey.PrivateKey, subKey.Sig})
}
}
}
return
}
// KeysByIdAndUsage returns the set of keys with the given id that also meet
// the key usage given by requiredUsage. The requiredUsage is expressed as
// the bitwise-OR of packet.KeyFlag* values.
func (el EntityList) KeysByIdUsage(id uint64, requiredUsage byte) (keys []Key) {
for _, key := range el.KeysById(id) {
if len(key.Entity.Revocations) > 0 {
continue
}
if key.SelfSignature.RevocationReason != nil {
continue
}
if key.SelfSignature.FlagsValid && requiredUsage != 0 {
var usage byte
if key.SelfSignature.FlagCertify {
usage |= packet.KeyFlagCertify
}
if key.SelfSignature.FlagSign {
usage |= packet.KeyFlagSign
}
if key.SelfSignature.FlagEncryptCommunications {
usage |= packet.KeyFlagEncryptCommunications
}
if key.SelfSignature.FlagEncryptStorage {
usage |= packet.KeyFlagEncryptStorage
}
if usage&requiredUsage != requiredUsage {
continue
}
}
keys = append(keys, key)
}
return
}
// DecryptionKeys returns all private keys that are valid for decryption.
func (el EntityList) DecryptionKeys() (keys []Key) {
for _, e := range el {
for _, subKey := range e.Subkeys {
if subKey.PrivateKey != nil && (!subKey.Sig.FlagsValid || subKey.Sig.FlagEncryptStorage || subKey.Sig.FlagEncryptCommunications) {
keys = append(keys, Key{e, subKey.PublicKey, subKey.PrivateKey, subKey.Sig})
}
}
}
return
}
// ReadArmoredKeyRing reads one or more public/private keys from an armor keyring file.
func ReadArmoredKeyRing(r io.Reader) (EntityList, error) {
block, err := armor.Decode(r)
if err == io.EOF {
return nil, errors.InvalidArgumentError("no armored data found")
}
if err != nil {
return nil, err
}
if block.Type != PublicKeyType && block.Type != PrivateKeyType {
return nil, errors.InvalidArgumentError("expected public or private key block, got: " + block.Type)
}
return ReadKeyRing(block.Body)
}
// ReadKeyRing reads one or more public/private keys. Unsupported keys are
// ignored as long as at least a single valid key is found.
func ReadKeyRing(r io.Reader) (el EntityList, err error) {
packets := packet.NewReader(r)
var lastUnsupportedError error
for {
var e *Entity
e, err = ReadEntity(packets)
if err != nil {
// TODO: warn about skipped unsupported/unreadable keys
if _, ok := err.(errors.UnsupportedError); ok {
lastUnsupportedError = err
err = readToNextPublicKey(packets)
} else if _, ok := err.(errors.StructuralError); ok {
// Skip unreadable, badly-formatted keys
lastUnsupportedError = err
err = readToNextPublicKey(packets)
}
if err == io.EOF {
err = nil
break
}
if err != nil {
el = nil
break
}
} else {
el = append(el, e)
}
}
if len(el) == 0 && err == nil {
err = lastUnsupportedError
}
return
}
// readToNextPublicKey reads packets until the start of the entity and leaves
// the first packet of the new entity in the Reader.
func readToNextPublicKey(packets *packet.Reader) (err error) {
var p packet.Packet
for {
p, err = packets.Next()
if err == io.EOF {
return
} else if err != nil {
if _, ok := err.(errors.UnsupportedError); ok {
err = nil
continue
}
return
}
if pk, ok := p.(*packet.PublicKey); ok && !pk.IsSubkey {
packets.Unread(p)
return
}
}
}
// ReadEntity reads an entity (public key, identities, subkeys etc) from the
// given Reader.
func ReadEntity(packets *packet.Reader) (*Entity, error) {
e := new(Entity)
e.Identities = make(map[string]*Identity)
p, err := packets.Next()
if err != nil {
return nil, err
}
var ok bool
if e.PrimaryKey, ok = p.(*packet.PublicKey); !ok {
if e.PrivateKey, ok = p.(*packet.PrivateKey); !ok {
packets.Unread(p)
return nil, errors.StructuralError("first packet was not a public/private key")
} else {
e.PrimaryKey = &e.PrivateKey.PublicKey
}
}
if !e.PrimaryKey.PubKeyAlgo.CanSign() {
return nil, errors.StructuralError("primary key cannot be used for signatures")
}
var current *Identity
var revocations []*packet.Signature
EachPacket:
for {
p, err := packets.Next()
if err == io.EOF {
break
} else if err != nil {
return nil, err
}
switch pkt := p.(type) {
case *packet.UserId:
current = new(Identity)
current.Name = pkt.Id
current.UserId = pkt
e.Identities[pkt.Id] = current
for {
p, err = packets.Next()
if err == io.EOF {
return nil, io.ErrUnexpectedEOF
} else if err != nil {
return nil, err
}
sig, ok := p.(*packet.Signature)
if !ok {
return nil, errors.StructuralError("user ID packet not followed by self-signature")
}
if (sig.SigType == packet.SigTypePositiveCert || sig.SigType == packet.SigTypeGenericCert) && sig.IssuerKeyId != nil && *sig.IssuerKeyId == e.PrimaryKey.KeyId {
if err = e.PrimaryKey.VerifyUserIdSignature(pkt.Id, e.PrimaryKey, sig); err != nil {
return nil, errors.StructuralError("user ID self-signature invalid: " + err.Error())
}
current.SelfSignature = sig
break
}
current.Signatures = append(current.Signatures, sig)
}
case *packet.Signature:
if pkt.SigType == packet.SigTypeKeyRevocation {
revocations = append(revocations, pkt)
} else if pkt.SigType == packet.SigTypeDirectSignature {
// TODO: RFC4880 5.2.1 permits signatures
// directly on keys (eg. to bind additional
// revocation keys).
} else if current == nil {
return nil, errors.StructuralError("signature packet found before user id packet")
} else {
current.Signatures = append(current.Signatures, pkt)
}
case *packet.PrivateKey:
if pkt.IsSubkey == false {
packets.Unread(p)
break EachPacket
}
err = addSubkey(e, packets, &pkt.PublicKey, pkt)
if err != nil {
return nil, err
}
case *packet.PublicKey:
if pkt.IsSubkey == false {
packets.Unread(p)
break EachPacket
}
err = addSubkey(e, packets, pkt, nil)
if err != nil {
return nil, err
}
default:
// we ignore unknown packets
}
}
if len(e.Identities) == 0 {
return nil, errors.StructuralError("entity without any identities")
}
for _, revocation := range revocations {
err = e.PrimaryKey.VerifyRevocationSignature(revocation)
if err == nil {
e.Revocations = append(e.Revocations, revocation)
} else {
// TODO: RFC 4880 5.2.3.15 defines revocation keys.
return nil, errors.StructuralError("revocation signature signed by alternate key")
}
}
return e, nil
}
func addSubkey(e *Entity, packets *packet.Reader, pub *packet.PublicKey, priv *packet.PrivateKey) error {
var subKey Subkey
subKey.PublicKey = pub
subKey.PrivateKey = priv
p, err := packets.Next()
if err == io.EOF {
return io.ErrUnexpectedEOF
}
if err != nil {
return errors.StructuralError("subkey signature invalid: " + err.Error())
}
var ok bool
subKey.Sig, ok = p.(*packet.Signature)
if !ok {
return errors.StructuralError("subkey packet not followed by signature")
}
if subKey.Sig.SigType != packet.SigTypeSubkeyBinding && subKey.Sig.SigType != packet.SigTypeSubkeyRevocation {
return errors.StructuralError("subkey signature with wrong type")
}
err = e.PrimaryKey.VerifyKeySignature(subKey.PublicKey, subKey.Sig)
if err != nil {
return errors.StructuralError("subkey signature invalid: " + err.Error())
}
e.Subkeys = append(e.Subkeys, subKey)
return nil
}
const defaultRSAKeyBits = 2048
// NewEntity returns an Entity that contains a fresh RSA/RSA keypair with a
// single identity composed of the given full name, comment and email, any of
// which may be empty but must not contain any of "()<>\x00".
// If config is nil, sensible defaults will be used.
func NewEntity(name, comment, email string, config *packet.Config) (*Entity, error) {
currentTime := config.Now()
bits := defaultRSAKeyBits
if config != nil && config.RSABits != 0 {
bits = config.RSABits
}
uid := packet.NewUserId(name, comment, email)
if uid == nil {
return nil, errors.InvalidArgumentError("user id field contained invalid characters")
}
signingPriv, err := rsa.GenerateKey(config.Random(), bits)
if err != nil {
return nil, err
}
encryptingPriv, err := rsa.GenerateKey(config.Random(), bits)
if err != nil {
return nil, err
}
e := &Entity{
PrimaryKey: packet.NewRSAPublicKey(currentTime, &signingPriv.PublicKey),
PrivateKey: packet.NewRSAPrivateKey(currentTime, signingPriv),
Identities: make(map[string]*Identity),
}
isPrimaryId := true
e.Identities[uid.Id] = &Identity{
Name: uid.Name,
UserId: uid,
SelfSignature: &packet.Signature{
CreationTime: currentTime,
SigType: packet.SigTypePositiveCert,
PubKeyAlgo: packet.PubKeyAlgoRSA,
Hash: config.Hash(),
IsPrimaryId: &isPrimaryId,
FlagsValid: true,
FlagSign: true,
FlagCertify: true,
IssuerKeyId: &e.PrimaryKey.KeyId,
},
}
// If the user passes in a DefaultHash via packet.Config,
// set the PreferredHash for the SelfSignature.
if config != nil && config.DefaultHash != 0 {
e.Identities[uid.Id].SelfSignature.PreferredHash = []uint8{hashToHashId(config.DefaultHash)}
}
e.Subkeys = make([]Subkey, 1)
e.Subkeys[0] = Subkey{
PublicKey: packet.NewRSAPublicKey(currentTime, &encryptingPriv.PublicKey),
PrivateKey: packet.NewRSAPrivateKey(currentTime, encryptingPriv),
Sig: &packet.Signature{
CreationTime: currentTime,
SigType: packet.SigTypeSubkeyBinding,
PubKeyAlgo: packet.PubKeyAlgoRSA,
Hash: config.Hash(),
FlagsValid: true,
FlagEncryptStorage: true,
FlagEncryptCommunications: true,
IssuerKeyId: &e.PrimaryKey.KeyId,
},
}
e.Subkeys[0].PublicKey.IsSubkey = true
e.Subkeys[0].PrivateKey.IsSubkey = true
return e, nil
}
// SerializePrivate serializes an Entity, including private key material, to
// the given Writer. For now, it must only be used on an Entity returned from
// NewEntity.
// If config is nil, sensible defaults will be used.
func (e *Entity) SerializePrivate(w io.Writer, config *packet.Config) (err error) {
err = e.PrivateKey.Serialize(w)
if err != nil {
return
}
for _, ident := range e.Identities {
err = ident.UserId.Serialize(w)
if err != nil {
return
}
err = ident.SelfSignature.SignUserId(ident.UserId.Id, e.PrimaryKey, e.PrivateKey, config)
if err != nil {
return
}
err = ident.SelfSignature.Serialize(w)
if err != nil {
return
}
}
for _, subkey := range e.Subkeys {
err = subkey.PrivateKey.Serialize(w)
if err != nil {
return
}
err = subkey.Sig.SignKey(subkey.PublicKey, e.PrivateKey, config)
if err != nil {
return
}
err = subkey.Sig.Serialize(w)
if err != nil {
return
}
}
return nil
}
// Serialize writes the public part of the given Entity to w. (No private
// key material will be output).
func (e *Entity) Serialize(w io.Writer) error {
err := e.PrimaryKey.Serialize(w)
if err != nil {
return err
}
for _, ident := range e.Identities {
err = ident.UserId.Serialize(w)
if err != nil {
return err
}
err = ident.SelfSignature.Serialize(w)
if err != nil {
return err
}
for _, sig := range ident.Signatures {
err = sig.Serialize(w)
if err != nil {
return err
}
}
}
for _, subkey := range e.Subkeys {
err = subkey.PublicKey.Serialize(w)
if err != nil {
return err
}
err = subkey.Sig.Serialize(w)
if err != nil {
return err
}
}
return nil
}
// SignIdentity adds a signature to e, from signer, attesting that identity is
// associated with e. The provided identity must already be an element of
// e.Identities and the private key of signer must have been decrypted if
// necessary.
// If config is nil, sensible defaults will be used.
func (e *Entity) SignIdentity(identity string, signer *Entity, config *packet.Config) error {
if signer.PrivateKey == nil {
return errors.InvalidArgumentError("signing Entity must have a private key")
}
if signer.PrivateKey.Encrypted {
return errors.InvalidArgumentError("signing Entity's private key must be decrypted")
}
ident, ok := e.Identities[identity]
if !ok {
return errors.InvalidArgumentError("given identity string not found in Entity")
}
sig := &packet.Signature{
SigType: packet.SigTypeGenericCert,
PubKeyAlgo: signer.PrivateKey.PubKeyAlgo,
Hash: config.Hash(),
CreationTime: config.Now(),
IssuerKeyId: &signer.PrivateKey.KeyId,
}
if err := sig.SignUserId(identity, e.PrimaryKey, signer.PrivateKey, config); err != nil {
return err
}
ident.Signatures = append(ident.Signatures, sig)
return nil
}
| {
"pile_set_name": "Github"
} |
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { by, ElementFinder, Locator, protractor } from 'protractor';
import { BrowserActions } from '../../../core/utils/browser-actions';
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
export class NumberRangeFilterPage {
fromInput: Locator = by.css('input[data-automation-id="number-range-from-input"]');
toInput: Locator = by.css('input[data-automation-id="number-range-to-input"]');
applyButton: Locator = by.css('button[data-automation-id="number-range-btn-apply"]');
clearButton: Locator = by.css('button[data-automation-id="number-range-btn-clear"]');
fromErrorInvalid: Locator = by.css('mat-error[data-automation-id="number-range-from-error-invalid"]');
fromErrorRequired: Locator = by.css('mat-error[data-automation-id="number-range-from-error-required"]');
toErrorInvalid: Locator = by.css('mat-error[data-automation-id="number-range-to-error-invalid"]');
toErrorRequired: Locator = by.css('mat-error[data-automation-id="number-range-to-error-required"]');
filter: ElementFinder;
constructor(filter: ElementFinder) {
this.filter = filter;
}
async clearFromField(): Promise<void> {
await BrowserVisibility.waitUntilElementIsClickable(this.filter.element(this.fromInput));
await BrowserActions.clearWithBackSpace(this.filter.element(this.fromInput));
}
async getFromNumber(): Promise<string> {
return this.filter.element(this.fromInput).getAttribute('value');
}
async putFromNumber(value): Promise<void> {
await this.checkFromFieldIsDisplayed();
await BrowserActions.clearSendKeys(this.filter.element(this.fromInput), value);
await this.filter.element(this.fromInput).sendKeys(protractor.Key.ENTER);
}
async getFromErrorRequired(): Promise<string> {
return BrowserActions.getText(this.filter.element(this.fromErrorRequired));
}
async checkFromErrorRequiredIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.fromErrorRequired));
}
async getFromErrorInvalid(): Promise<string> {
return BrowserActions.getText(this.filter.element(this.fromErrorInvalid));
}
async checkFromErrorInvalidIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.fromErrorInvalid));
}
async checkFromFieldIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.fromInput));
}
async clearToField(): Promise<void> {
await BrowserVisibility.waitUntilElementIsClickable(this.filter.element(this.toInput));
await BrowserActions.clearWithBackSpace(this.filter.element(this.toInput));
}
async getToNumber(): Promise<string> {
return this.filter.element(this.toInput).getAttribute('value');
}
async putToNumber(value): Promise<void> {
await this.checkToFieldIsDisplayed();
await BrowserActions.clearSendKeys(this.filter.element(this.toInput), value);
await this.filter.element(this.toInput).sendKeys(protractor.Key.ENTER);
}
async getToErrorRequired(): Promise<string> {
return BrowserActions.getText(this.filter.element(this.toErrorRequired));
}
async checkToErrorRequiredIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.toErrorRequired));
}
async getToErrorInvalid(): Promise<string> {
return BrowserActions.getText(this.filter.element(this.toErrorInvalid));
}
async checkToErrorInvalidIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.toErrorInvalid));
}
async checkToFieldIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.toInput));
}
async clickApplyButton(): Promise<void> {
await BrowserActions.click(this.filter.element(this.applyButton));
}
async checkApplyButtonIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.applyButton));
}
async checkApplyButtonIsEnabled(): Promise<boolean> {
return this.filter.element(this.applyButton).isEnabled();
}
async clickClearButton(): Promise<void> {
await BrowserActions.click(this.filter.element(this.clearButton));
}
async checkClearButtonIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.clearButton));
}
async checkNoErrorMessageIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.fromErrorInvalid));
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.fromErrorRequired));
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.toErrorInvalid));
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.toErrorRequired));
}
}
| {
"pile_set_name": "Github"
} |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using System;
using System.ComponentModel.Composition;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Reflection;
using Microsoft.Common.Core;
using Microsoft.Common.Core.Shell;
using Microsoft.R.Components.Sql.Publish;
using Microsoft.VisualStudio.Utilities;
namespace Microsoft.VisualStudio.R.Package.Sql.Publish {
[Export(typeof(IDacPackageServicesProvider))]
internal sealed class DacPackageServicesProvider: IDacPackageServicesProvider {
private readonly ICoreShell _coreShell;
private readonly IFileExtensionRegistryService _fers;
private readonly IContentTypeRegistryService _ctrs;
[ImportingConstructor]
public DacPackageServicesProvider(ICoreShell coreShell, IFileExtensionRegistryService fers, IContentTypeRegistryService ctrs) {
_coreShell = coreShell;
_fers = fers;
_ctrs = ctrs;
}
public IDacPackageServices GetDacPackageServices(bool showMessage = false) {
if(IsSqlToolsInstalled()) {
return TryGetDacServices();
} else {
var message = Resources.SqlPublish_NoSqlToolsVS15;
_coreShell.ShowErrorMessage(message);
}
return null;
}
private bool IsSqlToolsInstalled() {
bool installed = false;
// Try modern registration first
var ct = _fers.GetContentTypeForExtension(".sql");
if (ct != null && ct != _ctrs.UnknownContentType) {
installed = true;
} else {
// Fall back to IVs* type of registration
ct = _ctrs.GetContentType("SQL Server Tools");
installed = ct != null && ct != _ctrs.UnknownContentType;
}
return installed;
}
[SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", MessageId = "System.Reflection.Assembly.LoadFrom",
Justification = "Need to be able to load dynamically since SQL Tools may not be present")]
private IDacPackageServices TryGetDacServices() {
var thisAssemblyPath = Assembly.GetExecutingAssembly().GetAssemblyPath();
var directory = Path.GetDirectoryName(thisAssemblyPath);
var rSqlAssembly = Assembly.LoadFrom(Path.Combine(directory, "Microsoft.VisualStudio.R.Sql.dll"));
var type = rSqlAssembly.GetTypes().FirstOrDefault(t => typeof(IDacPackageServices).IsAssignableFrom(t));
return (IDacPackageServices)Activator.CreateInstance(type);
}
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-parent</artifactId>
<version>2.7.0-SNAPSHOT</version>
</parent>
<artifactId>spring-cloud-dataflow-classic-docs</artifactId>
<name>Spring Cloud Data Flow Docs for Classic mode</name>
<description>Spring Cloud Data Flow Docs for Classic Mode</description>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-configuration-metadata</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-registry</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-rest-resource</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-server-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-rest-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-shell-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-completion</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-dataflow-server</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.restdocs</groupId>
<artifactId>spring-restdocs-mockmvc</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.restdocs</groupId>
<artifactId>spring-restdocs-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-task-batch</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<reuseForks>false</reuseForks>
<includes>
<include>**/*Documentation.java</include>
<include>**/*Tests.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</project>
| {
"pile_set_name": "Github"
} |
require 'spec_helper'
require 'puppet/node'
require 'puppet/indirector/memory'
require 'puppet/indirector/facts/store_configs'
class Puppet::Node::Facts::StoreConfigsTesting < Puppet::Indirector::Memory
end
describe Puppet::Node::Facts::StoreConfigs do
after :all do
Puppet::Node::Facts.indirection.reset_terminus_class
Puppet::Node::Facts.indirection.cache_class = nil
end
it_should_behave_like "a StoreConfigs terminus"
end
| {
"pile_set_name": "Github"
} |
# 现实可以有多美好?
## 作者: 田浩 赞同: 9345
一个制毒者,凌晨被我们抓到,家里全是「制毒原料」,还有一台蒸馏机,几个塑料桶,我们进去的时候他还拿着棍子在桶里搅。被抓到当时情绪就崩溃了,说自己只是个木匠,
一时鬼迷心窍才去缅甸买了这些机器和原料,并表示认罪,愿意积极配合,问我们能不能不死。说实话,按他的数量,少说几十公斤,虽然嘴上应承着,但心里觉得他死定了。
我们把人和东西抓回去之后,化验毒品,神转折是,发现他的制毒的原料和机器全是假的。去境外被人骗了。
最后是算预备犯罪还是犯罪未遂我忘记了,反正关了不到一年就放出来了。
对他来说,这现实简直太美好啦。
#### 原链接: http://www.zhihu.com/question/24269892/answer/29960616 | {
"pile_set_name": "Github"
} |
= nng_alloc(3)
//
// Copyright 2018 Staysail Systems, Inc. <[email protected]>
// Copyright 2018 Capitar IT Group BV <[email protected]>
//
// This document is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
// file was obtained (LICENSE.txt). A copy of the license may also be
// found online at https://opensource.org/licenses/MIT.
//
== NAME
nng_alloc - allocate memory
== SYNOPSIS
[source, c]
----
#include <nng/nng.h>
void *nng_alloc(size_t size);
----
== DESCRIPTION
The `nng_alloc()` function allocates a contiguous memory region of
at least _size_ bytes.
The memory will be 64-bit aligned.
The returned memory can be used to hold message buffers, in which
case it can be directly passed to xref:nng_send.3.adoc[`nng_send()`] using
the flag `NNG_FLAG_ALLOC`. Alternatively, it can be freed when no
longer needed using xref:nng_free.3.adoc[`nng_free()`].
IMPORTANT: Do not use the system `free()` function to release this memory.
On some platforms this may work, but it is not guaranteed and may lead
to a crash or other undesirable and unpredictable behavior.
== RETURN VALUES
This function returns a pointer to the allocated memory on success,
and `NULL` otherwise.
== ERRORS
No errors are returned, but a `NULL` return value should be
treated the same as `NNG_ENOMEM`.
== SEE ALSO
[.text-left]
xref:nng_free.3.adoc[nng_free(3)],
xref:nng_send.3.adoc[nng_send(3)],
xref:nng_strerror.3.adoc[nng_strerror(3)],
xref:nng.7.adoc[nng(7)]
| {
"pile_set_name": "Github"
} |
"""
COCO keypoint detection (2D multiple human pose estimation) dataset (for Lightweight OpenPose).
"""
import os
import json
import math
import threading
import cv2
from operator import itemgetter
import numpy as np
from tensorflow.keras.preprocessing.image import ImageDataGenerator, DirectoryIterator
from .dataset_metainfo import DatasetMetaInfo
class CocoHpe2Dataset(object):
"""
COCO keypoint detection (2D multiple human pose estimation) dataset.
Parameters
----------
root : string
Path to `annotations`, `train2017`, and `val2017` folders.
mode : string, default 'train'
'train', 'val', 'test', or 'demo'.
transform : callable, optional
A function that transforms the image.
"""
def __init__(self,
root,
mode="train",
transform=None):
super(CocoHpe2Dataset, self).__init__()
self._root = os.path.expanduser(root)
self.mode = mode
self.transform = transform
mode_name = "train" if mode == "train" else "val"
annotations_dir_path = os.path.join(root, "annotations")
annotations_file_path = os.path.join(annotations_dir_path, "person_keypoints_" + mode_name + "2017.json")
with open(annotations_file_path, "r") as f:
self.file_names = json.load(f)["images"]
self.image_dir_path = os.path.join(root, mode_name + "2017")
self.annotations_file_path = annotations_file_path
def __str__(self):
return self.__class__.__name__ + "(" + self._root + ")"
def __len__(self):
return len(self.file_names)
def __getitem__(self, idx):
file_name = self.file_names[idx]["file_name"]
image_file_path = os.path.join(self.image_dir_path, file_name)
image = cv2.imread(image_file_path, flags=cv2.IMREAD_COLOR)
# image = cv2.cvtColor(img, code=cv2.COLOR_BGR2RGB)
img_mean = (128, 128, 128)
img_scale = 1.0 / 256
base_height = 368
stride = 8
pad_value = (0, 0, 0)
height, width, _ = image.shape
image = self.normalize(image, img_mean, img_scale)
ratio = base_height / float(image.shape[0])
image = cv2.resize(image, (0, 0), fx=ratio, fy=ratio, interpolation=cv2.INTER_CUBIC)
min_dims = [base_height, max(image.shape[1], base_height)]
image, pad = self.pad_width(
image,
stride,
pad_value,
min_dims)
image = image.astype(np.float32)
# image = image.transpose((2, 0, 1))
# image = torch.from_numpy(image)
# if self.transform is not None:
# image = self.transform(image)
image_id = int(os.path.splitext(os.path.basename(file_name))[0])
label = np.array([image_id, 1.0] + pad + [height, width], np.float32)
# label = torch.from_numpy(label)
return image, label
@staticmethod
def normalize(img,
img_mean,
img_scale):
img = np.array(img, dtype=np.float32)
img = (img - img_mean) * img_scale
return img
@staticmethod
def pad_width(img,
stride,
pad_value,
min_dims):
h, w, _ = img.shape
h = min(min_dims[0], h)
min_dims[0] = math.ceil(min_dims[0] / float(stride)) * stride
min_dims[1] = max(min_dims[1], w)
min_dims[1] = math.ceil(min_dims[1] / float(stride)) * stride
top = int(math.floor((min_dims[0] - h) / 2.0))
left = int(math.floor((min_dims[1] - w) / 2.0))
bottom = int(min_dims[0] - h - top)
right = int(min_dims[1] - w - left)
pad = [top, left, bottom, right]
padded_img = cv2.copyMakeBorder(
src=img,
top=top,
bottom=bottom,
left=left,
right=right,
borderType=cv2.BORDER_CONSTANT,
value=pad_value)
return padded_img, pad
# ---------------------------------------------------------------------------------------------------------------------
class CocoHpe2ValTransform(object):
def __init__(self,
ds_metainfo):
self.ds_metainfo = ds_metainfo
def __call__(self, src, label):
return src, label
def extract_keypoints(heatmap,
all_keypoints,
total_keypoint_num):
heatmap[heatmap < 0.1] = 0
heatmap_with_borders = np.pad(heatmap, [(2, 2), (2, 2)], mode="constant")
heatmap_center = heatmap_with_borders[1:heatmap_with_borders.shape[0] - 1, 1:heatmap_with_borders.shape[1] - 1]
heatmap_left = heatmap_with_borders[1:heatmap_with_borders.shape[0] - 1, 2:heatmap_with_borders.shape[1]]
heatmap_right = heatmap_with_borders[1:heatmap_with_borders.shape[0] - 1, 0:heatmap_with_borders.shape[1] - 2]
heatmap_up = heatmap_with_borders[2:heatmap_with_borders.shape[0], 1:heatmap_with_borders.shape[1] - 1]
heatmap_down = heatmap_with_borders[0:heatmap_with_borders.shape[0] - 2, 1:heatmap_with_borders.shape[1] - 1]
heatmap_peaks = (heatmap_center > heatmap_left) &\
(heatmap_center > heatmap_right) &\
(heatmap_center > heatmap_up) &\
(heatmap_center > heatmap_down)
heatmap_peaks = heatmap_peaks[1:heatmap_center.shape[0] - 1, 1:heatmap_center.shape[1] - 1]
keypoints = list(zip(np.nonzero(heatmap_peaks)[1], np.nonzero(heatmap_peaks)[0])) # (w, h)
keypoints = sorted(keypoints, key=itemgetter(0))
suppressed = np.zeros(len(keypoints), np.uint8)
keypoints_with_score_and_id = []
keypoint_num = 0
for i in range(len(keypoints)):
if suppressed[i]:
continue
for j in range(i + 1, len(keypoints)):
if math.sqrt((keypoints[i][0] - keypoints[j][0]) ** 2 + (keypoints[i][1] - keypoints[j][1]) ** 2) < 6:
suppressed[j] = 1
keypoint_with_score_and_id = (
keypoints[i][0],
keypoints[i][1],
heatmap[keypoints[i][1], keypoints[i][0]],
total_keypoint_num + keypoint_num)
keypoints_with_score_and_id.append(keypoint_with_score_and_id)
keypoint_num += 1
all_keypoints.append(keypoints_with_score_and_id)
return keypoint_num
def group_keypoints(all_keypoints_by_type,
pafs,
pose_entry_size=20,
min_paf_score=0.05):
def linspace2d(start, stop, n=10):
points = 1 / (n - 1) * (stop - start)
return points[:, None] * np.arange(n) + start[:, None]
BODY_PARTS_KPT_IDS = [[1, 2], [1, 5], [2, 3], [3, 4], [5, 6], [6, 7], [1, 8], [8, 9], [9, 10], [1, 11],
[11, 12], [12, 13], [1, 0], [0, 14], [14, 16], [0, 15], [15, 17], [2, 16], [5, 17]]
BODY_PARTS_PAF_IDS = ([12, 13], [20, 21], [14, 15], [16, 17], [22, 23], [24, 25], [0, 1], [2, 3], [4, 5],
[6, 7], [8, 9], [10, 11], [28, 29], [30, 31], [34, 35], [32, 33], [36, 37], [18, 19],
[26, 27])
pose_entries = []
all_keypoints = np.array([item for sublist in all_keypoints_by_type for item in sublist])
for part_id in range(len(BODY_PARTS_PAF_IDS)):
part_pafs = pafs[:, :, BODY_PARTS_PAF_IDS[part_id]]
kpts_a = all_keypoints_by_type[BODY_PARTS_KPT_IDS[part_id][0]]
kpts_b = all_keypoints_by_type[BODY_PARTS_KPT_IDS[part_id][1]]
num_kpts_a = len(kpts_a)
num_kpts_b = len(kpts_b)
kpt_a_id = BODY_PARTS_KPT_IDS[part_id][0]
kpt_b_id = BODY_PARTS_KPT_IDS[part_id][1]
if num_kpts_a == 0 and num_kpts_b == 0: # no keypoints for such body part
continue
elif num_kpts_a == 0: # body part has just 'b' keypoints
for i in range(num_kpts_b):
num = 0
for j in range(len(pose_entries)): # check if already in some pose, was added by another body part
if pose_entries[j][kpt_b_id] == kpts_b[i][3]:
num += 1
continue
if num == 0:
pose_entry = np.ones(pose_entry_size) * -1
pose_entry[kpt_b_id] = kpts_b[i][3] # keypoint idx
pose_entry[-1] = 1 # num keypoints in pose
pose_entry[-2] = kpts_b[i][2] # pose score
pose_entries.append(pose_entry)
continue
elif num_kpts_b == 0: # body part has just 'a' keypoints
for i in range(num_kpts_a):
num = 0
for j in range(len(pose_entries)):
if pose_entries[j][kpt_a_id] == kpts_a[i][3]:
num += 1
continue
if num == 0:
pose_entry = np.ones(pose_entry_size) * -1
pose_entry[kpt_a_id] = kpts_a[i][3]
pose_entry[-1] = 1
pose_entry[-2] = kpts_a[i][2]
pose_entries.append(pose_entry)
continue
connections = []
for i in range(num_kpts_a):
kpt_a = np.array(kpts_a[i][0:2])
for j in range(num_kpts_b):
kpt_b = np.array(kpts_b[j][0:2])
mid_point = [(), ()]
mid_point[0] = (int(round((kpt_a[0] + kpt_b[0]) * 0.5)),
int(round((kpt_a[1] + kpt_b[1]) * 0.5)))
mid_point[1] = mid_point[0]
vec = [kpt_b[0] - kpt_a[0], kpt_b[1] - kpt_a[1]]
vec_norm = math.sqrt(vec[0] ** 2 + vec[1] ** 2)
if vec_norm == 0:
continue
vec[0] /= vec_norm
vec[1] /= vec_norm
cur_point_score = (vec[0] * part_pafs[mid_point[0][1], mid_point[0][0], 0] +
vec[1] * part_pafs[mid_point[1][1], mid_point[1][0], 1])
height_n = pafs.shape[0] // 2
success_ratio = 0
point_num = 10 # number of points to integration over paf
if cur_point_score > -100:
passed_point_score = 0
passed_point_num = 0
x, y = linspace2d(kpt_a, kpt_b)
for point_idx in range(point_num):
px = int(round(x[point_idx]))
py = int(round(y[point_idx]))
paf = part_pafs[py, px, 0:2]
cur_point_score = vec[0] * paf[0] + vec[1] * paf[1]
if cur_point_score > min_paf_score:
passed_point_score += cur_point_score
passed_point_num += 1
success_ratio = passed_point_num / point_num
ratio = 0
if passed_point_num > 0:
ratio = passed_point_score / passed_point_num
ratio += min(height_n / vec_norm - 1, 0)
if ratio > 0 and success_ratio > 0.8:
score_all = ratio + kpts_a[i][2] + kpts_b[j][2]
connections.append([i, j, ratio, score_all])
if len(connections) > 0:
connections = sorted(connections, key=itemgetter(2), reverse=True)
num_connections = min(num_kpts_a, num_kpts_b)
has_kpt_a = np.zeros(num_kpts_a, dtype=np.int32)
has_kpt_b = np.zeros(num_kpts_b, dtype=np.int32)
filtered_connections = []
for row in range(len(connections)):
if len(filtered_connections) == num_connections:
break
i, j, cur_point_score = connections[row][0:3]
if not has_kpt_a[i] and not has_kpt_b[j]:
filtered_connections.append([kpts_a[i][3], kpts_b[j][3], cur_point_score])
has_kpt_a[i] = 1
has_kpt_b[j] = 1
connections = filtered_connections
if len(connections) == 0:
continue
if part_id == 0:
pose_entries = [np.ones(pose_entry_size) * -1 for _ in range(len(connections))]
for i in range(len(connections)):
pose_entries[i][BODY_PARTS_KPT_IDS[0][0]] = connections[i][0]
pose_entries[i][BODY_PARTS_KPT_IDS[0][1]] = connections[i][1]
pose_entries[i][-1] = 2
pose_entries[i][-2] = np.sum(all_keypoints[connections[i][0:2], 2]) + connections[i][2]
elif part_id == 17 or part_id == 18:
kpt_a_id = BODY_PARTS_KPT_IDS[part_id][0]
kpt_b_id = BODY_PARTS_KPT_IDS[part_id][1]
for i in range(len(connections)):
for j in range(len(pose_entries)):
if pose_entries[j][kpt_a_id] == connections[i][0] and pose_entries[j][kpt_b_id] == -1:
pose_entries[j][kpt_b_id] = connections[i][1]
elif pose_entries[j][kpt_b_id] == connections[i][1] and pose_entries[j][kpt_a_id] == -1:
pose_entries[j][kpt_a_id] = connections[i][0]
continue
else:
kpt_a_id = BODY_PARTS_KPT_IDS[part_id][0]
kpt_b_id = BODY_PARTS_KPT_IDS[part_id][1]
for i in range(len(connections)):
num = 0
for j in range(len(pose_entries)):
if pose_entries[j][kpt_a_id] == connections[i][0]:
pose_entries[j][kpt_b_id] = connections[i][1]
num += 1
pose_entries[j][-1] += 1
pose_entries[j][-2] += all_keypoints[connections[i][1], 2] + connections[i][2]
if num == 0:
pose_entry = np.ones(pose_entry_size) * -1
pose_entry[kpt_a_id] = connections[i][0]
pose_entry[kpt_b_id] = connections[i][1]
pose_entry[-1] = 2
pose_entry[-2] = np.sum(all_keypoints[connections[i][0:2], 2]) + connections[i][2]
pose_entries.append(pose_entry)
filtered_entries = []
for i in range(len(pose_entries)):
if pose_entries[i][-1] < 3 or (pose_entries[i][-2] / pose_entries[i][-1] < 0.2):
continue
filtered_entries.append(pose_entries[i])
pose_entries = np.asarray(filtered_entries)
return pose_entries, all_keypoints
def convert_to_coco_format(pose_entries, all_keypoints):
coco_keypoints = []
scores = []
for n in range(len(pose_entries)):
if len(pose_entries[n]) == 0:
continue
keypoints = [0] * 17 * 3
to_coco_map = [0, -1, 6, 8, 10, 5, 7, 9, 12, 14, 16, 11, 13, 15, 2, 1, 4, 3]
person_score = pose_entries[n][-2]
position_id = -1
for keypoint_id in pose_entries[n][:-2]:
position_id += 1
if position_id == 1: # no 'neck' in COCO
continue
cx, cy, score, visibility = 0, 0, 0, 0 # keypoint not found
if keypoint_id != -1:
cx, cy, score = all_keypoints[int(keypoint_id), 0:3]
cx = cx + 0.5
cy = cy + 0.5
visibility = 1
keypoints[to_coco_map[position_id] * 3 + 0] = cx
keypoints[to_coco_map[position_id] * 3 + 1] = cy
keypoints[to_coco_map[position_id] * 3 + 2] = visibility
coco_keypoints.append(keypoints)
scores.append(person_score * max(0, (pose_entries[n][-1] - 1))) # -1 for 'neck'
return coco_keypoints, scores
def recalc_pose(pred,
label):
label_img_id = label[:, 0].astype(np.int32)
# label_score = label[:, 1]
pred = pred.transpose((0, 3, 1, 2))
pads = label[:, 2:6].astype(np.int32)
heights = label[:, 6].astype(np.int32)
widths = label[:, 7].astype(np.int32)
keypoints = 19
stride = 8
heatmap2ds = pred[:, :keypoints]
paf2ds = pred[:, keypoints:(3 * keypoints)]
pred_pts_score = []
pred_person_score = []
label_img_id_ = []
batch = pred.shape[0]
for batch_i in range(batch):
label_img_id_i = label_img_id[batch_i]
pad = list(pads[batch_i])
height = int(heights[batch_i])
width = int(widths[batch_i])
heatmap2d = heatmap2ds[batch_i]
paf2d = paf2ds[batch_i]
heatmaps = np.transpose(heatmap2d, (1, 2, 0))
heatmaps = cv2.resize(heatmaps, (0, 0), fx=stride, fy=stride, interpolation=cv2.INTER_CUBIC)
heatmaps = heatmaps[pad[0]:heatmaps.shape[0] - pad[2], pad[1]:heatmaps.shape[1] - pad[3]:, :]
heatmaps = cv2.resize(heatmaps, (width, height), interpolation=cv2.INTER_CUBIC)
pafs = np.transpose(paf2d, (1, 2, 0))
pafs = cv2.resize(pafs, (0, 0), fx=stride, fy=stride, interpolation=cv2.INTER_CUBIC)
pafs = pafs[pad[0]:pafs.shape[0] - pad[2], pad[1]:pafs.shape[1] - pad[3], :]
pafs = cv2.resize(pafs, (width, height), interpolation=cv2.INTER_CUBIC)
total_keypoints_num = 0
all_keypoints_by_type = []
for kpt_idx in range(18): # 19th for bg
total_keypoints_num += extract_keypoints(
heatmaps[:, :, kpt_idx],
all_keypoints_by_type,
total_keypoints_num)
pose_entries, all_keypoints = group_keypoints(
all_keypoints_by_type,
pafs)
coco_keypoints, scores = convert_to_coco_format(
pose_entries,
all_keypoints)
pred_pts_score.append(coco_keypoints)
pred_person_score.append(scores)
label_img_id_.append([label_img_id_i] * len(scores))
return np.array(pred_pts_score).reshape((-1, 17, 3)), np.array(pred_person_score)[0], np.array(label_img_id_[0])
# ---------------------------------------------------------------------------------------------------------------------
class CocoHpe2MetaInfo(DatasetMetaInfo):
def __init__(self):
super(CocoHpe2MetaInfo, self).__init__()
self.label = "COCO"
self.short_label = "coco"
self.root_dir_name = "coco"
self.dataset_class = CocoHpe2Dataset
self.num_training_samples = None
self.in_channels = 3
self.num_classes = 17
self.input_image_size = (368, 368)
self.train_metric_capts = None
self.train_metric_names = None
self.train_metric_extra_kwargs = None
self.val_metric_capts = None
self.val_metric_names = None
self.test_metric_capts = ["Val.CocoOksAp"]
self.test_metric_names = ["CocoHpeOksApMetric"]
self.test_metric_extra_kwargs = [
{"name": "OksAp",
"coco_annotations_file_path": None,
"use_file": False,
"pose_postprocessing_fn": lambda x, y: recalc_pose(x, y)}]
self.saver_acc_ind = 0
self.do_transform = True
self.test_transform = cocohpe_val_transform
self.test_transform2 = CocoHpe2ValTransform
self.test_generator = cocohpe_test_generator
self.ml_type = "hpe"
self.net_extra_kwargs = {}
self.mean_rgb = (0.485, 0.456, 0.406)
self.std_rgb = (0.229, 0.224, 0.225)
self.load_ignore_extra = False
def add_dataset_parser_arguments(self,
parser,
work_dir_path):
"""
Create python script parameters (for ImageNet-1K dataset metainfo).
Parameters:
----------
parser : ArgumentParser
ArgumentParser instance.
work_dir_path : str
Path to working directory.
"""
super(CocoHpe2MetaInfo, self).add_dataset_parser_arguments(parser, work_dir_path)
parser.add_argument(
"--input-size",
type=int,
nargs=2,
default=self.input_image_size,
help="size of the input for model")
parser.add_argument(
"--load-ignore-extra",
action="store_true",
help="ignore extra layers in the source PyTroch model")
def update(self,
args):
"""
Update ImageNet-1K dataset metainfo after user customizing.
Parameters:
----------
args : ArgumentParser
Main script arguments.
"""
super(CocoHpe2MetaInfo, self).update(args)
self.input_image_size = args.input_size
self.load_ignore_extra = args.load_ignore_extra
def update_from_dataset(self,
dataset):
"""
Update dataset metainfo after a dataset class instance creation.
Parameters:
----------
args : obj
A dataset class instance.
"""
self.test_metric_extra_kwargs[0]["coco_annotations_file_path"] = dataset.annotations_file_path
# ---------------------------------------------------------------------------------------------------------------------
class CocoHpeDirectoryIterator(DirectoryIterator):
allowed_class_modes = {'categorical', 'binary', 'sparse', 'input', None}
def __init__(self,
directory,
image_data_generator,
target_size=(368, 368),
color_mode='rgb',
classes=None,
class_mode='categorical',
batch_size=32,
shuffle=True,
seed=None,
data_format='channels_last',
save_to_dir=None,
save_prefix='',
save_format='png',
follow_links=False,
subset=None,
interpolation='nearest',
dtype='float32',
dataset=None):
super(CocoHpeDirectoryIterator, self).set_processing_attrs(
image_data_generator,
target_size,
color_mode,
data_format,
save_to_dir,
save_prefix,
save_format,
subset,
interpolation)
self.dataset = dataset
self.class_mode = class_mode
self.dtype = dtype
self.n = len(self.dataset)
self.batch_size = batch_size
self.seed = seed
self.shuffle = shuffle
self.batch_index = 0
self.total_batches_seen = 0
self.lock = threading.Lock()
self.index_array = None
self.index_generator = self._flow_index()
def _get_batches_of_transformed_samples(self, index_array):
"""Gets a batch of transformed samples.
# Arguments
index_array: Array of sample indices to include in batch.
# Returns
A batch of transformed samples.
"""
batch_x = None
batch_y = None
for i, j in enumerate(index_array):
x, y = self.dataset[j]
if batch_x is None:
batch_x = np.zeros((len(index_array),) + x.shape, dtype=self.dtype)
batch_y = np.zeros((len(index_array),) + y.shape, dtype=np.float32)
batch_x[i] = x
batch_y[i] = y
return batch_x, batch_y
class CocoHpeImageDataGenerator(ImageDataGenerator):
def flow_from_directory(self,
directory,
target_size=(368, 368),
color_mode='rgb',
classes=None,
class_mode='categorical',
batch_size=32,
shuffle=True,
seed=None,
save_to_dir=None,
save_prefix='',
save_format='png',
follow_links=False,
subset=None,
interpolation='nearest',
dataset=None):
return CocoHpeDirectoryIterator(
directory,
self,
target_size=target_size,
color_mode=color_mode,
classes=classes,
class_mode=class_mode,
data_format=self.data_format,
batch_size=batch_size,
shuffle=shuffle,
seed=seed,
save_to_dir=save_to_dir,
save_prefix=save_prefix,
save_format=save_format,
follow_links=follow_links,
subset=subset,
interpolation=interpolation,
dataset=dataset)
def cocohpe_val_transform(ds_metainfo,
data_format="channels_last"):
"""
Create image transform sequence for validation subset.
Parameters:
----------
ds_metainfo : DatasetMetaInfo
Pascal VOC2012 dataset metainfo.
data_format : str, default 'channels_last'
The ordering of the dimensions in tensors.
Returns
-------
ImageDataGenerator
Image transform sequence.
"""
data_generator = CocoHpeImageDataGenerator(
preprocessing_function=(lambda img: ds_metainfo.val_transform2(ds_metainfo=ds_metainfo)(img)),
data_format=data_format)
return data_generator
def cocohpe_val_generator(data_generator,
ds_metainfo,
batch_size):
"""
Create image generator for validation subset.
Parameters:
----------
data_generator : ImageDataGenerator
Image transform sequence.
ds_metainfo : DatasetMetaInfo
Pascal VOC2012 dataset metainfo.
batch_size : int
Batch size.
Returns
-------
Sequential
Image transform sequence.
"""
split = "val"
root = ds_metainfo.root_dir_path
root = os.path.join(root, split)
generator = data_generator.flow_from_directory(
directory=root,
target_size=ds_metainfo.input_image_size,
class_mode="binary",
batch_size=batch_size,
shuffle=False,
interpolation="bilinear",
dataset=ds_metainfo.dataset_class(
root=ds_metainfo.root_dir_path,
mode="val",
transform=ds_metainfo.val_transform2(
ds_metainfo=ds_metainfo)))
return generator
def cocohpe_test_generator(data_generator,
ds_metainfo,
batch_size):
"""
Create image generator for testing subset.
Parameters:
----------
data_generator : ImageDataGenerator
Image transform sequence.
ds_metainfo : DatasetMetaInfo
Pascal VOC2012 dataset metainfo.
batch_size : int
Batch size.
Returns
-------
Sequential
Image transform sequence.
"""
split = "val"
root = ds_metainfo.root_dir_path
root = os.path.join(root, split)
generator = data_generator.flow_from_directory(
directory=root,
target_size=ds_metainfo.input_image_size,
class_mode="binary",
batch_size=batch_size,
shuffle=False,
interpolation="bilinear",
dataset=ds_metainfo.dataset_class(
root=ds_metainfo.root_dir_path,
mode="test",
transform=ds_metainfo.test_transform2(
ds_metainfo=ds_metainfo)))
return generator
| {
"pile_set_name": "Github"
} |
/**
* Copyright(c) dtysky<[email protected]>
* Created: 7 Feb 2018
* Description:
*/
/// <reference types="react" />
import {Component} from 'react';
export interface IPropTypes {
total?: number;
pageSize?: number;
length?: number;
offset?: number;
current?: number;
view?: 'box' | 'circle' | 'simple';
size?: 'small' | 'middle' | 'large';
onSelect?: (currentPage: number, index: number) => void;
preIcon?: React.ReactNode;
nextIcon?: React.ReactNode;
withBorderJumper?: boolean;
className?: string;
style?: any;
eachDefaultStyle?: any;
eachHoveredStyle?: any;
eachActiveStyle?: any;
eachDisabledStyle?: any;
children?: React.ReactNode;
}
export interface IStateTypes {
hovered: boolean;
}
export default class Pagination extends Component<IPropTypes, IStateTypes> {
static defaultProps: IPropTypes;
public state: IStateTypes;
private genPageList;
private quickJump;
private handleHover;
private handleClearHover;
private handleChangePage;
}
| {
"pile_set_name": "Github"
} |
{
Copyright (c) 1999-2001 by the Free Pascal development team.
Borland Pascal 7 Compatible CRT Unit for Netware, tested with
Netware 4.11 and 5.1
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
{At initialization time, AutoScreenDestructionMode is set to true so after program termination
no "press any key to close screen" is displayed. Also check for ctrl-c in readkey is disabled.
To enable ctrl-c check, set CheckBreak to true before calling ReadKey.
2001/04/13 armin: first version for netware, compilable, completely untested
2001/04/14 armin: tested, seems to work
TextMode, Sound and NoSound are dummys, don't know how to
implement that for netware
}
unit crt;
interface
{$i crth.inc}
Const
ScreenHeight : longint=25;
ScreenWidth : longint=80;
implementation
{$I nwsys.inc}
{$ASMMODE ATT}
var
DelayCnt,
// ScreenWidth,
// ScreenHeight : longint;
VidSeg : Word;
{****************************************************************************
Low level Routines
****************************************************************************}
procedure setscreenmode(mode : byte);
begin
end;
function GetScreenHeight : longint;
VAR Height, Width : WORD;
begin
_GetSizeOfScreen (Height,Width);
GetScreenHeight := Height;
end;
function GetScreenWidth : longint;
VAR Height, Width : WORD;
begin
_GetSizeOfScreen (Height,Width);
GetScreenWidth := Width;
end;
procedure GetScreenCursor(var x,y : longint);
begin
x := _wherex+1;
y := _wherey+1;
end;
{****************************************************************************
Helper Routines
****************************************************************************}
Function WinMinX: Longint;
{
Current Minimum X coordinate
}
Begin
WinMinX:=(WindMin and $ff)+1;
End;
Function WinMinY: Longint;
{
Current Minimum Y Coordinate
}
Begin
WinMinY:=(WindMin shr 8)+1;
End;
Function WinMaxX: Longint;
{
Current Maximum X coordinate
}
Begin
WinMaxX:=(WindMax and $ff)+1;
End;
Function WinMaxY: Longint;
{
Current Maximum Y coordinate;
}
Begin
WinMaxY:=(WindMax shr 8) + 1;
End;
Function FullWin:boolean;
{
Full Screen 80x25? Window(1,1,80,25) is used, allows faster routines
}
begin
FullWin:=(WinMinX=1) and (WinMinY=1) and
(WinMaxX=ScreenWidth) and (WinMaxY=ScreenHeight);
end;
{****************************************************************************
Public Crt Functions
****************************************************************************}
procedure textmode (mode: word);
begin
Window (1,1,byte(ScreenWidth),byte(ScreenHeight));
ClrScr;
end;
Procedure TextColor(Color: Byte);
{
Switch foregroundcolor
}
Begin
TextAttr:=(Color and $f) or (TextAttr and $70);
If (Color>15) Then TextAttr:=TextAttr Or Blink;
End;
Procedure TextBackground(Color: Byte);
{
Switch backgroundcolor
}
Begin
TextAttr:=((Color shl 4) and ($f0 and not Blink)) or (TextAttr and ($0f OR Blink) );
End;
Procedure HighVideo;
{
Set highlighted output.
}
Begin
TextColor(TextAttr Or $08);
End;
Procedure LowVideo;
{
Set normal output
}
Begin
TextColor(TextAttr And $77);
End;
Procedure NormVideo;
{
Set normal back and foregroundcolors.
}
Begin
TextColor(7);
TextBackGround(0);
End;
Procedure GotoXy(X: tcrtcoord; Y: tcrtcoord);
{
Go to coordinates X,Y in the current window.
}
Begin
If (X>0) and (X<=WinMaxX- WinMinX+1) and
(Y>0) and (Y<=WinMaxY-WinMinY+1) Then
Begin
X := X + WinMinX - 1;
Y := Y + WinMinY - 1;
_GotoXY (x-1,y-1);
End;
End;
Procedure Window(X1, Y1, X2, Y2: Byte);
{
Set screen window to the specified coordinates.
}
Begin
if (X1>X2) or (X2>ScreenWidth) or
(Y1>Y2) or (Y2>ScreenHeight) then
exit;
WindMin:=((Y1-1) Shl 8)+(X1-1);
WindMax:=((Y2-1) Shl 8)+(X2-1);
GoToXY(1,1);
End;
Procedure ClrScr;
{
Clear the current window, and set the cursor on 1,1
}
var
fil : word;
y : longint;
p : pointer;
rowlen,rows: longint;
begin
fil:=32 or (textattr shl 8);
if FullWin then
begin
_clrscr; {seems to swich cursor off}
_DisplayInputCursor;
end else
begin
rowlen := WinMaxX-WinMinX+1;
rows := WinMaxY-WinMinY+1;
GetMem (p, rows * rowlen * 2);
FillWord (p^, rows * rowlen, fil);
_CopyToScreenMemory (word(rows),word(rowlen),p,WinMinX-1,WinMinY-1);
FreeMem (p, rows * rowlen * 2);
end;
Gotoxy(1,1);
end;
Procedure ClrEol;
{
Clear from current position to end of line.
}
var
x,y : longint;
fil : word;
rowlen : word;
p : pointer;
Begin
GetScreenCursor(x,y);
fil:=32 or (textattr shl 8);
if x<WinMaxX then
begin
rowlen := WinMaxX-x+1;
GetMem (p, rowlen * 2);
FillWord (p^, rowlen, fil);
_CopyToScreenMemory (1,rowlen,p,x-1,y-1);
FreeMem (p, rowlen * 2);
end;
End;
Function WhereX: tcrtcoord;
{
Return current X-position of cursor.
}
var
x,y : longint;
Begin
GetScreenCursor(x,y);
WhereX:=x-WinMinX+1;
End;
Function WhereY: tcrtcoord;
{
Return current Y-position of cursor.
}
var
x,y : longint;
Begin
GetScreenCursor(x,y);
WhereY:=y-WinMinY+1;
End;
{*************************************************************************
Keyboard
*************************************************************************}
var
is_last : boolean;
function readkey : char;
var
char1 : char;
begin
if is_last then
begin
is_last:=false;
readkey:=_getch;
end else
begin
_SetCtrlCharCheckMode (CheckBreak);
char1 := _getch;
if char1 = #0 then is_last := true;
readkey:=char1;
end;
end;
function keypressed : boolean;
begin
if is_last then
begin
keypressed:=true;
exit;
end else
keypressed := (_kbhit <> 0);
end;
{*************************************************************************
Delay
*************************************************************************}
procedure Delay(MS: Word);
begin
_delay (MS);
end;
procedure sound(hz : word);
begin
_RingTheBell;
end;
procedure nosound;
begin
end;
{****************************************************************************
HighLevel Crt Functions
****************************************************************************}
procedure removeline(y : longint);
var
fil : word;
rowlen : word;
p : pointer;
begin
fil:=32 or (textattr shl 8);
rowlen:=WinMaxX-WinMinX+1;
GetMem (p, rowlen*2);
y:=WinMinY+y-1;
While (y<=WinMaxY) do
begin
_CopyFromScreenMemory (1,rowlen,p,WinMinX-1,word(y));
_CopyToScreenMemory (1,rowlen,p,WinMinX-1,word(y-1));
inc(y);
end;
FillWord (p^,rowlen,fil);
_CopyToScreenMemory (1,rowlen,p,WinMinX-1,WinMaxY-1);
FreeMem (p, rowlen*2);
end;
procedure delline;
begin
removeline(wherey);
end;
procedure insline;
var
my : longint;
y : word;
fil : word;
rowlen : word;
p : pointer;
begin
fil:=32 or (textattr shl 8);
y:=WhereY-1;
my:=WinMaxY-WinMinY;
rowlen := WinMaxX-WinMinX+1;
GetMem (p, rowlen*2);
while (my>=y) do
begin
_CopyFromScreenMemory (1,rowlen,p,WinMinX-1,word(my));
_CopyToScreenMemory (1,rowlen,p,WinMinX-1,word(my+1));
dec(my);
end;
FillWord (p^,rowlen,fil);
_CopyToScreenMemory (1,rowlen,p,WinMinX-1,y);
FreeMem (p, rowlen*2);
end;
{****************************************************************************
Extra Crt Functions
****************************************************************************}
procedure cursoron;
begin
if _IsColorMonitor <> 0 then
_SetCursorShape (9,$A)
else
_SetCursorShape ($B,$D);
_DisplayInputCursor;
end;
procedure cursoroff;
begin
_HideInputCursor;
end;
procedure cursorbig;
begin
_SetCursorShape (1,$A);
_DisplayInputCursor;
end;
{*****************************************************************************
Read and Write routines
*****************************************************************************}
var
CurrX,CurrY : longint;
Procedure WriteChar(c:char);
var
w : word;
begin
case c of
#10 : inc(CurrY);
#13 : CurrX:=WinMinX;
#8 : begin
if CurrX>WinMinX then
dec(CurrX);
end;
#7 : begin { beep }
_RingTheBell;
end;
else
begin
w:=(textattr shl 8) or byte(c);
_CopyToScreenMemory (1,1,@w,CurrX-1,CurrY-1);
inc(CurrX);
end;
end;
if CurrX>WinMaxX then
begin
CurrX:=WinMinX;
inc(CurrY);
end;
while CurrY>WinMaxY do
begin
removeline(1);
dec(CurrY);
end;
end;
Function CrtWrite(var f : textrec):integer;
var
i : longint;
begin
GetScreenCursor(CurrX,CurrY);
for i:=0 to f.bufpos-1 do
WriteChar(f.buffer[i]); { ad: may be better to use a buffer but i think it's fast enough }
_GotoXY (CurrX-1,CurrY-1);
f.bufpos:=0;
CrtWrite:=0;
end;
Function CrtRead(Var F: TextRec): Integer;
procedure BackSpace;
begin
if (f.bufpos>0) and (f.bufpos=f.bufend) then
begin
WriteChar(#8);
WriteChar(' ');
WriteChar(#8);
dec(f.bufpos);
dec(f.bufend);
end;
end;
var
ch : Char;
Begin
GetScreenCursor(CurrX,CurrY);
f.bufpos:=0;
f.bufend:=0;
repeat
if f.bufpos>f.bufend then
f.bufend:=f.bufpos;
_GotoXY (CurrX-1,CurrY-1);
ch:=readkey;
case ch of
#0 : case readkey of
#71 : while f.bufpos>0 do
begin
dec(f.bufpos);
WriteChar(#8);
end;
#75 : if f.bufpos>0 then
begin
dec(f.bufpos);
WriteChar(#8);
end;
#77 : if f.bufpos<f.bufend then
begin
WriteChar(f.bufptr^[f.bufpos]);
inc(f.bufpos);
end;
#79 : while f.bufpos<f.bufend do
begin
WriteChar(f.bufptr^[f.bufpos]);
inc(f.bufpos);
end;
end;
^S,
#8 : BackSpace;
^Y,
#27 : begin
f.bufpos:=f.bufend;
while f.bufend>0 do
BackSpace;
end;
#13 : begin
WriteChar(#13);
WriteChar(#10);
f.bufptr^[f.bufend]:=#13;
f.bufptr^[f.bufend+1]:=#10;
inc(f.bufend,2);
break;
end;
#26 : if CheckEOF then
begin
f.bufptr^[f.bufend]:=#26;
inc(f.bufend);
break;
end;
else
begin
if f.bufpos<f.bufsize-2 then
begin
f.buffer[f.bufpos]:=ch;
inc(f.bufpos);
WriteChar(ch);
end;
end;
end;
until false;
f.bufpos:=0;
_GotoXY (CurrX-1,CurrY-1);
CrtRead:=0;
End;
Function CrtReturn(Var F: TextRec): Integer;
Begin
CrtReturn:=0;
end;
Function CrtClose(Var F: TextRec): Integer;
Begin
F.Mode:=fmClosed;
CrtClose:=0;
End;
Function CrtOpen(Var F: TextRec): Integer;
Begin
If F.Mode=fmOutput Then
begin
TextRec(F).InOutFunc:=@CrtWrite;
TextRec(F).FlushFunc:=@CrtWrite;
end
Else
begin
F.Mode:=fmInput;
TextRec(F).InOutFunc:=@CrtRead;
TextRec(F).FlushFunc:=@CrtReturn;
end;
TextRec(F).CloseFunc:=@CrtClose;
CrtOpen:=0;
End;
procedure AssignCrt(var F: Text);
begin
Assign(F,'');
TextRec(F).OpenFunc:=@CrtOpen;
end;
var
x,y : longint;
begin
{ Load startup values }
ScreenWidth:=GetScreenWidth;
ScreenHeight:=GetScreenHeight;
lastmode := CO80;
TextMode (lastmode);
GetScreenCursor(x,y);
if screenheight>25 then
lastmode:=lastmode or $100;
TextColor (LightGray);
TextBackground (Black);
{ Redirect the standard output }
assigncrt(Output);
Rewrite(Output);
TextRec(Output).Handle:=StdOutputHandle;
assigncrt(Input);
Reset(Input);
TextRec(Input).Handle:=StdInputHandle;
CheckBreak := FALSE;
CheckEOF := FALSE;
_SetCtrlCharCheckMode (CheckBreak);
_SetAutoScreenDestructionMode (TRUE);
end.
| {
"pile_set_name": "Github"
} |
package cn.itcast_03;
/*
* 可变参数:定义方法的时候不知道该定义多少个参数
* 格式:
* 修饰符 返回值类型 方法名(数据类型… 变量名){
*
* }
* 注意事项:
* A:这里的变量其实是一个数组。它会自动把参数组装成一个数组里面去。
* B:一个方法中的可变参数只能出现在形式参数的最后。
*/
public class ArgsDemo {
public static void main(String[] args) {
// System.out.println(sum());
int a = 10;
int b = 20;
int result = sum(a, b);
System.out.println(result);
int c = 30;
result = sum(a, b, c);
System.out.println(result);
int d = 40;
result = sum(a, b, c, d);
System.out.println(result);
// 需求:我要计算出求和功能,参数是2-100个,目前我也不知道多少个?调用的时候我就知道了,请你提供功能?
// 怎么办?从2个开始,一直到100个。可以,但是太麻烦了
// 有没有更好的方案呢?有。针对参数个数不明确的情况,java就提供了一个技术:可变参数的用法。
result = sum(10, 20, 30, 40, 50);
System.out.println(result);
result = sum(10, 20, 30, 40, 50, 60, 70, 80, 90);
System.out.println(result);
}
public static int sum(int b,int... a) {
// [I@7821f46a
// System.out.println(a);
int result = 0;
for (int i : a) {
result += i;
}
return result;
}
// public static int sum(int a, int b) {
// return a + b;
// }
//
// public static int sum(int a, int b, int c) {
// return a + b + c;
// }
//
// public static int sum(int a, int b, int c, int d) {
// return a + b + c + d;
// }
}
| {
"pile_set_name": "Github"
} |
.\" DO NOT MODIFY THIS FILE! It was generated by gdoc.
.TH "gnutls_x509_ext_import_name_constraints" 3 "3.6.13" "gnutls" "gnutls"
.SH NAME
gnutls_x509_ext_import_name_constraints \- API function
.SH SYNOPSIS
.B #include <gnutls/x509-ext.h>
.sp
.BI "int gnutls_x509_ext_import_name_constraints(const gnutls_datum_t * " ext ", gnutls_x509_name_constraints_t " nc ", unsigned int " flags ");"
.SH ARGUMENTS
.IP "const gnutls_datum_t * ext" 12
a DER encoded extension
.IP "gnutls_x509_name_constraints_t nc" 12
The nameconstraints
.IP "unsigned int flags" 12
zero or \fBGNUTLS_NAME_CONSTRAINTS_FLAG_APPEND\fP
.SH "DESCRIPTION"
This function will return an intermediate type containing
the name constraints of the provided NameConstraints extension. That
can be used in combination with \fBgnutls_x509_name_constraints_check()\fP
to verify whether a server's name is in accordance with the constraints.
When the \fIflags\fP is set to \fBGNUTLS_NAME_CONSTRAINTS_FLAG_APPEND\fP, then if
the \fInc\fP type is empty this function will behave identically as if the flag was not set.
Otherwise if there are elements in the \fInc\fP structure then the
constraints will be merged with the existing constraints following
RFC5280 p6.1.4 (excluded constraints will be appended, permitted
will be intersected).
Note that \fInc\fP must be initialized prior to calling this function.
.SH "RETURNS"
On success, \fBGNUTLS_E_SUCCESS\fP (0) is returned, \fBGNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE\fP
if the extension is not present, otherwise a negative error value.
.SH "SINCE"
3.3.0
.SH "REPORTING BUGS"
Report bugs to <[email protected]>.
.br
Home page: https://www.gnutls.org
.SH COPYRIGHT
Copyright \(co 2001-2020 Free Software Foundation, Inc., and others.
.br
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
.SH "SEE ALSO"
The full documentation for
.B gnutls
is maintained as a Texinfo manual.
If the /usr/share/doc/gnutls/
directory does not contain the HTML form visit
.B
.IP https://www.gnutls.org/manual/
.PP
| {
"pile_set_name": "Github"
} |
trait ClassParams {
class C(
foo: Int,
bar: String,
)(implicit
ev0: Ev0,
ev1: Ev1,
)
// test class params in the presence of varargs
case class D(i: Int*,
)
}
-----
ScalaFile
ScTrait: ClassParams
AnnotationsList
<empty list>
Modifiers
<empty list>
PsiElement(trait)('trait')
PsiWhiteSpace(' ')
PsiElement(identifier)('ClassParams')
PsiWhiteSpace(' ')
ExtendsBlock
ScTemplateBody
PsiElement({)('{')
PsiWhiteSpace('\n ')
ScClass: C
AnnotationsList
<empty list>
Modifiers
<empty list>
PsiElement(class)('class')
PsiWhiteSpace(' ')
PsiElement(identifier)('C')
PrimaryConstructor
AnnotationsList
<empty list>
Modifiers
<empty list>
Parameters
ParametersClause
PsiElement(()('(')
PsiWhiteSpace('\n ')
ClassParameter: foo
AnnotationsList
<empty list>
Modifiers
<empty list>
PsiElement(identifier)('foo')
PsiElement(:)(':')
PsiWhiteSpace(' ')
ParameterType
SimpleType: Int
CodeReferenceElement: Int
PsiElement(identifier)('Int')
PsiElement(,)(',')
PsiWhiteSpace('\n ')
ClassParameter: bar
AnnotationsList
<empty list>
Modifiers
<empty list>
PsiElement(identifier)('bar')
PsiElement(:)(':')
PsiWhiteSpace(' ')
ParameterType
SimpleType: String
CodeReferenceElement: String
PsiElement(identifier)('String')
PsiElement(,)(',')
PsiWhiteSpace('\n ')
PsiElement())(')')
ParametersClause
PsiElement(()('(')
PsiElement(implicit)('implicit')
PsiWhiteSpace('\n ')
ClassParameter: ev0
AnnotationsList
<empty list>
Modifiers
<empty list>
PsiElement(identifier)('ev0')
PsiElement(:)(':')
PsiWhiteSpace(' ')
ParameterType
SimpleType: Ev0
CodeReferenceElement: Ev0
PsiElement(identifier)('Ev0')
PsiElement(,)(',')
PsiWhiteSpace('\n ')
ClassParameter: ev1
AnnotationsList
<empty list>
Modifiers
<empty list>
PsiElement(identifier)('ev1')
PsiElement(:)(':')
PsiWhiteSpace(' ')
ParameterType
SimpleType: Ev1
CodeReferenceElement: Ev1
PsiElement(identifier)('Ev1')
PsiElement(,)(',')
PsiWhiteSpace('\n ')
PsiElement())(')')
ExtendsBlock
<empty list>
PsiWhiteSpace('\n\n ')
ScClass: D
PsiComment(comment)('// test class params in the presence of varargs')
PsiWhiteSpace('\n ')
AnnotationsList
<empty list>
Modifiers
PsiElement(case)('case')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
PsiElement(identifier)('D')
PrimaryConstructor
AnnotationsList
<empty list>
Modifiers
<empty list>
Parameters
ParametersClause
PsiElement(()('(')
ClassParameter: i
AnnotationsList
<empty list>
Modifiers
<empty list>
PsiElement(identifier)('i')
PsiElement(:)(':')
PsiWhiteSpace(' ')
ParameterType
SimpleType: Int
CodeReferenceElement: Int
PsiElement(identifier)('Int')
PsiElement(identifier)('*')
PsiElement(,)(',')
PsiWhiteSpace('\n ')
PsiElement())(')')
ExtendsBlock
<empty list>
PsiWhiteSpace('\n')
PsiElement(})('}') | {
"pile_set_name": "Github"
} |
<http://example/s> <http://example/p> 1.0 .
| {
"pile_set_name": "Github"
} |
#include <iostream>
#include <cstring>
#include <cassert>
template<char C>
struct Char { char c; Char() : c(C) {} };
struct G : Char<'g'> {};
template<size_t N>
struct O : O<N-1>, Char<'o'> {};
template<>
struct O<0> : G {};
template<size_t N>
struct Al : O<N>, Char<'a'>, Char<'l'>, Char<'\0'> {
operator const char*() const { return reinterpret_cast<const char*>(this); }
};
template<size_t N>
struct Go : O<N> {
Al<N> operator()(const char* s) {
assert(std::strcmp(s, "al") == 0);
return Al<N>();
}
Go<N+1> operator()() {
return Go<N+1>();
}
};
Go<0> g;
int main() {
std::cout << g("al") << std::endl;
std::cout << g()("al") << std::endl;
std::cout << g()()()()("al") << std::endl;
}
| {
"pile_set_name": "Github"
} |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from aliyunsdkcore.request import RpcRequest
from aliyunsdkslb.endpoint import endpoint_data
class DescribeAccessControlListAttributeRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Slb', '2014-05-15', 'DescribeAccessControlListAttribute','slb')
self.set_method('POST')
if hasattr(self, "endpoint_map"):
setattr(self, "endpoint_map", endpoint_data.getEndpointMap())
if hasattr(self, "endpoint_regional"):
setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional())
def get_ResourceOwnerId(self):
return self.get_query_params().get('ResourceOwnerId')
def set_ResourceOwnerId(self,ResourceOwnerId):
self.add_query_param('ResourceOwnerId',ResourceOwnerId)
def get_AclId(self):
return self.get_query_params().get('AclId')
def set_AclId(self,AclId):
self.add_query_param('AclId',AclId)
def get_ResourceOwnerAccount(self):
return self.get_query_params().get('ResourceOwnerAccount')
def set_ResourceOwnerAccount(self,ResourceOwnerAccount):
self.add_query_param('ResourceOwnerAccount',ResourceOwnerAccount)
def get_OwnerAccount(self):
return self.get_query_params().get('OwnerAccount')
def set_OwnerAccount(self,OwnerAccount):
self.add_query_param('OwnerAccount',OwnerAccount)
def get_AclEntryComment(self):
return self.get_query_params().get('AclEntryComment')
def set_AclEntryComment(self,AclEntryComment):
self.add_query_param('AclEntryComment',AclEntryComment)
def get_OwnerId(self):
return self.get_query_params().get('OwnerId')
def set_OwnerId(self,OwnerId):
self.add_query_param('OwnerId',OwnerId) | {
"pile_set_name": "Github"
} |
{
"name": "Host Permissions",
"version": "1.0",
"description": "Test the permissions message with hosts on various RCDs.",
"content_scripts": [
{
"matches": [
"http://www.google.ad/",
"http://www.google.ad/search*",
"http://www.google.ad/webhp*",
"http://www.google.ae/",
"http://www.google.ae/search*",
"http://www.google.ae/webhp*",
"http://www.google.am/",
"http://www.google.am/search*",
"http://www.google.am/webhp*",
"http://www.google.as/",
"http://www.google.as/search*",
"http://www.google.as/webhp*",
"http://www.google.at/",
"http://www.google.at/search*",
"http://www.google.at/webhp*",
"http://www.google.az/",
"http://www.google.az/search*",
"http://www.google.az/webhp*",
"http://www.google.ba/",
"http://www.google.ba/search*",
"http://www.google.ba/webhp*",
"http://www.google.be/",
"http://www.google.be/search*",
"http://www.google.be/webhp*",
"http://www.google.bf/",
"http://www.google.bf/search*",
"http://www.google.bf/webhp*",
"http://www.google.bg/",
"http://www.google.bg/search*",
"http://www.google.bg/webhp*",
"http://www.google.bi/",
"http://www.google.bi/search*",
"http://www.google.bi/webhp*",
"http://www.google.bj/",
"http://www.google.bj/search*",
"http://www.google.bj/webhp*",
"http://www.google.bs/",
"http://www.google.bs/search*",
"http://www.google.bs/webhp*",
"http://www.google.by/",
"http://www.google.by/search*",
"http://www.google.by/webhp*",
"http://www.google.ca/",
"http://www.google.ca/search*",
"http://www.google.ca/webhp*",
"http://www.google.cat/",
"http://www.google.cat/search*",
"http://www.google.cat/webhp*",
"http://www.google.cd/",
"http://www.google.cd/search*",
"http://www.google.cd/webhp*",
"http://www.google.cf/",
"http://www.google.cf/search*",
"http://www.google.cf/webhp*",
"http://www.google.cg/",
"http://www.google.cg/search*",
"http://www.google.cg/webhp*",
"http://www.google.ch/",
"http://www.google.ch/search*",
"http://www.google.ch/webhp*",
"http://www.google.ci/",
"http://www.google.ci/search*",
"http://www.google.ci/webhp*",
"http://www.google.cl/",
"http://www.google.cl/search*",
"http://www.google.cl/webhp*",
"http://www.google.cm/",
"http://www.google.cm/search*",
"http://www.google.cm/webhp*",
"http://www.google.cn/",
"http://www.google.cn/search*",
"http://www.google.cn/webhp*",
"http://www.google.co.bw/",
"http://www.google.co.bw/search*",
"http://www.google.co.bw/webhp*",
"http://www.google.co.ck/",
"http://www.google.co.ck/search*",
"http://www.google.co.ck/webhp*",
"http://www.google.co.cr/",
"http://www.google.co.cr/search*",
"http://www.google.co.cr/webhp*",
"http://www.google.co.id/",
"http://www.google.co.id/search*",
"http://www.google.co.id/webhp*",
"http://www.google.co.il/",
"http://www.google.co.il/search*",
"http://www.google.co.il/webhp*",
"http://www.google.co.in/",
"http://www.google.co.in/search*",
"http://www.google.co.in/webhp*",
"http://www.google.co.jp/",
"http://www.google.co.jp/search*",
"http://www.google.co.jp/webhp*",
"http://www.google.co.ke/",
"http://www.google.co.ke/search*",
"http://www.google.co.ke/webhp*",
"http://www.google.co.kr/",
"http://www.google.co.kr/search*",
"http://www.google.co.kr/webhp*",
"http://www.google.co.ls/",
"http://www.google.co.ls/search*",
"http://www.google.co.ls/webhp*",
"http://www.google.co.ma/",
"http://www.google.co.ma/search*",
"http://www.google.co.ma/webhp*",
"http://www.google.co.mz/",
"http://www.google.co.mz/search*",
"http://www.google.co.mz/webhp*",
"http://www.google.co.nz/",
"http://www.google.co.nz/search*",
"http://www.google.co.nz/webhp*",
"http://www.google.co.th/",
"http://www.google.co.th/search*",
"http://www.google.co.th/webhp*",
"http://www.google.co.tz/",
"http://www.google.co.tz/search*",
"http://www.google.co.tz/webhp*",
"http://www.google.co.ug/",
"http://www.google.co.ug/search*",
"http://www.google.co.ug/webhp*",
"http://www.google.co.uk/",
"http://www.google.co.uk/search*",
"http://www.google.co.uk/webhp*",
"http://www.google.co.uz/",
"http://www.google.co.uz/search*",
"http://www.google.co.uz/webhp*",
"http://www.google.co.ve/",
"http://www.google.co.ve/search*",
"http://www.google.co.ve/webhp*",
"http://www.google.co.vi/",
"http://www.google.co.vi/search*",
"http://www.google.co.vi/webhp*",
"http://www.google.co.za/",
"http://www.google.co.za/search*",
"http://www.google.co.za/webhp*",
"http://www.google.co.zm/",
"http://www.google.co.zm/search*",
"http://www.google.co.zm/webhp*",
"http://www.google.co.zw/",
"http://www.google.co.zw/search*",
"http://www.google.co.zw/webhp*",
"http://www.google.com/",
"http://www.google.com/webhp*",
"http://www.google.com/search*",
"http://www.google.com.af/",
"http://www.google.com.af/search*",
"http://www.google.com.af/webhp*",
"http://www.google.com.ag/",
"http://www.google.com.ag/search*",
"http://www.google.com.ag/webhp*",
"http://www.google.com.ai/",
"http://www.google.com.ai/search*",
"http://www.google.com.ai/webhp*",
"http://www.google.com.ar/",
"http://www.google.com.ar/search*",
"http://www.google.com.ar/webhp*",
"http://www.google.com.au/",
"http://www.google.com.au/search*",
"http://www.google.com.au/webhp*",
"http://www.google.com.bd/",
"http://www.google.com.bd/search*",
"http://www.google.com.bd/webhp*",
"http://www.google.com.bh/",
"http://www.google.com.bh/search*",
"http://www.google.com.bh/webhp*",
"http://www.google.com.bn/",
"http://www.google.com.bn/search*",
"http://www.google.com.bn/webhp*",
"http://www.google.com.bo/",
"http://www.google.com.bo/search*",
"http://www.google.com.bo/webhp*",
"http://www.google.com.br/",
"http://www.google.com.br/search*",
"http://www.google.com.br/webhp*",
"http://www.google.com.by/",
"http://www.google.com.by/search*",
"http://www.google.com.by/webhp*",
"http://www.google.com.bz/",
"http://www.google.com.bz/search*",
"http://www.google.com.bz/webhp*",
"http://www.google.com.co/",
"http://www.google.com.co/search*",
"http://www.google.com.co/webhp*",
"http://www.google.com.cu/",
"http://www.google.com.cu/search*",
"http://www.google.com.cu/webhp*",
"http://www.google.com.do/",
"http://www.google.com.do/search*",
"http://www.google.com.do/webhp*",
"http://www.google.com.ec/",
"http://www.google.com.ec/search*",
"http://www.google.com.ec/webhp*",
"http://www.google.com.eg/",
"http://www.google.com.eg/search*",
"http://www.google.com.eg/webhp*",
"http://www.google.com.et/",
"http://www.google.com.et/search*",
"http://www.google.com.et/webhp*",
"http://www.google.com.fj/",
"http://www.google.com.fj/search*",
"http://www.google.com.fj/webhp*",
"http://www.google.com.gh/",
"http://www.google.com.gh/search*",
"http://www.google.com.gh/webhp*",
"http://www.google.com.gi/",
"http://www.google.com.gi/search*",
"http://www.google.com.gi/webhp*",
"http://www.google.com.gt/",
"http://www.google.com.gt/search*",
"http://www.google.com.gt/webhp*",
"http://www.google.com.hk/",
"http://www.google.com.hk/search*",
"http://www.google.com.hk/webhp*",
"http://www.google.com.jm/",
"http://www.google.com.jm/search*",
"http://www.google.com.jm/webhp*",
"http://www.google.com.kh/",
"http://www.google.com.kh/search*",
"http://www.google.com.kh/webhp*",
"http://www.google.com.kw/",
"http://www.google.com.kw/search*",
"http://www.google.com.kw/webhp*",
"http://www.google.com.lb/",
"http://www.google.com.lb/search*",
"http://www.google.com.lb/webhp*",
"http://www.google.com.ly/",
"http://www.google.com.ly/search*",
"http://www.google.com.ly/webhp*",
"http://www.google.com.mt/",
"http://www.google.com.mt/search*",
"http://www.google.com.mt/webhp*",
"http://www.google.com.mx/",
"http://www.google.com.mx/search*",
"http://www.google.com.mx/webhp*",
"http://www.google.com.my/",
"http://www.google.com.my/search*",
"http://www.google.com.my/webhp*",
"http://www.google.com.na/",
"http://www.google.com.na/search*",
"http://www.google.com.na/webhp*",
"http://www.google.com.nf/",
"http://www.google.com.nf/search*",
"http://www.google.com.nf/webhp*",
"http://www.google.com.ng/",
"http://www.google.com.ng/search*",
"http://www.google.com.ng/webhp*",
"http://www.google.com.ni/",
"http://www.google.com.ni/search*",
"http://www.google.com.ni/webhp*",
"http://www.google.com.np/",
"http://www.google.com.np/search*",
"http://www.google.com.np/webhp*",
"http://www.google.com.om/",
"http://www.google.com.om/search*",
"http://www.google.com.om/webhp*",
"http://www.google.com.pa/",
"http://www.google.com.pa/search*",
"http://www.google.com.pa/webhp*",
"http://www.google.com.pe/",
"http://www.google.com.pe/search*",
"http://www.google.com.pe/webhp*",
"http://www.google.com.ph/",
"http://www.google.com.ph/search*",
"http://www.google.com.ph/webhp*",
"http://www.google.com.pk/",
"http://www.google.com.pk/search*",
"http://www.google.com.pk/webhp*",
"http://www.google.com.pr/",
"http://www.google.com.pr/search*",
"http://www.google.com.pr/webhp*",
"http://www.google.com.py/",
"http://www.google.com.py/search*",
"http://www.google.com.py/webhp*",
"http://www.google.com.qa/",
"http://www.google.com.qa/search*",
"http://www.google.com.qa/webhp*",
"http://www.google.com.sa/",
"http://www.google.com.sa/search*",
"http://www.google.com.sa/webhp*",
"http://www.google.com.sb/",
"http://www.google.com.sb/search*",
"http://www.google.com.sb/webhp*",
"http://www.google.com.sg/",
"http://www.google.com.sg/search*",
"http://www.google.com.sg/webhp*",
"http://www.google.com.sl/",
"http://www.google.com.sl/search*",
"http://www.google.com.sl/webhp*",
"http://www.google.com.sv/",
"http://www.google.com.sv/search*",
"http://www.google.com.sv/webhp*",
"http://www.google.com.tj/",
"http://www.google.com.tj/search*",
"http://www.google.com.tj/webhp*",
"http://www.google.com.tr/",
"http://www.google.com.tr/search*",
"http://www.google.com.tr/webhp*",
"http://www.google.com.tw/",
"http://www.google.com.tw/search*",
"http://www.google.com.tw/webhp*",
"http://www.google.com.ua/",
"http://www.google.com.ua/search*",
"http://www.google.com.ua/webhp*",
"http://www.google.com.uy/",
"http://www.google.com.uy/search*",
"http://www.google.com.uy/webhp*",
"http://www.google.com.vc/",
"http://www.google.com.vc/search*",
"http://www.google.com.vc/webhp*",
"http://www.google.com.vn/",
"http://www.google.com.vn/search*",
"http://www.google.com.vn/webhp*",
"http://www.google.cz/",
"http://www.google.cz/search*",
"http://www.google.cz/webhp*",
"http://www.google.de/",
"http://www.google.de/search*",
"http://www.google.de/webhp*",
"http://www.google.dj/",
"http://www.google.dj/search*",
"http://www.google.dj/webhp*",
"http://www.google.dk/",
"http://www.google.dk/search*",
"http://www.google.dk/webhp*",
"http://www.google.dm/",
"http://www.google.dm/search*",
"http://www.google.dm/webhp*",
"http://www.google.dz/",
"http://www.google.dz/search*",
"http://www.google.dz/webhp*",
"http://www.google.ee/",
"http://www.google.ee/search*",
"http://www.google.ee/webhp*",
"http://www.google.es/",
"http://www.google.es/search*",
"http://www.google.es/webhp*",
"http://www.google.fi/",
"http://www.google.fi/search*",
"http://www.google.fi/webhp*",
"http://www.google.fm/",
"http://www.google.fm/search*",
"http://www.google.fm/webhp*",
"http://www.google.fr/",
"http://www.google.fr/search*",
"http://www.google.fr/webhp*",
"http://www.google.ga/",
"http://www.google.ga/search*",
"http://www.google.ga/webhp*",
"http://www.google.ge/",
"http://www.google.ge/search*",
"http://www.google.ge/webhp*",
"http://www.google.gg/",
"http://www.google.gg/search*",
"http://www.google.gg/webhp*",
"http://www.google.gl/",
"http://www.google.gl/search*",
"http://www.google.gl/webhp*",
"http://www.google.gm/",
"http://www.google.gm/search*",
"http://www.google.gm/webhp*",
"http://www.google.gp/",
"http://www.google.gp/search*",
"http://www.google.gp/webhp*",
"http://www.google.gr/",
"http://www.google.gr/search*",
"http://www.google.gr/webhp*",
"http://www.google.gy/",
"http://www.google.gy/search*",
"http://www.google.gy/webhp*",
"http://www.google.hn/",
"http://www.google.hn/search*",
"http://www.google.hn/webhp*",
"http://www.google.hr/",
"http://www.google.hr/search*",
"http://www.google.hr/webhp*",
"http://www.google.ht/",
"http://www.google.ht/search*",
"http://www.google.ht/webhp*",
"http://www.google.hu/",
"http://www.google.hu/search*",
"http://www.google.hu/webhp*",
"http://www.google.ie/",
"http://www.google.ie/search*",
"http://www.google.ie/webhp*",
"http://www.google.im/",
"http://www.google.im/search*",
"http://www.google.im/webhp*",
"http://www.google.is/",
"http://www.google.is/search*",
"http://www.google.is/webhp*",
"http://www.google.it/",
"http://www.google.it/search*",
"http://www.google.it/webhp*",
"http://www.google.it.ao/",
"http://www.google.it.ao/search*",
"http://www.google.it.ao/webhp*",
"http://www.google.je/",
"http://www.google.je/search*",
"http://www.google.je/webhp*",
"http://www.google.jo/",
"http://www.google.jo/search*",
"http://www.google.jo/webhp*",
"http://www.google.kg/",
"http://www.google.kg/search*",
"http://www.google.kg/webhp*",
"http://www.google.ki/",
"http://www.google.ki/search*",
"http://www.google.ki/webhp*",
"http://www.google.kz/",
"http://www.google.kz/search*",
"http://www.google.kz/webhp*",
"http://www.google.la/",
"http://www.google.la/search*",
"http://www.google.la/webhp*",
"http://www.google.li/",
"http://www.google.li/search*",
"http://www.google.li/webhp*",
"http://www.google.lk/",
"http://www.google.lk/search*",
"http://www.google.lk/webhp*",
"http://www.google.lt/",
"http://www.google.lt/search*",
"http://www.google.lt/webhp*",
"http://www.google.lu/",
"http://www.google.lu/search*",
"http://www.google.lu/webhp*",
"http://www.google.lv/",
"http://www.google.lv/search*",
"http://www.google.lv/webhp*",
"http://www.google.md/",
"http://www.google.md/search*",
"http://www.google.md/webhp*",
"http://www.google.me/",
"http://www.google.me/search*",
"http://www.google.me/webhp*",
"http://www.google.mg/",
"http://www.google.mg/search*",
"http://www.google.mg/webhp*",
"http://www.google.mk/",
"http://www.google.mk/search*",
"http://www.google.mk/webhp*",
"http://www.google.ml/",
"http://www.google.ml/search*",
"http://www.google.ml/webhp*",
"http://www.google.mn/",
"http://www.google.mn/search*",
"http://www.google.mn/webhp*",
"http://www.google.ms/",
"http://www.google.ms/search*",
"http://www.google.ms/webhp*",
"http://www.google.mu/",
"http://www.google.mu/search*",
"http://www.google.mu/webhp*",
"http://www.google.mv/",
"http://www.google.mv/search*",
"http://www.google.mv/webhp*",
"http://www.google.mw/",
"http://www.google.mw/search*",
"http://www.google.mw/webhp*",
"http://www.google.ne/",
"http://www.google.ne/search*",
"http://www.google.ne/webhp*",
"http://www.google.nl/",
"http://www.google.nl/search*",
"http://www.google.nl/webhp*",
"http://www.google.no/",
"http://www.google.no/search*",
"http://www.google.no/webhp*",
"http://www.google.nr/",
"http://www.google.nr/search*",
"http://www.google.nr/webhp*",
"http://www.google.nu/",
"http://www.google.nu/search*",
"http://www.google.nu/webhp*",
"http://www.google.pl/",
"http://www.google.pl/search*",
"http://www.google.pl/webhp*",
"http://www.google.pn/",
"http://www.google.pn/search*",
"http://www.google.pn/webhp*",
"http://www.google.ps/",
"http://www.google.ps/search*",
"http://www.google.ps/webhp*",
"http://www.google.pt/",
"http://www.google.pt/search*",
"http://www.google.pt/webhp*",
"http://www.google.ro/",
"http://www.google.ro/search*",
"http://www.google.ro/webhp*",
"http://www.google.rs/",
"http://www.google.rs/search*",
"http://www.google.rs/webhp*",
"http://www.google.ru/",
"http://www.google.ru/search*",
"http://www.google.ru/webhp*",
"http://www.google.rw/",
"http://www.google.rw/search*",
"http://www.google.rw/webhp*",
"http://www.google.sc/",
"http://www.google.sc/search*",
"http://www.google.sc/webhp*",
"http://www.google.se/",
"http://www.google.se/search*",
"http://www.google.se/webhp*",
"http://www.google.sh/",
"http://www.google.sh/search*",
"http://www.google.sh/webhp*",
"http://www.google.si/",
"http://www.google.si/search*",
"http://www.google.si/webhp*",
"http://www.google.sk/",
"http://www.google.sk/search*",
"http://www.google.sk/webhp*",
"http://www.google.sm/",
"http://www.google.sm/search*",
"http://www.google.sm/webhp*",
"http://www.google.sn/",
"http://www.google.sn/search*",
"http://www.google.sn/webhp*",
"http://www.google.st/",
"http://www.google.st/search*",
"http://www.google.st/webhp*",
"http://www.google.td/",
"http://www.google.td/search*",
"http://www.google.td/webhp*",
"http://www.google.tg/",
"http://www.google.tg/search*",
"http://www.google.tg/webhp*",
"http://www.google.tk/",
"http://www.google.tk/search*",
"http://www.google.tk/webhp*",
"http://www.google.tl/",
"http://www.google.tl/search*",
"http://www.google.tl/webhp*",
"http://www.google.tm/",
"http://www.google.tm/search*",
"http://www.google.tm/webhp*",
"http://www.google.to/",
"http://www.google.to/search*",
"http://www.google.to/webhp*",
"http://www.google.tt/",
"http://www.google.tt/search*",
"http://www.google.tt/webhp*",
"http://www.google.vg/",
"http://www.google.vg/search*",
"http://www.google.vg/webhp*",
"http://www.google.vu/",
"http://www.google.vu/search*",
"http://www.google.vu/webhp*",
"http://www.google.ws/",
"http://www.google.ws/search*",
"http://www.google.ws/webhp*",
"https://encrypted.google.com/",
"https://encrypted.google.com/search*",
"https://encrypted.google.com/webhp*",
"https://www.google.com/",
"https://www.google.com/search*",
"https://www.google.com/webhp*"
],
"js": ["common.js", "content_script.js"]
}
]
}
| {
"pile_set_name": "Github"
} |
<ASX version="3.0">
<TITLE>My Test Playlist</TITLE>
<ENTRY>
<STARTTIME value="1.2.3.4.5.text" />
<TITLE>Short timecode video</TITLE>
<AUTHOR>Novell, Inc</AUTHOR>
<COPYRIGHT>(c) 2008 Novell, Inc</COPYRIGHT>
<REF HREF="../video/timecode-short.wmv" />
</ENTRY>
</ASX>
| {
"pile_set_name": "Github"
} |
//
// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_LOCALE_INFO_HPP_INCLUDED
#define BOOST_LOCALE_INFO_HPP_INCLUDED
#include <boost/locale/config.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4275 4251 4231 4660)
#endif
#include <locale>
#include <string>
namespace boost {
namespace locale {
///
/// \brief a facet that holds general information about locale
///
/// This facet should be always created in order to make all Boost.Locale functions work
///
class BOOST_LOCALE_DECL info : public std::locale::facet
{
public:
static std::locale::id id; ///< This member uniquely defines this facet, required by STL
///
/// String information about the locale
///
enum string_propery {
language_property, ///< ISO 639 language id
country_property, ///< ISO 3166 country id
variant_property, ///< Variant for locale
encoding_property, ///< encoding name
name_property ///< locale name
};
///
/// Integer information about locale
///
enum integer_property {
utf8_property ///< Non zero value if uses UTF-8 encoding
};
///
/// Standard facet's constructor
///
info(size_t refs = 0) : std::locale::facet(refs)
{
}
///
/// Get language name
///
std::string language() const
{
return get_string_property(language_property);
}
///
/// Get country name
///
std::string country() const
{
return get_string_property(country_property);
}
///
/// Get locale variant
///
std::string variant() const
{
return get_string_property(variant_property);
}
///
/// Get encoding
///
std::string encoding() const
{
return get_string_property(encoding_property);
}
///
/// Get the name of the locale, like en_US.UTF-8
///
std::string name() const
{
return get_string_property(name_property);
}
///
/// True if the underlying encoding is UTF-8 (for char streams and strings)
///
bool utf8() const
{
return get_integer_property(utf8_property) != 0;
}
#if defined (__SUNPRO_CC) && defined (_RWSTD_VER)
std::locale::id& __get_id (void) const { return id; }
#endif
protected:
///
/// Get string property by its id \a v
///
virtual std::string get_string_property(string_propery v) const = 0;
///
/// Get integer property by its id \a v
///
virtual int get_integer_property(integer_property v) const = 0;
};
}
}
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#endif
// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
| {
"pile_set_name": "Github"
} |
{
"channel": {
"channelId": 0,
"accessHash": 0,
"_constructor": "inputChannel#afeb712e"
},
"userId": {
"_constructor": "inputUserEmpty#b98886cf"
},
"kicked": false,
"_constructor": "channels.kickFromChannel#a672de14"
} | {
"pile_set_name": "Github"
} |
<?php
/*
* This file is part of PhpSpec, A php toolset to drive emergent
* design by specification.
*
* (c) Marcello Duarte <[email protected]>
* (c) Konstantin Kudryashov <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PhpSpec\Wrapper\Subject\Expectation;
use PhpSpec\Util\Instantiator;
use PhpSpec\Wrapper\Subject\WrappedObject;
final class ConstructorDecorator extends Decorator implements Expectation
{
/**
* @param Expectation $expectation
*/
public function __construct(Expectation $expectation)
{
$this->setExpectation($expectation);
}
/**
* @param string $alias
* @param mixed $subject
* @param array $arguments
* @param WrappedObject|null $wrappedObject
*
* @return mixed
*
* @throws \PhpSpec\Exception\ErrorException
* @throws \PhpSpec\Exception\Example\ErrorException
* @throws \PhpSpec\Exception\Fracture\FractureException
*/
public function match(string $alias, $subject, array $arguments = [], WrappedObject $wrappedObject = null)
{
try {
$wrapped = $subject->getWrappedObject();
} catch (\PhpSpec\Exception\Example\ErrorException $e) {
throw $e;
} catch (\PhpSpec\Exception\Fracture\FractureException $e) {
throw $e;
} catch (\Exception $e) {
if ($wrappedObject === null || $wrappedObject->getClassName() === null) {
throw $e;
}
$instantiator = new Instantiator();
$wrapped = $instantiator->instantiate(
$wrappedObject->getClassName()
);
}
return $this->getExpectation()->match($alias, $wrapped, $arguments);
}
}
| {
"pile_set_name": "Github"
} |
// Underscore.js 1.7.0
// http://underscorejs.org
// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license.
(function() {
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `exports` on the server.
var root = this;
// Save the previous value of the `_` variable.
//var previousUnderscore = root._;
// Save bytes in the minified (but not gzipped) version:
var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
// Create quick reference variables for speed access to core prototypes.
var
push = ArrayProto.push,
slice = ArrayProto.slice,
concat = ArrayProto.concat,
toString = ObjProto.toString,
hasOwnProperty = ObjProto.hasOwnProperty;
// All **ECMAScript 5** native function implementations that we hope to use
// are declared here.
var
nativeIsArray = Array.isArray,
nativeKeys = Object.keys,
nativeBind = FuncProto.bind;
// Create a safe reference to the Underscore object for use below.
var _ = function(obj) {
if (obj instanceof _) return obj;
if (!(this instanceof _)) return new _(obj);
this._wrapped = obj;
};
// Export the Underscore object for **Node.js**, with
// backwards-compatibility for the old `require()` API. If we're in
// the browser, add `_` as a global object.
if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = _;
}
exports._ = _;
} else {
root._ = _;
}
// Current version.
_.VERSION = '1.7.0';
// Internal function that returns an efficient (for current engines) version
// of the passed-in callback, to be repeatedly applied in other Underscore
// functions.
var createCallback = function(func, context, argCount) {
if (context === void 0) return func;
switch (argCount == null ? 3 : argCount) {
case 1: return function(value) {
return func.call(context, value);
};
case 2: return function(value, other) {
return func.call(context, value, other);
};
case 3: return function(value, index, collection) {
return func.call(context, value, index, collection);
};
case 4: return function(accumulator, value, index, collection) {
return func.call(context, accumulator, value, index, collection);
};
}
return function() {
return func.apply(context, arguments);
};
};
// A mostly-internal function to generate callbacks that can be applied
// to each element in a collection, returning the desired result — either
// identity, an arbitrary callback, a property matcher, or a property accessor.
_.iteratee = function(value, context, argCount) {
if (value == null) return _.identity;
if (_.isFunction(value)) return createCallback(value, context, argCount);
if (_.isObject(value)) return _.matches(value);
return _.property(value);
};
// Collection Functions
// --------------------
// The cornerstone, an `each` implementation, aka `forEach`.
// Handles raw objects in addition to array-likes. Treats all
// sparse array-likes as if they were dense.
_.each = _.forEach = function(obj, iteratee, context) {
if (obj == null) return obj;
iteratee = createCallback(iteratee, context);
var i, length = obj.length;
if (length === +length) {
for (i = 0; i < length; i++) {
iteratee(obj[i], i, obj);
}
} else {
var keys = _.keys(obj);
for (i = 0, length = keys.length; i < length; i++) {
iteratee(obj[keys[i]], keys[i], obj);
}
}
return obj;
};
// Return the results of applying the iteratee to each element.
_.map = _.collect = function(obj, iteratee, context) {
if (obj == null) return [];
iteratee = _.iteratee(iteratee, context);
var keys = obj.length !== +obj.length && _.keys(obj),
length = (keys || obj).length,
results = Array(length),
currentKey;
for (var index = 0; index < length; index++) {
currentKey = keys ? keys[index] : index;
results[index] = iteratee(obj[currentKey], currentKey, obj);
}
return results;
};
var reduceError = 'Reduce of empty array with no initial value';
// **Reduce** builds up a single result from a list of values, aka `inject`,
// or `foldl`.
_.reduce = _.foldl = _.inject = function(obj, iteratee, memo, context) {
if (obj == null) obj = [];
iteratee = createCallback(iteratee, context, 4);
var keys = obj.length !== +obj.length && _.keys(obj),
length = (keys || obj).length,
index = 0, currentKey;
if (arguments.length < 3) {
if (!length) throw new TypeError(reduceError);
memo = obj[keys ? keys[index++] : index++];
}
for (; index < length; index++) {
currentKey = keys ? keys[index] : index;
memo = iteratee(memo, obj[currentKey], currentKey, obj);
}
return memo;
};
// The right-associative version of reduce, also known as `foldr`.
_.reduceRight = _.foldr = function(obj, iteratee, memo, context) {
if (obj == null) obj = [];
iteratee = createCallback(iteratee, context, 4);
var keys = obj.length !== + obj.length && _.keys(obj),
index = (keys || obj).length,
currentKey;
if (arguments.length < 3) {
if (!index) throw new TypeError(reduceError);
memo = obj[keys ? keys[--index] : --index];
}
while (index--) {
currentKey = keys ? keys[index] : index;
memo = iteratee(memo, obj[currentKey], currentKey, obj);
}
return memo;
};
// Return the first value which passes a truth test. Aliased as `detect`.
_.find = _.detect = function(obj, predicate, context) {
var result;
predicate = _.iteratee(predicate, context);
_.some(obj, function(value, index, list) {
if (predicate(value, index, list)) {
result = value;
return true;
}
});
return result;
};
// Return all the elements that pass a truth test.
// Aliased as `select`.
_.filter = _.select = function(obj, predicate, context) {
var results = [];
if (obj == null) return results;
predicate = _.iteratee(predicate, context);
_.each(obj, function(value, index, list) {
if (predicate(value, index, list)) results.push(value);
});
return results;
};
// Return all the elements for which a truth test fails.
_.reject = function(obj, predicate, context) {
return _.filter(obj, _.negate(_.iteratee(predicate)), context);
};
// Determine whether all of the elements match a truth test.
// Aliased as `all`.
_.every = _.all = function(obj, predicate, context) {
if (obj == null) return true;
predicate = _.iteratee(predicate, context);
var keys = obj.length !== +obj.length && _.keys(obj),
length = (keys || obj).length,
index, currentKey;
for (index = 0; index < length; index++) {
currentKey = keys ? keys[index] : index;
if (!predicate(obj[currentKey], currentKey, obj)) return false;
}
return true;
};
// Determine if at least one element in the object matches a truth test.
// Aliased as `any`.
_.some = _.any = function(obj, predicate, context) {
if (obj == null) return false;
predicate = _.iteratee(predicate, context);
var keys = obj.length !== +obj.length && _.keys(obj),
length = (keys || obj).length,
index, currentKey;
for (index = 0; index < length; index++) {
currentKey = keys ? keys[index] : index;
if (predicate(obj[currentKey], currentKey, obj)) return true;
}
return false;
};
// Determine if the array or object contains a given value (using `===`).
// Aliased as `include`.
_.contains = _.include = function(obj, target) {
if (obj == null) return false;
if (obj.length !== +obj.length) obj = _.values(obj);
return _.indexOf(obj, target) >= 0;
};
// Invoke a method (with arguments) on every item in a collection.
_.invoke = function(obj, method) {
var args = slice.call(arguments, 2);
var isFunc = _.isFunction(method);
return _.map(obj, function(value) {
return (isFunc ? method : value[method]).apply(value, args);
});
};
// Convenience version of a common use case of `map`: fetching a property.
_.pluck = function(obj, key) {
return _.map(obj, _.property(key));
};
// Convenience version of a common use case of `filter`: selecting only objects
// containing specific `key:value` pairs.
_.where = function(obj, attrs) {
return _.filter(obj, _.matches(attrs));
};
// Convenience version of a common use case of `find`: getting the first object
// containing specific `key:value` pairs.
_.findWhere = function(obj, attrs) {
return _.find(obj, _.matches(attrs));
};
// Return the maximum element (or element-based computation).
_.max = function(obj, iteratee, context) {
var result = -Infinity, lastComputed = -Infinity,
value, computed;
if (iteratee == null && obj != null) {
obj = obj.length === +obj.length ? obj : _.values(obj);
for (var i = 0, length = obj.length; i < length; i++) {
value = obj[i];
if (value > result) {
result = value;
}
}
} else {
iteratee = _.iteratee(iteratee, context);
_.each(obj, function(value, index, list) {
computed = iteratee(value, index, list);
if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
result = value;
lastComputed = computed;
}
});
}
return result;
};
// Return the minimum element (or element-based computation).
_.min = function(obj, iteratee, context) {
var result = Infinity, lastComputed = Infinity,
value, computed;
if (iteratee == null && obj != null) {
obj = obj.length === +obj.length ? obj : _.values(obj);
for (var i = 0, length = obj.length; i < length; i++) {
value = obj[i];
if (value < result) {
result = value;
}
}
} else {
iteratee = _.iteratee(iteratee, context);
_.each(obj, function(value, index, list) {
computed = iteratee(value, index, list);
if (computed < lastComputed || computed === Infinity && result === Infinity) {
result = value;
lastComputed = computed;
}
});
}
return result;
};
// Shuffle a collection, using the modern version of the
// [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
_.shuffle = function(obj) {
var set = obj && obj.length === +obj.length ? obj : _.values(obj);
var length = set.length;
var shuffled = Array(length);
for (var index = 0, rand; index < length; index++) {
rand = _.random(0, index);
if (rand !== index) shuffled[index] = shuffled[rand];
shuffled[rand] = set[index];
}
return shuffled;
};
// Sample **n** random values from a collection.
// If **n** is not specified, returns a single random element.
// The internal `guard` argument allows it to work with `map`.
_.sample = function(obj, n, guard) {
if (n == null || guard) {
if (obj.length !== +obj.length) obj = _.values(obj);
return obj[_.random(obj.length - 1)];
}
return _.shuffle(obj).slice(0, Math.max(0, n));
};
// Sort the object's values by a criterion produced by an iteratee.
_.sortBy = function(obj, iteratee, context) {
iteratee = _.iteratee(iteratee, context);
return _.pluck(_.map(obj, function(value, index, list) {
return {
value: value,
index: index,
criteria: iteratee(value, index, list)
};
}).sort(function(left, right) {
var a = left.criteria;
var b = right.criteria;
if (a !== b) {
if (a > b || a === void 0) return 1;
if (a < b || b === void 0) return -1;
}
return left.index - right.index;
}), 'value');
};
// An internal function used for aggregate "group by" operations.
var group = function(behavior) {
return function(obj, iteratee, context) {
var result = {};
iteratee = _.iteratee(iteratee, context);
_.each(obj, function(value, index) {
var key = iteratee(value, index, obj);
behavior(result, value, key);
});
return result;
};
};
// Groups the object's values by a criterion. Pass either a string attribute
// to group by, or a function that returns the criterion.
_.groupBy = group(function(result, value, key) {
if (_.has(result, key)) result[key].push(value); else result[key] = [value];
});
// Indexes the object's values by a criterion, similar to `groupBy`, but for
// when you know that your index values will be unique.
_.indexBy = group(function(result, value, key) {
result[key] = value;
});
// Counts instances of an object that group by a certain criterion. Pass
// either a string attribute to count by, or a function that returns the
// criterion.
_.countBy = group(function(result, value, key) {
if (_.has(result, key)) result[key]++; else result[key] = 1;
});
// Use a comparator function to figure out the smallest index at which
// an object should be inserted so as to maintain order. Uses binary search.
_.sortedIndex = function(array, obj, iteratee, context) {
iteratee = _.iteratee(iteratee, context, 1);
var value = iteratee(obj);
var low = 0, high = array.length;
while (low < high) {
var mid = low + high >>> 1;
if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
}
return low;
};
// Safely create a real, live array from anything iterable.
_.toArray = function(obj) {
if (!obj) return [];
if (_.isArray(obj)) return slice.call(obj);
if (obj.length === +obj.length) return _.map(obj, _.identity);
return _.values(obj);
};
// Return the number of elements in an object.
_.size = function(obj) {
if (obj == null) return 0;
return obj.length === +obj.length ? obj.length : _.keys(obj).length;
};
// Split a collection into two arrays: one whose elements all satisfy the given
// predicate, and one whose elements all do not satisfy the predicate.
_.partition = function(obj, predicate, context) {
predicate = _.iteratee(predicate, context);
var pass = [], fail = [];
_.each(obj, function(value, key, obj) {
(predicate(value, key, obj) ? pass : fail).push(value);
});
return [pass, fail];
};
// Array Functions
// ---------------
// Get the first element of an array. Passing **n** will return the first N
// values in the array. Aliased as `head` and `take`. The **guard** check
// allows it to work with `_.map`.
_.first = _.head = _.take = function(array, n, guard) {
if (array == null) return void 0;
if (n == null || guard) return array[0];
if (n < 0) return [];
return slice.call(array, 0, n);
};
// Returns everything but the last entry of the array. Especially useful on
// the arguments object. Passing **n** will return all the values in
// the array, excluding the last N. The **guard** check allows it to work with
// `_.map`.
_.initial = function(array, n, guard) {
return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
};
// Get the last element of an array. Passing **n** will return the last N
// values in the array. The **guard** check allows it to work with `_.map`.
_.last = function(array, n, guard) {
if (array == null) return void 0;
if (n == null || guard) return array[array.length - 1];
return slice.call(array, Math.max(array.length - n, 0));
};
// Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
// Especially useful on the arguments object. Passing an **n** will return
// the rest N values in the array. The **guard**
// check allows it to work with `_.map`.
_.rest = _.tail = _.drop = function(array, n, guard) {
return slice.call(array, n == null || guard ? 1 : n);
};
// Trim out all falsy values from an array.
_.compact = function(array) {
return _.filter(array, _.identity);
};
// Internal implementation of a recursive `flatten` function.
var flatten = function(input, shallow, strict, output) {
if (shallow && _.every(input, _.isArray)) {
return concat.apply(output, input);
}
for (var i = 0, length = input.length; i < length; i++) {
var value = input[i];
if (!_.isArray(value) && !_.isArguments(value)) {
if (!strict) output.push(value);
} else if (shallow) {
push.apply(output, value);
} else {
flatten(value, shallow, strict, output);
}
}
return output;
};
// Flatten out an array, either recursively (by default), or just one level.
_.flatten = function(array, shallow) {
return flatten(array, shallow, false, []);
};
// Return a version of the array that does not contain the specified value(s).
_.without = function(array) {
return _.difference(array, slice.call(arguments, 1));
};
// Produce a duplicate-free version of the array. If the array has already
// been sorted, you have the option of using a faster algorithm.
// Aliased as `unique`.
_.uniq = _.unique = function(array, isSorted, iteratee, context) {
if (array == null) return [];
if (!_.isBoolean(isSorted)) {
context = iteratee;
iteratee = isSorted;
isSorted = false;
}
if (iteratee != null) iteratee = _.iteratee(iteratee, context);
var result = [];
var seen = [];
for (var i = 0, length = array.length; i < length; i++) {
var value = array[i];
if (isSorted) {
if (!i || seen !== value) result.push(value);
seen = value;
} else if (iteratee) {
var computed = iteratee(value, i, array);
if (_.indexOf(seen, computed) < 0) {
seen.push(computed);
result.push(value);
}
} else if (_.indexOf(result, value) < 0) {
result.push(value);
}
}
return result;
};
// Produce an array that contains the union: each distinct element from all of
// the passed-in arrays.
_.union = function() {
return _.uniq(flatten(arguments, true, true, []));
};
// Produce an array that contains every item shared between all the
// passed-in arrays.
_.intersection = function(array) {
if (array == null) return [];
var result = [];
var argsLength = arguments.length;
for (var i = 0, length = array.length; i < length; i++) {
var item = array[i];
if (_.contains(result, item)) continue;
for (var j = 1; j < argsLength; j++) {
if (!_.contains(arguments[j], item)) break;
}
if (j === argsLength) result.push(item);
}
return result;
};
// Take the difference between one array and a number of other arrays.
// Only the elements present in just the first array will remain.
_.difference = function(array) {
var rest = flatten(slice.call(arguments, 1), true, true, []);
return _.filter(array, function(value){
return !_.contains(rest, value);
});
};
// Zip together multiple lists into a single array -- elements that share
// an index go together.
_.zip = function(array) {
if (array == null) return [];
var length = _.max(arguments, 'length').length;
var results = Array(length);
for (var i = 0; i < length; i++) {
results[i] = _.pluck(arguments, i);
}
return results;
};
// Converts lists into objects. Pass either a single array of `[key, value]`
// pairs, or two parallel arrays of the same length -- one of keys, and one of
// the corresponding values.
_.object = function(list, values) {
if (list == null) return {};
var result = {};
for (var i = 0, length = list.length; i < length; i++) {
if (values) {
result[list[i]] = values[i];
} else {
result[list[i][0]] = list[i][1];
}
}
return result;
};
// Return the position of the first occurrence of an item in an array,
// or -1 if the item is not included in the array.
// If the array is large and already in sort order, pass `true`
// for **isSorted** to use binary search.
_.indexOf = function(array, item, isSorted) {
if (array == null) return -1;
var i = 0, length = array.length;
if (isSorted) {
if (typeof isSorted == 'number') {
i = isSorted < 0 ? Math.max(0, length + isSorted) : isSorted;
} else {
i = _.sortedIndex(array, item);
return array[i] === item ? i : -1;
}
}
for (; i < length; i++) if (array[i] === item) return i;
return -1;
};
_.lastIndexOf = function(array, item, from) {
if (array == null) return -1;
var idx = array.length;
if (typeof from == 'number') {
idx = from < 0 ? idx + from + 1 : Math.min(idx, from + 1);
}
while (--idx >= 0) if (array[idx] === item) return idx;
return -1;
};
// Generate an integer Array containing an arithmetic progression. A port of
// the native Python `range()` function. See
// [the Python documentation](http://docs.python.org/library/functions.html#range).
_.range = function(start, stop, step) {
if (arguments.length <= 1) {
stop = start || 0;
start = 0;
}
step = step || 1;
var length = Math.max(Math.ceil((stop - start) / step), 0);
var range = Array(length);
for (var idx = 0; idx < length; idx++, start += step) {
range[idx] = start;
}
return range;
};
// Function (ahem) Functions
// ------------------
// Reusable constructor function for prototype setting.
var Ctor = function(){};
// Create a function bound to a given object (assigning `this`, and arguments,
// optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
// available.
_.bind = function(func, context) {
var args, bound;
if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');
args = slice.call(arguments, 2);
bound = function() {
if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
Ctor.prototype = func.prototype;
var self = new Ctor;
Ctor.prototype = null;
var result = func.apply(self, args.concat(slice.call(arguments)));
if (_.isObject(result)) return result;
return self;
};
return bound;
};
// Partially apply a function by creating a version that has had some of its
// arguments pre-filled, without changing its dynamic `this` context. _ acts
// as a placeholder, allowing any combination of arguments to be pre-filled.
_.partial = function(func) {
var boundArgs = slice.call(arguments, 1);
return function() {
var position = 0;
var args = boundArgs.slice();
for (var i = 0, length = args.length; i < length; i++) {
if (args[i] === _) args[i] = arguments[position++];
}
while (position < arguments.length) args.push(arguments[position++]);
return func.apply(this, args);
};
};
// Bind a number of an object's methods to that object. Remaining arguments
// are the method names to be bound. Useful for ensuring that all callbacks
// defined on an object belong to it.
_.bindAll = function(obj) {
var i, length = arguments.length, key;
if (length <= 1) throw new Error('bindAll must be passed function names');
for (i = 1; i < length; i++) {
key = arguments[i];
obj[key] = _.bind(obj[key], obj);
}
return obj;
};
// Memoize an expensive function by storing its results.
_.memoize = function(func, hasher) {
var memoize = function(key) {
var cache = memoize.cache;
var address = hasher ? hasher.apply(this, arguments) : key;
if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);
return cache[address];
};
memoize.cache = {};
return memoize;
};
// Delays a function for the given number of milliseconds, and then calls
// it with the arguments supplied.
_.delay = function(func, wait) {
var args = slice.call(arguments, 2);
return setTimeout(function(){
return func.apply(null, args);
}, wait);
};
// Defers a function, scheduling it to run after the current call stack has
// cleared.
_.defer = function(func) {
return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
};
// Returns a function, that, when invoked, will only be triggered at most once
// during a given window of time. Normally, the throttled function will run
// as much as it can, without ever going more than once per `wait` duration;
// but if you'd like to disable the execution on the leading edge, pass
// `{leading: false}`. To disable execution on the trailing edge, ditto.
_.throttle = function(func, wait, options) {
var context, args, result;
var timeout = null;
var previous = 0;
if (!options) options = {};
var later = function() {
previous = options.leading === false ? 0 : _.now();
timeout = null;
result = func.apply(context, args);
if (!timeout) context = args = null;
};
return function() {
var now = _.now();
if (!previous && options.leading === false) previous = now;
var remaining = wait - (now - previous);
context = this;
args = arguments;
if (remaining <= 0 || remaining > wait) {
clearTimeout(timeout);
timeout = null;
previous = now;
result = func.apply(context, args);
if (!timeout) context = args = null;
} else if (!timeout && options.trailing !== false) {
timeout = setTimeout(later, remaining);
}
return result;
};
};
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
_.debounce = function(func, wait, immediate) {
var timeout, args, context, timestamp, result;
var later = function() {
var last = _.now() - timestamp;
if (last < wait && last > 0) {
timeout = setTimeout(later, wait - last);
} else {
timeout = null;
if (!immediate) {
result = func.apply(context, args);
if (!timeout) context = args = null;
}
}
};
return function() {
context = this;
args = arguments;
timestamp = _.now();
var callNow = immediate && !timeout;
if (!timeout) timeout = setTimeout(later, wait);
if (callNow) {
result = func.apply(context, args);
context = args = null;
}
return result;
};
};
// Returns the first function passed as an argument to the second,
// allowing you to adjust arguments, run code before and after, and
// conditionally execute the original function.
_.wrap = function(func, wrapper) {
return _.partial(wrapper, func);
};
// Returns a negated version of the passed-in predicate.
_.negate = function(predicate) {
return function() {
return !predicate.apply(this, arguments);
};
};
// Returns a function that is the composition of a list of functions, each
// consuming the return value of the function that follows.
_.compose = function() {
var args = arguments;
var start = args.length - 1;
return function() {
var i = start;
var result = args[start].apply(this, arguments);
while (i--) result = args[i].call(this, result);
return result;
};
};
// Returns a function that will only be executed after being called N times.
_.after = function(times, func) {
return function() {
if (--times < 1) {
return func.apply(this, arguments);
}
};
};
// Returns a function that will only be executed before being called N times.
_.before = function(times, func) {
var memo;
return function() {
if (--times > 0) {
memo = func.apply(this, arguments);
} else {
func = null;
}
return memo;
};
};
// Returns a function that will be executed at most one time, no matter how
// often you call it. Useful for lazy initialization.
_.once = _.partial(_.before, 2);
// Object Functions
// ----------------
// Retrieve the names of an object's properties.
// Delegates to **ECMAScript 5**'s native `Object.keys`
_.keys = function(obj) {
if (!_.isObject(obj)) return [];
if (nativeKeys) return nativeKeys(obj);
var keys = [];
for (var key in obj) if (_.has(obj, key)) keys.push(key);
return keys;
};
// Retrieve the values of an object's properties.
_.values = function(obj) {
var keys = _.keys(obj);
var length = keys.length;
var values = Array(length);
for (var i = 0; i < length; i++) {
values[i] = obj[keys[i]];
}
return values;
};
// Convert an object into a list of `[key, value]` pairs.
_.pairs = function(obj) {
var keys = _.keys(obj);
var length = keys.length;
var pairs = Array(length);
for (var i = 0; i < length; i++) {
pairs[i] = [keys[i], obj[keys[i]]];
}
return pairs;
};
// Invert the keys and values of an object. The values must be serializable.
_.invert = function(obj) {
var result = {};
var keys = _.keys(obj);
for (var i = 0, length = keys.length; i < length; i++) {
result[obj[keys[i]]] = keys[i];
}
return result;
};
// Return a sorted list of the function names available on the object.
// Aliased as `methods`
_.functions = _.methods = function(obj) {
var names = [];
for (var key in obj) {
if (_.isFunction(obj[key])) names.push(key);
}
return names.sort();
};
// Extend a given object with all the properties in passed-in object(s).
_.extend = function(obj) {
if (!_.isObject(obj)) return obj;
var source, prop;
for (var i = 1, length = arguments.length; i < length; i++) {
source = arguments[i];
for (prop in source) {
if (hasOwnProperty.call(source, prop)) {
obj[prop] = source[prop];
}
}
}
return obj;
};
// Return a copy of the object only containing the whitelisted properties.
_.pick = function(obj, iteratee, context) {
var result = {}, key;
if (obj == null) return result;
if (_.isFunction(iteratee)) {
iteratee = createCallback(iteratee, context);
for (key in obj) {
var value = obj[key];
if (iteratee(value, key, obj)) result[key] = value;
}
} else {
var keys = concat.apply([], slice.call(arguments, 1));
obj = new Object(obj);
for (var i = 0, length = keys.length; i < length; i++) {
key = keys[i];
if (key in obj) result[key] = obj[key];
}
}
return result;
};
// Return a copy of the object without the blacklisted properties.
_.omit = function(obj, iteratee, context) {
if (_.isFunction(iteratee)) {
iteratee = _.negate(iteratee);
} else {
var keys = _.map(concat.apply([], slice.call(arguments, 1)), String);
iteratee = function(value, key) {
return !_.contains(keys, key);
};
}
return _.pick(obj, iteratee, context);
};
// Fill in a given object with default properties.
_.defaults = function(obj) {
if (!_.isObject(obj)) return obj;
for (var i = 1, length = arguments.length; i < length; i++) {
var source = arguments[i];
for (var prop in source) {
if (obj[prop] === void 0) obj[prop] = source[prop];
}
}
return obj;
};
// Create a (shallow-cloned) duplicate of an object.
_.clone = function(obj) {
if (!_.isObject(obj)) return obj;
return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
};
// Invokes interceptor with the obj, and then returns obj.
// The primary purpose of this method is to "tap into" a method chain, in
// order to perform operations on intermediate results within the chain.
_.tap = function(obj, interceptor) {
interceptor(obj);
return obj;
};
// Internal recursive comparison function for `isEqual`.
var eq = function(a, b, aStack, bStack) {
// Identical objects are equal. `0 === -0`, but they aren't identical.
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
if (a === b) return a !== 0 || 1 / a === 1 / b;
// A strict comparison is necessary because `null == undefined`.
if (a == null || b == null) return a === b;
// Unwrap any wrapped objects.
if (a instanceof _) a = a._wrapped;
if (b instanceof _) b = b._wrapped;
// Compare `[[Class]]` names.
var className = toString.call(a);
if (className !== toString.call(b)) return false;
switch (className) {
// Strings, numbers, regular expressions, dates, and booleans are compared by value.
case '[object RegExp]':
// RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
case '[object String]':
// Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
// equivalent to `new String("5")`.
return '' + a === '' + b;
case '[object Number]':
// `NaN`s are equivalent, but non-reflexive.
// Object(NaN) is equivalent to NaN
if (+a !== +a) return +b !== +b;
// An `egal` comparison is performed for other numeric values.
return +a === 0 ? 1 / +a === 1 / b : +a === +b;
case '[object Date]':
case '[object Boolean]':
// Coerce dates and booleans to numeric primitive values. Dates are compared by their
// millisecond representations. Note that invalid dates with millisecond representations
// of `NaN` are not equivalent.
return +a === +b;
}
if (typeof a != 'object' || typeof b != 'object') return false;
// Assume equality for cyclic structures. The algorithm for detecting cyclic
// structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
var length = aStack.length;
while (length--) {
// Linear search. Performance is inversely proportional to the number of
// unique nested structures.
if (aStack[length] === a) return bStack[length] === b;
}
// Objects with different constructors are not equivalent, but `Object`s
// from different frames are.
var aCtor = a.constructor, bCtor = b.constructor;
if (
aCtor !== bCtor &&
// Handle Object.create(x) cases
'constructor' in a && 'constructor' in b &&
!(_.isFunction(aCtor) && aCtor instanceof aCtor &&
_.isFunction(bCtor) && bCtor instanceof bCtor)
) {
return false;
}
// Add the first object to the stack of traversed objects.
aStack.push(a);
bStack.push(b);
var size, result;
// Recursively compare objects and arrays.
if (className === '[object Array]') {
// Compare array lengths to determine if a deep comparison is necessary.
size = a.length;
result = size === b.length;
if (result) {
// Deep compare the contents, ignoring non-numeric properties.
while (size--) {
if (!(result = eq(a[size], b[size], aStack, bStack))) break;
}
}
} else {
// Deep compare objects.
var keys = _.keys(a), key;
size = keys.length;
// Ensure that both objects contain the same number of properties before comparing deep equality.
result = _.keys(b).length === size;
if (result) {
while (size--) {
// Deep compare each member
key = keys[size];
if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;
}
}
}
// Remove the first object from the stack of traversed objects.
aStack.pop();
bStack.pop();
return result;
};
// Perform a deep comparison to check if two objects are equal.
_.isEqual = function(a, b) {
return eq(a, b, [], []);
};
// Is a given array, string, or object empty?
// An "empty" object has no enumerable own-properties.
_.isEmpty = function(obj) {
if (obj == null) return true;
if (_.isArray(obj) || _.isString(obj) || _.isArguments(obj)) return obj.length === 0;
for (var key in obj) if (_.has(obj, key)) return false;
return true;
};
// Is a given value a DOM element?
_.isElement = function(obj) {
return !!(obj && obj.nodeType === 1);
};
// Is a given value an array?
// Delegates to ECMA5's native Array.isArray
_.isArray = nativeIsArray || function(obj) {
return toString.call(obj) === '[object Array]';
};
// Is a given variable an object?
_.isObject = function(obj) {
var type = typeof obj;
return type === 'function' || type === 'object' && !!obj;
};
// Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
_.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
_['is' + name] = function(obj) {
return toString.call(obj) === '[object ' + name + ']';
};
});
// Define a fallback version of the method in browsers (ahem, IE), where
// there isn't any inspectable "Arguments" type.
if (!_.isArguments(arguments)) {
_.isArguments = function(obj) {
return _.has(obj, 'callee');
};
}
// Optimize `isFunction` if appropriate. Work around an IE 11 bug.
if (typeof /./ !== 'function') {
_.isFunction = function(obj) {
return typeof obj == 'function' || false;
};
}
// Is a given object a finite number?
_.isFinite = function(obj) {
return isFinite(obj) && !isNaN(parseFloat(obj));
};
// Is the given value `NaN`? (NaN is the only number which does not equal itself).
_.isNaN = function(obj) {
return _.isNumber(obj) && obj !== +obj;
};
// Is a given value a boolean?
_.isBoolean = function(obj) {
return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
};
// Is a given value equal to null?
_.isNull = function(obj) {
return obj === null;
};
// Is a given variable undefined?
_.isUndefined = function(obj) {
return obj === void 0;
};
// Shortcut function for checking if an object has a given property directly
// on itself (in other words, not on a prototype).
_.has = function(obj, key) {
return obj != null && hasOwnProperty.call(obj, key);
};
// Utility Functions
// -----------------
// Run Underscore.js in *noConflict* mode, returning the `_` variable to its
// previous owner. Returns a reference to the Underscore object.
_.noConflict = function() {
root._ = previousUnderscore;
return this;
};
// Keep the identity function around for default iteratees.
_.identity = function(value) {
return value;
};
// Predicate-generating functions. Often useful outside of Underscore.
_.constant = function(value) {
return function() {
return value;
};
};
_.noop = function(){};
_.property = function(key) {
return function(obj) {
return obj[key];
};
};
// Returns a predicate for checking whether an object has a given set of `key:value` pairs.
_.matches = function(attrs) {
var pairs = _.pairs(attrs), length = pairs.length;
return function(obj) {
if (obj == null) return !length;
obj = new Object(obj);
for (var i = 0; i < length; i++) {
var pair = pairs[i], key = pair[0];
if (pair[1] !== obj[key] || !(key in obj)) return false;
}
return true;
};
};
// Run a function **n** times.
_.times = function(n, iteratee, context) {
var accum = Array(Math.max(0, n));
iteratee = createCallback(iteratee, context, 1);
for (var i = 0; i < n; i++) accum[i] = iteratee(i);
return accum;
};
// Return a random integer between min and max (inclusive).
_.random = function(min, max) {
if (max == null) {
max = min;
min = 0;
}
return min + Math.floor(Math.random() * (max - min + 1));
};
// A (possibly faster) way to get the current timestamp as an integer.
_.now = Date.now || function() {
return new Date().getTime();
};
// List of HTML entities for escaping.
var escapeMap = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": ''',
'`': '`'
};
var unescapeMap = _.invert(escapeMap);
// Functions for escaping and unescaping strings to/from HTML interpolation.
var createEscaper = function(map) {
var escaper = function(match) {
return map[match];
};
// Regexes for identifying a key that needs to be escaped
var source = '(?:' + _.keys(map).join('|') + ')';
var testRegexp = RegExp(source);
var replaceRegexp = RegExp(source, 'g');
return function(string) {
string = string == null ? '' : '' + string;
return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
};
};
_.escape = createEscaper(escapeMap);
_.unescape = createEscaper(unescapeMap);
// If the value of the named `property` is a function then invoke it with the
// `object` as context; otherwise, return it.
_.result = function(object, property) {
if (object == null) return void 0;
var value = object[property];
return _.isFunction(value) ? object[property]() : value;
};
// Generate a unique integer id (unique within the entire client session).
// Useful for temporary DOM ids.
var idCounter = 0;
_.uniqueId = function(prefix) {
var id = ++idCounter + '';
return prefix ? prefix + id : id;
};
// By default, Underscore uses ERB-style template delimiters, change the
// following template settings to use alternative delimiters.
_.templateSettings = {
evaluate : /<%([\s\S]+?)%>/g,
interpolate : /<%=([\s\S]+?)%>/g,
escape : /<%-([\s\S]+?)%>/g
};
// When customizing `templateSettings`, if you don't want to define an
// interpolation, evaluation or escaping regex, we need one that is
// guaranteed not to match.
var noMatch = /(.)^/;
// Certain characters need to be escaped so that they can be put into a
// string literal.
var escapes = {
"'": "'",
'\\': '\\',
'\r': 'r',
'\n': 'n',
'\u2028': 'u2028',
'\u2029': 'u2029'
};
var escaper = /\\|'|\r|\n|\u2028|\u2029/g;
var escapeChar = function(match) {
return '\\' + escapes[match];
};
// JavaScript micro-templating, similar to John Resig's implementation.
// Underscore templating handles arbitrary delimiters, preserves whitespace,
// and correctly escapes quotes within interpolated code.
// NB: `oldSettings` only exists for backwards compatibility.
_.template = function(text, settings, oldSettings) {
if (!settings && oldSettings) settings = oldSettings;
settings = _.defaults({}, settings, _.templateSettings);
// Combine delimiters into one regular expression via alternation.
var matcher = RegExp([
(settings.escape || noMatch).source,
(settings.interpolate || noMatch).source,
(settings.evaluate || noMatch).source
].join('|') + '|$', 'g');
// Compile the template source, escaping string literals appropriately.
var index = 0;
var source = "__p+='";
text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
source += text.slice(index, offset).replace(escaper, escapeChar);
index = offset + match.length;
if (escape) {
source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
} else if (interpolate) {
source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
} else if (evaluate) {
source += "';\n" + evaluate + "\n__p+='";
}
// Adobe VMs need the match returned to produce the correct offest.
return match;
});
source += "';\n";
// If a variable is not specified, place data values in local scope.
if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
source = "var __t,__p='',__j=Array.prototype.join," +
"print=function(){__p+=__j.call(arguments,'');};\n" +
source + 'return __p;\n';
try {
var render = new Function(settings.variable || 'obj', '_', source);
} catch (e) {
e.source = source;
throw e;
}
var template = function(data) {
return render.call(this, data, _);
};
// Provide the compiled source as a convenience for precompilation.
var argument = settings.variable || 'obj';
template.source = 'function(' + argument + '){\n' + source + '}';
return template;
};
// Add a "chain" function. Start chaining a wrapped Underscore object.
_.chain = function(obj) {
var instance = _(obj);
instance._chain = true;
return instance;
};
// OOP
// ---------------
// If Underscore is called as a function, it returns a wrapped object that
// can be used OO-style. This wrapper holds altered versions of all the
// underscore functions. Wrapped objects may be chained.
// Helper function to continue chaining intermediate results.
var result = function(obj) {
return this._chain ? _(obj).chain() : obj;
};
// Add your own custom functions to the Underscore object.
_.mixin = function(obj) {
_.each(_.functions(obj), function(name) {
var func = _[name] = obj[name];
_.prototype[name] = function() {
var args = [this._wrapped];
push.apply(args, arguments);
return result.call(this, func.apply(_, args));
};
});
};
// Add all of the Underscore functions to the wrapper object.
_.mixin(_);
// Add all mutator Array functions to the wrapper.
_.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
var method = ArrayProto[name];
_.prototype[name] = function() {
var obj = this._wrapped;
method.apply(obj, arguments);
if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];
return result.call(this, obj);
};
});
// Add all accessor Array functions to the wrapper.
_.each(['concat', 'join', 'slice'], function(name) {
var method = ArrayProto[name];
_.prototype[name] = function() {
return result.call(this, method.apply(this._wrapped, arguments));
};
});
// Extracts the result from a wrapped and chained object.
_.prototype.value = function() {
return this._wrapped;
};
// AMD registration happens at the end for compatibility with AMD loaders
// that may not enforce next-turn semantics on modules. Even though general
// practice for AMD registration is to be anonymous, underscore registers
// as a named module because, like jQuery, it is a base library that is
// popular enough to be bundled in a third party lib, but not be part of
// an AMD load request. Those cases could generate an error when an
// anonymous define() is called outside of a loader request.
if (typeof define === 'function' && define.amd) {
define('underscore', [], function() {
return _;
});
}
}.call(this));
| {
"pile_set_name": "Github"
} |
// SPDX-License-Identifier: GPL-2.0
#include <sys/types.h>
#include <sys/socket.h>
#ifndef MSG_PROBE
#define MSG_PROBE 0x10
#endif
#ifndef MSG_WAITFORONE
#define MSG_WAITFORONE 0x10000
#endif
#ifndef MSG_SENDPAGE_NOTLAST
#define MSG_SENDPAGE_NOTLAST 0x20000
#endif
#ifndef MSG_FASTOPEN
#define MSG_FASTOPEN 0x20000000
#endif
#ifndef MSG_CMSG_CLOEXEC
# define MSG_CMSG_CLOEXEC 0x40000000
#endif
static size_t syscall_arg__scnprintf_msg_flags(char *bf, size_t size,
struct syscall_arg *arg)
{
int printed = 0, flags = arg->val;
if (flags == 0)
return scnprintf(bf, size, "NONE");
#define P_MSG_FLAG(n) \
if (flags & MSG_##n) { \
printed += scnprintf(bf + printed, size - printed, "%s%s", printed ? "|" : "", #n); \
flags &= ~MSG_##n; \
}
P_MSG_FLAG(OOB);
P_MSG_FLAG(PEEK);
P_MSG_FLAG(DONTROUTE);
P_MSG_FLAG(CTRUNC);
P_MSG_FLAG(PROBE);
P_MSG_FLAG(TRUNC);
P_MSG_FLAG(DONTWAIT);
P_MSG_FLAG(EOR);
P_MSG_FLAG(WAITALL);
P_MSG_FLAG(FIN);
P_MSG_FLAG(SYN);
P_MSG_FLAG(CONFIRM);
P_MSG_FLAG(RST);
P_MSG_FLAG(ERRQUEUE);
P_MSG_FLAG(NOSIGNAL);
P_MSG_FLAG(MORE);
P_MSG_FLAG(WAITFORONE);
P_MSG_FLAG(SENDPAGE_NOTLAST);
P_MSG_FLAG(FASTOPEN);
P_MSG_FLAG(CMSG_CLOEXEC);
#undef P_MSG_FLAG
if (flags)
printed += scnprintf(bf + printed, size - printed, "%s%#x", printed ? "|" : "", flags);
return printed;
}
#define SCA_MSG_FLAGS syscall_arg__scnprintf_msg_flags
| {
"pile_set_name": "Github"
} |
// +build !nacl,!js
// run
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Issue 11771: Magic comments should ignore carriage returns.
package main
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
"path/filepath"
"runtime"
)
func main() {
if runtime.Compiler != "gc" {
return
}
dir, err := ioutil.TempDir("", "go-issue11771")
if err != nil {
log.Fatalf("creating temp dir: %v\n", err)
}
defer os.RemoveAll(dir)
// The go:nowritebarrier magic comment is only permitted in
// the runtime package. So we confirm that the compilation
// fails.
var buf bytes.Buffer
fmt.Fprintln(&buf, `
package main
func main() {
}
`)
fmt.Fprintln(&buf, "//go:nowritebarrier\r")
fmt.Fprintln(&buf, `
func x() {
}
`)
if err := ioutil.WriteFile(filepath.Join(dir, "x.go"), buf.Bytes(), 0666); err != nil {
log.Fatal(err)
}
cmd := exec.Command("go", "tool", "compile", "x.go")
cmd.Dir = dir
output, err := cmd.CombinedOutput()
if err == nil {
log.Fatal("compile succeeded unexpectedly")
}
if !bytes.Contains(output, []byte("only allowed in runtime")) {
log.Fatalf("wrong error message from compiler; got:\n%s\n", output)
}
}
| {
"pile_set_name": "Github"
} |
{
"CVE_data_meta": {
"ASSIGNER": "[email protected]",
"ID": "CVE-2008-3873",
"STATE": "PUBLIC"
},
"affects": {
"vendor": {
"vendor_data": [
{
"product": {
"product_data": [
{
"product_name": "n/a",
"version": {
"version_data": [
{
"version_value": "n/a"
}
]
}
}
]
},
"vendor_name": "n/a"
}
]
}
},
"data_format": "MITRE",
"data_type": "CVE",
"data_version": "4.0",
"description": {
"description_data": [
{
"lang": "eng",
"value": "The System.setClipboard method in ActionScript in Adobe Flash Player 9.0.124.0 and earlier allows remote attackers to populate the clipboard with a URL that is difficult to delete and does not require user interaction to populate the clipboard, as exploited in the wild in August 2008."
}
]
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "eng",
"value": "n/a"
}
]
}
]
},
"references": {
"reference_data": [
{
"name": "http://support.nortel.com/go/main.jsp?cscat=BLTNDETAIL&DocumentOID=834256&poid=",
"refsource": "CONFIRM",
"url": "http://support.nortel.com/go/main.jsp?cscat=BLTNDETAIL&DocumentOID=834256&poid="
},
{
"name": "33390",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/33390"
},
{
"name": "http://www.adobe.com/support/security/bulletins/apsb08-18.html",
"refsource": "CONFIRM",
"url": "http://www.adobe.com/support/security/bulletins/apsb08-18.html"
},
{
"name": "http://support.avaya.com/elmodocs2/security/ASA-2009-020.htm",
"refsource": "CONFIRM",
"url": "http://support.avaya.com/elmodocs2/security/ASA-2009-020.htm"
},
{
"name": "32702",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/32702"
},
{
"name": "adobe-flash-setclipboard-hijacking(44584)",
"refsource": "XF",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/44584"
},
{
"name": "http://www.adobe.com/devnet/flashplayer/articles/fplayer10_security_changes.html",
"refsource": "CONFIRM",
"url": "http://www.adobe.com/devnet/flashplayer/articles/fplayer10_security_changes.html"
},
{
"name": "http://blogs.adobe.com/psirt/2008/08/clipboard_attack.html",
"refsource": "CONFIRM",
"url": "http://blogs.adobe.com/psirt/2008/08/clipboard_attack.html"
},
{
"name": "34226",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/34226"
},
{
"name": "ADV-2008-2838",
"refsource": "VUPEN",
"url": "http://www.vupen.com/english/advisories/2008/2838"
},
{
"name": "http://blogs.zdnet.com/security/?p=1733",
"refsource": "MISC",
"url": "http://blogs.zdnet.com/security/?p=1733"
},
{
"name": "GLSA-200903-23",
"refsource": "GENTOO",
"url": "http://security.gentoo.org/glsa/glsa-200903-23.xml"
},
{
"name": "1020724",
"refsource": "SECTRACK",
"url": "http://securitytracker.com/id?1020724"
},
{
"name": "32759",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/32759"
},
{
"name": "RHSA-2008:0945",
"refsource": "REDHAT",
"url": "http://www.redhat.com/support/errata/RHSA-2008-0945.html"
},
{
"name": "RHSA-2008:0980",
"refsource": "REDHAT",
"url": "http://www.redhat.com/support/errata/RHSA-2008-0980.html"
},
{
"name": "http://support.avaya.com/elmodocs2/security/ASA-2008-440.htm",
"refsource": "CONFIRM",
"url": "http://support.avaya.com/elmodocs2/security/ASA-2008-440.htm"
},
{
"name": "31117",
"refsource": "BID",
"url": "http://www.securityfocus.com/bid/31117"
},
{
"name": "248586",
"refsource": "SUNALERT",
"url": "http://sunsolve.sun.com/search/document.do?assetkey=1-26-248586-1"
},
{
"name": "32448",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/32448"
},
{
"name": "SUSE-SR:2008:025",
"refsource": "SUSE",
"url": "http://lists.opensuse.org/opensuse-security-announce/2008-11/msg00001.html"
},
{
"name": "http://blogs.zdnet.com/security/?p=1759",
"refsource": "MISC",
"url": "http://blogs.zdnet.com/security/?p=1759"
}
]
}
} | {
"pile_set_name": "Github"
} |
// Copyright JS Foundation and other contributors, http://js.foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
assert(isNaN(new String("5") / undefined) === true) | {
"pile_set_name": "Github"
} |
package com.jesusm.kfingerprintmanager.authentication.ui
import android.content.DialogInterface
import android.content.SharedPreferences
import android.preference.PreferenceManager
import android.support.design.widget.TextInputLayout
import android.support.v7.app.AlertDialog
import android.text.Editable
import android.text.TextWatcher
import android.view.KeyEvent
import android.view.View
import android.view.View.GONE
import android.view.View.VISIBLE
import android.view.ViewAnimationUtils
import android.view.inputmethod.EditorInfo
import android.widget.CheckBox
import android.widget.EditText
import android.widget.TextView
import com.jesusm.kfingerprintmanager.KFingerprintManager
import com.jesusm.kfingerprintmanager.R
import com.jesusm.kfingerprintmanager.authentication.presenter.FingerprintAuthenticationDialogPresenter
import com.jesusm.kfingerprintmanager.base.ui.FingerprintBaseDialogFragment
class FingerprintAuthenticationDialogFragment : FingerprintBaseDialogFragment<FingerprintAuthenticationDialogPresenter>(),
TextView.OnEditorActionListener, FingerprintAuthenticationDialogPresenter.View {
interface AuthenticationDialogCallback : KFingerprintManager.AuthenticationCallback {
fun createKey(invalidatedByBiometricEnrollment: Boolean)
fun onPasswordInserted(password: String)
}
private val passwordContainer : View by lazy {
dialogRootView.findViewById<View>(R.id.fingerprint_dialog_backup_content)
}
val password: EditText by lazy {
dialogRootView.findViewById<EditText>(R.id.password)
}
val textInputLayout: TextInputLayout by lazy {
dialogRootView.findViewById<TextInputLayout>(R.id.input_layout_password)
}
private val useFingerprintFutureCheckBox by lazy {
dialogRootView.findViewById<CheckBox>(R.id.use_fingerprint_in_future_check)
}
private val sharedPreferences: SharedPreferences by lazy {
PreferenceManager.getDefaultSharedPreferences(activity)
}
private var startWithNewFingerprintEnrolled: Boolean = false
override fun inflateViews(rootView: View) {
super.inflateViews(rootView)
rootView.apply {
password.setOnEditorActionListener(this@FingerprintAuthenticationDialogFragment)
password.addTextChangedListener(object : TextWatcherAdapter() {
override fun afterTextChanged(s: Editable) {
if (s.toString().isEmpty()) {
onPasswordEmpty()
} else {
textInputLayout.error = null
}
}
})
}
}
override fun onPause() {
super.onPause()
presenter?.pause()
}
override fun onDialogShown() {
super.onDialogShown()
alertDialog.apply {
val b = getButton(android.app.AlertDialog.BUTTON_POSITIVE)
b.setOnClickListener {
presenter?.showPasswordClicked()
}
}
}
override fun addDialogButtons(dialogBuilder: AlertDialog.Builder) {
super.addDialogButtons(dialogBuilder)
dialogBuilder.setPositiveButton(R.string.use_password, null)
}
override fun onEditorAction(v: TextView?, actionId: Int, event: KeyEvent?): Boolean =
when (actionId) {
EditorInfo.IME_ACTION_GO -> {
dismiss()
true
}
else -> {
textInputLayout.error = null
false
}
}
override fun onFingerprintDisplayed() {
fingerprintContainer.visibility = VISIBLE
passwordContainer.visibility = GONE
}
override fun onPasswordViewDisplayed(newFingerprintEnrolled: Boolean) {
updateDialogButtonText(DialogInterface.BUTTON_NEGATIVE, R.string.cancel)
updateDialogButtonText(DialogInterface.BUTTON_POSITIVE, R.string.ok)
alertDialog.getButton(DialogInterface.BUTTON_POSITIVE)?.setOnClickListener {
val passwordText = password.text?.toString()
val useFingerprintFuture = useFingerprintFutureCheckBox.isChecked
if (passwordText != null) {
presenter?.onPasswordEntered(passwordText, useFingerprintFuture)
}
}
fingerprintContainer.visibility = GONE
showWithRevealEffect(passwordContainer)
password.requestFocus()
if (newFingerprintEnrolled) {
password.hint = getString(R.string.new_fingerprint_enrolled_description)
useFingerprintFutureCheckBox.visibility = VISIBLE
}
}
private fun showWithRevealEffect(viewToShow: View) {
dialogRootView.let {
val centerX = it.measuredWidth / 2
val centerY = it.measuredHeight / 2
val endRadius = it.measuredWidth / 2
val anim = ViewAnimationUtils.createCircularReveal(viewToShow, centerX,
centerY, 0f, endRadius.toFloat())
viewToShow.visibility = VISIBLE
anim.start()
}
}
fun startWithNewFingerprintEnrolled() {
startWithNewFingerprintEnrolled = true
}
override fun saveUseFingerprintFuture(useFingerprintFuture: Boolean) {
val editor = sharedPreferences.edit()
editor.putBoolean(getString(R.string.use_fingerprint_to_authenticate_key), useFingerprintFuture)
editor.apply()
}
override fun createKey() {
(callback as AuthenticationDialogCallback).createKey(true)
}
override fun onPasswordInserted(password: String) {
(callback as AuthenticationDialogCallback).onPasswordInserted(password)
}
override fun onPasswordEmpty() {
textInputLayout.error = getString(R.string.warning_password_empty)
}
override fun onAuthenticationSucceed() {
(callback as AuthenticationDialogCallback).onAuthenticationSuccess()
}
class Builder : FingerprintBaseDialogFragment.Builder<FingerprintAuthenticationDialogFragment, FingerprintAuthenticationDialogPresenter>() {
private var newFingerprintEnrolled: Boolean = false
fun newFingerprintEnrolled(newFingerprintEnrolled: Boolean): Builder {
this.newFingerprintEnrolled = newFingerprintEnrolled
return this
}
override fun createDialogFragment(): FingerprintAuthenticationDialogFragment =
FingerprintAuthenticationDialogFragment()
override fun addProperties(dialogFragment: FingerprintAuthenticationDialogFragment) {
if (newFingerprintEnrolled) {
dialogFragment.startWithNewFingerprintEnrolled()
}
}
override fun createPresenter(view: FingerprintAuthenticationDialogFragment): FingerprintAuthenticationDialogPresenter =
FingerprintAuthenticationDialogPresenter(view)
}
private open class TextWatcherAdapter : TextWatcher {
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {}
override fun afterTextChanged(s: Editable) {}
}
} | {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.