text
stringlengths 2
100k
| meta
dict |
---|---|
package com.interrupt.managers;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.ObjectMap;
import com.badlogic.gdx.utils.OrderedMap;
import com.interrupt.dungeoneer.entities.Entity;
import com.interrupt.dungeoneer.entities.Monster;
import com.interrupt.dungeoneer.game.Level;
import com.interrupt.dungeoneer.serializers.KryoSerializer;
public class MonsterManager {
public HashMap<String, Array<Monster>> monsters;
Random random;
public MonsterManager() { random = new Random(); }
public Monster GetRandomMonster(String levelTheme) {
if(levelTheme == null || !monsters.containsKey(levelTheme) ) return null;
int r = random.nextInt(monsters.get(levelTheme).size);
return Copy( Monster.class, monsters.get(levelTheme).get(r) );
}
public Monster GetMonster(String levelTheme, String name) {
if( monsters.containsKey(levelTheme) ) {
Array<Monster> list = monsters.get(levelTheme);
for(int i = 0; i < list.size; i++) {
if(list.get(i).name.equals(name))
return Copy( Monster.class, list.get(i) );
}
}
return null;
}
public Monster Copy(Class<?> type, Monster tocopy)
{
return (Monster) KryoSerializer.copyObject(tocopy);
}
public void merge(MonsterManager otherMonsterManager) {
for(String category : otherMonsterManager.monsters.keySet()) {
if(monsters.containsKey(category)) {
// walk through and merge stuff
Array<Monster> bucket = monsters.get(category);
for(Monster m : otherMonsterManager.monsters.get(category)) {
mergeMonster(bucket, m);
}
}
else {
// easy, just add that other category
monsters.put(category, otherMonsterManager.monsters.get(category));
}
}
}
// If a monster name already exists that is the same as the new one, replace it. Otherwise add it.
public void mergeMonster(Array bucket, Monster monster) {
int foundIndex = -1;
for(int i = 0; i < bucket.size && foundIndex == -1; i++) {
Monster m = (Monster)bucket.get(i);
if(m.name != null && m.name.equals(monster.name)) {
foundIndex = i;
}
}
// if this already exists, replace it. Otherwise just add it
if(foundIndex != -1)
bucket.set(foundIndex, monster);
else
bucket.add(monster);
}
}
| {
"pile_set_name": "Github"
} |
package com.wix.reactnativenotifications.core.notificationdrawer;
import android.content.Context;
import com.wix.reactnativenotifications.core.AppLaunchHelper;
public interface INotificationsDrawerApplication {
IPushNotificationsDrawer getPushNotificationsDrawer(Context context, AppLaunchHelper defaultAppLaunchHelper);
}
| {
"pile_set_name": "Github"
} |
(cl:in-package #:common-lisp-user)
(defpackage #:sicl-mir-to-lir
(:use #:common-lisp)
(:export
#:mir-to-lir
#:*rax*
#:*rax*
#:*rbx*
#:*rcx*
#:*rdx*
#:*rsp*
#:*rbp*
#:*rsi*
#:*rdi*
#:*r8*
#:*r9*
#:*r10*
#:*r11*
#:*r12*
#:*r13*
#:*r14*
#:*r15*))
| {
"pile_set_name": "Github"
} |
carl9170-objs := main.o usb.o cmd.o mac.o phy.o led.o fw.o tx.o rx.o
carl9170-$(CONFIG_CARL9170_DEBUGFS) += debug.o
obj-$(CONFIG_CARL9170) += carl9170.o
| {
"pile_set_name": "Github"
} |
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
// VMOptions=
// VMOptions=--short_socket_read
// VMOptions=--short_socket_write
// VMOptions=--short_socket_read --short_socket_write
import "package:expect/expect.dart";
import "package:path/path.dart";
import "dart:async";
import "dart:io";
import "dart:isolate";
const SERVER_ADDRESS = "127.0.0.1";
const CERTIFICATE = "localhost_cert";
void testArguments() {
bool isArgOrTypeError(e) => e is ArgumentError || e is TypeError;
Expect.throws(() =>
RawSecureServerSocket.bind(SERVER_ADDRESS, 65536, CERTIFICATE),
isArgOrTypeError);
Expect.throws(() =>
RawSecureServerSocket.bind(SERVER_ADDRESS, -1, CERTIFICATE),
isArgOrTypeError);
Expect.throws(() => RawSecureServerSocket.bind(SERVER_ADDRESS, 0,
CERTIFICATE, backlog: -1),
isArgOrTypeError);
Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, 3456,
sendClientCertificate: true,
certificateName: 12.3),
isArgOrTypeError);
Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, null),
isArgOrTypeError);
Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, -1),
isArgOrTypeError);
Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, 345656),
isArgOrTypeError);
Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, 'hest'),
isArgOrTypeError);
Expect.throws(() => RawSecureSocket.connect(null, 0),
isArgOrTypeError);
Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, 0,
certificateName: 77),
isArgOrTypeError);
Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, 0,
sendClientCertificate: 'fisk'),
isArgOrTypeError);
Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, 0,
onBadCertificate: 'hund'),
isArgOrTypeError);
}
main() {
var certificateDatabase = Platform.script.resolve('pkcert').toFilePath();
SecureSocket.initialize(database: certificateDatabase,
password: 'dartdart',
useBuiltinRoots: false);
testArguments();
}
| {
"pile_set_name": "Github"
} |
idx label predict basePredict correct time
0 3 3 3 1 0:00:16.029334
20 7 5 5 0 0:00:15.918181
40 4 4 4 1 0:00:15.844616
60 7 7 7 1 0:00:15.823835
80 8 8 8 1 0:00:15.996645
100 4 5 5 0 0:00:15.833195
120 8 1 8 0 0:00:16.076786
140 6 6 2 1 0:00:16.093920
160 2 2 2 1 0:00:15.887400
180 0 0 0 1 0:00:17.100096
200 5 5 5 1 0:00:15.946723
220 7 5 5 0 0:00:16.386805
240 1 1 1 1 0:00:16.673163
260 8 8 8 1 0:00:15.887459
280 9 0 0 0 0:00:17.423267
300 6 6 6 1 0:00:15.851963
320 3 5 5 0 0:00:16.363976
340 2 4 4 0 0:00:16.526463
360 9 9 5 1 0:00:15.811560
380 6 6 2 1 0:00:15.840803
400 9 9 9 1 0:00:15.819217
420 4 4 4 1 0:00:15.832167
440 1 1 1 1 0:00:15.893696
460 5 5 5 1 0:00:15.834728
480 8 9 8 0 0:00:15.834982
500 4 6 3 0 0:00:15.820810
520 5 5 5 1 0:00:15.862357
540 1 1 1 1 0:00:15.860254
560 0 0 0 1 0:00:15.848015
580 4 4 4 1 0:00:15.837473
600 8 8 8 1 0:00:15.825163
620 7 7 7 1 0:00:15.896634
640 5 3 3 0 0:00:15.855078
660 9 9 8 1 0:00:15.849789
680 9 9 2 1 0:00:15.841214
700 7 7 7 1 0:00:15.836847
720 4 9 4 0 0:00:15.857311
740 2 5 5 0 0:00:15.850353
760 3 3 3 1 0:00:15.822615
780 9 9 9 1 0:00:15.837174
800 7 7 7 1 0:00:15.854338
820 6 6 2 1 0:00:15.855866
840 7 7 7 1 0:00:15.856567
860 4 7 2 0 0:00:15.840853
880 8 8 8 1 0:00:15.862078
900 2 6 6 0 0:00:15.827462
920 6 6 4 1 0:00:15.826343
940 9 9 9 1 0:00:15.822091
960 9 3 3 0 0:00:15.818723
980 2 4 2 0 0:00:15.836118
1000 5 5 5 1 0:00:15.126603
1020 1 1 1 1 0:00:15.146164
1040 7 5 5 0 0:00:15.132075
1060 9 9 9 1 0:00:15.117806
1080 6 6 6 1 0:00:15.132788
1100 7 8 8 0 0:00:15.168246
1120 5 2 2 0 0:00:15.129684
1140 6 6 5 1 0:00:15.120656
1160 8 8 8 1 0:00:15.130909
1180 3 3 3 1 0:00:15.135883
1200 8 8 8 1 0:00:15.130407
1220 9 6 3 0 0:00:15.114907
1240 2 6 6 0 0:00:15.125970
1260 1 9 9 0 0:00:15.150093
1280 3 3 3 1 0:00:15.124891
1300 4 3 3 0 0:00:15.113441
1320 7 7 2 1 0:00:15.136939
1340 1 1 1 1 0:00:15.123362
1360 7 7 4 1 0:00:15.123266
1380 4 5 5 0 0:00:15.215382
1400 5 3 5 0 0:00:15.143875
1420 4 7 7 0 0:00:15.124709
1440 0 0 8 1 0:00:15.119421
1460 6 6 2 1 0:00:15.126115
1480 1 5 5 0 0:00:15.120993
1500 1 1 1 1 0:00:15.122242
1520 7 7 4 1 0:00:15.102144
1540 8 8 8 1 0:00:15.146194
1560 7 7 7 1 0:00:15.128431
1580 6 1 3 0 0:00:15.169879
1600 8 9 3 0 0:00:15.128653
1620 5 8 8 0 0:00:15.144879
1640 7 3 3 0 0:00:15.106020
1660 3 3 3 1 0:00:15.126958
1680 6 6 3 1 0:00:15.123831
1700 5 3 3 0 0:00:15.136032
1720 4 4 3 1 0:00:15.116775
1740 1 1 1 1 0:00:15.131444
1760 0 0 0 1 0:00:15.120127
1780 7 7 4 1 0:00:15.128345
1800 4 4 2 1 0:00:15.117329
1820 8 8 8 1 0:00:15.154319
1840 8 7 4 0 0:00:15.105291
1860 8 8 8 1 0:00:15.135603
1880 1 1 1 1 0:00:15.145170
1900 8 8 8 1 0:00:15.120646
1920 2 2 2 1 0:00:15.104555
1940 5 2 2 0 0:00:15.122609
1960 2 5 5 0 0:00:15.109833
1980 9 9 9 1 0:00:15.107899
2000 1 1 1 1 0:00:15.208542
2020 9 9 9 1 0:00:15.130692
2040 0 0 0 1 0:00:15.122879
2060 5 3 3 0 0:00:15.122928
2080 1 9 9 0 0:00:15.105627
2100 2 2 2 1 0:00:15.129799
2120 4 8 8 0 0:00:15.144618
2140 9 9 9 1 0:00:15.234616
2160 0 0 8 1 0:00:15.125993
2180 4 4 4 1 0:00:15.141269
2200 0 0 0 1 0:00:15.115729
2220 1 1 1 1 0:00:15.110493
2240 9 9 1 1 0:00:15.112866
2260 4 4 4 1 0:00:15.119997
2280 4 -1 8 0 0:00:15.111633
2300 3 4 4 0 0:00:15.108996
2320 5 2 2 0 0:00:15.216101
2340 7 7 7 1 0:00:15.145245
2360 7 5 5 0 0:00:15.131469
2380 8 8 8 1 0:00:15.119240
2400 0 0 0 1 0:00:15.121036
2420 8 1 3 0 0:00:15.125057
2440 7 7 7 1 0:00:15.110629
2460 9 4 4 0 0:00:15.108345
2480 8 8 8 1 0:00:15.108744
2500 4 6 4 0 0:00:15.120966
2520 1 8 8 0 0:00:15.118024
2540 2 6 2 0 0:00:15.130471
2560 7 7 5 1 0:00:15.110605
2580 6 5 5 0 0:00:15.119644
2600 8 8 8 1 0:00:15.112414
2620 1 1 1 1 0:00:15.120761
2640 7 7 7 1 0:00:15.130095
2660 3 2 2 0 0:00:15.105304
2680 0 0 0 1 0:00:15.107867
2700 9 1 1 0 0:00:15.133373
2720 3 3 3 1 0:00:15.108587
2740 1 7 2 0 0:00:15.116935
2760 2 2 2 1 0:00:15.105607
2780 7 7 7 1 0:00:15.107463
2800 4 4 3 1 0:00:15.100082
2820 6 6 4 1 0:00:15.116976
2840 3 3 3 1 0:00:15.164370
2860 5 4 4 0 0:00:15.151537
2880 4 4 4 1 0:00:15.119016
2900 3 7 2 0 0:00:15.137754
2920 2 3 3 0 0:00:15.142205
2940 3 0 0 0 0:00:15.123782
2960 9 0 0 0 0:00:15.116213
2980 8 8 8 1 0:00:15.122540
3000 5 5 5 1 0:00:15.138018
3020 1 1 1 1 0:00:15.114105
3040 7 7 7 1 0:00:15.129509
3060 7 7 7 1 0:00:15.206510
3080 1 9 9 0 0:00:15.205062
3100 0 0 0 1 0:00:15.229114
3120 4 4 3 1 0:00:15.151361
3140 8 8 8 1 0:00:15.135599
3160 6 2 2 0 0:00:15.115919
3180 3 6 3 0 0:00:15.131201
3200 5 5 5 1 0:00:15.126615
3220 3 9 9 0 0:00:15.129165
3240 4 0 0 0 0:00:15.139049
3260 7 7 7 1 0:00:15.142242
3280 3 5 5 0 0:00:15.130069
3300 4 4 2 1 0:00:15.169939
3320 2 7 7 0 0:00:15.126231
3340 6 6 0 1 0:00:15.113272
3360 4 4 3 1 0:00:15.103675
3380 8 8 8 1 0:00:15.130786
3400 6 4 4 0 0:00:15.115137
3420 5 7 3 0 0:00:15.117987
3440 2 3 3 0 0:00:15.126272
3460 1 1 1 1 0:00:15.137426
3480 2 2 2 1 0:00:15.159653
3500 1 9 9 0 0:00:15.141043
3520 1 1 1 1 0:00:15.126819
3540 6 6 3 1 0:00:15.147916
3560 1 9 9 0 0:00:15.107670
3580 4 4 4 1 0:00:15.160595
3600 4 2 2 0 0:00:15.120737
3620 0 0 5 1 0:00:15.121534
3640 6 2 2 0 0:00:15.116312
3660 0 0 8 1 0:00:15.132342
3680 0 4 0 0 0:00:15.118919
3700 3 3 3 1 0:00:15.114890
3720 2 2 2 1 0:00:15.231823
3740 0 0 0 1 0:00:15.182516
3760 7 7 7 1 0:00:15.124197
3780 4 4 2 1 0:00:15.132208
3800 9 9 9 1 0:00:15.129927
3820 0 8 2 0 0:00:15.142261
3840 6 3 3 0 0:00:15.114704
3860 7 7 7 1 0:00:15.129865
3880 6 6 5 1 0:00:15.116187
3900 3 6 6 0 0:00:15.119053
3920 7 7 7 1 0:00:15.110307
3940 6 2 2 0 0:00:15.134051
3960 2 2 2 1 0:00:15.123738
3980 9 -1 3 0 0:00:15.133423
4000 8 4 8 0 0:00:15.115426
4020 8 8 8 1 0:00:15.133490
4040 0 0 0 1 0:00:15.115574
4060 6 6 0 1 0:00:15.116677
4080 1 1 1 1 0:00:15.120032
4100 7 7 7 1 0:00:15.193622
4120 4 4 4 1 0:00:15.120401
4140 5 5 3 1 0:00:15.133042
4160 5 3 2 0 0:00:15.114340
4180 0 8 8 0 0:00:15.121561
4200 4 2 2 0 0:00:15.161401
4220 4 0 0 0 0:00:15.118011
4240 7 0 0 0 0:00:15.119339
4260 8 8 8 1 0:00:15.133372
4280 8 0 0 0 0:00:15.115603
4300 8 8 8 1 0:00:15.119304
4320 1 9 8 0 0:00:15.117348
4340 0 0 0 1 0:00:15.119153
4360 6 6 6 1 0:00:15.206586
4380 9 9 9 1 0:00:15.165177
4400 3 4 5 0 0:00:15.117393
4420 5 5 5 1 0:00:15.118845
4440 2 4 2 0 0:00:15.124345
4460 9 9 9 1 0:00:15.119660
4480 9 9 9 1 0:00:15.128620
4500 3 5 5 0 0:00:15.116702
4520 3 6 3 0 0:00:15.126205
4540 9 9 9 1 0:00:15.112653
4560 1 1 1 1 0:00:15.144274
4580 6 6 4 1 0:00:15.150136
4600 4 4 4 1 0:00:15.118260
4620 7 3 3 0 0:00:15.121337
4640 2 2 2 1 0:00:15.112423
4660 7 4 4 0 0:00:15.115103
4680 9 9 9 1 0:00:15.125385
4700 6 5 5 0 0:00:15.202960
4720 8 8 8 1 0:00:15.181393
4740 5 3 3 0 0:00:15.139755
4760 3 2 2 0 0:00:15.124439
4780 0 0 0 1 0:00:15.124538
4800 9 9 9 1 0:00:15.193653
4820 3 3 3 1 0:00:15.124922
4840 0 0 0 1 0:00:15.115148
4860 5 5 5 1 0:00:15.120403
4880 0 8 8 0 0:00:15.118861
4900 3 3 3 1 0:00:15.172824
4920 7 7 7 1 0:00:15.164807
4940 6 6 4 1 0:00:15.149233
4960 4 4 3 1 0:00:15.187972
4980 1 9 9 0 0:00:15.121934
5000 7 7 7 1 0:00:15.118526
5020 8 8 8 1 0:00:15.134970
5040 3 3 3 1 0:00:15.132609
5060 6 6 2 1 0:00:15.137386
5080 7 7 7 1 0:00:15.114709
5100 3 3 3 1 0:00:15.149519
5120 9 9 8 1 0:00:15.132521
5140 8 8 8 1 0:00:15.123793
5160 0 0 8 1 0:00:15.113296
5180 9 7 7 0 0:00:15.121789
5200 3 3 3 1 0:00:15.131208
5220 0 0 0 1 0:00:15.111997
5240 1 1 9 1 0:00:15.128778
5260 0 0 0 1 0:00:15.194413
5280 0 4 4 0 0:00:15.142169
5300 9 9 9 1 0:00:15.118345
5320 7 7 7 1 0:00:15.147467
5340 3 4 4 0 0:00:15.168051
5360 9 9 9 1 0:00:15.144715
5380 1 9 9 0 0:00:15.116997
5400 9 9 9 1 0:00:15.153224
5420 6 6 6 1 0:00:15.180556
5440 9 9 9 1 0:00:15.126132
5460 0 0 0 1 0:00:15.135670
5480 1 1 1 1 0:00:15.126545
5500 8 8 8 1 0:00:15.113990
5520 4 4 3 1 0:00:15.134308
5540 5 3 2 0 0:00:15.115027
5560 3 5 5 0 0:00:15.114701
5580 5 6 3 0 0:00:15.140172
5600 6 5 3 0 0:00:15.144963
5620 3 6 2 0 0:00:15.111353
5640 2 5 2 0 0:00:15.203376
5660 9 1 8 0 0:00:15.125169
5680 2 3 3 0 0:00:15.130039
5700 3 3 3 1 0:00:15.122612
5720 9 9 9 1 0:00:15.199283
5740 6 6 2 1 0:00:15.116161
5760 2 2 0 1 0:00:15.117912
5780 7 7 7 1 0:00:15.144418
5800 2 2 2 1 0:00:15.148924
5820 5 5 5 1 0:00:15.153438
5840 2 2 3 1 0:00:15.162282
5860 0 0 0 1 0:00:15.119220
5880 0 0 0 1 0:00:15.128152
5900 4 3 0 0 0:00:15.119414
5920 8 8 8 1 0:00:15.217111
5940 7 2 3 0 0:00:15.124261
5960 2 6 6 0 0:00:15.135193
5980 9 9 9 1 0:00:15.123393
6000 8 8 8 1 0:00:15.154176
6020 6 6 2 1 0:00:15.145884
6040 2 5 7 0 0:00:15.121977
6060 3 4 5 0 0:00:15.132581
6080 1 1 1 1 0:00:15.140126
6100 1 1 1 1 0:00:15.116138
6120 5 5 5 1 0:00:15.132401
6140 9 9 1 1 0:00:15.120741
6160 2 5 2 0 0:00:15.121927
6180 0 0 8 1 0:00:15.137546
6200 3 2 2 0 0:00:15.132707
6220 2 5 5 0 0:00:15.116499
6240 2 2 0 1 0:00:15.113224
6260 2 2 2 1 0:00:15.118037
6280 8 5 5 0 0:00:15.107013
6300 1 1 1 1 0:00:15.115380
6320 0 0 0 1 0:00:15.142476
6340 3 7 3 0 0:00:15.153294
6360 2 2 2 1 0:00:15.119174
6380 3 6 3 0 0:00:15.135052
6400 0 0 0 1 0:00:15.125384
6420 7 7 7 1 0:00:15.133417
6440 3 6 2 0 0:00:15.133506
6460 3 3 3 1 0:00:15.122815
6480 0 0 0 1 0:00:15.114525
6500 7 6 8 0 0:00:15.203887
6520 6 2 2 0 0:00:15.113518
6540 8 8 8 1 0:00:15.154190
6560 6 5 5 0 0:00:15.131336
6580 1 8 8 0 0:00:15.126395
6600 7 7 7 1 0:00:15.141306
6620 7 7 7 1 0:00:15.121843
6640 5 3 3 0 0:00:15.134992
6660 0 0 1 1 0:00:15.129838
6680 3 5 5 0 0:00:15.122211
6700 6 6 6 1 0:00:15.120335
6720 2 2 2 1 0:00:15.198736
6740 2 4 4 0 0:00:15.211153
6760 5 5 5 1 0:00:15.133331
6780 7 7 7 1 0:00:15.117103
6800 6 4 4 0 0:00:15.129005
6820 1 1 1 1 0:00:15.131994
6840 9 9 9 1 0:00:15.121491
6860 0 0 0 1 0:00:15.126744
6880 2 2 2 1 0:00:15.139223
6900 3 3 3 1 0:00:15.159653
6920 5 4 2 0 0:00:15.123578
6940 1 1 1 1 0:00:15.123816
6960 9 9 8 1 0:00:15.109925
6980 0 0 0 1 0:00:15.136344
7000 2 -1 8 0 0:00:15.133195
7020 7 7 7 1 0:00:15.124106
7040 7 8 8 0 0:00:15.111516
7060 8 8 8 1 0:00:15.117544
7080 5 4 4 0 0:00:15.125778
7100 9 3 3 0 0:00:15.140680
7120 7 5 5 0 0:00:15.122367
7140 4 3 3 0 0:00:15.115874
7160 5 5 5 1 0:00:15.127483
7180 6 6 3 1 0:00:15.136089
7200 4 3 2 0 0:00:15.126608
7220 9 9 9 1 0:00:15.129684
7240 0 0 8 1 0:00:15.119865
7260 1 1 1 1 0:00:15.237234
7280 1 9 3 0 0:00:15.126364
7300 3 4 5 0 0:00:15.116353
7320 8 0 0 0 0:00:15.118772
7340 2 2 0 1 0:00:15.133636
7360 2 2 2 1 0:00:15.121438
7380 7 7 7 1 0:00:15.121240
7400 3 5 5 0 0:00:15.205277
7420 3 4 4 0 0:00:15.181799
7440 3 3 3 1 0:00:15.124595
7460 5 5 5 1 0:00:15.118186
7480 1 1 8 1 0:00:15.146763
7500 6 6 6 1 0:00:15.124280
7520 4 4 4 1 0:00:15.131688
7540 5 5 5 1 0:00:15.120604
7560 0 0 0 1 0:00:15.130428
7580 8 8 8 1 0:00:15.129539
7600 8 2 2 0 0:00:15.105026
7620 5 3 3 0 0:00:15.114742
7640 9 8 8 0 0:00:15.116205
7660 7 7 4 1 0:00:15.135618
7680 3 5 5 0 0:00:15.122187
7700 6 6 4 1 0:00:15.120374
7720 5 2 2 0 0:00:15.130203
7740 4 4 2 1 0:00:15.129251
7760 2 0 8 0 0:00:15.112190
7780 3 8 8 0 0:00:15.135563
7800 0 0 0 1 0:00:15.136683
7820 5 5 0 1 0:00:15.122203
7840 1 1 1 1 0:00:15.124511
7860 8 8 8 1 0:00:15.129354
7880 0 0 0 1 0:00:15.114183
7900 0 4 8 0 0:00:15.125806
7920 9 9 9 1 0:00:15.133854
7940 2 6 2 0 0:00:15.133898
7960 0 3 3 0 0:00:15.155237
7980 3 3 3 1 0:00:15.127341
8000 9 9 9 1 0:00:15.132348
8020 6 7 3 0 0:00:15.114290
8040 2 2 2 1 0:00:15.114832
8060 6 6 5 1 0:00:15.128556
8080 4 4 3 1 0:00:15.101449
8100 6 2 2 0 0:00:15.128868
8120 8 9 8 0 0:00:15.104449
8140 5 7 3 0 0:00:15.126796
8160 6 6 6 1 0:00:15.130647
8180 4 4 4 1 0:00:15.104792
8200 3 6 3 0 0:00:15.102486
8220 6 5 5 0 0:00:15.113964
8240 7 7 4 1 0:00:15.123152
8260 1 1 1 1 0:00:15.119157
8280 4 4 4 1 0:00:15.147105
8300 5 4 2 0 0:00:15.130079
8320 7 7 7 1 0:00:15.112841
8340 5 3 5 0 0:00:15.110534
8360 7 7 7 1 0:00:15.132743
8380 9 9 9 1 0:00:15.131188
8400 0 9 9 0 0:00:15.140790
8420 3 6 6 0 0:00:15.123839
8440 5 3 3 0 0:00:15.151010
8460 8 8 8 1 0:00:15.138408
8480 2 2 2 1 0:00:15.140461
8500 4 4 4 1 0:00:15.134101
8520 8 8 8 1 0:00:15.142601
8540 4 2 2 0 0:00:15.135303
8560 7 7 7 1 0:00:15.134868
8580 3 5 5 0 0:00:15.141398
8600 3 2 2 0 0:00:15.124672
8620 3 2 5 0 0:00:15.146335
8640 1 1 1 1 0:00:15.121875
8660 7 7 7 1 0:00:15.114879
8680 3 7 3 0 0:00:15.122716
8700 3 3 3 1 0:00:15.114322
8720 2 0 0 0 0:00:15.132171
8740 2 -1 5 0 0:00:15.125901
8760 8 8 8 1 0:00:15.132457
8780 4 4 4 1 0:00:15.124578
8800 0 0 0 1 0:00:15.119433
8820 2 2 2 1 0:00:15.137784
8840 2 5 2 0 0:00:15.186709
8860 2 2 2 1 0:00:15.157173
8880 1 1 1 1 0:00:15.134940
8900 2 4 4 0 0:00:15.109301
8920 6 6 3 1 0:00:15.109109
8940 6 3 3 0 0:00:15.128089
8960 0 4 2 0 0:00:15.121811
8980 9 9 9 1 0:00:15.115053
9000 8 8 8 1 0:00:15.152593
9020 7 7 7 1 0:00:15.142334
9040 2 5 5 0 0:00:15.155871
9060 9 9 5 1 0:00:15.152888
9080 3 5 3 0 0:00:15.125413
9100 9 1 1 0 0:00:15.134091
9120 3 0 2 0 0:00:15.147804
9140 7 7 4 1 0:00:15.113673
9160 5 3 3 0 0:00:15.144785
9180 5 5 5 1 0:00:15.148318
9200 8 8 8 1 0:00:15.135377
9220 8 8 8 1 0:00:15.125624
9240 8 8 8 1 0:00:15.141343
9260 5 5 5 1 0:00:15.119823
9280 9 8 8 0 0:00:15.143259
9300 5 2 2 0 0:00:15.117860
9320 9 9 9 1 0:00:15.121662
9340 1 1 1 1 0:00:15.120479
9360 5 0 0 0 0:00:15.132034
9380 5 3 3 0 0:00:15.145038
9400 6 6 6 1 0:00:15.155661
9420 5 5 5 1 0:00:15.147021
9440 8 8 8 1 0:00:15.145599
9460 3 7 7 0 0:00:15.122821
9480 2 6 6 0 0:00:15.148942
9500 9 9 2 1 0:00:15.115911
9520 1 1 1 1 0:00:15.115447
9540 5 5 5 1 0:00:15.126101
9560 9 7 3 0 0:00:15.121480
9580 1 1 1 1 0:00:15.118638
9600 8 8 8 1 0:00:15.157892
9620 4 4 4 1 0:00:15.131263
9640 5 5 5 1 0:00:15.162027
9660 6 6 6 1 0:00:15.108668
9680 8 8 8 1 0:00:15.120548
9700 0 0 2 1 0:00:15.147805
9720 8 6 8 0 0:00:15.141885
9740 3 6 2 0 0:00:15.228507
9760 9 5 5 0 0:00:15.170283
9780 4 4 2 1 0:00:15.117251
9800 1 1 1 1 0:00:15.123360
9820 0 8 8 0 0:00:15.124308
9840 4 7 7 0 0:00:15.130935
9860 0 3 8 0 0:00:15.132194
9880 7 8 8 0 0:00:15.156224
9900 8 8 8 1 0:00:15.116109
9920 6 6 6 1 0:00:15.102113
9940 4 5 5 0 0:00:15.149848
9960 2 0 0 0 0:00:15.139303
9980 0 0 0 1 0:00:15.119437
| {
"pile_set_name": "Github"
} |
structure Ponyo_Net_Http_Server : PONYO_NET_HTTP_SERVER =
struct
local
structure Format = Ponyo_Format_String
structure Socket = Ponyo_Net_Socket
structure String = Ponyo_String
structure Thread = Ponyo_Thread
structure Request = Ponyo_Net_Http_Request (Socket)
structure Response = Ponyo_Net_Http_Response (Socket)
in
structure Router = Ponyo_Net_Http_Router (Socket)
val MAX_CONN : int ref = ref ~1
fun handleCleanup (conn) : unit =
let
val exit = Thread.exit
in
Socket.close (conn) handle _ => exit ();
exit ()
end
fun handleRequest (conn) (router: Router.t) : unit =
let
val emptyRequest = Request.init (String.Dict.new ()) ""
val request = Request.read (conn) handle _ => emptyRequest
val response = router (request) handle _ => Response.InternalServerError;
in
Format.println [Request.toString request];
Response.write conn response handle _ => handleCleanup (conn);
handleCleanup (conn)
end
fun serve sock (router: Router.t) : unit =
let
val (conn, _) = Basis.Socket.accept (sock);
in
Thread.fork (fn () => handleRequest conn router);
Thread.run ();
serve sock router;
()
end
fun bind sock address =
let
val sleep = OS.Process.sleep
fun doBind () = Basis.Socket.bind (sock, address)
in
doBind () handle SysError => (sleep (Time.fromSeconds 1); bind sock address);
()
end
fun listenAndServe (address: string) (port: int) (router: Router.t) : unit =
let
val sock = INetSock.TCP.socket ();
in
Format.println ["Binding server..."];
bind sock (INetSock.any port);
Format.printf "Server bound. Listening on port %:%\n\n" [address, Int.toString port];
Basis.Socket.listen (sock, !MAX_CONN);
Basis.Socket.Ctl.setREUSEADDR (sock, true);
serve sock router;
Socket.close (sock);
()
end
end
end
| {
"pile_set_name": "Github"
} |
package com.example.qyh.joe.fragment;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.ActivityOptionsCompat;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.qyh.joe.R;
import com.example.qyh.joe.adapter.FirstAdapter;
import com.example.qyh.joe.bean.DataBean;
import com.example.qyh.joe.commons.Urls;
import com.example.qyh.joe.presenter.FirstFragmentImpl;
import com.example.qyh.joe.presenter.FirstPresenter;
import com.example.qyh.joe.activity.FirstDetilActivity;
import com.example.qyh.joe.view.FirstView;
import java.util.ArrayList;
import java.util.List;
/**
* Created by qyh on 2016/8/5.
*/
public class FirstListFragment extends Fragment implements FirstView, SwipeRefreshLayout.OnRefreshListener {
private RecyclerView mRecyclerView;
private SwipeRefreshLayout mSwipeRefreshWidget;
private int type= FirstFragment.ONE;
private FirstPresenter firstPresenter;
private LinearLayoutManager mLayoutManger;
private FirstAdapter mAdapter;
private int pageIndex=0;
private ArrayList<DataBean> mData;
private FloatingActionButton fa_firstlist;
public static FirstListFragment newInstance(int type) {
Bundle bundle = new Bundle();
FirstListFragment fragment = new FirstListFragment();
bundle.putInt("type", type);
fragment.setArguments(bundle);
return fragment;
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
firstPresenter = new FirstFragmentImpl(this);
type = getArguments().getInt("type");
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.firstlist_fragment, null);
initView(view);
onRefresh();
return view;
}
@Override
public void showProgress() {
mSwipeRefreshWidget.setRefreshing(true);
}
@Override
public void hideProgress() {
mSwipeRefreshWidget.setRefreshing(false);
}
@Override
public void addData(List<DataBean> mlist) {
if(null==mData){
mData = new ArrayList<>();
}
mData.addAll(mlist);
if(pageIndex==0){
mAdapter.setData(mData);
}else{
//没有加载更多的数据时候,,隐藏加载更多的布局
if(mlist.size()==0||mlist==null){
mAdapter.isShowFooter(false);
}
mAdapter.notifyDataSetChanged();
}
pageIndex += Urls.PAZE_SIZE;
}
//当没有网络或者加载失败的时候,隐藏进度,自动弹出提示框
@Override
public void showLoadFail() {
if(pageIndex==0){
mAdapter.isShowFooter(false);
mAdapter.notifyDataSetChanged();
}
View view = getActivity() == null ? mRecyclerView.getRootView() : getActivity().findViewById(R.id.drawer_layout);
Snackbar.make(view,"数据加载失败",Snackbar.LENGTH_SHORT).show();
}
private void initView(View view) {
fa_firstlist = (FloatingActionButton) view.findViewById(R.id.fa_firstlist);
mSwipeRefreshWidget = (SwipeRefreshLayout) view.findViewById(R.id.swipe_refresh_widget);
mSwipeRefreshWidget.setColorSchemeResources(R.color.colorPrimary,
R.color.colorPrimaryDark, R.color.colorAccent,
R.color.colorAccent);
mSwipeRefreshWidget.setOnRefreshListener(this);
mRecyclerView = (RecyclerView) view.findViewById(R.id.recycle_view);
mRecyclerView.setHasFixedSize(true);
mLayoutManger = new LinearLayoutManager(getActivity());
mRecyclerView.setLayoutManager(mLayoutManger);
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
mAdapter = new FirstAdapter(getActivity());
mRecyclerView.setAdapter(mAdapter);
mAdapter.setOnItemClickListener(mOnItemClickListener);
mRecyclerView.addOnScrollListener(mOnScrollListener);
fa_firstlist.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
gotoTop(0);
}
});
}
//点击滚动到列表的最顶端
private void gotoTop(int position) {
mRecyclerView.scrollToPosition(position);
}
//列表下拉刷新监听事件
public RecyclerView.OnScrollListener mOnScrollListener=new RecyclerView.OnScrollListener(){
private int mLastVisibleItemPosition;//最后一个角标位置
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
mLastVisibleItemPosition = mLayoutManger.findLastVisibleItemPosition();
}
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
//正在滚动
if(newState==RecyclerView.SCROLL_STATE_IDLE&&mLastVisibleItemPosition+1==mAdapter.getItemCount()
&&mAdapter.isShowFooter()){
firstPresenter.loadData(type,pageIndex+Urls.PAZE_SIZE);
}
}
};
//刷新
@Override
public void onRefresh() {
// System.out.println("onRefresh=================");
pageIndex=0;
if(null!=mData){
mData.clear();
}
firstPresenter.loadData(type,pageIndex);
}
//FirstAdapter点击,跳转到新闻详情界面
private FirstAdapter.OnItemClickListener mOnItemClickListener=new FirstAdapter.OnItemClickListener(){
@Override
public void onItemClick(View view, int position) {
DataBean data = mAdapter.getItem(position);
System.out.println("点击的数据======" + data.getTitle());
Intent intent = new Intent(getActivity(), FirstDetilActivity.class);
intent.putExtra("news", data);
View intoView = view.findViewById(R.id.ivNews);
ActivityOptionsCompat options =
ActivityOptionsCompat.makeSceneTransitionAnimation(getActivity(),
intoView, getString(R.string.transition_news_img));
ActivityCompat.startActivity(getActivity(),intent,options.toBundle());
}
};
}
| {
"pile_set_name": "Github"
} |
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| framework needs to place the application's name in a notification or
| any other location as required by the application or its packages.
*/
'name' => 'Talk Message',
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services your application utilizes. Set this in your ".env" file.
|
*/
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => env('APP_DEBUG', false),
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => env('APP_URL', 'http://localhost'),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
'timezone' => 'UTC',
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/
'locale' => 'en',
/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/
'fallback_locale' => 'en',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
/*
|--------------------------------------------------------------------------
| Logging Configuration
|--------------------------------------------------------------------------
|
| Here you may configure the log settings for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Settings: "single", "daily", "syslog", "errorlog"
|
*/
'log' => env('APP_LOG', 'single'),
'log_level' => env('APP_LOG_LEVEL', 'debug'),
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
'providers' => [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
/*
* Package Service Providers...
*/
//
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
Pusher\Laravel\PusherServiceProvider::class,
Nahid\Talk\TalkServiceProvider::class,
],
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
'Talk' => Nahid\Talk\Facades\Talk::class,
'Pusher' => Pusher\Laravel\Facades\Pusher::class
],
];
| {
"pile_set_name": "Github"
} |
// Copyright (c) 2014, Ryan Lewis All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
// 3. Neither the name of the copyright holder 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 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*---
author: Ryan Lewis
description: >
endsWith should return true when called on 'word' and passed 'r',
with an endPosition of 3.
includes: [runTestCase.js]
---*/
function testcase() {
if('word'.endsWith('r', 3) === true) {
return true;
}
}
runTestCase(testcase);
| {
"pile_set_name": "Github"
} |
export const API = process.env.VUE_APP_API;
| {
"pile_set_name": "Github"
} |
/*
Copyright The Kubernetes 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1alpha1 "k8s.io/api/node/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeRuntimeClasses implements RuntimeClassInterface
type FakeRuntimeClasses struct {
Fake *FakeNodeV1alpha1
}
var runtimeclassesResource = schema.GroupVersionResource{Group: "node.k8s.io", Version: "v1alpha1", Resource: "runtimeclasses"}
var runtimeclassesKind = schema.GroupVersionKind{Group: "node.k8s.io", Version: "v1alpha1", Kind: "RuntimeClass"}
// Get takes name of the runtimeClass, and returns the corresponding runtimeClass object, and an error if there is any.
func (c *FakeRuntimeClasses) Get(name string, options v1.GetOptions) (result *v1alpha1.RuntimeClass, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(runtimeclassesResource, name), &v1alpha1.RuntimeClass{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.RuntimeClass), err
}
// List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors.
func (c *FakeRuntimeClasses) List(opts v1.ListOptions) (result *v1alpha1.RuntimeClassList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(runtimeclassesResource, runtimeclassesKind, opts), &v1alpha1.RuntimeClassList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.RuntimeClassList{ListMeta: obj.(*v1alpha1.RuntimeClassList).ListMeta}
for _, item := range obj.(*v1alpha1.RuntimeClassList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested runtimeClasses.
func (c *FakeRuntimeClasses) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(runtimeclassesResource, opts))
}
// Create takes the representation of a runtimeClass and creates it. Returns the server's representation of the runtimeClass, and an error, if there is any.
func (c *FakeRuntimeClasses) Create(runtimeClass *v1alpha1.RuntimeClass) (result *v1alpha1.RuntimeClass, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(runtimeclassesResource, runtimeClass), &v1alpha1.RuntimeClass{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.RuntimeClass), err
}
// Update takes the representation of a runtimeClass and updates it. Returns the server's representation of the runtimeClass, and an error, if there is any.
func (c *FakeRuntimeClasses) Update(runtimeClass *v1alpha1.RuntimeClass) (result *v1alpha1.RuntimeClass, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(runtimeclassesResource, runtimeClass), &v1alpha1.RuntimeClass{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.RuntimeClass), err
}
// Delete takes name of the runtimeClass and deletes it. Returns an error if one occurs.
func (c *FakeRuntimeClasses) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(runtimeclassesResource, name), &v1alpha1.RuntimeClass{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeRuntimeClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(runtimeclassesResource, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.RuntimeClassList{})
return err
}
// Patch applies the patch and returns the patched runtimeClass.
func (c *FakeRuntimeClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.RuntimeClass, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(runtimeclassesResource, name, pt, data, subresources...), &v1alpha1.RuntimeClass{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.RuntimeClass), err
}
| {
"pile_set_name": "Github"
} |
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cldr
import (
"encoding/xml"
"regexp"
"strconv"
)
// Elem is implemented by every XML element.
type Elem interface {
setEnclosing(Elem)
setName(string)
enclosing() Elem
GetCommon() *Common
}
type hidden struct {
CharData string `xml:",chardata"`
Alias *struct {
Common
Source string `xml:"source,attr"`
Path string `xml:"path,attr"`
} `xml:"alias"`
Def *struct {
Common
Choice string `xml:"choice,attr,omitempty"`
Type string `xml:"type,attr,omitempty"`
} `xml:"default"`
}
// Common holds several of the most common attributes and sub elements
// of an XML element.
type Common struct {
XMLName xml.Name
name string
enclElem Elem
Type string `xml:"type,attr,omitempty"`
Reference string `xml:"reference,attr,omitempty"`
Alt string `xml:"alt,attr,omitempty"`
ValidSubLocales string `xml:"validSubLocales,attr,omitempty"`
Draft string `xml:"draft,attr,omitempty"`
hidden
}
// Default returns the default type to select from the enclosed list
// or "" if no default value is specified.
func (e *Common) Default() string {
if e.Def == nil {
return ""
}
if e.Def.Choice != "" {
return e.Def.Choice
} else if e.Def.Type != "" {
// Type is still used by the default element in collation.
return e.Def.Type
}
return ""
}
// Element returns the XML element name.
func (e *Common) Element() string {
return e.name
}
// GetCommon returns e. It is provided such that Common implements Elem.
func (e *Common) GetCommon() *Common {
return e
}
// Data returns the character data accumulated for this element.
func (e *Common) Data() string {
e.CharData = charRe.ReplaceAllStringFunc(e.CharData, replaceUnicode)
return e.CharData
}
func (e *Common) setName(s string) {
e.name = s
}
func (e *Common) enclosing() Elem {
return e.enclElem
}
func (e *Common) setEnclosing(en Elem) {
e.enclElem = en
}
// Escape characters that can be escaped without further escaping the string.
var charRe = regexp.MustCompile(`&#x[0-9a-fA-F]*;|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|\\x[0-9a-fA-F]{2}|\\[0-7]{3}|\\[abtnvfr]`)
// replaceUnicode converts hexadecimal Unicode codepoint notations to a one-rune string.
// It assumes the input string is correctly formatted.
func replaceUnicode(s string) string {
if s[1] == '#' {
r, _ := strconv.ParseInt(s[3:len(s)-1], 16, 32)
return string(r)
}
r, _, _, _ := strconv.UnquoteChar(s, 0)
return string(r)
}
| {
"pile_set_name": "Github"
} |
/***************************************************
* 版权声明
*
* 本操作系统名为:MINE
* 该操作系统未经授权不得以盈利或非盈利为目的进行开发,
* 只允许个人学习以及公开交流使用
*
* 代码最终所有权及解释权归田宇所有;
*
* 本模块作者: 田宇
* EMail: [email protected]
*
*
***************************************************/
#ifndef __PRINTK_H__
#define __PRINTK_H__
#include <stdarg.h>
#include "font.h"
#include "linkage.h"
#include "spinlock.h"
#define ZEROPAD 1 /* pad with zero */
#define SIGN 2 /* unsigned/signed long */
#define PLUS 4 /* show plus */
#define SPACE 8 /* space if plus */
#define LEFT 16 /* left justified */
#define SPECIAL 32 /* 0x */
#define SMALL 64 /* use 'abcdef' instead of 'ABCDEF' */
#define is_digit(c) ((c) >= '0' && (c) <= '9')
#define WHITE 0x00ffffff //白
#define BLACK 0x00000000 //黑
#define RED 0x00ff0000 //红
#define ORANGE 0x00ff8000 //橙
#define YELLOW 0x00ffff00 //黄
#define GREEN 0x0000ff00 //绿
#define BLUE 0x000000ff //蓝
#define INDIGO 0x0000ffff //靛
#define PURPLE 0x008000ff //紫
/*
*/
extern unsigned char font_ascii[256][16];
struct position
{
int XResolution;
int YResolution;
int XPosition;
int YPosition;
int XCharSize;
int YCharSize;
unsigned int * FB_addr;
unsigned long FB_length;
spinlock_T printk_lock;
};
extern struct position Pos;
/*
*/
void frame_buffer_init();
/*
*/
void putchar(unsigned int * fb,int Xsize,int x,int y,unsigned int FRcolor,unsigned int BKcolor,unsigned char font);
/*
*/
int skip_atoi(const char **s);
/*
*/
#define do_div(n,base) ({ \
int __res; \
__asm__("divq %%rcx":"=a" (n),"=d" (__res):"0" (n),"1" (0),"c" (base)); \
__res; })
/*
*/
static char * number(char * str, long num, int base, int size, int precision ,int type);
/*
*/
int vsprintf(char * buf,const char *fmt, va_list args);
/*
*/
int color_printk(unsigned int FRcolor,unsigned int BKcolor,const char * fmt,...);
#endif
| {
"pile_set_name": "Github"
} |
#ifndef CAFFE_ELTWISE_LAYER_HPP_
#define CAFFE_ELTWISE_LAYER_HPP_
#include <vector>
#include "../layer.hpp"
namespace caffe {
/**
* @brief Compute elementwise operations, such as product and sum,
* along multiple input Blobs.
*
* TODO(dox): thorough documentation for Forward, Backward, and proto params.
*/
class EltwiseLayer : public Layer {
public:
explicit EltwiseLayer(const LayerParameter& param)
: Layer(param) {}
virtual void LayerSetUp(const vector<Blob*>& bottom,
const vector<Blob*>& top);
virtual void Reshape(const vector<Blob*>& bottom,
const vector<Blob*>& top);
virtual const char* type() const { return "Eltwise"; }
virtual int MinBottomBlobs() const { return 2; }
virtual int ExactNumTopBlobs() const { return 1; }
protected:
virtual void Forward_cpu(const vector<Blob*>& bottom,
const vector<Blob*>& top);
virtual void Forward_gpu(const vector<Blob*>& bottom,
const vector<Blob*>& top);
EltwiseParameter_EltwiseOp op_;
vector<real_t> coeffs_;
bool stable_prod_grad_;
};
} // namespace caffe
#endif // CAFFE_ELTWISE_LAYER_HPP_
| {
"pile_set_name": "Github"
} |
# This list is a compilation of EISA ids.
# It also includes numerous ISA cards for which an EISA id
# has been allocated.
#
# Please send any patch/addition/correction to
# Marc Zyngier <[email protected]>
#
# Many entries were contributed by [email protected]
ABP0510 "Advansys ABP-510 ISA SCSI Host Adapter"
ABP0540 "Advansys ABP-540/542 ISA SCSI Host Adapter"
ABP7401 "AdvanSys ABP-740/742 EISA Single Channel SCSI Host Adapter"
ABP7501 "AdvanSys ABP-750/752 EISA Dual Channel SCSI Host Adapter"
ACC1200 "ACCTON EtherCombo-32 Ethernet Adapter"
ACC120A "ACCTON EtherCombo-32 Ethernet Adapter"
ACC1650 "Accton MPX Ethernet Adapter (EN165x)"
ACC1660 "Accton MPX Ethernet Adapter (EN166x)"
ACE1010 "ACME Super Fast System Board"
ACE2010 "ACME PC Network"
ACE3010 "ACME Arcnet Plan"
ACE3030 "ACME Sample VS Board 1"
ACE4010 "ACME Tape Controller"
ACE5010 "ACME VDU Video Board"
ACE6010 "ACME Disk Controller"
ACE7010 "ACME Multi-Function Board"
ACR1201 "Acer 1200 486/25 EISA System Board"
ACR1211 "AcerFrame 3000SP33 486/33 EISA System Board"
ACR1341 "M1 486SX/20 CPU Board"
ACR1351 "M1 486SX/20 CPU Board"
ACR1361 "M1 487/20 CPU Board"
ACR1371 "M1 487/20 CPU Board"
ACR1381 "M1 486/20 CPU Board"
ACR1391 "M1 486/20 CPU Board"
ACR1581 "M1 486/33 CPU Board"
ACR1591 "M1 486/33 CPU Board"
ACR15A1 "M1 486/33 CPU Board"
ACR15B1 "M1 486/33 CPU Board"
ACR1701 "AcerFrame 1000"
ACR1711 "AcerFrame 1000 486/33 SYSTEM-2"
ACR1801 "Acer P43WE EISA System Board"
ACR3211 "AcerFrame 3000MP 486 SYSTEM-1"
ACR3221 "AcerFrame 486 Series SYSTEM-2"
ACR3231 "AcerFrame 486 Series SYSTEM-3"
ACR3241 "AcerFrame 486 Series SYSTEM-4"
ACR3261 "AcerFrame 3000MP 486 SYSTEM-1"
ACR3271 "AcerFrame 486 Series SYSTEM-2"
ACR3281 "AcerFrame 486 Series SYSTEM-3"
ACR3291 "AcerFrame 486 Series SYSTEM-4"
ACR4509 "ACER/Altos M1 System Board"
ADI0001 "Lightning Networks 32-Bit EISA Ethernet LAN Adapter"
ADP0000 "Adaptec AHA-1740 SCSI"
ADP0001 "Adaptec AHA-1740A SCSI"
ADP0002 "Adaptec AHA-1742A SCSI"
ADP0100 "Adaptec AHA-1540/1542 ISA SCSI Host Adapter"
AIM0002 "AUVA OPTi/EISA 32-Bit 486 All-in-One System Board"
ADP0200 "Adaptec AHA-1520/1522 ISA SCSI Host Adapter"
ADP0400 "Adaptec AHA-1744 SCSI"
ADP7756 "Adaptec AHA-284x SCSI (BIOS enabled)"
ADP7757 "Adaptec AHA-284x SCSI (BIOS disabled)"
ADP7770 "Adaptec AIC-7770 SCSI (on motherboard)"
ADP7771 "Adaptec AHA-274x SCSI"
AEI0401 "486EI EISA System Board"
AEO0301 "486EO EISA System Board"
AIR0101 "AIR486SE/25/33 EISA Baby AT-foot print motherboard."
AIR0103 "AIR486SE/25/33/50"
AIR0201 "AIR486LE/25/33/50"
AIR0301 "AIR 486EO EISA System Board"
AIR0401 "486EI EISA System Board"
AIR0501 "AIR 586EP PCI/EISA System Board"
AIR0601 "AIR 54CEP PCI/EISA System Board"
AIR0701 "AIR 54CDP PCI/EISA System Board"
AIR0702 "AIR 54CDP PCI/EISA Dual-Processors System Board"
AIR0901 "AIR 54TDP PCI/EISA Dual-Processors System Board"
AIR1001 "AIR P6NDP PCI/EISA Dual-Pentium Processor System Board"
AIR2001 "AIR SCSI-2E"
AIR2101 "AIR SCSI-2V"
AIR3001 "ENET2E EISA BUS MASTER ETHERNET ADAPTER"
AIR3101 "ENET-2V LOCAL BUS MASTER ETHERNET ADAPTER"
ALR0001 "Power/Business VEISA System Board"
ALR0041 "PowerPro System Board"
ALR0181 "PowerPro System Board"
ALR0241 "Evolution V Pentium Tower System Board"
ALR0341 "EISA PCI base System Board"
ALR3000 "80486 Processor Module"
ALR3010 "Pentium Processor Board"
ALR3023 "ALR 16-bit VGA without Parallel port"
ALR8580 "Advanced Disk Array Caching EISA Controller"
ALRA0C1 "System Board"
ALRA301 "Revolution Q-SMP System Board"
ALRA311 "Revolution Q-2SMP System Board"
ALRB0A0 "Primary System Processor Board - 80486DX2/66"
ALRB0B0 "Secondary System Processor Board - 80486DX2/66"
AMI44C1 "AMI SCSI Host Adapter - Series 44"
AMI15C1 "AMI SCSI Host Adapter"
AMI15D1 "AMI SCSI Host Adapter - Rev 2"
AMI15E1 "AMI Normal Single Ended EISA SCSI CACHING Controller-Ver 1.22"
AMI16B1 "AMI ENTERPRISE EISA system board"
AMI2509 "AMI ENTERPRISE EISA system board"
AMI25B1 "AMI ENTERPRISE EISA system board"
AMI28A1 "AMI EZ-FLEX EISA System Board"
AMI44D2 "AMI Fast Single Ended EISA SCSI CACHING Controller"
AMI4801 "AMI Series 48 EISA Fast SCSI Host Adapter"
AMI68B1 "AMI Enterprise III 486 EISA System Board"
APS0101 "EISA PIP INTERFACE"
APS0102 "EISA PIP INTERFACE"
APS0103 "EISA PIP INTERFACE"
ARC0010 "Alta EtherTPI/Combo"
ARC0020 "Alta TokenCombo-16 S/U"
ASU0100 "ASUS EISA-SC100 SCSI Cache Host Adapter (CFG file V2.0)"
ASU0500 "ASUS EISA-L500 Ethernet LAN ADAPTER"
ASU4001 "EISA-486C Main Board"
ASU4101 "EISA-486E Main Board"
ASU4201 "EISA-486A Main Board"
ASU4301 "EISA-486SI Main Board"
ASU4501 "Mini EISA-486H Main Board"
ASU4701 "Mini EISA-486AS Main Board"
ASU4901 "VL/EISA-486SV1 Main Board"
ASU5101 "PCI/E-P5MP4 or PCI/E-P54NP4 Main Board V2.3"
ASU5201 "P/E-P55T2P4D Main Board (CFG File V1.2)"
ATI1500 "ATI AT-1500 Ethernet Adapter Card"
ATI1700 "ATI AT-1700 Ethernet Adapter Card"
ATI4400 "mach32 EISA Video Accelerator Card"
ATI4402 "mach32 EISA Video Accelerator Card"
ATI4410 "mach32 Video Accelerator Card"
ATI4420 "mach32 Video Accelerator Card"
ATI4430 "mach32 VLB Video Accelerator Card"
ATT2402 "AT&T SCSI Host Adapter A (StarServer E)"
ATT2404 "DPT SCSI Host Bus Adapter (PM2012B/9X)"
AVI2E01 "AVIEW2E EISA SVGA Adapter"
AVM0001 "AVM ISDN-Controller A1"
BAN0440 "Banyan ICA"
BAN0670 "Banyan ICAplus"
BAN0680 "Banyan ICA/RM"
BUS4201 "BusTek/BusLogic Bt74xB 32-Bit Bus Master EISA-to-SCSI Host Adapter"
BUS4202 "BusTek/BusLogic Bt74xC 32-Bit Bus Master EISA-to-SCSI Host Adapter"
BUS6001 "BusTek/BusLogic Bt760 32-Bit Bus Master EISA-to-Ethernet Controller"
BUS6301 "BusTek/BusLogic Bt763E EISA 32-Bit 82596-based Ethernet Controller"
CCI0000 "Cache Computers, Inc. Memory Refresh Controller"
CCI1001 "Cache Computers Inc. 486/25 EISA System Board"
CCI2001 "Cache Computers Inc. 486/33 EISA System Board"
CCI3001 "Cache Computers, Inc. Modular EISA System Board"
CCI3009 "Cache Computers Inc. Modular EISA System Board"
CCI4000 "Cache Computers, Inc. 486/33 CPU Board"
CCI4001 "Cache Computers, Inc. 486/33 CPU Board"
CCI5001 "Cache Computers, Inc. 486/50 CPU Board"
CCI6001 "Cache Computer EISA Ethernet LAN Adapter"
CCI7001 "Cache Computers, Inc. EISA System Board"
CCI8001 "Cache Computers, Inc. EISA System Board"
CHAA041 "Chase AT4 Intelligent Serial Controller"
CHAA081 "Chase AT8 Intelligent Serial Controller"
CHAA091 "Chase AT8+ Intelligent Serial Controller"
CHAA161 "Chase AT16 Intelligent Serial Controller"
CHAA171 "Chase AT16+ Intelligent Serial Controller"
CMD0003 "CMD Technology, Inc. EISA SCSI Host Adapter"
CNT2000 "900E/950E EISA Bus 32-bit Ethernet LAN Adapter"
COG5000 "Cogent eMASTER+ AT Combo 16-Bit Workstation Ethernet Adapter"
COG7002 "Cogent eMASTER+ ATS Combo Bus-Mastering Ethernet Adapter"
COG9002 "Cogent eMASTER+ EISA XL 32-Bit Burst-mode Ethernet Adapter"
CPQ0101 "Compaq SYSTEMPRO System Board"
CPQ0109 "Compaq SYSTEMPRO System Board (ASSY # 001981)"
CPQ0401 "Compaq DESKPRO 486/33L or 386/33L System Board"
CPQ0501 "Compaq DESKPRO/M System Board"
CPQ0509 "Compaq DESKPRO/M System Board with Audio"
CPQ0511 "Compaq SYSTEMPRO/LT System Board"
CPQ0521 "Compaq DESKPRO XL System Board"
CPQ0531 "Compaq ProSignia 500 System Board"
CPQ0541 "Compaq ProSignia 300 System Board"
CPQ0551 "Compaq ProLiant 2500 Server"
CPQ0552 "Compaq ProLiant 2500 System Board"
CPQ0553 "Compaq ProLiant 1600 System Board"
CPQ0559 "Compaq ProLiant 1500 System Board"
CPQ0561 "Compaq ProLiant 3000 System Board"
CPQ0571 "Compaq ProSignia 200 Server"
CPQ0579 "Compaq ProLiant 800 Server"
CPQ0589 "Compaq ProLiant 850R"
CPQ0601 "Compaq ProSignia Server"
CPQ0609 "Compaq ProSignia Server"
CPQ0611 "Compaq ProSignia Server"
CPQ0621 "Compaq ProSignia Server (ASSY # 3154)"
CPQ0629 "Compaq ProSignia Server (ASSY # 3154)"
CPQ0631 "Compaq ProLiant 1000 Server"
CPQ0639 "Compaq ProLiant 1000 Server"
CPQ0671 "Compaq ProSignia 200"
CPQ0679 "Compaq ProLiant 1850R"
CPQ0680 "Compaq ProLiant CL1850 System Board"
CPQ0681 "ProLiant CL380"
CPQ0685 "Compaq ProLiant DL360"
CPQ0686 "Compaq ProSignia 780"
CPQ0687 "Compaq ProSignia 740"
CPQ0688 "Compaq ProLiant 800 System Board"
CPQ0689 "Compaq ProLiant 1600 System Board"
CPQ0690 "Compaq ProLiant ML370"
CPQ0691 "Compaq ProLiant 800"
CPQ0692 "Compaq ProLiant DL380"
CPQ0701 "Compaq ProSignia VS"
CPQ0709 "Compaq ProLiant 3000 System Board"
CPQ0711 "Compaq ProSignia VS"
CPQ0712 "Compaq ProLiant ML530"
CPQ0714 "Compaq ProLiant ML570"
CPQ0715 "Compaq ProLiant DL580"
CPQ0718 "Compaq TaskSmart N2400"
CPQ071D "Compaq TaskSmart C2500"
CPQ0808 "Compaq ProLiant 5500"
CPQ0809 "Compaq ProLiant 6500 System Board"
CPQ0810 "Compaq ProLiant 6400R System Board"
CPQ0811 "Compaq ProLiant 1500 System Board"
CPQ1001 "Compaq Portable 486"
CPQ1009 "Compaq Portable 486/66"
CPQ1201 "Compaq DESKPRO 486/25"
CPQ1301 "Compaq DESKPRO 486/50L"
CPQ1401 "Compaq Portable 486c"
CPQ1409 "Compaq Portable 486c/66"
CPQ1501 "Compaq SYSTEMPRO/XL Server"
CPQ1509 "Compaq ProLiant 4000 Server"
CPQ1519 "Compaq ProLiant 2000 Server"
CPQ1529 "Compaq ProLiant 4500 Server"
CPQ1561 "Compaq ProLiant 5000 System Board"
CPQ1563 "Compaq ProLiant 6000 System Board"
CPQ1565 "Compaq ProLiant 6500 System Board"
CPQ1601 "Compaq ProLiant 7000"
CPQ1602 "Compaq ProLiant 6000"
CPQ1603 "Compaq Standard Peripherals Board"
CPQ1608 "Compaq ProLiant 8500"
CPQ1609 "Compaq ProLiant 8000"
CPQ1669 "Compaq ProLiant 7000 System Board"
CPQ3001 "Compaq Advanced VGA"
CPQ3011 "Compaq QVision 1024/E Video Controller"
CPQ3021 "Compaq QVision 1024/I Video Controller"
CPQ3111 "Compaq QVision 1024/E Graphics Controller"
CPQ3112 "Compaq QVision 1280/E Graphics Controller"
CPQ3121 "Compaq QVision 1024/I Graphics Controller"
CPQ3122 "Compaq QVision 1280/I Graphics Controller"
CPQ4001 "Compaq 32-Bit Intelligent Drive Array Controller"
CPQ4002 "Compaq Intelligent Drive Array Controller-2"
CPQ4010 "Compaq 32-Bit Intelligent Drive Array Expansion Controller"
CPQ4020 "Compaq SMART Array Controller"
CPQ4030 "Compaq SMART-2/E Array Controller"
CPQ4300 "Compaq Advanced ESDI Fixed Disk Controller"
CPQ4401 "Compaq Integrated SCSI-2 Options Port"
CPQ4410 "Compaq Integrated 32-Bit Fast-SCSI-2 Controller"
CPQ4411 "Compaq 32-Bit Fast-SCSI-2 Controller"
CPQ4420 "Compaq 6260 SCSI-2 Controller"
CPQ4430 "Compaq 32-Bit Fast-Wide SCSI-2/E Controller"
CPQ4431 "Compaq 32-Bit Fast-Wide SCSI-2/E Controller"
CPQ5000 "Compaq 386/33 System Processor Board used as Secondary"
CPQ5251 "Compaq 5/133 System Processor Board-2MB"
CPQ5253 "Compaq 5/166 System Processor Board-2MB"
CPQ5255 "Compaq 5/133 System Processor Board-1MB"
CPQ525D "Compaq 5/100 System Processor Board-1MB"
CPQ5281 "Compaq 486/50 System Processor Board used as Secondary"
CPQ5282 "Compaq 486/50 System Processor Board used as Secondary"
CPQ5287 "Compaq 5/66 System Processor Board used as Secondary"
CPQ528A "Compaq 5/100 System Processor Board w/ Transaction Blaster"
CPQ528B "Compaq 5/100 System Processor Board"
CPQ528F "Compaq 486DX2/66 System Processor Board used as Secondary"
CPQ529B "Compaq 5/90 System Processor Board"
CPQ529F "Compaq 5/133 System Processor Board"
CPQ52A0 "Compaq System Processor"
CPQ5900 "Compaq 486/33 System Processor Board used as Secondary"
CPQ5A00 "Compaq 486/33 System Processor Board (ASSY # 002013) used as Secondary"
CPQ5B00 "Compaq 486DX2/66 System Processor Board used as Secondary"
CPQ5C00 "Compaq 486/33 System Processor Board used as Secondary"
CPQ6000 "Compaq 32-Bit DualSpeed Token Ring Controller"
CPQ6001 "Compaq 32-Bit DualSpeed Token Ring Controller"
CPQ6002 "Compaq NetFlex-2 TR"
CPQ6100 "Compaq NetFlex ENET-TR"
CPQ6101 "Compaq NetFlex-2 Controller"
CPQ6200 "Compaq DualPort Ethernet Controller"
CPQ6300 "Compaq NetFlex-2 DualPort TR"
CPQ7000 "Compaq 32-Bit Server Manager/R Board"
CPQ7001 "Compaq 32-Bit Server Manager/R Board"
CPQ7100 "Compaq Remote Insight Board"
CPQ7200 "Compaq StorageWorks Fibre Channel Host Bus Adapter/E"
CPQ9004 "Compaq 386/33 Processor Board"
CPQ9005 "Compaq 386/25 Processor Board"
CPQ9013 "Compaq 486DX2/66 System Processor Board used as Primary"
CPQ9014 "Compaq 486/33 System Processor Board used as Primary"
CPQ9015 "Compaq 486/33 Processor Board"
CPQ9016 "Compaq 486DX2/66 Processor Board"
CPQ9017 "Compaq 486DX2/50 Processor Board"
CPQ9018 "Compaq 486/33 Processor Board (8 MB)"
CPQ9034 "Compaq 486SX/25 Processor Board"
CPQ9035 "Compaq 486SX/16 Processor Board"
CPQ9036 "Compaq 486SX/25 Processor Board (8 MB)"
CPQ9037 "Compaq 486SX/16 Processor Board (8 MB)"
CPQ9038 "Compaq 486SX/33 Processor Board (8 MB)"
CPQ903C "Compaq 486SX/33 Processor Board (4 MB)"
CPQ9040 "Compaq 5/66 Processor Board"
CPQ9041 "Compaq 5/66 Processor Board"
CPQ9042 "Compaq 5/66 Processor Board"
CPQ9043 "Compaq 5/66 Processor Board"
CPQ9044 "Compaq 5/60 Processor Board"
CPQ9045 "Compaq 5/60 Processor Board"
CPQ9046 "Compaq 5/60 Processor Board"
CPQ9047 "Compaq 5/60 Processor Board"
CPQ9251 "Compaq 5/133 System Processor Board-2MB"
CPQ9253 "Compaq 5/166 System Processor Board-2MB"
CPQ9255 "Compaq 5/133 System Processor Board-1MB"
CPQ925D "Compaq 5/100 System Processor Board-1MB"
CPQ925F "ProLiant 2500 Dual Pentium Pro Processor Board"
CPQ9267 "Compaq Pentium II Processor Board"
CPQ9278 "Compaq Processor Board"
CPQ9279 "Compaq Processor Board"
CPQ9280 "Compaq Processor Board"
CPQ9281 "Compaq 486/50 System Processor Board used as Primary"
CPQ9282 "Compaq 486/50 System Processor Board used as Primary"
CPQ9283 "Processor Modules"
CPQ9285 "Processor Modules"
CPQ9286 "Compaq Slot-1 Terminator Board"
CPQ9287 "Compaq 5/66 System Processor Board used as Primary"
CPQ928A "Compaq 5/100 System Processor Board w/ Transaction Blaster"
CPQ928B "Compaq 5/100 System Processor Board"
CPQ928F "Compaq 486DX2/66 System Processor Board used as Primary"
CPQ929B "Compaq 5/90 System Processor Board"
CPQ929F "Compaq 5/133 System Processor Board"
CPQ92A0 "Compaq ProLiant 1500 Processor Board"
CPQ92A4 "Compaq System Processor Board"
CPQ92B0 "Compaq Processor Board"
CPQ92B1 "Compaq FRC Processor Board"
CPQ92B2 "Compaq Terminator Board"
CPQ92B3 "6/200 FlexSMP Dual Processor Board"
CPQ92B4 "Compaq Processor Board"
CPQ92B5 "Compaq Terminator Board"
CPQ92B6 "Compaq Processor Board"
CPQ92B7 "Compaq Processor(s)"
CPQ92B8 "Compaq Terminator Board"
CPQ92B9 "Compaq Terminator Board"
CPQ9351 "Compaq 5/133 System Processor Board-2MB"
CPQ9353 "Compaq 5/166 System Processor Board-2MB"
CPQ9355 "Compaq 5/133 System Processor Board-1MB"
CPQ935D "Compaq 5/100 System Processor Board-1MB"
CPQ9381 "Compaq 486/50 System Processor Board"
CPQ9382 "Compaq 486/50 System Processor Board"
CPQ9387 "Compaq 5/66 System Processor Board"
CPQ938A "Compaq 5/100 System Processor Board w/ Transaction Blaster"
CPQ938B "Compaq 5/100 System Processor Board"
CPQ939B "Compaq 5/90 System Processor Board"
CPQ939F "Compaq 5/133 System Processor Board"
CPQ9451 "Compaq 5/133 System Processor Board-2MB"
CPQ9453 "Compaq 5/166 System Processor Board-2MB"
CPQ9455 "Compaq 5/133 System Processor Board-1MB"
CPQ945D "Compaq 5/100 System Processor Board-1MB"
CPQ9481 "Compaq 486/50 System Processor Board"
CPQ9482 "Compaq 486/50 System Processor Board"
CPQ9487 "Compaq 5/66 System Processor Board"
CPQ948A "Compaq 5/100 System Processor Board w/ Transaction Blaster"
CPQ948B "Compaq 5/100 System Processor Board"
CPQ949B "Compaq 5/90 System Processor Board"
CPQ949F "Compaq 5/133 System Processor Board"
CPQ9901 "Compaq 486SX/16 Processor Board"
CPQ9902 "Compaq 486SX/16 Processor Board"
CPQ9903 "Compaq 486SX/25 Processor Board"
CPQ9904 "Compaq 486SX/25 Processor Board"
CPQ9905 "Compaq 486SX/25 Processor Board"
CPQ9906 "Compaq 486/33 Processor Board"
CPQ9907 "Compaq 486DX2/66 Processor Board"
CPQ9908 "Compaq 486SX/16 Processor Board"
CPQ9909 "Compaq 486SX/16 Processor Board"
CPQ990A "Compaq 486SX/25 Processor Board"
CPQ990B "Compaq 486SX/25 Processor Board"
CPQ990C "Compaq 486SX/25 Processor Board"
CPQ990D "Compaq 486/33 Processor Board"
CPQ990E "Compaq 486SX/33 Processor Board (8 MB)"
CPQ990F "Compaq 486SX/33 Processor Board (8 MB)"
CPQ9990 "Compaq 386/33 System Processor Board used as Primary"
CPQ9991 "Compaq 386/33 Desktop Processor Board"
CPQ9999 "Compaq 486/33 System Processor Board used as Primary"
CPQ999A "Compaq 486/33 Desktop Processor Board"
CPQ9A83 "Compaq DESKPRO XL Processor Board"
CPQ9AA1 "Compaq ProSignia 500 Processor Board"
CPQ9AA2 "Compaq ProSignia 300 Processor Board"
CPQA000 "Compaq Enhanced Option Slot Serial Board"
CPQA010 "Compaq Enhanced Option Slot Modem Board"
CPQA015 "Compaq Integrated Remote Console (IRC)"
CPQA020 "Compaq Integrated CD Rom Adapter"
CPQA030 "Compaq Integrated CD Rom Adapter"
CPQA040 "Compaq Automatic Server Recovery (ASR)"
CPQA045 "Compaq Integrated Management Display Information"
CPQF000 "Compaq Fixed Disk Drive Feature"
CPQF100 "Compaq Ethernet 16TP Controller"
CPQF110 "Compaq Token Ring 16TR Controller"
CPQF120 "Compaq NetFlex-3/E Controller"
CPQF140 "Compaq NetFlex-3/E Controller"
CPQFA0D "Compaq SYSTEMPRO 4-Socket System Memory Board"
CPQFA0E "Compaq SYSTEMPRO 6-Socket System Memory Board"
CPQFA0F "Compaq DESKPRO 486/25 System Memory Board"
CPQFA1A "Compaq DESKPRO 3-Socket System Memory Board"
CPQFA1B "Compaq DESKPRO 486/50 System Memory Board"
CPQFA1C "Compaq System Memory Expansion Board"
CPQFA1D "Compaq SYSTEMPRO/XL Memory Expansion Board"
CPQFA1E "Compaq Memory Expansion Board"
CPQFB03 "Compaq Async/Parallel Printer Intf Assy 000990"
CPQFB07 "Compaq DESKPRO 2400 Baud Modem"
CPQFB09 "Compaq SpeedPaq 144/I Modem"
CPQFB11 "Compaq Internal 28.8/33.6 Data+Fax Modem"
CPQFC0B "Compaq Advanced Graphics 1024 Board"
CPQFD08 "Compaq 135Mb, 150/250Mb Tape Adapter"
CPQFD13 "Compaq 15MHz ESDI Fixed Disk Controller 001283"
CPQFD17 "Compaq SCSI Tape Adapter"
CPX0301 "Universal 10/100VG Selectable EISA LAN Adapter"
CRS3203 "Crescendo 320 FDDI/CDDI EISA Adapter"
CRS3204 "Cisco CDDI/FDDI EISA Adapter"
CSI0690 "CSI F70X9 EISA FDDI DNI adapter card"
CUI0000 "CUI Examples -- Virtual Board"
DBI0101 "Digi C/X Host Adapter - EISA"
DBI0102 "Digi C/X Host Adapter - EISA"
DBI0201 "Digi EISA/Xem Host Adapter"
DBI0301 "Digi EPC/X Host Adapter - EISA"
DBI0501 "Digi Ports/Xem Host Adapter - ISA"
DBI0601 "Digi EPC/X Host Adapter - ISA"
DBI0701 "Digi C/X Host Adapter - ISA"
DBI0801 "Digi PC/Xr - ISA"
DBI0901 "Digi PC/Xt - ISA"
DBI0C01 "Digi DataFire - ISA"
DBI0D01 "Digi DataFire/4 - ISA"
DBI0E01 "Digi PC IMAC - ISA"
DBI0F01 "Digi PC IMAC/4 - ISA"
DBI1001 "Digi PC/Xe - ISA"
DBI1101 "Digi ES/4 Host Adapter - EISA"
DBI1201 "Digi Acceleport Xr 920 - ISA"
DEC1011 "Digital EISA Video Controller (EVC-1)"
DEC1021 "Digital EISA SCSI Controller (ESC-1)"
DEC1031 "DECpc MTE Series System Board"
DEC2030 "Digital Ethernet Controller (DE203)"
DEC2040 "Digital Ethernet Controller (DE204)"
DEC2050 "Digital Ethernet Controller (DE205)"
DEC2400 "DECpc AXP/150 System Board"
DEC2500 "DEC EISA NVRAM for Alpha AXP"
DEC2A01 "Digital AlphaServer 2100 Family System Board"
DEC2E00 "Digital KFESA DSSI EISA Host Adapter"
DEC2F00 "Digital WANcontroller/EISA (DNSES)"
DEC3001 "DEC FDDIcontroller/EISA Adapter"
DEC3002 "DEC FDDIcontroller/EISA Adapter"
DEC3003 "DEC FDDIcontroller/EISA Adapter"
DEC3004 "DEC FDDI Controller"
DEC4220 "Digital EISA Ethernet Controller (DE422-SA)"
DEC4250 "Digital EtherWORKS Turbo EISA (DE425-AA)"
DEC5000 "Digital AlphaServer 1000, 1000A and AlphaStation 600A System Board"
DEC5100 "Digital AlphaStation 600 Family System Board"
DEC5301 "Digital 800 AlphaServer Family System Board"
DEC6000 "Digital AlphaServer 8200 and 8400 Family System Board"
DEC6400 "Digital AlphaServer 4100 System Board"
DEC8101 "DEC VGA 1024 Graphics Adapter"
DEC8102 "DEC 8514/A-Compatible Graphics Adapter"
DEC8103 "DECpc VGA 1024 NI Graphics Adapter"
DEC8300 "DEC DEPCA LC Ethernet Controller"
DEC8301 "DEC DEPCA TURBO Ethernet Controller"
DEL0000 "Generic ISA Board"
DEL0001 "Dell System(R) 425E(TM) System Board"
DEL0002 "Dell System(R) 433E(TM) System Board"
DEL0003 "Dell System(R) 425TE(TM) System Board"
DEL0004 "Dell System(R) 433TE(TM) System Board"
DEL0005 "Dell Powerline(TM) Workstation 433DE(TM) System Board"
DEL0006 "Dell Powerline(TM) Workstation 420DE(TM) System Board"
DEL0007 "Dell Powerline(TM) Workstation 450DE(TM) System Board"
DEL0008 "Dell Powerline(TM) Server 433SE(TM) System Board"
DEL0009 "Dell Powerline(TM) Server 420SE(TM) System Board"
DEL000A "Dell Powerline(TM) Server 450SE(TM) System Board"
DEL000B "Dell PowerLine(TM) Workstation 425DE(TM) System Board"
DEL000C "Dell PowerLine(TM) Server 425SE(TM) System Board"
DEL0011 "Dell Powerline(TM) Server 450SE/2(TM) System Board"
DEL0019 "Dell Powerline(TM) Server 466SE(TM) System Board"
DEL0021 "Dell Powerline(TM) Workstation 450DE/2(TM) System Board"
DEL0029 "Dell Powerline(TM) Workstation 466DE(TM) System Board"
DEL002A "Dell Powerline(TM) Workstation P60/DE(TM) System Board"
DEL002B "Dell Powerline(TM) Workstation P66/DE(TM) System Board"
DEL002C "Dell Powerline(TM) Workstation P60/SE(TM) System Board"
DEL002D "Dell Powerline(TM) Workstation P66/SE(TM) System Board"
DEL0031 "Dell 486/ME System Board"
DEL0036 "Dell 406x/XE System Board"
DEL0038 "Dell 456x/XE System Board"
DEL0054 "Dell System PowerEdge 2100"
DEL0058 "Dell System PowerEdge 4100"
DEL005A "Dell System PowerEdge 2200"
DEL005C "Dell System PowerEdge 4200"
DEL2100 "Dell Remote Server Assistant Card"
DEL4001 "Dell Drive Array"
DEL4002 "Dell SCSI Array Controller"
DEL6001 "Dell DGX Video Subsystem"
DELFC00 "Dell GPX-1024 Graphics Performance Accelerator"
DELFC01 "Dell VGA Professional 16-bit"
DELFC02 "Paradise Hi-Res Graphics Adapter"
DELFC03 "Paradise Hi-Res Graphics Card"
DELFD00 "UltraStor 12F/12F-24 ESDI/Diskette Cntrl"
DELFD02 "Archive XL Tape Host Adapter"
DELFD03 "Wangtek Tape Host Adapter"
DELFD05 "Adaptec AHA-1510 ISA SCSI Host Adapter"
DIS0000 "NETSERVER LH PRO - DISABLE SCSI B - FOR TEST & EVALUATION ONLY"
DPT2402 "DPT SCSI Host Bus Adapter (PM2012A/9X)"
DPT2403 "DPT SCSI Host Bus Adapter (PM2012A/90)"
DPTA401 "DPT SCSI Host Bus Adapter (PM2012B/9X)"
DPTA402 "DPT SCSI Host Bus Adapter (PM2012B2/9X) - Banyan Vines"
DPTA410 "DPT SCSI Host Bus Adapter (PM2X22A/9X)"
DPTA501 "DPT SCSI Host Bus Adapter (PM2012B1/9X)"
DPTA502 "DPT SCSI Host Bus Adapter (PM2012B2/9X)"
DPTA701 "DPT SCSI Host Bus Adapter (PM2011B1/9X)"
DPTBC01 "DPT ESDI Caching Hard Disk Controller (PM3011/7X)"
DTC1101 "DTC2290 EISA IDE Controller"
DTC3101 "DTC3290 Host Adapter"
DTI0000 "Evolution RISC PC"
DTI2000 "DTI ESP2000A/ESP2000 EISA System Processor Board"
DTI2002 "DTI ESP2002 Integrated EISA System Processor"
DTK0001 "DTK PLM-3300I 80486 EISA Board"
DTK0003 "DTK PLM-3331P EISACACHE486 33/25/50 MHZ"
ECS0580 "DI-580A EISA SCSI Host Adapter"
ECS0590 "DI-590 EISA SCSI Cache Host Adapter"
EGL0101 "Eagle Technology EP3210 EtherXpert EISA Adapter"
ELS8041 "ELSA WINNER 1000 Enhanced VGA"
ETI1001 "NE3300 Ethernet Rev. C & D"
EVX0002 "PN-3000 System Board"
FCT0001 "EISA SYSTEM BOARD"
FCT0002 "386 EISA SYSTEM BOARD"
FCT0003 "486 EISA SYSTEM BOARD"
FIC0000 "LEO 486VE EISA Main Board"
FIX1516 "15-16MB Memory Hole Patch - Netserver LF/LC 5/66"
FSI2001 "ESA-200 ATM"
FSI2002 "ESA-200A ATM"
FSI2003 "ESA-200E ATM"
GCI0101 "Gateway G/Ethernet 32EB -- 32-Bit EISA Bus Master Ethernet Adpater"
GCI0102 "Gateway G/Ethernet 32EB -- 32-Bit EISA Bus Master Ethernet Adapter"
GCI0103 "Gateway G/Ethernet 32EB -- 32-Bit EISA Bus Master Ethernet Adapter"
GDT2001 "GDT2000/GDT2020 Fast-SCSI Cache Controller - Rev. 1.0"
GDT3001 "GDT3000/GDT3020 Dual Channel SCSI Controller - Rev. 1.0"
GDT3002 "GDT30x0A Cache Controller"
GDT3003 "GDT3000B/GDT3010A EISA SCSI Cache Controller - Rev. 1.0"
GIT0000 "G486PEL EISA & LOCAL Bus Mother Board."
GIT0001 "G486HVL EISA & VESA LOCAL Bus Mother Board."
HCL0801 "HCL-Hewlett Packard Limited PANTHER System Board"
HIT0001 "MCC Mini-EISA486 Board"
HKG0011 "Distributed Signal Conditioning Front-End"
HMS0000 "HMSI ESIC EVALUATION BOARD"
HWP0000 "HP Monochrome Plus Video Board (35732A)"
HWP0010 "HP Multimode Video Adapter (45981A)"
HWP0020 "HP Multimode Color Adapter Board (45984A)"
HWP0030 "HP Enhanced Graphics Adapter Board (45983A)"
HWP0070 "HP Intelligent Graphics Controller 20 (A1083A)"
HWP0C70 "HP-IB Host Adapter"
HWP0C80 "SCSI Host Adapter (Cirrus-II) -- 25525A"
HWP1400 "HP Dual Serial Interface Board (24541B)"
HWP1410 "HP Internal 2400 Baud Modem (24551A)"
HWP1420 "HP Internal 1200 Baud Modem (24550A)"
HWP1440 "HP Terminal Multiplexor Board (D2040A)"
HWP1450 "HP HP-IB Interface board (82335A)"
HWP1460 "HP ScanJet Plus Interface (88290A)"
HWP1461 "HP ScanJet Plus Interface (88290A)"
HWP1801 "HP StarLAN 10 PC Link II (27240A)"
HWP1810 "HP ThinLAN Interface Board (27210B)"
HWP1811 "HP ThinLAN PC Adapter Card (27250A)"
HWP1820 "HP EtherTwist Adapter Card/8 (27245-60002)"
HWP1832 "HP EtherTwist PC LAN Adapter/16 TP Plus (27247B)"
HWP1840 "HP EtherTwist EISA LAN Adapter/32"
HWP1850 "LAN AdapterCard -- 25567A"
HWP18A0 "HP EtherTwist PC LAN Adapter/16 TL Plus (27252A)"
HWP18C0 "HP EtherTwist PC LAN Adapter NC/16 TP (J2405A)"
HWP18E0 "HP 100Mbps EISA ATM Card"
HWP1940 "HP 10/100VG Selectable EISA LAN Adapter (J2577A)"
HWP1980 "ATM Adapter -- J2802A"
HWP1990 "Hewlett-Packard EISA 100VG AnyLAN adapter card"
HWP1C00 "HP Serial/Parallel Interface Board (24540B)"
HWP2002 "HP ScanJet II Interface (C1752A)"
HWP2051 "EISA Test Adapter Card"
HWP2080 "HP ScanJet II Interface (C2502A)"
HWPC000 "Series 700 EISA System Board"
HWPC010 "Series 700 EISA System Board"
HWPC051 "Series 700 EISA System Board"
HWPC091 "EISA System Board"
HWPC0D1 "EISA System Board"
HWPC0E1 "EISA System Board"
IBM0001 "IBM Auto 16/4 Token Ring ISA Adapter"
IBM1000 "IBM 16/4 Busmaster EISA Adapter"
IBM1060 "IBM 100/10 ISA Ethernet Adapter"
IBM1061 "IBM 100/10 ISA Ethernet Adapter"
ICLA080 "ICL EtherTeam 32 EISA 32-bit Ethernet Controller"
ICU0010 "Intel SatisFAXtion Modem/400"
ICU0020 "Intel SatisFAXtion Modem/100"
ICU0030 "DigiBoard DigiChannel PC/4E Serial Adapter"
ICU0040 "Western Digital WD1003V-MM2(WITH FIRMWARE) Hard/Floppy Disk Controller"
ICU0041 "Western Digital WD1003V-MM2(WITHOUT FIRMWARE) Hard/Floppy Disk Controller"
ICU0050 "Western Digital WD1007A-WA2(WITH BIOS) Hard/Floppy Disk Controller"
ICU0051 "Western Digital WD1007A-WA2(WITHOUT BIOS) Hard/Floppy Disk Controller"
ICU0052 "Western Digital WD1007V-SE2 Hard/Floppy Disk Controller"
ICU0060 "Archive SC402/VP402 QIC-02 Tape Controller"
ICU0070 "Wangtek PC-36 Tape Controller"
ICU0080 "Wangtek PC-02 Tape Controller"
ICU0091 "Adaptec 1542B SCSI/Floppy Disk Controller"
ICU0092 "Adaptec 1542C SCSI/Floppy Disk Controller"
ICU00A0 "DPT PM2011B1/9X SCSI Controller"
ICU00B0 "3COM Etherlink II (3C503) Network Adapter"
ICU00C0 "3COM Etherlink 16 (3C507) Network Adapter"
ICU00D0 "SMC PC600WS Network Adapter"
ICU00E0 "SMC PC130E Network Adapter"
ICU00F0 "Novell NE2000 Network Adapter"
ICU0100 "Western Digital WD8003E Network Adapter"
ICU0110 "Paradise VGA Plus 16 Video Adapter "
ICU0120 "Paradise VGA 1024 Video Adapter "
ICU0130 "Orchid Prodesigner IIs Video Adapter"
ICU0140 "ATI Graphics Ultra Pro Video Adapter"
ICU0150 "Orchid Fahrenheit 1280 Video Adapter "
ICU0160 "ATI VGA Wonder XL24 Video Adapter"
ICU0170 "ATI Graphics Ultra Video Adapter"
ICU0180 "Sound Blaster Multi-Media Adapter"
ICU0190 "Sound Blaster Pro Multi-Media Adapter"
ICU01A0 "Sound Blaster 16ASP Multi-Media Adapter"
ICU01B0 "Gravis Ultra Sound Multi-Media Adapter"
ICU01C0 "Logitech Soundman 16 Multi-Media Adapter"
ICU01D0 "Media Vision Thunderboard Multi-Media Adapter"
ICU01E0 "Pro Audio Spectrum 16 Multi-Media Adapter"
ICU01F0 "Microsoft Windows Sound System Multi-Media Adapter"
ICU0200 "Intel Above Board Plus 8 I/O"
ICU0210 "Logitech Bus Mouse"
ICU0220 "Microfield Graphics V8 Video Controller"
ICU0230 "Accton Ringpair-4/16 (TR1605)"
ICU0240 "CNet CN600E/680E"
ICU0250 "CNet CN1000T"
ICU0260 "CNet CN850E"
ICU0270 "CNet CN800E/880E"
ICU0280 "Cogent E/Master II-AT"
ICU0290 "Cogent E/Master I-AT"
ICU02A0 "D-Link DE-100"
ICU02B0 "D-Link DE-200"
ICU02C0 "Eagle/Novell NE1000 (810-160-00X)"
ICU02C1 "Eagle/Novell NE1000 (950-054401)"
ICU02D0 "Eagle/Novell NE1500T"
ICU02E0 "Eagle/Novell NE2100"
ICU02F0 "Gateway Ethertwist 16 (Fujitsu Chipset)"
ICU02F1 "Gateway Ethertwist 16 (National Chipset)"
ICU0300 "Gateway Ethertwist PC/PC-WS(National Chipset)"
ICU0310 "Proteon ProNET-4/16 Model p1390"
ICU0320 "Racal-Datacom InterLan AT"
ICU0330 "SMC PC330"
ICU0340 "SMC PC500"
ICU0350 "SMC PC550"
ICU0360 "SMC PC650"
ICU0370 "SMC PC270E"
ICU0380 "SMC 3008"
ICU0390 "SMC 3016"
ICU03A0 "Thomas-Conrad TC5045-2"
ICU03B0 "Thomas-Conrad TC6042/TC6142/TC6242"
ICU03C0 "Thomas-Conrad TC6045"
ICU03D0 "Thomas-Conrad TC6245"
ICU03E0 "Tiara Lancard 2002/2003"
ICU03F0 "Tiara Lancard AT"
ICU0400 "Tiara Lancard PC"
ICU0410 "Tiara ARCNET Lancard AT"
ICU0420 "Tiara Ethernet Lancard * 2000"
ICU0430 "Tiara Ethernet Lancard E2000"
ICU0440 "Tiara Lancard A-286"
ICU0450 "Tiara Lancard E"
ICU0460 "Tiara Lancard E * AT"
ICU0470 "Tiara Lancard E * AT TP"
ICU0480 "Tiara Lancard E * PC"
ICU0490 "Tiara Lancard E * PC10BT"
ICU04A0 "Tiara Lancard E * PC10TP"
ICU04B0 "Tiara Token Ring Lancard*16 AT"
ICU04C0 "Zenith LAN10E-MAT/FAT/FL-AT"
ICU04D0 "Zenith LAN16TR-AT"
ICU04E0 "Zenith LAN16TR-XT"
ICU04F0 "Zenith LAN4TR-AT"
ICU0500 "Zenith LAN4TR-XT"
ICU0510 "Zenith OfficeNIC"
ICU0520 "Zenith XT Lancard"
ICU0530 "BOCA M1440I 14.4Kbps V.32bis Modem"
ICU0540 "Always Technology IN-2000 SCSI Controller"
ICU0550 "Data Technology DTC3180A/DTC3280A SCSI Controller"
ICU0560 "DTC3150 SCSI Controller"
ICU0561 "DTC3150B SCSI Controller"
ICU0570 "Data Technology DTC3250 SCSI Controller"
ICU0580 "TMC-850M/TMC-850RL SCSI Controller"
ICU0590 "Future Domain TMC-880/TMC-881 SCSI Controller"
ICU05A0 "Future Domain TMC-1650/1660/1670/1680 SCSI Controller V5"
ICU05B0 "Future Domain TMC-1650/1660/1670/1680 SCSI Controller V4"
ICU05C0 "Promise Technology DC-2030 IDE Controller"
ICU05D0 "Promise Technology DC-2031 IDE Controller"
ICU05E0 "Promise Technology DC-2040 SCSI Controller"
ICU05F0 "Ultrastor ULTRA14F SCSI Controller"
ICU0600 "Ultrastor ULTRA12C/12F ESDI Controller"
ICU0610 "Ultrastor ULTRA15C IDE Controller"
ICU0620 "Longshine LCS-6624/6624G IDE Controller"
ICU0630 "Longshine LCS-6631/6631F SCSI Controller"
ICU0640 "Intel EtherExpress TPE Hub Controller"
ICU0650 "US Robotics Sportster 9600/PC Modem w/V.42BIS"
ICU0660 "Zoom AFC FAX Modem"
ICU0680 "DFI DIO-500 Serial/Parallel I/O Card"
ICU0681 "DFI DIO-200 Serial/Parallel I/O Card"
ICU0690 "Practical Peripherals PM9600FX Modem/FAX"
ICU06A0 "Practical Peripherals PM2400 Modem"
ICU06B0 "Zoom VFP V.32bis FAX Modem"
ICU06C0 "Zoom VP V.32bis Modem"
ICU06D0 "Zoom AMC 2400 Modem"
ICU06E0 "Cardinal MVP96IF 9600 Baud FAX/Modem"
ICU06F0 "Cardinal MB2296SR 9600 Baud FAX/Modem"
ICU0700 "Hayes Accura 2400B Modem"
ICU0710 "US Robotics Sportster 2400/PC Modem"
ICU0720 "US Robotics Sportster 14,400/PC FAX/Modem"
ICU0730 "Intel SatisFAXtion Modem/200"
ICU0740 "Racal InterLan NI5210-10BT"
ICU0750 "Racal InterLan NI6510-UTP"
ICU0760 "Intel Smart Video Recorder"
ICU0770 "Diamond Stealth Pro Accelerator"
ICU0780 "Diamond SpeedStar 24X VGA adapter"
ICU0790 "Video Seven WIN.PRO card"
ICU0800 "Video Seven WIN.VGA card"
ICU0810 "BOCA Super X Accelerator VGA"
ICU0820 "Metheus Premier 928"
ICU0830 "GraphicsENGINE ULTRA Series"
ICU0840 "Cardinal VIDEO spectrum"
ICU0850 "SigmaDegins Legend 24LX"
ICU0860 "Hercules Graphite Card"
ICU0870 "Focus GUIVGA"
ICU0880 "AIR AVIEW2V SVGA"
ICU0890 "NDI Volante Warp Series Warp10"
ICU0900 "NDI Volante Warp Series Warp10LB and 24LB"
ICU0910 "Cyber Audio Multi-Media Adapter"
ICU0920 "Genoa SuperVGA 6000 Series"
ICU0930 "Acculogic sIDE-1"
ICU0940 "Acculogic sIDE-1/16"
ICU0950 "Acculogic sIDE-3/plus"
ICU0960 "Alpha Research S4251 ISA"
ICU0970 "CMS Enhancement Universal AT/XT Controller"
ICU0980 "Eastern IDC-747"
ICU0990 "Juko D16-X"
ICU1000 "NCL538/NCL539"
ICU1010 "NCL538B"
ICU1020 "NCL538C"
ICU1030 "easyCACHE IDE/easyCACHEPro IDE"
ICU1040 "Plus Development HARDCARD II XL"
ICU1050 "Plus Development HARDCARD II"
ICU1060 "Seagate ST05A"
ICU1070 "Seagate ST05X"
ICU1080 "Silicon ADP60"
ICU1090 "Silicon ADP65"
ICU1100 "HP ISA SCSI Host Adapter (D1682A)"
ICU1101 "HP SCSI-1 Host Adapter for HP CD-ROM (D2886A)"
ICU1110 "Adaptec AHA-1540A/AHA-1542A"
ICU1120 "Bustek BT-542B"
ICU1130 "Bustek BT-542S/BT-542D"
ICU1140 "Computer Electronik Infosys C5610"
ICU1150 "Computer Electronik Infosys C5630"
ICU1160 "Computer Electronik Infosys C5635"
ICU1170 "Control Concepts HB A8"
ICU1180 "DPT PM2001B/90,PM2001B/95"
ICU1190 "Quantum ISA-200S"
ICU1200 "easyCACHE SCSI/easyCACHEPro SCSI"
ICU1210 "Procom CC-8 SCSI ENABLER"
ICU1220 "Procom CC-16 SCSI ENABLER"
ICU1230 "Procomp S-DCB"
ICU1240 "Procomp USA, Incoprated S-DCB"
ICU1250 "Rancho RT10-AT"
ICU1260 "SMS OMTI-810/812/820/822"
ICU1270 "SMC 4004-PC"
ICU1280 "Sumo SPI 200"
ICU1290 "Trantor T100"
ICU1300 "IBM Token-Ring 16/4 Adapter"
ICU1310 "Thomas TC-4045"
ICU1330 "DPT PM2011/95 SCSI Controller"
ICU1340 "DPT PM2021 SamrtCacheIII Adapter"
INP0010 "Barracuda E/4810"
ICU1360 "SyQuest SQ08 IDE Controller"
ICU1370 "SyQuest ST01 SCSI HOST Adapter"
IDS0100 "EISC960 EISA Caching SCSI Host Adapter"
IIN0B01 "Intel TokenExpress(tm) ISA/8 Network Adapter"
IKN1110 "IKON hardcopy boards: 10092, 10097, or 10111"
IMS1001 "Integrated Micro Solution Inc. 486 EISA System Board"
ING2040 "HCL-Hewlett Packard Limited PANTHER System Board"
INP25D0 "Seahawk 4811 FDDI Controller"
INP5000 "Interphase 4800 EISA->PCI Bridge"
INT0000 "Mercury/Neptune PCI-EISA Main Board"
INT0081 "HCL-Hewlett Packard Limited PANTHER System Board"
INT0701 "Intel TokenExpress(tm) ISA 16/4 Network Adapter"
INT0703 "Intel TokenExpress(tm) ISA/16s Network Adapter"
INT0902 "Intel TokenExpress(tm) EISA 16/4 Network Adapter"
INT0B01 "Intel TokenExpress(tm) ISA/8 Network Adapter"
INT1000 "Intel EtherExpress 16 Family LAN Adapter"
INT1010 "Intel EtherExpress(tm) Flash32 Ethernet Adapter"
INT1030 "Intel EtherExpress(TM) PRO/10 LAN Adapter"
INT1031 "Intel EtherExpress(TM) PRO/10+ LAN Adapter"
INT1060 "Intel EtherExpress(tm) PRO/100 LAN Adapter"
INT1201 "Intel TokenExpress(tm) EISA/32 Network Adapter"
INT3061 "LP486E System Board"
INT3079 "X-Series Desktop System Board"
INT3089 "X-Series Deskside System Board"
INT30A1 "L486 Series System Board"
INT30A9 "L486 Series System Board"
INT30D1 "X-Series System Board"
INT30F1 "X-Series Premium System Board"
INT3132 "ECC Memory Module (BXECCMEM0)"
INT31A0 "System Board"
ISA0000 "Generic ISA Adapter"
ISA0001 "Generic Video Card"
ISA1000 "Serial/Parallel Adapter Board"
ISA1010 "Generic OSF ISA COM/MODEM/LPT"
ISA2000 "Microsoft Sound Board ISA Adapter Definition"
ISA3000 "ISA-PCMCIA Adapter"
ISA4000 "Dialogic Voice Card Adapter"
ISA4010 "Dialogic DTI/2xx, DMX, MSI/C Adapter"
ISA4020 "GammaLink Fax Card Adapter Definitions"
ISA4030 "Dialogic Antares Card Definitions"
ISA6400 "ISA ATI MACH64 VGA controller"
ISA8100 "Attachmate 3270 COAX Adapter (Long Board)"
ISA8101 "Attachmate Advanced 3270 COAX Adapter (Short Board)"
ISA8102 "Attachmate SDLC/Autolink Adapter"
ISA8103 "Attachmate SDLC Adapter"
ISA8200 "AST 3270/COAX II Rev. X4"
ISA8201 "AST 5251/11 Enhanced Plus"
ISA8202 "AST SixPakPlus Version A"
ISA8203 "AST Rampage 286"
ISA8204 "AST RAMvantage"
ISA8300 "IBM Enhanced 5250 Emulator"
ISA8301 "IBM Enhanced 5250 Emulator Rev B"
ISA8302 "IBM SDLC (3270 or 5250 Remote)"
ISA8303 "IBM Advanced 3278/79 Adapter"
ISA8304 "IBM Serial/Parallel Adapter"
ISA8305 "IBM PC Network"
ISA8306 "IBM TOKEN RING Adapter I"
ISA8307 "IBM TOKEN RING Adapter II"
ISA8308 "IBM Monochrome Adapter"
ISA8309 "IBM VGA Display Adapter"
ISA830A "IBM Token Ring II Short Adapter"
ISA830B "IBM Token Ring 16/4 Adapter"
ISA830C "IBM Enhanced Graphics Adapter"
ISA830D "IBM PGA"
ISA830E "IBM Realtime Interface Co-Processor Multiport Adapter, Model 2"
ISA8400 "IDEAssociates IDEAcomm 5250/Remote"
ISA8401 "IDEAssociates IDEAcomm 5251 Twinax Plus Rev D"
ISA8402 "IDEAssociates IDEAcomm 5251 Twinax Plus Rev C"
ISA8403 "IDEAssociates IDEAcomm 5251 Twinax Rev A,B,C"
ISA8500 "DCA IRMA2 Adapter"
ISA8501 "DCA IRMA 3278 Emulation"
ISA8502 "DCA IRMA 3279 Graphics Adapter"
ISA8503 "DCA IRMA3 Convertible"
ISA8505 "DCA Smart Alec 5250"
ISA8506 "DCA IRMA Remote SDLC Adapter"
ISA8507 "DCA 10-NET Adapter"
ISA8508 "DCA IRMA2 3279 Graphics Adapter"
ISA8509 "DCA Intelligent Serial PC Adapter (Long SDLC)"
ISA8700 "Novell Coax Adapter 3270 Connection"
ISA8701 "Novell COAX GRAPHICS Rev. A"
ISA8702 "Novell TWINAX 5250"
ISA8711 "Novell NE1000 Ethernet Adapter"
ISA8712 "Novell NE2000 Ethernet Adapter"
ISA8713 "Novell RX-Net REV B,C,D NIC"
ISA8714 "Novell RX-Net REV E,F,G NIC"
ISA8804 "Tecmar EGA Master 480/800"
ISA8805 "Tecmar Maestro AT"
ISA8900 "SMC ARCNET PC"
ISA8901 "SMC ARCNET PC100"
ISA8902 "SMC ARCNET PC110"
ISA8903 "SMC Arcnet PC130/E"
ISA8904 "SMC Arcnet PC220/120"
ISA8905 "SMC Arcnet PC270/E"
ISA8906 "SMC Arcnet PC500"
ISA8907 "SMC Ethernet PC510"
ISA8A00 "NESTAR ARCNET PLAN 2000"
ISA8B00 "DEC DEPCA EtherLink Adapter, Rev D1"
ISA8B01 "DEC DEPCA EtherLink Adapter, Rev E or F"
ISA8C00 "3COM 3C505-2012 EtherLink Plus 16bit Mode"
ISA8C01 "3COM EtherLink 3C501 ASM 1221"
ISA8C02 "3COM EtherLink 3C500B ASM 34-0780"
ISA8C03 "3COM 3C503 EtherLink II"
ISA8C04 "3COM 3C603 Tokenlink 16bit"
ISA8C05 "3COM 3C605-2065 Tokenlink Plus 8bit"
ISA8C06 "3COM 3C505-2012 EtherLink Plus 8bit Mode"
ISA8C07 "3COM 3C605-2065 Tokenlink Plus 16bit Mode"
ISA8C08 "3COM 3C603 Tokenlink 8bit Mode"
ISA8C09 "3COM 3C507 Etherlink 16"
ISA8C10 "3COM 3C507TP Etherlink 16"
ISA8D00 "Tiara LANCARD/A REV B"
ISA8D01 "Tiara LANCard/E * PC 16"
ISA8E00 "Microsoft Mouse Controller"
ISA8E01 "Scanman Plus by Logitech"
ISA8F00 "AT&T STARLAN Network Adapter"
ISA8F01 "AT&T Truevision Image Capture Board"
ISA9000 "Hercules GB222 InColor Card"
ISA9001 "Hercules Graphics Card Plus"
ISA9002 "Hercules VGA Card"
ISA9100 "Quadram QuadEGA+"
ISA9101 "Quadram QuadVGA Video Adapter"
ISA9102 "Quadram QUADMEG-AT"
ISA9103 "QUADEMS+ W/IO"
ISA9200 "Intel Above Board/AT (no Piggyback)"
ISA9201 "Intel Above Board/AT With 2MB Piggyback"
ISA9202 "Intel Above Board 286 (no Piggyback)"
ISA9203 "Intel Above Board 286 With 2MB Piggyback"
ISA9204 "Intel Above Board PS/286 (no Piggyback)"
ISA9205 "Intel Above Board PS/286 With 2MB Piggyback"
ISA9206 "Intel Above Board Plus 8 (including 6Mb Piggyback)"
ISA9207 "Intel Visual Edge printing enhancement system"
ISA9208 "Intel iMX-LAN/586"
ISA9209 "Intel PC586E"
ISA9300 "MICOM-Interlan NP600A Ethernet 16bit"
ISA9302 "MICOM-Interlan NI5210/8 Ethernet"
ISA9303 "MICOM-Interlan NI5210/16 Ethernet"
ISA9400 "Gateway G/Ethernet AT"
ISA9401 "Gateway G/Ethernet 8-bit PC"
ISA9402 "Gateway G/Token Ring 8-bit "
ISA9403 "Gateway G/Token Ring AT "
ISA9404 "Gateway G/Net VS "
ISA9405 "Gateway G/Net LNIM"
ISA9500 "Proteon ProNET-4/AT P1344"
ISA9600 "Madge AT Ring Node"
ISA9601 "Smart ISA Ringnode"
ISA9700 "IMC PCnic 16bit NIC"
ISA9800 "Video Seven V-RAM VGA"
ISA9801 "Video Seven Vega Deluxe EGA Adapter"
ISA9802 "Video Seven FastWrite VGA Video Adapter"
ISA9803 "Video Seven VGA 1024i Video Adapter"
ISA9900 "Sigma Designs VGA-PC-HP160/162"
ISA9901 "Sigma Designs SigmaVGA or VGA/HP8"
ISA9A00 "Verticom M16/M256E"
ISA9A01 "Verticom MX16/AT & MX256/AT"
ISA9B00 "HP 82328A Intelligent Graphics Controller"
ISA9C01 "Matrox PG-1281"
ISA9C02 "Matrox PG-1024"
ISA9C03 "Matrox PG-641"
ISA9D00 "Renaissance GRX Rendition I"
ISA9D01 "Rendition II Intelligent Graphics Controller"
ISA9E00 "Pixelworks Micro Clipper Graphics"
ISA9E01 "Pixelworks Ultra Clipper Graphics"
ISA9F00 "Genoa Super VGA 16-Bit"
ISA9F02 "Genoa SuperVGA"
ISA9F03 "Genoa SuperEGA HiRes+"
ISA9F04 "Genoa SuperSpectrum Model 4650"
ISA9F05 "Genoa SuperSpectrum Model 4640"
ISA9F07 "Genoa Systems QIC-02 Tape Controller"
ISAA000 "Vermont Page Manager 100"
ISAA100 "Orchid TurboPGA"
ISAA101 "Orchid ProDesigner VGA/VGA+"
ISAA102 "Orchid Enhanced Board OM"
ISAA103 "Orchid Enhanced Board w/IO"
ISAA200 "Paradise VGA Professional 16-bit"
ISAA201 "Paradise VGA Plus 8-bit"
ISAA202 "Paradise Autoswitch EGA"
ISAA300 "Truevision ATVista ICB"
ISAA400 "Excelan EXOS 205E"
ISAA401 "Excelan EXOS 205T 16-Bit"
ISAA500 "Pure Data PDI8025 Token Ring"
ISAA501 "Pure Data PDI508 ArcNet"
ISAA600 "BICC ISOLAN Ethernet"
ISAA700 "Control Systems Artist 10"
ISAA701 "Control Systems Artist XJ10"
ISAA800 "Codenoll Codenet3051"
ISAAB00 "Hayes Smartmodem 1200B"
ISAAB01 "Hayes Smartmodem"
ISAAB02 "Hayes Smartmodem 2400B"
ISAAB03 "Hayes Smartmodem 2400Q"
ISAAC00 "ATI Tech. Inc. EGA WONDER"
ISAAC01 "ATI Tech. Inc. VGA WONDER"
ISAAD00 "TOPS FlashCard"
ISAAE01 "Arnet SMARTPORT Card"
ISAAE02 "Arnet MODULAR SMARTPORT Card"
ISAAE03 "Arnet SMARTPORT 16 Card"
ISAAF00 "Computone INTELLIPORT Multiport Serial Card"
ISAAF01 "Computone IntelliPort ATCC Cluster Controller"
ISAB000 "Anvil Designs Stallion Intelligent I/O Controller"
ISAB100 "Emerald 3XTwin 5250 Twinax"
ISAB101 "Emerald 3XPlus 5250 Remote"
ISAB200 "EVEREX Evercom 24 2400 baud modem"
ISAB300 "Practical Modem 2400"
ISAB401 "STB Systems EGA Plus"
ISAB402 "STB Chauffeur HT"
ISAB403 "STB VGA Extra"
ISAB404 "STB EGA MultiRes"
ISAB500 "Banyan Intelligent Communications Adapter"
ISAB600 "Computer Peripherals Monographic Video"
ISAB601 "Computer Peripherals VisionMaster VGA"
ISAB602 "Graphmaster Plus EGA Video Adapter"
ISAB700 "Iomega Bernoulli PC3B/50 Board"
ISAB701 "Iomega Bernoulli PC2/50, PC2B/50 Boards"
ISAB702 "Iomega Bernoulli II Combo Adapter Board"
ISAB800 "Archive SC499R Tape Controller"
ISAB801 "Archive VP402 Tape Adapter"
ISAB900 "DigiBoard DigiCHANNEL PC/Xe"
ISAB901 "DigiBoard DigiCHANNEL PC/8i"
ISAB903 "Digiboard Digichannel PC/8e"
ISAB904 "DigiBoard Com/8s"
ISAB905 "DigiBoard DigiCHANNEL PC/8"
ISABA00 "Alloy IMP2 Multiuser Port Controller"
ISABA01 "Alloy IMP8 Multiuser Port Controller"
ISABA02 "Alloy PC-HIA XBUS Controller"
ISABA03 "Alloy FTFA Tape & Floppy Controller"
ISABB00 "BIT3 403/404/405 Bus Communications Adaptors"
ISABC00 "Boca Research BOCARAM/AT Plus"
ISABC01 "Boca Research I/O Master AT"
ISABD00 "Racal-Interlan NP600A Ethernet 16bit"
ISABD02 "Racal-Interlan NI5210/8 Ethernet"
ISABD03 "Racal-Interlan NI5210/16 Ethernet"
ISABE00 "Qua Tech PXB-1608 Parallel Expansion Board"
ISABE01 "Qua Tech ES-100 8 Channel Asyncronous"
ISABE02 "Qua Tech QS-100M 4 Channel Asyncronous"
ISABE03 "Qua Tech MXI-100 IEEE 488 GPIB"
ISABE04 "Qua Tech DS-201 Dual Channel RS-422"
ISABE05 "Qua Tech PXB-721 Parallel Expansion"
ISABE06 "Qua Tech DSDP-402 Dual Serial/Dual Parallel"
ISABE07 "Qua Tech WSB-10 Waveform Synthesizer"
ISABE08 "Qua Tech SmartLynx Multiport Adapter"
ISABF00 "EOgraph Plus"
ISAC000 "Corollary 8x4 Mux (Jumpers)"
ISAC001 "Corollary 8x4 Mux (Rotary Switches)"
ISAC002 "Corollary 8x4"
ISAC100 "Bell Technologies' ACE Multiport Serial Card"
ISAC200 "Micro-Integration PC-STWINAX"
ISAC201 "Micro-Integration PC-MICOAX"
ISAC300 "BlueLynx 5251-12"
ISAC301 "BlueLynx 5250"
ISAC302 "BlueLynx 3270 Remote"
ISAC303 "BlueLynx Enhanced 5251-11"
ISAC304 "BlueLynx 3270 Enhanced Coax"
ISAC400 "Core CNT-ATP ESDI Internal FD Ctrl"
ISAC500 "CEC PC 488 IEEE Printer Controller"
ISAC600 "Vector International SCC Async/BSC/SDLC"
ISAC700 "LSE Electronics YC808 Color Graphics Printer Adapter"
ISAC701 "LSE Electronics Platinum VGA16 Card"
ISAC800 "Street Electronics ECHO PC+ Speech Synthesizer"
ISAC900 "SIIG ARCLAN-100 Arcnet Network Board."
ISACA00 "National Instruments GPIB-PCIIA"
ISACA01 "National Instruments AT-GPIB"
ISACA02 "National Instruments GPIB-PC"
ISACB00 "Konan TNT-1050 Caching Disk Controller"
ISACC00 "Packard Bell PB 3270 Coax"
ISACD00 "Digital Storage Systems ARC6000"
ISACE00 "Ideaphone Input Device"
ISACF00 "Atronics Professional Image Board Plus"
ISAD000 "Bi-Tech SCSI 2110 HD/TAPE Controller"
ISAD001 "Bi-Tech SCSI 2200 Controller"
ISAD100 "Equinox Megaport Board"
ISAD200 "Comtrol SMART HOSTESS Multiport Serial Card"
ISAD300 "Emulex MPC-II Comm Controller"
ISAD301 "Altos Wide Area Network Board /2"
ISAD400 "Western Digital WD1004A-WX1 Controller"
ISAD401 "Western Digital WD1006V-MM2 Winchester/Floppy Controller"
ISAD402 "Western Digital WD1006V-SR2 Winchester/Floppy Controller"
ISAD403 "Western Digital WD1007A-WAH Winchester Controller"
ISAD404 "Western Digital WD1007V-SE1 Winchester Controller"
ISAD500 "GammaLink GammaFax NA"
ISAD501 "GammaLink GammaFax CP"
ISAD600 "The Complete FAX/9600"
ISAD601 "The Complete Page Scanner"
ISAD602 "Scanman Plus"
ISAD700 "Hughes 4140 Ethernet Board"
ISAD701 "Hughes 6130 Broadband Network Card"
ISAD702 "Hughes(Sytek) 6140 Token Ring Net. Board"
ISAD800 "AMI SMART PACK 2 W/ PAL 5.1"
ISAD801 "AMI SMART PACK 2 W/ PAL 6.1"
ISAD802 "AMI SMART PACK 2 W/ PAL 6.2"
ISAD900 "NEC Multisync Graphics Board GB-1"
ISADA00 "Torus Systems Ethernet Adapter"
ISADA01 "Torus Systems Ethernet Adapter/SB"
ISADB00 "Rabbit Software RB14 X.25 Adapter"
ISADB01 "Rabbit Software RB24 Multi-Protocol Comm"
ISADC00 "Nth Graphics Nth Engine"
ISADD00 "Chase AT4/AT8/AT16"
ISADE00 "QMS JetScript"
ISADF00 "Altos ACPA/AT"
ISADF01 "SoundBlaster by Creative Labs, Inc."
ISADF02 "Emerald Systems SCSI Tape Adapter"
ISADF03 "Weitek Array Processor, Brd #3002-0046-01"
ISAE000 "Headlands VGA 1024i Video Adapter"
ISAE100 "Scanman Plus"
ISAE300 "Overland Data 9-Track Tape TX-8 Controller"
ISAE401 "Microfield V8 Color Graphics Controller"
ISAE402 "Microfield T8 Color Graphics Controller"
ISY0010 "(SYSTEM) VGA Board"
ISY0020 "(SYSTEM) COM Ports"
ISY0030 "(SYSTEM) Mother Board PS-2 style Mouse"
ISY0040 "(SYSTEM) Hard Disk Controller"
ISY0050 "(SYSTEM) Floppy Drive Controller"
ISY0060 "(SYSTEM) LPT Ports"
ISY0070 "(SYSTEM) IRQ9 Cascaded Interrupt"
ITC0001 "EISA-486C Main Board"
ITK0011 "ITK ixEins Basic S0/Up0 ISDN-Adapter Version 1.1"
ITK0012 "ITK ixEins Basic S0/Up0 ISDN-Adapter Version 1.2"
KCI3201 "ET32EM EISA 32-bit BUS-MASTER Ethernet Adapter"
KCI3202 "ET-32EM 32-bit EISA Bus Master Ethernet Adapter"
LEF8000 "LeafNet LAN Adapter"
MCC0000 "MCC EISA-486 Board"
MCC0001 "MCCI-486 EISA System Board"
MCY2501 "Microdyne NE2500/NE5500 Series Ethernet Lan Adapter"
MDG0002 "Madge Smart 16/4 EISA Ringnode"
MDG0010 "Madge Smart 16/4 AT Ringnode"
MDG0020 "Madge Smart 16/4 ISA Client Ringnode"
MDG2000 "Madge Blue+ 16/4 ISA Token Ring Adapter"
MDG2010 "Madge Blue+ 16/4 ISA PnP Token Ring Adapter"
MET1104 "Metheus UGA 1104 Graphics Controller"
MET1128 "Metheus UGA 1124/1128 Graphics Ctlr."
MIC0001 "MICRONICS EISA 486 66/50/33/25 System Board"
MIC0004 "MICRONICS 486 PCI-EISA System Board"
MIC0005 "MICRONICS M5PE EISA-PCI Pentium System Board"
MIC0021 "FD-0475 EISA Bus Ethernet LAN Adapter"
MIC0054 "Micronics M54Pe Dual Pentium PCI-EISA System Board"
MIC3001 "Micronics EISA3 System Board"
MIC5402 "Micronics M54E2 Dual Pentium PCI-EISA System Board"
MINIADP "Adaptec 32-bit SCSI Host Adapter (with floppy)"
MIR0928 "miroCRYSTAL / miroMAGIC / miroRAINBOW (14-Sep-93) "
MLX0010 "Mylex LNE390A EISA 32-bit Ethernet LAN Adapter"
MLX0011 "Mylex LNE390B EISA 32-bit Ethernet LAN Adapter"
MLX0020 "Mylex DCE376 EISA 32-Bit SCSI Host Adapter"
MLX0021 "Mylex DCE376 EISA 32-Bit SCSI Host Adapter"
MLX0022 "Mylex DCE376 EISA 32-Bit SCSI Host Adapter"
MLX0030 "Mylex LNI390A ISA 16-Bit Ethernet LAN Adapter"
MLX0040 "Mylex GXE020B or GXE020C EISA 32-Bit Graphics Controller"
MLX0050 "Mylex GLE(911) EISA Graphics Adapter"
MLX0070 "Mylex DAC960 EISA Disk Array Controller"
MLX0071 "Mylex DAC960 EISA Disk Array Controller (3-channel)"
MLX0072 "Mylex DAC960 EISA Disk Array Controller (3-channel)"
MLX0073 "Mylex DAC960 EISA Disk Array Controller (2-channel)"
MLX0074 "Mylex DAC960 EISA Disk Array Controller (1-channel)"
MLX0075 "Mylex DAC960-A EISA Disk Array Controller (3-channel)"
MLX0076 "Mylex DAC960-A EISA Disk Array Controller (2-channel)"
MLX0077 "Mylex DAC960-A EISA Disk Array Controller (1-channel)"
MLX0101 "Mylex LME596 EISA 32-bit 4 Channel Ethernet LAN Adapter"
MLXFD01 "Mylex Corporation MDE486 EISA 32-Bit 486 System Board"
MLXFE01 "Mylex MBE486 EISA 32-Bit 486 System Board"
MLXFF01 "Mylex MAE486 EISA 32-Bit 486 System Board"
MLXFF02 "Mylex Corporation MDE486 or MNE486 EISA 32-Bit 486 System Board"
MTX2040 "MATROX IM-1280/EISA"
NEC8201 "DPT SCSI Host Bus Adapter w/ Cache (PM2012B/90)"
NIC0202 "AT-MIO-16 Multi-function Board"
NIC0301 "AT-DIO-32F Digital I/O Board"
NIC0400 "PC-DIO-24 Digital I/O Board"
NIC0501 "LAB-PC/LAB-PC+ Multi-function Board"
NIC0602 "AT-MIO-16F-5 Multi-function Board"
NIC0700 "PC-DIO-96 Digital I/O Board"
NIC0800 "PC-LPM-16 Low Power Multi-function Board"
NIC0900 "PC-TIO-10 Timing I/O Board"
NIC1000 "AT-A2150 16-bit 4 Channel A/D Board"
NIC1100 "AT-DSP2200 DSP Accelerator/Audio I/O Board"
NIC1200 "AT-AO-6/10 ANALOG OUTPUT BOARD"
NIC1300 "AT-MIO-16X Multi-function Board"
NIC1400 "AT-MIO-64F-5 Multi-function Board"
NIC1500 "AT-MIO-16D Multi-function Board"
NICC005 "National Instruments AT-GPIB Interface Board"
NICC105 "National Instruments GPIB-PCIIA Interface Board"
NICC205 "National Instruments GPIB-PCII Interface Board"
NICC304 "National Instruments AT-GPIB/TNT"
NICC502 "National Instruments EISA-GPIB"
NON0101 "c't Universal 16-Bit Multi I/O Adapter"
NON0102 "c't Universal 16-Bit Multi I/O Adapter"
NON0201 "c't Universal 8-Bit Multi I/O Adapter"
NON0301 "c't Universale Graphic Adapter"
NON0401 "c't Universal Ethernet Adapter"
NON0501 "c't Universal 16-Bit Sound Adapter"
NON0601 "c't Universal 8-Bit Adapter"
NPI0120 "Network Peripherals NP-EISA-1 FDDI Interface"
NPI0221 "Network Peripherals NP-EISA-2 FDDI Interface"
NPI0223 "Network Peripherals NP-EISA-2E Enhanced FDDI Interface"
NPI0301 "Network Peripherals NP-EISA-3 FDDI Interface"
NPI0303 "Network Peripherals NP-EISA-3E Enhanced FDDI Interface"
NSS0011 "Newport Systems Solutions WNIC Adapter"
NVL0701 "Novell NE3200 Bus Master Ethernet"
NVL0702 "Novell NE3200T Bus Master Ethernet"
NVL0901 "Novell NE2100 Ethernet/Cheapernet Adapter"
NVL1001 "Novell NMSL (Netware Mirrored Server Link)"
NVL1201 "Novell NE32HUB 32-bit Base EISA Adapter"
NVL1301 "Novell NE32HUB 32-bit TPE EISA Adapter"
NVL1401 "Novell NE32HUB PME ISA Adapter"
NVL1501 "Novell NE2000PLUS Ethernet Adapter"
NVL1801 "Eagle Technology NE3210 EISA Ethernet LAN Adapter"
OLC0701 "Olicom ISA 16/4 Token-Ring Network Adapter"
OLC0702 "Olicom OC-3117, ISA 16/4 Adapter (NIC)"
OLC0801 "OC-3118 Olicom ISA 16/4 Token-Ring Network Adapter"
OLC0901 "Olicom EISA 16/4 Token-Ring Network Adapter"
OLC0902 "Olicom EISA 16/4 Token-Ring Network Adapter"
OLC0B01 "Olicom PCA 16/4 Token-Ring Network Adapter"
OLC1201 "Olicom 32 Bit EISA 16/4 Token-Ring Network Adapter"
OPT0000 "OPTi HUNTER EISA 32-Bit 486 System Board"
OPT0200 "OPTi LOW_COST EISA 32-Bit 486 System Board"
OTI0011 "Pro II/EISA"
PCI0080 "PIONEER 486WB 8 SLOT EISA SYSTEM BOARD"
PCI0120 "PIONEER 486WB 12 SLOT EISA SYSTEM BOARD"
PCI2080 "PIONEER 486WB 8 SLOT EISA SYSTEM BOARD"
PHI8041 "Standard VGA controller"
PLX1001 "OCEAN EISALink EISA 32-Bit BUS-MASTER Ethernet Controller"
PRO6000 "Proteon ProNET 4/16 Token Ring Adapter"
PRO6001 "Proteon ProNET 4/16 Token Ring Adapter"
PRO6002 "Proteon ProNET 4/16 Token Ring Adapter"
PTI5401 "Poseidon P6 QUAD PCI-EISA Board"
RII0101 "Racal InterLan ES3210 Ethernet Controller"
SEC0010 "SAMSUNG ISA Multifunction Card"
SEC0020 "SAMSUNG VGA Card (GTI VC-004)"
SEC0021 "WD 90C31 Local Bus VGA"
SECFF01 "SAMSUNG MAE486 System Board"
SECFF02 "OPTi/EISA 32-Bit 486 System Board"
SGT0101 "AT&T GIS 8/16 Port Serial Controller"
SIS0000 "4DESD EISA-486 System Board"
SIS0001 "EISA-486 Demo Board"
SKD0100 "SK-NET FDDI-FE EISA 32-Bit FDDI LAN Adapter"
SMC0110 "Standard Microsystems Corp. Elite32 Ethernet"
SMC03E0 "SMC EtherCard PLUS Family LAN Adapters"
SMC13E0 "SMC EtherCard PLUS Elite16 Family LAN Adapters"
SMC8003 "SMC EtherCard PLUS Elite Family LAN Adapters"
SMC8010 "SMC Ethercard Elite32C Ultra"
SMC8013 "SMC EtherCard PLUS Elite16 Family LAN Adapters"
SMC8216 "SMC EtherCard Elite16 ULTRA Family LAN Adapters"
SMCA010 "SMC Ether 10/100"
SNIAAA0 "Siemens Nixdorf Ether-Board EISA T"
SNIAAB0 "Siemens Nixdorf Ether-Board EISA 2"
SNIABF0 "Siemens Nixdorf ETHER-BOARD-AT105T Ethernet/Cheapernet Adapter"
SNIACA0 "Siemens Nixdorf ETHER-BOARD-AT10T Ethernet/Twisted Pair Adapter"
STL0100 "Stallion Technologies - ONboard/E"
STL0120 "Stallion Technologies - ONboard ISA"
STL0130 "Stallion Technologies - Brumby ISA"
STL0200 "Stallion Technologies - EasyIO"
STL0400 "Stallion Technologies - EC 8/64-EI"
STL0410 "Stallion Technologies - EC 8/32-AT"
STL0420 "Stallion Technologies - EC 8/64-AT"
SUK1022 "SK-NET Token Ring LAN Interface Board"
SUK1059 "SK-NET G16 LAN Interface Board"
SUK1072 "SK-FDDI FI LAN Interface Board"
TCC010C "Thomas-Conrad TC6045 ARC-Card/AT"
TCC030D "Thomas-Conrad TC6042 ARC-Card/CE"
TCC040B "Thomas-Conrad TC6142 ARC-Card/CE"
TCC3047 "Thomas-Conrad TC3047 TCNS Adapter/EISA"
TCM3190 "3Com 3C319 TokenLink Velocity ISA NIC"
TCM5030 "3COM EtherLink II Family"
TCM5070 "3COM 3C507 Etherlink 16 or TP v2.0"
TCM5090 "3Com 3C509-TP Network Adapter"
TCM5091 "3Com 3C509 Network Adapter"
TCM5092 "3Com 3C579-TP EISA Network Adapter"
TCM5093 "3Com 3C579 EISA Network Adapter"
TCM5094 "3Com 3C509-Combo Network Adapter"
TCM5095 "3Com 3C509-TPO Network Adapter"
TCM5098 "3Com 3C509-TPC Network Adapter"
TCM5920 "3Com EtherLink III Bus Master EISA (3C592) Network Adapter"
TCM5970 "3Com Fast EtherLink EISA (3C597-TX) Network Adapter"
TCM5971 "3C597 Fast Etherlink T4"
TCM5972 "3C597 Fast Etherlink MII"
TCM7700 "3Com 3C770 FDDI Adapter"
TCO010C "Thomas-Conrad TC6045 ARC-Card/AT"
TCO030D "Thomas-Conrad TC6042 ARC-Card/CE"
TCO040B "Thomas-Conrad TC6142 ARC-Card/CE"
TCO050D "Thomas-Conrad TC4035 TOKEN RING Adapter/AT (Rev D)"
TCO3147 "TC3047 Thomas Conrad Network System (TCNS) EISA Adapter"
TCO345A "TC3045 Thomas-Conrad Network System (TCNS) AT Adapter"
TCO345B "TC3045 Thomas-Conrad Network System (TCNS) AT Adapter"
TEC8000 "Tecmar QIC60 HOST ADAPTER"
TEC8001 "Tecmar QIC PC36 TAPE CONTROLLER"
TEC8002 "Tecmar QT HOST ADAPTER"
TEC8003 "Tecmar QT PC36 TAPE CONTROLLER"
TRM0001 "EISA-486C SYSTEM BOARD"
TRM0320 "DC-320 EISA SCSI Host Adapter"
TRM0620 "DC-620 EISA IDE Cache Controller"
TRM0820 "DC-820 EISA SCSI Cache Host Adapter"
TRM320E "DC-320E EISA SCSI Host Adapter"
TRM820B "DC-820B EISA SCSI Cache Host Adapter"
TRU0210 "Truevision Image Capture Board"
TRU0520 "Truevision ATVista (R) VideoGraphics Adapter"
TRU1100 "Truevision DVR"
TXN0011 "TACT84500 MODULAR EISA SYSTEM BOARD"
TYN0000 "Tyan 486 PRO-EISA Board"
TYN0001 "TYN VL EISA-486 Board"
TYN0003 "Tyn S1452/S1462 PCI-EISA Main Board"
UBIA100 "Ungermann-Bass Personal NIU"
UBIA200 "Ungermann-Bass Personal NIU/ex"
UBIB100 "Ungermann-Bass NIUpc"
UBIB200 "Ungermann-Bass 3270 NIUpc"
UBIC100 "Ungermann-Bass NIC"
UBID100 "Ungermann-Bass NIUpc/Token Ring"
USC0120 "UltraStor - ULTRA-12F ISA ESDI Hard Disk Controller"
USC0125 "UltraStor - ULTRA-12C ESDI Hard Disk Controller"
USC0140 "UltraStor - ULTRA-14F ISA SCSI Host Adapter"
USC0220 "UltraStor - U22C"
USC0225 "UltraStor - ULTRA-22F ESDI Hard Disk Controller"
USC0240 "UltraStor - ULTRA-24F SCSI Host Adapter"
USC0340 "UltraStor - ULTRA-34F VESA VL-BUS Host Adapter"
USR0011 "USROBOTICS 33.6 TELEPHONY MODEM"
USR3401 "U S Robotics V.34-Ready Fax Modem"
VMI0201 "Vermont Image Manager 1024"
VMI0211 "Vermont Cobra"
VMI0601 "Vermont Image Manager 640"
VMI0E01 "Vermont Cobra Plus"
WDC0101 "Western Digital WD1009V-MM1 Winchester Controller"
WDC0102 "Western Digital WD1009V-SE1 Winchester Controller"
WDC0300 "Western Digital StarCard PLUS 8003S"
WDC0301 "Western Digital StarLink PLUS 8003SH"
WDC03E0 "Western Digital EtherCard PLUS 8003E"
WDC03E1 "Western Digital EtherCard PLUS w/Boot 8003EBT"
WDC03E2 "Western Digital EtherCard + 8003EB 61-600245-02"
WDC03E3 "Western Digital EtherCard PLUS TP 8003WT"
WDC03E4 "Western Digital EtherCard + 8003EB 61-600090-00"
WDC0510 "Western Digital TokenCard 8005TR/8005TRWS"
WDC1009 "Western Digital WD1009V-MM1/MM2 Winchester Controller"
WDC13E0 "Western Digital EtherCard PLUS 16 8013EBT"
XTI02B1 "XNET 1800 PARALLEL SWITCH"
| {
"pile_set_name": "Github"
} |
/*
Copyright 2014 The Kubernetes 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.
*/
package clientcmd
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"os"
"golang.org/x/crypto/ssh/terminal"
clientauth "k8s.io/client-go/tools/auth"
)
// AuthLoaders are used to build clientauth.Info objects.
type AuthLoader interface {
// LoadAuth takes a path to a config file and can then do anything it needs in order to return a valid clientauth.Info
LoadAuth(path string) (*clientauth.Info, error)
}
// default implementation of an AuthLoader
type defaultAuthLoader struct{}
// LoadAuth for defaultAuthLoader simply delegates to clientauth.LoadFromFile
func (*defaultAuthLoader) LoadAuth(path string) (*clientauth.Info, error) {
return clientauth.LoadFromFile(path)
}
type PromptingAuthLoader struct {
reader io.Reader
}
// LoadAuth parses an AuthInfo object from a file path. It prompts user and creates file if it doesn't exist.
func (a *PromptingAuthLoader) LoadAuth(path string) (*clientauth.Info, error) {
// Prompt for user/pass and write a file if none exists.
if _, err := os.Stat(path); os.IsNotExist(err) {
authPtr, err := a.Prompt()
auth := *authPtr
if err != nil {
return nil, err
}
data, err := json.Marshal(auth)
if err != nil {
return &auth, err
}
err = ioutil.WriteFile(path, data, 0600)
return &auth, err
}
authPtr, err := clientauth.LoadFromFile(path)
if err != nil {
return nil, err
}
return authPtr, nil
}
// Prompt pulls the user and password from a reader
func (a *PromptingAuthLoader) Prompt() (*clientauth.Info, error) {
var err error
auth := &clientauth.Info{}
auth.User, err = promptForString("Username", a.reader, true)
if err != nil {
return nil, err
}
auth.Password, err = promptForString("Password", nil, false)
if err != nil {
return nil, err
}
return auth, nil
}
func promptForString(field string, r io.Reader, show bool) (result string, err error) {
fmt.Printf("Please enter %s: ", field)
if show {
_, err = fmt.Fscan(r, &result)
} else {
var data []byte
if terminal.IsTerminal(int(os.Stdin.Fd())) {
data, err = terminal.ReadPassword(int(os.Stdin.Fd()))
result = string(data)
} else {
return "", fmt.Errorf("error reading input for %s", field)
}
}
return result, err
}
// NewPromptingAuthLoader is an AuthLoader that parses an AuthInfo object from a file path. It prompts user and creates file if it doesn't exist.
func NewPromptingAuthLoader(reader io.Reader) *PromptingAuthLoader {
return &PromptingAuthLoader{reader}
}
// NewDefaultAuthLoader returns a default implementation of an AuthLoader that only reads from a config file
func NewDefaultAuthLoader() AuthLoader {
return &defaultAuthLoader{}
}
| {
"pile_set_name": "Github"
} |
module ExternalLogoutHelper
def external_logout_props
{
version: SETTINGS[:version].version,
caption: Setting[:login_text],
logoSrc: image_path("login_logo.png"),
submitLink: extlogin_users_path,
backgroundUrl: nil,
}
end
def mount_external_logout
react_component('ExternalLogout', external_logout_props)
end
end
| {
"pile_set_name": "Github"
} |
module SimplyStored
module Couch
module Validations
def validates_uniqueness_of(*attr_names)
attr_names.each do |name|
if not respond_to?("by_#{name}")
view "by_#{name}", :key => name
end
end
validates_with ValidatesUniquenessOf, _merge_attributes(attr_names)
end
def validates_inclusion_of(*attr_names)
validates_with ValidatesInclusionOf, _merge_attributes(attr_names)
end
class ValidatesUniquenessOf < ::ActiveModel::EachValidator
def validate_each(record, attribute, value)
other_record = record.class.send("find_by_#{attribute}", record.send(attribute))
if other_record && other_record != record &&
other_record.send(attribute) == record.send(attribute)
record.errors.add(attribute, :taken)
else
true
end
end
end
class ValidatesInclusionOf < ::ActiveModel::Validations::InclusionValidator
def validate_each(record, attribute, value)
delimiter = options[:in]
exclusions = delimiter.respond_to?(:call) ? delimiter.call(record) : delimiter
if value.is_a?(Array)
values = value
else
values = [value]
end
values.each do |value|
unless exclusions.send(inclusion_method(exclusions), value)
record.errors.add(attribute, :inclusion, options.except(:in).merge!(:value => value))
end
end
end
end
end
end
end
| {
"pile_set_name": "Github"
} |
html, body {
height: 100%;
}
#hawkeye-container {
margin-left: auto;
margin-right: auto;
padding: 0;
width: 100%;
height: 96%;
padding-top: 2%;
padding-bottom: 2%;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-o-box-sizing: border-box;
-ms-box-sizing: border-box;
}
#hawkeye-carousel {
margin-left: auto;
margin-right: auto;
height: 100%;
}
#hawkeye-carousel .carousel-inner,
#hawkeye-carousel .carousel-inner .item {
height: 100%;
}
#hawkeye-carousel .alert {
height: 100%;
text-align: center;
padding-top: 4em;
min-height: 320px;
}
.mjpeg {
margin-left: auto;
margin-right: auto;
display: block;
max-height: 100%;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
-o-border-radius: 10px;
-ms-border-radius: 10px;
}
#hawkeye-carousel .carousel-control {
background: none;
}
| {
"pile_set_name": "Github"
} |
Source: zstd
Version: 1.4.4
Port-Version: 2
Description: Zstandard - Fast real-time compression algorithm
Homepage: https://facebook.github.io/zstd/
| {
"pile_set_name": "Github"
} |
"""Simple implementation of the Level 1 DOM.
Namespaces and other minor Level 2 features are also supported.
parse("foo.xml")
parseString("<foo><bar/></foo>")
Todo:
=====
* convenience methods for getting elements and text.
* more testing
* bring some of the writer and linearizer code into conformance with this
interface
* SAX 2 namespaces
"""
import xml.dom
from xml.dom import EMPTY_NAMESPACE, EMPTY_PREFIX, XMLNS_NAMESPACE, domreg
from xml.dom.minicompat import *
from xml.dom.xmlbuilder import DOMImplementationLS, DocumentLS
# This is used by the ID-cache invalidation checks; the list isn't
# actually complete, since the nodes being checked will never be the
# DOCUMENT_NODE or DOCUMENT_FRAGMENT_NODE. (The node being checked is
# the node being added or removed, not the node being modified.)
#
_nodeTypes_with_children = (xml.dom.Node.ELEMENT_NODE,
xml.dom.Node.ENTITY_REFERENCE_NODE)
class Node(xml.dom.Node):
namespaceURI = None # this is non-null only for elements and attributes
parentNode = None
ownerDocument = None
nextSibling = None
previousSibling = None
prefix = EMPTY_PREFIX # non-null only for NS elements and attributes
def __nonzero__(self):
return True
def toxml(self, encoding = None):
return self.toprettyxml("", "", encoding)
def toprettyxml(self, indent="\t", newl="\n", encoding = None):
# indent = the indentation string to prepend, per level
# newl = the newline string to append
writer = _get_StringIO()
if encoding is not None:
import codecs
# Can't use codecs.getwriter to preserve 2.0 compatibility
writer = codecs.lookup(encoding)[3](writer)
if self.nodeType == Node.DOCUMENT_NODE:
# Can pass encoding only to document, to put it into XML header
self.writexml(writer, "", indent, newl, encoding)
else:
self.writexml(writer, "", indent, newl)
return writer.getvalue()
def hasChildNodes(self):
if self.childNodes:
return True
else:
return False
def _get_childNodes(self):
return self.childNodes
def _get_firstChild(self):
if self.childNodes:
return self.childNodes[0]
def _get_lastChild(self):
if self.childNodes:
return self.childNodes[-1]
def insertBefore(self, newChild, refChild):
if newChild.nodeType == self.DOCUMENT_FRAGMENT_NODE:
for c in tuple(newChild.childNodes):
self.insertBefore(c, refChild)
### The DOM does not clearly specify what to return in this case
return newChild
if newChild.nodeType not in self._child_node_types:
raise xml.dom.HierarchyRequestErr(
"%s cannot be child of %s" % (repr(newChild), repr(self)))
if newChild.parentNode is not None:
newChild.parentNode.removeChild(newChild)
if refChild is None:
self.appendChild(newChild)
else:
try:
index = self.childNodes.index(refChild)
except ValueError:
raise xml.dom.NotFoundErr()
if newChild.nodeType in _nodeTypes_with_children:
_clear_id_cache(self)
self.childNodes.insert(index, newChild)
newChild.nextSibling = refChild
refChild.previousSibling = newChild
if index:
node = self.childNodes[index-1]
node.nextSibling = newChild
newChild.previousSibling = node
else:
newChild.previousSibling = None
newChild.parentNode = self
return newChild
def appendChild(self, node):
if node.nodeType == self.DOCUMENT_FRAGMENT_NODE:
for c in tuple(node.childNodes):
self.appendChild(c)
### The DOM does not clearly specify what to return in this case
return node
if node.nodeType not in self._child_node_types:
raise xml.dom.HierarchyRequestErr(
"%s cannot be child of %s" % (repr(node), repr(self)))
elif node.nodeType in _nodeTypes_with_children:
_clear_id_cache(self)
if node.parentNode is not None:
node.parentNode.removeChild(node)
_append_child(self, node)
node.nextSibling = None
return node
def replaceChild(self, newChild, oldChild):
if newChild.nodeType == self.DOCUMENT_FRAGMENT_NODE:
refChild = oldChild.nextSibling
self.removeChild(oldChild)
return self.insertBefore(newChild, refChild)
if newChild.nodeType not in self._child_node_types:
raise xml.dom.HierarchyRequestErr(
"%s cannot be child of %s" % (repr(newChild), repr(self)))
if newChild is oldChild:
return
if newChild.parentNode is not None:
newChild.parentNode.removeChild(newChild)
try:
index = self.childNodes.index(oldChild)
except ValueError:
raise xml.dom.NotFoundErr()
self.childNodes[index] = newChild
newChild.parentNode = self
oldChild.parentNode = None
if (newChild.nodeType in _nodeTypes_with_children
or oldChild.nodeType in _nodeTypes_with_children):
_clear_id_cache(self)
newChild.nextSibling = oldChild.nextSibling
newChild.previousSibling = oldChild.previousSibling
oldChild.nextSibling = None
oldChild.previousSibling = None
if newChild.previousSibling:
newChild.previousSibling.nextSibling = newChild
if newChild.nextSibling:
newChild.nextSibling.previousSibling = newChild
return oldChild
def removeChild(self, oldChild):
try:
self.childNodes.remove(oldChild)
except ValueError:
raise xml.dom.NotFoundErr()
if oldChild.nextSibling is not None:
oldChild.nextSibling.previousSibling = oldChild.previousSibling
if oldChild.previousSibling is not None:
oldChild.previousSibling.nextSibling = oldChild.nextSibling
oldChild.nextSibling = oldChild.previousSibling = None
if oldChild.nodeType in _nodeTypes_with_children:
_clear_id_cache(self)
oldChild.parentNode = None
return oldChild
def normalize(self):
L = []
for child in self.childNodes:
if child.nodeType == Node.TEXT_NODE:
if not child.data:
# empty text node; discard
if L:
L[-1].nextSibling = child.nextSibling
if child.nextSibling:
child.nextSibling.previousSibling = child.previousSibling
child.unlink()
elif L and L[-1].nodeType == child.nodeType:
# collapse text node
node = L[-1]
node.data = node.data + child.data
node.nextSibling = child.nextSibling
if child.nextSibling:
child.nextSibling.previousSibling = node
child.unlink()
else:
L.append(child)
else:
L.append(child)
if child.nodeType == Node.ELEMENT_NODE:
child.normalize()
self.childNodes[:] = L
def cloneNode(self, deep):
return _clone_node(self, deep, self.ownerDocument or self)
def isSupported(self, feature, version):
return self.ownerDocument.implementation.hasFeature(feature, version)
def _get_localName(self):
# Overridden in Element and Attr where localName can be Non-Null
return None
# Node interfaces from Level 3 (WD 9 April 2002)
def isSameNode(self, other):
return self is other
def getInterface(self, feature):
if self.isSupported(feature, None):
return self
else:
return None
# The "user data" functions use a dictionary that is only present
# if some user data has been set, so be careful not to assume it
# exists.
def getUserData(self, key):
try:
return self._user_data[key][0]
except (AttributeError, KeyError):
return None
def setUserData(self, key, data, handler):
old = None
try:
d = self._user_data
except AttributeError:
d = {}
self._user_data = d
if key in d:
old = d[key][0]
if data is None:
# ignore handlers passed for None
handler = None
if old is not None:
del d[key]
else:
d[key] = (data, handler)
return old
def _call_user_data_handler(self, operation, src, dst):
if hasattr(self, "_user_data"):
for key, (data, handler) in self._user_data.items():
if handler is not None:
handler.handle(operation, key, data, src, dst)
# minidom-specific API:
def unlink(self):
self.parentNode = self.ownerDocument = None
if self.childNodes:
for child in self.childNodes:
child.unlink()
self.childNodes = NodeList()
self.previousSibling = None
self.nextSibling = None
defproperty(Node, "firstChild", doc="First child node, or None.")
defproperty(Node, "lastChild", doc="Last child node, or None.")
defproperty(Node, "localName", doc="Namespace-local name of this node.")
def _append_child(self, node):
# fast path with less checks; usable by DOM builders if careful
childNodes = self.childNodes
if childNodes:
last = childNodes[-1]
node.__dict__["previousSibling"] = last
last.__dict__["nextSibling"] = node
childNodes.append(node)
node.__dict__["parentNode"] = self
def _in_document(node):
# return True iff node is part of a document tree
while node is not None:
if node.nodeType == Node.DOCUMENT_NODE:
return True
node = node.parentNode
return False
def _write_data(writer, data):
"Writes datachars to writer."
if data:
data = data.replace("&", "&").replace("<", "<"). \
replace("\"", """).replace(">", ">")
writer.write(data)
def _get_elements_by_tagName_helper(parent, name, rc):
for node in parent.childNodes:
if node.nodeType == Node.ELEMENT_NODE and \
(name == "*" or node.tagName == name):
rc.append(node)
_get_elements_by_tagName_helper(node, name, rc)
return rc
def _get_elements_by_tagName_ns_helper(parent, nsURI, localName, rc):
for node in parent.childNodes:
if node.nodeType == Node.ELEMENT_NODE:
if ((localName == "*" or node.localName == localName) and
(nsURI == "*" or node.namespaceURI == nsURI)):
rc.append(node)
_get_elements_by_tagName_ns_helper(node, nsURI, localName, rc)
return rc
class DocumentFragment(Node):
nodeType = Node.DOCUMENT_FRAGMENT_NODE
nodeName = "#document-fragment"
nodeValue = None
attributes = None
parentNode = None
_child_node_types = (Node.ELEMENT_NODE,
Node.TEXT_NODE,
Node.CDATA_SECTION_NODE,
Node.ENTITY_REFERENCE_NODE,
Node.PROCESSING_INSTRUCTION_NODE,
Node.COMMENT_NODE,
Node.NOTATION_NODE)
def __init__(self):
self.childNodes = NodeList()
class Attr(Node):
nodeType = Node.ATTRIBUTE_NODE
attributes = None
ownerElement = None
specified = False
_is_id = False
_child_node_types = (Node.TEXT_NODE, Node.ENTITY_REFERENCE_NODE)
def __init__(self, qName, namespaceURI=EMPTY_NAMESPACE, localName=None,
prefix=None):
# skip setattr for performance
d = self.__dict__
d["nodeName"] = d["name"] = qName
d["namespaceURI"] = namespaceURI
d["prefix"] = prefix
d['childNodes'] = NodeList()
# Add the single child node that represents the value of the attr
self.childNodes.append(Text())
# nodeValue and value are set elsewhere
def _get_localName(self):
return self.nodeName.split(":", 1)[-1]
def _get_specified(self):
return self.specified
def __setattr__(self, name, value):
d = self.__dict__
if name in ("value", "nodeValue"):
d["value"] = d["nodeValue"] = value
d2 = self.childNodes[0].__dict__
d2["data"] = d2["nodeValue"] = value
if self.ownerElement is not None:
_clear_id_cache(self.ownerElement)
elif name in ("name", "nodeName"):
d["name"] = d["nodeName"] = value
if self.ownerElement is not None:
_clear_id_cache(self.ownerElement)
else:
d[name] = value
def _set_prefix(self, prefix):
nsuri = self.namespaceURI
if prefix == "xmlns":
if nsuri and nsuri != XMLNS_NAMESPACE:
raise xml.dom.NamespaceErr(
"illegal use of 'xmlns' prefix for the wrong namespace")
d = self.__dict__
d['prefix'] = prefix
if prefix is None:
newName = self.localName
else:
newName = "%s:%s" % (prefix, self.localName)
if self.ownerElement:
_clear_id_cache(self.ownerElement)
d['nodeName'] = d['name'] = newName
def _set_value(self, value):
d = self.__dict__
d['value'] = d['nodeValue'] = value
if self.ownerElement:
_clear_id_cache(self.ownerElement)
self.childNodes[0].data = value
def unlink(self):
# This implementation does not call the base implementation
# since most of that is not needed, and the expense of the
# method call is not warranted. We duplicate the removal of
# children, but that's all we needed from the base class.
elem = self.ownerElement
if elem is not None:
del elem._attrs[self.nodeName]
del elem._attrsNS[(self.namespaceURI, self.localName)]
if self._is_id:
self._is_id = False
elem._magic_id_nodes -= 1
self.ownerDocument._magic_id_count -= 1
for child in self.childNodes:
child.unlink()
del self.childNodes[:]
def _get_isId(self):
if self._is_id:
return True
doc = self.ownerDocument
elem = self.ownerElement
if doc is None or elem is None:
return False
info = doc._get_elem_info(elem)
if info is None:
return False
if self.namespaceURI:
return info.isIdNS(self.namespaceURI, self.localName)
else:
return info.isId(self.nodeName)
def _get_schemaType(self):
doc = self.ownerDocument
elem = self.ownerElement
if doc is None or elem is None:
return _no_type
info = doc._get_elem_info(elem)
if info is None:
return _no_type
if self.namespaceURI:
return info.getAttributeTypeNS(self.namespaceURI, self.localName)
else:
return info.getAttributeType(self.nodeName)
defproperty(Attr, "isId", doc="True if this attribute is an ID.")
defproperty(Attr, "localName", doc="Namespace-local name of this attribute.")
defproperty(Attr, "schemaType", doc="Schema type for this attribute.")
class NamedNodeMap(object):
"""The attribute list is a transient interface to the underlying
dictionaries. Mutations here will change the underlying element's
dictionary.
Ordering is imposed artificially and does not reflect the order of
attributes as found in an input document.
"""
__slots__ = ('_attrs', '_attrsNS', '_ownerElement')
def __init__(self, attrs, attrsNS, ownerElement):
self._attrs = attrs
self._attrsNS = attrsNS
self._ownerElement = ownerElement
def _get_length(self):
return len(self._attrs)
def item(self, index):
try:
return self[self._attrs.keys()[index]]
except IndexError:
return None
def items(self):
L = []
for node in self._attrs.values():
L.append((node.nodeName, node.value))
return L
def itemsNS(self):
L = []
for node in self._attrs.values():
L.append(((node.namespaceURI, node.localName), node.value))
return L
def has_key(self, key):
if isinstance(key, StringTypes):
return key in self._attrs
else:
return key in self._attrsNS
def keys(self):
return self._attrs.keys()
def keysNS(self):
return self._attrsNS.keys()
def values(self):
return self._attrs.values()
def get(self, name, value=None):
return self._attrs.get(name, value)
__len__ = _get_length
__hash__ = None # Mutable type can't be correctly hashed
def __cmp__(self, other):
if self._attrs is getattr(other, "_attrs", None):
return 0
else:
return cmp(id(self), id(other))
def __getitem__(self, attname_or_tuple):
if isinstance(attname_or_tuple, tuple):
return self._attrsNS[attname_or_tuple]
else:
return self._attrs[attname_or_tuple]
# same as set
def __setitem__(self, attname, value):
if isinstance(value, StringTypes):
try:
node = self._attrs[attname]
except KeyError:
node = Attr(attname)
node.ownerDocument = self._ownerElement.ownerDocument
self.setNamedItem(node)
node.value = value
else:
if not isinstance(value, Attr):
raise TypeError, "value must be a string or Attr object"
node = value
self.setNamedItem(node)
def getNamedItem(self, name):
try:
return self._attrs[name]
except KeyError:
return None
def getNamedItemNS(self, namespaceURI, localName):
try:
return self._attrsNS[(namespaceURI, localName)]
except KeyError:
return None
def removeNamedItem(self, name):
n = self.getNamedItem(name)
if n is not None:
_clear_id_cache(self._ownerElement)
del self._attrs[n.nodeName]
del self._attrsNS[(n.namespaceURI, n.localName)]
if 'ownerElement' in n.__dict__:
n.__dict__['ownerElement'] = None
return n
else:
raise xml.dom.NotFoundErr()
def removeNamedItemNS(self, namespaceURI, localName):
n = self.getNamedItemNS(namespaceURI, localName)
if n is not None:
_clear_id_cache(self._ownerElement)
del self._attrsNS[(n.namespaceURI, n.localName)]
del self._attrs[n.nodeName]
if 'ownerElement' in n.__dict__:
n.__dict__['ownerElement'] = None
return n
else:
raise xml.dom.NotFoundErr()
def setNamedItem(self, node):
if not isinstance(node, Attr):
raise xml.dom.HierarchyRequestErr(
"%s cannot be child of %s" % (repr(node), repr(self)))
old = self._attrs.get(node.name)
if old:
old.unlink()
self._attrs[node.name] = node
self._attrsNS[(node.namespaceURI, node.localName)] = node
node.ownerElement = self._ownerElement
_clear_id_cache(node.ownerElement)
return old
def setNamedItemNS(self, node):
return self.setNamedItem(node)
def __delitem__(self, attname_or_tuple):
node = self[attname_or_tuple]
_clear_id_cache(node.ownerElement)
node.unlink()
def __getstate__(self):
return self._attrs, self._attrsNS, self._ownerElement
def __setstate__(self, state):
self._attrs, self._attrsNS, self._ownerElement = state
defproperty(NamedNodeMap, "length",
doc="Number of nodes in the NamedNodeMap.")
AttributeList = NamedNodeMap
class TypeInfo(object):
__slots__ = 'namespace', 'name'
def __init__(self, namespace, name):
self.namespace = namespace
self.name = name
def __repr__(self):
if self.namespace:
return "<TypeInfo %r (from %r)>" % (self.name, self.namespace)
else:
return "<TypeInfo %r>" % self.name
def _get_name(self):
return self.name
def _get_namespace(self):
return self.namespace
_no_type = TypeInfo(None, None)
class Element(Node):
nodeType = Node.ELEMENT_NODE
nodeValue = None
schemaType = _no_type
_magic_id_nodes = 0
_child_node_types = (Node.ELEMENT_NODE,
Node.PROCESSING_INSTRUCTION_NODE,
Node.COMMENT_NODE,
Node.TEXT_NODE,
Node.CDATA_SECTION_NODE,
Node.ENTITY_REFERENCE_NODE)
def __init__(self, tagName, namespaceURI=EMPTY_NAMESPACE, prefix=None,
localName=None):
self.tagName = self.nodeName = tagName
self.prefix = prefix
self.namespaceURI = namespaceURI
self.childNodes = NodeList()
self._attrs = {} # attributes are double-indexed:
self._attrsNS = {} # tagName -> Attribute
# URI,localName -> Attribute
# in the future: consider lazy generation
# of attribute objects this is too tricky
# for now because of headaches with
# namespaces.
def _get_localName(self):
return self.tagName.split(":", 1)[-1]
def _get_tagName(self):
return self.tagName
def unlink(self):
for attr in self._attrs.values():
attr.unlink()
self._attrs = None
self._attrsNS = None
Node.unlink(self)
def getAttribute(self, attname):
try:
return self._attrs[attname].value
except KeyError:
return ""
def getAttributeNS(self, namespaceURI, localName):
try:
return self._attrsNS[(namespaceURI, localName)].value
except KeyError:
return ""
def setAttribute(self, attname, value):
attr = self.getAttributeNode(attname)
if attr is None:
attr = Attr(attname)
# for performance
d = attr.__dict__
d["value"] = d["nodeValue"] = value
d["ownerDocument"] = self.ownerDocument
self.setAttributeNode(attr)
elif value != attr.value:
d = attr.__dict__
d["value"] = d["nodeValue"] = value
if attr.isId:
_clear_id_cache(self)
def setAttributeNS(self, namespaceURI, qualifiedName, value):
prefix, localname = _nssplit(qualifiedName)
attr = self.getAttributeNodeNS(namespaceURI, localname)
if attr is None:
# for performance
attr = Attr(qualifiedName, namespaceURI, localname, prefix)
d = attr.__dict__
d["prefix"] = prefix
d["nodeName"] = qualifiedName
d["value"] = d["nodeValue"] = value
d["ownerDocument"] = self.ownerDocument
self.setAttributeNode(attr)
else:
d = attr.__dict__
if value != attr.value:
d["value"] = d["nodeValue"] = value
if attr.isId:
_clear_id_cache(self)
if attr.prefix != prefix:
d["prefix"] = prefix
d["nodeName"] = qualifiedName
def getAttributeNode(self, attrname):
return self._attrs.get(attrname)
def getAttributeNodeNS(self, namespaceURI, localName):
return self._attrsNS.get((namespaceURI, localName))
def setAttributeNode(self, attr):
if attr.ownerElement not in (None, self):
raise xml.dom.InuseAttributeErr("attribute node already owned")
old1 = self._attrs.get(attr.name, None)
if old1 is not None:
self.removeAttributeNode(old1)
old2 = self._attrsNS.get((attr.namespaceURI, attr.localName), None)
if old2 is not None and old2 is not old1:
self.removeAttributeNode(old2)
_set_attribute_node(self, attr)
if old1 is not attr:
# It might have already been part of this node, in which case
# it doesn't represent a change, and should not be returned.
return old1
if old2 is not attr:
return old2
setAttributeNodeNS = setAttributeNode
def removeAttribute(self, name):
try:
attr = self._attrs[name]
except KeyError:
raise xml.dom.NotFoundErr()
self.removeAttributeNode(attr)
def removeAttributeNS(self, namespaceURI, localName):
try:
attr = self._attrsNS[(namespaceURI, localName)]
except KeyError:
raise xml.dom.NotFoundErr()
self.removeAttributeNode(attr)
def removeAttributeNode(self, node):
if node is None:
raise xml.dom.NotFoundErr()
try:
self._attrs[node.name]
except KeyError:
raise xml.dom.NotFoundErr()
_clear_id_cache(self)
node.unlink()
# Restore this since the node is still useful and otherwise
# unlinked
node.ownerDocument = self.ownerDocument
removeAttributeNodeNS = removeAttributeNode
def hasAttribute(self, name):
return name in self._attrs
def hasAttributeNS(self, namespaceURI, localName):
return (namespaceURI, localName) in self._attrsNS
def getElementsByTagName(self, name):
return _get_elements_by_tagName_helper(self, name, NodeList())
def getElementsByTagNameNS(self, namespaceURI, localName):
return _get_elements_by_tagName_ns_helper(
self, namespaceURI, localName, NodeList())
def __repr__(self):
return "<DOM Element: %s at %#x>" % (self.tagName, id(self))
def writexml(self, writer, indent="", addindent="", newl=""):
# indent = current indentation
# addindent = indentation to add to higher levels
# newl = newline string
writer.write(indent+"<" + self.tagName)
attrs = self._get_attributes()
a_names = attrs.keys()
a_names.sort()
for a_name in a_names:
writer.write(" %s=\"" % a_name)
_write_data(writer, attrs[a_name].value)
writer.write("\"")
if self.childNodes:
writer.write(">")
if (len(self.childNodes) == 1 and
self.childNodes[0].nodeType == Node.TEXT_NODE):
self.childNodes[0].writexml(writer, '', '', '')
else:
writer.write(newl)
for node in self.childNodes:
node.writexml(writer, indent+addindent, addindent, newl)
writer.write(indent)
writer.write("</%s>%s" % (self.tagName, newl))
else:
writer.write("/>%s"%(newl))
def _get_attributes(self):
return NamedNodeMap(self._attrs, self._attrsNS, self)
def hasAttributes(self):
if self._attrs:
return True
else:
return False
# DOM Level 3 attributes, based on the 22 Oct 2002 draft
def setIdAttribute(self, name):
idAttr = self.getAttributeNode(name)
self.setIdAttributeNode(idAttr)
def setIdAttributeNS(self, namespaceURI, localName):
idAttr = self.getAttributeNodeNS(namespaceURI, localName)
self.setIdAttributeNode(idAttr)
def setIdAttributeNode(self, idAttr):
if idAttr is None or not self.isSameNode(idAttr.ownerElement):
raise xml.dom.NotFoundErr()
if _get_containing_entref(self) is not None:
raise xml.dom.NoModificationAllowedErr()
if not idAttr._is_id:
idAttr.__dict__['_is_id'] = True
self._magic_id_nodes += 1
self.ownerDocument._magic_id_count += 1
_clear_id_cache(self)
defproperty(Element, "attributes",
doc="NamedNodeMap of attributes on the element.")
defproperty(Element, "localName",
doc="Namespace-local name of this element.")
def _set_attribute_node(element, attr):
_clear_id_cache(element)
element._attrs[attr.name] = attr
element._attrsNS[(attr.namespaceURI, attr.localName)] = attr
# This creates a circular reference, but Element.unlink()
# breaks the cycle since the references to the attribute
# dictionaries are tossed.
attr.__dict__['ownerElement'] = element
class Childless:
"""Mixin that makes childless-ness easy to implement and avoids
the complexity of the Node methods that deal with children.
"""
attributes = None
childNodes = EmptyNodeList()
firstChild = None
lastChild = None
def _get_firstChild(self):
return None
def _get_lastChild(self):
return None
def appendChild(self, node):
raise xml.dom.HierarchyRequestErr(
self.nodeName + " nodes cannot have children")
def hasChildNodes(self):
return False
def insertBefore(self, newChild, refChild):
raise xml.dom.HierarchyRequestErr(
self.nodeName + " nodes do not have children")
def removeChild(self, oldChild):
raise xml.dom.NotFoundErr(
self.nodeName + " nodes do not have children")
def normalize(self):
# For childless nodes, normalize() has nothing to do.
pass
def replaceChild(self, newChild, oldChild):
raise xml.dom.HierarchyRequestErr(
self.nodeName + " nodes do not have children")
class ProcessingInstruction(Childless, Node):
nodeType = Node.PROCESSING_INSTRUCTION_NODE
def __init__(self, target, data):
self.target = self.nodeName = target
self.data = self.nodeValue = data
def _get_data(self):
return self.data
def _set_data(self, value):
d = self.__dict__
d['data'] = d['nodeValue'] = value
def _get_target(self):
return self.target
def _set_target(self, value):
d = self.__dict__
d['target'] = d['nodeName'] = value
def __setattr__(self, name, value):
if name == "data" or name == "nodeValue":
self.__dict__['data'] = self.__dict__['nodeValue'] = value
elif name == "target" or name == "nodeName":
self.__dict__['target'] = self.__dict__['nodeName'] = value
else:
self.__dict__[name] = value
def writexml(self, writer, indent="", addindent="", newl=""):
writer.write("%s<?%s %s?>%s" % (indent,self.target, self.data, newl))
class CharacterData(Childless, Node):
def _get_length(self):
return len(self.data)
__len__ = _get_length
def _get_data(self):
return self.__dict__['data']
def _set_data(self, data):
d = self.__dict__
d['data'] = d['nodeValue'] = data
_get_nodeValue = _get_data
_set_nodeValue = _set_data
def __setattr__(self, name, value):
if name == "data" or name == "nodeValue":
self.__dict__['data'] = self.__dict__['nodeValue'] = value
else:
self.__dict__[name] = value
def __repr__(self):
data = self.data
if len(data) > 10:
dotdotdot = "..."
else:
dotdotdot = ""
return '<DOM %s node "%r%s">' % (
self.__class__.__name__, data[0:10], dotdotdot)
def substringData(self, offset, count):
if offset < 0:
raise xml.dom.IndexSizeErr("offset cannot be negative")
if offset >= len(self.data):
raise xml.dom.IndexSizeErr("offset cannot be beyond end of data")
if count < 0:
raise xml.dom.IndexSizeErr("count cannot be negative")
return self.data[offset:offset+count]
def appendData(self, arg):
self.data = self.data + arg
def insertData(self, offset, arg):
if offset < 0:
raise xml.dom.IndexSizeErr("offset cannot be negative")
if offset >= len(self.data):
raise xml.dom.IndexSizeErr("offset cannot be beyond end of data")
if arg:
self.data = "%s%s%s" % (
self.data[:offset], arg, self.data[offset:])
def deleteData(self, offset, count):
if offset < 0:
raise xml.dom.IndexSizeErr("offset cannot be negative")
if offset >= len(self.data):
raise xml.dom.IndexSizeErr("offset cannot be beyond end of data")
if count < 0:
raise xml.dom.IndexSizeErr("count cannot be negative")
if count:
self.data = self.data[:offset] + self.data[offset+count:]
def replaceData(self, offset, count, arg):
if offset < 0:
raise xml.dom.IndexSizeErr("offset cannot be negative")
if offset >= len(self.data):
raise xml.dom.IndexSizeErr("offset cannot be beyond end of data")
if count < 0:
raise xml.dom.IndexSizeErr("count cannot be negative")
if count:
self.data = "%s%s%s" % (
self.data[:offset], arg, self.data[offset+count:])
defproperty(CharacterData, "length", doc="Length of the string data.")
class Text(CharacterData):
# Make sure we don't add an instance __dict__ if we don't already
# have one, at least when that's possible:
# XXX this does not work, CharacterData is an old-style class
# __slots__ = ()
nodeType = Node.TEXT_NODE
nodeName = "#text"
attributes = None
def splitText(self, offset):
if offset < 0 or offset > len(self.data):
raise xml.dom.IndexSizeErr("illegal offset value")
newText = self.__class__()
newText.data = self.data[offset:]
newText.ownerDocument = self.ownerDocument
next = self.nextSibling
if self.parentNode and self in self.parentNode.childNodes:
if next is None:
self.parentNode.appendChild(newText)
else:
self.parentNode.insertBefore(newText, next)
self.data = self.data[:offset]
return newText
def writexml(self, writer, indent="", addindent="", newl=""):
_write_data(writer, "%s%s%s" % (indent, self.data, newl))
# DOM Level 3 (WD 9 April 2002)
def _get_wholeText(self):
L = [self.data]
n = self.previousSibling
while n is not None:
if n.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE):
L.insert(0, n.data)
n = n.previousSibling
else:
break
n = self.nextSibling
while n is not None:
if n.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE):
L.append(n.data)
n = n.nextSibling
else:
break
return ''.join(L)
def replaceWholeText(self, content):
# XXX This needs to be seriously changed if minidom ever
# supports EntityReference nodes.
parent = self.parentNode
n = self.previousSibling
while n is not None:
if n.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE):
next = n.previousSibling
parent.removeChild(n)
n = next
else:
break
n = self.nextSibling
if not content:
parent.removeChild(self)
while n is not None:
if n.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE):
next = n.nextSibling
parent.removeChild(n)
n = next
else:
break
if content:
d = self.__dict__
d['data'] = content
d['nodeValue'] = content
return self
else:
return None
def _get_isWhitespaceInElementContent(self):
if self.data.strip():
return False
elem = _get_containing_element(self)
if elem is None:
return False
info = self.ownerDocument._get_elem_info(elem)
if info is None:
return False
else:
return info.isElementContent()
defproperty(Text, "isWhitespaceInElementContent",
doc="True iff this text node contains only whitespace"
" and is in element content.")
defproperty(Text, "wholeText",
doc="The text of all logically-adjacent text nodes.")
def _get_containing_element(node):
c = node.parentNode
while c is not None:
if c.nodeType == Node.ELEMENT_NODE:
return c
c = c.parentNode
return None
def _get_containing_entref(node):
c = node.parentNode
while c is not None:
if c.nodeType == Node.ENTITY_REFERENCE_NODE:
return c
c = c.parentNode
return None
class Comment(Childless, CharacterData):
nodeType = Node.COMMENT_NODE
nodeName = "#comment"
def __init__(self, data):
self.data = self.nodeValue = data
def writexml(self, writer, indent="", addindent="", newl=""):
if "--" in self.data:
raise ValueError("'--' is not allowed in a comment node")
writer.write("%s<!--%s-->%s" % (indent, self.data, newl))
class CDATASection(Text):
# Make sure we don't add an instance __dict__ if we don't already
# have one, at least when that's possible:
# XXX this does not work, Text is an old-style class
# __slots__ = ()
nodeType = Node.CDATA_SECTION_NODE
nodeName = "#cdata-section"
def writexml(self, writer, indent="", addindent="", newl=""):
if self.data.find("]]>") >= 0:
raise ValueError("']]>' not allowed in a CDATA section")
writer.write("<![CDATA[%s]]>" % self.data)
class ReadOnlySequentialNamedNodeMap(object):
__slots__ = '_seq',
def __init__(self, seq=()):
# seq should be a list or tuple
self._seq = seq
def __len__(self):
return len(self._seq)
def _get_length(self):
return len(self._seq)
def getNamedItem(self, name):
for n in self._seq:
if n.nodeName == name:
return n
def getNamedItemNS(self, namespaceURI, localName):
for n in self._seq:
if n.namespaceURI == namespaceURI and n.localName == localName:
return n
def __getitem__(self, name_or_tuple):
if isinstance(name_or_tuple, tuple):
node = self.getNamedItemNS(*name_or_tuple)
else:
node = self.getNamedItem(name_or_tuple)
if node is None:
raise KeyError, name_or_tuple
return node
def item(self, index):
if index < 0:
return None
try:
return self._seq[index]
except IndexError:
return None
def removeNamedItem(self, name):
raise xml.dom.NoModificationAllowedErr(
"NamedNodeMap instance is read-only")
def removeNamedItemNS(self, namespaceURI, localName):
raise xml.dom.NoModificationAllowedErr(
"NamedNodeMap instance is read-only")
def setNamedItem(self, node):
raise xml.dom.NoModificationAllowedErr(
"NamedNodeMap instance is read-only")
def setNamedItemNS(self, node):
raise xml.dom.NoModificationAllowedErr(
"NamedNodeMap instance is read-only")
def __getstate__(self):
return [self._seq]
def __setstate__(self, state):
self._seq = state[0]
defproperty(ReadOnlySequentialNamedNodeMap, "length",
doc="Number of entries in the NamedNodeMap.")
class Identified:
"""Mix-in class that supports the publicId and systemId attributes."""
# XXX this does not work, this is an old-style class
# __slots__ = 'publicId', 'systemId'
def _identified_mixin_init(self, publicId, systemId):
self.publicId = publicId
self.systemId = systemId
def _get_publicId(self):
return self.publicId
def _get_systemId(self):
return self.systemId
class DocumentType(Identified, Childless, Node):
nodeType = Node.DOCUMENT_TYPE_NODE
nodeValue = None
name = None
publicId = None
systemId = None
internalSubset = None
def __init__(self, qualifiedName):
self.entities = ReadOnlySequentialNamedNodeMap()
self.notations = ReadOnlySequentialNamedNodeMap()
if qualifiedName:
prefix, localname = _nssplit(qualifiedName)
self.name = localname
self.nodeName = self.name
def _get_internalSubset(self):
return self.internalSubset
def cloneNode(self, deep):
if self.ownerDocument is None:
# it's ok
clone = DocumentType(None)
clone.name = self.name
clone.nodeName = self.name
operation = xml.dom.UserDataHandler.NODE_CLONED
if deep:
clone.entities._seq = []
clone.notations._seq = []
for n in self.notations._seq:
notation = Notation(n.nodeName, n.publicId, n.systemId)
clone.notations._seq.append(notation)
n._call_user_data_handler(operation, n, notation)
for e in self.entities._seq:
entity = Entity(e.nodeName, e.publicId, e.systemId,
e.notationName)
entity.actualEncoding = e.actualEncoding
entity.encoding = e.encoding
entity.version = e.version
clone.entities._seq.append(entity)
e._call_user_data_handler(operation, n, entity)
self._call_user_data_handler(operation, self, clone)
return clone
else:
return None
def writexml(self, writer, indent="", addindent="", newl=""):
writer.write("<!DOCTYPE ")
writer.write(self.name)
if self.publicId:
writer.write("%s PUBLIC '%s'%s '%s'"
% (newl, self.publicId, newl, self.systemId))
elif self.systemId:
writer.write("%s SYSTEM '%s'" % (newl, self.systemId))
if self.internalSubset is not None:
writer.write(" [")
writer.write(self.internalSubset)
writer.write("]")
writer.write(">"+newl)
class Entity(Identified, Node):
attributes = None
nodeType = Node.ENTITY_NODE
nodeValue = None
actualEncoding = None
encoding = None
version = None
def __init__(self, name, publicId, systemId, notation):
self.nodeName = name
self.notationName = notation
self.childNodes = NodeList()
self._identified_mixin_init(publicId, systemId)
def _get_actualEncoding(self):
return self.actualEncoding
def _get_encoding(self):
return self.encoding
def _get_version(self):
return self.version
def appendChild(self, newChild):
raise xml.dom.HierarchyRequestErr(
"cannot append children to an entity node")
def insertBefore(self, newChild, refChild):
raise xml.dom.HierarchyRequestErr(
"cannot insert children below an entity node")
def removeChild(self, oldChild):
raise xml.dom.HierarchyRequestErr(
"cannot remove children from an entity node")
def replaceChild(self, newChild, oldChild):
raise xml.dom.HierarchyRequestErr(
"cannot replace children of an entity node")
class Notation(Identified, Childless, Node):
nodeType = Node.NOTATION_NODE
nodeValue = None
def __init__(self, name, publicId, systemId):
self.nodeName = name
self._identified_mixin_init(publicId, systemId)
class DOMImplementation(DOMImplementationLS):
_features = [("core", "1.0"),
("core", "2.0"),
("core", None),
("xml", "1.0"),
("xml", "2.0"),
("xml", None),
("ls-load", "3.0"),
("ls-load", None),
]
def hasFeature(self, feature, version):
if version == "":
version = None
return (feature.lower(), version) in self._features
def createDocument(self, namespaceURI, qualifiedName, doctype):
if doctype and doctype.parentNode is not None:
raise xml.dom.WrongDocumentErr(
"doctype object owned by another DOM tree")
doc = self._create_document()
add_root_element = not (namespaceURI is None
and qualifiedName is None
and doctype is None)
if not qualifiedName and add_root_element:
# The spec is unclear what to raise here; SyntaxErr
# would be the other obvious candidate. Since Xerces raises
# InvalidCharacterErr, and since SyntaxErr is not listed
# for createDocument, that seems to be the better choice.
# XXX: need to check for illegal characters here and in
# createElement.
# DOM Level III clears this up when talking about the return value
# of this function. If namespaceURI, qName and DocType are
# Null the document is returned without a document element
# Otherwise if doctype or namespaceURI are not None
# Then we go back to the above problem
raise xml.dom.InvalidCharacterErr("Element with no name")
if add_root_element:
prefix, localname = _nssplit(qualifiedName)
if prefix == "xml" \
and namespaceURI != "http://www.w3.org/XML/1998/namespace":
raise xml.dom.NamespaceErr("illegal use of 'xml' prefix")
if prefix and not namespaceURI:
raise xml.dom.NamespaceErr(
"illegal use of prefix without namespaces")
element = doc.createElementNS(namespaceURI, qualifiedName)
if doctype:
doc.appendChild(doctype)
doc.appendChild(element)
if doctype:
doctype.parentNode = doctype.ownerDocument = doc
doc.doctype = doctype
doc.implementation = self
return doc
def createDocumentType(self, qualifiedName, publicId, systemId):
doctype = DocumentType(qualifiedName)
doctype.publicId = publicId
doctype.systemId = systemId
return doctype
# DOM Level 3 (WD 9 April 2002)
def getInterface(self, feature):
if self.hasFeature(feature, None):
return self
else:
return None
# internal
def _create_document(self):
return Document()
class ElementInfo(object):
"""Object that represents content-model information for an element.
This implementation is not expected to be used in practice; DOM
builders should provide implementations which do the right thing
using information available to it.
"""
__slots__ = 'tagName',
def __init__(self, name):
self.tagName = name
def getAttributeType(self, aname):
return _no_type
def getAttributeTypeNS(self, namespaceURI, localName):
return _no_type
def isElementContent(self):
return False
def isEmpty(self):
"""Returns true iff this element is declared to have an EMPTY
content model."""
return False
def isId(self, aname):
"""Returns true iff the named attribute is a DTD-style ID."""
return False
def isIdNS(self, namespaceURI, localName):
"""Returns true iff the identified attribute is a DTD-style ID."""
return False
def __getstate__(self):
return self.tagName
def __setstate__(self, state):
self.tagName = state
def _clear_id_cache(node):
if node.nodeType == Node.DOCUMENT_NODE:
node._id_cache.clear()
node._id_search_stack = None
elif _in_document(node):
node.ownerDocument._id_cache.clear()
node.ownerDocument._id_search_stack= None
class Document(Node, DocumentLS):
_child_node_types = (Node.ELEMENT_NODE, Node.PROCESSING_INSTRUCTION_NODE,
Node.COMMENT_NODE, Node.DOCUMENT_TYPE_NODE)
nodeType = Node.DOCUMENT_NODE
nodeName = "#document"
nodeValue = None
attributes = None
doctype = None
parentNode = None
previousSibling = nextSibling = None
implementation = DOMImplementation()
# Document attributes from Level 3 (WD 9 April 2002)
actualEncoding = None
encoding = None
standalone = None
version = None
strictErrorChecking = False
errorHandler = None
documentURI = None
_magic_id_count = 0
def __init__(self):
self.childNodes = NodeList()
# mapping of (namespaceURI, localName) -> ElementInfo
# and tagName -> ElementInfo
self._elem_info = {}
self._id_cache = {}
self._id_search_stack = None
def _get_elem_info(self, element):
if element.namespaceURI:
key = element.namespaceURI, element.localName
else:
key = element.tagName
return self._elem_info.get(key)
def _get_actualEncoding(self):
return self.actualEncoding
def _get_doctype(self):
return self.doctype
def _get_documentURI(self):
return self.documentURI
def _get_encoding(self):
return self.encoding
def _get_errorHandler(self):
return self.errorHandler
def _get_standalone(self):
return self.standalone
def _get_strictErrorChecking(self):
return self.strictErrorChecking
def _get_version(self):
return self.version
def appendChild(self, node):
if node.nodeType not in self._child_node_types:
raise xml.dom.HierarchyRequestErr(
"%s cannot be child of %s" % (repr(node), repr(self)))
if node.parentNode is not None:
# This needs to be done before the next test since this
# may *be* the document element, in which case it should
# end up re-ordered to the end.
node.parentNode.removeChild(node)
if node.nodeType == Node.ELEMENT_NODE \
and self._get_documentElement():
raise xml.dom.HierarchyRequestErr(
"two document elements disallowed")
return Node.appendChild(self, node)
def removeChild(self, oldChild):
try:
self.childNodes.remove(oldChild)
except ValueError:
raise xml.dom.NotFoundErr()
oldChild.nextSibling = oldChild.previousSibling = None
oldChild.parentNode = None
if self.documentElement is oldChild:
self.documentElement = None
return oldChild
def _get_documentElement(self):
for node in self.childNodes:
if node.nodeType == Node.ELEMENT_NODE:
return node
def unlink(self):
if self.doctype is not None:
self.doctype.unlink()
self.doctype = None
Node.unlink(self)
def cloneNode(self, deep):
if not deep:
return None
clone = self.implementation.createDocument(None, None, None)
clone.encoding = self.encoding
clone.standalone = self.standalone
clone.version = self.version
for n in self.childNodes:
childclone = _clone_node(n, deep, clone)
assert childclone.ownerDocument.isSameNode(clone)
clone.childNodes.append(childclone)
if childclone.nodeType == Node.DOCUMENT_NODE:
assert clone.documentElement is None
elif childclone.nodeType == Node.DOCUMENT_TYPE_NODE:
assert clone.doctype is None
clone.doctype = childclone
childclone.parentNode = clone
self._call_user_data_handler(xml.dom.UserDataHandler.NODE_CLONED,
self, clone)
return clone
def createDocumentFragment(self):
d = DocumentFragment()
d.ownerDocument = self
return d
def createElement(self, tagName):
e = Element(tagName)
e.ownerDocument = self
return e
def createTextNode(self, data):
if not isinstance(data, StringTypes):
raise TypeError, "node contents must be a string"
t = Text()
t.data = data
t.ownerDocument = self
return t
def createCDATASection(self, data):
if not isinstance(data, StringTypes):
raise TypeError, "node contents must be a string"
c = CDATASection()
c.data = data
c.ownerDocument = self
return c
def createComment(self, data):
c = Comment(data)
c.ownerDocument = self
return c
def createProcessingInstruction(self, target, data):
p = ProcessingInstruction(target, data)
p.ownerDocument = self
return p
def createAttribute(self, qName):
a = Attr(qName)
a.ownerDocument = self
a.value = ""
return a
def createElementNS(self, namespaceURI, qualifiedName):
prefix, localName = _nssplit(qualifiedName)
e = Element(qualifiedName, namespaceURI, prefix)
e.ownerDocument = self
return e
def createAttributeNS(self, namespaceURI, qualifiedName):
prefix, localName = _nssplit(qualifiedName)
a = Attr(qualifiedName, namespaceURI, localName, prefix)
a.ownerDocument = self
a.value = ""
return a
# A couple of implementation-specific helpers to create node types
# not supported by the W3C DOM specs:
def _create_entity(self, name, publicId, systemId, notationName):
e = Entity(name, publicId, systemId, notationName)
e.ownerDocument = self
return e
def _create_notation(self, name, publicId, systemId):
n = Notation(name, publicId, systemId)
n.ownerDocument = self
return n
def getElementById(self, id):
if id in self._id_cache:
return self._id_cache[id]
if not (self._elem_info or self._magic_id_count):
return None
stack = self._id_search_stack
if stack is None:
# we never searched before, or the cache has been cleared
stack = [self.documentElement]
self._id_search_stack = stack
elif not stack:
# Previous search was completed and cache is still valid;
# no matching node.
return None
result = None
while stack:
node = stack.pop()
# add child elements to stack for continued searching
stack.extend([child for child in node.childNodes
if child.nodeType in _nodeTypes_with_children])
# check this node
info = self._get_elem_info(node)
if info:
# We have to process all ID attributes before
# returning in order to get all the attributes set to
# be IDs using Element.setIdAttribute*().
for attr in node.attributes.values():
if attr.namespaceURI:
if info.isIdNS(attr.namespaceURI, attr.localName):
self._id_cache[attr.value] = node
if attr.value == id:
result = node
elif not node._magic_id_nodes:
break
elif info.isId(attr.name):
self._id_cache[attr.value] = node
if attr.value == id:
result = node
elif not node._magic_id_nodes:
break
elif attr._is_id:
self._id_cache[attr.value] = node
if attr.value == id:
result = node
elif node._magic_id_nodes == 1:
break
elif node._magic_id_nodes:
for attr in node.attributes.values():
if attr._is_id:
self._id_cache[attr.value] = node
if attr.value == id:
result = node
if result is not None:
break
return result
def getElementsByTagName(self, name):
return _get_elements_by_tagName_helper(self, name, NodeList())
def getElementsByTagNameNS(self, namespaceURI, localName):
return _get_elements_by_tagName_ns_helper(
self, namespaceURI, localName, NodeList())
def isSupported(self, feature, version):
return self.implementation.hasFeature(feature, version)
def importNode(self, node, deep):
if node.nodeType == Node.DOCUMENT_NODE:
raise xml.dom.NotSupportedErr("cannot import document nodes")
elif node.nodeType == Node.DOCUMENT_TYPE_NODE:
raise xml.dom.NotSupportedErr("cannot import document type nodes")
return _clone_node(node, deep, self)
def writexml(self, writer, indent="", addindent="", newl="",
encoding = None):
if encoding is None:
writer.write('<?xml version="1.0" ?>'+newl)
else:
writer.write('<?xml version="1.0" encoding="%s"?>%s' % (encoding, newl))
for node in self.childNodes:
node.writexml(writer, indent, addindent, newl)
# DOM Level 3 (WD 9 April 2002)
def renameNode(self, n, namespaceURI, name):
if n.ownerDocument is not self:
raise xml.dom.WrongDocumentErr(
"cannot rename nodes from other documents;\n"
"expected %s,\nfound %s" % (self, n.ownerDocument))
if n.nodeType not in (Node.ELEMENT_NODE, Node.ATTRIBUTE_NODE):
raise xml.dom.NotSupportedErr(
"renameNode() only applies to element and attribute nodes")
if namespaceURI != EMPTY_NAMESPACE:
if ':' in name:
prefix, localName = name.split(':', 1)
if ( prefix == "xmlns"
and namespaceURI != xml.dom.XMLNS_NAMESPACE):
raise xml.dom.NamespaceErr(
"illegal use of 'xmlns' prefix")
else:
if ( name == "xmlns"
and namespaceURI != xml.dom.XMLNS_NAMESPACE
and n.nodeType == Node.ATTRIBUTE_NODE):
raise xml.dom.NamespaceErr(
"illegal use of the 'xmlns' attribute")
prefix = None
localName = name
else:
prefix = None
localName = None
if n.nodeType == Node.ATTRIBUTE_NODE:
element = n.ownerElement
if element is not None:
is_id = n._is_id
element.removeAttributeNode(n)
else:
element = None
# avoid __setattr__
d = n.__dict__
d['prefix'] = prefix
d['localName'] = localName
d['namespaceURI'] = namespaceURI
d['nodeName'] = name
if n.nodeType == Node.ELEMENT_NODE:
d['tagName'] = name
else:
# attribute node
d['name'] = name
if element is not None:
element.setAttributeNode(n)
if is_id:
element.setIdAttributeNode(n)
# It's not clear from a semantic perspective whether we should
# call the user data handlers for the NODE_RENAMED event since
# we're re-using the existing node. The draft spec has been
# interpreted as meaning "no, don't call the handler unless a
# new node is created."
return n
defproperty(Document, "documentElement",
doc="Top-level element of this document.")
def _clone_node(node, deep, newOwnerDocument):
"""
Clone a node and give it the new owner document.
Called by Node.cloneNode and Document.importNode
"""
if node.ownerDocument.isSameNode(newOwnerDocument):
operation = xml.dom.UserDataHandler.NODE_CLONED
else:
operation = xml.dom.UserDataHandler.NODE_IMPORTED
if node.nodeType == Node.ELEMENT_NODE:
clone = newOwnerDocument.createElementNS(node.namespaceURI,
node.nodeName)
for attr in node.attributes.values():
clone.setAttributeNS(attr.namespaceURI, attr.nodeName, attr.value)
a = clone.getAttributeNodeNS(attr.namespaceURI, attr.localName)
a.specified = attr.specified
if deep:
for child in node.childNodes:
c = _clone_node(child, deep, newOwnerDocument)
clone.appendChild(c)
elif node.nodeType == Node.DOCUMENT_FRAGMENT_NODE:
clone = newOwnerDocument.createDocumentFragment()
if deep:
for child in node.childNodes:
c = _clone_node(child, deep, newOwnerDocument)
clone.appendChild(c)
elif node.nodeType == Node.TEXT_NODE:
clone = newOwnerDocument.createTextNode(node.data)
elif node.nodeType == Node.CDATA_SECTION_NODE:
clone = newOwnerDocument.createCDATASection(node.data)
elif node.nodeType == Node.PROCESSING_INSTRUCTION_NODE:
clone = newOwnerDocument.createProcessingInstruction(node.target,
node.data)
elif node.nodeType == Node.COMMENT_NODE:
clone = newOwnerDocument.createComment(node.data)
elif node.nodeType == Node.ATTRIBUTE_NODE:
clone = newOwnerDocument.createAttributeNS(node.namespaceURI,
node.nodeName)
clone.specified = True
clone.value = node.value
elif node.nodeType == Node.DOCUMENT_TYPE_NODE:
assert node.ownerDocument is not newOwnerDocument
operation = xml.dom.UserDataHandler.NODE_IMPORTED
clone = newOwnerDocument.implementation.createDocumentType(
node.name, node.publicId, node.systemId)
clone.ownerDocument = newOwnerDocument
if deep:
clone.entities._seq = []
clone.notations._seq = []
for n in node.notations._seq:
notation = Notation(n.nodeName, n.publicId, n.systemId)
notation.ownerDocument = newOwnerDocument
clone.notations._seq.append(notation)
if hasattr(n, '_call_user_data_handler'):
n._call_user_data_handler(operation, n, notation)
for e in node.entities._seq:
entity = Entity(e.nodeName, e.publicId, e.systemId,
e.notationName)
entity.actualEncoding = e.actualEncoding
entity.encoding = e.encoding
entity.version = e.version
entity.ownerDocument = newOwnerDocument
clone.entities._seq.append(entity)
if hasattr(e, '_call_user_data_handler'):
e._call_user_data_handler(operation, n, entity)
else:
# Note the cloning of Document and DocumentType nodes is
# implementation specific. minidom handles those cases
# directly in the cloneNode() methods.
raise xml.dom.NotSupportedErr("Cannot clone node %s" % repr(node))
# Check for _call_user_data_handler() since this could conceivably
# used with other DOM implementations (one of the FourThought
# DOMs, perhaps?).
if hasattr(node, '_call_user_data_handler'):
node._call_user_data_handler(operation, node, clone)
return clone
def _nssplit(qualifiedName):
fields = qualifiedName.split(':', 1)
if len(fields) == 2:
return fields
else:
return (None, fields[0])
def _get_StringIO():
# we can't use cStringIO since it doesn't support Unicode strings
from StringIO import StringIO
return StringIO()
def _do_pulldom_parse(func, args, kwargs):
events = func(*args, **kwargs)
toktype, rootNode = events.getEvent()
events.expandNode(rootNode)
events.clear()
return rootNode
def parse(file, parser=None, bufsize=None):
"""Parse a file into a DOM by filename or file object."""
if parser is None and not bufsize:
from xml.dom import expatbuilder
return expatbuilder.parse(file)
else:
from xml.dom import pulldom
return _do_pulldom_parse(pulldom.parse, (file,),
{'parser': parser, 'bufsize': bufsize})
def parseString(string, parser=None):
"""Parse a file into a DOM from a string."""
if parser is None:
from xml.dom import expatbuilder
return expatbuilder.parseString(string)
else:
from xml.dom import pulldom
return _do_pulldom_parse(pulldom.parseString, (string,),
{'parser': parser})
def getDOMImplementation(features=None):
if features:
if isinstance(features, StringTypes):
features = domreg._parse_feature_string(features)
for f, v in features:
if not Document.implementation.hasFeature(f, v):
return None
return Document.implementation
| {
"pile_set_name": "Github"
} |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ActiveUp.Net.Samples.Utils;
using ActiveUp.Net.Mail;
namespace ActiveUp.Net.Samples.IMAP4
{
public partial class RenameMailbox : ActiveUp.Net.Samples.Utils.MasterForm
{
public RenameMailbox(SamplesConfiguration config)
{
this.Config = config;
InitializeComponent();
InitializeSample();
}
protected override void InitializeSample()
{
base.InitializeSample();
_tbUserName.Text = Config.Imap4UserName;
_tbPassword.Text = Config.Imap4Password;
_tbImap4Server.Text = Config.Imap4Server;
}
private void _bRenameMailbox_Click(object sender, EventArgs e)
{
// We create Imap client
Imap4Client imap = new Imap4Client();
try
{
// We connect to the imap4 server
imap.Connect(_tbImap4Server.Text);
this.AddLogEntry(string.Format("Connection to {0} successfully", _tbImap4Server.Text));
// Login to mail box
imap.Login(_tbUserName.Text, _tbPassword.Text);
this.AddLogEntry(string.Format("Login to {0} successfully", _tbImap4Server.Text));
if (_tbOldMailbox.Text.Length > 0 && _tbNewMailbox.Text.Length > 0)
{
imap.RenameMailbox(_tbOldMailbox.Text, _tbNewMailbox.Text);
this.AddLogEntry("Mailbox {0} successfully renamed");
}
else
{
this.AddLogEntry("You have to set a mailbox name to delete");
}
}
catch (Imap4Exception iex)
{
this.AddLogEntry(string.Format("Imap4 Error: {0}", iex.Message));
}
catch (Exception ex)
{
this.AddLogEntry(string.Format("Failed: {0}", ex.Message));
}
finally
{
if (imap.IsConnected)
{
imap.Disconnect();
}
}
}
}
}
| {
"pile_set_name": "Github"
} |
<a href="bunyan.1.html">bunyan(1) man page</a>
| {
"pile_set_name": "Github"
} |
/*
Copyright 2020 The Kubermatic Kubernetes Platform contributors.
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 metrics
import (
"k8s.io/client-go/util/workqueue"
"github.com/prometheus/client_golang/prometheus"
)
// Copied from https://github.com/kubernetes/kubernetes/blob/master/pkg/util/workqueue/prometheus/prometheus.go
// and https://github.com/kubernetes-sigs/controller-runtime/blob/v0.3.0/pkg/metrics/workqueue.go
// Package prometheus sets the workqueue DefaultMetricsFactory to produce
// prometheus metrics. To use this package, you just have to import it.
func init() {
workqueue.SetProvider(prometheusMetricsProvider{})
}
type prometheusMetricsProvider struct{}
func (prometheusMetricsProvider) NewDepthMetric(name string) workqueue.GaugeMetric {
depth := prometheus.NewGauge(prometheus.GaugeOpts{
Subsystem: name,
Name: "depth",
Help: "Current depth of workqueue: " + name,
})
// Upstream has prometheus.Register here
prometheus.MustRegister(depth)
return depth
}
func (prometheusMetricsProvider) NewAddsMetric(name string) workqueue.CounterMetric {
adds := prometheus.NewCounter(prometheus.CounterOpts{
Subsystem: name,
Name: "adds",
Help: "Total number of adds handled by workqueue: " + name,
})
// Upstream has prometheus.Register here
prometheus.MustRegister(adds)
return adds
}
func (prometheusMetricsProvider) NewLatencyMetric(queue string) workqueue.HistogramMetric {
m := prometheus.NewHistogram(prometheus.HistogramOpts{
Name: "workqueue_queue_duration_seconds",
Help: "How long in seconds an item stays in workqueue before being requested.",
ConstLabels: prometheus.Labels{"name": queue},
Buckets: prometheus.ExponentialBuckets(10e-9, 10, 10),
})
prometheus.MustRegister(m)
return m
}
func (prometheusMetricsProvider) NewWorkDurationMetric(queue string) workqueue.HistogramMetric {
const name = "workqueue_work_duration_seconds"
m := prometheus.NewHistogram(prometheus.HistogramOpts{
Name: name,
Help: "How long in seconds processing an item from workqueue takes.",
ConstLabels: prometheus.Labels{"name": queue},
Buckets: prometheus.ExponentialBuckets(10e-9, 10, 10),
})
prometheus.MustRegister(m)
return m
}
func (prometheusMetricsProvider) NewUnfinishedWorkSecondsMetric(name string) workqueue.SettableGaugeMetric {
unfinished := prometheus.NewGauge(prometheus.GaugeOpts{
Subsystem: name,
Name: "unfinished_work_seconds",
Help: "How many seconds of work " + name + " has done that " +
"is in progress and hasn't been observed by work_duration. Large " +
"values indicate stuck threads. One can deduce the number of stuck " +
"threads by observing the rate at which this increases.",
})
// Upstream has prometheus.Register here
prometheus.MustRegister(unfinished)
return unfinished
}
func (prometheusMetricsProvider) NewLongestRunningProcessorSecondsMetric(queue string) workqueue.SettableGaugeMetric {
const name = "workqueue_longest_running_processor_seconds"
m := prometheus.NewGauge(prometheus.GaugeOpts{
Name: name,
Help: "How many seconds has the longest running " +
"processor for workqueue been running.",
ConstLabels: prometheus.Labels{"name": queue},
})
prometheus.MustRegister(m)
return m
}
func (prometheusMetricsProvider) NewLongestRunningProcessorMicrosecondsMetric(name string) workqueue.SettableGaugeMetric {
unfinished := prometheus.NewGauge(prometheus.GaugeOpts{
Subsystem: name,
Name: "longest_running_processor_microseconds",
Help: "How many microseconds has the longest running " +
"processor for " + name + " been running.",
})
// Upstream has prometheus.Register here
prometheus.MustRegister(unfinished)
return unfinished
}
func (prometheusMetricsProvider) NewRetriesMetric(name string) workqueue.CounterMetric {
retries := prometheus.NewCounter(prometheus.CounterOpts{
Subsystem: name,
Name: "retries",
Help: "Total number of retries handled by workqueue: " + name,
})
// Upstream has prometheus.Register here
prometheus.MustRegister(retries)
return retries
}
func (prometheusMetricsProvider) NewDeprecatedLongestRunningProcessorMicrosecondsMetric(queue string) workqueue.SettableGaugeMetric {
m := prometheus.NewGauge(prometheus.GaugeOpts{
Name: "workqueue_longest_running_processor_microseconds",
Help: "(Deprecated) How many microseconds has the longest running " +
"processor for workqueue been running.",
ConstLabels: prometheus.Labels{"name": queue},
})
prometheus.MustRegister(m)
return m
}
func (prometheusMetricsProvider) NewDeprecatedDepthMetric(queue string) workqueue.GaugeMetric {
return noopMetric{}
}
func (prometheusMetricsProvider) NewDeprecatedAddsMetric(queue string) workqueue.CounterMetric {
return noopMetric{}
}
func (prometheusMetricsProvider) NewDeprecatedLatencyMetric(queue string) workqueue.SummaryMetric {
return noopMetric{}
}
func (prometheusMetricsProvider) NewDeprecatedWorkDurationMetric(queue string) workqueue.SummaryMetric {
return noopMetric{}
}
func (prometheusMetricsProvider) NewDeprecatedUnfinishedWorkSecondsMetric(queue string) workqueue.SettableGaugeMetric {
return noopMetric{}
}
func (prometheusMetricsProvider) NewDeprecatedRetriesMetric(queue string) workqueue.CounterMetric {
return noopMetric{}
}
type noopMetric struct{}
func (noopMetric) Inc() {}
func (noopMetric) Dec() {}
func (noopMetric) Set(float64) {}
func (noopMetric) Observe(float64) {}
| {
"pile_set_name": "Github"
} |
import del from 'del';
import fs from 'fs';
import { getStd, fork, spawn } from './utils';
import path from 'path';
import assert = require('assert');
import extend from 'extend2';
const options = {
silent: true,
env: {
...process.env,
ETS_SILENT: 'false',
ETS_WATCH: 'true',
},
cwd: path.resolve(__dirname, './fixtures/app8'),
};
const runRegister = (opt?: PlainObject) => {
return fork(path.resolve(__dirname, '../register.js'), [], extend(true, {}, options, opt));
};
describe('register.test.ts', () => {
beforeEach(() => {
del.sync(path.resolve(__dirname, './fixtures/app8/typings'), { force: true });
});
it('should not start register if env.ETS_REGISTER_PID is exist', async () => {
const { stdout, stderr } = await getStd(
runRegister({ env: { ETS_REGISTER_PID: '123', DEBUG: 'egg-ts-helper#register' } }),
true,
);
assert(!stdout.includes('create'));
assert(stderr.includes('egg-ts-helper watcher has ran in 123'));
});
it('should works with --require without error', async () => {
const ps = spawn(
'node',
[
'--require',
path.resolve(__dirname, '../register.js'),
path.resolve(__dirname, './fixtures/app8/app/controller/home.js'),
],
options,
);
const { stdout, stderr } = await getStd(ps);
assert(!stderr);
assert(stdout.includes('create'));
assert(stdout.includes('done'));
});
it('should silent when NODE_ENV is test', async () => {
const ps = spawn(
'node',
[
'--require',
path.resolve(__dirname, '../register.js'),
path.resolve(__dirname, './fixtures/app8/app/controller/home.js'),
],
{
...options,
env: {
...process.env,
NODE_ENV: 'test',
},
},
);
const { stdout, stderr } = await getStd(ps);
assert(!stderr);
assert(!stdout.includes('create'));
assert(stdout.includes('done'));
});
it('should auto gen jsconfig in js proj', async () => {
const appPath = path.resolve(__dirname, './fixtures/app10');
const jsConfigPath = path.resolve(appPath, './jsconfig.json');
del.sync(jsConfigPath);
const { stderr } = await getStd(runRegister({ cwd: appPath }));
assert(!stderr);
assert(fs.existsSync(jsConfigPath));
});
it('should not cover exists jsconfig.json in js proj', async () => {
const appPath = path.resolve(__dirname, './fixtures/app11');
const jsConfigPath = path.resolve(appPath, './jsconfig.json');
const { stderr } = await getStd(runRegister({ cwd: appPath }));
assert(!stderr);
assert(fs.existsSync(jsConfigPath));
assert(!!JSON.parse(fs.readFileSync(jsConfigPath).toString()).mySpecConfig);
});
});
| {
"pile_set_name": "Github"
} |
/*
*
* Copyright (C) 1998-2005, OFFIS
*
* This software and supporting documentation were developed by
*
* Kuratorium OFFIS e.V.
* Healthcare Information and Communication Systems
* Escherweg 2
* D-26121 Oldenburg, Germany
*
* THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND OFFIS MAKES NO WARRANTY
* REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR
* FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR
* ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND
* PERFORMANCE OF THE SOFTWARE IS WITH THE USER.
*
* Module: dcmnet
*
* Author: Marco Eichelberg
*
* Purpose:
* classes: DcmTransportConnection, DcmTCPConnection
*
* Last Update: $Author: lpysher $
* Update Date: $Date: 2006/03/01 20:15:49 $
* CVS/RCS Revision: $Revision: 1.1 $
* Status: $State: Exp $
*
* CVS/RCS Log at end of file
*
*/
#include "osconfig.h" /* make sure OS specific configuration is included first */
#include "dcmtrans.h"
#include "dcompat.h" /* compatibility code for certain Unix dialects such as SunOS */
#define INCLUDE_CSTDLIB
#define INCLUDE_CSTDIO
#define INCLUDE_CSTRING
#define INCLUDE_CTIME
#define INCLUDE_CERRNO
#define INCLUDE_CSIGNAL
#include "ofstdinc.h"
BEGIN_EXTERN_C
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
END_EXTERN_C
#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif
#ifdef HAVE_GUSI_H
#include <GUSI.h> /* Use the Grand Unified Sockets Interface (GUSI) on Macintosh */
#endif
DcmTransportConnection::DcmTransportConnection(int openSocket)
: theSocket(openSocket)
{
}
DcmTransportConnection::~DcmTransportConnection()
{
}
OFBool DcmTransportConnection::safeSelectReadableAssociation(DcmTransportConnection *connections[], int connCount, int timeout)
{
int numberOfRounds = timeout+1;
if (numberOfRounds < 0) numberOfRounds = 0xFFFF; /* a long time */
OFBool found = OFFalse;
OFBool firstRound = OFTrue;
int timeToWait=0;
int i=0;
while ((numberOfRounds > 0)&&(! found))
{
if (firstRound)
{
timeToWait = 0;
firstRound = OFFalse;
}
else timeToWait = 1;
for (i=0; i<connCount; i++)
{
if (connections[i])
{
if (connections[i]->networkDataAvailable(timeToWait))
{
i = connCount; /* break out of for loop */
found = OFTrue; /* break out of while loop */
}
timeToWait = 0;
}
} /* for */
if (timeToWait == 1) return OFFalse; /* all entries NULL */
numberOfRounds--;
} /* while */
/* number of rounds == 0 (timeout over), do final check */
found = OFFalse;
for (i=0; i<connCount; i++)
{
if (connections[i])
{
if (connections[i]->networkDataAvailable(0)) found = OFTrue; else connections[i]=NULL;
}
}
return found;
}
OFBool DcmTransportConnection::fastSelectReadableAssociation(DcmTransportConnection *connections[], int connCount, int timeout)
{
int socketfd = -1;
int maxsocketfd = -1;
int i=0;
struct timeval t;
fd_set fdset;
FD_ZERO(&fdset);
t.tv_sec = timeout;
t.tv_usec = 0;
for (i=0; i<connCount; i++)
{
if (connections[i])
{
socketfd = connections[i]->getSocket();
#ifdef __MINGW32__
// on MinGW, FD_SET expects an unsigned first argument
FD_SET((unsigned int)socketfd, &fdset);
#else
FD_SET(socketfd, &fdset);
#endif
if (socketfd > maxsocketfd) maxsocketfd = socketfd;
}
}
#ifdef HAVE_INTP_SELECT
int nfound = select(maxsocketfd + 1, (int *)(&fdset), NULL, NULL, &t);
#else
int nfound = select(maxsocketfd + 1, &fdset, NULL, NULL, &t);
#endif
if (nfound<=0) return OFFalse; /* none available for reading */
for (i=0; i<connCount; i++)
{
if (connections[i])
{
socketfd = connections[i]->getSocket();
/* if not available, set entry in array to NULL */
if (!FD_ISSET(socketfd, &fdset)) connections[i] = NULL;
}
}
return OFTrue;
}
OFBool DcmTransportConnection::selectReadableAssociation(DcmTransportConnection *connections[], int connCount, int timeout)
{
OFBool canUseFastMode = OFTrue;
for (int i=0; i<connCount; i++)
{
if ((connections[i]) && (! connections[i]->isTransparentConnection())) canUseFastMode = OFFalse;
}
if (canUseFastMode) return fastSelectReadableAssociation(connections, connCount, timeout);
return safeSelectReadableAssociation(connections, connCount, timeout);
}
/* ================================================ */
DcmTCPConnection::DcmTCPConnection(int openSocket)
: DcmTransportConnection(openSocket)
{
}
DcmTCPConnection::~DcmTCPConnection()
{
}
DcmTransportLayerStatus DcmTCPConnection::serverSideHandshake()
{
return TCS_ok;
}
DcmTransportLayerStatus DcmTCPConnection::clientSideHandshake()
{
return TCS_ok;
}
DcmTransportLayerStatus DcmTCPConnection::renegotiate(const char * /* newSuite */ )
{
return TCS_ok;
}
ssize_t DcmTCPConnection::read(void *buf, size_t nbyte)
{
#ifdef HAVE_WINSOCK_H
return recv(getSocket(), (char *)buf, nbyte, 0);
#else
return ::read(getSocket(), (char *)buf, nbyte);
#endif
}
ssize_t DcmTCPConnection::write(void *buf, size_t nbyte)
{
#ifdef HAVE_WINSOCK_H
return send(getSocket(), (char *)buf, nbyte, 0);
#else
return ::write(getSocket(), (char *)buf, nbyte);
#endif
}
void DcmTCPConnection::close()
{
#ifdef HAVE_WINSOCK_H
(void) shutdown(getSocket(), 1 /* SD_SEND */);
(void) closesocket(getSocket());
#else
(void) ::close(getSocket());
#endif
}
unsigned int DcmTCPConnection::getPeerCertificateLength()
{
return 0;
}
unsigned int DcmTCPConnection::getPeerCertificate(void * /* buf */ , unsigned int /* bufLen */ )
{
return 0;
}
OFBool DcmTCPConnection::networkDataAvailable(int timeout)
{
struct timeval t;
fd_set fdset;
int nfound;
FD_ZERO(&fdset);
#ifdef __MINGW32__
// on MinGW, FD_SET expects an unsigned first argument
FD_SET((unsigned int) getSocket(), &fdset);
#else
FD_SET(getSocket(), &fdset);
#endif
t.tv_sec = timeout;
t.tv_usec = 0;
#ifdef HAVE_INTP_SELECT
nfound = select(getSocket() + 1, (int *)(&fdset), NULL, NULL, &t);
#else
nfound = select(getSocket() + 1, &fdset, NULL, NULL, &t);
#endif
if (nfound <= 0) return OFFalse;
else
{
if (FD_ISSET(getSocket(), &fdset)) return OFTrue;
else return OFFalse; /* This should not really happen */
}
}
OFBool DcmTCPConnection::isTransparentConnection()
{
return OFTrue;
}
void DcmTCPConnection::dumpConnectionParameters(ostream &out)
{
out << "Transport connection: TCP/IP, unencrypted." << endl;
}
const char *DcmTCPConnection::errorString(DcmTransportLayerStatus code)
{
switch (code)
{
case TCS_ok:
return "no error";
/* break; */
case TCS_noConnection:
return "no secure connection in place";
/* break; */
case TCS_tlsError:
return "TLS error";
/* break; */
case TCS_illegalCall:
return "illegal call";
/* break; */
case TCS_unspecifiedError:
return "unspecified error";
/* break; */
}
return "unknown error code";
}
/*
* $Log: dcmtrans.cc,v $
* Revision 1.1 2006/03/01 20:15:49 lpysher
* Added dcmtkt ocvs not in xcode and fixed bug with multiple monitors
*
* Revision 1.9 2005/12/08 15:44:35 meichel
* Changed include path schema for all DCMTK header files
*
* Revision 1.8 2003/07/03 14:21:10 meichel
* Added special handling for FD_SET() on MinGW, which expects an
* unsigned first argument.
*
* Revision 1.7 2002/11/27 13:04:38 meichel
* Adapted module dcmnet to use of new header file ofstdinc.h
*
* Revision 1.6 2001/06/01 15:50:05 meichel
* Updated copyright header
*
* Revision 1.5 2000/12/12 16:44:49 meichel
* Minor changes to keep gcc 2.7.x on SunOS 4.1.3 happy
*
* Revision 1.4 2000/10/10 12:06:56 meichel
* Updated transport layer error codes and routines for printing
* connection parameters.
*
* Revision 1.3 2000/09/05 16:52:41 joergr
* Removed unnecessary '#ifdef HAVE_WINDOWS_H' statements.
*
* Revision 1.2 2000/09/05 15:24:18 joergr
* Adapted source code to compile on Windows (MSVC++ 5.0).
*
* Revision 1.1 2000/08/10 14:50:56 meichel
* Added initial OpenSSL support.
*
*
*/
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Auto-imported from Gecko test 448111-1.html</title>
<link rel="author" title="Boris Zbarsky" href="mailto:[email protected]"/>
<link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes"/>
<meta name="flags" content='dom'/>
</head>
<body>
<p>There should be no red below, except for antialiasing issues.</p>
<div style="position: relative; font-size: 2em;">
<div style="position: relative; z-index: 1; color: red; padding: 1px;">
<table border="1"><tr>
<td style="float: left; height: 200px">
<script type="text/javascript">v = document.body.offsetHeight;</script>
</td>
<td style="float: right">
Right
</td></tr>
</table>
</div>
<div style="position: absolute; z-index: 2; top: 0; color: green; padding: 1px;">
<table border="1"><tr>
<td style="float: left; height: 200px">
</td>
<td style="float: right">
Right
</td></tr>
</table>
</div>
</div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
/***********************************************************************
* Software License Agreement (BSD License)
*
* Copyright 2008-2009 Marius Muja ([email protected]). All rights reserved.
* Copyright 2008-2009 David G. Lowe ([email protected]). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
*************************************************************************/
#include "flann/flann.hpp"
| {
"pile_set_name": "Github"
} |
/*
* @Author: 小粽子
* @Date: 2017-12-11 20:50:41
* @Last Modified by: 小粽子
* @Last Modified time: 2017-12-11 20:50:41
*/
const merge = require('webpack-merge');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const common = require('./webpack.common.js');
module.exports = merge(common, {
plugins: [new UglifyJSPlugin()]
}); | {
"pile_set_name": "Github"
} |
/***************************************************************************
* Copyright (C) 2011 by Mauro Gamba <[email protected]> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef OPENOCD_JTAG_DRIVERS_LIBUSB_COMMON_H
#define OPENOCD_JTAG_DRIVERS_LIBUSB_COMMON_H
#ifdef HAVE_LIBUSB1
#include "libusb1_common.h"
#else
#include "libusb0_common.h"
#endif
#endif /* OPENOCD_JTAG_DRIVERS_LIBUSB_COMMON_H */
| {
"pile_set_name": "Github"
} |
Description: fix denial of service and possible code execution via
stack overflows in File Transfer feature
Origin: backport, https://github.com/newsoft/libvncserver/commit/06ccdf016154fde8eccb5355613ba04c59127b2e
Origin: backport, https://github.com/newsoft/libvncserver/commit/f528072216dec01cee7ca35d94e171a3b909e677
Origin: backport, https://github.com/newsoft/libvncserver/commit/256964b884c980038cd8b2f0d180fbb295b1c748
Signed-off-by: Gustavo Zacarias <[email protected]>
Index: libvncserver-0.9.9+dfsg/libvncserver/rfbserver.c
===================================================================
--- libvncserver-0.9.9+dfsg.orig/libvncserver/rfbserver.c 2014-09-25 11:20:22.972070915 -0400
+++ libvncserver-0.9.9+dfsg/libvncserver/rfbserver.c 2014-09-25 11:20:40.368071381 -0400
@@ -1237,21 +1237,35 @@
#define RFB_FILE_ATTRIBUTE_TEMPORARY 0x100
#define RFB_FILE_ATTRIBUTE_COMPRESSED 0x800
-rfbBool rfbFilenameTranslate2UNIX(rfbClientPtr cl, char *path, char *unixPath)
+rfbBool rfbFilenameTranslate2UNIX(rfbClientPtr cl, /* in */ char *path, /* out */ char *unixPath, size_t unixPathMaxLen )
{
int x;
char *home=NULL;
FILEXFER_ALLOWED_OR_CLOSE_AND_RETURN("", cl, FALSE);
+ /*
+ * Do not use strncpy() - truncating the file name would probably have undesirable side effects
+ * Instead check if destination buffer is big enough
+ */
+
+ if (strlen(path) >= unixPathMaxLen)
+ return FALSE;
+
/* C: */
if (path[0]=='C' && path[1]==':')
+ {
strcpy(unixPath, &path[2]);
+ }
else
{
home = getenv("HOME");
if (home!=NULL)
{
+ /* Re-check buffer size */
+ if ((strlen(path) + strlen(home) + 1) >= unixPathMaxLen)
+ return FALSE;
+
strcpy(unixPath, home);
strcat(unixPath,"/");
strcat(unixPath, path);
@@ -1289,7 +1303,8 @@
FILEXFER_ALLOWED_OR_CLOSE_AND_RETURN("", cl, FALSE);
/* Client thinks we are Winblows */
- rfbFilenameTranslate2UNIX(cl, buffer, path);
+ if (!rfbFilenameTranslate2UNIX(cl, buffer, path, sizeof(path)))
+ return FALSE;
if (DB) rfbLog("rfbProcessFileTransfer() rfbDirContentRequest: rfbRDirContent: \"%s\"->\"%s\"\n",buffer, path);
@@ -1566,7 +1581,9 @@
/* add some space to the end of the buffer as we will be adding a timespec to it */
if ((buffer = rfbProcessFileTransferReadBuffer(cl, length))==NULL) return FALSE;
/* The client requests a File */
- rfbFilenameTranslate2UNIX(cl, buffer, filename1);
+ if (!rfbFilenameTranslate2UNIX(cl, buffer, filename1, sizeof(filename1)))
+ goto fail;
+
cl->fileTransfer.fd=open(filename1, O_RDONLY, 0744);
/*
@@ -1660,16 +1677,17 @@
*/
if ((buffer = rfbProcessFileTransferReadBuffer(cl, length))==NULL) return FALSE;
- /* Parse the FileTime */
+ /* Parse the FileTime
+ * TODO: FileTime is actually never used afterwards
+ */
p = strrchr(buffer, ',');
if (p!=NULL) {
*p = '\0';
- strcpy(szFileTime, p+1);
+ strncpy(szFileTime, p+1, sizeof(szFileTime));
+ szFileTime[sizeof(szFileTime)-1] = '\x00'; /* ensure NULL terminating byte is present, even if copy overflowed */
} else
szFileTime[0]=0;
-
-
/* Need to read in sizeHtmp */
if ((n = rfbReadExact(cl, (char *)&sizeHtmp, 4)) <= 0) {
if (n != 0)
@@ -1681,7 +1699,8 @@
}
sizeHtmp = Swap32IfLE(sizeHtmp);
- rfbFilenameTranslate2UNIX(cl, buffer, filename1);
+ if (!rfbFilenameTranslate2UNIX(cl, buffer, filename1, sizeof(filename1)))
+ goto fail;
/* If the file exists... We can send a rfbFileChecksums back to the client before we send an rfbFileAcceptHeader */
/* TODO: Delta Transfer */
@@ -1810,7 +1829,9 @@
if ((buffer = rfbProcessFileTransferReadBuffer(cl, length))==NULL) return FALSE;
switch (contentParam) {
case rfbCDirCreate: /* Client requests the creation of a directory */
- rfbFilenameTranslate2UNIX(cl, buffer, filename1);
+ if (!rfbFilenameTranslate2UNIX(cl, buffer, filename1, sizeof(filename1)))
+ goto fail;
+
retval = mkdir(filename1, 0755);
if (DB) rfbLog("rfbProcessFileTransfer() rfbCommand: rfbCDirCreate(\"%s\"->\"%s\") %s\n", buffer, filename1, (retval==-1?"Failed":"Success"));
/*
@@ -1819,7 +1840,9 @@
if (buffer!=NULL) free(buffer);
return retval;
case rfbCFileDelete: /* Client requests the deletion of a file */
- rfbFilenameTranslate2UNIX(cl, buffer, filename1);
+ if (!rfbFilenameTranslate2UNIX(cl, buffer, filename1, sizeof(filename1)))
+ goto fail;
+
if (stat(filename1,&statbuf)==0)
{
if (S_ISDIR(statbuf.st_mode))
@@ -1837,8 +1860,12 @@
{
/* Split into 2 filenames ('*' is a seperator) */
*p = '\0';
- rfbFilenameTranslate2UNIX(cl, buffer, filename1);
- rfbFilenameTranslate2UNIX(cl, p+1, filename2);
+ if (!rfbFilenameTranslate2UNIX(cl, buffer, filename1, sizeof(filename1)))
+ goto fail;
+
+ if (!rfbFilenameTranslate2UNIX(cl, p+1, filename2, sizeof(filename2)))
+ goto fail;
+
retval = rename(filename1,filename2);
if (DB) rfbLog("rfbProcessFileTransfer() rfbCommand: rfbCFileRename(\"%s\"->\"%s\" -->> \"%s\"->\"%s\") %s\n", buffer, filename1, p+1, filename2, (retval==-1?"Failed":"Success"));
/*
@@ -1858,6 +1885,10 @@
/* NOTE: don't forget to free(buffer) if you return early! */
if (buffer!=NULL) free(buffer);
return TRUE;
+
+fail:
+ if (buffer!=NULL) free(buffer);
+ return FALSE;
}
/*
| {
"pile_set_name": "Github"
} |
<?php
class DependencyFailureTest extends PHPUnit_Framework_TestCase
{
public function testOne()
{
$this->fail();
}
/**
* @depends testOne
*/
public function testTwo()
{
}
/**
* @depends !clone testTwo
*/
public function testThree()
{
}
/**
* @depends clone testOne
*/
public function testFour()
{
}
}
| {
"pile_set_name": "Github"
} |
(*
* Copyright (c) 2019, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the "hack" directory of this source tree.
*
*)
(* This `.mli` file was generated automatically. It may include extra
definitions that should not actually be exposed to the caller. If you notice
that this interface file is a poor interface, please take a few minutes to
clean it up manually, and then delete this comment once the interface is in
shape. *)
type t = {
pos_lnum: int;
pos_bol: int;
pos_cnum: int;
}
[@@deriving eq]
val pp : Format.formatter -> t -> unit
val compare : t -> t -> int
val dummy : t
val is_dummy : t -> bool
val beg_of_file : t
val of_line_column_offset : line:int -> column:int -> offset:int -> t
val of_lexing_pos : Lexing.position -> t
val of_lnum_bol_cnum : pos_lnum:int -> pos_bol:int -> pos_cnum:int -> t
val offset : t -> int
val line : t -> int
val column : t -> int
val beg_of_line : t -> int
val set_column : int -> t -> t
val line_beg : t -> int * int
val line_column : t -> int * int
val line_column_beg : t -> int * int * int
val line_column_offset : t -> int * int * int
val line_beg_offset : t -> int * int * int
val to_lexing_pos : string -> t -> Lexing.position
| {
"pile_set_name": "Github"
} |
{{- if and .Values.rbac.create (not .Values.rbac.namespaced) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ template "grafana.clusterRoleBindingName" . }}
labels:
{{- include "commonLabels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: {{ template "grafana.serviceAccountName" . }}
namespace: {{ .Values.global.namespace }}
roleRef:
kind: ClusterRole
name: {{ template "grafana.clusterRoleName" . }}
apiGroup: rbac.authorization.k8s.io
{{- end -}}
| {
"pile_set_name": "Github"
} |
# DESCRIPTION
# Verify 3 by 3 columns are dependent
# ENDDESCRIPTION
##\{ textbook_ref_exact("Holt Linear Algebra", "2.3","10") \}
## DBsubject(Linear algebra)
## DBchapter(Euclidean spaces)
## DBsection(Linear independence)
## Institution(Saint Louis University)
## Author(Mike May)
## Level(3)
## TitleText1('Linear Algebra')
## AuthorText1('Holt')
## EditionText1('')
## Section1('2.3')
## Problem1('10')
## KEYWORDS('subspaces')
DOCUMENT();
loadMacros(
"PGstandard.pl",
"PGchoicemacros.pl",
"parserPopUp.pl",
"MathObjects.pl",
"freemanMacros.pl",
"PGcourse.pl"
);
# make sure we're in the context we want
Context("Numeric");
# We start by producing the row reduced matrix.
# This is upper triangular
$red11=1;
$red12=random(1,5,1)*random(-1,1,2);
$red13=random(1,5,1)*random(-1,1,2);
$red21=0;
$red22=1;
$red23=random(1,5,1)*random(-1,1,2);
$red31=0;
$red32=0;
$red33=0;
# Next we produce the scalars that will be used in Gauss elimination.
# This is an lower triangular matrix
$m11=random(1,6,1)*random(-1,1,2);
$m12=0;
$m13=0;
$m21=random(1,5,1)*random(-1,1,2);
$m22=random(1,5,1)*random(-1,1,2);
$m23=0;
$m31=random(1,5,1)*random(-1,1,2);
$m32=random(1,5,1)*random(-1,1,2);
$m33=random(1,5,1)*random(-1,1,2);
# We are ready to produce our matrix A.
$A11=$m11*$red11+$m12*$red21+$m13*$red31;
$A12=$m11*$red12+$m12*$red22+$m13*$red32;
$A13=$m11*$red13+$m12*$red23+$m13*$red33;
$A21=$m21*$red11+$m22*$red21+$m23*$red31;
$A22=$m21*$red12+$m22*$red22+$m23*$red32;
$A23=$m21*$red13+$m22*$red23+$m23*$red33;
$A31=$m31*$red11+$m32*$red21+$m33*$red31;
$A32=$m31*$red12+$m32*$red22+$m33*$red32;
$A33=$m31*$red13+$m32*$red23+$m33*$red33;
# the arguments of PopUp are [list of answers],
# correct answer
$mc = new_multiple_choice();
$mc->qa(
"",
"The columns of \(A\) are linearly dependent."
);
$mc->extra(
"The columns of \(A\) are linearly independent.",
);
$mc->makeLast("We cannot tell if the columns of \(A\) are linearly independent or not.");
TEXT(beginproblem());
$showPartialCorrectAnswers = 0;
Context()->texStrings;
BEGIN_TEXT
\{ textbook_ref_exact("Holt Linear Algebra", "2.3","10") \}
$PAR
Let
\(A =
\left[{\begin{matrix}$A11 & $A12 & $A13 \cr $A21 & $A22 & $A23 \cr
$A31 & $A32 & $A33 \cr \end{matrix}}\right]\).
$PAR
We want to determine if the columns of matrix \(A\) and are linearly independent. To do that we row reduce \(A\).
$PAR
To do this we add \{ans_rule(6)\} times the first row to the second.
$BR
We then add \{ans_rule(6)\} times the first row to the third.
$BR
We then add \{ans_rule(6)\} times the new second row to the new third row.
$BR
We conclude that
$PAR
\{ $mc->print_a() \}
$PAR
END_TEXT
Context()->normalStrings;
$showPartialCorrectAnswers = 1;
ANS(num_cmp(-$m21/$m11));
ANS(num_cmp(-$m31/$m11));
ANS(num_cmp(-$m32/$m22));
ANS( radio_cmp( $mc->correct_ans() ) );
Context()->texStrings;
SOLUTION(EV3(<<'END_SOLUTION'));
$PAR SOLUTION $PAR
Row reducing \(A\) shows us
$PAR
\[\left[{\begin{matrix}$A11 & $A12 & $A13 \cr $A21 & $A22 & $A23 \cr
$A31 & $A32 & $A33 \cr \end{matrix}}\right]\sim
\left[\begin{matrix}$red11 & $red12 & $red13 \cr $red21 & $red22 & $red23 \cr
$red31 & $red32 & $red33 \cr \end{matrix}\right]
\]
$PAR
Since not every column of the reduced matrix has a leading coefficient for some row, we conclude that the columns are linearly dependent.
END_SOLUTION
Context()->normalStrings;
ENDDOCUMENT();
| {
"pile_set_name": "Github"
} |
require_relative '../../spec_helper'
require_relative 'fixtures/classes'
describe "StringIO#print" do
before :each do
@io = StringIO.new('example')
end
it "prints $_ when passed no arguments" do
$_ = nil
@io.print
@io.string.should == "example"
$_ = "blah"
@io.print
@io.string.should == "blahple"
end
it "prints the passed arguments to self" do
@io.print(5, 6, 7, 8)
@io.string.should == "5678ple"
end
it "tries to convert the passed Object to a String using #to_s" do
obj = mock("to_s")
obj.should_receive(:to_s).and_return("to_s")
@io.print(obj)
@io.string.should == "to_sple"
end
it "returns nil" do
@io.print(1, 2, 3).should be_nil
end
it "pads self with \\000 when the current position is after the end" do
@io.pos = 10
@io.print(1, 2, 3)
@io.string.should == "example\000\000\000123"
end
it "honors the output record separator global" do
old_rs = $\
suppress_warning {$\ = 'x'}
begin
@io.print(5, 6, 7, 8)
@io.string.should == '5678xle'
ensure
suppress_warning {$\ = old_rs}
end
end
it "updates the current position" do
@io.print(1, 2, 3)
@io.pos.should eql(3)
@io.print(1, 2, 3)
@io.pos.should eql(6)
end
it "correctly updates the current position when honoring the output record separator global" do
old_rs = $\
suppress_warning {$\ = 'x'}
begin
@io.print(5, 6, 7, 8)
@io.pos.should eql(5)
ensure
suppress_warning {$\ = old_rs}
end
end
end
describe "StringIO#print when in append mode" do
before :each do
@io = StringIO.new("example", "a")
end
it "appends the passed argument to the end of self" do
@io.print(", just testing")
@io.string.should == "example, just testing"
@io.print(" and more testing")
@io.string.should == "example, just testing and more testing"
end
it "correctly updates self's position" do
@io.print(", testing")
@io.pos.should eql(16)
end
end
describe "StringIO#print when self is not writable" do
it "raises an IOError" do
io = StringIO.new("test", "r")
-> { io.print("test") }.should raise_error(IOError)
io = StringIO.new("test")
io.close_write
-> { io.print("test") }.should raise_error(IOError)
end
end
| {
"pile_set_name": "Github"
} |
// Copyright 2015 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#ifndef CEF_LIBCEF_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_H_
#define CEF_LIBCEF_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_H_
#include "base/callback_forward.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/permissions/permission_request_id.h"
#include "components/content_settings/core/common/content_settings.h"
class CefBrowserContext;
namespace content {
enum class PermissionType;
class WebContents;
}; // namespace content
// Based on chrome/browser/permissions/permission_context_base.h
class CefPermissionContext {
public:
explicit CefPermissionContext(CefBrowserContext* profile);
using BrowserPermissionCallback = base::Callback<void(ContentSetting)>;
using PermissionDecidedCallback = base::Callback<void(ContentSetting)>;
// Returns true if support exists for querying the embedder about the
// specified permission type.
bool SupportsPermission(content::PermissionType permission);
// The renderer is requesting permission to push messages.
// When the answer to a permission request has been determined, |callback|
// should be called with the result.
void RequestPermission(content::PermissionType permission,
content::WebContents* web_contents,
const PermissionRequestID& id,
const GURL& requesting_frame,
const BrowserPermissionCallback& callback);
// Withdraw an existing permission request, no op if the permission request
// was already cancelled by some other means.
void CancelPermissionRequest(content::PermissionType permission,
content::WebContents* web_contents,
const PermissionRequestID& id);
// Resets the permission to its default value.
void ResetPermission(content::PermissionType permission,
const GURL& requesting_origin,
const GURL& embedding_origin);
// Returns whether the permission has been granted, denied...
ContentSetting GetPermissionStatus(content::PermissionType permission,
const GURL& requesting_origin,
const GURL& embedding_origin) const;
private:
// Decide whether the permission should be granted.
// Calls PermissionDecided if permission can be decided non-interactively,
// or NotifyPermissionSet if permission decided by presenting an infobar.
void DecidePermission(content::PermissionType permission,
content::WebContents* web_contents,
const PermissionRequestID& id,
const GURL& requesting_origin,
const GURL& embedding_origin,
const BrowserPermissionCallback& callback);
void QueryPermission(content::PermissionType permission,
const PermissionRequestID& id,
const GURL& requesting_origin,
const GURL& embedding_origin,
const PermissionDecidedCallback& callback);
void NotifyPermissionSet(content::PermissionType permission,
const PermissionRequestID& id,
const GURL& requesting_origin,
const GURL& embedding_origin,
const BrowserPermissionCallback& callback,
bool persist,
ContentSetting content_setting);
// Store the decided permission as a content setting.
void UpdateContentSetting(
content::PermissionType permission,
const GURL& requesting_origin,
const GURL& embedding_origin,
ContentSetting content_setting);
CefBrowserContext* profile_;
base::WeakPtrFactory<CefPermissionContext> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefPermissionContext);
};
#endif // CEF_LIBCEF_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_H_
| {
"pile_set_name": "Github"
} |
This project was bootstrapped with [Create React Native App](https://github.com/react-community/create-react-native-app).
Below you'll find information about performing common tasks. The most recent version of this guide is available [here](https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/README.md).
## Table of Contents
* [Updating to New Releases](#updating-to-new-releases)
* [Available Scripts](#available-scripts)
* [npm start](#npm-start)
* [npm test](#npm-test)
* [npm run ios](#npm-run-ios)
* [npm run android](#npm-run-android)
* [npm run eject](#npm-run-eject)
* [Writing and Running Tests](#writing-and-running-tests)
* [Environment Variables](#environment-variables)
* [Configuring Packager IP Address](#configuring-packager-ip-address)
* [Customizing App Display Name and Icon](#customizing-app-display-name-and-icon)
* [Sharing and Deployment](#sharing-and-deployment)
* [Publishing to Expo's React Native Community](#publishing-to-expos-react-native-community)
* [Building an Expo "standalone" app](#building-an-expo-standalone-app)
* [Ejecting from Create React Native App](#ejecting-from-create-react-native-app)
* [Build Dependencies (Xcode & Android Studio)](#build-dependencies-xcode-android-studio)
* [Should I Use ExpoKit?](#should-i-use-expokit)
* [Troubleshooting](#troubleshooting)
* [Networking](#networking)
* [iOS Simulator won't open](#ios-simulator-wont-open)
* [QR Code does not scan](#qr-code-does-not-scan)
## Updating to New Releases
You should only need to update the global installation of `create-react-native-app` very rarely, ideally never.
Updating the `react-native-scripts` dependency of your app should be as simple as bumping the version number in `package.json` and reinstalling your project's dependencies.
Upgrading to a new version of React Native requires updating the `react-native`, `react`, and `expo` package versions, and setting the correct `sdkVersion` in `app.json`. See the [versioning guide](https://github.com/react-community/create-react-native-app/blob/master/VERSIONS.md) for up-to-date information about package version compatibility.
## Available Scripts
If Yarn was installed when the project was initialized, then dependencies will have been installed via Yarn, and you should probably use it to run these commands as well. Unlike dependency installation, command running syntax is identical for Yarn and NPM at the time of this writing.
### `npm start`
Runs your app in development mode.
Open it in the [Expo app](https://expo.io) on your phone to view it. It will reload if you save edits to your files, and you will see build errors and logs in the terminal.
Sometimes you may need to reset or clear the React Native packager's cache. To do so, you can pass the `--reset-cache` flag to the start script:
```
npm start --reset-cache
# or
yarn start --reset-cache
```
#### `npm test`
Runs the [jest](https://github.com/facebook/jest) test runner on your tests.
#### `npm run ios`
Like `npm start`, but also attempts to open your app in the iOS Simulator if you're on a Mac and have it installed.
#### `npm run android`
Like `npm start`, but also attempts to open your app on a connected Android device or emulator. Requires an installation of Android build tools (see [React Native docs](https://facebook.github.io/react-native/docs/getting-started.html) for detailed setup). We also recommend installing Genymotion as your Android emulator. Once you've finished setting up the native build environment, there are two options for making the right copy of `adb` available to Create React Native App:
##### Using Android Studio's `adb`
1. Make sure that you can run adb from your terminal.
2. Open Genymotion and navigate to `Settings -> ADB`. Select “Use custom Android SDK tools” and update with your [Android SDK directory](https://stackoverflow.com/questions/25176594/android-sdk-location).
##### Using Genymotion's `adb`
1. Find Genymotion’s copy of adb. On macOS for example, this is normally `/Applications/Genymotion.app/Contents/MacOS/tools/`.
2. Add the Genymotion tools directory to your path (instructions for [Mac](http://osxdaily.com/2014/08/14/add-new-path-to-path-command-line/), [Linux](http://www.computerhope.com/issues/ch001647.htm), and [Windows](https://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access/)).
3. Make sure that you can run adb from your terminal.
#### `npm run eject`
This will start the process of "ejecting" from Create React Native App's build scripts. You'll be asked a couple of questions about how you'd like to build your project.
**Warning:** Running eject is a permanent action (aside from whatever version control system you use). An ejected app will require you to have an [Xcode and/or Android Studio environment](https://facebook.github.io/react-native/docs/getting-started.html) set up.
## Customizing App Display Name and Icon
You can edit `app.json` to include [configuration keys](https://docs.expo.io/versions/latest/guides/configuration.html) under the `expo` key.
To change your app's display name, set the `expo.name` key in `app.json` to an appropriate string.
To set an app icon, set the `expo.icon` key in `app.json` to be either a local path or a URL. It's recommended that you use a 512x512 png file with transparency.
## Writing and Running Tests
This project is set up to use [jest](https://facebook.github.io/jest/) for tests. You can configure whatever testing strategy you like, but jest works out of the box. Create test files in directories called `__tests__` or with the `.test` extension to have the files loaded by jest. See the [the template project](https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/App.test.js) for an example test. The [jest documentation](https://facebook.github.io/jest/docs/en/getting-started.html) is also a wonderful resource, as is the [React Native testing tutorial](https://facebook.github.io/jest/docs/en/tutorial-react-native.html).
## Environment Variables
You can configure some of Create React Native App's behavior using environment variables.
### Configuring Packager IP Address
When starting your project, you'll see something like this for your project URL:
```
exp://192.168.0.2:19000
```
The "manifest" at that URL tells the Expo app how to retrieve and load your app's JavaScript bundle, so even if you load it in the app via a URL like `exp://localhost:19000`, the Expo client app will still try to retrieve your app at the IP address that the start script provides.
In some cases, this is less than ideal. This might be the case if you need to run your project inside of a virtual machine and you have to access the packager via a different IP address than the one which prints by default. In order to override the IP address or hostname that is detected by Create React Native App, you can specify your own hostname via the `REACT_NATIVE_PACKAGER_HOSTNAME` environment variable:
Mac and Linux:
```
REACT_NATIVE_PACKAGER_HOSTNAME='my-custom-ip-address-or-hostname' npm start
```
Windows:
```
set REACT_NATIVE_PACKAGER_HOSTNAME='my-custom-ip-address-or-hostname'
npm start
```
The above example would cause the development server to listen on `exp://my-custom-ip-address-or-hostname:19000`.
## Sharing and Deployment
Create React Native App does a lot of work to make app setup and development simple and straightforward, but it's very difficult to do the same for deploying to Apple's App Store or Google's Play Store without relying on a hosted service.
### Publishing to Expo's React Native Community
Expo provides free hosting for the JS-only apps created by CRNA, allowing you to share your app through the Expo client app. This requires registration for an Expo account.
Install the `exp` command-line tool, and run the publish command:
```
$ npm i -g exp
$ exp publish
```
### Building an Expo "standalone" app
You can also use a service like [Expo's standalone builds](https://docs.expo.io/versions/latest/guides/building-standalone-apps.html) if you want to get an IPA/APK for distribution without having to build the native code yourself.
### Ejecting from Create React Native App
If you want to build and deploy your app yourself, you'll need to eject from CRNA and use Xcode and Android Studio.
This is usually as simple as running `npm run eject` in your project, which will walk you through the process. Make sure to install `react-native-cli` and follow the [native code getting started guide for React Native](https://facebook.github.io/react-native/docs/getting-started.html).
#### Should I Use ExpoKit?
If you have made use of Expo APIs while working on your project, then those API calls will stop working if you eject to a regular React Native project. If you want to continue using those APIs, you can eject to "React Native + ExpoKit" which will still allow you to build your own native code and continue using the Expo APIs. See the [ejecting guide](https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md) for more details about this option.
## Troubleshooting
### Networking
If you're unable to load your app on your phone due to a network timeout or a refused connection, a good first step is to verify that your phone and computer are on the same network and that they can reach each other. Create React Native App needs access to ports 19000 and 19001 so ensure that your network and firewall settings allow access from your device to your computer on both of these ports.
Try opening a web browser on your phone and opening the URL that the packager script prints, replacing `exp://` with `http://`. So, for example, if underneath the QR code in your terminal you see:
```
exp://192.168.0.1:19000
```
Try opening Safari or Chrome on your phone and loading
```
http://192.168.0.1:19000
```
and
```
http://192.168.0.1:19001
```
If this works, but you're still unable to load your app by scanning the QR code, please open an issue on the [Create React Native App repository](https://github.com/react-community/create-react-native-app) with details about these steps and any other error messages you may have received.
If you're not able to load the `http` URL in your phone's web browser, try using the tethering/mobile hotspot feature on your phone (beware of data usage, though), connecting your computer to that WiFi network, and restarting the packager. If you are using a VPN you may need to disable it.
### iOS Simulator won't open
If you're on a Mac, there are a few errors that users sometimes see when attempting to `npm run ios`:
* "non-zero exit code: 107"
* "You may need to install Xcode" but it is already installed
* and others
There are a few steps you may want to take to troubleshoot these kinds of errors:
1. Make sure Xcode is installed and open it to accept the license agreement if it prompts you. You can install it from the Mac App Store.
2. Open Xcode's Preferences, the Locations tab, and make sure that the `Command Line Tools` menu option is set to something. Sometimes when the CLI tools are first installed by Homebrew this option is left blank, which can prevent Apple utilities from finding the simulator. Make sure to re-run `npm/yarn run ios` after doing so.
3. If that doesn't work, open the Simulator, and under the app menu select `Reset Contents and Settings...`. After that has finished, quit the Simulator, and re-run `npm/yarn run ios`.
### QR Code does not scan
If you're not able to scan the QR code, make sure your phone's camera is focusing correctly, and also make sure that the contrast on the two colors in your terminal is high enough. For example, WebStorm's default themes may [not have enough contrast](https://github.com/react-community/create-react-native-app/issues/49) for terminal QR codes to be scannable with the system barcode scanners that the Expo app uses.
If this causes problems for you, you may want to try changing your terminal's color theme to have more contrast, or running Create React Native App from a different terminal. You can also manually enter the URL printed by the packager script in the Expo app's search bar to load it manually.
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
* VA Linux Systems Inc., Fremont, California.
* Copyright 2008 Red Hat 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, 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
*
* Original Authors:
* Kevin E. Martin, Rickard E. Faith, Alan Hourihane
*
* Kernel port Author: Dave Airlie
*/
#ifndef AMDGPU_MODE_H
#define AMDGPU_MODE_H
#include <drm/drm_crtc.h>
#include <drm/drm_edid.h>
#include <drm/drm_encoder.h>
#include <drm/drm_dp_helper.h>
#include <drm/drm_fixed.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_plane_helper.h>
#include <drm/drm_probe_helper.h>
#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>
#include <linux/hrtimer.h>
#include "amdgpu_irq.h"
#include <drm/drm_dp_mst_helper.h>
#include "modules/inc/mod_freesync.h"
struct amdgpu_bo;
struct amdgpu_device;
struct amdgpu_encoder;
struct amdgpu_router;
struct amdgpu_hpd;
#define to_amdgpu_crtc(x) container_of(x, struct amdgpu_crtc, base)
#define to_amdgpu_connector(x) container_of(x, struct amdgpu_connector, base)
#define to_amdgpu_encoder(x) container_of(x, struct amdgpu_encoder, base)
#define to_amdgpu_framebuffer(x) container_of(x, struct amdgpu_framebuffer, base)
#define to_dm_plane_state(x) container_of(x, struct dm_plane_state, base)
#define AMDGPU_MAX_HPD_PINS 6
#define AMDGPU_MAX_CRTCS 6
#define AMDGPU_MAX_PLANES 6
#define AMDGPU_MAX_AFMT_BLOCKS 9
enum amdgpu_rmx_type {
RMX_OFF,
RMX_FULL,
RMX_CENTER,
RMX_ASPECT
};
enum amdgpu_underscan_type {
UNDERSCAN_OFF,
UNDERSCAN_ON,
UNDERSCAN_AUTO,
};
#define AMDGPU_HPD_CONNECT_INT_DELAY_IN_MS 50
#define AMDGPU_HPD_DISCONNECT_INT_DELAY_IN_MS 10
enum amdgpu_hpd_id {
AMDGPU_HPD_1 = 0,
AMDGPU_HPD_2,
AMDGPU_HPD_3,
AMDGPU_HPD_4,
AMDGPU_HPD_5,
AMDGPU_HPD_6,
AMDGPU_HPD_NONE = 0xff,
};
enum amdgpu_crtc_irq {
AMDGPU_CRTC_IRQ_VBLANK1 = 0,
AMDGPU_CRTC_IRQ_VBLANK2,
AMDGPU_CRTC_IRQ_VBLANK3,
AMDGPU_CRTC_IRQ_VBLANK4,
AMDGPU_CRTC_IRQ_VBLANK5,
AMDGPU_CRTC_IRQ_VBLANK6,
AMDGPU_CRTC_IRQ_VLINE1,
AMDGPU_CRTC_IRQ_VLINE2,
AMDGPU_CRTC_IRQ_VLINE3,
AMDGPU_CRTC_IRQ_VLINE4,
AMDGPU_CRTC_IRQ_VLINE5,
AMDGPU_CRTC_IRQ_VLINE6,
AMDGPU_CRTC_IRQ_NONE = 0xff
};
enum amdgpu_pageflip_irq {
AMDGPU_PAGEFLIP_IRQ_D1 = 0,
AMDGPU_PAGEFLIP_IRQ_D2,
AMDGPU_PAGEFLIP_IRQ_D3,
AMDGPU_PAGEFLIP_IRQ_D4,
AMDGPU_PAGEFLIP_IRQ_D5,
AMDGPU_PAGEFLIP_IRQ_D6,
AMDGPU_PAGEFLIP_IRQ_NONE = 0xff
};
enum amdgpu_flip_status {
AMDGPU_FLIP_NONE,
AMDGPU_FLIP_PENDING,
AMDGPU_FLIP_SUBMITTED
};
#define AMDGPU_MAX_I2C_BUS 16
/* amdgpu gpio-based i2c
* 1. "mask" reg and bits
* grabs the gpio pins for software use
* 0=not held 1=held
* 2. "a" reg and bits
* output pin value
* 0=low 1=high
* 3. "en" reg and bits
* sets the pin direction
* 0=input 1=output
* 4. "y" reg and bits
* input pin value
* 0=low 1=high
*/
struct amdgpu_i2c_bus_rec {
bool valid;
/* id used by atom */
uint8_t i2c_id;
/* id used by atom */
enum amdgpu_hpd_id hpd;
/* can be used with hw i2c engine */
bool hw_capable;
/* uses multi-media i2c engine */
bool mm_i2c;
/* regs and bits */
uint32_t mask_clk_reg;
uint32_t mask_data_reg;
uint32_t a_clk_reg;
uint32_t a_data_reg;
uint32_t en_clk_reg;
uint32_t en_data_reg;
uint32_t y_clk_reg;
uint32_t y_data_reg;
uint32_t mask_clk_mask;
uint32_t mask_data_mask;
uint32_t a_clk_mask;
uint32_t a_data_mask;
uint32_t en_clk_mask;
uint32_t en_data_mask;
uint32_t y_clk_mask;
uint32_t y_data_mask;
};
#define AMDGPU_MAX_BIOS_CONNECTOR 16
/* pll flags */
#define AMDGPU_PLL_USE_BIOS_DIVS (1 << 0)
#define AMDGPU_PLL_NO_ODD_POST_DIV (1 << 1)
#define AMDGPU_PLL_USE_REF_DIV (1 << 2)
#define AMDGPU_PLL_LEGACY (1 << 3)
#define AMDGPU_PLL_PREFER_LOW_REF_DIV (1 << 4)
#define AMDGPU_PLL_PREFER_HIGH_REF_DIV (1 << 5)
#define AMDGPU_PLL_PREFER_LOW_FB_DIV (1 << 6)
#define AMDGPU_PLL_PREFER_HIGH_FB_DIV (1 << 7)
#define AMDGPU_PLL_PREFER_LOW_POST_DIV (1 << 8)
#define AMDGPU_PLL_PREFER_HIGH_POST_DIV (1 << 9)
#define AMDGPU_PLL_USE_FRAC_FB_DIV (1 << 10)
#define AMDGPU_PLL_PREFER_CLOSEST_LOWER (1 << 11)
#define AMDGPU_PLL_USE_POST_DIV (1 << 12)
#define AMDGPU_PLL_IS_LCD (1 << 13)
#define AMDGPU_PLL_PREFER_MINM_OVER_MAXP (1 << 14)
struct amdgpu_pll {
/* reference frequency */
uint32_t reference_freq;
/* fixed dividers */
uint32_t reference_div;
uint32_t post_div;
/* pll in/out limits */
uint32_t pll_in_min;
uint32_t pll_in_max;
uint32_t pll_out_min;
uint32_t pll_out_max;
uint32_t lcd_pll_out_min;
uint32_t lcd_pll_out_max;
uint32_t best_vco;
/* divider limits */
uint32_t min_ref_div;
uint32_t max_ref_div;
uint32_t min_post_div;
uint32_t max_post_div;
uint32_t min_feedback_div;
uint32_t max_feedback_div;
uint32_t min_frac_feedback_div;
uint32_t max_frac_feedback_div;
/* flags for the current clock */
uint32_t flags;
/* pll id */
uint32_t id;
};
struct amdgpu_i2c_chan {
struct i2c_adapter adapter;
struct drm_device *dev;
struct i2c_algo_bit_data bit;
struct amdgpu_i2c_bus_rec rec;
struct drm_dp_aux aux;
bool has_aux;
struct mutex mutex;
};
struct amdgpu_fbdev;
struct amdgpu_afmt {
bool enabled;
int offset;
bool last_buffer_filled_status;
int id;
struct amdgpu_audio_pin *pin;
};
/*
* Audio
*/
struct amdgpu_audio_pin {
int channels;
int rate;
int bits_per_sample;
u8 status_bits;
u8 category_code;
u32 offset;
bool connected;
u32 id;
};
struct amdgpu_audio {
bool enabled;
struct amdgpu_audio_pin pin[AMDGPU_MAX_AFMT_BLOCKS];
int num_pins;
};
struct amdgpu_display_funcs {
/* display watermarks */
void (*bandwidth_update)(struct amdgpu_device *adev);
/* get frame count */
u32 (*vblank_get_counter)(struct amdgpu_device *adev, int crtc);
/* set backlight level */
void (*backlight_set_level)(struct amdgpu_encoder *amdgpu_encoder,
u8 level);
/* get backlight level */
u8 (*backlight_get_level)(struct amdgpu_encoder *amdgpu_encoder);
/* hotplug detect */
bool (*hpd_sense)(struct amdgpu_device *adev, enum amdgpu_hpd_id hpd);
void (*hpd_set_polarity)(struct amdgpu_device *adev,
enum amdgpu_hpd_id hpd);
u32 (*hpd_get_gpio_reg)(struct amdgpu_device *adev);
/* pageflipping */
void (*page_flip)(struct amdgpu_device *adev,
int crtc_id, u64 crtc_base, bool async);
int (*page_flip_get_scanoutpos)(struct amdgpu_device *adev, int crtc,
u32 *vbl, u32 *position);
/* display topology setup */
void (*add_encoder)(struct amdgpu_device *adev,
uint32_t encoder_enum,
uint32_t supported_device,
u16 caps);
void (*add_connector)(struct amdgpu_device *adev,
uint32_t connector_id,
uint32_t supported_device,
int connector_type,
struct amdgpu_i2c_bus_rec *i2c_bus,
uint16_t connector_object_id,
struct amdgpu_hpd *hpd,
struct amdgpu_router *router);
};
struct amdgpu_framebuffer {
struct drm_framebuffer base;
/* caching for later use */
uint64_t address;
};
struct amdgpu_fbdev {
struct drm_fb_helper helper;
struct amdgpu_framebuffer rfb;
struct list_head fbdev_list;
struct amdgpu_device *adev;
};
struct amdgpu_mode_info {
struct atom_context *atom_context;
struct card_info *atom_card_info;
bool mode_config_initialized;
struct amdgpu_crtc *crtcs[AMDGPU_MAX_CRTCS];
struct drm_plane *planes[AMDGPU_MAX_PLANES];
struct amdgpu_afmt *afmt[AMDGPU_MAX_AFMT_BLOCKS];
/* DVI-I properties */
struct drm_property *coherent_mode_property;
/* DAC enable load detect */
struct drm_property *load_detect_property;
/* underscan */
struct drm_property *underscan_property;
struct drm_property *underscan_hborder_property;
struct drm_property *underscan_vborder_property;
/* audio */
struct drm_property *audio_property;
/* FMT dithering */
struct drm_property *dither_property;
/* Adaptive Backlight Modulation (power feature) */
struct drm_property *abm_level_property;
/* hardcoded DFP edid from BIOS */
struct edid *bios_hardcoded_edid;
int bios_hardcoded_edid_size;
/* pointer to fbdev info structure */
struct amdgpu_fbdev *rfbdev;
/* firmware flags */
u16 firmware_flags;
/* pointer to backlight encoder */
struct amdgpu_encoder *bl_encoder;
u8 bl_level; /* saved backlight level */
struct amdgpu_audio audio; /* audio stuff */
int num_crtc; /* number of crtcs */
int num_hpd; /* number of hpd pins */
int num_dig; /* number of dig blocks */
int disp_priority;
const struct amdgpu_display_funcs *funcs;
const enum drm_plane_type *plane_type;
};
#define AMDGPU_MAX_BL_LEVEL 0xFF
#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
struct amdgpu_backlight_privdata {
struct amdgpu_encoder *encoder;
uint8_t negative;
};
#endif
struct amdgpu_atom_ss {
uint16_t percentage;
uint16_t percentage_divider;
uint8_t type;
uint16_t step;
uint8_t delay;
uint8_t range;
uint8_t refdiv;
/* asic_ss */
uint16_t rate;
uint16_t amount;
};
struct amdgpu_crtc {
struct drm_crtc base;
int crtc_id;
bool enabled;
bool can_tile;
uint32_t crtc_offset;
struct drm_gem_object *cursor_bo;
uint64_t cursor_addr;
int cursor_x;
int cursor_y;
int cursor_hot_x;
int cursor_hot_y;
int cursor_width;
int cursor_height;
int max_cursor_width;
int max_cursor_height;
enum amdgpu_rmx_type rmx_type;
u8 h_border;
u8 v_border;
fixed20_12 vsc;
fixed20_12 hsc;
struct drm_display_mode native_mode;
u32 pll_id;
/* page flipping */
struct amdgpu_flip_work *pflip_works;
enum amdgpu_flip_status pflip_status;
int deferred_flip_completion;
u32 last_flip_vblank;
/* pll sharing */
struct amdgpu_atom_ss ss;
bool ss_enabled;
u32 adjusted_clock;
int bpc;
u32 pll_reference_div;
u32 pll_post_div;
u32 pll_flags;
struct drm_encoder *encoder;
struct drm_connector *connector;
/* for dpm */
u32 line_time;
u32 wm_low;
u32 wm_high;
u32 lb_vblank_lead_lines;
struct drm_display_mode hw_mode;
/* for virtual dce */
struct hrtimer vblank_timer;
enum amdgpu_interrupt_state vsync_timer_enabled;
int otg_inst;
struct drm_pending_vblank_event *event;
};
struct amdgpu_encoder_atom_dig {
bool linkb;
/* atom dig */
bool coherent_mode;
int dig_encoder; /* -1 disabled, 0 DIGA, 1 DIGB, etc. */
/* atom lvds/edp */
uint32_t lcd_misc;
uint16_t panel_pwr_delay;
uint32_t lcd_ss_id;
/* panel mode */
struct drm_display_mode native_mode;
struct backlight_device *bl_dev;
int dpms_mode;
uint8_t backlight_level;
int panel_mode;
struct amdgpu_afmt *afmt;
};
struct amdgpu_encoder {
struct drm_encoder base;
uint32_t encoder_enum;
uint32_t encoder_id;
uint32_t devices;
uint32_t active_device;
uint32_t flags;
uint32_t pixel_clock;
enum amdgpu_rmx_type rmx_type;
enum amdgpu_underscan_type underscan_type;
uint32_t underscan_hborder;
uint32_t underscan_vborder;
struct drm_display_mode native_mode;
void *enc_priv;
int audio_polling_active;
bool is_ext_encoder;
u16 caps;
};
struct amdgpu_connector_atom_dig {
/* displayport */
u8 dpcd[DP_RECEIVER_CAP_SIZE];
u8 dp_sink_type;
int dp_clock;
int dp_lane_count;
bool edp_on;
};
struct amdgpu_gpio_rec {
bool valid;
u8 id;
u32 reg;
u32 mask;
u32 shift;
};
struct amdgpu_hpd {
enum amdgpu_hpd_id hpd;
u8 plugged_state;
struct amdgpu_gpio_rec gpio;
};
struct amdgpu_router {
u32 router_id;
struct amdgpu_i2c_bus_rec i2c_info;
u8 i2c_addr;
/* i2c mux */
bool ddc_valid;
u8 ddc_mux_type;
u8 ddc_mux_control_pin;
u8 ddc_mux_state;
/* clock/data mux */
bool cd_valid;
u8 cd_mux_type;
u8 cd_mux_control_pin;
u8 cd_mux_state;
};
enum amdgpu_connector_audio {
AMDGPU_AUDIO_DISABLE = 0,
AMDGPU_AUDIO_ENABLE = 1,
AMDGPU_AUDIO_AUTO = 2
};
enum amdgpu_connector_dither {
AMDGPU_FMT_DITHER_DISABLE = 0,
AMDGPU_FMT_DITHER_ENABLE = 1,
};
struct amdgpu_dm_dp_aux {
struct drm_dp_aux aux;
struct ddc_service *ddc_service;
};
struct amdgpu_i2c_adapter {
struct i2c_adapter base;
struct ddc_service *ddc_service;
};
#define TO_DM_AUX(x) container_of((x), struct amdgpu_dm_dp_aux, aux)
struct amdgpu_connector {
struct drm_connector base;
uint32_t connector_id;
uint32_t devices;
struct amdgpu_i2c_chan *ddc_bus;
/* some systems have an hdmi and vga port with a shared ddc line */
bool shared_ddc;
bool use_digital;
/* we need to mind the EDID between detect
and get modes due to analog/digital/tvencoder */
struct edid *edid;
void *con_priv;
bool dac_load_detect;
bool detected_by_load; /* if the connection status was determined by load */
uint16_t connector_object_id;
struct amdgpu_hpd hpd;
struct amdgpu_router router;
struct amdgpu_i2c_chan *router_bus;
enum amdgpu_connector_audio audio;
enum amdgpu_connector_dither dither;
unsigned pixelclock_for_modeset;
};
/* TODO: start to use this struct and remove same field from base one */
struct amdgpu_mst_connector {
struct amdgpu_connector base;
struct drm_dp_mst_topology_mgr mst_mgr;
struct amdgpu_dm_dp_aux dm_dp_aux;
struct drm_dp_mst_port *port;
struct amdgpu_connector *mst_port;
bool is_mst_connector;
struct amdgpu_encoder *mst_encoder;
};
#define ENCODER_MODE_IS_DP(em) (((em) == ATOM_ENCODER_MODE_DP) || \
((em) == ATOM_ENCODER_MODE_DP_MST))
/* Driver internal use only flags of amdgpu_display_get_crtc_scanoutpos() */
#define DRM_SCANOUTPOS_VALID (1 << 0)
#define DRM_SCANOUTPOS_IN_VBLANK (1 << 1)
#define DRM_SCANOUTPOS_ACCURATE (1 << 2)
#define USE_REAL_VBLANKSTART (1 << 30)
#define GET_DISTANCE_TO_VBLANKSTART (1 << 31)
void amdgpu_link_encoder_connector(struct drm_device *dev);
struct drm_connector *
amdgpu_get_connector_for_encoder(struct drm_encoder *encoder);
struct drm_connector *
amdgpu_get_connector_for_encoder_init(struct drm_encoder *encoder);
bool amdgpu_dig_monitor_is_duallink(struct drm_encoder *encoder,
u32 pixel_clock);
u16 amdgpu_encoder_get_dp_bridge_encoder_id(struct drm_encoder *encoder);
struct drm_encoder *amdgpu_get_external_encoder(struct drm_encoder *encoder);
bool amdgpu_display_ddc_probe(struct amdgpu_connector *amdgpu_connector,
bool use_aux);
void amdgpu_encoder_set_active_device(struct drm_encoder *encoder);
int amdgpu_display_get_crtc_scanoutpos(struct drm_device *dev,
unsigned int pipe, unsigned int flags, int *vpos,
int *hpos, ktime_t *stime, ktime_t *etime,
const struct drm_display_mode *mode);
int amdgpu_display_framebuffer_init(struct drm_device *dev,
struct amdgpu_framebuffer *rfb,
const struct drm_mode_fb_cmd2 *mode_cmd,
struct drm_gem_object *obj);
int amdgpufb_remove(struct drm_device *dev, struct drm_framebuffer *fb);
void amdgpu_enc_destroy(struct drm_encoder *encoder);
void amdgpu_copy_fb(struct drm_device *dev, struct drm_gem_object *dst_obj);
bool amdgpu_display_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode);
void amdgpu_panel_mode_fixup(struct drm_encoder *encoder,
struct drm_display_mode *adjusted_mode);
int amdgpu_display_crtc_idx_to_irq_type(struct amdgpu_device *adev, int crtc);
/* fbdev layer */
int amdgpu_fbdev_init(struct amdgpu_device *adev);
void amdgpu_fbdev_fini(struct amdgpu_device *adev);
void amdgpu_fbdev_set_suspend(struct amdgpu_device *adev, int state);
int amdgpu_fbdev_total_size(struct amdgpu_device *adev);
bool amdgpu_fbdev_robj_is_fb(struct amdgpu_device *adev, struct amdgpu_bo *robj);
int amdgpu_align_pitch(struct amdgpu_device *adev, int width, int bpp, bool tiled);
/* amdgpu_display.c */
void amdgpu_display_print_display_setup(struct drm_device *dev);
int amdgpu_display_modeset_create_props(struct amdgpu_device *adev);
int amdgpu_display_crtc_set_config(struct drm_mode_set *set,
struct drm_modeset_acquire_ctx *ctx);
int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc,
struct drm_framebuffer *fb,
struct drm_pending_vblank_event *event,
uint32_t page_flip_flags, uint32_t target,
struct drm_modeset_acquire_ctx *ctx);
extern const struct drm_mode_config_funcs amdgpu_mode_funcs;
#endif
| {
"pile_set_name": "Github"
} |
var user = require('./users.controller.js')
var multer = require('multer')
var upload = multer({ dest: 'client/uploads/' })
module.exports = function (app, auth, mail, settings, models, logger) {
app.post('/api/user/photos/upload', upload.single('file'), user.postPhoto)
app.post('/api/user/authenticate', user.checkLoginInformation, user.postAuthenticate)
app.get('/api/user/authenticate', user.getAuthenticate)
app.post('/api/user/logout', user.logout)
app.post('/api/user/forgot', user.postForgot)
app.get('/api/user/reset/:token', user.getReset)
app.post('/api/user/reset/:token', user.postReset)
app.post('/api/user/signup', user.postSignup)
app.put('/api/user/profile', auth.isAuthenticated, user.putUpdateProfile)
app.put('/api/user/password', auth.isAuthenticated, user.putUpdatePassword)
app.delete('/api/user/delete', auth.isAuthenticated, user.deleteDeleteAccount)
// ADD/GET ROLE
// app.get('/api/user/role', user.postKey)
// app.post('/api/user/role/:role', user.postKey)
// API KEY
app.get('/api/user/token', auth.isAuthenticated, user.getKey)
app.post('/api/user/token', user.checkLoginInformation, user.postKey)
app.get('/api/user/token/reset', auth.isAuthenticated, user.getKeyReset)
// var passport = require('passport')
// Azure
// app.get('/api/azure/user', auth.isAuthenticated, user.getUserAzure)
// app.get('/api/auth/link/azure', auth.isAuthenticated, passport.authenticate('azuread-openidconnect', {failureRedirect: '/account'}))
// app.post('/api/auth/link/azure/callback', auth.isAuthenticated, passport.authenticate('azuread-openidconnect', { failureRedirect: '/account', session: false }), user.postCallbackAzure)
// app.get('/api/auth/unlink/azure', auth.isAuthenticated, user.getUnlinkAzure)
// Instagram
// app.get('/api/auth/link/instagram', auth.isAuthenticated, passport.authenticate('instagram', {failureRedirect: '/account'}))
// app.post('/api/auth/link/instagram/callback', auth.isAuthenticated, passport.authenticate('instagram', {failureRedirect: '/account'}), user.postCallbackInstagram)
// app.get('/api/auth/unlink/instagram', auth.isAuthenticated, user.getUnlinkInstagram)
// Facebook
// app.get('/api/auth/link/facebook', auth.isAuthenticated, passport.authenticate('facebook', {failureRedirect: '/account'}))
// app.post('/api/auth/link/facebook/callback', auth.isAuthenticated, passport.authenticate('facebook', {failureRedirect: '/account'}), user.postCallbackFacebook)
// app.get('/api/auth/unlink/facebook', auth.isAuthenticated, user.getUnlinkFacebook)
// Twitter
// app.get('/api/auth/link/twitter', auth.isAuthenticated, passport.authenticate('twitter', {failureRedirect: '/account'}))
// app.post('/api/auth/link/twitter/callback', auth.isAuthenticated, passport.authenticate('twitter', {failureRedirect: '/account'}), user.postCallbackTwitter)
// app.get('/api/auth/unlink/twitter', auth.isAuthenticated, user.getUnlinkTwitter)
// GitHub
// app.get('/api/auth/link/gitHub', auth.isAuthenticated, passport.authenticate('gitHub', {failureRedirect: '/account'}))
// app.post('/api/auth/link/gitHub/callback', auth.isAuthenticated, passport.authenticate('gitHub', {failureRedirect: '/account'}), user.postCallbackGitHub)
// app.get('/api/auth/unlink/gitHub', auth.isAuthenticated, user.getUnlinkGitHub)
// Google
// app.get('/api/auth/link/google', auth.isAuthenticated, passport.authenticate('google', {failureRedirect: '/account'}))
// app.post('/api/auth/link/google/callback', auth.isAuthenticated, passport.authenticate('google', {failureRedirect: '/account'}), user.postCallbackGoogle)
// app.get('/api/auth/unlink/google', auth.isAuthenticated, user.getUnlinkGoogle)
// LinkedIn
// app.get('/api/auth/link/linkedIn', auth.isAuthenticated, passport.authenticate('linkedIn', {failureRedirect: '/account'}))
// app.post('/api/auth/link/linkedIn/callback', auth.isAuthenticated, passport.authenticate('linkedIn', {failureRedirect: '/account'}), user.postCallbackLinkedIn)
// app.get('/api/auth/unlink/linkedIn', auth.isAuthenticated, user.getUnlinkLinkedIn)
}
| {
"pile_set_name": "Github"
} |
<properties
pageTitle="Get started with authentication (Xamarin.iOS) - Mobile Services"
description="Learn how to use authentication in your Azure Mobile Services app for Xamarin.iOS."
documentationCenter="xamarin"
services="mobile-services"
manager="dwrede"
authors="lindydonna"
editor=""/>
<tags
ms.service="mobile-services"
ms.workload="mobile"
ms.tgt_pltfrm="mobile-xamarin-ios"
ms.devlang="dotnet"
ms.topic="article"
ms.date="07/21/2016"
ms.author="donnam"/>
# Add authentication to your Mobile Services app
> [AZURE.SELECTOR-LIST (Platform | Backend )]
- [(iOS | .NET)](mobile-services-dotnet-backend-ios-get-started-users.md)
- [(iOS | JavaScript)](mobile-services-ios-get-started-users.md)
- [(Windows Runtime 8.1 universal C# | .NET)](mobile-services-dotnet-backend-windows-universal-dotnet-get-started-users.md)
- [(Windows Runtime 8.1 universal C# | Javascript)](mobile-services-javascript-backend-windows-universal-dotnet-get-started-users.md)
- [(Windows Phone Silverlight 8.x | Javascript)](mobile-services-windows-phone-get-started-users.md)
- [(Android | Javascript)](mobile-services-android-get-started-users.md)
- [(Xamarin.iOS | .NET)](mobile-services-dotnet-backend-xamarin-ios-get-started-users.md)
- [(Xamarin.iOS | Javascript)](partner-xamarin-mobile-services-ios-get-started-users.md)
- [(Xamarin.Android | .NET)](mobile-services-dotnet-backend-xamarin-android-get-started-users.md)
- [(Xamarin.Android | Javascript)](partner-xamarin-mobile-services-android-get-started-users.md)
- [(HTML | Javascript)](mobile-services-html-get-started-users.md)
>[AZURE.WARNING] This is an **Azure Mobile Services** topic. This service has been superseded by Azure App Service Mobile Apps and is scheduled for removal from Azure. We recommend using Azure Mobile Apps for all new mobile backend deployments. Read [this announcement](https://azure.microsoft.com/blog/transition-of-azure-mobile-services/) to learn more about the pending deprecation of this service.
>
> Learn about [migrating your site to Azure App Service](https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-migrating-from-mobile-services/).
>
> Get started with Azure Mobile Apps, see the [Azure Mobile Apps documentation center](https://azure.microsoft.com/documentation/learning-paths/appservice-mobileapps/).
This topic shows you how to authenticate users in Azure Mobile Services from your app. In this tutorial, you add authentication to the quickstart project using an identity provider that is supported by Mobile Services. After being successfully authenticated and authorized by Mobile Services, the user ID value is displayed.
This tutorial walks you through these basic steps to enable authentication in your app:
1. [Register your app for authentication and configure Mobile Services]
2. [Restrict table permissions to authenticated users]
3. [Add authentication to the app]
This tutorial is based on the Mobile Services quickstart. You must also first complete the tutorial [Get started with Mobile Services].
Completing this tutorial requires [Xamarin Studio], XCode 6.0, and iOS 7.0 or later versions.
## <a name="register"></a>Register your app for authentication and configure Mobile Services
1. In the [Azure classic portal](https://manage.windowsazure.com/), click **Mobile Services** > your mobile service > **Dashboard**, and make a note of the **Mobile Service URL** value.
2. Register your app with one or more of the following authentication providers:
* [Google](./
mobile-services-how-to-register-google-authentication.md)
* [Facebook](./
mobile-services-how-to-register-facebook-authentication.md)
* [Twitter](./
mobile-services-how-to-register-twitter-authentication.md)
* [Microsoft](./
mobile-services-how-to-register-microsoft-authentication.md)
* [Azure Active Directory](./
mobile-services-how-to-register-active-directory-authentication.md).
Make a note of the client identity and client secret values generated by the provider. Do not distribute or share the client secret.
3. Back in the [Azure classic portal](https://manage.windowsazure.com/), click **Mobile Services** > your mobile service > **Identity** > your identity provider settings, then enter the client ID and secret value from your provider.
You've now configured both your app and your mobile service to work with your auth provider. You may optionally repeat all these steps for each additional identity provider you'd like to support.
> [AZURE.IMPORTANT] Verify that you've set the correct redirect URI on your identity provider's developer site. As described in the linked instructions for each provider above, the redirect URI may be different for a .NET backend service vs. for a JavaScript backend service. An incorrectly configured redirect URI may result in the login screen not being displayed properly and the app malfunctioning in unexpected ways.
## <a name="permissions"></a>Restrict permissions to authenticated users
To secure your endpoints, you must restrict access to only authenticated clients.
1. In the [Azure classic portal](https://manage.windowsazure.com/), navigate to your mobile service, then click **Data** > your table name (**TodoItem**) > **Permissions**.
2. Set all of the table operation permissions to **Only authenticated users**.
This ensures that all operations against the table require an authenticated user, which is required for this tutorial. You can set different permissions on each operations to support your specific scenario.
3. In Xcode, open the project that you created when you completed the tutorial [Get started with Mobile Services].
4. Press the **Run** button to build the project and start the app in the iPhone emulator; verify that an unhandled exception with a status code of 401 (Unauthorized) is raised after the app starts.
This happens because the app attempts to access Mobile Services as an unauthenticated user, but the _TodoItem_ table now requires authentication.
Next, you will update the app to authenticate users before requesting resources from the mobile service.
## <a name="add-authentication"></a>Add authentication to the app
1. Open the **QSToDoService** project file and add the following variables
// Mobile Service logged in user
private MobileServiceUser user;
public MobileServiceUser User { get { return user; } }
2. Then add a new method named **Authenticate** to **ToDoService** defined as:
private async Task Authenticate(MonoTouch.UIKit.UIViewController view)
{
try
{
user = await client.LoginAsync(view, MobileServiceAuthenticationProvider.MicrosoftAccount);
}
catch (Exception ex)
{
Console.Error.WriteLine (@"ERROR - AUTHENTICATION FAILED {0}", ex.Message);
}
}
> [AZURE.NOTE] If you are using an identity provider other than a Microsoft Account, change the value passed to **LoginAsync** above to one of the following: _Facebook_, _Twitter_, _Google_, or _WindowsAzureActiveDirectory_.
3. Move the request for the **ToDoItem** table from the **ToDoService** constructor into a new method named **CreateTable**:
private async Task CreateTable()
{
// Create an MSTable instance to allow us to work with the ToDoItem table
todoTable = client.GetSyncTable<ToDoItem>();
}
4. Create a new asynchronous public method named **LoginAndGetData** defined as:
public async Task LoginAndGetData(MonoTouch.UIKit.UIViewController view)
{
await Authenticate(view);
await CreateTable();
}
5. In the **TodoListViewController** override the **ViewDidAppear** method and define it as found below. This logs in the user if the **ToDoService** doesn't yet have a handle on the user:
public override async void ViewDidAppear(bool animated)
{
base.ViewDidAppear(animated);
if (QSTodoService.DefaultService.User == null)
{
await QSTodoService.DefaultService.LoginAndGetData(this);
}
if (QSTodoService.DefaultService.User == null)
{
// TODO:: show error
return;
}
await RefreshAsync();
}
6. Remove the original call to **RefreshAsync** from **TodoListViewController.ViewDidLoad**.
7. Press the **Run** button to build the project, start the app in the iPhone emulator, then log-on with your chosen identity provider.
When you are successfully logged-in, the app should run without errors, and you should be able to query Mobile Services and make updates to data.
## Get completed example
Download the [completed example project]. Be sure to update the **applicationURL** and **applicationKey** variables with your own Azure settings.
## <a name="next-steps"></a>Next steps
In the next tutorial, [Authorize users with scripts], you will take the user ID value provided by Mobile Services based on an authenticated user and use it to filter the data returned by Mobile Services.
<!-- Anchors. -->
[Register your app for authentication and configure Mobile Services]: #register
[Restrict table permissions to authenticated users]: #permissions
[Add authentication to the app]: #add-authentication
[Next Steps]:#next-steps
<!-- Images. -->
[4]: ./media/partner-xamarin-mobile-services-ios-get-started-users/mobile-services-selection.png
[5]: ./media/partner-xamarin-mobile-services-ios-get-started-users/mobile-service-uri.png
[13]: ./media/partner-xamarin-mobile-services-ios-get-started-users/mobile-identity-tab.png
[14]: ./media/partner-xamarin-mobile-services-ios-get-started-users/mobile-portal-data-tables.png
[15]: ./media/partner-xamarin-mobile-services-ios-get-started-users/mobile-portal-change-table-perms.png
<!-- URLs. TODO:: update completed example project link with project download -->
[Submit an app page]: http://go.microsoft.com/fwlink/p/?LinkID=266582
[My Applications]: http://go.microsoft.com/fwlink/p/?LinkId=262039
[Live SDK for Windows]: http://go.microsoft.com/fwlink/p/?LinkId=262253
[Get started with Mobile Services]: https://azure.microsoft.com/develop/mobile/tutorials/get-started-xamarin-ios
[Get started with data]: https://azure.microsoft.com/develop/mobile/tutorials/get-started-with-data-xamarin-ios
[Get started with authentication]: https://azure.microsoft.com/develop/mobile/tutorials/get-started-with-users-xamarin-ios
[Get started with push notifications]: https://azure.microsoft.com/develop/mobile/tutorials/-get-started-with-push-xamarin-ios
[Authorize users with scripts]: https://azure.microsoft.com/develop/mobile/tutorials/authorize-users-in-scripts-xamarin-ios
[completed example project]: http://go.microsoft.com/fwlink/p/?LinkId=331328
[Xamarin Studio]: http://xamarin.com/download
| {
"pile_set_name": "Github"
} |
(1:1)FeatureLine:Feature/Some rules/
(2:1)Empty://
(3:3)BackgroundLine:Background//
(4:5)StepLine:Given /fb/
(5:1)Empty://
(6:3)RuleLine:Rule/A/
(7:1)Other:/ The rule A description/
(8:1)Other://
(9:5)BackgroundLine:Background//
(10:7)StepLine:Given /ab/
(11:1)Empty://
(12:5)ScenarioLine:Example/Example A/
(13:7)StepLine:Given /a/
(14:1)Empty://
(15:3)RuleLine:Rule/B/
(16:1)Other:/ The rule B description/
(17:1)Other://
(18:5)ScenarioLine:Example/Example B/
(19:7)StepLine:Given /b/
EOF
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: d6132359ece035a4995c4859a13e95e3
timeCreated: 1486634495
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2011 Thomas Akehurst
*
* 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 com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;
import com.github.jknack.handlebars.Options;
import com.github.tomakehurst.wiremock.common.ListOrSingle;
import com.github.tomakehurst.wiremock.common.xml.*;
import com.github.tomakehurst.wiremock.extension.responsetemplating.RenderCache;
import java.io.IOException;
/**
* This class uses javax.xml.xpath.* for reading a xml via xPath so that the result can be used for response
* templating.
*/
public class HandlebarsXPathHelper extends HandlebarsHelper<String> {
@Override
public Object apply(final String inputXml, final Options options) throws IOException {
if (inputXml == null ) {
return "";
}
if (options.param(0, null) == null) {
return handleError("The XPath expression cannot be empty");
}
final String xPathInput = options.param(0);
XmlDocument xmlDocument;
try {
xmlDocument = getXmlDocument(inputXml, options);
} catch (XmlException e) {
return handleError(inputXml + " is not valid XML");
}
try {
ListOrSingle<XmlNode> xmlNodes = getXmlNodes(getXPathPrefix() + xPathInput, xmlDocument, options);
if (xmlNodes == null || xmlNodes.isEmpty()) {
return "";
}
return xmlNodes;
} catch (XPathException e) {
return handleError(xPathInput + " is not a valid XPath expression", e);
}
}
private ListOrSingle<XmlNode> getXmlNodes(String xPathExpression, XmlDocument doc, Options options) {
RenderCache renderCache = getRenderCache(options);
RenderCache.Key cacheKey = RenderCache.Key.keyFor(XmlDocument.class, xPathExpression, doc);
ListOrSingle<XmlNode> nodes = renderCache.get(cacheKey);
if (nodes == null) {
nodes = doc.findNodes(xPathExpression);
renderCache.put(cacheKey, nodes);
}
return nodes;
}
private XmlDocument getXmlDocument(String xml, Options options) {
RenderCache renderCache = getRenderCache(options);
RenderCache.Key cacheKey = RenderCache.Key.keyFor(XmlDocument.class, xml);
XmlDocument document = renderCache.get(cacheKey);
if (document == null) {
document = Xml.parse(xml);
renderCache.put(cacheKey, document);
}
return document;
}
/**
* No prefix by default. It allows to extend this class with a specified prefix. Just overwrite this method to do
* so.
*
* @return a prefix which will be applied before the specified xpath.
*/
protected String getXPathPrefix() {
return "";
}
}
| {
"pile_set_name": "Github"
} |
#import <UIKit/UIKit.h>
@interface MITViewWithCenterText : UIView
@property (weak, nonatomic) IBOutlet UILabel *overviewText;
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *overviewIndicator;
@end
| {
"pile_set_name": "Github"
} |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Cake.Common.Tests.Fixtures.Build;
using NSubstitute;
using Xunit;
namespace Cake.Common.Tests.Unit.Build.AppVeyor.Data
{
public sealed class AppVeyorTagInfoTests
{
public sealed class TheIsTagProperty
{
[Theory]
[InlineData("true", true)]
[InlineData("True", true)]
[InlineData("false", false)]
[InlineData("False", false)]
[InlineData("Yes", false)]
public void Should_Return_Correct_Value(string value, bool expected)
{
// Given
var fixture = new AppVeyorInfoFixture();
fixture.Environment.GetEnvironmentVariable("APPVEYOR_REPO_TAG").Returns(value);
var info = fixture.CreateTagInfo();
// When
var result = info.IsTag;
// Then
Assert.Equal(expected, result);
}
}
public sealed class TheNameProperty
{
[Fact]
public void Should_Return_Correct_Value()
{
// Given
var info = new AppVeyorInfoFixture().CreateTagInfo();
// When
var result = info.Name;
// Then
Assert.Equal("v1.0.25", result);
}
}
}
} | {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{225C620D-C774-30C0-A16D-B392DA51D110}</ProjectGuid>
<RootNamespace>Candle</RootNamespace>
<Keyword>Qt4VSv1.0</Keyword>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.17763.0</WindowsTargetPlatformMinVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<PlatformToolset>v141</PlatformToolset>
<OutputDirectory>release\</OutputDirectory>
<ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage>
<CharacterSet>NotSet</CharacterSet>
<ConfigurationType>Application</ConfigurationType>
<IntermediateDirectory>release\</IntermediateDirectory>
<PrimaryOutput>Candle</PrimaryOutput>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<PlatformToolset>v141</PlatformToolset>
<OutputDirectory>debug\</OutputDirectory>
<ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage>
<CharacterSet>NotSet</CharacterSet>
<ConfigurationType>Application</ConfigurationType>
<IntermediateDirectory>debug\</IntermediateDirectory>
<PrimaryOutput>Candle</PrimaryOutput>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup Condition="'$(QtMsBuild)'=='' or !Exists('$(QtMsBuild)\qt.targets')">
<QtMsBuild>$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
</PropertyGroup>
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
<Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
</Target>
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.props')">
<Import Project="$(QtMsBuild)\qt.props" />
</ImportGroup>
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\build-$(Platform)\$(Configuration)\Bin</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\build-$(Platform)\$(Configuration)\</IntDir>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Candle</TargetName>
<IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</IgnoreImportLibrary>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\build-$(Platform)\$(Configuration)\Bin</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\build-$(Platform)\$(Configuration)\</IntDir>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Candle</TargetName>
<IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</IgnoreImportLibrary>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\include;..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\include\QtOpenGL;..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\include\QtWidgets;..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\include\QtWinExtras;..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\include\QtGui;..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\include\QtANGLE;..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\include\QtSerialPort;..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\include\QtCore;release;\include;..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\mkspecs\win32-msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
<AssemblerListingLocation>release\</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation>
<DebugInformationFormat>None</DebugInformationFormat>
<DisableSpecificWarnings>4577;4467;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ExceptionHandling>Sync</ExceptionHandling>
<ObjectFileName>$(IntDir)</ObjectFileName>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WINDOWS;APP_VERSION="1.1.8";_USE_MATH_DEFINES;QT_NO_DEBUG;QT_OPENGL_LIB;QT_WIDGETS_LIB;QT_WINEXTRAS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_CORE_LIB;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessToFile>false</PreprocessToFile>
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<WarningLevel>Level3</WarningLevel>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<AdditionalDependencies>$(QTDIR)\lib\Qt5OpenGL.lib;$(QTDIR)\lib\Qt5Widgets.lib;$(QTDIR)\lib\Qt5WinExtras.lib;$(QTDIR)\lib\Qt5Gui.lib;$(QTDIR)\lib\Qt5SerialPort.lib;$(QTDIR)\lib\Qt5Core.lib;$(QTDIR)\lib\qtmain.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(QTDIR)\lib;E:\QT\QT5.12.0\5.12.0\MSVC2017\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
<DataExecutionPrevention>true</DataExecutionPrevention>
<GenerateDebugInformation>false</GenerateDebugInformation>
<IgnoreImportLibrary>true</IgnoreImportLibrary>
<LinkIncremental>false</LinkIncremental>
<OutputFile>$(OutDir)\Candle.exe</OutputFile>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<SubSystem>Windows</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<Version>1.1</Version>
</Link>
<Midl>
<DefaultCharType>Unsigned</DefaultCharType>
<EnableErrorChecks>None</EnableErrorChecks>
<WarningLevel>0</WarningLevel>
</Midl>
<ResourceCompile>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WINDOWS;sNan="65536";APP_VERSION=\"1.1.8\";_USE_MATH_DEFINES;QT_NO_DEBUG;QT_OPENGL_LIB;QT_WIDGETS_LIB;QT_WINEXTRAS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_CORE_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<QtMoc>
<QTDIR>E:\QT\QT5.12.0\5.12.0\MSVC2017</QTDIR>
<OutputFile>.\build-$(Platform)\$(Configuration)\moc_%(Filename).cpp</OutputFile>
<Define>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WINDOWS;APP_VERSION="1.1.8";_USE_MATH_DEFINES;QT_NO_DEBUG;QT_OPENGL_LIB;QT_WIDGETS_LIB;QT_WINEXTRAS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_CORE_LIB;NDEBUG;%(PreprocessorDefinitions)</Define>
<CompilerFlavor>msvc</CompilerFlavor>
<Include>./$(Configuration)/moc_predefs.h</Include>
<ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription>
<InputFile>%(FullPath)</InputFile>
<DynamicSource>output</DynamicSource>
<IncludePath>.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;E:/QT/QT5.12.0/5.12.0/MSVC2017/mkspecs/$(Platform)-msvc;.;E:/QT/QT5.12.0/5.12.0/MSVC2017/include;E:/QT/QT5.12.0/5.12.0/MSVC2017/include/QtOpenGL;E:/QT/QT5.12.0/5.12.0/MSVC2017/include/QtWidgets;E:/QT/QT5.12.0/5.12.0/MSVC2017/include/QtWinExtras;E:/QT/QT5.12.0/5.12.0/MSVC2017/include/QtGui;E:/QT/QT5.12.0/5.12.0/MSVC2017/include/QtANGLE;E:/QT/QT5.12.0/5.12.0/MSVC2017/include/QtSerialPort;E:/QT/QT5.12.0/5.12.0/MSVC2017/include/QtCore;C:\Program Files (x86)\Microsoft Visual Studio\VC98\atl\include;C:\Program Files (x86)\Microsoft Visual Studio\VC98\mfc\include;C:\Program Files (x86)\Microsoft Visual Studio\VC98\include;E:\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include;E:\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt</IncludePath>
</QtMoc>
<QtRcc>
<OutputFile>.\build-$(Platform)\$(Configuration)\qrc_%(Filename).cpp</OutputFile>
<QTDIR>E:\QT\QT5.12.0\5.12.0\MSVC2017</QTDIR>
<Compression>default</Compression>
<ExecutionDescription>Rcc'ing %(Identity)...</ExecutionDescription>
<InputFile>%(FullPath)</InputFile>
</QtRcc>
<QtUic>
<QTDIR>E:\QT\QT5.12.0\5.12.0\MSVC2017</QTDIR>
<ExecutionDescription>Uic'ing %(Identity)...</ExecutionDescription>
<InputFile>%(FullPath)</InputFile>
<OutputFile>.\build-$(Platform)\$(Configuration)\ui_%(Filename).h</OutputFile>
</QtUic>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\include;..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\include\QtOpenGL;..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\include\QtWidgets;..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\include\QtWinExtras;..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\include\QtGui;..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\include\QtANGLE;..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\include\QtSerialPort;..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\include\QtCore;debug;\include;..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\mkspecs\win32-msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
<AssemblerListingLocation>debug\</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4577;4467;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ExceptionHandling>Sync</ExceptionHandling>
<ObjectFileName>$(IntDir)</ObjectFileName>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WINDOWS;APP_VERSION="1.1.8";_USE_MATH_DEFINES;QT_OPENGL_LIB;QT_WIDGETS_LIB;QT_WINEXTRAS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_CORE_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessToFile>false</PreprocessToFile>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<WarningLevel>Level3</WarningLevel>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<AdditionalDependencies>$(QTDIR)\lib\Qt5OpenGLd.lib;$(QTDIR)\lib\Qt5Widgetsd.lib;$(QTDIR)\lib\Qt5WinExtrasd.lib;$(QTDIR)\lib\Qt5Guid.lib;$(QTDIR)\lib\Qt5SerialPortd.lib;$(QTDIR)\lib\Qt5Cored.lib;$(QTDIR)\lib\qtmaind.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(QTDIR)\lib;E:\QT\QT5.12.0\5.12.0\MSVC2017\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
<DataExecutionPrevention>true</DataExecutionPrevention>
<GenerateDebugInformation>true</GenerateDebugInformation>
<IgnoreImportLibrary>true</IgnoreImportLibrary>
<OutputFile>$(OutDir)\Candle.exe</OutputFile>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<SubSystem>Windows</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<Version>1.1</Version>
</Link>
<Midl>
<DefaultCharType>Unsigned</DefaultCharType>
<EnableErrorChecks>None</EnableErrorChecks>
<WarningLevel>0</WarningLevel>
</Midl>
<ResourceCompile>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WINDOWS;APP_VERSION=\"1.1.8\";_USE_MATH_DEFINES;QT_OPENGL_LIB;QT_WIDGETS_LIB;QT_WINEXTRAS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_CORE_LIB;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<QtMoc>
<QTDIR>E:\QT\QT5.12.0\5.12.0\MSVC2017</QTDIR>
<OutputFile>.\build-$(Platform)\$(Configuration)\moc_%(Filename).cpp</OutputFile>
<Define>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WINDOWS;APP_VERSION="1.1.8";_USE_MATH_DEFINES;QT_OPENGL_LIB;QT_WIDGETS_LIB;QT_WINEXTRAS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_CORE_LIB;%(PreprocessorDefinitions)</Define>
<CompilerFlavor>msvc</CompilerFlavor>
<Include>./$(Configuration)/moc_predefs.h</Include>
<ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription>
<InputFile>%(FullPath)</InputFile>
<DynamicSource>output</DynamicSource>
<IncludePath>.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;E:/QT/QT5.12.0/5.12.0/MSVC2017/mkspecs/$(Platform)-msvc;.;E:/QT/QT5.12.0/5.12.0/MSVC2017/include;E:/QT/QT5.12.0/5.12.0/MSVC2017/include/QtOpenGL;E:/QT/QT5.12.0/5.12.0/MSVC2017/include/QtWidgets;E:/QT/QT5.12.0/5.12.0/MSVC2017/include/QtWinExtras;E:/QT/QT5.12.0/5.12.0/MSVC2017/include/QtGui;E:/QT/QT5.12.0/5.12.0/MSVC2017/include/QtANGLE;E:/QT/QT5.12.0/5.12.0/MSVC2017/include/QtSerialPort;E:/QT/QT5.12.0/5.12.0/MSVC2017/include/QtCore;C:\Program Files (x86)\Microsoft Visual Studio\VC98\atl\include;C:\Program Files (x86)\Microsoft Visual Studio\VC98\mfc\include;C:\Program Files (x86)\Microsoft Visual Studio\VC98\include;E:\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include;E:\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt</IncludePath>
</QtMoc>
<QtRcc>
<Compression>default</Compression>
<OutputFile>.\build-$(Platform)\$(Configuration)\qrc_%(Filename).cpp</OutputFile>
<QTDIR>E:\QT\QT5.12.0\5.12.0\MSVC2017</QTDIR>
<ExecutionDescription>Rcc'ing %(Identity)...</ExecutionDescription>
<InputFile>%(FullPath)</InputFile>
</QtRcc>
<QtUic>
<QTDIR>E:\QT\QT5.12.0\5.12.0\MSVC2017</QTDIR>
<ExecutionDescription>Uic'ing %(Identity)...</ExecutionDescription>
<InputFile>%(FullPath)</InputFile>
<OutputFile>.\build-$(Platform)\$(Configuration)\ui_%(Filename).h</OutputFile>
</QtUic>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="parser\arcproperties.cpp" />
<ClCompile Include="widgets\colorpicker.cpp" />
<ClCompile Include="widgets\combobox.cpp" />
<ClCompile Include="widgets\comboboxkey.cpp" />
<ClCompile Include="frmabout.cpp" />
<ClCompile Include="frmmain.cpp" />
<ClCompile Include="frmsettings.cpp" />
<ClCompile Include="drawers\gcodedrawer.cpp" />
<ClCompile Include="parser\gcodeparser.cpp" />
<ClCompile Include="parser\gcodepreprocessorutils.cpp" />
<ClCompile Include="tables\gcodetablemodel.cpp" />
<ClCompile Include="parser\gcodeviewparse.cpp" />
<ClCompile Include="widgets\glwidget.cpp" />
<ClCompile Include="widgets\groupbox.cpp" />
<ClCompile Include="drawers\heightmapborderdrawer.cpp" />
<ClCompile Include="drawers\heightmapgriddrawer.cpp" />
<ClCompile Include="drawers\heightmapinterpolationdrawer.cpp" />
<ClCompile Include="tables\heightmaptablemodel.cpp" />
<ClCompile Include="parser\linesegment.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="drawers\origindrawer.cpp" />
<ClCompile Include="parser\pointsegment.cpp" />
<ClCompile Include="widgets\scrollarea.cpp" />
<ClCompile Include="drawers\selectiondrawer.cpp" />
<ClCompile Include="drawers\shaderdrawable.cpp" />
<ClCompile Include="widgets\slider.cpp" />
<ClCompile Include="widgets\sliderbox.cpp" />
<ClCompile Include="widgets\styledtoolbutton.cpp" />
<ClCompile Include="drawers\tooldrawer.cpp" />
<ClCompile Include="widgets\widget.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="parser\arcproperties.h" />
<QtMoc Include="widgets\colorpicker.h">
</QtMoc>
<QtMoc Include="widgets\combobox.h">
</QtMoc>
<ClInclude Include="widgets\comboboxkey.h" />
<QtMoc Include="frmabout.h">
</QtMoc>
<QtMoc Include="frmmain.h">
</QtMoc>
<QtMoc Include="frmsettings.h">
</QtMoc>
<QtMoc Include="drawers\gcodedrawer.h">
</QtMoc>
<QtMoc Include="parser\gcodeparser.h">
</QtMoc>
<QtMoc Include="parser\gcodepreprocessorutils.h">
</QtMoc>
<QtMoc Include="tables\gcodetablemodel.h">
</QtMoc>
<QtMoc Include="parser\gcodeviewparse.h">
</QtMoc>
<QtMoc Include="widgets\glwidget.h">
</QtMoc>
<QtMoc Include="widgets\groupbox.h">
</QtMoc>
<ClInclude Include="drawers\heightmapborderdrawer.h" />
<ClInclude Include="drawers\heightmapgriddrawer.h" />
<ClInclude Include="drawers\heightmapinterpolationdrawer.h" />
<QtMoc Include="tables\heightmaptablemodel.h">
</QtMoc>
<ClInclude Include="utils\interpolation.h" />
<ClInclude Include="parser\linesegment.h" />
<ClInclude Include="drawers\origindrawer.h" />
<ClInclude Include="parser\pointsegment.h" />
<QtMoc Include="widgets\scrollarea.h">
</QtMoc>
<ClInclude Include="drawers\selectiondrawer.h" />
<ClInclude Include="drawers\shaderdrawable.h" />
<QtMoc Include="widgets\slider.h">
</QtMoc>
<QtMoc Include="widgets\sliderbox.h">
</QtMoc>
<ClInclude Include="widgets\styledtoolbutton.h" />
<ClInclude Include="drawers\tooldrawer.h" />
<ClInclude Include="utils\util.h" />
<QtMoc Include="widgets\widget.h">
</QtMoc>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="debug\moc_predefs.h.cbt">
<FileType>Document</FileType>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">cl -Bx"$(QTDIR)\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -Zi -MDd -g3 -pg -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E ..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\mkspecs\features\data\dummy.cpp 2>NUL >debug\moc_predefs.h</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generate moc_predefs.h</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">debug\moc_predefs.h;%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="release\moc_predefs.h.cbt">
<FileType>Document</FileType>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">cl -Bx"$(QTDIR)\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E ..\..\..\QT\QT5.12.0\5.12.0\MSVC2017\mkspecs\features\data\dummy.cpp 2>NUL >release\moc_predefs.h</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Generate moc_predefs.h</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">release\moc_predefs.h;%(Outputs)</Outputs>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</CustomBuild>
<ClInclude Include="ui_frmabout.h" />
<ClInclude Include="ui_frmmain.h" />
<ClInclude Include="ui_frmsettings.h" />
</ItemGroup>
<ItemGroup>
<None Include="translations\candle_en.ts" />
<None Include="translations\candle_es.ts" />
<None Include="translations\candle_fr.ts" />
<None Include="translations\candle_pt.ts" />
<None Include="translations\candle_ru.ts" />
</ItemGroup>
<ItemGroup>
<QtUic Include="frmabout.ui">
<OutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ui_frmabout.h</OutputFile>
<OutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ui_frmabout.h</OutputFile>
</QtUic>
<QtUic Include="frmmain.ui">
<OutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ui_frmmain.h</OutputFile>
<OutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ui_frmmain.h</OutputFile>
</QtUic>
<QtUic Include="frmsettings.ui">
<OutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ui_frmsettings.h</OutputFile>
<OutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ui_frmsettings.h</OutputFile>
</QtUic>
<QtUic Include="widgets\sliderbox.ui">
<OutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ui_sliderbox.h</OutputFile>
<OutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ui_sliderbox.h</OutputFile>
</QtUic>
</ItemGroup>
<ItemGroup>
<None Include="images\1401561986_chevron-left.png" />
<None Include="images\1401562173_chevron-down.png" />
<None Include="images\1401562173_chevron-right.png" />
<None Include="images\1401562173_chevron-up.png" />
<None Include="images\1401562699_icon-arrow-down-b.png" />
<None Include="images\1401562699_icon-arrow-up-b.png" />
<None Include="images\axis_return.png" />
<None Include="images\axis_zero.png" />
<None Include="images\brake.png" />
<None Include="images\candle_256.png" />
<None Include="images\collapse.png" />
<None Include="images\collapse_disabled.png" />
<None Include="images\cube.png" />
<None Include="images\cubeFront.png" />
<None Include="images\cubeLeft.png" />
<None Include="images\cubeTop.png" />
<None Include="images\cutter.png" />
<None Include="images\erase_1.png" />
<None Include="images\expand.png" />
<None Include="images\expand_disabled.png" />
<None Include="images\fit_1.png" />
<None Include="shaders\fshader.glsl" />
<None Include="images\guard.png" />
<None Include="images\handle2s.png" />
<None Include="images\handle2s1.png" />
<None Include="images\handle2sh.png" />
<None Include="images\handle_horizontal.png" />
<None Include="images\handle_small.png" />
<None Include="images\handle_vertical.png" />
<None Include="images\icon3png.png" />
<QtRcc Include="images.qrc">
<InitFuncName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">images</InitFuncName>
<InitFuncName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">images</InitFuncName>
</QtRcc>
<None Include="images\num1.png" />
<None Include="images\num2.png" />
<None Include="images\num3.png" />
<None Include="images\num4.png" />
<None Include="images\origin.png" />
<None Include="images\restart.png" />
<None Include="images\run.png" />
<None Include="images\safe_z.png" />
<None Include="images\search_for_home2.png" />
<None Include="images\search_for_z.png" />
<None Include="images\send_1.png" />
<QtRcc Include="shaders.qrc">
<InitFuncName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">shaders</InitFuncName>
<InitFuncName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">shaders</InitFuncName>
</QtRcc>
<None Include="images\shadow.png" />
<None Include="images\small_arrow.png" />
<None Include="images\unlock.png" />
<None Include="shaders\vshader.glsl" />
<None Include="images\zero_z.png" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include=".\Candle_resource.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
<Import Project="$(QtMsBuild)\qt.targets" />
</ImportGroup>
<ImportGroup Label="ExtensionTargets" />
<ProjectExtensions>
<VisualStudio>
<UserProperties UicDir="$(Configuration)" Qt5Version_x0020_Win32="msvc2017" />
</VisualStudio>
</ProjectExtensions>
</Project> | {
"pile_set_name": "Github"
} |
// Copyright (c) 2020 Uber Technologies, 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, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
package main
import (
"testing"
"time"
"github.com/m3db/m3/src/cmd/services/m3comparator/main/parser"
"github.com/m3db/m3/src/dbnode/encoding"
"github.com/m3db/m3/src/query/models"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
var (
series1 = parser.Tags{
parser.NewTag("foo", "bar"),
parser.NewTag("baz", "quix"),
}
series2 = parser.Tags{
parser.NewTag("alpha", "a"),
parser.NewTag("beta", "b"),
}
allSeries = list(series1, series2)
)
func TestFilter(t *testing.T) {
testCases := []struct {
name string
givenMatchers models.Matchers
wantedSeries []parser.IngestSeries
}{
{
name: "No matchers",
givenMatchers: models.Matchers{},
wantedSeries: list(series1, series2),
},
{
name: "MatchEqual on one tag",
givenMatchers: models.Matchers{
tagMatcher("foo", models.MatchEqual, "bar"),
},
wantedSeries: list(series1),
},
{
name: "MatchEqual on two tags",
givenMatchers: models.Matchers{
tagMatcher("alpha", models.MatchEqual, "a"),
tagMatcher("beta", models.MatchEqual, "b"),
},
wantedSeries: list(series2),
},
{
name: "Two MatchEqual excluding every series each",
givenMatchers: models.Matchers{
tagMatcher("foo", models.MatchEqual, "bar"),
tagMatcher("beta", models.MatchEqual, "b"),
},
wantedSeries: list(),
},
{
name: "MatchEqual excluding all series",
givenMatchers: models.Matchers{
tagMatcher("unknown", models.MatchEqual, "whatever"),
},
wantedSeries: list(),
},
{
name: "MatchEqual on empty value",
givenMatchers: models.Matchers{
tagMatcher("unknown", models.MatchEqual, ""),
},
wantedSeries: list(series1, series2),
},
{
name: "MatchNotEqual on one tag",
givenMatchers: models.Matchers{
tagMatcher("foo", models.MatchNotEqual, "bar"),
},
wantedSeries: list(series2),
},
{
name: "MatchNotEqual on two tags",
givenMatchers: models.Matchers{
tagMatcher("alpha", models.MatchNotEqual, "a"),
tagMatcher("beta", models.MatchNotEqual, "b"),
},
wantedSeries: list(series1),
},
{
name: "Two MatchNotEqual excluding every series each",
givenMatchers: models.Matchers{
tagMatcher("foo", models.MatchNotEqual, "bar"),
tagMatcher("beta", models.MatchNotEqual, "b"),
},
wantedSeries: list(),
},
{
name: "MatchNotEqual accepting all series",
givenMatchers: models.Matchers{
tagMatcher("unknown", models.MatchNotEqual, "whatever"),
},
wantedSeries: list(series1, series2),
},
{
name: "MatchNotEqual on empty value",
givenMatchers: models.Matchers{
tagMatcher("unknown", models.MatchNotEqual, ""),
},
wantedSeries: list(),
},
{
name: "MatchRegexp on full value",
givenMatchers: models.Matchers{
tagMatcher("foo", models.MatchRegexp, "bar"),
},
wantedSeries: list(series1),
},
{
name: "MatchRegexp with wildcard",
givenMatchers: models.Matchers{
tagMatcher("foo", models.MatchRegexp, "b.+"),
},
wantedSeries: list(series1),
},
{
name: "MatchRegexp with alternatives",
givenMatchers: models.Matchers{
tagMatcher("foo", models.MatchRegexp, "bax|bar|baz"),
},
wantedSeries: list(series1),
},
{
name: "MatchRegexp unmatched",
givenMatchers: models.Matchers{
tagMatcher("foo", models.MatchRegexp, "bax|baz"),
},
wantedSeries: list(),
},
{
name: "MatchNotRegexp on full value",
givenMatchers: models.Matchers{
tagMatcher("foo", models.MatchNotRegexp, "bar"),
},
wantedSeries: list(series2),
},
{
name: "MatchNotRegexp with wildcard",
givenMatchers: models.Matchers{
tagMatcher("foo", models.MatchNotRegexp, "b.+"),
},
wantedSeries: list(series2),
},
{
name: "MatchNotRegexp with alternatives",
givenMatchers: models.Matchers{
tagMatcher("foo", models.MatchNotRegexp, "bax|bar|baz"),
},
wantedSeries: list(series2),
},
{
name: "MatchNotRegexp matching all",
givenMatchers: models.Matchers{
tagMatcher("foo", models.MatchNotRegexp, "bax|baz"),
},
wantedSeries: list(series1, series2),
},
{
name: "MatchField",
givenMatchers: models.Matchers{
tagMatcher("foo", models.MatchField, ""),
},
wantedSeries: list(series1),
},
{
name: "MatchNotField",
givenMatchers: models.Matchers{
tagMatcher("foo", models.MatchNotField, ""),
},
wantedSeries: list(series2),
},
{
name: `Ignore 'role="remote"' matcher added by Prometheus`,
givenMatchers: models.Matchers{
tagMatcher("role", models.MatchEqual, "remote"),
},
wantedSeries: list(series1, series2),
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
unfilteredIters, err := toSeriesIterators(allSeries)
require.NoError(t, err)
filteredIters := filter(unfilteredIters, tc.givenMatchers)
filteredSeries := fromSeriesIterators(filteredIters)
assert.Equal(t, tc.wantedSeries, filteredSeries)
})
}
}
func tagMatcher(tag string, matchType models.MatchType, value string) models.Matcher {
return models.Matcher{
Type: matchType,
Name: []byte(tag),
Value: []byte(value),
}
}
func list(tagsList ...parser.Tags) []parser.IngestSeries {
list := make([]parser.IngestSeries, 0, len(tagsList))
for _, tags := range tagsList {
list = append(list, parser.IngestSeries{Tags: tags})
}
return list
}
func toSeriesIterators(series []parser.IngestSeries) (encoding.SeriesIterators, error) {
return parser.BuildSeriesIterators(series, time.Now(), time.Hour, iteratorOpts)
}
func fromSeriesIterators(seriesIters encoding.SeriesIterators) []parser.IngestSeries {
result := make([]parser.IngestSeries, 0, seriesIters.Len())
for _, iter := range seriesIters.Iters() {
tagsIter := iter.Tags()
tags := make(parser.Tags, 0, tagsIter.Len())
for tagsIter.Next() {
tag := tagsIter.Current()
tags = append(tags, parser.NewTag(tag.Name.String(), tag.Value.String()))
}
result = append(result, parser.IngestSeries{Tags: tags})
}
return result
}
| {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.spark.sql.execution.streaming
import scala.collection.mutable
import org.apache.hadoop.fs.{FileStatus, Path}
import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.execution.datasources._
/**
* A [[FileCatalog]] that generates the list of files to processing by reading them from the
* metadata log files generated by the [[FileStreamSink]].
*/
class MetadataLogFileCatalog(sparkSession: SparkSession, path: Path)
extends PartitioningAwareFileCatalog(sparkSession, Map.empty, None) {
private val metadataDirectory = new Path(path, FileStreamSink.metadataDir)
logInfo(s"Reading streaming file log from $metadataDirectory")
private val metadataLog =
new FileStreamSinkLog(FileStreamSinkLog.VERSION, sparkSession, metadataDirectory.toUri.toString)
private val allFilesFromLog = metadataLog.allFiles().map(_.toFileStatus).filterNot(_.isDirectory)
private var cachedPartitionSpec: PartitionSpec = _
override protected val leafFiles: mutable.LinkedHashMap[Path, FileStatus] = {
new mutable.LinkedHashMap ++= allFilesFromLog.map(f => f.getPath -> f)
}
override protected val leafDirToChildrenFiles: Map[Path, Array[FileStatus]] = {
allFilesFromLog.toArray.groupBy(_.getPath.getParent)
}
override def rootPaths: Seq[Path] = path :: Nil
override def refresh(): Unit = { }
override def partitionSpec(): PartitionSpec = {
if (cachedPartitionSpec == null) {
cachedPartitionSpec = inferPartitioning()
}
cachedPartitionSpec
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (©) 2016 Jeff Harris <[email protected]>
* All rights reserved. Use of the code is allowed under the
* Artistic License 2.0 terms, as specified in the LICENSE file
* distributed with this code, or available from
* http://www.opensource.org/licenses/artistic-license-2.0.php
*/
package net.tjado.passwdsafe.test.util;
import net.tjado.passwdsafe.util.CountedBool;
import org.junit.Before;
import org.junit.Test;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
/**
* Unit tests for CountedBool
*/
public class CountedBoolTest
{
private CountedBool itsBool;
@Before
public void createBool()
{
itsBool = new CountedBool();
}
@Test
public void testDefault()
{
assertFalse(itsBool.get());
}
@Test
public void testUpdateTrueBasic()
{
assertEquals(CountedBool.StateChange.TRUE, itsBool.update(true));
assertTrue(itsBool.get());
assertEquals(CountedBool.StateChange.FALSE, itsBool.update(false));
assertFalse(itsBool.get());
}
@Test
public void testUpdateTrueMulti()
{
assertEquals(CountedBool.StateChange.TRUE, itsBool.update(true));
assertTrue(itsBool.get());
for (int i = 0; i < 10; ++i) {
assertEquals(CountedBool.StateChange.SAME, itsBool.update(true));
assertTrue(itsBool.get());
}
for (int i = 0; i < 10; ++i) {
assertEquals(CountedBool.StateChange.SAME, itsBool.update(false));
assertTrue(itsBool.get());
}
assertEquals(CountedBool.StateChange.FALSE, itsBool.update(false));
assertFalse(itsBool.get());
}
@Test
public void testUpdateTrueMultiMixed()
{
assertEquals(CountedBool.StateChange.TRUE, itsBool.update(true));
assertTrue(itsBool.get());
for (int i = 0; i < 10; ++i) {
assertEquals(CountedBool.StateChange.SAME, itsBool.update(true));
assertTrue(itsBool.get());
assertEquals(CountedBool.StateChange.SAME, itsBool.update(false));
assertTrue(itsBool.get());
}
assertEquals(CountedBool.StateChange.FALSE, itsBool.update(false));
assertFalse(itsBool.get());
}
@Test
public void testUpdateFalseBasic()
{
assertFalse(itsBool.get());
assertEquals(CountedBool.StateChange.SAME, itsBool.update(false));
assertFalse(itsBool.get());
assertEquals(CountedBool.StateChange.SAME, itsBool.update(true));
assertFalse(itsBool.get());
assertEquals(CountedBool.StateChange.TRUE, itsBool.update(true));
assertTrue(itsBool.get());
}
@Test
public void testUpdateFalseMulti()
{
assertFalse(itsBool.get());
for (int i = 0; i < 10; ++i) {
assertEquals(CountedBool.StateChange.SAME, itsBool.update(false));
assertFalse(itsBool.get());
}
for (int i = 0; i < 10; ++i) {
assertEquals(CountedBool.StateChange.SAME, itsBool.update(true));
assertFalse(itsBool.get());
}
assertEquals(CountedBool.StateChange.TRUE, itsBool.update(true));
assertTrue(itsBool.get());
}
@Test
public void testUpdateFalseMultiMixed()
{
assertFalse(itsBool.get());
for (int i = 0; i < 10; ++i) {
assertEquals(CountedBool.StateChange.SAME, itsBool.update(false));
assertFalse(itsBool.get());
assertEquals(CountedBool.StateChange.SAME, itsBool.update(true));
assertFalse(itsBool.get());
}
assertEquals(CountedBool.StateChange.TRUE, itsBool.update(true));
assertTrue(itsBool.get());
}
}
| {
"pile_set_name": "Github"
} |
cheats = 2
cheat0_desc = "Infinite Energy"
cheat0_code = "M 8 48378 58 0\nZ 8 48392 58 0"
cheat0_enable = false
cheat1_desc = "Infinite Time"
cheat1_code = "Z 8 49915 0 0"
cheat1_enable = false | {
"pile_set_name": "Github"
} |
<html>
<head>
<title>DarkBASIC Professional Help File</title>
</head>
<body background="..\..\gfx\dbpro_bg.jpg">
<!-- Page Header -->
<center><table width="340" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="..\..\gfx\dbph_head_1.jpg" width="102" height="51"></td>
<td><a href="..\..\main.htm"><img src="..\..\gfx\dbph_head_2.jpg" width="47" height="51" border="0"></a></td>
<td><a href="..\..\commands.htm"><img src="..\..\gfx\dbph_head_3.jpg" width="50" height="51" border="0"></a></td>
<td><a href="..\..\examples.htm"><img src="..\..\gfx\dbph_head_4.jpg" width="47" height="51" border="0"></a></td>
<td><a href="..\..\documents.htm"><img src="..\..\gfx\dbph_head_5.jpg" width="46" height="51" border="0"></a></td>
<td><a href="..\..\index.htm"><img src="..\..\gfx\dbph_head_6.jpg" width="56" height="51" border="0"></a></td>
</tr>
</table></center>
<font face="Verdana">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td>
<!-- Function Head -->
<font face="Verdana" size="5">
<b>
PHY SET PULLEY JOINT RIGID
</b>
<font face="Verdana" size="2">
<p>
Use this command to set the joint so it also maintains a minimum distance, not just a maximum.
</p>
</font>
<!-- Synopsis -->
<table width="590" cellpadding="3">
<tr><td bgcolor="#0d4283"><font color="#ffffff" size="3"><b>
Syntax
</b></font></td></tr>
</table>
<font face="Verdana" size="2">
<pre>
PHY SET PULLEY JOINT RIGID ID, state
</pre>
</font>
<!-- Parameters -->
<table width="590" cellpadding="3">
<tr><td bgcolor="#0d4283"><font color="#ffffff" size="3"><b>
Parameters
</b></font></td></tr>
</table>
<font face="Verdana" size="2">
<pre>
ID
</pre>
<blockquote>
Integer
<br>
identification number of the joint
</blockquote>
<pre>
state
</pre>
<blockquote>
Integer
<br>
use 1 to enable and 0 to disable
</blockquote>
</font>
<BR>
<!-- Returns -->
<table width="590" cellpadding="3">
<tr><td bgcolor="#0d4283"><font color="#ffffff" size="3"><b>
Returns
</b></font></td></tr>
</table>
<font face="Verdana" size="2">
<p>
</p>
</font>
<!-- Examples -->
<table width="590" cellpadding="3">
<tr><td bgcolor="#0d4283"><font color="#ffffff" size="3"><b>
Example Code
</b></font></td></tr>
</table>
<font face="Verdana" size="2">
<pre>
<blockquote>
No example code is provided for this command
</blockquote>
</pre>
</font>
<!-- Function Footer -->
</font>
</td></tr></table>
<br>
<!-- Page Footer -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><img src="..\..\gfx\dbph_foot_1.jpg" width="340" height="38"></td>
</tr>
</table>
</body>
</html>
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="a00228.html">tbb</a></li><li class="navelem"><a class="el" href="a00098.html">pre_scan_tag</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">tbb::pre_scan_tag Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="a00098.html">tbb::pre_scan_tag</a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>is_final_scan</b>() (defined in <a class="el" href="a00098.html">tbb::pre_scan_tag</a>)</td><td class="entry"><a class="el" href="a00098.html">tbb::pre_scan_tag</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr>
</table></div><!-- contents -->
<hr>
<p></p>
Copyright © 2005-2016 Intel Corporation. All Rights Reserved.
<p></p>
Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
registered trademarks or trademarks of Intel Corporation or its
subsidiaries in the United States and other countries.
<p></p>
* Other names and brands may be claimed as the property of others.
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.nio.ch.sctp;
import com.sun.nio.sctp.Association;
/**
* An implementation of Association
*/
public class AssociationImpl extends Association {
public AssociationImpl(int associationID,
int maxInStreams,
int maxOutStreams) {
super(associationID, maxInStreams, maxOutStreams);
}
@Override
public String toString() {
StringBuffer sb = new StringBuffer(super.toString());
return sb.append("[associationID:")
.append(associationID())
.append(", maxIn:")
.append(maxInboundStreams())
.append(", maxOut:")
.append(maxOutboundStreams())
.append("]")
.toString();
}
}
| {
"pile_set_name": "Github"
} |
/** @file
@section license License
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#pragma once
#include <cstddef>
#include <cstdint>
#include <cctype>
struct ATSHashBase {
virtual void update(const void *, size_t) = 0;
virtual void final() = 0;
virtual void clear() = 0;
virtual ~ATSHashBase();
};
struct ATSHash : ATSHashBase {
struct nullxfrm {
uint8_t
operator()(uint8_t byte) const
{
return byte;
}
};
struct nocase {
uint8_t
operator()(uint8_t byte) const
{
return toupper(byte);
}
};
virtual const void *get() const = 0;
virtual size_t size() const = 0;
virtual bool operator==(const ATSHash &) const;
};
struct ATSHash32 : ATSHashBase {
virtual uint32_t get() const = 0;
virtual bool operator==(const ATSHash32 &) const;
};
struct ATSHash64 : ATSHashBase {
virtual uint64_t get() const = 0;
virtual bool operator==(const ATSHash64 &) const;
};
| {
"pile_set_name": "Github"
} |
#
# 8390 device configuration
#
config NET_VENDOR_8390
bool "National Semi-conductor 8390 devices"
default y
depends on NET_VENDOR_NATSEMI
---help---
If you have a network (Ethernet) card belonging to this class, say Y.
Note that the answer to this question doesn't directly affect the
kernel: saying N will just cause the configurator to skip all
the questions about Western Digital cards. If you say Y, you will be
asked for your specific card in the following questions.
if NET_VENDOR_8390
config PCMCIA_AXNET
tristate "Asix AX88190 PCMCIA support"
depends on PCMCIA
---help---
Say Y here if you intend to attach an Asix AX88190-based PCMCIA
(PC-card) Fast Ethernet card to your computer. These cards are
nearly NE2000 compatible but need a separate driver due to a few
misfeatures.
To compile this driver as a module, choose M here: the module will be
called axnet_cs. If unsure, say N.
config AX88796
tristate "ASIX AX88796 NE2000 clone support"
depends on (ARM || MIPS || SUPERH)
select CRC32
select PHYLIB
select MDIO_BITBANG
---help---
AX88796 driver, using platform bus to provide
chip detection and resources
config AX88796_93CX6
bool "ASIX AX88796 external 93CX6 eeprom support"
depends on AX88796
select EEPROM_93CX6
---help---
Select this if your platform comes with an external 93CX6 eeprom.
config HYDRA
tristate "Hydra support"
depends on ZORRO
select CRC32
---help---
If you have a Hydra Ethernet adapter, say Y. Otherwise, say N.
To compile this driver as a module, choose M here: the module
will be called hydra.
config ARM_ETHERH
tristate "I-cubed EtherH/ANT EtherM support"
depends on ARM && ARCH_ACORN
select CRC32
---help---
If you have an Acorn system with one of these network cards, you
should say Y to this option if you wish to use it with Linux.
config MAC8390
tristate "Macintosh NS 8390 based ethernet cards"
depends on MAC
select CRC32
---help---
If you want to include a driver to support Nubus or LC-PDS
Ethernet cards using an NS8390 chipset or its equivalent, say Y.
config MCF8390
tristate "ColdFire NS8390 based Ethernet support"
depends on COLDFIRE
select CRC32
---help---
This driver is for Ethernet devices using an NS8390-compatible
chipset on many common ColdFire CPU based boards. Many of the older
Freescale dev boards use this, and some other common boards like
some SnapGear routers do as well.
If you have one of these boards and want to use the network interface
on them then choose Y. To compile this driver as a module, choose M
here, the module will be called mcf8390.
config NE2000
tristate "NE2000/NE1000 support"
depends on (ISA || (Q40 && m) || M32R || MACH_TX49XX || \
ATARI_ETHERNEC)
select CRC32
---help---
If you have a network (Ethernet) card of this type, say Y here.
Many Ethernet cards without a specific driver are compatible with
the NE2000.
If you have a PCI NE2000 card however, say N here and Y to "PCI
NE2000 and clone support" below.
To compile this driver as a module, choose M here. The module
will be called ne.
config NE2K_PCI
tristate "PCI NE2000 and clones support (see help)"
depends on PCI
select CRC32
---help---
This driver is for NE2000 compatible PCI cards. It will not work
with ISA NE2000 cards (they have their own driver, "NE2000/NE1000
support" below). If you have a PCI NE2000 network (Ethernet) card,
say Y here.
This driver also works for the following NE2000 clone cards:
RealTek RTL-8029 Winbond 89C940 Compex RL2000 KTI ET32P2
NetVin NV5000SC Via 86C926 SureCom NE34 Winbond
Holtek HT80232 Holtek HT80229
To compile this driver as a module, choose M here. The module
will be called ne2k-pci.
config APNE
tristate "PCMCIA NE2000 support"
depends on AMIGA_PCMCIA
select CRC32
---help---
If you have a PCMCIA NE2000 compatible adapter, say Y. Otherwise,
say N.
To compile this driver as a module, choose M here: the module
will be called apne.
config PCMCIA_PCNET
tristate "NE2000 compatible PCMCIA support"
depends on PCMCIA
select CRC32
---help---
Say Y here if you intend to attach an NE2000 compatible PCMCIA
(PC-card) Ethernet or Fast Ethernet card to your computer.
To compile this driver as a module, choose M here: the module will be
called pcnet_cs. If unsure, say N.
config STNIC
tristate "National DP83902AV support"
depends on SUPERH
select CRC32
---help---
Support for cards based on the National Semiconductor DP83902AV
ST-NIC Serial Network Interface Controller for Twisted Pair. This
is a 10Mbit/sec Ethernet controller. Product overview and specs at
<http://www.national.com/pf/DP/DP83902A.html>.
If unsure, say N.
config ULTRA
tristate "SMC Ultra support"
depends on ISA
select CRC32
---help---
If you have a network (Ethernet) card of this type, say Y here.
Important: There have been many reports that, with some motherboards
mixing an SMC Ultra and an Adaptec AHA154x SCSI card (or compatible,
such as some BusLogic models) causes corruption problems with many
operating systems. The Linux smc-ultra driver has a work-around for
this but keep it in mind if you have such a SCSI card and have
problems.
To compile this driver as a module, choose M here. The module
will be called smc-ultra.
config WD80x3
tristate "WD80*3 support"
depends on ISA
select CRC32
---help---
If you have a network (Ethernet) card of this type, say Y here.
To compile this driver as a module, choose M here. The module
will be called wd.
config ZORRO8390
tristate "Zorro NS8390-based Ethernet support"
depends on ZORRO
select CRC32
---help---
This driver is for Zorro Ethernet cards using an NS8390-compatible
chipset, like the Village Tronic Ariadne II and the Individual
Computers X-Surf Ethernet cards. If you have such a card, say Y.
Otherwise, say N.
To compile this driver as a module, choose M here: the module
will be called zorro8390.
endif # NET_VENDOR_8390
| {
"pile_set_name": "Github"
} |
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file threadPriority.h
* @author drose
* @date 2002-08-08
*/
#ifndef THREADPRIORITY_H
#define THREADPRIORITY_H
#include "pandabase.h"
BEGIN_PUBLISH
// An enumerated type used by Thread to specify a suggested relative priority
// for a particular thread.
enum ThreadPriority {
TP_low,
TP_normal,
TP_high,
TP_urgent
};
END_PUBLISH
EXPCL_PANDA_PIPELINE std::ostream &
operator << (std::ostream &out, ThreadPriority pri);
EXPCL_PANDA_PIPELINE std::istream &
operator >> (std::istream &in, ThreadPriority &pri);
#endif
| {
"pile_set_name": "Github"
} |
package eta.runtime;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class RuntimeOptions {
private Properties p;
public RuntimeOptions(String path) {
loadProperties(path);
}
/*
* Loads properties from resource which
* may be override by system properties
*/
private void loadProperties(String path) {
Properties lp = new Properties();
// Load properties from resource
try (InputStream in = getClass().getClassLoader().getResourceAsStream(path)) {
if (in != null) lp.load(in);
} catch (IOException e) {
e.printStackTrace();
}
Properties sp = System.getProperties();
/*
* Add properties loaded from resource to system properties
* without overriding existing ones
*/
for (String key : lp.stringPropertyNames()) {
if (sp.getProperty(key) == null) {
sp.setProperty(key, sp.getProperty(key));
}
}
p = sp;
}
public Properties getProperties() {
return p;
}
/*
* The following methods get and parse value from properties
* and return the provided default value if failed.
*/
public int getInt(String key, int d) {
String val = p.getProperty(key);
if (val == null) return d;
try {
return Integer.parseInt(val);
} catch (NumberFormatException e) {
return d;
}
}
public double getDouble(String key, double d) {
String val = p.getProperty(key);
if (val == null) return d;
try {
return Double.parseDouble(val);
} catch (NumberFormatException e) {
return d;
}
}
public boolean getBoolean(String key, boolean d) {
String val = p.getProperty(key);
if (val == null) return d;
// return true only if val equals "true"(case-insensitive) and false otherwise
return Boolean.parseBoolean(val);
}
} | {
"pile_set_name": "Github"
} |
"""SCons.Tool.Packaging.rpm
The rpm packager.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
__revision__ = "src/engine/SCons/Tool/packaging/rpm.py 5357 2011/09/09 21:31:03 bdeegan"
import os
import SCons.Builder
from SCons.Environment import OverrideEnvironment
from SCons.Tool.packaging import stripinstallbuilder, src_targz
from SCons.Errors import UserError
def package(env, target, source, PACKAGEROOT, NAME, VERSION,
PACKAGEVERSION, DESCRIPTION, SUMMARY, X_RPM_GROUP, LICENSE,
**kw):
# initialize the rpm tool
SCons.Tool.Tool('rpm').generate(env)
bld = env['BUILDERS']['Rpm']
# Generate a UserError whenever the target name has been set explicitly,
# since rpm does not allow for controlling it. This is detected by
# checking if the target has been set to the default by the Package()
# Environment function.
if str(target[0])!="%s-%s"%(NAME, VERSION):
raise UserError( "Setting target is not supported for rpm." )
else:
# This should be overridable from the construction environment,
# which it is by using ARCHITECTURE=.
# Guessing based on what os.uname() returns at least allows it
# to work for both i386 and x86_64 Linux systems.
archmap = {
'i686' : 'i386',
'i586' : 'i386',
'i486' : 'i386',
}
buildarchitecture = os.uname()[4]
buildarchitecture = archmap.get(buildarchitecture, buildarchitecture)
if 'ARCHITECTURE' in kw:
buildarchitecture = kw['ARCHITECTURE']
fmt = '%s-%s-%s.%s.rpm'
srcrpm = fmt % (NAME, VERSION, PACKAGEVERSION, 'src')
binrpm = fmt % (NAME, VERSION, PACKAGEVERSION, buildarchitecture)
target = [ srcrpm, binrpm ]
# get the correct arguments into the kw hash
loc=locals()
del loc['kw']
kw.update(loc)
del kw['source'], kw['target'], kw['env']
# if no "SOURCE_URL" tag is given add a default one.
if 'SOURCE_URL' not in kw:
#kw['SOURCE_URL']=(str(target[0])+".tar.gz").replace('.rpm', '')
kw['SOURCE_URL']=(str(target[0])+".tar.gz").replace('.rpm', '')
# mangle the source and target list for the rpmbuild
env = OverrideEnvironment(env, kw)
target, source = stripinstallbuilder(target, source, env)
target, source = addspecfile(target, source, env)
target, source = collectintargz(target, source, env)
# now call the rpm builder to actually build the packet.
return bld(env, target, source, **kw)
def collectintargz(target, source, env):
""" Puts all source files into a tar.gz file. """
# the rpm tool depends on a source package, until this is chagned
# this hack needs to be here that tries to pack all sources in.
sources = env.FindSourceFiles()
# filter out the target we are building the source list for.
#sources = [s for s in sources if not (s in target)]
sources = [s for s in sources if s not in target]
# find the .spec file for rpm and add it since it is not necessarily found
# by the FindSourceFiles function.
#sources.extend( [s for s in source if str(s).rfind('.spec')!=-1] )
spec_file = lambda s: str(s).rfind('.spec') != -1
sources.extend( list(filter(spec_file, source)) )
# as the source contains the url of the source package this rpm package
# is built from, we extract the target name
#tarball = (str(target[0])+".tar.gz").replace('.rpm', '')
tarball = (str(target[0])+".tar.gz").replace('.rpm', '')
try:
#tarball = env['SOURCE_URL'].split('/')[-1]
tarball = env['SOURCE_URL'].split('/')[-1]
except KeyError, e:
raise SCons.Errors.UserError( "Missing PackageTag '%s' for RPM packager" % e.args[0] )
tarball = src_targz.package(env, source=sources, target=tarball,
PACKAGEROOT=env['PACKAGEROOT'], )
return (target, tarball)
def addspecfile(target, source, env):
specfile = "%s-%s" % (env['NAME'], env['VERSION'])
bld = SCons.Builder.Builder(action = build_specfile,
suffix = '.spec',
target_factory = SCons.Node.FS.File)
source.extend(bld(env, specfile, source))
return (target,source)
def build_specfile(target, source, env):
""" Builds a RPM specfile from a dictionary with string metadata and
by analyzing a tree of nodes.
"""
file = open(target[0].abspath, 'w')
str = ""
try:
file.write( build_specfile_header(env) )
file.write( build_specfile_sections(env) )
file.write( build_specfile_filesection(env, source) )
file.close()
# call a user specified function
if 'CHANGE_SPECFILE' in env:
env['CHANGE_SPECFILE'](target, source)
except KeyError, e:
raise SCons.Errors.UserError( '"%s" package field for RPM is missing.' % e.args[0] )
#
# mandatory and optional package tag section
#
def build_specfile_sections(spec):
""" Builds the sections of a rpm specfile.
"""
str = ""
mandatory_sections = {
'DESCRIPTION' : '\n%%description\n%s\n\n', }
str = str + SimpleTagCompiler(mandatory_sections).compile( spec )
optional_sections = {
'DESCRIPTION_' : '%%description -l %s\n%s\n\n',
'CHANGELOG' : '%%changelog\n%s\n\n',
'X_RPM_PREINSTALL' : '%%pre\n%s\n\n',
'X_RPM_POSTINSTALL' : '%%post\n%s\n\n',
'X_RPM_PREUNINSTALL' : '%%preun\n%s\n\n',
'X_RPM_POSTUNINSTALL' : '%%postun\n%s\n\n',
'X_RPM_VERIFY' : '%%verify\n%s\n\n',
# These are for internal use but could possibly be overriden
'X_RPM_PREP' : '%%prep\n%s\n\n',
'X_RPM_BUILD' : '%%build\n%s\n\n',
'X_RPM_INSTALL' : '%%install\n%s\n\n',
'X_RPM_CLEAN' : '%%clean\n%s\n\n',
}
# Default prep, build, install and clean rules
# TODO: optimize those build steps, to not compile the project a second time
if 'X_RPM_PREP' not in spec:
spec['X_RPM_PREP'] = '[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT"' + '\n%setup -q'
if 'X_RPM_BUILD' not in spec:
spec['X_RPM_BUILD'] = 'mkdir "$RPM_BUILD_ROOT"'
if 'X_RPM_INSTALL' not in spec:
spec['X_RPM_INSTALL'] = 'scons --install-sandbox="$RPM_BUILD_ROOT" "$RPM_BUILD_ROOT"'
if 'X_RPM_CLEAN' not in spec:
spec['X_RPM_CLEAN'] = '[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT"'
str = str + SimpleTagCompiler(optional_sections, mandatory=0).compile( spec )
return str
def build_specfile_header(spec):
""" Builds all section but the %file of a rpm specfile
"""
str = ""
# first the mandatory sections
mandatory_header_fields = {
'NAME' : '%%define name %s\nName: %%{name}\n',
'VERSION' : '%%define version %s\nVersion: %%{version}\n',
'PACKAGEVERSION' : '%%define release %s\nRelease: %%{release}\n',
'X_RPM_GROUP' : 'Group: %s\n',
'SUMMARY' : 'Summary: %s\n',
'LICENSE' : 'License: %s\n', }
str = str + SimpleTagCompiler(mandatory_header_fields).compile( spec )
# now the optional tags
optional_header_fields = {
'VENDOR' : 'Vendor: %s\n',
'X_RPM_URL' : 'Url: %s\n',
'SOURCE_URL' : 'Source: %s\n',
'SUMMARY_' : 'Summary(%s): %s\n',
'X_RPM_DISTRIBUTION' : 'Distribution: %s\n',
'X_RPM_ICON' : 'Icon: %s\n',
'X_RPM_PACKAGER' : 'Packager: %s\n',
'X_RPM_GROUP_' : 'Group(%s): %s\n',
'X_RPM_REQUIRES' : 'Requires: %s\n',
'X_RPM_PROVIDES' : 'Provides: %s\n',
'X_RPM_CONFLICTS' : 'Conflicts: %s\n',
'X_RPM_BUILDREQUIRES' : 'BuildRequires: %s\n',
'X_RPM_SERIAL' : 'Serial: %s\n',
'X_RPM_EPOCH' : 'Epoch: %s\n',
'X_RPM_AUTOREQPROV' : 'AutoReqProv: %s\n',
'X_RPM_EXCLUDEARCH' : 'ExcludeArch: %s\n',
'X_RPM_EXCLUSIVEARCH' : 'ExclusiveArch: %s\n',
'X_RPM_PREFIX' : 'Prefix: %s\n',
'X_RPM_CONFLICTS' : 'Conflicts: %s\n',
# internal use
'X_RPM_BUILDROOT' : 'BuildRoot: %s\n', }
# fill in default values:
# Adding a BuildRequires renders the .rpm unbuildable under System, which
# are not managed by rpm, since the database to resolve this dependency is
# missing (take Gentoo as an example)
# if not s.has_key('x_rpm_BuildRequires'):
# s['x_rpm_BuildRequires'] = 'scons'
if 'X_RPM_BUILDROOT' not in spec:
spec['X_RPM_BUILDROOT'] = '%{_tmppath}/%{name}-%{version}-%{release}'
str = str + SimpleTagCompiler(optional_header_fields, mandatory=0).compile( spec )
return str
#
# mandatory and optional file tags
#
def build_specfile_filesection(spec, files):
""" builds the %file section of the specfile
"""
str = '%files\n'
if 'X_RPM_DEFATTR' not in spec:
spec['X_RPM_DEFATTR'] = '(-,root,root)'
str = str + '%%defattr %s\n' % spec['X_RPM_DEFATTR']
supported_tags = {
'PACKAGING_CONFIG' : '%%config %s',
'PACKAGING_CONFIG_NOREPLACE' : '%%config(noreplace) %s',
'PACKAGING_DOC' : '%%doc %s',
'PACKAGING_UNIX_ATTR' : '%%attr %s',
'PACKAGING_LANG_' : '%%lang(%s) %s',
'PACKAGING_X_RPM_VERIFY' : '%%verify %s',
'PACKAGING_X_RPM_DIR' : '%%dir %s',
'PACKAGING_X_RPM_DOCDIR' : '%%docdir %s',
'PACKAGING_X_RPM_GHOST' : '%%ghost %s', }
for file in files:
# build the tagset
tags = {}
for k in supported_tags.keys():
try:
tags[k]=getattr(file, k)
except AttributeError:
pass
# compile the tagset
str = str + SimpleTagCompiler(supported_tags, mandatory=0).compile( tags )
str = str + ' '
str = str + file.PACKAGING_INSTALL_LOCATION
str = str + '\n\n'
return str
class SimpleTagCompiler(object):
""" This class is a simple string substition utility:
the replacement specfication is stored in the tagset dictionary, something
like:
{ "abc" : "cdef %s ",
"abc_" : "cdef %s %s" }
the compile function gets a value dictionary, which may look like:
{ "abc" : "ghij",
"abc_gh" : "ij" }
The resulting string will be:
"cdef ghij cdef gh ij"
"""
def __init__(self, tagset, mandatory=1):
self.tagset = tagset
self.mandatory = mandatory
def compile(self, values):
""" compiles the tagset and returns a str containing the result
"""
def is_international(tag):
#return tag.endswith('_')
return tag[-1:] == '_'
def get_country_code(tag):
return tag[-2:]
def strip_country_code(tag):
return tag[:-2]
replacements = list(self.tagset.items())
str = ""
#domestic = [ (k,v) for k,v in replacements if not is_international(k) ]
domestic = [t for t in replacements if not is_international(t[0])]
for key, replacement in domestic:
try:
str = str + replacement % values[key]
except KeyError, e:
if self.mandatory:
raise e
#international = [ (k,v) for k,v in replacements if is_international(k) ]
international = [t for t in replacements if is_international(t[0])]
for key, replacement in international:
try:
#int_values_for_key = [ (get_country_code(k),v) for k,v in values.items() if strip_country_code(k) == key ]
x = [t for t in values.items() if strip_country_code(t[0]) == key]
int_values_for_key = [(get_country_code(t[0]),t[1]) for t in x]
for v in int_values_for_key:
str = str + replacement % v
except KeyError, e:
if self.mandatory:
raise e
return str
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
| {
"pile_set_name": "Github"
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="Start" href="index.html">
<link rel="previous" href="Stdlib.Scanf.html">
<link rel="next" href="Stdlib.Set.html">
<link rel="Up" href="Stdlib.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of extensions" rel=Appendix href="index_extensions.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="Arg" rel="Chapter" href="Arg.html">
<link title="Array" rel="Chapter" href="Array.html">
<link title="ArrayLabels" rel="Chapter" href="ArrayLabels.html">
<link title="Bigarray" rel="Chapter" href="Bigarray.html">
<link title="Bool" rel="Chapter" href="Bool.html">
<link title="Buffer" rel="Chapter" href="Buffer.html">
<link title="Bytes" rel="Chapter" href="Bytes.html">
<link title="BytesLabels" rel="Chapter" href="BytesLabels.html">
<link title="Callback" rel="Chapter" href="Callback.html">
<link title="CamlinternalFormat" rel="Chapter" href="CamlinternalFormat.html">
<link title="CamlinternalFormatBasics" rel="Chapter" href="CamlinternalFormatBasics.html">
<link title="CamlinternalLazy" rel="Chapter" href="CamlinternalLazy.html">
<link title="CamlinternalMod" rel="Chapter" href="CamlinternalMod.html">
<link title="CamlinternalOO" rel="Chapter" href="CamlinternalOO.html">
<link title="Char" rel="Chapter" href="Char.html">
<link title="Complex" rel="Chapter" href="Complex.html">
<link title="Condition" rel="Chapter" href="Condition.html">
<link title="Digest" rel="Chapter" href="Digest.html">
<link title="Dynlink" rel="Chapter" href="Dynlink.html">
<link title="Ephemeron" rel="Chapter" href="Ephemeron.html">
<link title="Event" rel="Chapter" href="Event.html">
<link title="Filename" rel="Chapter" href="Filename.html">
<link title="Float" rel="Chapter" href="Float.html">
<link title="Format" rel="Chapter" href="Format.html">
<link title="Fun" rel="Chapter" href="Fun.html">
<link title="Gc" rel="Chapter" href="Gc.html">
<link title="Genlex" rel="Chapter" href="Genlex.html">
<link title="Graphics" rel="Chapter" href="Graphics.html">
<link title="GraphicsX11" rel="Chapter" href="GraphicsX11.html">
<link title="Hashtbl" rel="Chapter" href="Hashtbl.html">
<link title="Int" rel="Chapter" href="Int.html">
<link title="Int32" rel="Chapter" href="Int32.html">
<link title="Int64" rel="Chapter" href="Int64.html">
<link title="Lazy" rel="Chapter" href="Lazy.html">
<link title="Lexing" rel="Chapter" href="Lexing.html">
<link title="List" rel="Chapter" href="List.html">
<link title="ListLabels" rel="Chapter" href="ListLabels.html">
<link title="Map" rel="Chapter" href="Map.html">
<link title="Marshal" rel="Chapter" href="Marshal.html">
<link title="MoreLabels" rel="Chapter" href="MoreLabels.html">
<link title="Mutex" rel="Chapter" href="Mutex.html">
<link title="Nativeint" rel="Chapter" href="Nativeint.html">
<link title="Obj" rel="Chapter" href="Obj.html">
<link title="Ocaml_operators" rel="Chapter" href="Ocaml_operators.html">
<link title="Oo" rel="Chapter" href="Oo.html">
<link title="Option" rel="Chapter" href="Option.html">
<link title="Parsing" rel="Chapter" href="Parsing.html">
<link title="Pervasives" rel="Chapter" href="Pervasives.html">
<link title="Printexc" rel="Chapter" href="Printexc.html">
<link title="Printf" rel="Chapter" href="Printf.html">
<link title="Queue" rel="Chapter" href="Queue.html">
<link title="Random" rel="Chapter" href="Random.html">
<link title="Result" rel="Chapter" href="Result.html">
<link title="Scanf" rel="Chapter" href="Scanf.html">
<link title="Seq" rel="Chapter" href="Seq.html">
<link title="Set" rel="Chapter" href="Set.html">
<link title="Spacetime" rel="Chapter" href="Spacetime.html">
<link title="Stack" rel="Chapter" href="Stack.html">
<link title="StdLabels" rel="Chapter" href="StdLabels.html">
<link title="Stdlib" rel="Chapter" href="Stdlib.html">
<link title="Str" rel="Chapter" href="Str.html">
<link title="Stream" rel="Chapter" href="Stream.html">
<link title="String" rel="Chapter" href="String.html">
<link title="StringLabels" rel="Chapter" href="StringLabels.html">
<link title="Sys" rel="Chapter" href="Sys.html">
<link title="Thread" rel="Chapter" href="Thread.html">
<link title="ThreadUnix" rel="Chapter" href="ThreadUnix.html">
<link title="Uchar" rel="Chapter" href="Uchar.html">
<link title="Unit" rel="Chapter" href="Unit.html">
<link title="Unix" rel="Chapter" href="Unix.html">
<link title="UnixLabels" rel="Chapter" href="UnixLabels.html">
<link title="Weak" rel="Chapter" href="Weak.html"><title>Stdlib.Seq</title>
</head>
<body>
<div class="navbar"><a class="pre" href="Stdlib.Scanf.html" title="Stdlib.Scanf">Previous</a>
<a class="up" href="Stdlib.html" title="Stdlib">Up</a>
<a class="post" href="Stdlib.Set.html" title="Stdlib.Set">Next</a>
</div>
<h1>Module <a href="type_Stdlib.Seq.html">Stdlib.Seq</a></h1>
<pre><span id="MODULESeq"><span class="keyword">module</span> Seq</span>: <code class="type"><a href="Seq.html">Seq</a></code></pre><hr width="100%">
<p>The type <code class="code"><span class="keywordsign">'</span>a t</code> is a <b>delayed list</b>, i.e. a list where some evaluation
is needed to access the next element. This makes it possible to build
infinite sequences, to build sequences as we traverse them, and to transform
them in a lazy fashion rather than upfront.</p>
<pre><span id="TYPEt"><span class="keyword">type</span> <code class="type">'a</code> t</span> = <code class="type">unit -> 'a <a href="Seq.html#TYPEnode">node</a></code> </pre>
<div class="info ">
<div class="info-desc">
<p>The type of delayed lists containing elements of type <code class="code"><span class="keywordsign">'</span>a</code>.
Note that the concrete list node <code class="code"><span class="keywordsign">'</span>a node</code> is delayed under a closure,
not a <code class="code"><span class="keyword">lazy</span></code> block, which means it might be recomputed every time
we access it.</p>
</div>
</div>
<pre><code><span id="TYPEnode"><span class="keyword">type</span> <code class="type">'a</code> node</span> = </code></pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTnode.Nil"><span class="constructor">Nil</span></span></code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTnode.Cons"><span class="constructor">Cons</span></span> <span class="keyword">of</span> <code class="type">'a * 'a <a href="Seq.html#TYPEt">t</a></code></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><div class="info ">
<div class="info-desc">
<p>A fully-evaluated list node, either empty or containing an element
and a delayed tail.</p>
</div>
</div>
</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr></table>
<pre><span id="VALempty"><span class="keyword">val</span> empty</span> : <code class="type">'a <a href="Seq.html#TYPEt">t</a></code></pre><div class="info ">
<div class="info-desc">
<p>The empty sequence, containing no elements.</p>
</div>
</div>
<pre><span id="VALreturn"><span class="keyword">val</span> return</span> : <code class="type">'a -> 'a <a href="Seq.html#TYPEt">t</a></code></pre><div class="info ">
<div class="info-desc">
<p>The singleton sequence containing only the given element.</p>
</div>
</div>
<pre><span id="VALmap"><span class="keyword">val</span> map</span> : <code class="type">('a -> 'b) -> 'a <a href="Seq.html#TYPEt">t</a> -> 'b <a href="Seq.html#TYPEt">t</a></code></pre><div class="info ">
<div class="info-desc">
<p><code class="code">map f seq</code> returns a new sequence whose elements are the elements of
<code class="code">seq</code>, transformed by <code class="code">f</code>.
This transformation is lazy, it only applies when the result is traversed.</p>
<p>If <code class="code">seq = [1;2;3]</code>, then <code class="code">map f seq = [f 1; f 2; f 3]</code>.</p>
</div>
</div>
<pre><span id="VALfilter"><span class="keyword">val</span> filter</span> : <code class="type">('a -> bool) -> 'a <a href="Seq.html#TYPEt">t</a> -> 'a <a href="Seq.html#TYPEt">t</a></code></pre><div class="info ">
<div class="info-desc">
<p>Remove from the sequence the elements that do not satisfy the
given predicate.
This transformation is lazy, it only applies when the result is
traversed.</p>
</div>
</div>
<pre><span id="VALfilter_map"><span class="keyword">val</span> filter_map</span> : <code class="type">('a -> 'b option) -> 'a <a href="Seq.html#TYPEt">t</a> -> 'b <a href="Seq.html#TYPEt">t</a></code></pre><div class="info ">
<div class="info-desc">
<p>Apply the function to every element; if <code class="code">f x = <span class="constructor">None</span></code> then <code class="code">x</code> is dropped;
if <code class="code">f x = <span class="constructor">Some</span> y</code> then <code class="code">y</code> is returned.
This transformation is lazy, it only applies when the result is
traversed.</p>
</div>
</div>
<pre><span id="VALflat_map"><span class="keyword">val</span> flat_map</span> : <code class="type">('a -> 'b <a href="Seq.html#TYPEt">t</a>) -> 'a <a href="Seq.html#TYPEt">t</a> -> 'b <a href="Seq.html#TYPEt">t</a></code></pre><div class="info ">
<div class="info-desc">
<p>Map each element to a subsequence, then return each element of this
sub-sequence in turn.
This transformation is lazy, it only applies when the result is
traversed.</p>
</div>
</div>
<pre><span id="VALfold_left"><span class="keyword">val</span> fold_left</span> : <code class="type">('a -> 'b -> 'a) -> 'a -> 'b <a href="Seq.html#TYPEt">t</a> -> 'a</code></pre><div class="info ">
<div class="info-desc">
<p>Traverse the sequence from left to right, combining each element with the
accumulator using the given function.
The traversal happens immediately and will not terminate on infinite
sequences.</p>
<p>Also see <a href="List.html#VALfold_left"><code class="code"><span class="constructor">List</span>.fold_left</code></a></p>
</div>
</div>
<pre><span id="VALiter"><span class="keyword">val</span> iter</span> : <code class="type">('a -> unit) -> 'a <a href="Seq.html#TYPEt">t</a> -> unit</code></pre><div class="info ">
<div class="info-desc">
<p>Iterate on the sequence, calling the (imperative) function on every element.
The traversal happens immediately and will not terminate on infinite
sequences.</p>
</div>
</div>
</body></html>
| {
"pile_set_name": "Github"
} |
<?php
return [
'Tracking Code' => 'İzleme Kodu',
];
| {
"pile_set_name": "Github"
} |
Download and docs:
http://pypi.python.org/pypi/colorama
Development:
http://code.google.com/p/colorama
Discussion group:
https://groups.google.com/forum/#!forum/python-colorama
Description
===========
Makes ANSI escape character sequences for producing colored terminal text and
cursor positioning work under MS Windows.
ANSI escape character sequences have long been used to produce colored terminal
text and cursor positioning on Unix and Macs. Colorama makes this work on
Windows, too, by wrapping stdout, stripping ANSI sequences it finds (which
otherwise show up as gobbledygook in your output), and converting them into the
appropriate win32 calls to modify the state of the terminal. On other platforms,
Colorama does nothing.
Colorama also provides some shortcuts to help generate ANSI sequences
but works fine in conjunction with any other ANSI sequence generation library,
such as Termcolor (http://pypi.python.org/pypi/termcolor.)
This has the upshot of providing a simple cross-platform API for printing
colored terminal text from Python, and has the happy side-effect that existing
applications or libraries which use ANSI sequences to produce colored output on
Linux or Macs can now also work on Windows, simply by calling
``colorama.init()``.
An alternative approach is to install 'ansi.sys' on Windows machines, which
provides the same behaviour for all applications running in terminals. Colorama
is intended for situations where that isn't easy (e.g. maybe your app doesn't
have an installer.)
Demo scripts in the source code repository prints some colored text using
ANSI sequences. Compare their output under Gnome-terminal's built in ANSI
handling, versus on Windows Command-Prompt using Colorama:
.. image:: http://colorama.googlecode.com/hg/screenshots/ubuntu-demo.png
:width: 661
:height: 357
:alt: ANSI sequences on Ubuntu under gnome-terminal.
.. image:: http://colorama.googlecode.com/hg/screenshots/windows-demo.png
:width: 668
:height: 325
:alt: Same ANSI sequences on Windows, using Colorama.
These screengrabs show that Colorama on Windows does not support ANSI 'dim
text': it looks the same as 'normal text'.
License
=======
Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
Dependencies
============
None, other than Python. Tested on Python 2.5.5, 2.6.5, 2.7, 3.1.2, and 3.2
Usage
=====
Initialisation
--------------
Applications should initialise Colorama using::
from colorama import init
init()
If you are on Windows, the call to ``init()`` will start filtering ANSI escape
sequences out of any text sent to stdout or stderr, and will replace them with
equivalent Win32 calls.
Calling ``init()`` has no effect on other platforms (unless you request other
optional functionality, see keyword args below.) The intention is that
applications can call ``init()`` unconditionally on all platforms, after which
ANSI output should just work.
To stop using colorama before your program exits, simply call ``deinit()``.
This will restore stdout and stderr to their original values, so that Colorama
is disabled. To start using Colorama again, call ``reinit()``, which wraps
stdout and stderr again, but is cheaper to call than doing ``init()`` all over
again.
Colored Output
--------------
Cross-platform printing of colored text can then be done using Colorama's
constant shorthand for ANSI escape sequences::
from colorama import Fore, Back, Style
print(Fore.RED + 'some red text')
print(Back.GREEN + 'and with a green background')
print(Style.DIM + 'and in dim text')
print(Fore.RESET + Back.RESET + Style.RESET_ALL)
print('back to normal now')
or simply by manually printing ANSI sequences from your own code::
print('/033[31m' + 'some red text')
print('/033[30m' # and reset to default color)
or Colorama can be used happily in conjunction with existing ANSI libraries
such as Termcolor::
from colorama import init
from termcolor import colored
# use Colorama to make Termcolor work on Windows too
init()
# then use Termcolor for all colored text output
print(colored('Hello, World!', 'green', 'on_red'))
Available formatting constants are::
Fore: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET.
Back: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET.
Style: DIM, NORMAL, BRIGHT, RESET_ALL
Style.RESET_ALL resets foreground, background and brightness. Colorama will
perform this reset automatically on program exit.
Cursor Positioning
------------------
ANSI codes to reposition the cursor are supported. See demos/demo06.py for
an example of how to generate them.
Init Keyword Args
-----------------
``init()`` accepts some kwargs to override default behaviour.
init(autoreset=False):
If you find yourself repeatedly sending reset sequences to turn off color
changes at the end of every print, then ``init(autoreset=True)`` will
automate that::
from colorama import init
init(autoreset=True)
print(Fore.RED + 'some red text')
print('automatically back to default color again')
init(strip=None):
Pass ``True`` or ``False`` to override whether ansi codes should be
stripped from the output. The default behaviour is to strip if on Windows.
init(convert=None):
Pass ``True`` or ``False`` to override whether to convert ansi codes in the
output into win32 calls. The default behaviour is to convert if on Windows
and output is to a tty (terminal).
init(wrap=True):
On Windows, colorama works by replacing ``sys.stdout`` and ``sys.stderr``
with proxy objects, which override the .write() method to do their work. If
this wrapping causes you problems, then this can be disabled by passing
``init(wrap=False)``. The default behaviour is to wrap if autoreset or
strip or convert are True.
When wrapping is disabled, colored printing on non-Windows platforms will
continue to work as normal. To do cross-platform colored output, you can
use Colorama's ``AnsiToWin32`` proxy directly::
import sys
from colorama import init, AnsiToWin32
init(wrap=False)
stream = AnsiToWin32(sys.stderr).stream
# Python 2
print >>stream, Fore.BLUE + 'blue text on stderr'
# Python 3
print(Fore.BLUE + 'blue text on stderr', file=stream)
Status & Known Problems
=======================
I've personally only tested it on WinXP (CMD, Console2), Ubuntu
(gnome-terminal, xterm), and OSX.
Some presumably valid ANSI sequences aren't recognised (see details below)
but to my knowledge nobody has yet complained about this. Puzzling.
See outstanding issues and wishlist at:
http://code.google.com/p/colorama/issues/list
If anything doesn't work for you, or doesn't do what you expected or hoped for,
I'd love to hear about it on that issues list, would be delighted by patches,
and would be happy to grant commit access to anyone who submits a working patch
or two.
Recognised ANSI Sequences
=========================
ANSI sequences generally take the form:
ESC [ <param> ; <param> ... <command>
Where <param> is an integer, and <command> is a single letter. Zero or more
params are passed to a <command>. If no params are passed, it is generally
synonymous with passing a single zero. No spaces exist in the sequence, they
have just been inserted here to make it easy to read.
The only ANSI sequences that colorama converts into win32 calls are::
ESC [ 0 m # reset all (colors and brightness)
ESC [ 1 m # bright
ESC [ 2 m # dim (looks same as normal brightness)
ESC [ 22 m # normal brightness
# FOREGROUND:
ESC [ 30 m # black
ESC [ 31 m # red
ESC [ 32 m # green
ESC [ 33 m # yellow
ESC [ 34 m # blue
ESC [ 35 m # magenta
ESC [ 36 m # cyan
ESC [ 37 m # white
ESC [ 39 m # reset
# BACKGROUND
ESC [ 40 m # black
ESC [ 41 m # red
ESC [ 42 m # green
ESC [ 43 m # yellow
ESC [ 44 m # blue
ESC [ 45 m # magenta
ESC [ 46 m # cyan
ESC [ 47 m # white
ESC [ 49 m # reset
# cursor positioning
ESC [ y;x H # position cursor at x across, y down
# clear the screen
ESC [ mode J # clear the screen. Only mode 2 (clear entire screen)
# is supported. It should be easy to add other modes,
# let me know if that would be useful.
Multiple numeric params to the 'm' command can be combined into a single
sequence, eg::
ESC [ 36 ; 45 ; 1 m # bright cyan text on magenta background
All other ANSI sequences of the form ``ESC [ <param> ; <param> ... <command>``
are silently stripped from the output on Windows.
Any other form of ANSI sequence, such as single-character codes or alternative
initial characters, are not recognised nor stripped. It would be cool to add
them though. Let me know if it would be useful for you, via the issues on
google code.
Development
===========
Help and fixes welcome! Ask Jonathan for commit rights, you'll get them.
Running tests requires:
- Michael Foord's 'mock' module to be installed.
- Tests are written using the 2010 era updates to 'unittest', and require to
be run either using Python2.7 or greater, or else to have Michael Foord's
'unittest2' module installed.
unittest2 test discovery doesn't work for colorama, so I use 'nose'::
nosetests -s
The -s is required because 'nosetests' otherwise applies a proxy of its own to
stdout, which confuses the unit tests.
Contact
=======
Created by Jonathan Hartley, [email protected]
Thanks
======
| Ben Hoyt, for a magnificent fix under 64-bit Windows.
| Jesse@EmptySquare for submitting a fix for examples in the README.
| User 'jamessp', an observant documentation fix for cursor positioning.
| User 'vaal1239', Dave Mckee & Lackner Kristof for a tiny but much-needed Win7 fix.
| Julien Stuyck, for wisely suggesting Python3 compatible updates to README.
| Daniel Griffith for multiple fabulous patches.
| Oscar Lesta for valuable fix to stop ANSI chars being sent to non-tty output.
| Roger Binns, for many suggestions, valuable feedback, & bug reports.
| Tim Golden for thought and much appreciated feedback on the initial idea.
| {
"pile_set_name": "Github"
} |
/*=======================================
Template Design By MarkUps
Author URI : http://www.markups.io/
========================================*/
.mu-service-icon-box,
.mu-team-social-info a:hover,
.mu-team-social-info a:focus,
.mu-testimonial-slide .slick-dots li button::before,
.mu-testimonial-slide .slick-dots li.slick-active button::before,
.mu-footer-area a:hover,
.mu-footer-area a:focus,
.mu-hero-left .mu-primary-btn,
.mu-hero-left .mu-primary-btn:hover,
.mu-hero-left .mu-primary-btn:focus,
.mu-single-counter i,
.counter-value {
color: #ee4532;
}
.mu-send-msg-btn:hover,
.mu-send-msg-btn:focus,
.mu-book-overview-icon-box,
.mu-social-media a,
.mu-social-media a:hover,
.mu-social-media a:focus,
.mu-order-btn:hover,
.mu-order-btn:focus {
border: 1px solid #ee4532;
color: #ee4532;
}
.mu-send-msg-btn {
border: 1px solid #ee4532;
background-color: #ee4532;
}
#mu-hero,
.mu-testimonial-slide .slick-dots li button:hover,
.mu-testimonial-slide .slick-dots li button:focus,
.mu-testimonial-slide .slick-dots li.slick-active button,
.mu-header-dot,
.mu-author-social a,
.mu-pricing-content .mu-popular-price-tag,
#mu-video-review:before {
background-color: #ee4532;
}
.mu-contact-form .form-control:focus,
.mu-testimonial-slide .slick-dots li button:hover,
.mu-testimonial-slide .slick-dots li button:focus,
.mu-testimonial-slide .slick-dots li.slick-active button{
border: 1px solid #ee4532;
}
| {
"pile_set_name": "Github"
} |
// Copyright (C) 2013 Davis E. King ([email protected])
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_sIMD4I_Hh_
#define DLIB_sIMD4I_Hh_
#include "simd_check.h"
#include "../uintn.h"
namespace dlib
{
#ifdef DLIB_HAVE_SSE2
class simd4i
{
public:
typedef int32 type;
inline simd4i() {}
inline simd4i(int32 f) { x = _mm_set1_epi32(f); }
inline simd4i(int32 r0, int32 r1, int32 r2, int32 r3) { x = _mm_setr_epi32(r0,r1,r2,r3); }
inline simd4i(const __m128i& val):x(val) {}
inline simd4i& operator=(const __m128i& val)
{
x = val;
return *this;
}
inline operator __m128i() const { return x; }
inline void load_aligned(const type* ptr) { x = _mm_load_si128((const __m128i*)ptr); }
inline void store_aligned(type* ptr) const { _mm_store_si128((__m128i*)ptr, x); }
inline void load(const type* ptr) { x = _mm_loadu_si128((const __m128i*)ptr); }
inline void store(type* ptr) const { _mm_storeu_si128((__m128i*)ptr, x); }
inline unsigned int size() const { return 4; }
inline int32 operator[](unsigned int idx) const
{
int32 temp[4];
store(temp);
return temp[idx];
}
private:
__m128i x;
};
#elif defined(DLIB_HAVE_VSX)
class simd4i
{
typedef union {
vector signed int v;
vector bool int b;
signed int x[4];
} v4i;
v4i x;
public:
inline simd4i() : x{0,0,0,0} { }
inline simd4i(const simd4i& v) : x(v.x) { }
inline simd4i(const vector int& v) : x{v} { }
inline simd4i(const vector bool int& b) { x.b=b; }
inline simd4i(int32 f) : x{f,f,f,f} { }
inline simd4i(int32 r0, int32 r1, int32 r2, int32 r3)
: x{r0,r1,r2,r3} { }
inline simd4i& operator=(const simd4i& v) { x = v.x; return *this; }
inline simd4i& operator=(const int32& v) { *this = simd4i(v); return *this; }
inline vector signed int operator() () const { return x.v; }
inline int32 operator[](unsigned int idx) const { return x.x[idx]; }
inline vector bool int to_bool() const { return x.b; }
// intrinsics now seem to use xxpermdi automatically now
inline void load_aligned(const int32* ptr) { x.v = vec_ld(0, ptr); }
inline void store_aligned(int32* ptr) const { vec_st(x.v, 0, ptr); }
inline void load(const int32* ptr) { x.v = vec_vsx_ld(0, ptr); }
inline void store(int32* ptr) const { vec_vsx_st(x.v, 0, ptr); }
struct rawarray
{
v4i v;
};
inline simd4i(const rawarray& a) : x{a.v} { }
};
#elif defined(DLIB_HAVE_NEON)
class simd4i
{
public:
typedef int32 type;
inline simd4i() {}
inline simd4i(int32 f) { x = vdupq_n_s32(f); }
inline simd4i(int32 r0, int32 r1, int32 r2, int32 r3)
{
int32 __attribute__((aligned(16))) data[4] = { r0, r1, r2, r3 };
x = vld1q_s32(data);
}
inline simd4i(const int32x4_t& val):x(val) {}
inline simd4i& operator=(const int32x4_t& val)
{
x = val;
return *this;
}
inline operator int32x4_t() const { return x; }
inline operator uint32x4_t() const { return (uint32x4_t)x; }
inline void load_aligned(const type* ptr) { x = vld1q_s32(ptr); }
inline void store_aligned(type* ptr) const { vst1q_s32(ptr, x); }
inline void load(const type* ptr) { x = vld1q_s32(ptr); }
inline void store(type* ptr) const { vst1q_s32(ptr, x); }
inline unsigned int size() const { return 4; }
inline int32 operator[](unsigned int idx) const
{
int32 temp[4];
store(temp);
return temp[idx];
}
private:
int32x4_t x;
};
#else
class simd4i
{
public:
typedef int32 type;
inline simd4i() {}
inline simd4i(int32 f) { x[0]=f; x[1]=f; x[2]=f; x[3]=f; }
inline simd4i(int32 r0, int32 r1, int32 r2, int32 r3) { x[0]=r0; x[1]=r1; x[2]=r2; x[3]=r3;}
struct rawarray
{
int32 a[4];
};
inline simd4i(const rawarray& a) { x[0]=a.a[0]; x[1]=a.a[1]; x[2]=a.a[2]; x[3]=a.a[3]; }
inline void load_aligned(const type* ptr)
{
x[0] = ptr[0];
x[1] = ptr[1];
x[2] = ptr[2];
x[3] = ptr[3];
}
inline void store_aligned(type* ptr) const
{
ptr[0] = x[0];
ptr[1] = x[1];
ptr[2] = x[2];
ptr[3] = x[3];
}
inline void load(const type* ptr)
{
x[0] = ptr[0];
x[1] = ptr[1];
x[2] = ptr[2];
x[3] = ptr[3];
}
inline void store(type* ptr) const
{
ptr[0] = x[0];
ptr[1] = x[1];
ptr[2] = x[2];
ptr[3] = x[3];
}
inline unsigned int size() const { return 4; }
inline int32 operator[](unsigned int idx) const { return x[idx]; }
private:
int32 x[4];
};
#endif
// ----------------------------------------------------------------------------------------
inline std::ostream& operator<<(std::ostream& out, const simd4i& item)
{
int32 temp[4];
item.store(temp);
out << "(" << temp[0] << ", " << temp[1] << ", " << temp[2] << ", " << temp[3] << ")";
return out;
}
// ----------------------------------------------------------------------------------------
inline simd4i operator+ (const simd4i& lhs, const simd4i& rhs)
{
#ifdef DLIB_HAVE_SSE2
return _mm_add_epi32(lhs, rhs);
#elif defined(DLIB_HAVE_VSX)
return vec_add(lhs(), rhs());
#elif defined(DLIB_HAVE_NEON)
return vaddq_s32(lhs, rhs);
#else
return simd4i(lhs[0]+rhs[0],
lhs[1]+rhs[1],
lhs[2]+rhs[2],
lhs[3]+rhs[3]);
#endif
}
inline simd4i& operator+= (simd4i& lhs, const simd4i& rhs)
{ return lhs = lhs + rhs; return lhs;}
// ----------------------------------------------------------------------------------------
inline simd4i operator- (const simd4i& lhs, const simd4i& rhs)
{
#ifdef DLIB_HAVE_SSE2
return _mm_sub_epi32(lhs, rhs);
#elif defined(DLIB_HAVE_VSX)
return vec_sub(lhs(), rhs());
#elif defined(DLIB_HAVE_NEON)
return vsubq_s32(lhs, rhs);
#else
return simd4i(lhs[0]-rhs[0],
lhs[1]-rhs[1],
lhs[2]-rhs[2],
lhs[3]-rhs[3]);
#endif
}
inline simd4i& operator-= (simd4i& lhs, const simd4i& rhs)
{ return lhs = lhs - rhs; return lhs;}
// ----------------------------------------------------------------------------------------
inline simd4i operator* (const simd4i& lhs, const simd4i& rhs)
{
#ifdef DLIB_HAVE_SSE41
return _mm_mullo_epi32(lhs, rhs);
#elif defined(DLIB_HAVE_SSE2)
int32 _lhs[4]; lhs.store(_lhs);
int32 _rhs[4]; rhs.store(_rhs);
return simd4i(_lhs[0]*_rhs[0],
_lhs[1]*_rhs[1],
_lhs[2]*_rhs[2],
_lhs[3]*_rhs[3]);
#elif defined(DLIB_HAVE_VSX)
vector int a = lhs(), b = rhs();
asm("vmuluwm %0, %0, %1\n\t" : "+&v" (a) : "v" (b) );
return simd4i(a);
#elif defined(DLIB_HAVE_NEON)
return vmulq_s32(lhs, rhs);
#else
return simd4i(lhs[0]*rhs[0],
lhs[1]*rhs[1],
lhs[2]*rhs[2],
lhs[3]*rhs[3]);
#endif
}
inline simd4i& operator*= (simd4i& lhs, const simd4i& rhs)
{ return lhs = lhs * rhs; return lhs;}
// ----------------------------------------------------------------------------------------
inline simd4i operator& (const simd4i& lhs, const simd4i& rhs)
{
#ifdef DLIB_HAVE_SSE2
return _mm_and_si128(lhs, rhs);
#elif defined(DLIB_HAVE_VSX)
return vec_and(lhs(), rhs());
#elif defined(DLIB_HAVE_NEON)
return vandq_s32(lhs, rhs);
#else
return simd4i(lhs[0]&rhs[0],
lhs[1]&rhs[1],
lhs[2]&rhs[2],
lhs[3]&rhs[3]);
#endif
}
inline simd4i& operator&= (simd4i& lhs, const simd4i& rhs)
{ return lhs = lhs & rhs; return lhs;}
// ----------------------------------------------------------------------------------------
inline simd4i operator| (const simd4i& lhs, const simd4i& rhs)
{
#ifdef DLIB_HAVE_SSE2
return _mm_or_si128(lhs, rhs);
#elif defined(DLIB_HAVE_VSX)
return vec_or(lhs(), rhs());
#elif defined(DLIB_HAVE_NEON)
return vorrq_s32(lhs, rhs);
#else
return simd4i(lhs[0]|rhs[0],
lhs[1]|rhs[1],
lhs[2]|rhs[2],
lhs[3]|rhs[3]);
#endif
}
inline simd4i& operator|= (simd4i& lhs, const simd4i& rhs)
{ return lhs = lhs | rhs; return lhs;}
// ----------------------------------------------------------------------------------------
inline simd4i operator^ (const simd4i& lhs, const simd4i& rhs)
{
#ifdef DLIB_HAVE_SSE2
return _mm_xor_si128(lhs, rhs);
#elif defined(DLIB_HAVE_VSX)
return vec_xor(lhs(), rhs());
#elif defined(DLIB_HAVE_NEON)
return veorq_s32(lhs, rhs);
#else
return simd4i(lhs[0]^rhs[0],
lhs[1]^rhs[1],
lhs[2]^rhs[2],
lhs[3]^rhs[3]);
#endif
}
inline simd4i& operator^= (simd4i& lhs, const simd4i& rhs)
{ return lhs = lhs ^ rhs; return lhs;}
// ----------------------------------------------------------------------------------------
inline simd4i operator~ (const simd4i& lhs)
{
#ifdef DLIB_HAVE_SSE2
return _mm_xor_si128(lhs, _mm_set1_epi32(0xFFFFFFFF));
#elif defined(DLIB_HAVE_VSX)
return vec_xor(lhs(), vec_splats(~0));
#elif defined(DLIB_HAVE_NEON)
return vmvnq_s32(lhs);
#else
return simd4i(~lhs[0],
~lhs[1],
~lhs[2],
~lhs[3]);
#endif
}
// ----------------------------------------------------------------------------------------
inline simd4i operator<< (const simd4i& lhs, const int& rhs)
{
#ifdef DLIB_HAVE_SSE2
return _mm_sll_epi32(lhs,_mm_cvtsi32_si128(rhs));
#elif defined(DLIB_HAVE_VSX)
return vec_sl(lhs(), vec_splats((uint32_t)rhs));
#elif defined(DLIB_HAVE_NEON)
return vshlq_s32(lhs, simd4i(rhs));
#else
return simd4i(lhs[0]<<rhs,
lhs[1]<<rhs,
lhs[2]<<rhs,
lhs[3]<<rhs);
#endif
}
inline simd4i& operator<<= (simd4i& lhs, const int& rhs)
{ return lhs = lhs << rhs; return lhs;}
// ----------------------------------------------------------------------------------------
inline simd4i operator>> (const simd4i& lhs, const int& rhs)
{
#ifdef DLIB_HAVE_SSE2
return _mm_sra_epi32(lhs,_mm_cvtsi32_si128(rhs));
#elif defined(DLIB_HAVE_VSX)
return vec_sr(lhs(), vec_splats((uint32_t)rhs));
#elif defined(DLIB_HAVE_NEON)
int32 _lhs[4]; lhs.store(_lhs);
return simd4i(_lhs[0]>>rhs,
_lhs[1]>>rhs,
_lhs[2]>>rhs,
_lhs[3]>>rhs);
#else
return simd4i(lhs[0]>>rhs,
lhs[1]>>rhs,
lhs[2]>>rhs,
lhs[3]>>rhs);
#endif
}
inline simd4i& operator>>= (simd4i& lhs, const int& rhs)
{ return lhs = lhs >> rhs; return lhs;}
// ----------------------------------------------------------------------------------------
inline simd4i operator== (const simd4i& lhs, const simd4i& rhs)
{
#ifdef DLIB_HAVE_SSE2
return _mm_cmpeq_epi32(lhs, rhs);
#elif defined(DLIB_HAVE_VSX)
return vec_cmpeq(lhs(), rhs());
#elif defined(DLIB_HAVE_NEON)
return (int32x4_t)vceqq_s32(lhs,rhs);
#else
return simd4i(lhs[0]==rhs[0] ? 0xFFFFFFFF : 0,
lhs[1]==rhs[1] ? 0xFFFFFFFF : 0,
lhs[2]==rhs[2] ? 0xFFFFFFFF : 0,
lhs[3]==rhs[3] ? 0xFFFFFFFF : 0);
#endif
}
// ----------------------------------------------------------------------------------------
inline simd4i operator!= (const simd4i& lhs, const simd4i& rhs)
{
#if defined(DLIB_HAVE_SSE2) || defined(DLIB_HAVE_VSX) || defined(DLIB_HAVE_NEON)
return ~(lhs==rhs);
#else
return simd4i(lhs[0]!=rhs[0] ? 0xFFFFFFFF : 0,
lhs[1]!=rhs[1] ? 0xFFFFFFFF : 0,
lhs[2]!=rhs[2] ? 0xFFFFFFFF : 0,
lhs[3]!=rhs[3] ? 0xFFFFFFFF : 0);
#endif
}
// ----------------------------------------------------------------------------------------
inline simd4i operator< (const simd4i& lhs, const simd4i& rhs)
{
#ifdef DLIB_HAVE_SSE2
return _mm_cmplt_epi32(lhs, rhs);
#elif defined(DLIB_HAVE_VSX)
return vec_cmplt(lhs(), rhs());
#elif defined(DLIB_HAVE_NEON)
return (int32x4_t)vcltq_s32(lhs, rhs);
#else
return simd4i(lhs[0]<rhs[0] ? 0xFFFFFFFF : 0,
lhs[1]<rhs[1] ? 0xFFFFFFFF : 0,
lhs[2]<rhs[2] ? 0xFFFFFFFF : 0,
lhs[3]<rhs[3] ? 0xFFFFFFFF : 0);
#endif
}
// ----------------------------------------------------------------------------------------
inline simd4i operator> (const simd4i& lhs, const simd4i& rhs)
{
return rhs < lhs;
}
// ----------------------------------------------------------------------------------------
inline simd4i operator<= (const simd4i& lhs, const simd4i& rhs)
{
#ifdef DLIB_HAVE_SSE2
return ~(lhs > rhs);
#elif defined(DLIB_HAVE_NEON)
return (int32x4_t)vcleq_s32(lhs, rhs);
#else
return simd4i(lhs[0]<=rhs[0] ? 0xFFFFFFFF : 0,
lhs[1]<=rhs[1] ? 0xFFFFFFFF : 0,
lhs[2]<=rhs[2] ? 0xFFFFFFFF : 0,
lhs[3]<=rhs[3] ? 0xFFFFFFFF : 0);
#endif
}
// ----------------------------------------------------------------------------------------
inline simd4i operator>= (const simd4i& lhs, const simd4i& rhs)
{
return rhs <= lhs;
}
// ----------------------------------------------------------------------------------------
inline simd4i min (const simd4i& lhs, const simd4i& rhs)
{
#ifdef DLIB_HAVE_SSE41
return _mm_min_epi32(lhs, rhs);
#elif defined(DLIB_HAVE_SSE2)
int32 _lhs[4]; lhs.store(_lhs);
int32 _rhs[4]; rhs.store(_rhs);
return simd4i(std::min(_lhs[0],_rhs[0]),
std::min(_lhs[1],_rhs[1]),
std::min(_lhs[2],_rhs[2]),
std::min(_lhs[3],_rhs[3]));
#elif defined(DLIB_HAVE_VSX)
return vec_min(lhs(), rhs());
#elif defined(DLIB_HAVE_NEON)
return (int32x4_t)vminq_s32(lhs, rhs);
#else
return simd4i(std::min(lhs[0],rhs[0]),
std::min(lhs[1],rhs[1]),
std::min(lhs[2],rhs[2]),
std::min(lhs[3],rhs[3]));
#endif
}
// ----------------------------------------------------------------------------------------
inline simd4i max (const simd4i& lhs, const simd4i& rhs)
{
#ifdef DLIB_HAVE_SSE41
return _mm_max_epi32(lhs, rhs);
#elif defined(DLIB_HAVE_SSE2)
int32 _lhs[4]; lhs.store(_lhs);
int32 _rhs[4]; rhs.store(_rhs);
return simd4i(std::max(_lhs[0],_rhs[0]),
std::max(_lhs[1],_rhs[1]),
std::max(_lhs[2],_rhs[2]),
std::max(_lhs[3],_rhs[3]));
#elif defined(DLIB_HAVE_VSX)
return vec_max(lhs(), rhs());
#elif defined(DLIB_HAVE_NEON)
return vmaxq_s32(lhs, rhs);
#else
return simd4i(std::max(lhs[0],rhs[0]),
std::max(lhs[1],rhs[1]),
std::max(lhs[2],rhs[2]),
std::max(lhs[3],rhs[3]));
#endif
}
// ----------------------------------------------------------------------------------------
inline int32 sum(const simd4i& item)
{
#ifdef DLIB_HAVE_SSE3
simd4i temp = _mm_hadd_epi32(item,item);
temp = _mm_hadd_epi32(temp,temp);
return _mm_cvtsi128_si32(temp);
#elif defined(DLIB_HAVE_SSE2)
int32 temp[4];
item.store(temp);
return temp[0]+temp[1]+temp[2]+temp[3];
#elif defined(DLIB_HAVE_NEON)
int32x2_t r = vadd_s32(vget_high_s32(item), vget_low_s32(item));
return vget_lane_s32(vpadd_s32(r, r), 0);
#else
return item[0]+item[1]+item[2]+item[3];
#endif
}
// ----------------------------------------------------------------------------------------
// perform cmp ? a : b
inline simd4i select(const simd4i& cmp, const simd4i& a, const simd4i& b)
{
#ifdef DLIB_HAVE_SSE41
return _mm_blendv_epi8(b,a,cmp);
#elif defined(DLIB_HAVE_SSE2)
return ((cmp&a) | _mm_andnot_si128(cmp,b));
#elif defined(DLIB_HAVE_VSX)
return vec_sel(b(), a(), cmp.to_bool());
#elif defined(DLIB_HAVE_NEON)
return vbslq_s32(cmp, a, b);
#else
return ((cmp&a) | (~cmp&b));
#endif
}
// ----------------------------------------------------------------------------------------
}
#endif // DLIB_sIMD4I_Hh_
| {
"pile_set_name": "Github"
} |
COMPLEX FUNCTION CDOTC(N,CX,INCX,CY,INCY)
INTEGER INCX,INCY,N
COMPLEX CX(*),CY(*)
COMPLEX RES
EXTERNAL CDOTCW
CALL CDOTCW(N,CX,INCX,CY,INCY,RES)
CDOTC = RES
RETURN
END
COMPLEX FUNCTION CDOTU(N,CX,INCX,CY,INCY)
INTEGER INCX,INCY,N
COMPLEX CX(*),CY(*)
COMPLEX RES
EXTERNAL CDOTUW
CALL CDOTUW(N,CX,INCX,CY,INCY,RES)
CDOTU = RES
RETURN
END
DOUBLE COMPLEX FUNCTION ZDOTC(N,CX,INCX,CY,INCY)
INTEGER INCX,INCY,N
DOUBLE COMPLEX CX(*),CY(*)
DOUBLE COMPLEX RES
EXTERNAL ZDOTCW
CALL ZDOTCW(N,CX,INCX,CY,INCY,RES)
ZDOTC = RES
RETURN
END
DOUBLE COMPLEX FUNCTION ZDOTU(N,CX,INCX,CY,INCY)
INTEGER INCX,INCY,N
DOUBLE COMPLEX CX(*),CY(*)
DOUBLE COMPLEX RES
EXTERNAL ZDOTUW
CALL ZDOTUW(N,CX,INCX,CY,INCY,RES)
ZDOTU = RES
RETURN
END
| {
"pile_set_name": "Github"
} |
#
# Copyright (c) 2007, Cameron Rich
#
# 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 the axTLS project 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.
#
all : web_server lua
AXTLS_HOME=..
include $(AXTLS_HOME)/config/.config
include $(AXTLS_HOME)/config/makefile.conf
ifndef CONFIG_PLATFORM_WIN32
ifdef CONFIG_PLATFORM_CYGWIN
TARGET=$(AXTLS_HOME)/$(STAGE)/axhttpd.exe
TARGET2=$(AXTLS_HOME)/$(STAGE)/htpasswd.exe
else
TARGET=$(AXTLS_HOME)/$(STAGE)/axhttpd
TARGET2=$(AXTLS_HOME)/$(STAGE)/htpasswd
endif
ifdef CONFIG_HTTP_STATIC_BUILD
LIBS=$(AXTLS_HOME)/$(STAGE)/libaxtls.a
else
LIBS=-L$(AXTLS_HOME)/$(STAGE) -laxtls
endif
ifdef CONFIG_HTTP_BUILD_LUA
lua: kepler-1.1
kepler-1.1:
@tar xvfz kepler-1.1-snapshot-20070521-1825.tar.gz
@cat kepler.patch | patch -p0
cd kepler-1.1; ./configure --prefix=$(CONFIG_HTTP_LUA_PREFIX) --launcher=cgi --lua-suffix= ; make install
else
lua:
endif
else # win32 build
lua:
TARGET=$(AXTLS_HOME)/$(STAGE)/axhttpd.exe
TARGET2=$(AXTLS_HOME)/$(STAGE)/htpasswd.exe
ifdef CONFIG_HTTP_STATIC_BUILD
LIBS=$(AXTLS_HOME)/$(STAGE)/axtls.static.lib $(AXTLS_HOME)\\config\\axtls.res
else
LIBS=$(AXTLS_HOME)/$(STAGE)/axtls.lib $(AXTLS_HOME)\\config\\axtls.res
endif
endif
ifndef CONFIG_AXHTTPD
web_server:
else
web_server :: $(TARGET)
ifdef CONFIG_HTTP_HAS_AUTHORIZATION
web_server :: $(TARGET2)
endif
OBJ= \
axhttpd.o \
proc.o \
tdate_parse.o
include $(AXTLS_HOME)/config/makefile.post
ifndef CONFIG_PLATFORM_WIN32
$(TARGET): $(OBJ) $(AXTLS_HOME)/$(STAGE)/libaxtls.a
$(LD) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
ifdef CONFIG_STRIP_UNWANTED_SECTIONS
$(STRIP) --remove-section=.comment $(TARGET)
endif
$(TARGET2): htpasswd.o $(AXTLS_HOME)/$(STAGE)/libaxtls.a
$(LD) $(LDFLAGS) -o $@ htpasswd.o $(LIBS)
ifdef CONFIG_STRIP_UNWANTED_SECTIONS
$(STRIP) --remove-section=.comment $(TARGET2)
endif
else # Win32
OBJ:=$(OBJ:.o=.obj)
%.obj : %.c
$(CC) $(CFLAGS) $<
htpasswd.obj : htpasswd.c
$(CC) $(CFLAGS) $?
$(TARGET): $(OBJ)
$(LD) $(LDFLAGS) /out:$@ $(LIBS) $?
$(TARGET2): htpasswd.obj
$(LD) $(LDFLAGS) /out:$@ $(LIBS) $?
endif
endif # CONFIG_AXHTTPD
clean::
-@rm -f $(TARGET)*
-@rm -fr kepler-1.1
| {
"pile_set_name": "Github"
} |
<?xml version="1.0"?>
<!--
// ==UserScript==
// @name feed button in urlbar
// @namespace http://oflow.me/archives/310
// @description RSS購読ボタンをURLバーの中につっこむ
// @compatibility Firefox 4.0, 5.0, 6.0b1
// @version 1.0.20110711
// ==/UserScript==
//
// Firefox 6以降でdata:text/cssがbase64エンコードでないとアレ
// 見辛いけど解決策わからん
-->
<?xml-stylesheet type="text/css" href="data:text/css;base64,QG5hbWVzcGFjZSB1cmwoaHR0cDovL3d3dy5tb3ppbGxhLm9yZy9rZXltYXN0ZXIvZ2F0ZWtlZXBlci90aGVyZS5pcy5vbmx5Lnh1bCk7DQojdXJsYmFyLWljb25zICNmZWVkLWJ1dHRvbiBkcm9wbWFya2Vye2Rpc3BsYXk6bm9uZSAhaW1wb3J0YW50O30NCiN1cmxiYXItaWNvbnMgI2ZlZWQtYnV0dG9uIC5idXR0b24tYm94e21hcmdpbjowICFpbXBvcnRhbnQ7cGFkZGluZzowICFpbXBvcnRhbnQ7fQ0KI2ZlZWQtYnV0dG9uey1tb3otaW1hZ2UtcmVnaW9uOiByZWN0KDAsIDE2cHgsIDE2cHgsIDBweCkgIWltcG9ydGFudDttaW4td2lkdGg6MTZweCAhaW1wb3J0YW50O21hcmdpbi1yaWdodDoycHggIWltcG9ydGFudDtiYWNrZ3JvdW5kOnRyYW5zcGFyZW50ICFpbXBvcnRhbnQ7bGlzdC1zdHlsZS1pbWFnZTp1cmwoImRhdGE6aW1hZ2UvZ2lmO2Jhc2U2NCxSMGxHT0RsaEVBQVFBUGNBQUFBQUFQLy8vLzkvQVArQUF2K0JBLytCQlArQ0J2K0RCLytEQ1ArRUN2K0ZDLytGRFArR0R2K0hELytJRXYrSkZQK0tGditMRi8rTEdQK01HZitOSFArT0h2K1BILytQSVArUkpQK1NKZitTSnYrVEtQK1VLditWTFArV0x2K1hNUCtZTWYrWU12K1pNLytjT3YrZFBQK2hRLytpUmYralIvK2pTUCtsVFArbVR2K25ULytvVWYrcFUvK3BWUCtxVmYrclYvK3RXLyt0WFArdVhmK3VYdit2WC8rdllQK3dZZit4WS8reVpmK3ladit6Wi8remFQKzBhZiswYXYrMWJQKzJidiszYi8rM2NQKzRjZis0Y3YrNWMvKzVkUCs2ZHYrN2QvKzhlZis4ZXYrOWZQKytmZisrZnYrL2dQL0FnZi9CZy8vQ2hQL0NoZi9DaHYvRGgvL0VpZi9Iai8vSWtmL0lrdi9Kay8vSmxQL0tsZi9LbHYvTm5QL09uZi9PbnYvUG4vL1BvUC9Rb2YvUW92L1JwUC9UcVAvVXFmL1Vxdi9WcS8vVnJQL1p0UC9hdGYvYnQvL2J1UC9jdXYvZHUvL2R2UC9ldnYvZnYvL2d3Zi9ody8vaXhmL28wZi9ObmYvU3AvL1hzZi9ldi8vZndQL2d3Ly9oeFAvaXh2L2p5UC9tenYvbjBQL28wdi8vL3dBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFDSDVCQUVBQUlNQUxBQUFBQUFRQUJBQUFBanRBQWNKR0Vpd1lNRkJKRXlvZ0dHalI1RWxWYmlNU2JNR2pod0JJVWFVU1BHaUJvOGhTcWhvRVlObXpSc0JHejU0U1pQSHhRd2RRWkpNeVJJR2pSb0JGalFFMkFub1RKc2NRSkJJd2ZMbGpJQUlGZnI0MlJrZ0VCc2NQNDVBdWZKRlFBTUlGREIwd01OVTBBMGZScDVZRVlDQWdadzVkRGlJT0xQVFRvMGVSSndJSUlDQUtaMG1JTXpzWEVOamg1Q0JBNkpzMFJPQUQ1TVBaUUlBYWlFakI4RUJCaFFROXJMRXcwNFVMR0lRZk9JR1NvSTRBZTVrSUJNQXpJa1ZCTjBFY0ZOQVM0QTlGTUFFK0pOd3M1c25BcTRFaVBPZ1M0QTZHUTArUHJEQXdZUUxLUVVJRkE2NXVJU2Nnd0lDQURzPSIpO30NCiN1cmxiYXItaWNvbnMgI2ZlZWQtYnV0dG9uW2Rpc2FibGVkXXtkaXNwbGF5OiBub25lICFpbXBvcnRhbnQ7fQ0K"?>
<!DOCTYPE window SYSTEM "chrome://browser/locale/browser.dtd" >
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<hbox id="urlbar-icons">
<button id="feed-button"
insertbefore="star-button"
type="menu"
style="-moz-user-focus:none;min-width:16px;"
class="plain urlbar-icon"
tooltiptext="&feedButton.tooltip;"
onclick="return FeedHandler.onFeedButtonClick(event);">
<menupopup id="feed-menu"
onpopupshowing="return FeedHandler.buildFeedList(this);"
oncommand="return FeedHandler.subscribeToFeed(null, event);"
onclick="checkForMiddleClick(this, event);"/>
</button>
</hbox>
</overlay> | {
"pile_set_name": "Github"
} |
;;; -*- coding: utf-8-unix -*-
;;;
;;;Part of: Vicare Scheme
;;;Contents: tests for arguments validation library
;;;Date: Mon Oct 1, 2012
;;;
;;;Abstract
;;;
;;;
;;;
;;;Copyright (C) 2012, 2013, 2014, 2015, 2016 Marco Maggi <[email protected]>
;;;
;;;This program is free software: you can redistribute it and/or modify
;;;it under the terms of the GNU General Public License as published by
;;;the Free Software Foundation, either version 3 of the License, or (at
;;;your option) any later version.
;;;
;;;This program is distributed in the hope that it will be useful, but
;;;WITHOUT ANY WARRANTY; without even the implied warranty of
;;;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;;;General Public License for more details.
;;;
;;;You should have received a copy of the GNU General Public License
;;;along with this program. If not, see <http://www.gnu.org/licenses/>.
;;;
#!r6rs
(program (test)
(options strict-r6rs)
(import (except (vicare) catch)
(vicare language-extensions syntaxes)
(vicare arguments validation)
(prefix (vicare arguments validation)
args.)
(vicare checks))
(check-set-mode! 'report-failed)
(check-display "*** testing Vicare arguments validation library\n")
;;;; helpers
(define-syntax catch
(syntax-rules ()
((_ print? . ?body)
(guard (E ((assertion-violation? E)
(when print?
(check-pretty-print (condition-message E)))
(condition-irritants E))
(else E))
(begin . ?body)))))
(define-syntax catch-expand-time-type-mismatch
(syntax-rules ()
((_ print? . ?body)
(guard (E ((syntax-violation? E)
(when print?
(check-pretty-print (condition-message E)))
(syntax->datum (syntax-violation-subform E)))
((assertion-violation? E)
(when print?
(check-pretty-print (condition-message E)))
(condition-irritants E))
(else E))
(with-exception-handler
(lambda (E)
(unless (warning? E)
(raise E)))
(lambda ()
(eval '(begin . ?body)
(environment '(vicare)
'(vicare language-extensions syntaxes)
'(vicare arguments validation)
'(prefix (vicare arguments validation)
args.))
(expander-options strict-r6rs)
(compiler-options strict-r6rs))))))))
(define-syntax doit
(syntax-rules ()
((_ ?print ?validator . ?objs)
(catch-expand-time-type-mismatch ?print
(let ((who 'test))
(with-arguments-validation (who)
((?validator . ?objs))
#t))))))
(parametrise ((check-test-name 'config))
(check
(eval 'config.arguments-validation
(environment '(prefix (vicare platform configuration)
config.)))
=> #t)
;;These tests can be run only when the library (vicare posix) is
;;available.
;; (begin
;; (check
;; (begin
;; (px.setenv "VICARE_ARGUMENTS_VALIDATION" "yes" #t)
;; (eval 'config.arguments-validation
;; (environment '(prefix (vicare platform configuration)
;; config.))))
;; => #t)
;; (check
;; (begin
;; (px.setenv "VICARE_ARGUMENTS_VALIDATION" "no" #t)
;; (eval 'config.arguments-validation
;; (environment '(prefix (vicare platform configuration)
;; config.))))
;; => #f)
;; (check
;; (begin
;; (px.setenv "VICARE_ARGUMENTS_VALIDATION" "1" #t)
;; (eval 'config.arguments-validation
;; (environment '(prefix (vicare platform configuration)
;; config.))))
;; => #t)
;; (check
;; (begin
;; (px.setenv "VICARE_ARGUMENTS_VALIDATION" "0" #t)
;; (eval 'config.arguments-validation
;; (environment '(prefix (vicare platform configuration)
;; config.))))
;; => #f)
;; (px.setenv "VICARE_ARGUMENTS_VALIDATION" "yes" #t))
#f)
(parametrise ((check-test-name 'validate-booleans))
;;; boolean
(check
(doit #f boolean #t)
=> #t)
(check
(doit #f boolean #f)
=> #t)
(check
(doit #f boolean 'ciao)
=> '(ciao))
#t)
(parametrise ((check-test-name 'validate-prefixed))
(check
(doit #f args.fixnum 123)
=> #t)
(check
(doit #f args.fixnum 'ciao)
=> '(ciao))
(check
(doit #f args.fixnum/false #f)
=> #t)
(check
(doit #f args.string "123")
=> #t)
#t)
(parametrise ((check-test-name 'validate-chars))
(check
(doit #f args.char #\c)
=> #t)
(check
(doit #f args.char 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
(check (char-in-ascii-range? #\c) => #t)
(check (char-in-ascii-range? #\x5555) => #f)
(check
(doit #f args.char-in-ascii-range #\c)
=> #t)
(check
(doit #f args.char-in-ascii-range #\x5555)
=> '(#\x5555))
;;; --------------------------------------------------------------------
(check
(doit #f args.char-in-ascii-range/false #\c)
=> #t)
(check
(doit #f args.char-in-ascii-range/false #\x5555)
=> '(#\x5555))
(check
(doit #f args.char-in-ascii-range/false #f)
=> #t)
#t)
(parametrise ((check-test-name 'validate-fixnums))
;;; fixnum
(check
(doit #f fixnum 123)
=> #t)
(check
(doit #f fixnum 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; fixnum/false
(check
(doit #f fixnum/false 123)
=> #t)
(check
(doit #f fixnum/false #f)
=> #t)
(check
(doit #f fixnum/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; positive-fixnum
(check
(doit #f positive-fixnum 123)
=> #t)
(check
(doit #f positive-fixnum 'ciao)
=> '(ciao))
(check
(doit #f positive-fixnum 0)
=> '(0))
(check
(doit #f positive-fixnum -1)
=> '(-1))
;;; --------------------------------------------------------------------
;;; negative-fixnum
(check
(doit #f negative-fixnum -123)
=> #t)
(check
(doit #f negative-fixnum 'ciao)
=> '(ciao))
(check
(doit #f negative-fixnum 0)
=> '(0))
(check
(doit #f negative-fixnum +1)
=> '(+1))
;;; --------------------------------------------------------------------
;;; non-positive-fixnum
(check
(doit #f non-positive-fixnum -123)
=> #t)
(check
(doit #f non-positive-fixnum 'ciao)
=> '(ciao))
(check
(doit #f non-positive-fixnum 0)
=> #t)
(check
(doit #f non-positive-fixnum +1)
=> '(+1))
;;; --------------------------------------------------------------------
;;; non-negative-fixnum
(check
(doit #f non-negative-fixnum +123)
=> #t)
(check
(doit #f non-negative-fixnum 'ciao)
=> '(ciao))
(check
(doit #f non-negative-fixnum 0)
=> #t)
(check
(doit #f non-negative-fixnum -1)
=> '(-1))
;;; --------------------------------------------------------------------
;;; fixnum-in-inclusive-range
(check
(doit #f fixnum-in-inclusive-range +123 100 200)
=> #t)
(check
(doit #f fixnum-in-inclusive-range +100 100 200)
=> #t)
(check
(doit #f fixnum-in-inclusive-range +200 100 200)
=> #t)
(check
(doit #f fixnum-in-inclusive-range 'ciao 100 200)
=> '(ciao))
(check
(doit #f fixnum-in-inclusive-range 0 100 200)
=> '(0))
;;; --------------------------------------------------------------------
;;; fixnum-in-exclusive-range
(check
(doit #f fixnum-in-exclusive-range +123 100 200)
=> #t)
(check
(doit #f fixnum-in-exclusive-range +100 100 200)
=> '(100))
(check
(doit #f fixnum-in-exclusive-range +200 100 200)
=> '(200))
(check
(doit #f fixnum-in-exclusive-range 'ciao 100 200)
=> '(ciao))
(check
(doit #f fixnum-in-exclusive-range 0 100 200)
=> '(0))
;;; --------------------------------------------------------------------
;;; even-fixnum
(check
(doit #f even-fixnum 2)
=> #t)
(check
(doit #f even-fixnum 3)
=> '(3))
(check
(doit #f even-fixnum -2)
=> #t)
(check
(doit #f even-fixnum -3)
=> '(-3))
(check
(doit #f even-fixnum 'ciao)
=> '(ciao))
(check
(doit #f even-fixnum 0)
=> #t)
;;; --------------------------------------------------------------------
;;; odd-fixnum
(check
(doit #f odd-fixnum 2)
=> '(2))
(check
(doit #f odd-fixnum 3)
=> #t)
(check
(doit #f odd-fixnum -2)
=> '(-2))
(check
(doit #f odd-fixnum -3)
=> #t)
(check
(doit #f odd-fixnum 'ciao)
=> '(ciao))
(check
(doit #f odd-fixnum 0)
=> '(0))
#t)
(parametrise ((check-test-name 'validate-exact-integer))
;;; exact-integer
(check
(doit #f exact-integer 123)
=> #t)
(check
(doit #f exact-integer 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; exact-integer/false
(check
(doit #f exact-integer/false 123)
=> #t)
(check
(doit #f exact-integer/false #f)
=> #t)
(check
(doit #f exact-integer/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; positive-exact-integer
(check
(doit #f positive-exact-integer 123)
=> #t)
(check
(doit #f positive-exact-integer 'ciao)
=> '(ciao))
(check
(doit #f positive-exact-integer 0)
=> '(0))
(check
(doit #f positive-exact-integer -1)
=> '(-1))
;;; --------------------------------------------------------------------
;;; negative-exact-integer
(check
(doit #f negative-exact-integer -123)
=> #t)
(check
(doit #f negative-exact-integer 'ciao)
=> '(ciao))
(check
(doit #f negative-exact-integer 0)
=> '(0))
(check
(doit #f negative-exact-integer +1)
=> '(+1))
;;; --------------------------------------------------------------------
;;; non-positive-exact-integer
(check
(doit #f non-positive-exact-integer -123)
=> #t)
(check
(doit #f non-positive-exact-integer 'ciao)
=> '(ciao))
(check
(doit #f non-positive-exact-integer 0)
=> #t)
(check
(doit #f non-positive-exact-integer +1)
=> '(+1))
;;; --------------------------------------------------------------------
;;; non-negative-exact-integer
(check
(doit #f non-negative-exact-integer +123)
=> #t)
(check
(doit #f non-negative-exact-integer 'ciao)
=> '(ciao))
(check
(doit #f non-negative-exact-integer 0)
=> #t)
(check
(doit #f non-negative-exact-integer -1)
=> '(-1))
;;; --------------------------------------------------------------------
;;; exact-integer-in-inclusive-range
(check
(doit #f exact-integer-in-inclusive-range +123 100 200)
=> #t)
(check
(doit #f exact-integer-in-inclusive-range +100 100 200)
=> #t)
(check
(doit #f exact-integer-in-inclusive-range +200 100 200)
=> #t)
(check
(doit #f exact-integer-in-inclusive-range 'ciao 100 200)
=> '(ciao))
(check
(doit #f exact-integer-in-inclusive-range 0 100 200)
=> '(0))
;;; --------------------------------------------------------------------
;;; exact-integer-in-exclusive-range
(check
(doit #f exact-integer-in-exclusive-range +123 100 200)
=> #t)
(check
(doit #f exact-integer-in-exclusive-range +100 100 200)
=> '(100))
(check
(doit #f exact-integer-in-exclusive-range +200 100 200)
=> '(200))
(check
(doit #f exact-integer-in-exclusive-range 'ciao 100 200)
=> '(ciao))
(check
(doit #f exact-integer-in-exclusive-range 0 100 200)
=> '(0))
;;; --------------------------------------------------------------------
;;; even-exact-integer
(check
(doit #f even-exact-integer 2)
=> #t)
(check
(doit #f even-exact-integer 3)
=> '(3))
(check
(doit #f even-exact-integer -2)
=> #t)
(check
(doit #f even-exact-integer -3)
=> '(-3))
(check
(doit #f even-exact-integer 'ciao)
=> '(ciao))
(check
(doit #f even-exact-integer 0)
=> #t)
;;; --------------------------------------------------------------------
;;; odd-exact-integer
(check
(doit #f odd-exact-integer 2)
=> '(2))
(check
(doit #f odd-exact-integer 3)
=> #t)
(check
(doit #f odd-exact-integer -2)
=> '(-2))
(check
(doit #f odd-exact-integer -3)
=> #t)
(check
(doit #f odd-exact-integer 'ciao)
=> '(ciao))
(check
(doit #f odd-exact-integer 0)
=> '(0))
#t)
(parametrise ((check-test-name 'validate-bits))
;;; u8
(check
(doit #f word-u8 123)
=> #t)
(check
(doit #f word-u8 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; s8
(check
(doit #f word-s8 123)
=> #t)
(check
(doit #f word-s8 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; u16
(check
(doit #f word-u16 123)
=> #t)
(check
(doit #f word-u16 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; s16
(check
(doit #f word-s16 123)
=> #t)
(check
(doit #f word-s16 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; u32
(check
(doit #f word-u32 123)
=> #t)
(check
(doit #f word-u32 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; s32
(check
(doit #f word-s32 123)
=> #t)
(check
(doit #f word-s32 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; u64
(check
(doit #f word-u64 123)
=> #t)
(check
(doit #f word-u64 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; s64
(check
(doit #f word-s64 123)
=> #t)
(check
(doit #f word-s64 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; u128
(check
(doit #f word-u128 123)
=> #t)
(check
(doit #f word-u128 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; s128
(check
(doit #f word-s128 123)
=> #t)
(check
(doit #f word-s128 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; u256
(check
(doit #f word-u256 123)
=> #t)
(check
(doit #f word-u256 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; s256
(check
(doit #f word-s256 123)
=> #t)
(check
(doit #f word-s256 'ciao)
=> '(ciao))
#t)
(parametrise ((check-test-name 'validate-bits-false))
;;; u8/false
(check
(doit #f word-u8/false 123)
=> #t)
(check
(doit #f word-u8/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; s8/false
(check
(doit #f word-s8/false 123)
=> #t)
(check
(doit #f word-s8/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; u16/false
(check
(doit #f word-u16/false 123)
=> #t)
(check
(doit #f word-u16/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; s16/false
(check
(doit #f word-s16/false 123)
=> #t)
(check
(doit #f word-s16/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; u32/false
(check
(doit #f word-u32/false 123)
=> #t)
(check
(doit #f word-u32/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; s32/false
(check
(doit #f word-s32/false 123)
=> #t)
(check
(doit #f word-s32/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; u64/false
(check
(doit #f word-u64/false 123)
=> #t)
(check
(doit #f word-u64/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; s64/false
(check
(doit #f word-s64/false 123)
=> #t)
(check
(doit #f word-s64/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; u128/false
(check
(doit #f word-u128/false 123)
=> #t)
(check
(doit #f word-u128/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; s128/false
(check
(doit #f word-s128/false 123)
=> #t)
(check
(doit #f word-s128/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; u256/false
(check
(doit #f word-u256/false 123)
=> #t)
(check
(doit #f word-u256/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; s256/false
(check
(doit #f word-s256/false 123)
=> #t)
(check
(doit #f word-s256/false 'ciao)
=> '(ciao))
#t)
(parametrise ((check-test-name 'validate-signed-int))
;;; signed-int
(check
(doit #f signed-int 123)
=> #t)
(check
(doit #f signed-int 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; signed-int/false
(check
(doit #f signed-int/false 123)
=> #t)
(check
(doit #f signed-int/false #f)
=> #t)
(check
(doit #f signed-int/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; positive-signed-int
(check
(doit #f positive-signed-int 123)
=> #t)
(check
(doit #f positive-signed-int 'ciao)
=> '(ciao))
(check
(doit #f positive-signed-int 0)
=> '(0))
(check
(doit #f positive-signed-int -1)
=> '(-1))
;;; --------------------------------------------------------------------
;;; negative-signed-int
(check
(doit #f negative-signed-int -123)
=> #t)
(check
(doit #f negative-signed-int 'ciao)
=> '(ciao))
(check
(doit #f negative-signed-int 0)
=> '(0))
(check
(doit #f negative-signed-int +1)
=> '(+1))
;;; --------------------------------------------------------------------
;;; non-positive-signed-int
(check
(doit #f non-positive-signed-int -123)
=> #t)
(check
(doit #f non-positive-signed-int 'ciao)
=> '(ciao))
(check
(doit #f non-positive-signed-int 0)
=> #t)
(check
(doit #f non-positive-signed-int +1)
=> '(+1))
;;; --------------------------------------------------------------------
;;; non-negative-signed-int
(check
(doit #f non-negative-signed-int +123)
=> #t)
(check
(doit #f non-negative-signed-int 'ciao)
=> '(ciao))
(check
(doit #f non-negative-signed-int 0)
=> #t)
(check
(doit #f non-negative-signed-int -1)
=> '(-1))
;;; --------------------------------------------------------------------
;;; signed-int-in-inclusive-range
(check
(doit #f signed-int-in-inclusive-range +123 100 200)
=> #t)
(check
(doit #f signed-int-in-inclusive-range +100 100 200)
=> #t)
(check
(doit #f signed-int-in-inclusive-range +200 100 200)
=> #t)
(check
(doit #f signed-int-in-inclusive-range 'ciao 100 200)
=> '(ciao))
(check
(doit #f signed-int-in-inclusive-range 0 100 200)
=> '(0))
;;; --------------------------------------------------------------------
;;; signed-int-in-exclusive-range
(check
(doit #f signed-int-in-exclusive-range +123 100 200)
=> #t)
(check
(doit #f signed-int-in-exclusive-range +100 100 200)
=> '(100))
(check
(doit #f signed-int-in-exclusive-range +200 100 200)
=> '(200))
(check
(doit #f signed-int-in-exclusive-range 'ciao 100 200)
=> '(ciao))
(check
(doit #f signed-int-in-exclusive-range 0 100 200)
=> '(0))
;;; --------------------------------------------------------------------
;;; even-signed-int
(check
(doit #f even-signed-int 2)
=> #t)
(check
(doit #f even-signed-int 3)
=> '(3))
(check
(doit #f even-signed-int -2)
=> #t)
(check
(doit #f even-signed-int -3)
=> '(-3))
(check
(doit #f even-signed-int 'ciao)
=> '(ciao))
(check
(doit #f even-signed-int 0)
=> #t)
;;; --------------------------------------------------------------------
;;; odd-signed-int
(check
(doit #f odd-signed-int 2)
=> '(2))
(check
(doit #f odd-signed-int 3)
=> #t)
(check
(doit #f odd-signed-int -2)
=> '(-2))
(check
(doit #f odd-signed-int -3)
=> #t)
(check
(doit #f odd-signed-int 'ciao)
=> '(ciao))
(check
(doit #f odd-signed-int 0)
=> '(0))
#t)
(parametrise ((check-test-name 'validate-clang))
;;; unsigned-char
(check
(doit #f unsigned-char 123)
=> #t)
(check
(doit #f unsigned-char 500)
=> '(500))
(check
(doit #f unsigned-char -123)
=> '(-123))
(check
(doit #f unsigned-char 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; signed-char
(check
(doit #f signed-char 123)
=> #t)
(check
(doit #f signed-char 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; unsigned-short
(check
(doit #f unsigned-short 123)
=> #t)
(check
(doit #f unsigned-short 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; signed-short
(check
(doit #f signed-short 123)
=> #t)
(check
(doit #f signed-short 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; unsigned-int
(check
(doit #f unsigned-int 123)
=> #t)
(check
(doit #f unsigned-int 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; unsigned-long
(check
(doit #f unsigned-long 123)
=> #t)
(check
(doit #f unsigned-long 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; signed-long
(check
(doit #f signed-long 123)
=> #t)
(check
(doit #f signed-long 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; unsigned-long-long
(check
(doit #f unsigned-long-long 123)
=> #t)
(check
(doit #f unsigned-long-long 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; signed-long-long
(check
(doit #f signed-long-long 123)
=> #t)
(check
(doit #f signed-long-long 'ciao)
=> '(ciao))
#t)
(parametrise ((check-test-name 'validate-clang-false))
;;; unsigned-char/false
(check
(doit #f unsigned-char/false 123)
=> #t)
(check
(doit #f unsigned-char/false 500)
=> '(500))
(check
(doit #f unsigned-char/false -123)
=> '(-123))
(check
(doit #f unsigned-char/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; signed-char/false
(check
(doit #f signed-char/false 123)
=> #t)
(check
(doit #f signed-char/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; unsigned-short/false
(check
(doit #f unsigned-short/false 123)
=> #t)
(check
(doit #f unsigned-short/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; signed-short/false
(check
(doit #f signed-short/false 123)
=> #t)
(check
(doit #f signed-short/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; unsigned-int/false
(check
(doit #f unsigned-int/false 123)
=> #t)
(check
(doit #f unsigned-int/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; unsigned-long/false
(check
(doit #f unsigned-long/false 123)
=> #t)
(check
(doit #f unsigned-long/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; signed-long/false
(check
(doit #f signed-long/false 123)
=> #t)
(check
(doit #f signed-long/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; unsigned-long-long/false
(check
(doit #f unsigned-long-long/false 123)
=> #t)
(check
(doit #f unsigned-long-long/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; signed-long-long/false
(check
(doit #f signed-long-long/false 123)
=> #t)
(check
(doit #f signed-long-long/false 'ciao)
=> '(ciao))
#t)
(parametrise ((check-test-name 'validate-string))
;;; string
(check
(doit #f string "123")
=> #t)
(check
(doit #f string 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; string/false
(check
(doit #f string/false "123")
=> #t)
(check
(doit #f string/false #f)
=> #t)
(check
(doit #f string/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; non-empty-string
(check
(doit #f non-empty-string "123")
=> #t)
(check
(doit #f non-empty-string "")
=> '(""))
(check
(doit #f non-empty-string 123)
=> '(123))
;;; --------------------------------------------------------------------
;;; non-empty-string/false
(check
(doit #f non-empty-string/false "123")
=> #t)
;;This test does not work because of expand-time type check.
;;
;; (check
;; (doit #f non-empty-string/false #f)
;; => #t)
(check
(doit #f non-empty-string/false "")
=> '(""))
(check
(doit #f non-empty-string/false 123)
=> '(123))
;;; --------------------------------------------------------------------
;;; index-for-string
(check
(doit #f index-for-string "123" 0)
=> #t)
(check
(doit #f index-for-string "123" 2)
=> #t)
(check
(doit #f index-for-string "123" 3)
=> '(3 "123"))
(check
(doit #f index-for-string "123" 'ciao)
=> '(ciao "123"))
;;; --------------------------------------------------------------------
;;; index-and-count-for-string
(check (doit #f index-and-count-for-string "123" 0 0) => #t)
(check (doit #f index-and-count-for-string "123" 0 1) => #t)
(check (doit #f index-and-count-for-string "123" 0 2) => #t)
(check (doit #f index-and-count-for-string "123" 0 3) => #t)
(check (doit #f index-and-count-for-string "123" 0 4) => '(0 4 "123"))
(check
(doit #f index-and-count-for-string "123" 'ciao 2)
=> '(ciao 2 "123"))
(check
(doit #f index-and-count-for-string "123" 2 'ciao)
=> '(2 ciao "123"))
;;; --------------------------------------------------------------------
;;; start-and-end-for-string
(check (doit #f start-and-end-for-string "123" 0 0) => #t)
(check (doit #f start-and-end-for-string "123" 0 1) => #t)
(check (doit #f start-and-end-for-string "123" 0 2) => #t)
(check (doit #f start-and-end-for-string "123" 0 3) => '(0 3 "123"))
(check (doit #f start-and-end-for-string "123" 0 0) => #t)
(check (doit #f start-and-end-for-string "123" 1 1) => #t)
(check (doit #f start-and-end-for-string "123" 2 2) => #t)
(check (doit #f start-and-end-for-string "123" 3 3) => '(3 3 "123"))
(check (doit #f start-and-end-for-string "123" 2 1) => '(2 1 "123"))
(check
(doit #f start-and-end-for-string "123" 'ciao 2)
=> '(ciao 2 "123"))
(check
(doit #f start-and-end-for-string "123" 2 'ciao)
=> '(2 ciao "123"))
;;; --------------------------------------------------------------------
;;; start-and-past-for-string
(check (doit #f start-and-past-for-string "123" 0 0) => #t)
(check (doit #f start-and-past-for-string "123" 0 1) => #t)
(check (doit #f start-and-past-for-string "123" 0 2) => #t)
(check (doit #f start-and-past-for-string "123" 0 3) => #t)
(check (doit #f start-and-past-for-string "123" 0 4) => '(0 4 "123"))
(check (doit #f start-and-past-for-string "123" 0 0) => #t)
(check (doit #f start-and-past-for-string "123" 1 1) => #t)
(check (doit #f start-and-past-for-string "123" 2 2) => #t)
(check (doit #f start-and-past-for-string "123" 2 3) => #t)
(check (doit #f start-and-past-for-string "123" 3 3) => #t)
(check (doit #f start-and-past-for-string "123" 2 1) => '(2 1 "123"))
(check
(doit #f start-and-past-for-string "123" 'ciao 2)
=> '(ciao 2 "123"))
(check
(doit #f start-and-past-for-string "123" 2 'ciao)
=> '(2 ciao "123"))
#t)
(parametrise ((check-test-name 'validate-vector))
;;; vector
(check
(doit #f vector '#(1 2 3))
=> #t)
(check
(doit #f vector 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; vector/false
(check
(doit #f vector/false '#(1 2 3))
=> #t)
(check
(doit #f vector/false #f)
=> #t)
(check
(doit #f vector/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; non-empty-vector
(check
(doit #f non-empty-vector '#(1 2 3))
=> #t)
(check
(doit #f non-empty-vector '#())
=> '(#()))
(check
(doit #f non-empty-vector 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; non-empty-vector/false
(check
(doit #f non-empty-vector/false '#(1 2 3))
=> #t)
(check
(doit #f non-empty-vector/false #f)
=> #t)
(check
(doit #f non-empty-vector/false '#())
=> '(#()))
(check
(doit #f non-empty-vector/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; index-for-vector
(check
(doit #f index-for-vector '#(1 2 3) 0)
=> #t)
(check
(doit #f index-for-vector '#(1 2 3) 2)
=> #t)
(check
(doit #f index-for-vector '#(1 2 3) 3)
=> '(3 #(1 2 3)))
(check
(doit #f index-for-vector '#(1 2 3) 'ciao)
=> '(ciao #(1 2 3)))
;;; --------------------------------------------------------------------
;;; index-and-count-for-vector
(check (doit #f index-and-count-for-vector '#(1 2 3) 0 0) => #t)
(check (doit #f index-and-count-for-vector '#(1 2 3) 0 1) => #t)
(check (doit #f index-and-count-for-vector '#(1 2 3) 0 2) => #t)
(check (doit #f index-and-count-for-vector '#(1 2 3) 0 3) => #t)
(check (doit #f index-and-count-for-vector '#(1 2 3) 0 4) => '(0 4 #(1 2 3)))
(check
(doit #f index-and-count-for-vector '#(1 2 3) 'ciao 2)
=> '(ciao 2 #(1 2 3)))
(check
(doit #f index-and-count-for-vector '#(1 2 3) 2 'ciao)
=> '(2 ciao #(1 2 3)))
;;; --------------------------------------------------------------------
;;; start-and-past-for-vector
(check (doit #f start-and-past-for-vector '#(1 2 3) 0 0) => #t)
(check (doit #f start-and-past-for-vector '#(1 2 3) 0 1) => #t)
(check (doit #f start-and-past-for-vector '#(1 2 3) 0 2) => #t)
(check (doit #f start-and-past-for-vector '#(1 2 3) 0 3) => #t)
(check (doit #f start-and-past-for-vector '#(1 2 3) 0 4) => '(0 4 #(1 2 3)))
(check (doit #f start-and-past-for-vector '#(1 2 3) 0 0) => #t)
(check (doit #f start-and-past-for-vector '#(1 2 3) 1 1) => #t)
(check (doit #f start-and-past-for-vector '#(1 2 3) 2 2) => #t)
(check (doit #f start-and-past-for-vector '#(1 2 3) 2 3) => #t)
(check (doit #f start-and-past-for-vector '#(1 2 3) 3 3) => #t)
(check (doit #f start-and-past-for-vector '#(1 2 3) 2 1) => '(2 1 #(1 2 3)))
(check
(doit #f start-and-past-for-vector '#(1 2 3) 'ciao 2)
=> '(ciao 2 #(1 2 3)))
(check
(doit #f start-and-past-for-vector '#(1 2 3) 2 'ciao)
=> '(2 ciao #(1 2 3)))
#t)
(parametrise ((check-test-name 'validate-bytevector))
;;; bytevector
(check
(doit #f bytevector '#vu8(1 2 3))
=> #t)
(check
(doit #f bytevector 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; bytevector/false
(check
(doit #f bytevector/false '#vu8(1 2 3))
=> #t)
(check
(doit #f bytevector/false #f)
=> #t)
(check
(doit #f bytevector/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; non-empty-bytevector
(check
(doit #f non-empty-bytevector '#vu8(1 2 3))
=> #t)
(check
(doit #f non-empty-bytevector '#vu8())
=> '(#vu8()))
(check
(doit #f non-empty-bytevector 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; non-empty-bytevector/false
(check
(doit #f non-empty-bytevector/false '#vu8(1 2 3))
=> #t)
(check
(doit #f non-empty-bytevector/false #f)
=> #t)
(check
(doit #f non-empty-bytevector/false '#vu8())
=> '(#vu8()))
(check
(doit #f non-empty-bytevector/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; index-for-bytevector
(check
(doit #f index-for-bytevector '#vu8(1 2 3) 0)
=> #t)
(check
(doit #f index-for-bytevector '#vu8(1 2 3) 2)
=> #t)
(check
(doit #f index-for-bytevector '#vu8(1 2 3) 3)
=> '(3 #vu8(1 2 3)))
(check
(doit #f index-for-bytevector '#vu8(1 2 3) 'ciao)
=> '(ciao #vu8(1 2 3)))
;;; --------------------------------------------------------------------
;;; index-and-count-for-bytevector
(check (doit #f index-and-count-for-bytevector '#vu8(1 2 3) 0 0) => #t)
(check (doit #f index-and-count-for-bytevector '#vu8(1 2 3) 0 1) => #t)
(check (doit #f index-and-count-for-bytevector '#vu8(1 2 3) 0 2) => #t)
(check (doit #f index-and-count-for-bytevector '#vu8(1 2 3) 0 3) => #t)
(check (doit #f index-and-count-for-bytevector '#vu8(1 2 3) 0 4) => '(0 4 #vu8(1 2 3)))
(check
(doit #f index-and-count-for-bytevector '#vu8(1 2 3) 'ciao 2)
=> '(ciao 2 #vu8(1 2 3)))
(check
(doit #f index-and-count-for-bytevector '#vu8(1 2 3) 2 'ciao)
=> '(2 ciao #vu8(1 2 3)))
;;; --------------------------------------------------------------------
;;; start-and-past-for-bytevector
(check (doit #f start-and-past-for-bytevector '#vu8(1 2 3) 0 0) => #t)
(check (doit #f start-and-past-for-bytevector '#vu8(1 2 3) 0 1) => #t)
(check (doit #f start-and-past-for-bytevector '#vu8(1 2 3) 0 2) => #t)
(check (doit #f start-and-past-for-bytevector '#vu8(1 2 3) 0 3) => #t)
(check (doit #f start-and-past-for-bytevector '#vu8(1 2 3) 0 4) => '(0 4 #vu8(1 2 3)))
(check (doit #f start-and-past-for-bytevector '#vu8(1 2 3) 0 0) => #t)
(check (doit #f start-and-past-for-bytevector '#vu8(1 2 3) 1 1) => #t)
(check (doit #f start-and-past-for-bytevector '#vu8(1 2 3) 2 2) => #t)
(check (doit #f start-and-past-for-bytevector '#vu8(1 2 3) 2 3) => #t)
(check (doit #f start-and-past-for-bytevector '#vu8(1 2 3) 3 3) => #t)
(check (doit #f start-and-past-for-bytevector '#vu8(1 2 3) 2 1) => '(2 1 #vu8(1 2 3)))
(check
(doit #f start-and-past-for-bytevector '#vu8(1 2 3) 'ciao 2)
=> '(ciao 2 #vu8(1 2 3)))
(check
(doit #f start-and-past-for-bytevector '#vu8(1 2 3) 2 'ciao)
=> '(2 ciao #vu8(1 2 3)))
#t)
(parametrise ((check-test-name 'validate-symbol))
;;; symbol
(check
(doit #f symbol 'ciao)
=> #t)
(check
(doit #f symbol "ciao")
=> '("ciao"))
;;; --------------------------------------------------------------------
;;; symbol/false
(check
(doit #f symbol/false 'ciao)
=> #t)
(check
(doit #f symbol/false #f)
=> #t)
(check
(doit #f symbol/false "ciao")
=> '("ciao"))
#t)
(parametrise ((check-test-name 'validate-enum-set))
;;; enum-set
(check
(doit #f enum-set (make-enumeration '(ciao)))
=> #t)
(check
(doit #f enum-set "ciao")
=> '("ciao"))
;;; --------------------------------------------------------------------
;;; enum-set/false
(check
(doit #f enum-set/false (make-enumeration '(ciao)))
=> #t)
(check
(doit #f enum-set/false #f)
=> #t)
(check
(doit #f enum-set/false "ciao")
=> '("ciao"))
#t)
(parametrise ((check-test-name 'validate-pointer))
;;; pointer
(check
(doit #f pointer (null-pointer))
=> #t)
(check
(doit #f pointer "ciao")
=> '("ciao"))
;;; --------------------------------------------------------------------
;;; pointer/false
(check
(doit #f pointer/false (null-pointer))
=> #t)
(check
(doit #f pointer/false #f)
=> #t)
(check
(doit #f pointer/false "ciao")
=> '("ciao"))
#t)
(parametrise ((check-test-name 'validate-memory-block))
;;; memory-block
(check
(doit #f memory-block (null-memory-block))
=> #t)
(check
(doit #f memory-block "ciao")
=> '("ciao"))
;;; --------------------------------------------------------------------
;;; memory-block/false
(check
(doit #f memory-block/false (null-memory-block))
=> #t)
(check
(doit #f memory-block/false #f)
=> #t)
(check
(doit #f memory-block/false "ciao")
=> '("ciao"))
#t)
(parametrise ((check-test-name 'validate-port))
;;; port
(check
(doit #f port (current-output-port))
=> #t)
(check
(doit #f port "ciao")
=> '("ciao"))
;;; --------------------------------------------------------------------
;;; port/false
(check
(doit #f port/false (current-output-port))
=> #t)
(check
(doit #f port/false #f)
=> #t)
(check
(doit #f port/false "ciao")
=> '("ciao"))
;;; --------------------------------------------------------------------
;;; input-port
(check
(doit #f input-port (current-input-port))
=> #t)
(check
(doit #f input-port "ciao")
=> '("ciao"))
;;; --------------------------------------------------------------------
;;; input-port/false
(check
(doit #f input-port/false (current-input-port))
=> #t)
(check
(doit #f input-port/false #f)
=> #t)
(check
(doit #f input-port/false "ciao")
=> '("ciao"))
;;; --------------------------------------------------------------------
;;; output-port
(check
(doit #f output-port (current-output-port))
=> #t)
(check
(doit #f output-port "ciao")
=> '("ciao"))
;;; --------------------------------------------------------------------
;;; output-port/false
(check
(doit #f output-port/false (current-output-port))
=> #t)
(check
(doit #f output-port/false #f)
=> #t)
(check
(doit #f output-port/false "ciao")
=> '("ciao"))
;;; --------------------------------------------------------------------
;;; input/output-port
(check
(doit #f input/output-port (make-custom-textual-input/output-port
"id" values values values values values))
=> #t)
(check
(doit #f input/output-port "ciao")
=> '("ciao"))
;;; --------------------------------------------------------------------
;;; input/output-port/false
(check
(doit #f input/output-port/false (make-custom-textual-input/output-port
"id" values values values values values))
=> #t)
(check
(doit #f input/output-port/false #f)
=> #t)
(check
(doit #f input/output-port/false "ciao")
=> '("ciao"))
;;; --------------------------------------------------------------------
;;; textual-port
(check
(doit #f textual-port (current-input-port))
=> #t)
(check
(doit #f textual-port "ciao")
=> '("ciao"))
;;; --------------------------------------------------------------------
;;; textual-port/false
(check
(doit #f textual-port/false (current-input-port))
=> #t)
(check
(doit #f textual-port/false #f)
=> #t)
(check
(doit #f textual-port/false "ciao")
=> '("ciao"))
;;; --------------------------------------------------------------------
;;; binary-port
(check
(doit #f binary-port (standard-input-port))
=> #t)
(check
(doit #f binary-port "ciao")
=> '("ciao"))
;;; --------------------------------------------------------------------
;;; binary-port/false
(check
(doit #f binary-port/false (standard-input-port))
=> #t)
(check
(doit #f binary-port/false #f)
=> #t)
(check
(doit #f binary-port/false "ciao")
=> '("ciao"))
#t)
(parametrise ((check-test-name 'validate-procedure))
;;; procedure
(check
(doit #f procedure values)
=> #t)
(check
(doit #f procedure "ciao")
=> '("ciao"))
;;; --------------------------------------------------------------------
;;; procedure/false
(check
(doit #f procedure/false values)
=> #t)
(check
(doit #f procedure/false #f)
=> #t)
(check
(doit #f procedure/false "ciao")
=> '("ciao"))
#t)
(parametrise ((check-test-name 'validate-genstrings))
;;; general-c-string
(check
(doit #f general-c-string "ciao")
=> #t)
(check
(doit #f general-c-string '#vu8(1 2 3))
=> #t)
(check
(doit #f general-c-string (null-pointer))
=> #t)
(check
(doit #f general-c-string (null-memory-block))
=> #t)
(check
(doit #f general-c-string 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; general-c-string/false
(check
(doit #f general-c-string/false "ciao")
=> #t)
(check
(doit #f general-c-string/false '#vu8(1 2 3))
=> #t)
(check
(doit #f general-c-string/false (null-pointer))
=> #t)
(check
(doit #f general-c-string/false (null-memory-block))
=> #t)
(check
(doit #f general-c-string/false #f)
=> #t)
(check
(doit #f general-c-string/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; string length
(check
(doit #t general-c-string.len "ciao" #f)
=> #t)
(check
(doit #t general-c-string.len (null-pointer) 123)
=> #t)
(check
(doit #f general-c-string.len (null-pointer) #f)
=> '(#f))
;;; --------------------------------------------------------------------
;;; general-c-string*
(check
(doit #f general-c-string* "ciao" #f)
=> #t)
(check
(doit #f general-c-string* '#vu8(1 2 3) #f)
=> #t)
(check
(doit #f general-c-string* (null-memory-block) #f)
=> #t)
(check
(doit #f general-c-string* (null-pointer) 123)
=> #t)
(check
(doit #f general-c-string* (null-pointer) #f)
=> (list (null-pointer) #f))
;;; --------------------------------------------------------------------
;;; general-c-string*/false
(check
(doit #f general-c-string*/false "ciao" #f)
=> #t)
(check
(doit #f general-c-string*/false #f #f)
=> #t)
(check
(doit #f general-c-string*/false '#vu8(1 2 3) #f)
=> #t)
(check
(doit #f general-c-string*/false (null-memory-block) #f)
=> #t)
(check
(doit #f general-c-string*/false (null-pointer) 123)
=> #t)
(check
(doit #f general-c-string*/false (null-pointer) #f)
=> (list (null-pointer) #f))
#t)
(parametrise ((check-test-name 'validate-genbuffers))
;;; general-c-buffer
(check
(doit #f general-c-buffer "ciao")
=> '("ciao"))
(check
(doit #f general-c-buffer '#vu8(1 2 3))
=> #t)
(check
(doit #f general-c-buffer (null-pointer))
=> #t)
(check
(doit #f general-c-buffer (null-memory-block))
=> #t)
(check
(doit #f general-c-buffer 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; general-c-buffer/false
(check
(doit #f general-c-buffer/false "ciao")
=> '("ciao"))
(check
(doit #f general-c-buffer/false '#vu8(1 2 3))
=> #t)
(check
(doit #f general-c-buffer/false (null-pointer))
=> #t)
(check
(doit #f general-c-buffer/false (null-memory-block))
=> #t)
(check
(doit #f general-c-buffer/false #f)
=> #t)
(check
(doit #f general-c-buffer/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; buffer length
(check
(doit #t general-c-buffer.len "ciao" #f)
=> #t)
(check
(doit #t general-c-buffer.len (null-pointer) 123)
=> #t)
(check
(doit #f general-c-buffer.len (null-pointer) #f)
=> '(#f))
;;; --------------------------------------------------------------------
;;; general-c-buffer*
(check
(doit #f general-c-buffer* '#vu8(1 2 3) #f)
=> #t)
(check
(doit #f general-c-buffer* (null-memory-block) #f)
=> #t)
(check
(doit #f general-c-buffer* (null-pointer) 123)
=> #t)
(check
(doit #f general-c-buffer* (null-pointer) #f)
=> (list (null-pointer) #f))
;;; --------------------------------------------------------------------
;;; general-c-buffer*/false
(check
(doit #f general-c-buffer*/false #f #f)
=> #t)
(check
(doit #f general-c-buffer*/false '#vu8(1 2 3) #f)
=> #t)
(check
(doit #f general-c-buffer*/false (null-memory-block) #f)
=> #t)
(check
(doit #f general-c-buffer*/false (null-pointer) 123)
=> #t)
(check
(doit #f general-c-buffer*/false (null-pointer) #f)
=> (list (null-pointer) #f))
#t)
(parametrise ((check-test-name 'validate-genbuffers-sticky))
;;; general-c-sticky-buffer
(check
(doit #f general-c-sticky-buffer "ciao")
=> '("ciao"))
(check
(doit #f general-c-sticky-buffer '#vu8(1 2 3))
=> '(#vu8(1 2 3)))
(check
(doit #f general-c-sticky-buffer (null-pointer))
=> #t)
(check
(doit #f general-c-sticky-buffer (null-memory-block))
=> #t)
(check
(doit #f general-c-sticky-buffer 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; general-c-sticky-buffer/false
(check
(doit #f general-c-sticky-buffer/false "ciao")
=> '("ciao"))
(check
(doit #f general-c-sticky-buffer/false '#vu8(1 2 3))
=> '(#vu8(1 2 3)))
(check
(doit #f general-c-sticky-buffer/false (null-pointer))
=> #t)
(check
(doit #f general-c-sticky-buffer/false (null-memory-block))
=> #t)
(check
(doit #f general-c-sticky-buffer/false #f)
=> #t)
(check
(doit #f general-c-sticky-buffer/false 'ciao)
=> '(ciao))
;;; --------------------------------------------------------------------
;;; general-c-sticky-buffer*
(check
(doit #f general-c-sticky-buffer* (null-memory-block) #f)
=> #t)
(check
(doit #f general-c-sticky-buffer* (null-pointer) 123)
=> #t)
(check
(doit #f general-c-sticky-buffer* (null-pointer) #f)
=> (list (null-pointer) #f))
;;; --------------------------------------------------------------------
;;; general-c-sticky-buffer*/false
(check
(doit #f general-c-sticky-buffer*/false #f #f)
=> #t)
(check
(doit #f general-c-sticky-buffer*/false (null-memory-block) #f)
=> #t)
(check
(doit #f general-c-sticky-buffer*/false (null-pointer) 123)
=> #t)
(check
(doit #f general-c-sticky-buffer*/false (null-pointer) #f)
=> (list (null-pointer) #f))
#t)
(parametrise ((check-test-name 'logic-clause-or-false))
(define who 'test)
(check
(let ((obj 123))
(with-arguments-validation (who)
(((or false fixnum) obj))
123))
=> 123)
(check
(let ((obj #f))
(with-arguments-validation (who)
(((or false fixnum) obj))
#t))
=> #t)
(check-for-procedure-argument-violation
(let ((obj "ciao"))
(with-arguments-validation (who)
(((or false fixnum) obj))
#t))
=> (list who '("ciao")))
#t)
;;;; done
(check-report)
#| end of program |# )
;;; end of file
| {
"pile_set_name": "Github"
} |
/*
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
* under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership. Camunda licenses this file to you under the Apache License,
* Version 2.0; 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.camunda.bpm.engine.impl.cmd.batch;
import static org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotEmpty;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import org.camunda.bpm.engine.BadUserRequestException;
import org.camunda.bpm.engine.authorization.BatchPermissions;
import org.camunda.bpm.engine.batch.Batch;
import org.camunda.bpm.engine.history.HistoricProcessInstanceQuery;
import org.camunda.bpm.engine.history.UserOperationLogEntry;
import org.camunda.bpm.engine.impl.HistoricProcessInstanceQueryImpl;
import org.camunda.bpm.engine.impl.ProcessInstanceQueryImpl;
import org.camunda.bpm.engine.impl.batch.BatchConfiguration;
import org.camunda.bpm.engine.impl.batch.BatchElementConfiguration;
import org.camunda.bpm.engine.impl.batch.builder.BatchBuilder;
import org.camunda.bpm.engine.impl.batch.deletion.DeleteProcessInstanceBatchConfiguration;
import org.camunda.bpm.engine.impl.interceptor.Command;
import org.camunda.bpm.engine.impl.interceptor.CommandContext;
import org.camunda.bpm.engine.impl.persistence.entity.PropertyChange;
import org.camunda.bpm.engine.impl.util.CollectionUtil;
import org.camunda.bpm.engine.runtime.ProcessInstanceQuery;
/**
* @author Askar Akhmerov
*/
public class DeleteProcessInstanceBatchCmd implements Command<Batch> {
protected final String deleteReason;
protected List<String> processInstanceIds;
protected ProcessInstanceQuery processInstanceQuery;
protected HistoricProcessInstanceQuery historicProcessInstanceQuery;
protected boolean skipCustomListeners;
protected boolean skipSubprocesses;
public DeleteProcessInstanceBatchCmd(List<String> processInstances,
ProcessInstanceQuery processInstanceQuery,
HistoricProcessInstanceQuery historicProcessInstanceQuery,
String deleteReason,
boolean skipCustomListeners,
boolean skipSubprocesses) {
super();
this.processInstanceIds = processInstances;
this.processInstanceQuery = processInstanceQuery;
this.historicProcessInstanceQuery = historicProcessInstanceQuery;
this.deleteReason = deleteReason;
this.skipCustomListeners = skipCustomListeners;
this.skipSubprocesses = skipSubprocesses;
}
@Override
public Batch execute(CommandContext commandContext) {
BatchElementConfiguration elementConfiguration = collectProcessInstanceIds(commandContext);
ensureNotEmpty(BadUserRequestException.class, "processInstanceIds", elementConfiguration.getIds());
return new BatchBuilder(commandContext)
.type(Batch.TYPE_PROCESS_INSTANCE_DELETION)
.config(getConfiguration(elementConfiguration))
.permission(BatchPermissions.CREATE_BATCH_DELETE_RUNNING_PROCESS_INSTANCES)
.operationLogHandler(this::writeUserOperationLog)
.build();
}
protected BatchElementConfiguration collectProcessInstanceIds(CommandContext commandContext) {
BatchElementConfiguration elementConfiguration = new BatchElementConfiguration();
List<String> processInstanceIds = this.getProcessInstanceIds();
if (!CollectionUtil.isEmpty(processInstanceIds)) {
ProcessInstanceQueryImpl query = new ProcessInstanceQueryImpl();
query.processInstanceIds(new HashSet<>(processInstanceIds));
elementConfiguration.addDeploymentMappings(
commandContext.runWithoutAuthorization(query::listDeploymentIdMappings), processInstanceIds);
}
ProcessInstanceQueryImpl processInstanceQuery = (ProcessInstanceQueryImpl) this.processInstanceQuery;
if (processInstanceQuery != null) {
elementConfiguration.addDeploymentMappings(processInstanceQuery.listDeploymentIdMappings());
}
HistoricProcessInstanceQueryImpl historicProcessInstanceQuery = (HistoricProcessInstanceQueryImpl) this.historicProcessInstanceQuery;
if (historicProcessInstanceQuery != null) {
elementConfiguration.addDeploymentMappings(historicProcessInstanceQuery.listDeploymentIdMappings());
}
return elementConfiguration;
}
public List<String> getProcessInstanceIds() {
return processInstanceIds;
}
protected void writeUserOperationLog(CommandContext commandContext, int numInstances) {
List<PropertyChange> propertyChanges = new ArrayList<>();
propertyChanges.add(new PropertyChange("nrOfInstances", null, numInstances));
propertyChanges.add(new PropertyChange("async", null, true));
propertyChanges.add(new PropertyChange("deleteReason", null, deleteReason));
commandContext.getOperationLogManager()
.logProcessInstanceOperation(UserOperationLogEntry.OPERATION_TYPE_DELETE,
null,
null,
null,
propertyChanges);
}
public BatchConfiguration getConfiguration(BatchElementConfiguration elementConfiguration) {
return new DeleteProcessInstanceBatchConfiguration(elementConfiguration.getIds(), elementConfiguration.getMappings(),
deleteReason, skipCustomListeners, skipSubprocesses, false);
}
}
| {
"pile_set_name": "Github"
} |
#!/bin/bash
#
# Copyright 2020 The Magma Authors.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This script adds the Swagger UI to the static folder served by obsidian.
# This provides the UI for the API docs.
if [ -d "/var/opt/magma/static/swagger-ui" ]; then
echo "Swagger UI already setup"
# Comment out the below line if you need to upgrade Swagger
exit 0
fi
VERSION='3.1.7'
cd /tmp
rm -rf "v$VERSION.zip" swagger-ui
wget "https://github.com/swagger-api/swagger-ui/archive/v$VERSION.zip"
unzip "v$VERSION.zip" -d swagger-ui
rm -rf /var/opt/magma/static/swagger-ui
mkdir -p /var/opt/magma/static/swagger-ui
cp -r "swagger-ui/swagger-ui-$VERSION/dist" /var/opt/magma/static/swagger-ui
| {
"pile_set_name": "Github"
} |
;
; This is a minimal sample xl2tpd configuration file for use
; with L2TP over IPsec.
;
; The idea is to provide an L2TP daemon to which remote Windows L2TP/IPsec
; clients connect. In this example, the internal (protected) network
; is 192.168.1.0/24. A special IP range within this network is reserved
; for the remote clients: 192.168.1.128/25
; (i.e. 192.168.1.128 ... 192.168.1.254)
;
; The listen-addr parameter can be used if you want to bind the L2TP daemon
; to a specific IP address instead of to all interfaces. For instance,
; you could bind it to the interface of the internal LAN (e.g. 192.168.1.98
; in the example below). Yet another IP address (local ip, e.g. 192.168.1.99)
; will be used by xl2tpd as its address on pppX interfaces.
[global]
; listen-addr = 192.168.1.98
;
; requires openswan-2.5.18 or higher - Also does not yet work in combination
; with kernel mode l2tp as present in linux 2.6.23+
; ipsec saref = yes
; Use refinfo of 22 if using an SAref kernel patch based on openswan 2.6.35 or
; when using any of the SAref kernel patches for kernels up to 2.6.35.
; saref refinfo = 30
;
; force userspace = yes
;
; debug tunnel = yes
[lns default]
ip range = 192.168.1.128-192.168.1.254
local ip = 192.168.1.99
require chap = yes
refuse pap = yes
require authentication = yes
name = LinuxVPNserver
ppp debug = yes
pppoptfile = /etc/ppp/options.xl2tpd
length bit = yes
| {
"pile_set_name": "Github"
} |
package compute
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/tracing"
"net/http"
)
// VirtualMachineScaleSetVMExtensionsClient is the compute Client
type VirtualMachineScaleSetVMExtensionsClient struct {
BaseClient
}
// NewVirtualMachineScaleSetVMExtensionsClient creates an instance of the VirtualMachineScaleSetVMExtensionsClient
// client.
func NewVirtualMachineScaleSetVMExtensionsClient(subscriptionID string) VirtualMachineScaleSetVMExtensionsClient {
return NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI creates an instance of the
// VirtualMachineScaleSetVMExtensionsClient client using a custom endpoint. Use this when interacting with an Azure
// cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
func NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMExtensionsClient {
return VirtualMachineScaleSetVMExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the operation to create or update the VMSS VM extension.
// Parameters:
// resourceGroupName - the name of the resource group.
// VMScaleSetName - the name of the VM scale set.
// instanceID - the instance ID of the virtual machine.
// VMExtensionName - the name of the virtual machine extension.
// extensionParameters - parameters supplied to the Create Virtual Machine Extension operation.
func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineExtension) (result VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.CreateOrUpdate")
defer func() {
sc := -1
if result.Response() != nil {
sc = result.Response().StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, extensionParameters)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request")
return
}
result, err = client.CreateOrUpdateSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
return
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineExtension) (*http.Request, error) {
pathParameters := map[string]interface{}{
"instanceId": autorest.Encode("path", instanceID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmExtensionName": autorest.Encode("path", VMExtensionName),
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
const APIVersion = "2019-07-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters),
autorest.WithJSON(extensionParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture, err error) {
var resp *http.Response
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Delete the operation to delete the VMSS VM extension.
// Parameters:
// resourceGroupName - the name of the resource group.
// VMScaleSetName - the name of the VM scale set.
// instanceID - the instance ID of the virtual machine.
// VMExtensionName - the name of the virtual machine extension.
func (client VirtualMachineScaleSetVMExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string) (result VirtualMachineScaleSetVMExtensionsDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Delete")
defer func() {
sc := -1
if result.Response() != nil {
sc = result.Response().StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Delete", nil, "Failure preparing request")
return
}
result, err = client.DeleteSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Delete", result.Response(), "Failure sending request")
return
}
return
}
// DeletePreparer prepares the Delete request.
func (client VirtualMachineScaleSetVMExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"instanceId": autorest.Encode("path", instanceID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmExtensionName": autorest.Encode("path", VMExtensionName),
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
const APIVersion = "2019-07-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetVMExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsDeleteFuture, err error) {
var resp *http.Response
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body.
func (client VirtualMachineScaleSetVMExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// Get the operation to get the VMSS VM extension.
// Parameters:
// resourceGroupName - the name of the resource group.
// VMScaleSetName - the name of the VM scale set.
// instanceID - the instance ID of the virtual machine.
// VMExtensionName - the name of the virtual machine extension.
// expand - the expand expression to apply on the operation.
func (client VirtualMachineScaleSetVMExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, expand string) (result VirtualMachineExtension, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Get")
defer func() {
sc := -1
if result.Response.Response != nil {
sc = result.Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, expand)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", nil, "Failure preparing request")
return
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", resp, "Failure sending request")
return
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
func (client VirtualMachineScaleSetVMExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"instanceId": autorest.Encode("path", instanceID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmExtensionName": autorest.Encode("path", VMExtensionName),
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
const APIVersion = "2019-07-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(expand) > 0 {
queryParameters["$expand"] = autorest.Encode("query", expand)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetVMExtensionsClient) GetSender(req *http.Request) (*http.Response, error) {
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}
// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client VirtualMachineScaleSetVMExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineExtension, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// List the operation to get all extensions of an instance in Virtual Machine Scaleset.
// Parameters:
// resourceGroupName - the name of the resource group.
// VMScaleSetName - the name of the VM scale set.
// instanceID - the instance ID of the virtual machine.
// expand - the expand expression to apply on the operation.
func (client VirtualMachineScaleSetVMExtensionsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result VirtualMachineExtensionsListResult, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.List")
defer func() {
sc := -1
if result.Response.Response != nil {
sc = result.Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, expand)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "List", nil, "Failure preparing request")
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "List", resp, "Failure sending request")
return
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client VirtualMachineScaleSetVMExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"instanceId": autorest.Encode("path", instanceID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
const APIVersion = "2019-07-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(expand) > 0 {
queryParameters["$expand"] = autorest.Encode("query", expand)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetVMExtensionsClient) ListSender(req *http.Request) (*http.Response, error) {
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client VirtualMachineScaleSetVMExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineExtensionsListResult, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Update the operation to update the VMSS VM extension.
// Parameters:
// resourceGroupName - the name of the resource group.
// VMScaleSetName - the name of the VM scale set.
// instanceID - the instance ID of the virtual machine.
// VMExtensionName - the name of the virtual machine extension.
// extensionParameters - parameters supplied to the Update Virtual Machine Extension operation.
func (client VirtualMachineScaleSetVMExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (result VirtualMachineScaleSetVMExtensionsUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Update")
defer func() {
sc := -1
if result.Response() != nil {
sc = result.Response().StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, extensionParameters)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Update", nil, "Failure preparing request")
return
}
result, err = client.UpdateSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Update", result.Response(), "Failure sending request")
return
}
return
}
// UpdatePreparer prepares the Update request.
func (client VirtualMachineScaleSetVMExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (*http.Request, error) {
pathParameters := map[string]interface{}{
"instanceId": autorest.Encode("path", instanceID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmExtensionName": autorest.Encode("path", VMExtensionName),
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
const APIVersion = "2019-07-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters),
autorest.WithJSON(extensionParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetVMExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsUpdateFuture, err error) {
var resp *http.Response
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// UpdateResponder handles the response to the Update request. The method always
// closes the http.Response Body.
func (client VirtualMachineScaleSetVMExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
| {
"pile_set_name": "Github"
} |
package metrics
import (
"fmt"
"io"
"sort"
"time"
)
// Write sorts writes each metric in the given registry periodically to the
// given io.Writer.
func Write(r Registry, d time.Duration, w io.Writer) {
for _ = range time.Tick(d) {
WriteOnce(r, w)
}
}
// WriteOnce sorts and writes metrics in the given registry to the given
// io.Writer.
func WriteOnce(r Registry, w io.Writer) {
var namedMetrics namedMetricSlice
r.Each(func(name string, i interface{}) {
namedMetrics = append(namedMetrics, namedMetric{name, i})
})
sort.Sort(namedMetrics)
for _, namedMetric := range namedMetrics {
switch metric := namedMetric.m.(type) {
case Counter:
fmt.Fprintf(w, "counter %s\n", namedMetric.name)
fmt.Fprintf(w, " count: %9d\n", metric.Count())
case Gauge:
fmt.Fprintf(w, "gauge %s\n", namedMetric.name)
fmt.Fprintf(w, " value: %9d\n", metric.Value())
case GaugeFloat64:
fmt.Fprintf(w, "gauge %s\n", namedMetric.name)
fmt.Fprintf(w, " value: %f\n", metric.Value())
case Healthcheck:
metric.Check()
fmt.Fprintf(w, "healthcheck %s\n", namedMetric.name)
fmt.Fprintf(w, " error: %v\n", metric.Error())
case Histogram:
h := metric.Snapshot()
ps := h.Percentiles([]float64{0.5, 0.75, 0.95, 0.99, 0.999})
fmt.Fprintf(w, "histogram %s\n", namedMetric.name)
fmt.Fprintf(w, " count: %9d\n", h.Count())
fmt.Fprintf(w, " min: %9d\n", h.Min())
fmt.Fprintf(w, " max: %9d\n", h.Max())
fmt.Fprintf(w, " mean: %12.2f\n", h.Mean())
fmt.Fprintf(w, " stddev: %12.2f\n", h.StdDev())
fmt.Fprintf(w, " median: %12.2f\n", ps[0])
fmt.Fprintf(w, " 75%%: %12.2f\n", ps[1])
fmt.Fprintf(w, " 95%%: %12.2f\n", ps[2])
fmt.Fprintf(w, " 99%%: %12.2f\n", ps[3])
fmt.Fprintf(w, " 99.9%%: %12.2f\n", ps[4])
case Meter:
m := metric.Snapshot()
fmt.Fprintf(w, "meter %s\n", namedMetric.name)
fmt.Fprintf(w, " count: %9d\n", m.Count())
fmt.Fprintf(w, " 1-min rate: %12.2f\n", m.Rate1())
fmt.Fprintf(w, " 5-min rate: %12.2f\n", m.Rate5())
fmt.Fprintf(w, " 15-min rate: %12.2f\n", m.Rate15())
fmt.Fprintf(w, " mean rate: %12.2f\n", m.RateMean())
case Timer:
t := metric.Snapshot()
ps := t.Percentiles([]float64{0.5, 0.75, 0.95, 0.99, 0.999})
fmt.Fprintf(w, "timer %s\n", namedMetric.name)
fmt.Fprintf(w, " count: %9d\n", t.Count())
fmt.Fprintf(w, " min: %9d\n", t.Min())
fmt.Fprintf(w, " max: %9d\n", t.Max())
fmt.Fprintf(w, " mean: %12.2f\n", t.Mean())
fmt.Fprintf(w, " stddev: %12.2f\n", t.StdDev())
fmt.Fprintf(w, " median: %12.2f\n", ps[0])
fmt.Fprintf(w, " 75%%: %12.2f\n", ps[1])
fmt.Fprintf(w, " 95%%: %12.2f\n", ps[2])
fmt.Fprintf(w, " 99%%: %12.2f\n", ps[3])
fmt.Fprintf(w, " 99.9%%: %12.2f\n", ps[4])
fmt.Fprintf(w, " 1-min rate: %12.2f\n", t.Rate1())
fmt.Fprintf(w, " 5-min rate: %12.2f\n", t.Rate5())
fmt.Fprintf(w, " 15-min rate: %12.2f\n", t.Rate15())
fmt.Fprintf(w, " mean rate: %12.2f\n", t.RateMean())
}
}
}
type namedMetric struct {
name string
m interface{}
}
// namedMetricSlice is a slice of namedMetrics that implements sort.Interface.
type namedMetricSlice []namedMetric
func (nms namedMetricSlice) Len() int { return len(nms) }
func (nms namedMetricSlice) Swap(i, j int) { nms[i], nms[j] = nms[j], nms[i] }
func (nms namedMetricSlice) Less(i, j int) bool {
return nms[i].name < nms[j].name
}
| {
"pile_set_name": "Github"
} |
央视/null
电信/null
移动/null
网通/null
联通/null
铁通/null
百度/null
环球网/null
长城网/null
新浪/null
腾讯/null
搜搜/soso
谷歌/null
雅虎/null
微软/null
中关村/null
搜狐/null
网易/null
硅谷/null
维基百科/null
巨人网络/null
阿里巴巴/null
阿里旺旺/旺旺
旺旺/null
淘宝/null
赶集网/null
猪八戒网/null
唯你英语/null
拉手网/null
百贯福泰/null
汇划算/null
汇划算网/null
聚划算/null
天猫/null
天猫网/null
亚马逊/null
亚马逊网/null
拍拍/null
拍拍网/null
京东/null
京东商城/null
返利网/null
支付宝/null
支付宝担保/null
支付宝及时到帐/null
支付宝双工能/null
财付通/null
财付通及时到帐/null
网银在线/null
苏宁易购/null
苏宁电器/null
仙童公司/null
开源中国/null
畅想网络/null
快乐大本营/null
越策越开心/null
超级男声/null
超男/null
超级女声/超女
超女/超级女声
好声音/null
快乐男声/快男
快男/快乐男声
快乐女声/null
快女/null
德克士/null
肯德基/null
奥利奥/null
回头客/null
苏波尔/null
苏宁/null
苏宁电器/null
苏宁易购/null
中央银行/null
人民银行/null
工商银行/null
农业银行/null
中国银行/null
建设银行/null
交通银行/null
华夏银行/null
光大银行/null
招商银行/null
中信银行/null
兴业银行/null
民生银行/null
深圳发展银行/null
广东发展银行/null
上海浦东发展银行/null
恒丰银行/null
农业发展银行/null
国家进出口信贷银行/null
国家开发银行/null
北京商业银行/null
上海银行/null
济南商业银行/null
信用社/null
农村信用社/null
邮政局/null
邮政储蓄银行/null
| {
"pile_set_name": "Github"
} |
<?php
use PHPUnit\Framework\TestCase;
class CoverageMethodParenthesesTest extends TestCase
{
/**
* @covers CoveredClass::publicMethod()
*/
public function testSomething()
{
$o = new CoveredClass;
$o->publicMethod();
}
}
| {
"pile_set_name": "Github"
} |
" themis: supporter: builtin_assert: Handle Vim built-in assertion functions.
" Version: 1.5.4
" Author : thinca <[email protected]>
" License: zlib License
let s:save_cpo = &cpoptions
set cpoptions&vim
let s:receiver = {}
function! s:receiver.start_test(bundle, entry) abort
if exists('v:errors')
let v:errors = []
endif
endfunction
function! s:receiver.end_test(report) abort
if !exists('v:errors')
return
endif
for error in v:errors
let [throwpoint, exception] = matchlist(error, '\v([^:]+):\s*(.*)')[1 : 2]
call a:report.add_exception(exception, throwpoint)
endfor
let v:errors = []
endfunction
function! s:parse_error(error) abort
let matched = matchlist(a:error, '\v^(.{-}) line (\d+):\s*(.+)$')
endfunction
function! themis#supporter#builtin_assert#new(runner) abort
call a:runner.add_event(deepcopy(s:receiver))
return {}
endfunction
let &cpoptions = s:save_cpo
unlet s:save_cpo
| {
"pile_set_name": "Github"
} |
spring.application.name=ratings-data-service
server.port=8083 | {
"pile_set_name": "Github"
} |
//
// NSMenu+Extension.swift
// Fuwari
//
// Created by Kengo Yokoyama on 2018/07/14.
// Copyright © 2018年 AppKnop. All rights reserved.
//
import Cocoa
extension NSMenu {
func addItem(withTitle title: String, action: Selector? = nil, target: AnyObject? = nil, representedObject: AnyObject? = nil, state: NSControl.StateValue = .off, submenu: NSMenu? = nil) {
let menuItem = NSMenuItem(title: title, action: action, keyEquivalent: "")
menuItem.target = target
menuItem.representedObject = representedObject
menuItem.state = state
menuItem.submenu = submenu
addItem(menuItem)
}
}
| {
"pile_set_name": "Github"
} |
/* crypto/ui/ui.h */
/*
* Written by Richard Levitte ([email protected]) for the OpenSSL project
* 2001.
*/
/* ====================================================================
* Copyright (c) 2001 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* [email protected].
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED 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 OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* ([email protected]). This product includes software written by Tim
* Hudson ([email protected]).
*
*/
#ifndef HEADER_UI_COMPAT_H
# define HEADER_UI_COMPAT_H
# include <openssl/opensslconf.h>
# include <openssl/ui.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* The following functions were previously part of the DES section, and are
* provided here for backward compatibility reasons.
*/
# define des_read_pw_string(b,l,p,v) \
_ossl_old_des_read_pw_string((b),(l),(p),(v))
# define des_read_pw(b,bf,s,p,v) \
_ossl_old_des_read_pw((b),(bf),(s),(p),(v))
int _ossl_old_des_read_pw_string(char *buf, int length, const char *prompt,
int verify);
int _ossl_old_des_read_pw(char *buf, char *buff, int size, const char *prompt,
int verify);
#ifdef __cplusplus
}
#endif
#endif
| {
"pile_set_name": "Github"
} |
////
Automatically generated by PainlessDocGenerator. Do not edit.
Rebuild by running `gradle generatePainlessApi`.
////
[[painless-api-reference-CharSequence]]++CharSequence++::
* ++[[painless-api-reference-CharSequence-charAt-1]]char link:{java8-javadoc}/java/lang/CharSequence.html#charAt%2Dint%2D[charAt](int)++ (link:{java9-javadoc}/java/lang/CharSequence.html#charAt%2Dint%2D[java 9])
* ++[[painless-api-reference-CharSequence-chars-0]]<<painless-api-reference-IntStream,IntStream>> link:{java8-javadoc}/java/lang/CharSequence.html#chars%2D%2D[chars]()++ (link:{java9-javadoc}/java/lang/CharSequence.html#chars%2D%2D[java 9])
* ++[[painless-api-reference-CharSequence-codePoints-0]]<<painless-api-reference-IntStream,IntStream>> link:{java8-javadoc}/java/lang/CharSequence.html#codePoints%2D%2D[codePoints]()++ (link:{java9-javadoc}/java/lang/CharSequence.html#codePoints%2D%2D[java 9])
* ++[[painless-api-reference-CharSequence-length-0]]int link:{java8-javadoc}/java/lang/CharSequence.html#length%2D%2D[length]()++ (link:{java9-javadoc}/java/lang/CharSequence.html#length%2D%2D[java 9])
* ++[[painless-api-reference-CharSequence-replaceAll-2]]<<painless-api-reference-String,String>> link:{painless-javadoc}/org/elasticsearch/painless/api/Augmentation.html#replaceAll%2Djava.lang.CharSequence%2Djava.util.regex.Pattern%2Djava.util.function.Function%2D[replaceAll](<<painless-api-reference-Pattern,Pattern>>, <<painless-api-reference-Function,Function>>)++
* ++[[painless-api-reference-CharSequence-replaceFirst-2]]<<painless-api-reference-String,String>> link:{painless-javadoc}/org/elasticsearch/painless/api/Augmentation.html#replaceFirst%2Djava.lang.CharSequence%2Djava.util.regex.Pattern%2Djava.util.function.Function%2D[replaceFirst](<<painless-api-reference-Pattern,Pattern>>, <<painless-api-reference-Function,Function>>)++
* ++[[painless-api-reference-CharSequence-subSequence-2]]<<painless-api-reference-CharSequence,CharSequence>> link:{java8-javadoc}/java/lang/CharSequence.html#subSequence%2Dint%2Dint%2D[subSequence](int, int)++ (link:{java9-javadoc}/java/lang/CharSequence.html#subSequence%2Dint%2Dint%2D[java 9])
* ++[[painless-api-reference-CharSequence-toString-0]]<<painless-api-reference-String,String>> link:{java8-javadoc}/java/lang/CharSequence.html#toString%2D%2D[toString]()++ (link:{java9-javadoc}/java/lang/CharSequence.html#toString%2D%2D[java 9])
* Inherits methods from ++<<painless-api-reference-Object,Object>>++
| {
"pile_set_name": "Github"
} |
cheats = 11
cheat0_desc = "No Damage\Player 1"
cheat0_enable = false
cheat0_code = "50000402 0000;8113CF08 0000"
cheat1_desc = "No Damage\Player 2"
cheat1_enable = false
cheat1_code = "50000402 0000;8113EF98 0000"
cheat2_desc = "Unlock All Tracks and Vehicles"
cheat2_enable = false
cheat2_code = "8008D0AC 0001"
cheat3_desc = "Freeze All Lap Timers"
cheat3_enable = false
cheat3_code = "8013CBD1 0001;8013CBD5 0001;8013CBD9 0001"
cheat4_desc = "Freeze Overall Timer"
cheat4_enable = false
cheat4_code = "8013CBC5 0001"
cheat5_desc = "Laps Of Race"
cheat5_enable = false
cheat5_code = "8013CBBE XXXX"
cheat6_desc = "Play As\Player 1"
cheat6_enable = false
cheat6_code = "8013CEC5 XXXX"
cheat7_desc = "Level Select"
cheat7_enable = false
cheat7_code = "8013CECB XXXX"
cheat8_desc = "Play As\Player 2"
cheat8_enable = false
cheat8_code = "8013CEC6 XXXX"
cheat9_desc = "Always 1st"
cheat9_enable = false
cheat9_code = "8013CC10 0001"
cheat10_desc = "Music Modifier"
cheat10_enable = false
cheat10_code = "80106B7C XXXX"
| {
"pile_set_name": "Github"
} |
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2020, Daniel Stenberg, <[email protected]>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.haxx.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
###########################################################################
set(LIB_NAME libcurl)
if(BUILD_SHARED_LIBS)
set(CURL_STATICLIB NO)
else()
set(CURL_STATICLIB YES)
endif()
# Use:
# * CURL_STATICLIB
configure_file(curl_config.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/curl_config.h)
transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
include(${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake)
list(APPEND HHEADERS
${CMAKE_CURRENT_BINARY_DIR}/curl_config.h
)
if(MSVC)
list(APPEND CSOURCES libcurl.rc)
endif()
# SET(CSOURCES
# # memdebug.c -not used
# # nwlib.c - Not used
# # strtok.c - specify later
# # strtoofft.c - specify later
# )
# # if we have Kerberos 4, right now this is never on
# #OPTION(CURL_KRB4 "Use Kerberos 4" OFF)
# IF(CURL_KRB4)
# SET(CSOURCES ${CSOURCES}
# krb4.c
# security.c
# )
# ENDIF(CURL_KRB4)
# #OPTION(CURL_MALLOC_DEBUG "Debug mallocs in Curl" OFF)
# MARK_AS_ADVANCED(CURL_MALLOC_DEBUG)
# IF(CURL_MALLOC_DEBUG)
# SET(CSOURCES ${CSOURCES}
# memdebug.c
# )
# ENDIF(CURL_MALLOC_DEBUG)
# # only build compat strtoofft if we need to
# IF(NOT HAVE_STRTOLL AND NOT HAVE__STRTOI64)
# SET(CSOURCES ${CSOURCES}
# strtoofft.c
# )
# ENDIF(NOT HAVE_STRTOLL AND NOT HAVE__STRTOI64)
# The rest of the build
include_directories(${CMAKE_CURRENT_BINARY_DIR}/../include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../include)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/..)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
if(USE_ARES)
include_directories(${CARES_INCLUDE_DIR})
endif()
add_library(
${LIB_NAME}
${HHEADERS} ${CSOURCES}
)
add_library(
${PROJECT_NAME}::${LIB_NAME}
ALIAS ${LIB_NAME}
)
if(MSVC AND NOT BUILD_SHARED_LIBS)
set_target_properties(${LIB_NAME} PROPERTIES STATIC_LIBRARY_FLAGS ${CMAKE_EXE_LINKER_FLAGS})
endif()
if(NOT BUILD_SHARED_LIBS)
set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_COMPILE_DEFINITIONS CURL_STATICLIB)
endif()
target_link_libraries(${LIB_NAME} ${CURL_LIBS})
if(WIN32)
add_definitions(-D_USRDLL)
endif()
set_target_properties(${LIB_NAME} PROPERTIES COMPILE_DEFINITIONS BUILDING_LIBCURL)
if(HIDES_CURL_PRIVATE_SYMBOLS)
set_property(TARGET ${LIB_NAME} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_HIDDEN_SYMBOLS")
set_property(TARGET ${LIB_NAME} APPEND PROPERTY COMPILE_FLAGS ${CURL_CFLAG_SYMBOLS_HIDE})
endif()
# Remove the "lib" prefix since the library is already named "libcurl".
set_target_properties(${LIB_NAME} PROPERTIES PREFIX "")
set_target_properties(${LIB_NAME} PROPERTIES IMPORT_PREFIX "")
if(CURL_HAS_LTO)
set_target_properties(${LIB_NAME} PROPERTIES
INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE
INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE)
endif()
if(WIN32)
if(BUILD_SHARED_LIBS)
# Add "_imp" as a suffix before the extension to avoid conflicting with the statically linked "libcurl.lib"
set_target_properties(${LIB_NAME} PROPERTIES IMPORT_SUFFIX "_imp.lib")
endif()
endif()
target_include_directories(${LIB_NAME} INTERFACE
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CURL_SOURCE_DIR}/include>)
install(TARGETS ${LIB_NAME}
EXPORT ${TARGETS_EXPORT_NAME}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
export(TARGETS ${LIB_NAME}
APPEND FILE ${PROJECT_BINARY_DIR}/libcurl-target.cmake
NAMESPACE ${PROJECT_NAME}::
)
| {
"pile_set_name": "Github"
} |
"""empty message
Revision ID: f234688f5ebd
Revises: 213fcca48483
Create Date: 2019-06-30 18:30:55.295040
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f234688f5ebd'
down_revision = '213fcca48483'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('profile_picture_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'users', 'file', ['profile_picture_id'], ['id'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'users', type_='foreignkey')
op.drop_column('users', 'profile_picture_id')
# ### end Alembic commands ###
| {
"pile_set_name": "Github"
} |
.. _INSTALL:
Installing Modules on Unix
==========================
This document is an overview of building and installing Modules on a Unix
system.
Requirements
------------
Modules consists of one Tcl script so to run it from a user shell the
only requirement is to have a working version of ``tclsh`` (version
8.4 or later) available on your system. ``tclsh`` is a part of Tcl
(http://www.tcl.tk/software/tcltk/).
To install Modules from a distribution tarball or a clone of the git
repository, a build step is there to adapt the initialization scripts to your
configuration and create the documentation files. This build step requires
the tools to be found on your system:
* bash
* make
* sed
* runtest
When also installing Modules Tcl extension library or the bundled
compatibility version of Modules (both enabled by default), these additional
tools are needed:
* grep
* gcc
* tcl-devel >= 8.4
When installing from a distribution tarball, documentation is pre-built and
scripts to configure Modules Tcl extension library and compatibility version
builds are already generated. Thus no additional software is required. When
installing from a clone of the git repository or from a git archive export,
documentation and scripts to prepare for compilation have to be built and the
following tools are required:
* autoconf
* automake
* autopoint
* python
* sphinx >= 1.0
Installation instructions
-------------------------
The simplest way to build and install Modules is::
$ ./configure
$ make
$ make install
Some explanation, step by step:
1. ``cd`` to the directory containing the package's source code. Your system
must have the above requirements installed to properly build scripts,
compatibility version of Modules if enabled, and documentation if build
occurs from a clone of the git repository.
2. Type ``./configure`` to adapt the installation for your system. At this
step you can choose the installation paths and the features you want to
enable in the initialization scripts (see `Build and installation options`_
section below for a complete overview of the available options)
3. Type ``make`` to adapt scripts to the configuration, build Tcl extension
library and compatibility version if enabled and build documentation if
working from git repository.
4. Optionally, type ``make test`` to run the test suite.
5. Type ``make install`` to install modulecmd.tcl, initialization scripts,
compatibility version if built and documentation.
6. Optionally, type ``make testinstall`` to run the installation test suite.
7. You can remove the built files from the source code directory by typing
``make clean``. To also remove the files that ``configure`` created, type
``make distclean``.
A default installation process like described above will install Modules
under ``/usr/local/Modules``. You can change this with the ``--prefix``
option. By default, ``/usr/local/Modules/modulefiles`` will be setup as
the default directory containing modulefiles. ``--modulefilesdir`` option
enables to change this directory location. For example::
$ ./configure --prefix=/usr/share/Modules \
--modulefilesdir=/etc/modulefiles
See `Build and installation options`_ section to discover all ``./configure``
option available.
.. note:: GNU Make is excepted to be used for this build and installation
process. On non-Linux systems, the ``gmake`` should be called instead of
``make``.
Configuration
-------------
Once installed you should review and adapt the configuration to make it fit
your needs. The following steps are provided for example. They are not
necessarily mandatory as it depends of the kind of setup you want to achieve.
1. Tune the initialization scripts. Review of these scripts is highly
encouraged as you may add or adapt specific stuff to get Modules
initialized the way you want.
2. Enable Modules initialization at shell startup. An easy way to get module
function defined and its associated configuration setup at shell startup
is to make the initialization scripts part of the system-wide environment
setup in ``/etc/profile.d``. To do so, make a link in this directory to the
profile scripts that can be found in your Modules installation init
directory::
$ ln -s PREFIX/init/profile.sh /etc/profile.d/modules.sh
$ ln -s PREFIX/init/profile.csh /etc/profile.d/modules.csh
These profile scripts will automatically adapt to the kind of ``sh`` or
``csh`` shell you are running.
Another approach may be to get the Modules initialization script sourced
from the shell configuration startup file. For instance following line
could be added to the end of the ``~/.bashrc`` file if running Bash shell::
source PREFIX/init/bash
Beware that shells have multiple ways to initialize depending if they are
a login shell or not and if they are launched in interactive mode or not.
3. Define module paths to enable by default. Edit ``modulerc`` configuration
file or ``.modulespath`` if you have chosen ``--enable-dotmodulespath`` at
configure time. If you have set ``--with-initconf-in`` to ``etcdir`` to
install these Modules initialization configurations in the configuration
directory designated by the ``--etcdir`` option, these configuration files
are respectively named ``initrc`` and ``modulespath``. If you use
``.modulespath`` (or ``modulespath``) configuration file, add one line
mentioning each modulefile directory::
/path/to/regular/modulefiles
/path/to/other/modulefiles
If you use ``modulerc`` (or ``initrc``) configuration file, add one line
mentioning each modulefile directory prefixed by the ``module use``
command::
module use /path/to/regular/modulefiles
module use /path/to/other/modulefiles
4. Define modulefiles to load by default. Edit ``modulerc`` (or ``initrc``)
configuration file. Modulefiles to load cannot be specified in
``.modulespath`` (or ``modulespath``) file. Add there all the modulefiles
you want to load by default at Modules initialization time.
Add one line mentioning each modulefile to load prefixed by the
``module load`` command::
module load foo
module load bar
In fact you can add to the ``modulerc`` (or ``initrc``) configuration file
any kind of supported module command, like ``module config`` commands to
tune ``module``'s default behaviors.
If you go through the above steps you should have a valid setup tuned to your
needs. After that you still have to write modulefiles to get something to
load and unload in your newly configured Modules setup. Please have a look
at the ``doc/example.txt`` that explains how the user environment is setup
with Modules at the University of Minnesota computer science department.
Build and installation options
------------------------------
Options available at the ``./configure`` installation step are described
below. These options enable to choose the installation paths and the
features to enable or disable. You can also get a description of these
options by typing ``./configure --help``.
Fine tuning of the installation directories (the default value for each option
is displayed within brakets):
--prefix=PREFIX Installation root directory [``/usr/local/Modules``]
--bindir=DIR Directory for executables reachable by users
[``PREFIX/bin``]
--libdir=DIR Directory for object code libraries like
libtclenvmodules.so [``PREFIX/lib``]
--libexecdir=DIR Directory for executables called by other executables
like modulecmd.tcl [``PREFIX/libexec``]
--etcdir=DIR Directory for the executable configuration scripts
[``PREFIX/etc``]
--initdir=DIR Directory for the per-shell environment initialization
scripts [``PREFIX/init``]
--datarootdir=DIR Base directory to set the man and doc directories
[``PREFIX/share``]
--mandir=DIR Directory to host man pages [``DATAROOTDIR/man``]
--docdir=DIR Directory to host documentation other than man
pages like README, license file, etc
[``DATAROOTDIR/doc``]
--vimdatadir=DIR Directory to host Vim addon files
[``DATAROOTDIR/vim/vimfiles``]
--modulefilesdir=DIR Directory of main modulefiles also called system
modulefiles [``PREFIX/modulefiles``]
Optional Features (the default for each option is displayed within
parenthesis, to disable an option replace ``enable`` by ``disable`` for
instance ``--disable-set-manpath``):
--enable-set-manpath Prepend man page directory defined by the ``--mandir``
option to the MANPATH environment variable in the shell
initialization scripts. (default=yes)
--enable-append-manpath
Append rather prepend man page directory to the MANPATH
environment variable when the ``--enable-set-manpath``
option is enabled. (default=no)
--enable-set-binpath Prepend binary directory defined by the ``--bindir``
option to the PATH environment variable in the shell
initialization scripts. (default=yes)
--enable-append-binpath
Append rather prepend binary directory to the PATH
environment variable when the ``--enable-set-binpath``
option is enabled. (default=no)
--enable-dotmodulespath, --enable-modulespath
Set the module paths defined by ``--with-modulepath``
option in a ``.modulespath`` file (following C version
fashion) within the initialization directory defined by
the ``--initdir`` option rather than within the
``modulerc`` file. Or respectively, if option
``--with-initconf-in`` has been set to ``etcdir``, in a
``modulespath`` file within the configuration directory
defined by the ``--etcdir`` option rather than within
the ``initrc`` file. (default=no)
--enable-doc-install Install the documentation files in the documentation
directory defined with the ``--docdir`` option. This
feature has no impact on manual pages installation.
Disabling documentation file installation is useful in
case of installation process handled via a package
manager which handles by itself the installation of
this kind of documents. (default=yes)
--enable-vim-addons Install the Vim addon files in the Vim addons directory
defined with the ``--vimdatadir`` option. (default=yes)
--enable-example-modulefiles
Install some modulefiles provided as example in the
system modulefiles directory defined with the
``modulefilesdir`` option. (default=yes)
--enable-compat-version
Build and install the Modules compatibility (C) version
in addition to the main released version. This feature
also enables switching capabilities from initialization
script between the two installed version of Modules (by
setting-up the ``switchml`` shell function or alias).
(default=no)
--enable-libtclenvmodules
Build and install the Modules Tcl extension library
which provides optimized Tcl commands for the
modulecmd.tcl script.
--enable-multilib-support
Support multilib systems by looking in modulecmd.tcl at
an alternative location where to find the Modules Tcl
extension library depending on current machine
architecture.
--enable-versioning Append Modules version to installation prefix and deploy
a ``versions`` modulepath shared between all versioning
enabled Modules installation. A modulefile corresponding
to Modules version is added to the shared modulepath and
enables to switch from one Modules version to another.
(default=no)
--enable-silent-shell-debug-support
Generate code in module function definition and
initialization scripts to add support for silencing
shell debugging properties (default=yes)
--enable-set-shell-startup
Set when module function is defined the shell startup
file to ensure that the module function is still defined
in sub-shells. (default=yes)
--enable-quarantine-support
Generate code in module function definition and
initialization scripts to add support for the
environment variable quarantine mechanism (default=yes)
--enable-auto-handling
Set modulecmd.tcl to automatically apply automated
modulefiles handling actions, like loading the
pre-requisites of a modulefile when loading this
modulefile. (default=no)
--enable-avail-indepth
When performing an ``avail`` sub-command, include in
search results the matching modulefiles and directories
and recursively the modulefiles and directories
contained in these matching directories when enabled or
limit search results to the matching modulefiles and
directories found at the depth level expressed by the
search query if disabled. (default=yes)
--enable-implicit-default
Define an implicit default version, for modules with
none explicitly defined, to select when the name of the
module to evaluate is passed without the mention of a
specific version. When this option is disabled the name
of the module passed for evaluation should be fully
qualified elsewhere an error is returned. (default=yes)
--enable-extended-default
Allow to specify module versions by their starting part,
i.e. substring separated from the rest of the version
string by a ``.`` character. (default=no)
--enable-advanced-version-spec
Activate the advanced module version specifiers which
enables to finely select module versions by specifying
after the module name a version constraint prefixed by
the ``@`` character. (default=no)
--enable-ml Define the ``ml`` command, a handy frontend to the
module command, when Modules initializes. (default=yes)
--enable-color Control if output should be colored by default or not.
A value of ``yes`` equals to the ``auto`` color mode.
``no`` equals to the ``never`` color mode. (default=no)
--enable-wa-277 Activate workaround for issue #277 related to Tcsh
history mechanism which does not cope well with default
module alias definition. Note that enabling this
workaround solves Tcsh history issue but weakens
shell evaluation of the code produced by modulefiles.
--enable-windows-support
Install all required files for Windows platform
(``module``, ``ml`` and ``envml`` command batch file and
``cmd.cmd`` initialization script). (default=no)
Optional Packages (the default for each option is displayed within
parenthesis, to disable an option replace ``with`` by ``without`` for
instance ``--without-modulepath``):
--with-bin-search-path=PATHLIST
List of paths to look at when searching the location of
tools required to build and configure Modules
(default=\ ``/usr/bin:/bin:/usr/local/bin``)
--with-moduleshome Location of the main Modules package file directory
(default=\ ``PREFIX``)
--with-initconf-in=VALUE
Location where to install Modules initialization
configuration files. Either ``initdir`` or ``etcdir``
(default=\ ``initdir``)
--with-tclsh=BIN Name or full path of Tcl interpreter shell
(default=\ ``tclsh``)
--with-pager=BIN Name or full path of default pager program to use to
paginate informational message output (can be superseded
at run-time by environment variable)
(default=\ ``less``)
--with-pager-opts=OPTLIST
Settings to apply to default pager program
(default=\ ``-eFKRX``)
--with-verbosity=VALUE
Specify default message verbosity. accepted values are
``silent``, ``concise``, ``normal``, ``verbose``,
``trace``, ``debug`` and ``debug2``.
(default=\ ``normal``)
--with-dark-background-colors=SGRLIST
Default color set to apply if terminal background color
is defined to ``dark``. SGRLIST follows the same syntax
than used in ``LS_COLORS``. Each element in SGRLIST is
an output item associated to a Select Graphic Rendition
(SGR) code. Elements in SGRLIST are separated by ``:``.
Output items are designated by keys. Items able to be
colorized are: highlighted element (``hi``), debug
information (``db``), trace information (``tr``) tag
separator (``se``); Error (``er``), warning (``wa``),
module error (``me``) and info (``in``) message
prefixes; Modulepath (``mp``), directory (``di``),
module alias (``al``), module symbolic version (``sy``)
and module ``default`` version (``de``). For a complete
SGR code reference, see
https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters.
(default=\ ``hi=1:db=2:tr=2:se=2:er=91:wa=93:me=95:in=94:mp=1;94:di=94:al=96:sy=95:de=4:cm=92``)
--with-light-background-colors=SGRLIST
Default color set to apply if terminal background color
is defined to ``light``. Expect the same syntax than
described for ``--with-dark-background-colors``.
(default=\ ``hi=1:db=2:tr=2:se=2:er=31:wa=33:me=35:in=34:mp=1;34:di=34:al=36:sy=35:de=4:cm=32``)
--with-terminal-background=VALUE
The terminal background color that determines the color
set to apply by default between the ``dark`` background
colors or the ``light`` background colors
(default=\ ``dark``)
--with-locked-configs=CONFIGLIST
Ignore environment variable superseding value for the
listed configuration options. Accepted option names
in CONFIGLIST are ``extra_siteconfig`` and
``implicit_default`` (each option name should be separated
by whitespace character). (default=no)
--with-unload-match-order=VALUE
When unloading a module if multiple loaded modules match
the request, unload module loaded first
(``returnfirst``) or module loaded last (``returnlast``)
(default=\ ``returnlast``)
--with-search-match=VALUE
When searching for a module with ``avail`` sub-command,
match query string against module name start
(``starts_with``) or any part of module name string
(``contains``). (default=\ ``starts_with``)
--with-icase=VALUE Apply a case insensitive match to module specification
on ``avail``, ``whatis`` and ``paths`` sub-commands
(when set to ``search``) or on all module sub-commands
and modulefile Tcl commands for the module specification
they receive as argument (when set to ``always``). Case
insensitive match is disabled when this option is set to
``never``. (default=\ ``never``)
--with-nearly-forbidden-days=VALUE
Define the number of days a module is considered nearly
forbidden prior reaching its expiry date.
(default=\ ``14``)
--with-modulepath=PATHLIST
Default path list to setup as the default modulepaths.
Each path in this list should be separated by ``:``.
Defined value is registered in the ``modulerc`` or
``.modulespath`` configuration file, depending on the
``--enable-dotmodulespath`` option. These files are
respectively called ``initrc`` and ``modulespath`` if
``--with-initconf-in`` is set to ``etcdir``. The path
list value is read at initialization time to populate
the MODULEPATH environment variable. By default, this
modulepath is composed of the directory set for the
system modulefiles (default=\ ``PREFIX/modulefiles`` or
``BASEPREFIX/$MODULE_VERSION/modulefiles`` if versioning
installation mode enabled)
--with-loadedmodules=MODLIST
Default modulefiles to load at Modules initialization
time. Each modulefile in this list should be separated
by ``:``. Defined value is registered in the
``modulerc`` configuration file or in the ``initrc``
file if ``--with-initconf-in`` is set to ``etcdir``.
(default=no)
--with-quarantine-vars=<VARNAME[=VALUE] ...>
Environment variables to put in quarantine when running
the module command to ensure it a sane execution
environment (each variable should be separated by space
character). A value can eventually be set to a
quarantine variable instead of emptying it. (default=no)
--with-tcl Directory containing the Tcl configuration script
``tclConfig.sh``. Useful to compile Modules
compatibility version or Modules Tcl extension library
if this file cannot be automatically found in default
locations.
--with-tclinclude Directory containing the Tcl header files. Useful to
compile Modules compatibility version or Modules Tcl
extension library if these headers cannot be
automatically found in default locations.
--with-python=BIN Name or full path of Python interpreter command to set
as shebang for helper scripts. (default=\ ``python``)
| {
"pile_set_name": "Github"
} |
// Package dynblock provides an extension to HCL that allows dynamic
// declaration of nested blocks in certain contexts via a special block type
// named "dynamic".
package dynblock
import (
"github.com/hashicorp/hcl/v2"
)
// Expand "dynamic" blocks in the given body, returning a new body that
// has those blocks expanded.
//
// The given EvalContext is used when evaluating "for_each" and "labels"
// attributes within dynamic blocks, allowing those expressions access to
// variables and functions beyond the iterator variable created by the
// iteration.
//
// Expand returns no diagnostics because no blocks are actually expanded
// until a call to Content or PartialContent on the returned body, which
// will then expand only the blocks selected by the schema.
//
// "dynamic" blocks are also expanded automatically within nested blocks
// in the given body, including within other dynamic blocks, thus allowing
// multi-dimensional iteration. However, it is not possible to
// dynamically-generate the "dynamic" blocks themselves except through nesting.
//
// parent {
// dynamic "child" {
// for_each = child_objs
// content {
// dynamic "grandchild" {
// for_each = child.value.children
// labels = [grandchild.key]
// content {
// parent_key = child.key
// value = grandchild.value
// }
// }
// }
// }
// }
func Expand(body hcl.Body, ctx *hcl.EvalContext) hcl.Body {
return &expandBody{
original: body,
forEachCtx: ctx,
}
}
| {
"pile_set_name": "Github"
} |
AF: Afghanistan
AX: 'Åland Islands'
AL: Albania
DZ: Algeria
AS: 'American Samoa'
AD: Andorra
AO: Angola
AI: Anguilla
AQ: Antarctica
AG: 'Antigua & Barbuda'
AR: Argentina
AM: Armenia
AW: Aruba
AU: Australia
AT: Austria
AZ: Azerbaijan
BS: Bahamas
BH: Bahrain
BD: Bangladesh
BB: Barbados
BY: Belarus
BE: Belgium
BZ: Belize
BJ: Benin
BM: Bermuda
BT: Bhutan
BO: Bolivia
BA: 'Bosnia & Herzegovina'
BW: Botswana
BV: 'Bouvet Island'
BR: Brazil
IO: 'British Indian Ocean Territory'
VG: 'British Virgin Islands'
BN: Brunei
BG: Bulgaria
BF: 'Burkina Faso'
BI: Burundi
KH: Cambodia
CM: Cameroon
CA: Canada
CV: 'Cape Verde'
BQ: 'Caribbean Netherlands'
KY: 'Cayman Islands'
CF: 'Central African Republic'
TD: Chad
CL: Chile
CN: China
CX: 'Christmas Island'
CC: 'Cocos (Keeling) Islands'
CO: Colombia
KM: Comoros
CG: 'Congo - Brazzaville'
CD: 'Congo - Kinshasa'
CK: 'Cook Islands'
CR: 'Costa Rica'
CI: 'Côte d’Ivoire'
HR: Croatia
CU: Cuba
CW: Curaçao
CY: Cyprus
CZ: Czechia
DK: Denmark
DJ: Djibouti
DM: Dominica
DO: 'Dominican Republic'
EC: Ecuador
EG: Egypt
SV: 'El Salvador'
GQ: 'Equatorial Guinea'
ER: Eritrea
EE: Estonia
SZ: Eswatini
ET: Ethiopia
FK: 'Falkland Islands'
FO: 'Faroe Islands'
FJ: Fiji
FI: Finland
FR: France
GF: 'French Guiana'
PF: 'French Polynesia'
TF: 'French Southern Territories'
GA: Gabon
GM: Gambia
GE: Georgia
DE: Germany
GH: Ghana
GI: Gibraltar
GR: Greece
GL: Greenland
GD: Grenada
GP: Guadeloupe
GU: Guam
GT: Guatemala
GG: Guernsey
GN: Guinea
GW: Guinea-Bissau
GY: Guyana
HT: Haiti
HM: 'Heard & McDonald Islands'
HN: Honduras
HK: 'Hong Kong SAR China'
HU: Hungary
IS: Iceland
IN: India
ID: Indonesia
IR: Iran
IQ: Iraq
IE: Ireland
IM: 'Isle of Man'
IL: Israel
IT: Italy
JM: Jamaica
JP: Japan
JE: Jersey
JO: Jordan
KZ: Kazakhstan
KE: Kenya
KI: Kiribati
KW: Kuwait
KG: Kyrgyzstan
LA: Laos
LV: Latvia
LB: Lebanon
LS: Lesotho
LR: Liberia
LY: Libya
LI: Liechtenstein
LT: Lithuania
LU: Luxembourg
MO: 'Macao SAR China'
MG: Madagascar
MW: Malawi
MY: Malaysia
MV: Maldives
ML: Mali
MT: Malta
MH: 'Marshall Islands'
MQ: Martinique
MR: Mauritania
MU: Mauritius
YT: Mayotte
MX: Mexico
FM: Micronesia
MD: Moldova
MC: Monaco
MN: Mongolia
ME: Montenegro
MS: Montserrat
MA: Morocco
MZ: Mozambique
MM: 'Myanmar (Burma)'
NA: Namibia
NR: Nauru
NP: Nepal
NL: Netherlands
NC: 'New Caledonia'
NZ: 'New Zealand'
NI: Nicaragua
NE: Niger
NG: Nigeria
NU: Niue
NF: 'Norfolk Island'
KP: 'North Korea'
MK: 'North Macedonia'
MP: 'Northern Mariana Islands'
'NO': Norway
OM: Oman
PK: Pakistan
PW: Palau
PS: 'Palestinian Territories'
PA: Panama
PG: 'Papua New Guinea'
PY: Paraguay
PE: Peru
PH: Philippines
PN: 'Pitcairn Islands'
PL: Poland
PT: Portugal
PR: 'Puerto Rico'
QA: Qatar
RE: Réunion
RO: Romania
RU: Russia
RW: Rwanda
WS: Samoa
SM: 'San Marino'
ST: 'São Tomé & Príncipe'
SA: 'Saudi Arabia'
SN: Senegal
RS: Serbia
SC: Seychelles
SL: 'Sierra Leone'
SG: Singapore
SX: 'Sint Maarten'
SK: Slovakia
SI: Slovenia
SB: 'Solomon Islands'
SO: Somalia
ZA: 'South Africa'
GS: 'South Georgia & South Sandwich Islands'
KR: 'South Korea'
SS: 'South Sudan'
ES: Spain
LK: 'Sri Lanka'
BL: 'St. Barthélemy'
SH: 'St. Helena'
KN: 'St. Kitts & Nevis'
LC: 'St. Lucia'
MF: 'St. Martin'
PM: 'St. Pierre & Miquelon'
VC: 'St. Vincent & Grenadines'
SD: Sudan
SR: Suriname
SJ: 'Svalbard & Jan Mayen'
SE: Sweden
CH: Switzerland
SY: Syria
TW: Taiwan
TJ: Tajikistan
TZ: Tanzania
TH: Thailand
TL: Timor-Leste
TG: Togo
TK: Tokelau
TO: Tonga
TT: 'Trinidad & Tobago'
TN: Tunisia
TR: Turkey
TM: Turkmenistan
TC: 'Turks & Caicos Islands'
TV: Tuvalu
UM: 'U.S. Outlying Islands'
VI: 'U.S. Virgin Islands'
UG: Uganda
UA: Ukraine
AE: 'United Arab Emirates'
GB: 'United Kingdom'
US: 'United States'
UY: Uruguay
UZ: Uzbekistan
VU: Vanuatu
VA: 'Vatican City'
VE: Venezuela
VN: Vietnam
WF: 'Wallis & Futuna'
EH: 'Western Sahara'
YE: Yemen
ZM: Zambia
ZW: Zimbabwe
| {
"pile_set_name": "Github"
} |
##### Atividade
# Cibersegurança
Atividade de Inquérito
### Objetivos de Aprendizado:
- [LO 6.3.1] Identificar as preocupações com segurança cibernética existentes e as possíveis opções para abordar esses problemas com a Internet e os sistemas construídos sobre ela. [P1]
- [LO 7.1.2] Explique como as pessoas participam de um processo de solução de problemas que aumenta. [P4]
## Preparação
Antes da aula, encontre um pequeno artigo ou vídeo descrevendo um ataque cibernético que tenha aparecido nas notícias recentemente ou use um destes:
- Interferência eleitoral de 2016: https://www.cbsnews.com/news/dhs-official-election-systems-in-21-states-were-targeted-in-russia-cyber-attacks/
- Ataque cibernético da HBO: http://www.newsweek.com/hbo-cyberattack-sony-hack-leak-game-thrones-645450
- Ataque global de ransomware:
https://www.nytimes.com/2017/06/27/technology/global-ransomware-hack-what-we-know-and-dont-know.html?mcubz=0
## Discuta Ataques Cibernéticos
Discuta o ataque cibernético. Pergunte aos alunos se eles já ouviram falar do ataque cibernético. Deixe que eles compartilhem o que já sabem e guiem a discussão em sala de aula:
- Como descobrimos esse ataque?
- Qual o impacto desse ataque?
- Como podemos nos defender contra esse tipo de ataque?
## Golpes de Phishing
Mostre aos alunos uma imagem de um e-mail de phishing (um e-mail de spam que solicita que você faça login com seu e-mail e senha).
<img alt="phishing scam" src="/images/pages/teachers/resources/markdown/phishing-scam.jpg" id="phishing-scam" />
Pergunte aos alunos o que eles fariam se recebessem este e-mail. Saliente que, embora o e-mail possa parecer legítimo, é, na verdade, um exemplo de phishing. O phishing é uma forma de ataques cibernéticos nos quais emails aparentemente legítimos são usados para coletar informações pessoais de destinatários desavisados.
Agora pergunte aos alunos se eles podem descobrir como você foi capaz de dizer que era ilegítimo. A razão é porque o site é http em vez de https. O Protocolo de Transferência de Hipertexto (HTTP) e o Protocolo de Transferência de Hipertexto Seguro (HTTPS) são dois protocolos usados para transferir informações entre dispositivos na Internet. A diferença entre os dois está na última letra, S. O S significa seguro, referindo-se à criptografia usada para transferir informações no site. Secure Socket Layer (SSL) é a tecnologia padrão usada para criptografar os dados entre navegadores e servidores na Internet. Usa criptografia simétrica e assimétrica. A criptografia simétrica é quando você usa uma chave para criptografar e descriptografar. Assimétrica é quando você usa uma chave para criptografar (uma chave pública) e outra para descriptografar (uma chave privada). Quando seu navegador acessa um site por meio de HTTPS, ele cria uma mensagem com a chave pública do site, que somente o site pode descriptografar com sua chave privada. Essa mensagem que o navegador envia inclui informações para gerar uma chave simétrica secreta que as duas máquinas podem usar para passar informações de maneira particular para frente e para trás. Esse processo é chamado de aperto de mão. Para maior segurança, o seu navegador só iniciará este aperto de mão se o site tiver um certificado emitido por uma autoridade de certificação confiável. Você pode usar seu navegador para procurar informações de certificado para qualquer site que seja servido por HTTPS. Quando seu navegador avisa que um site não é seguro, geralmente significa que ele possui um certificado inválido ou expirado.
Muitos invasores de phishing criam sites falsos que imitam o nome da empresa, mas são sites http e não https. Como os alunos já viram, criar um site não é muito difícil. Os invasores podem copiar imagens do website da empresa e criar algo que pareça quase idêntico. Eles então podem acessar as informações não criptografadas enviadas pelo usuário.
## Distributed Denial of Service Attacks
Uma Negação de Serviço Distribuída (DDoS) é um ataque cibernético no qual vários dispositivos atacam um serviço online, sobrecarregando-o a ponto de não poder mais funcionar. Esse tipo de ataque é frequentemente usado por grupos que desejam derrubar sites como uma forma de protesto.
Compartilhe o seguinte artigo com os alunos,
https://www.wired.com/story/reaper-iot-botnet-infected-million-networks/. Faça uma discussão de classe sobre o artigo e observe que a aceitação desses tipos de ataques está em debate. Também não deixe de discutir o impacto de ter várias pessoas participando do ataque.
## Reflexão
Finalmente, dê aos alunos essa tarefa para começar na aula e terminar para o dever de casa. Eles devem investigar um ataque cibernético por conta própria e escrever sobre isso. Lembre-os de que eles escolhem sites confiáveis como fontes. Peça-lhes que escrevam uma resposta de uma página para as seguintes perguntas:
- Que tipo de ataque é esse?
- Como foi descoberto?
- Quem estava alvejando?
- Qual foi o dano?
- Como pode ser defendido?
### Questões de Avaliações:
- Quais são alguns dos efeitos da guerra cibernética e do cibercrime? [EK 6.3.1C]
- O que é DDoS? [EK 6.3.1D]
- O que é criptografia de chave pública? [EK 6.3.1L]
| {
"pile_set_name": "Github"
} |
;- CONFOUNDED
;- VERSION 2.0
0x25170948
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
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: a52a050b94d6d8645a4fd8c551674741
folderAsset: yes
timeCreated: 1470190843
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
// RUN: %clang -### -x objective-c -target i386-apple-darwin10 -arch i386 -mios-simulator-version-min=4.2.1 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s
// RUN: %clang -### -x objective-c -target i386-apple-darwin10 -arch i386 -mios-simulator-version-min=5.0.0 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s
//
// CHECK-OPTIONS1: i386-apple-ios4.2.1
// CHECK-OPTIONS1: -fobjc-runtime=ios-4.2.1
// CHECK-OPTIONS2: i386-apple-ios5.0.0
// CHECK-OPTIONS2: -fobjc-runtime=ios-5.0.0
// RUN: %clang -### -x objective-c -target x86_64-apple-darwin -mtvos-simulator-version-min=8.3.0 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS3 %s
// CHECK-OPTIONS3: x86_64-apple-tvos8.3.0
// CHECK-OPTIONS3: -fobjc-runtime=ios-8.3.0
// RUN: %clang -### -x objective-c -target x86_64-apple-darwin -mwatchos-simulator-version-min=2.0.0 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS4 %s
// CHECK-OPTIONS4: x86_64-apple-watchos2.0.0
// CHECK-OPTIONS4: -fobjc-runtime=watchos-2.0.0
| {
"pile_set_name": "Github"
} |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#nullable disable
using System.Drawing;
using System.Windows.Forms.VisualStyles;
namespace System.Windows.Forms
{
public partial class DataGridViewButtonCell
{
private class DataGridViewButtonCellRenderer
{
private static VisualStyleRenderer visualStyleRenderer;
private DataGridViewButtonCellRenderer()
{
}
public static VisualStyleRenderer DataGridViewButtonRenderer
{
get
{
if (visualStyleRenderer is null)
{
visualStyleRenderer = new VisualStyleRenderer(ButtonElement);
}
return visualStyleRenderer;
}
}
public static void DrawButton(Graphics g, Rectangle bounds, int buttonState)
{
DataGridViewButtonRenderer.SetParameters(ButtonElement.ClassName, ButtonElement.Part, buttonState);
DataGridViewButtonRenderer.DrawBackground(g, bounds, Rectangle.Truncate(g.ClipBounds));
}
}
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --dynamic-map-checks --allow-natives-syntax --opt --no-always-opt
function f(v) {
return v.b;
}
var v = { a: 10, b: 10.23 };
%PrepareFunctionForOptimization(f);
f(v);
%OptimizeFunctionOnNextCall(f);
f(v);
assertOptimized(f);
v.b = {x: 20};
assertEquals(f(v).x, 20);
// Must deoptimize because of field-rep changes for field 'b'
assertUnoptimized(f);
function f0(v) {
return v.b;
}
var v0 = { b: 10.23 };
%PrepareFunctionForOptimization(f0);
f0(v0);
// Transition the field to an Smi field.
v0.b = {};
v0.b = 0;
%OptimizeFunctionOnNextCall(f0);
f0(v0);
assertEquals(f0(v0), 0);
| {
"pile_set_name": "Github"
} |
/*!
*
* Angle - Bootstrap Admin Template
*
* Version: 4.7.1
* Author: @themicon_co
* Website: http://themicon.co
* License: https://wrapbootstrap.com/help/licenses
*
*/
// Bootstrap
@import "bootstrap/functions";
@import "bootstrap/variables";
@import "bootstrap/mixins";
// Variables
@import "app/variables";
// Layout
@import "app/layout";
@import "app/layout-extra";
@import "app/layout-animation";
@import "app/top-navbar";
@import "app/sidebar";
@import "app/offsidebar";
@import "app/user-block";
@import "app/settings";
// Common
@import "app/typo";
@import "app/bootstrap-reset";
@import "app/bootstrap-custom";
@import "app/button-extra";
@import "app/placeholder";
@import "app/cards";
@import "app/circles";
@import "app/dropdown-extra";
@import "app/half-float";
@import "app/animate";
@import "app/slim-scroll";
@import "app/inputs";
@import "app/utils";
@import "app/print";
// Elements
// @import "app/spinner";
// Charts
// @import "app/radial-bar";
// @import "app/chart-flot";
// @import "app/chart-easypie";
// Form elements
// @import "app/form-select2";
// @import "app/form-tags-input";
// @import "app/file-upload";
// @import "app/summernote";
// @import "app/typeahead";
// Tables
// @import "app/table-extras";
// @import "app/table-angulargrid";
// Maps
// @import "app/gmap";
// @import "app/vector-map";
// Extras
// @import "app/timeline";
// @import "app/todo";
// @import "app/calendar";
// @import "app/mailbox";
// @import "app/plans";
| {
"pile_set_name": "Github"
} |
// dear imgui: Renderer for OpenGL3 / OpenGL ES2 / OpenGL ES3 (modern OpenGL with shaders / programmatic pipeline)
// This needs to be used along with a Platform Binding (e.g. GLFW, SDL, Win32, custom..)
// (Note: We are using GL3W as a helper library to access OpenGL functions since there is no standard header to access modern OpenGL functions easily. Alternatives are GLEW, Glad, etc..)
// Implemented features:
// [X] Renderer: User texture binding. Use 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID in imgui.cpp.
// You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this.
// If you are new to dear imgui, read examples/README.txt and read the documentation at the top of imgui.cpp.
// https://github.com/ocornut/imgui
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2018-11-30: Misc: Setting up io.BackendRendererName so it can be displayed in the About Window.
// 2018-11-13: OpenGL: Support for GL 4.5's glClipControl(GL_UPPER_LEFT).
// 2018-08-29: OpenGL: Added support for more OpenGL loaders: glew and glad, with comments indicative that any loader can be used.
// 2018-08-09: OpenGL: Default to OpenGL ES 3 on iOS and Android. GLSL version default to "#version 300 ES".
// 2018-07-30: OpenGL: Support for GLSL 300 ES and 410 core. Fixes for Emscripten compilation.
// 2018-07-10: OpenGL: Support for more GLSL versions (based on the GLSL version string). Added error output when shaders fail to compile/link.
// 2018-06-08: Misc: Extracted imgui_impl_opengl3.cpp/.h away from the old combined GLFW/SDL+OpenGL3 examples.
// 2018-06-08: OpenGL: Use draw_data->DisplayPos and draw_data->DisplaySize to setup projection matrix and clipping rectangle.
// 2018-05-25: OpenGL: Removed unnecessary backup/restore of GL_ELEMENT_ARRAY_BUFFER_BINDING since this is part of the VAO state.
// 2018-05-14: OpenGL: Making the call to glBindSampler() optional so 3.2 context won't fail if the function is a NULL pointer.
// 2018-03-06: OpenGL: Added const char* glsl_version parameter to ImGui_ImplOpenGL3_Init() so user can override the GLSL version e.g. "#version 150".
// 2018-02-23: OpenGL: Create the VAO in the render function so the setup can more easily be used with multiple shared GL context.
// 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_ImplSdlGL3_RenderDrawData() in the .h file so you can call it yourself.
// 2018-01-07: OpenGL: Changed GLSL shader version from 330 to 150.
// 2017-09-01: OpenGL: Save and restore current bound sampler. Save and restore current polygon mode.
// 2017-05-01: OpenGL: Fixed save and restore of current blend func state.
// 2017-05-01: OpenGL: Fixed save and restore of current GL_ACTIVE_TEXTURE.
// 2016-09-05: OpenGL: Fixed save and restore of current scissor rectangle.
// 2016-07-29: OpenGL: Explicitly setting GL_UNPACK_ROW_LENGTH to reduce issues because SDL changes it. (#752)
//----------------------------------------
// OpenGL GLSL GLSL
// version version string
//----------------------------------------
// 2.0 110 "#version 110"
// 2.1 120
// 3.0 130
// 3.1 140
// 3.2 150 "#version 150"
// 3.3 330
// 4.0 400
// 4.1 410 "#version 410 core"
// 4.2 420
// 4.3 430
// ES 2.0 100 "#version 100"
// ES 3.0 300 "#version 300 es"
//----------------------------------------
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "imgui.h"
#include "imgui_impl_opengl3.h"
#include <stdio.h>
#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
#include <stddef.h> // intptr_t
#else
#include <stdint.h> // intptr_t
#endif
#if defined(__APPLE__)
#include "TargetConditionals.h"
#endif
// iOS, Android and Emscripten can use GL ES 3
// Call ImGui_ImplOpenGL3_Init() with "#version 300 es"
#if (defined(__APPLE__) && TARGET_OS_IOS) || (defined(__ANDROID__)) || (defined(__EMSCRIPTEN__))
#define USE_GL_ES3
#endif
#ifdef USE_GL_ES3
// OpenGL ES 3
#include <GLES3/gl3.h> // Use GL ES 3
#else
// Regular OpenGL
// About OpenGL function loaders: modern OpenGL doesn't have a standard header file and requires individual function pointers to be loaded manually.
// Helper libraries are often used for this purpose! Here we are supporting a few common ones: gl3w, glew, glad.
// You may use another loader/header of your choice (glext, glLoadGen, etc.), or chose to manually implement your own.
#if defined(IMGUI_IMPL_OPENGL_LOADER_GL3W)
#include <GL/gl3w.h>
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLEW)
#include <GL/glew.h>
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLAD)
#include <glad/glad.h>
#else
#include IMGUI_IMPL_OPENGL_LOADER_CUSTOM
#endif
#endif
// OpenGL Data
static char g_GlslVersionString[32] = "";
static GLuint g_FontTexture = 0;
static GLuint g_ShaderHandle = 0, g_VertHandle = 0, g_FragHandle = 0;
static int g_AttribLocationTex = 0, g_AttribLocationProjMtx = 0;
static int g_AttribLocationPosition = 0, g_AttribLocationUV = 0, g_AttribLocationColor = 0;
static unsigned int g_VboHandle = 0, g_ElementsHandle = 0;
// Functions
bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
{
ImGuiIO& io = ImGui::GetIO();
io.BackendRendererName = "imgui_impl_opengl3";
// Store GLSL version string so we can refer to it later in case we recreate shaders. Note: GLSL version is NOT the same as GL version. Leave this to NULL if unsure.
#ifdef USE_GL_ES3
if (glsl_version == NULL)
glsl_version = "#version 300 es";
#else
if (glsl_version == NULL)
glsl_version = "#version 130";
#endif
IM_ASSERT((int)strlen(glsl_version) + 2 < IM_ARRAYSIZE(g_GlslVersionString));
strcpy(g_GlslVersionString, glsl_version);
strcat(g_GlslVersionString, "\n");
return true;
}
void ImGui_ImplOpenGL3_Shutdown()
{
ImGui_ImplOpenGL3_DestroyDeviceObjects();
}
void ImGui_ImplOpenGL3_NewFrame()
{
if (!g_FontTexture)
ImGui_ImplOpenGL3_CreateDeviceObjects();
}
// OpenGL3 Render function.
// (this used to be set in io.RenderDrawListsFn and called by ImGui::Render(), but you can now call this directly from your main loop)
// Note that this implementation is little overcomplicated because we are saving/setting up/restoring every OpenGL state explicitly, in order to be able to run within any OpenGL engine that doesn't do so.
void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
{
// Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates)
ImGuiIO& io = ImGui::GetIO();
int fb_width = (int)(draw_data->DisplaySize.x * io.DisplayFramebufferScale.x);
int fb_height = (int)(draw_data->DisplaySize.y * io.DisplayFramebufferScale.y);
if (fb_width <= 0 || fb_height <= 0)
return;
draw_data->ScaleClipRects(io.DisplayFramebufferScale);
// Backup GL state
GLenum last_active_texture; glGetIntegerv(GL_ACTIVE_TEXTURE, (GLint*)&last_active_texture);
glActiveTexture(GL_TEXTURE0);
GLint last_program; glGetIntegerv(GL_CURRENT_PROGRAM, &last_program);
GLint last_texture; glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture);
#ifdef GL_SAMPLER_BINDING
GLint last_sampler; glGetIntegerv(GL_SAMPLER_BINDING, &last_sampler);
#endif
GLint last_array_buffer; glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &last_array_buffer);
GLint last_vertex_array; glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &last_vertex_array);
#ifdef GL_POLYGON_MODE
GLint last_polygon_mode[2]; glGetIntegerv(GL_POLYGON_MODE, last_polygon_mode);
#endif
GLint last_viewport[4]; glGetIntegerv(GL_VIEWPORT, last_viewport);
GLint last_scissor_box[4]; glGetIntegerv(GL_SCISSOR_BOX, last_scissor_box);
GLenum last_blend_src_rgb; glGetIntegerv(GL_BLEND_SRC_RGB, (GLint*)&last_blend_src_rgb);
GLenum last_blend_dst_rgb; glGetIntegerv(GL_BLEND_DST_RGB, (GLint*)&last_blend_dst_rgb);
GLenum last_blend_src_alpha; glGetIntegerv(GL_BLEND_SRC_ALPHA, (GLint*)&last_blend_src_alpha);
GLenum last_blend_dst_alpha; glGetIntegerv(GL_BLEND_DST_ALPHA, (GLint*)&last_blend_dst_alpha);
GLenum last_blend_equation_rgb; glGetIntegerv(GL_BLEND_EQUATION_RGB, (GLint*)&last_blend_equation_rgb);
GLenum last_blend_equation_alpha; glGetIntegerv(GL_BLEND_EQUATION_ALPHA, (GLint*)&last_blend_equation_alpha);
GLboolean last_enable_blend = glIsEnabled(GL_BLEND);
GLboolean last_enable_cull_face = glIsEnabled(GL_CULL_FACE);
GLboolean last_enable_depth_test = glIsEnabled(GL_DEPTH_TEST);
GLboolean last_enable_scissor_test = glIsEnabled(GL_SCISSOR_TEST);
bool clip_origin_lower_left = true;
#ifdef GL_CLIP_ORIGIN
GLenum last_clip_origin = 0; glGetIntegerv(GL_CLIP_ORIGIN, (GLint*)&last_clip_origin); // Support for GL 4.5's glClipControl(GL_UPPER_LEFT)
if (last_clip_origin == GL_UPPER_LEFT)
clip_origin_lower_left = false;
#endif
// Setup render state: alpha-blending enabled, no face culling, no depth testing, scissor enabled, polygon fill
glEnable(GL_BLEND);
glBlendEquation(GL_FUNC_ADD);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable(GL_CULL_FACE);
glDisable(GL_DEPTH_TEST);
glEnable(GL_SCISSOR_TEST);
#ifdef GL_POLYGON_MODE
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
#endif
// Setup viewport, orthographic projection matrix
// Our visible imgui space lies from draw_data->DisplayPos (top left) to draw_data->DisplayPos+data_data->DisplaySize (bottom right). DisplayMin is typically (0,0) for single viewport apps.
glViewport(0, 0, (GLsizei)fb_width, (GLsizei)fb_height);
float L = draw_data->DisplayPos.x;
float R = draw_data->DisplayPos.x + draw_data->DisplaySize.x;
float T = draw_data->DisplayPos.y;
float B = draw_data->DisplayPos.y + draw_data->DisplaySize.y;
const float ortho_projection[4][4] =
{
{ 2.0f/(R-L), 0.0f, 0.0f, 0.0f },
{ 0.0f, 2.0f/(T-B), 0.0f, 0.0f },
{ 0.0f, 0.0f, -1.0f, 0.0f },
{ (R+L)/(L-R), (T+B)/(B-T), 0.0f, 1.0f },
};
glUseProgram(g_ShaderHandle);
glUniform1i(g_AttribLocationTex, 0);
glUniformMatrix4fv(g_AttribLocationProjMtx, 1, GL_FALSE, &ortho_projection[0][0]);
#ifdef GL_SAMPLER_BINDING
glBindSampler(0, 0); // We use combined texture/sampler state. Applications using GL 3.3 may set that otherwise.
#endif
// Recreate the VAO every time
// (This is to easily allow multiple GL contexts. VAO are not shared among GL contexts, and we don't track creation/deletion of windows so we don't have an obvious key to use to cache them.)
GLuint vao_handle = 0;
glGenVertexArrays(1, &vao_handle);
glBindVertexArray(vao_handle);
glBindBuffer(GL_ARRAY_BUFFER, g_VboHandle);
glEnableVertexAttribArray(g_AttribLocationPosition);
glEnableVertexAttribArray(g_AttribLocationUV);
glEnableVertexAttribArray(g_AttribLocationColor);
glVertexAttribPointer(g_AttribLocationPosition, 2, GL_FLOAT, GL_FALSE, sizeof(ImDrawVert), (GLvoid*)IM_OFFSETOF(ImDrawVert, pos));
glVertexAttribPointer(g_AttribLocationUV, 2, GL_FLOAT, GL_FALSE, sizeof(ImDrawVert), (GLvoid*)IM_OFFSETOF(ImDrawVert, uv));
glVertexAttribPointer(g_AttribLocationColor, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(ImDrawVert), (GLvoid*)IM_OFFSETOF(ImDrawVert, col));
// Draw
ImVec2 pos = draw_data->DisplayPos;
for (int n = 0; n < draw_data->CmdListsCount; n++)
{
const ImDrawList* cmd_list = draw_data->CmdLists[n];
const ImDrawIdx* idx_buffer_offset = 0;
glBindBuffer(GL_ARRAY_BUFFER, g_VboHandle);
glBufferData(GL_ARRAY_BUFFER, (GLsizeiptr)cmd_list->VtxBuffer.Size * sizeof(ImDrawVert), (const GLvoid*)cmd_list->VtxBuffer.Data, GL_STREAM_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, g_ElementsHandle);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, (GLsizeiptr)cmd_list->IdxBuffer.Size * sizeof(ImDrawIdx), (const GLvoid*)cmd_list->IdxBuffer.Data, GL_STREAM_DRAW);
for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++)
{
const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i];
if (pcmd->UserCallback)
{
// User callback (registered via ImDrawList::AddCallback)
pcmd->UserCallback(cmd_list, pcmd);
}
else
{
ImVec4 clip_rect = ImVec4(pcmd->ClipRect.x - pos.x, pcmd->ClipRect.y - pos.y, pcmd->ClipRect.z - pos.x, pcmd->ClipRect.w - pos.y);
if (clip_rect.x < fb_width && clip_rect.y < fb_height && clip_rect.z >= 0.0f && clip_rect.w >= 0.0f)
{
// Apply scissor/clipping rectangle
if (clip_origin_lower_left)
glScissor((int)clip_rect.x, (int)(fb_height - clip_rect.w), (int)(clip_rect.z - clip_rect.x), (int)(clip_rect.w - clip_rect.y));
else
glScissor((int)clip_rect.x, (int)clip_rect.y, (int)clip_rect.z, (int)clip_rect.w); // Support for GL 4.5's glClipControl(GL_UPPER_LEFT)
// Bind texture, Draw
glBindTexture(GL_TEXTURE_2D, (GLuint)(intptr_t)pcmd->TextureId);
glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer_offset);
}
}
idx_buffer_offset += pcmd->ElemCount;
}
}
glDeleteVertexArrays(1, &vao_handle);
// Restore modified GL state
glUseProgram(last_program);
glBindTexture(GL_TEXTURE_2D, last_texture);
#ifdef GL_SAMPLER_BINDING
glBindSampler(0, last_sampler);
#endif
glActiveTexture(last_active_texture);
glBindVertexArray(last_vertex_array);
glBindBuffer(GL_ARRAY_BUFFER, last_array_buffer);
glBlendEquationSeparate(last_blend_equation_rgb, last_blend_equation_alpha);
glBlendFuncSeparate(last_blend_src_rgb, last_blend_dst_rgb, last_blend_src_alpha, last_blend_dst_alpha);
if (last_enable_blend) glEnable(GL_BLEND); else glDisable(GL_BLEND);
if (last_enable_cull_face) glEnable(GL_CULL_FACE); else glDisable(GL_CULL_FACE);
if (last_enable_depth_test) glEnable(GL_DEPTH_TEST); else glDisable(GL_DEPTH_TEST);
if (last_enable_scissor_test) glEnable(GL_SCISSOR_TEST); else glDisable(GL_SCISSOR_TEST);
#ifdef GL_POLYGON_MODE
glPolygonMode(GL_FRONT_AND_BACK, (GLenum)last_polygon_mode[0]);
#endif
glViewport(last_viewport[0], last_viewport[1], (GLsizei)last_viewport[2], (GLsizei)last_viewport[3]);
glScissor(last_scissor_box[0], last_scissor_box[1], (GLsizei)last_scissor_box[2], (GLsizei)last_scissor_box[3]);
}
bool ImGui_ImplOpenGL3_CreateFontsTexture()
{
// Build texture atlas
ImGuiIO& io = ImGui::GetIO();
unsigned char* pixels;
int width, height;
io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); // Load as RGBA 32-bits (75% of the memory is wasted, but default font is so small) because it is more likely to be compatible with user's existing shaders. If your ImTextureId represent a higher-level concept than just a GL texture id, consider calling GetTexDataAsAlpha8() instead to save on GPU memory.
// Upload texture to graphics system
GLint last_texture;
glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture);
glGenTextures(1, &g_FontTexture);
glBindTexture(GL_TEXTURE_2D, g_FontTexture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
// Store our identifier
io.Fonts->TexID = (ImTextureID)(intptr_t)g_FontTexture;
// Restore state
glBindTexture(GL_TEXTURE_2D, last_texture);
return true;
}
void ImGui_ImplOpenGL3_DestroyFontsTexture()
{
if (g_FontTexture)
{
ImGuiIO& io = ImGui::GetIO();
glDeleteTextures(1, &g_FontTexture);
io.Fonts->TexID = 0;
g_FontTexture = 0;
}
}
// If you get an error please report on github. You may try different GL context version or GLSL version. See GL<>GLSL version table at the top of this file.
static bool CheckShader(GLuint handle, const char* desc)
{
GLint status = 0, log_length = 0;
glGetShaderiv(handle, GL_COMPILE_STATUS, &status);
glGetShaderiv(handle, GL_INFO_LOG_LENGTH, &log_length);
if ((GLboolean)status == GL_FALSE)
fprintf(stderr, "ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to compile %s!\n", desc);
if (log_length > 0)
{
ImVector<char> buf;
buf.resize((int)(log_length + 1));
glGetShaderInfoLog(handle, log_length, NULL, (GLchar*)buf.begin());
fprintf(stderr, "%s\n", buf.begin());
}
return (GLboolean)status == GL_TRUE;
}
// If you get an error please report on GitHub. You may try different GL context version or GLSL version.
static bool CheckProgram(GLuint handle, const char* desc)
{
GLint status = 0, log_length = 0;
glGetProgramiv(handle, GL_LINK_STATUS, &status);
glGetProgramiv(handle, GL_INFO_LOG_LENGTH, &log_length);
if ((GLboolean)status == GL_FALSE)
fprintf(stderr, "ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to link %s! (with GLSL '%s')\n", desc, g_GlslVersionString);
if (log_length > 0)
{
ImVector<char> buf;
buf.resize((int)(log_length + 1));
glGetProgramInfoLog(handle, log_length, NULL, (GLchar*)buf.begin());
fprintf(stderr, "%s\n", buf.begin());
}
return (GLboolean)status == GL_TRUE;
}
bool ImGui_ImplOpenGL3_CreateDeviceObjects()
{
// Backup GL state
GLint last_texture, last_array_buffer, last_vertex_array;
glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture);
glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &last_array_buffer);
glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &last_vertex_array);
// Parse GLSL version string
int glsl_version = 130;
sscanf(g_GlslVersionString, "#version %d", &glsl_version);
const GLchar* vertex_shader_glsl_120 =
"uniform mat4 ProjMtx;\n"
"attribute vec2 Position;\n"
"attribute vec2 UV;\n"
"attribute vec4 Color;\n"
"varying vec2 Frag_UV;\n"
"varying vec4 Frag_Color;\n"
"void main()\n"
"{\n"
" Frag_UV = UV;\n"
" Frag_Color = Color;\n"
" gl_Position = ProjMtx * vec4(Position.xy,0,1);\n"
"}\n";
const GLchar* vertex_shader_glsl_130 =
"uniform mat4 ProjMtx;\n"
"in vec2 Position;\n"
"in vec2 UV;\n"
"in vec4 Color;\n"
"out vec2 Frag_UV;\n"
"out vec4 Frag_Color;\n"
"void main()\n"
"{\n"
" Frag_UV = UV;\n"
" Frag_Color = Color;\n"
" gl_Position = ProjMtx * vec4(Position.xy,0,1);\n"
"}\n";
const GLchar* vertex_shader_glsl_300_es =
"precision mediump float;\n"
"layout (location = 0) in vec2 Position;\n"
"layout (location = 1) in vec2 UV;\n"
"layout (location = 2) in vec4 Color;\n"
"uniform mat4 ProjMtx;\n"
"out vec2 Frag_UV;\n"
"out vec4 Frag_Color;\n"
"void main()\n"
"{\n"
" Frag_UV = UV;\n"
" Frag_Color = Color;\n"
" gl_Position = ProjMtx * vec4(Position.xy,0,1);\n"
"}\n";
const GLchar* vertex_shader_glsl_410_core =
"layout (location = 0) in vec2 Position;\n"
"layout (location = 1) in vec2 UV;\n"
"layout (location = 2) in vec4 Color;\n"
"uniform mat4 ProjMtx;\n"
"out vec2 Frag_UV;\n"
"out vec4 Frag_Color;\n"
"void main()\n"
"{\n"
" Frag_UV = UV;\n"
" Frag_Color = Color;\n"
" gl_Position = ProjMtx * vec4(Position.xy,0,1);\n"
"}\n";
const GLchar* fragment_shader_glsl_120 =
"#ifdef GL_ES\n"
" precision mediump float;\n"
"#endif\n"
"uniform sampler2D Texture;\n"
"varying vec2 Frag_UV;\n"
"varying vec4 Frag_Color;\n"
"void main()\n"
"{\n"
" gl_FragColor = Frag_Color * texture2D(Texture, Frag_UV.st);\n"
"}\n";
const GLchar* fragment_shader_glsl_130 =
"uniform sampler2D Texture;\n"
"in vec2 Frag_UV;\n"
"in vec4 Frag_Color;\n"
"out vec4 Out_Color;\n"
"void main()\n"
"{\n"
" Out_Color = Frag_Color * texture(Texture, Frag_UV.st);\n"
"}\n";
const GLchar* fragment_shader_glsl_300_es =
"precision mediump float;\n"
"uniform sampler2D Texture;\n"
"in vec2 Frag_UV;\n"
"in vec4 Frag_Color;\n"
"layout (location = 0) out vec4 Out_Color;\n"
"void main()\n"
"{\n"
" Out_Color = Frag_Color * texture(Texture, Frag_UV.st);\n"
"}\n";
const GLchar* fragment_shader_glsl_410_core =
"in vec2 Frag_UV;\n"
"in vec4 Frag_Color;\n"
"uniform sampler2D Texture;\n"
"layout (location = 0) out vec4 Out_Color;\n"
"void main()\n"
"{\n"
" Out_Color = Frag_Color * texture(Texture, Frag_UV.st);\n"
"}\n";
// Select shaders matching our GLSL versions
const GLchar* vertex_shader = NULL;
const GLchar* fragment_shader = NULL;
if (glsl_version < 130)
{
vertex_shader = vertex_shader_glsl_120;
fragment_shader = fragment_shader_glsl_120;
}
else if (glsl_version == 410)
{
vertex_shader = vertex_shader_glsl_410_core;
fragment_shader = fragment_shader_glsl_410_core;
}
else if (glsl_version == 300)
{
vertex_shader = vertex_shader_glsl_300_es;
fragment_shader = fragment_shader_glsl_300_es;
}
else
{
vertex_shader = vertex_shader_glsl_130;
fragment_shader = fragment_shader_glsl_130;
}
// Create shaders
const GLchar* vertex_shader_with_version[2] = { g_GlslVersionString, vertex_shader };
g_VertHandle = glCreateShader(GL_VERTEX_SHADER);
glShaderSource(g_VertHandle, 2, vertex_shader_with_version, NULL);
glCompileShader(g_VertHandle);
CheckShader(g_VertHandle, "vertex shader");
const GLchar* fragment_shader_with_version[2] = { g_GlslVersionString, fragment_shader };
g_FragHandle = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource(g_FragHandle, 2, fragment_shader_with_version, NULL);
glCompileShader(g_FragHandle);
CheckShader(g_FragHandle, "fragment shader");
g_ShaderHandle = glCreateProgram();
glAttachShader(g_ShaderHandle, g_VertHandle);
glAttachShader(g_ShaderHandle, g_FragHandle);
glLinkProgram(g_ShaderHandle);
CheckProgram(g_ShaderHandle, "shader program");
g_AttribLocationTex = glGetUniformLocation(g_ShaderHandle, "Texture");
g_AttribLocationProjMtx = glGetUniformLocation(g_ShaderHandle, "ProjMtx");
g_AttribLocationPosition = glGetAttribLocation(g_ShaderHandle, "Position");
g_AttribLocationUV = glGetAttribLocation(g_ShaderHandle, "UV");
g_AttribLocationColor = glGetAttribLocation(g_ShaderHandle, "Color");
// Create buffers
glGenBuffers(1, &g_VboHandle);
glGenBuffers(1, &g_ElementsHandle);
ImGui_ImplOpenGL3_CreateFontsTexture();
// Restore modified GL state
glBindTexture(GL_TEXTURE_2D, last_texture);
glBindBuffer(GL_ARRAY_BUFFER, last_array_buffer);
glBindVertexArray(last_vertex_array);
return true;
}
void ImGui_ImplOpenGL3_DestroyDeviceObjects()
{
if (g_VboHandle) glDeleteBuffers(1, &g_VboHandle);
if (g_ElementsHandle) glDeleteBuffers(1, &g_ElementsHandle);
g_VboHandle = g_ElementsHandle = 0;
if (g_ShaderHandle && g_VertHandle) glDetachShader(g_ShaderHandle, g_VertHandle);
if (g_VertHandle) glDeleteShader(g_VertHandle);
g_VertHandle = 0;
if (g_ShaderHandle && g_FragHandle) glDetachShader(g_ShaderHandle, g_FragHandle);
if (g_FragHandle) glDeleteShader(g_FragHandle);
g_FragHandle = 0;
if (g_ShaderHandle) glDeleteProgram(g_ShaderHandle);
g_ShaderHandle = 0;
ImGui_ImplOpenGL3_DestroyFontsTexture();
}
| {
"pile_set_name": "Github"
} |
enable_language(CXX)
add_library(main INTERFACE)
target_compile_features(main PRIVATE cxx_delegating_constructors)
| {
"pile_set_name": "Github"
} |
//! This module contains some useful macros to simply
//! create supervisors and children groups.
/// This macro creates a new children group with the given amount of worker
/// callbacks, and a closure that will be executed when a message is received.
///
/// # Example
///
/// ```
/// # use bastion::prelude::*;
/// # fn main() {
/// let children = children! {
/// // the default redundancy is 1
/// redundancy: 100,
/// action: |msg| {
/// // do something with the message here
/// },
/// };
///
/// let sp = supervisor! {};
/// let children = children! {
/// supervisor: sp,
/// redundancy: 10,
/// action: |msg| {
/// // do something with the message here
/// },
/// };
/// # }
/// ```
#[macro_export]
macro_rules! children {
($($keys:ident: $vals:expr,)*) => {
children!(@sort,
1,
$crate::Callbacks::default(),
|_| {},
,
$($keys: $vals,)*
)
};
(@sort,
$_:expr, $cbs:expr, $action:expr, $($sp:expr)?,
redundancy: $red:expr,
$($keys:ident: $vals:expr,)*) => {
children!(@sort,
$red,
$cbs,
$action,
$($sp)?,
$($keys: $vals,)*
)
};
(@sort,
$red:expr, $_:expr, $action:expr, $($sp:expr)?,
callbacks: $cbs:expr,
$($keys:ident: $vals:expr,)*) => {
children!(@sort,
$red,
$cbs,
$action,
$($sp)?,
$($keys: $vals,)*
)
};
(@sort,
$red:expr, $cbs:expr, $action:expr, $($_:expr)?,
supervisor: $sp:expr,
$($keys:ident: $vals:expr,)*) => {
children!(@sort,
$red,
$cbs,
$action,
$sp,
$($keys: $vals,)*
)
};
(@sort,
$red:expr, $cbs:expr, $_:expr, $($sp:expr)?,
action: $action:expr,
$($keys:ident: $vals:expr,)*) => {
children!(@sort,
$red,
$cbs,
$action,
$($sp)?,
$($keys: $vals,)*
)
};
(@sort, $red:expr, $cbs:expr, $action:expr, ,) => {
$crate::Bastion::children(|ch| {
ch
.with_callbacks($cbs)
.with_redundancy($red)
.with_exec(|ctx: $crate::context::BastionContext| {
async move {
let ctx = ctx;
loop {
let msg = ctx.recv().await?;
($action)(msg);
}
}
})
}).expect("failed to create children group");
};
(@sort, $red:expr, $cbs:expr, $action:expr, $sp:expr,) => {
$sp.children(|ch| {
ch
.with_callbacks($cbs)
.with_redundancy($red)
.with_exec(|ctx: $crate::context::BastionContext| {
async move {
let ctx = ctx;
loop {
let msg = ctx.recv().await?;
($action)(msg);
}
}
})
}).expect("failed to create children group");
};
}
/// This macro creates a new supervisor with the given strategy and the given callbacks.
/// Children can be specified by using the `children` / `child` macro.
/// You can provide as many children groups as you want. Supervised supervisors are currently not
/// yet supported.
///
/// # Example
/// ```
/// # use bastion::prelude::*;
/// # fn main() {
/// let sp = supervisor! {
/// callbacks: Callbacks::default(),
/// strategy: SupervisionStrategy::OneForAll,
/// };
/// # }
/// ```
#[macro_export]
macro_rules! supervisor {
($($keys:ident: $vals:expr,)*) => {
supervisor!(@sort,
$crate::supervisor::SupervisionStrategy::OneForAll,
$crate::Callbacks::default(),
$($keys: $vals,)*
)
};
(@sort,
$strat:expr, $_:expr,
callbacks: $cbs:expr,
$($keys:ident: $vals:expr,)*) => {
supervisor!(@sort,
$strat,
$cbs,
$($keys: $vals,)*
)
};
(@sort,
$_:expr, $cbs:expr,
strategy: $strat:expr,
$($keys:ident: $vals:expr,)*) => {
supervisor!(@sort,
$strat,
$cbs,
$($keys: $vals,)*
)
};
(@sort, $strat:expr, $cbs:expr,) => {
$crate::Bastion::supervisor(|sp| {
sp
.with_callbacks($cbs)
.with_strategy($strat)
}).expect("failed to create supervisor");
};
}
/// Spawns a blocking task, which will run on the blocking thread pool,
/// and returns the handle.
///
/// # Example
/// ```
/// # use std::{thread, time};
/// # use lightproc::proc_stack::ProcStack;
/// # use bastion::prelude::*;
/// # fn main() {
/// let task = blocking! {
/// thread::sleep(time::Duration::from_millis(3000));
/// };
/// run!(task);
/// # }
/// ```
#[macro_export]
macro_rules! blocking {
($($tokens:tt)*) => {
$crate::executor::blocking(async move {
$($tokens)*
})
};
}
/// This macro blocks the current thread until passed
/// future is resolved with an output (including the panic).
///
/// # Example
/// ```
/// # use bastion::prelude::*;
/// # fn main() {
/// let future1 = async move {
/// 123
/// };
///
/// run! {
/// let result = future1.await;
/// assert_eq!(result, 123);
/// };
///
/// let future2 = async move {
/// 10 / 2
/// };
///
/// let result = run!(future2);
/// assert_eq!(result, 5);
/// # }
/// ```
#[macro_export]
macro_rules! run {
($action:expr) => {
$crate::executor::run($action)
};
($($tokens:tt)*) => {
bastion::executor::run(async move {$($tokens)*})
};
}
/// Spawn a given future onto the executor from the global level.
///
/// # Example
/// ```
/// # use bastion::prelude::*;
/// # fn main() {
/// let handle = spawn! {
/// panic!("test");
/// };
/// run!(handle);
/// # }
/// ```
#[macro_export]
macro_rules! spawn {
($action:expr) => {
$crate::executor::spawn($action)
};
($($tokens:tt)*) => {
bastion::executor::spawn(async move {$($tokens)*})
};
}
///
/// Marker of distributed API.
#[doc(hidden)]
macro_rules! distributed_api {
($($block:item)*) => {
$(
#[cfg(feature = "distributed")]
#[cfg_attr(feature = "docs", doc(cfg(distributed)))]
$block
)*
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Constants that were deprecated or moved to enums in the FreeBSD headers. Keep
// them here for backwards compatibility.
package unix
const (
IFF_SMART = 0x20
IFT_1822 = 0x2
IFT_A12MPPSWITCH = 0x82
IFT_AAL2 = 0xbb
IFT_AAL5 = 0x31
IFT_ADSL = 0x5e
IFT_AFLANE8023 = 0x3b
IFT_AFLANE8025 = 0x3c
IFT_ARAP = 0x58
IFT_ARCNET = 0x23
IFT_ARCNETPLUS = 0x24
IFT_ASYNC = 0x54
IFT_ATM = 0x25
IFT_ATMDXI = 0x69
IFT_ATMFUNI = 0x6a
IFT_ATMIMA = 0x6b
IFT_ATMLOGICAL = 0x50
IFT_ATMRADIO = 0xbd
IFT_ATMSUBINTERFACE = 0x86
IFT_ATMVCIENDPT = 0xc2
IFT_ATMVIRTUAL = 0x95
IFT_BGPPOLICYACCOUNTING = 0xa2
IFT_BSC = 0x53
IFT_CCTEMUL = 0x3d
IFT_CEPT = 0x13
IFT_CES = 0x85
IFT_CHANNEL = 0x46
IFT_CNR = 0x55
IFT_COFFEE = 0x84
IFT_COMPOSITELINK = 0x9b
IFT_DCN = 0x8d
IFT_DIGITALPOWERLINE = 0x8a
IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba
IFT_DLSW = 0x4a
IFT_DOCSCABLEDOWNSTREAM = 0x80
IFT_DOCSCABLEMACLAYER = 0x7f
IFT_DOCSCABLEUPSTREAM = 0x81
IFT_DS0 = 0x51
IFT_DS0BUNDLE = 0x52
IFT_DS1FDL = 0xaa
IFT_DS3 = 0x1e
IFT_DTM = 0x8c
IFT_DVBASILN = 0xac
IFT_DVBASIOUT = 0xad
IFT_DVBRCCDOWNSTREAM = 0x93
IFT_DVBRCCMACLAYER = 0x92
IFT_DVBRCCUPSTREAM = 0x94
IFT_ENC = 0xf4
IFT_EON = 0x19
IFT_EPLRS = 0x57
IFT_ESCON = 0x49
IFT_ETHER = 0x6
IFT_FAITH = 0xf2
IFT_FAST = 0x7d
IFT_FASTETHER = 0x3e
IFT_FASTETHERFX = 0x45
IFT_FDDI = 0xf
IFT_FIBRECHANNEL = 0x38
IFT_FRAMERELAYINTERCONNECT = 0x3a
IFT_FRAMERELAYMPI = 0x5c
IFT_FRDLCIENDPT = 0xc1
IFT_FRELAY = 0x20
IFT_FRELAYDCE = 0x2c
IFT_FRF16MFRBUNDLE = 0xa3
IFT_FRFORWARD = 0x9e
IFT_G703AT2MB = 0x43
IFT_G703AT64K = 0x42
IFT_GIF = 0xf0
IFT_GIGABITETHERNET = 0x75
IFT_GR303IDT = 0xb2
IFT_GR303RDT = 0xb1
IFT_H323GATEKEEPER = 0xa4
IFT_H323PROXY = 0xa5
IFT_HDH1822 = 0x3
IFT_HDLC = 0x76
IFT_HDSL2 = 0xa8
IFT_HIPERLAN2 = 0xb7
IFT_HIPPI = 0x2f
IFT_HIPPIINTERFACE = 0x39
IFT_HOSTPAD = 0x5a
IFT_HSSI = 0x2e
IFT_HY = 0xe
IFT_IBM370PARCHAN = 0x48
IFT_IDSL = 0x9a
IFT_IEEE80211 = 0x47
IFT_IEEE80212 = 0x37
IFT_IEEE8023ADLAG = 0xa1
IFT_IFGSN = 0x91
IFT_IMT = 0xbe
IFT_INTERLEAVE = 0x7c
IFT_IP = 0x7e
IFT_IPFORWARD = 0x8e
IFT_IPOVERATM = 0x72
IFT_IPOVERCDLC = 0x6d
IFT_IPOVERCLAW = 0x6e
IFT_IPSWITCH = 0x4e
IFT_IPXIP = 0xf9
IFT_ISDN = 0x3f
IFT_ISDNBASIC = 0x14
IFT_ISDNPRIMARY = 0x15
IFT_ISDNS = 0x4b
IFT_ISDNU = 0x4c
IFT_ISO88022LLC = 0x29
IFT_ISO88023 = 0x7
IFT_ISO88024 = 0x8
IFT_ISO88025 = 0x9
IFT_ISO88025CRFPINT = 0x62
IFT_ISO88025DTR = 0x56
IFT_ISO88025FIBER = 0x73
IFT_ISO88026 = 0xa
IFT_ISUP = 0xb3
IFT_L3IPXVLAN = 0x89
IFT_LAPB = 0x10
IFT_LAPD = 0x4d
IFT_LAPF = 0x77
IFT_LOCALTALK = 0x2a
IFT_LOOP = 0x18
IFT_MEDIAMAILOVERIP = 0x8b
IFT_MFSIGLINK = 0xa7
IFT_MIOX25 = 0x26
IFT_MODEM = 0x30
IFT_MPC = 0x71
IFT_MPLS = 0xa6
IFT_MPLSTUNNEL = 0x96
IFT_MSDSL = 0x8f
IFT_MVL = 0xbf
IFT_MYRINET = 0x63
IFT_NFAS = 0xaf
IFT_NSIP = 0x1b
IFT_OPTICALCHANNEL = 0xc3
IFT_OPTICALTRANSPORT = 0xc4
IFT_OTHER = 0x1
IFT_P10 = 0xc
IFT_P80 = 0xd
IFT_PARA = 0x22
IFT_PFLOG = 0xf6
IFT_PFSYNC = 0xf7
IFT_PLC = 0xae
IFT_POS = 0xab
IFT_PPPMULTILINKBUNDLE = 0x6c
IFT_PROPBWAP2MP = 0xb8
IFT_PROPCNLS = 0x59
IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5
IFT_PROPDOCSWIRELESSMACLAYER = 0xb4
IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6
IFT_PROPMUX = 0x36
IFT_PROPWIRELESSP2P = 0x9d
IFT_PTPSERIAL = 0x16
IFT_PVC = 0xf1
IFT_QLLC = 0x44
IFT_RADIOMAC = 0xbc
IFT_RADSL = 0x5f
IFT_REACHDSL = 0xc0
IFT_RFC1483 = 0x9f
IFT_RS232 = 0x21
IFT_RSRB = 0x4f
IFT_SDLC = 0x11
IFT_SDSL = 0x60
IFT_SHDSL = 0xa9
IFT_SIP = 0x1f
IFT_SLIP = 0x1c
IFT_SMDSDXI = 0x2b
IFT_SMDSICIP = 0x34
IFT_SONET = 0x27
IFT_SONETOVERHEADCHANNEL = 0xb9
IFT_SONETPATH = 0x32
IFT_SONETVT = 0x33
IFT_SRP = 0x97
IFT_SS7SIGLINK = 0x9c
IFT_STACKTOSTACK = 0x6f
IFT_STARLAN = 0xb
IFT_STF = 0xd7
IFT_T1 = 0x12
IFT_TDLC = 0x74
IFT_TERMPAD = 0x5b
IFT_TR008 = 0xb0
IFT_TRANSPHDLC = 0x7b
IFT_TUNNEL = 0x83
IFT_ULTRA = 0x1d
IFT_USB = 0xa0
IFT_V11 = 0x40
IFT_V35 = 0x2d
IFT_V36 = 0x41
IFT_V37 = 0x78
IFT_VDSL = 0x61
IFT_VIRTUALIPADDRESS = 0x70
IFT_VOICEEM = 0x64
IFT_VOICEENCAP = 0x67
IFT_VOICEFXO = 0x65
IFT_VOICEFXS = 0x66
IFT_VOICEOVERATM = 0x98
IFT_VOICEOVERFRAMERELAY = 0x99
IFT_VOICEOVERIP = 0x68
IFT_X213 = 0x5d
IFT_X25 = 0x5
IFT_X25DDN = 0x4
IFT_X25HUNTGROUP = 0x7a
IFT_X25MLP = 0x79
IFT_X25PLE = 0x28
IFT_XETHER = 0x1a
IPPROTO_MAXID = 0x34
IPV6_FAITH = 0x1d
IP_FAITH = 0x16
MAP_NORESERVE = 0x40
MAP_RENAME = 0x20
NET_RT_MAXID = 0x6
RTF_PRCLONING = 0x10000
RTM_OLDADD = 0x9
RTM_OLDDEL = 0xa
SIOCADDRT = 0x8040720a
SIOCALIFADDR = 0x8118691b
SIOCDELRT = 0x8040720b
SIOCDLIFADDR = 0x8118691d
SIOCGLIFADDR = 0xc118691c
SIOCGLIFPHYADDR = 0xc118694b
SIOCSLIFPHYADDR = 0x8118694a
)
| {
"pile_set_name": "Github"
} |
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright Jaap Suter 2003
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.lslboost.org/LICENSE_1_0.txt)
//
// Preprocessed version of "lslboost/mpl/shift_right.hpp" header
// -- DO NOT modify by hand!
namespace lslboost { namespace mpl {
template<
typename Tag1
, typename Tag2
, BOOST_MPL_AUX_NTTP_DECL(int, tag1_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag1)::value
, BOOST_MPL_AUX_NTTP_DECL(int, tag2_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag2)::value
>
struct shift_right_impl
: if_c<
( tag1_ > tag2_ )
, aux::cast2nd_impl< shift_right_impl< Tag1,Tag1 >,Tag1, Tag2 >
, aux::cast1st_impl< shift_right_impl< Tag2,Tag2 >,Tag1, Tag2 >
>::type
{
};
/// for Digital Mars C++/compilers with no CTPS/TTP support
template<> struct shift_right_impl< na,na >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template<> struct shift_right_impl< na,integral_c_tag >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template<> struct shift_right_impl< integral_c_tag,na >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template< typename T > struct shift_right_tag
{
typedef typename T::tag type;
};
template<
typename BOOST_MPL_AUX_NA_PARAM(N1)
, typename BOOST_MPL_AUX_NA_PARAM(N2)
>
struct shift_right
: aux::msvc_eti_base< typename apply_wrap2<
shift_right_impl<
typename shift_right_tag<N1>::type
, typename shift_right_tag<N2>::type
>
, N1
, N2
>::type >::type
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(2, shift_right, (N1, N2))
};
BOOST_MPL_AUX_NA_SPEC2(2, 2, shift_right)
}}
namespace lslboost { namespace mpl {
namespace aux {
template< typename T, typename Shift, T n, Shift s >
struct shift_right_wknd
{
BOOST_STATIC_CONSTANT(T, value = (n >> s));
typedef integral_c< T,value > type;
};
}
template<>
struct shift_right_impl< integral_c_tag,integral_c_tag >
{
template< typename N, typename S > struct apply
: aux::shift_right_wknd<
typename N::value_type
, typename S::value_type
, N::value
, S::value
>::type
{
};
};
}}
| {
"pile_set_name": "Github"
} |
/* The contents of this file are subject to the Netscape Public
* License Version 1.1 (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.mozilla.org/NPL/
*
* 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 is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*
*/
/**
File Name: 15.9.5.23-1.js
ECMA Section: 15.9.5.23 Date.prototype.setTime(time)
Description:
1. If the this value is not a Date object, generate a runtime error.
2. Call ToNumber(time).
3. Call TimeClip(Result(1)).
4. Set the [[Value]] property of the this value to Result(2).
5. Return the value of the [[Value]] property of the this value.
Author: [email protected]
Date: 12 november 1997
*/
var SECTION = "15.9.5.23-13";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.setTime()";
writeHeaderToLog( SECTION + " Date.prototype.setTime(time)");
var testcases = new Array();
getTestCases();
test();
function getTestCases() {
var now = "now";
addTestCase( now, -2208988800000 );
/*
addTestCase( now, 946684800000 );
// this daylight savings case fails -- need to fix date test functions
// addTestCase( now, -69609600000 );
addTestCase( now, 0 );
addTestCase( now, String( TIME_1900 ) );
addTestCase( now, String( TZ_DIFF* msPerHour ) );
addTestCase( now, String( TIME_2000 ) );
*/
}
function addTestCase( startTime, setTime ) {
if ( startTime == "now" ) {
DateCase = new Date();
} else {
DateCase = new Date( startTime );
}
DateCase.setTime( setTime );
var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ;
var UTCDate = UTCDateFromTime ( Number(setTime) );
var LocalDate = LocalDateFromTime( Number(setTime) );
var item = testcases.length;
// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year;
testcases[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() );
testcases[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() );
DateCase.toString = Object.prototype.toString;
testcases[item++] = new TestCase( SECTION,
DateString+".toString=Object.prototype.toString;"+DateString+".toString()",
"[object Date]",
DateCase.toString() );
}
function MyDate() {
this.year = 0;
this.month = 0;
this.date = 0;
this.hours = 0;
this.minutes = 0;
this.seconds = 0;
this.ms = 0;
}
function LocalDateFromTime(t) {
t = LocalTime(t);
return ( MyDateFromTime(t) );
}
function UTCDateFromTime(t) {
return ( MyDateFromTime(t) );
}
function MyDateFromTime( t ) {
var d = new MyDate();
d.year = YearFromTime(t);
d.month = MonthFromTime(t);
d.date = DateFromTime(t);
d.hours = HourFromTime(t);
d.minutes = MinFromTime(t);
d.seconds = SecFromTime(t);
d.ms = msFromTime(t);
d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms );
d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) );
d.day = WeekDay( d.value );
return (d);
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.