code stringlengths 3 1.01M | repo_name stringlengths 5 116 | path stringlengths 3 311 | language stringclasses 30 values | license stringclasses 15 values | size int64 3 1.01M |
|---|---|---|---|---|---|
package com.odcgroup.page.resource.exception;
import org.eclipse.emf.common.util.URI;
/**
* Thrown if a PageDSLResource is loaded and no root widget is present
*
* @author amc
*
*/
public class RootWidgetNullException extends PageDSLResourceLoadException {
private static final long serialVersionUID = -9131994957243179862L;
public RootWidgetNullException(URI uri) {
super(uri, "Root widget not present (null)");
}
}
| debabratahazra/DS | designstudio/components/page/core/com.odcgroup.page.model.dsl/src/com/odcgroup/page/resource/exception/RootWidgetNullException.java | Java | epl-1.0 | 433 |
package app.yuanfresh.lijz.beans;
public class PingJia_Info {
private String goods_id; //商品ID
private String evaluate_score; //满意度
private String evaluate_comment; //评论内容
private String store_desccredit; //发货速度
private String store_servicecredit; //服务态度
private String store_deliverycredit; //发货速度
private String geval_image; //评论图片
public PingJia_Info(String goods_id, String evaluate_score,
String evaluate_comment, String store_desccredit,
String store_servicecredit, String store_deliverycredit,
String geval_image) {
this.goods_id = goods_id;
this.evaluate_score = evaluate_score;
this.evaluate_comment = evaluate_comment;
this.store_desccredit = store_desccredit;
this.store_servicecredit = store_servicecredit;
this.store_deliverycredit = store_deliverycredit;
this.geval_image = geval_image;
}
public String getGoods_id() {
return goods_id;
}
public void setGoods_id(String goods_id) {
this.goods_id = goods_id;
}
public String getEvaluate_score() {
return evaluate_score;
}
public void setEvaluate_score(String evaluate_score) {
this.evaluate_score = evaluate_score;
}
public String getEvaluate_comment() {
return evaluate_comment;
}
public void setEvaluate_comment(String evaluate_comment) {
this.evaluate_comment = evaluate_comment;
}
public String getStore_desccredit() {
return store_desccredit;
}
public void setStore_desccredit(String store_desccredit) {
this.store_desccredit = store_desccredit;
}
public String getStore_servicecredit() {
return store_servicecredit;
}
public void setStore_servicecredit(String store_servicecredit) {
this.store_servicecredit = store_servicecredit;
}
public String getStore_deliverycredit() {
return store_deliverycredit;
}
public void setStore_deliverycredit(String store_deliverycredit) {
this.store_deliverycredit = store_deliverycredit;
}
public String getGeval_image() {
return geval_image;
}
public void setGeval_image(String geval_image) {
this.geval_image = geval_image;
}
}
| lijz36/YuanFresh | V_1.0/YuanFresh/src/app/yuanfresh/lijz/beans/PingJia_Info.java | Java | epl-1.0 | 2,160 |
/* Copyright (C) 2002, The IPDR Organization, all rights reserved.
* The use and distribution of this software is governed by the terms of
* the license agreement which can be found in the file LICENSE.TXT at
* the top of this source tree.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
* ANY KIND, either express or implied.
*/
/*****************************************************
* File : IPDRReadTool.h *
* Description : *
* Author : Infosys Tech Ltd *
* Modification History : *
*---------------------------------------------------*
* Date Name Change/Description *
*---------------------------------------------------*
* 02/18/02 Created *
*****************************************************/
#ifndef _IPDR_READTOOL_H
#define _IPDR_READTOOL_H
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "utils/IPDRMemory.h"
#include "common/descriptor.h"
#include "utils/errorCode.h"
#include "utils/utils.h"
#include "common/IPDRDocWriter.h"
#include "common/IPDRDocReader.h"
#include "xml/IPDRXMLRecordHelper.h"
#include "utils/UUIDUtil.h"
#include "curl/curl.h"
#include "curl/types.h"
#include "curl/easy.h"
#include "common/getFile.h"
#define MAX_STR_LENGTH 40000
/* Structures for the list of service information */
typedef struct ServiceInfo
{
FILE* fp;
FNFType* pFNFType_;
ListNameSpaceInfo* pListNameSpaceInfo_;
} ServiceInfo;
typedef struct ListServiceInfo
{
ServiceInfo* pServiceInfo_;
struct ListServiceInfo* pNext_;
} ListServiceInfo;
/* Functions for using the list of service information */
int appendListServiceInfo(
ListServiceInfo** pHeadRef,
FILE* fp,
FNFType* pFNFType,
ListNameSpaceInfo* pListNameSpaceInfo
);
int addListServiceInfo(ListServiceInfo** pHeadRef,
FILE* fp,
FNFType* pFNFType,
ListNameSpaceInfo* pListNameSpaceInfo
);
int printListServiceInfo(ListServiceInfo* pListServiceInfo);
ServiceInfo* newServiceInfo(void);
int freeListServiceInfo(ListServiceInfo **pHeadRef);
int freeServiceInfo(ServiceInfo* ServiceInfo);
int generateRawData(
IPDRCommonParameters* pIPDRCommonParameters,
FNFData* pFNFData,
ListServiceInfo* pListServiceInfo,
int* pErrorCode
);
int validateInputParams(
int argCount,
char* argValues[],
unsigned int* schemaValFlag,
unsigned int* outDirFlag,
unsigned int* versionFlag,
char* outFileDir,
char* ipdrVer,
IPDRCommonParameters* pIPDRCommonParameters,
int* pErrorCode
);
/*
int validateInputParams(
int argCount,
char* argValues[],
unsigned int* schemaValFlag,
unsigned int* outDirFlag,
char* outFileDir,
IPDRCommonParameters* pIPDRCommonParameters,
int* pErrorCode
);
*/
int populateIPDRCommonParameters(
IPDRCommonParameters* pIPDRCommonParameters,
int* pErrorCode
);
int getLengthListServiceInfo(
ListServiceInfo* pListServiceInfo
);
int printUsage();
int getElementName(char* pServInfoAttrName,
AttributeDescriptor* pAttributeDescriptor,
ListAttributeDescriptor* pListServiceAttributeDescriptor
);
int getComplexElementName(char* pServInfoAttrName,
char* pComplexType,
ListAttributeDescriptor* pListServiceAttributeDescriptor
);
int getFieldValue(AttributeDescriptor* pAttributeDescriptor,
ServiceInfo* pServiceInfo,
ListIPDRData* pCurrentIPDRData,
int* pErrorCode
);
int getComplexFieldValue( IPDRCommonParameters* pIPDRCommonParameters,
char* fieldValue,
AttributeDescriptor* pAttributeDescriptor,
ListAttributeDescriptor* pListServiceAttributeDescriptor,
ServiceInfo* pServiceInfo,
char *pComplexType,
ListIPDRData* pCurrentIPDRData,
int* pErrorCode
);
char* Findindex(char *cPtr, char c);
char* writeEscapedChar(char* str);
char* insertEscChar(char *string, char delim);
char* getStringBetweenDelims(char* string, char* startPoint, char* endPoint);
#endif
| JackieXie168/IPDR | test/include/IPDRReadTool.h | C | epl-1.0 | 4,267 |
% This file was created by matplotlib2tikz v0.5.4.
\begin{tikzpicture}
\definecolor{color1}{rgb}{0.105882352941176,0.619607843137255,0.466666666666667}
\definecolor{color0}{rgb}{0.917647058823529,0.917647058823529,0.949019607843137}
\definecolor{color3}{rgb}{0.686735870818916,0.297270280661284,0.61999231064975}
\definecolor{color2}{rgb}{0.589542483660131,0.416993464052288,0.470588235294118}
\definecolor{color5}{rgb}{0.488581314878893,0.654440599769319,0.0982698961937716}
\definecolor{color4}{rgb}{0.737254901960784,0.324183006535948,0.4}
\begin{groupplot}[group style={group size=2 by 1}]
\nextgroupplot[
xlabel={Simulated Time (mins)},
ylabel={Weighted Trust Value},
xmin=0, xmax=60,
ymin=0, ymax=1,
ytick={0,0.2,0.4,0.6,0.8,1},
yticklabels={$0.0$,$0.2$,$0.4$,$0.6$,$0.8$,$1.0$},
tick align=outside,
xmajorgrids,
x grid style={white!50.196078431372548!black},
ymajorgrids,
y grid style={white!50.196078431372548!black},
axis line style={white!50.196078431372548!black},
axis background/.style={fill=color0},
legend style={draw=none, fill=color0},
legend entries={{Alfa},{Charlie},{Delta},{Echo},{Foxtrot}},
legend cell align={left}
]
\addplot [color1, opacity=1.0]
table {%
0 0.00316414602291128
1 0.247855769083273
2 0.148699258952388
3 0.111323338328731
4 0.1424997263536
5 0.0965926241302429
6 0.129282094060312
7 0.298292310470156
8 0.216922809503684
9 0.20282247957675
10 0.144332899175562
11 0.110289631460696
12 0.07929180882503
13 0.0721027349042727
14 0.0720570927164927
15 0.0554418926281785
16 0.0404562463879995
17 0.0437438611042292
18 0.0885068079112403
19 0.120443611378471
20 0.31472500488724
21 0.281969893162745
22 0.28827171183526
23 0.38576595724781
24 0.28382866594885
25 0.220832518828016
26 0.214923135549573
27 0.154415666798518
28 0.124510784356407
29 0.146123459690216
30 0.317175354037149
31 0.227455974608106
32 0.219654727935319
33 0.157799610652842
34 0.169900392693919
35 0.125406008004797
36 0.0967171107331476
37 0.0699876174059576
38 0.107177521782797
39 0.0774593719706163
40 0.297457355670546
41 0.21534603868502
42 0.211004888917801
43 0.158785295250696
44 0.114322097947338
45 0.138844938160423
46 0.156361250319593
47 0.112590644855181
48 0.0952607287228337
49 0.0758385550137794
50 0.0550744374267861
51 0.0541777245924251
52 0.0396024161673866
53 0.0323362688501841
54 0.0802836274502865
55 0.11453174052043
56 0.0827124276577821
57 0.116266597699153
58 0.0839516114286998
};
\addplot [color2, opacity=0.6]
table {%
0 0.96681533972317
1 0.980702943023877
2 0.822480186260263
3 0.576550538983926
4 0.416854191413566
5 0.560994077085023
6 0.58534255632456
7 0.427642011241926
8 0.576934084771316
9 0.621186251175582
10 0.731232184418877
11 0.751188701335407
12 0.822269143467597
13 0.857839066644304
14 0.897306146200507
15 0.92587437563643
16 0.935424206685738
17 0.786384236712344
18 0.575547003419557
19 0.416362914679609
20 0.426842846284522
21 0.536819870381693
22 0.430366446454607
23 0.589684745279035
24 0.432633965145511
25 0.5560096254762
26 0.625685626064973
27 0.717801209467082
28 0.533259906911928
29 0.545087599988331
30 0.508881533010826
31 0.640460472899696
32 0.669751391155749
33 0.675754652661337
34 0.767285997273614
35 0.714854552580807
36 0.781486100857723
37 0.829079935986621
38 0.656918464396241
39 0.670874383181669
40 0.764006327007839
41 0.815193370846311
42 0.83413839166907
43 0.812295189251906
44 0.612482856449629
45 0.708363217772727
46 0.787639194613732
47 0.676562026044805
48 0.581096229822234
49 0.643596732271182
50 0.741377411961765
51 0.80043074072189
52 0.85654648837618
53 0.768376186304246
54 0.777368126754291
55 0.793596244831314
56 0.648089305671172
57 0.739893058036594
58 0.799370486572419
};
\addplot [color3, opacity=0.6]
table {%
0 0.972716875901758
1 0.986786279779034
2 0.59733252855938
3 0.751645186913292
4 0.596555159264452
5 0.695950050599704
6 0.783314026865266
7 0.58815748587433
8 0.63769015139331
9 0.457042875890459
10 0.451435159144885
11 0.383599324287353
12 0.557453505386449
13 0.660774521567845
14 0.58322873590454
15 0.424549379377668
16 0.364832973834317
17 0.545676584011793
18 0.667892596979311
19 0.75508946548576
20 0.819968670388873
21 0.841194640372402
22 0.603626396379212
23 0.493511960878561
24 0.379704420731419
25 0.273823945739104
26 0.224628116908047
27 0.428840185573491
28 0.58449328639224
29 0.686394417129483
30 0.768203248443093
31 0.833528227177053
32 0.87821570499144
33 0.855824684898414
34 0.839831217078876
35 0.884689930935445
36 0.915614206114848
37 0.67149168492482
38 0.546545310370156
39 0.483551322925109
40 0.450416912740344
41 0.550254432604318
42 0.533324699528195
43 0.585761802581876
44 0.593833680627904
45 0.563870785049966
46 0.512323391747646
47 0.643864399952801
48 0.512170034537413
49 0.559983136041616
50 0.493757499848935
51 0.53204359312459
52 0.622967626427074
53 0.709980306673961
54 0.734109300783783
55 0.57455374068852
56 0.681270974538733
57 0.608385688088124
58 0.710463991042184
};
\addplot [color4, opacity=0.6]
table {%
0 0.917296185330341
1 0.385861063439652
2 0.414235953700949
3 0.413350557953983
4 0.568266651163884
5 0.644566097436344
6 0.641876318346687
7 0.446122796864681
8 0.601806995898127
9 0.638531092746854
10 0.711140778469843
11 0.621305578067509
12 0.695326124437205
13 0.51057474171131
14 0.624597618577673
15 0.652138030941092
16 0.749213341312057
17 0.816976584699124
18 0.866441770047393
19 0.819763422733045
20 0.589397464654657
21 0.517261649943417
22 0.410348667739273
23 0.300867307777089
24 0.498337872538113
25 0.638815648847215
26 0.481536946913028
27 0.625995753205214
28 0.492671381177052
29 0.580439749586874
30 0.415498994761254
31 0.581005144664162
32 0.569245334252485
33 0.429236625834013
34 0.589792391654831
35 0.584131115039474
36 0.616582598730978
37 0.72465556932128
38 0.802421520460753
39 0.801686221447429
40 0.579010622115706
41 0.677557846159805
42 0.765635392856548
43 0.831692692025747
44 0.878876465115581
45 0.639969005066877
46 0.736971111515198
47 0.770485290783675
48 0.682606547753426
49 0.608964444017771
50 0.702085272756079
51 0.528447872363646
52 0.662202858411306
53 0.743877487747865
54 0.808882818885259
55 0.686622329584428
56 0.586199874012392
57 0.579890184695033
58 0.535173984458056
};
\addplot [color5, opacity=0.6]
table {%
0 0.390881515662268
1 0.16471305003931
2 0.538786604103082
3 0.69772122508992
4 0.785584569690281
5 0.778085882193318
6 0.78004487720419
7 0.786114162877519
8 0.849382567454966
9 0.834723023409683
10 0.641118841957013
11 0.73047026228104
12 0.581335657103519
13 0.56813606112616
14 0.684478434603739
15 0.556636325159883
16 0.682821458267427
17 0.768556512108201
18 0.759714462648978
19 0.593602471834776
20 0.670624222369863
21 0.763884415201174
22 0.823576832603981
23 0.816795049798516
24 0.863316832095472
25 0.619492735559975
26 0.498857501538353
27 0.617768728690824
28 0.706427359454873
29 0.576927436129049
30 0.424942801005607
31 0.510957358207514
32 0.630611173651649
33 0.731323868764394
34 0.637037209901347
35 0.49417356954341
36 0.357029412350321
37 0.269298278836302
38 0.195727985575013
39 0.278202158678697
40 0.199619789166699
41 0.347584312179832
42 0.277653028752461
43 0.199227604524473
44 0.200269627098273
45 0.257295849036364
46 0.350151567921169
47 0.414590748005844
48 0.580946504070811
49 0.651705207160216
50 0.746649536203905
51 0.542814500895939
52 0.55085229936929
53 0.493865867885818
54 0.56369324439403
55 0.631166025749829
56 0.725259626563663
57 0.802852834655726
58 0.850546053996043
};
\path [draw=white, fill opacity=0] (axis cs:0,1)
--(axis cs:60,1);
\path [draw=white, fill opacity=0] (axis cs:1,0)
--(axis cs:1,1);
\path [draw=white!50.196078431372548!black, fill opacity=0] (axis cs:0,0)
--(axis cs:60,0);
\path [draw=white!50.196078431372548!black, fill opacity=0] (axis cs:0,0)
--(axis cs:0,1);
\nextgroupplot[
xmin=0.5, xmax=5.5,
ymin=0, ymax=1,
xtick={1,2,3,4,5},
xticklabels={Alfa,Charlie,Delta,Echo,Foxtrot},
ytick={0,0.2,0.4,0.6,0.8,1},
yticklabels={$0.0$,$0.2$,$0.4$,$0.6$,$0.8$,$1.0$},
tick align=outside,
xmajorgrids,
x grid style={white!50.196078431372548!black},
ymajorgrids,
y grid style={white!50.196078431372548!black},
axis line style={white!50.196078431372548!black},
axis background/.style={fill=color0},
legend style={draw=none, fill=color0},
legend entries={{Alfa},{Charlie},{Delta},{Echo},{Foxtrot}},
legend cell align={left}
]
\addplot [color1, opacity=1]
table {%
0.75 0.0814980275540343
1.25 0.0814980275540343
1.25 0.212964012233687
0.75 0.212964012233687
0.75 0.0814980275540343
};
\addplot [blue, opacity=1, dashed]
table {%
1 0.0814980275540343
1 0.00316414602291128
};
\addplot [blue, opacity=1, dashed]
table {%
1 0.212964012233687
1 0.38576595724781
};
\addplot [black]
table {%
0.875 0.00316414602291128
1.125 0.00316414602291128
};
\addplot [black]
table {%
0.875 0.38576595724781
1.125 0.38576595724781
};
\addplot [red, opacity=1]
table {%
0.75 0.124510784356407
1.25 0.124510784356407
};
\addplot [blue, opacity=0.8]
table {%
0.75 0.146491021634574
1.25 0.146491021634574
};
\addplot [blue, mark=+, mark size=3, mark options={draw=black}, only marks]
table {%
};
\addplot [color2, opacity=1]
table {%
1.75 0.579015157296775
2.25 0.579015157296775
2.25 0.796483365701867
1.75 0.796483365701867
1.75 0.579015157296775
};
\addplot [blue, opacity=1, dashed]
table {%
2 0.579015157296775
2 0.416362914679609
};
\addplot [blue, opacity=1, dashed]
table {%
2 0.796483365701867
2 0.980702943023877
};
\addplot [black]
table {%
1.875 0.416362914679609
2.125 0.416362914679609
};
\addplot [black]
table {%
1.875 0.980702943023877
2.125 0.980702943023877
};
\addplot [red, opacity=1]
table {%
1.75 0.708363217772727
2.25 0.708363217772727
};
\addplot [blue, opacity=0.8]
table {%
1.75 0.689913407960018
2.25 0.689913407960018
};
\addplot [blue, mark=+, mark size=3, mark options={draw=black}, only marks]
table {%
};
\addplot [color3, opacity=1]
table {%
2.75 0.522183492436118
3.25 0.522183492436118
3.25 0.722286645912984
2.75 0.722286645912984
2.75 0.522183492436118
};
\addplot [blue, opacity=1, dashed]
table {%
3 0.522183492436118
3 0.224628116908047
};
\addplot [blue, opacity=1, dashed]
table {%
3 0.722286645912984
3 0.986786279779034
};
\addplot [black]
table {%
2.875 0.224628116908047
3.125 0.224628116908047
};
\addplot [black]
table {%
2.875 0.986786279779034
3.125 0.986786279779034
};
\addplot [red, opacity=1]
table {%
2.75 0.596555159264452
3.25 0.596555159264452
};
\addplot [blue, opacity=0.8]
table {%
2.75 0.621165092237305
3.25 0.621165092237305
};
\addplot [blue, mark=+, mark size=3, mark options={draw=black}, only marks]
table {%
};
\addplot [color4, opacity=1]
table {%
3.75 0.55172031781097
4.25 0.55172031781097
4.25 0.717898173895562
3.75 0.717898173895562
3.75 0.55172031781097
};
\addplot [blue, opacity=1, dashed]
table {%
4 0.55172031781097
4 0.385861063439652
};
\addplot [blue, opacity=1, dashed]
table {%
4 0.717898173895562
4 0.917296185330341
};
\addplot [black]
table {%
3.875 0.385861063439652
4.125 0.385861063439652
};
\addplot [black]
table {%
3.875 0.917296185330341
4.125 0.917296185330341
};
\addplot [red, opacity=1]
table {%
3.75 0.624597618577673
4.25 0.624597618577673
};
\addplot [blue, opacity=0.8]
table {%
3.75 0.627024945131369
4.25 0.627024945131369
};
\addplot [blue, mark=+, mark size=3, mark options={draw=black}, only marks]
table {%
4 0.300867307777089
};
\addplot [color5, opacity=1]
table {%
4.75 0.459404334445712
5.25 0.459404334445712
5.25 0.738986702484149
4.75 0.738986702484149
4.75 0.459404334445712
};
\addplot [blue, opacity=1, dashed]
table {%
5 0.459404334445712
5 0.16471305003931
};
\addplot [blue, opacity=1, dashed]
table {%
5 0.738986702484149
5 0.863316832095472
};
\addplot [black]
table {%
4.875 0.16471305003931
5.125 0.16471305003931
};
\addplot [black]
table {%
4.875 0.863316832095472
5.125 0.863316832095472
};
\addplot [red, opacity=1]
table {%
4.75 0.617768728690824
5.25 0.617768728690824
};
\addplot [blue, opacity=0.8]
table {%
4.75 0.577061476650881
5.25 0.577061476650881
};
\addplot [blue, mark=+, mark size=3, mark options={draw=black}, only marks]
table {%
};
\path [draw=white, fill opacity=0] (axis cs:0.5,1)
--(axis cs:5.5,1);
\path [draw=white, fill opacity=0] (axis cs:1,0)
--(axis cs:1,1);
\path [draw=white!50.196078431372548!black, fill opacity=0] (axis cs:0.5,0)
--(axis cs:5.5,0);
\path [draw=white!50.196078431372548!black, fill opacity=0] (axis cs:0,0)
--(axis cs:0,1);
\end{groupplot}
\end{tikzpicture} | andrewbolster/thesis | Figures/best_atxp_rxthroughput_plr_inhd_only_feats_signed_run_time_SlowCoach.tex | TeX | epl-1.0 | 12,452 |
/*
* Sonatype Nexus (TM) Open Source Version
* Copyright (c) 2008-present Sonatype, Inc.
* All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
*
* This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
* which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
*
* Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
package org.sonatype.nexus.repository.search.query;
import java.util.Set;
import org.sonatype.nexus.repository.search.ComponentSearchResult;
/**
*
*
* @since 3.14
*/
public interface SearchResultComponentGenerator
{
ComponentSearchResult from(ComponentSearchResult hit, Set<String> componentIdSet);
}
| sonatype/nexus-public | components/nexus-repository-services/src/main/java/org/sonatype/nexus/repository/search/query/SearchResultComponentGenerator.java | Java | epl-1.0 | 1,090 |
///////////////////////////////////////////////////////////////////////////////
//
// JTOpen (IBM Toolbox for Java - OSS version)
//
// Filename: AS400PackedDecimal.java
//
// The source code contained herein is licensed under the IBM Public License
// Version 1.0, which has been approved by the Open Source Initiative.
// Copyright (C) 1997-2004 International Business Machines Corporation and
// others. All rights reserved.
//
///////////////////////////////////////////////////////////////////////////////
package com.ibm.as400.access;
import java.math.BigDecimal;
import java.math.BigInteger;
/**
* Provides a converter between a BigDecimal object and a packed decimal format floating point number.
**/
public class AS400PackedDecimal implements AS400DataType
{
static final long serialVersionUID = 4L;
private int digits_;
private int scale_;
private static final long defaultValue = 0;
static final boolean HIGH_NIBBLE = true;
static final boolean LOW_NIBBLE = false;
private boolean useDouble_ = false;
/**
* Constructs an AS400PackedDecimal object.
* @param numDigits The number of digits in the packed decimal number. It must be greater than or equal to one and less than or equal to thirty-one.
* @param numDecimalPositions The number of decimal positions in the packed decimal number. It must be greater than or equal to zero and less than or equal to <i>numDigits</i>.
**/
public AS400PackedDecimal(int numDigits, int numDecimalPositions)
{
// check for valid input
if (numDigits < 1 || numDigits > 63) // @M0C - changed the upper limit here from 31 for JDBC support
{
throw new ExtendedIllegalArgumentException("numDigits (" + String.valueOf(numDigits) + ")", ExtendedIllegalArgumentException.RANGE_NOT_VALID);
}
if (numDecimalPositions < 0 || numDecimalPositions > numDigits)
{
throw new ExtendedIllegalArgumentException("numDecimalPositions (" + String.valueOf(numDecimalPositions) + ")", ExtendedIllegalArgumentException.RANGE_NOT_VALID);
}
// set instance variables
this.digits_ = numDigits;
this.scale_ = numDecimalPositions;
}
/**
* Creates a new AS400PackedDecimal object that is identical to the current instance.
* @return The new object.
**/
public Object clone()
{
try
{
return super.clone(); // Object.clone does not throw exception
}
catch (CloneNotSupportedException e)
{
Trace.log(Trace.ERROR, "Unexpected cloning error", e);
throw new InternalErrorException(InternalErrorException.UNKNOWN);
}
}
/**
* Returns the byte length of the data type.
* @return The number of bytes in the IBM i representation of the data type.
**/
public int getByteLength()
{
return this.digits_/2+1;
}
/**
* Returns a Java object representing the default value of the data type.
* @return The BigDecimal object with a value of zero.
**/
public Object getDefaultValue()
{
return BigDecimal.valueOf(defaultValue);
}
/**
* Returns {@link com.ibm.as400.access.AS400DataType#TYPE_PACKED TYPE_PACKED}.
* @return <tt>AS400DataType.TYPE_PACKED</tt>.
**/
public int getInstanceType()
{
return AS400DataType.TYPE_PACKED;
}
/**
* Returns the Java class that corresponds with this data type.
* @return <tt>BigDecimal.class</tt>.
**/
public Class getJavaType()
{
return BigDecimal.class;
}
/**
* Returns the total number of digits in the packed decimal number.
* @return The number of digits.
**/
public int getNumberOfDigits()
{
return this.digits_;
}
/**
* Returns the number of decimal positions in the packed decimal number.
* @return The number of decimal positions.
**/
public int getNumberOfDecimalPositions()
{
return this.scale_;
}
/**
* Indicates if a {@link java.lang.Double Double} object or a
* {@link java.math.BigDecimal BigDecimal} object will be returned
* on a call to {@link #toObject toObject()}.
* @return true if a Double will be returned, false if a BigDecimal
* will be returned. The default is false.
**/
public boolean isUseDouble()
{
return useDouble_;
}
/**
* Sets whether to return a {@link java.lang.Double Double} object or a
* {@link java.math.BigDecimal BigDecimal} object on a call to
* {@link #toObject toObject()}.
* @see com.ibm.as400.access.AS400ZonedDecimal#setUseDouble
**/
public void setUseDouble(boolean b)
{
useDouble_ = b;
}
/**
* Converts the specified Java object to IBM i format.
* @param javaValue The object corresponding to the data type. It must be an instance of BigDecimal and the BigDecimal must have a less than or equal to number of digits and a less than or equal to number of decimal places.
* @return The IBM i representation of the data type.
**/
public byte[] toBytes(Object javaValue)
{
byte[] as400Value = new byte[this.digits_/2+1];
this.toBytes(javaValue, as400Value, 0);
return as400Value;
}
/**
* Converts the specified Java object into IBM i format in the specified byte array.
* @param javaValue The object corresponding to the data type. It must be an instance of BigDecimal and the BigDecimal must have a less than or equal to number of digits and a less than or equal to number of decimal places.
* @param as400Value The array to receive the data type in IBM i format. There must be enough space to hold the IBM i value.
* @return The number of bytes in the IBM i representation of the data type.
**/
public int toBytes(Object javaValue, byte[] as400Value)
{
return this.toBytes(javaValue, as400Value, 0);
}
/**
* Converts the specified Java object into IBM i format in the specified byte array.
* @param javaValue An object corresponding to the data type. It must be an instance of BigDecimal and the BigDecimal must have a less than or equal to number of digits and a less than or equal to number of decimal places.
* @param as400Value The array to receive the data type in IBM i format. There must be enough space to hold the IBM i value.
* @param offset The offset into the byte array for the start of the IBM i value. It must be greater than or equal to zero.
* @return The number of bytes in the IBM i representation of the data type.
**/
public int toBytes(Object javaValue, byte[] as400Value, int offset)
{
int outDigits = this.digits_;
int outDecimalPlaces = this.scale_;
int outLength = outDigits/2+1;
// verify input
BigDecimal inValue = null;
try {
inValue = (BigDecimal)javaValue; // Let this line throw ClassCastException
}
catch (ClassCastException e) {
Trace.log(Trace.ERROR, "ClassCastException when attempting to cast a " + javaValue.getClass().getName() + " to a BigDecimal", e);
throw e;
}
if (inValue.scale() > outDecimalPlaces) // Let this line throw NullPointerException
{
throw new ExtendedIllegalArgumentException("javaValue (" + javaValue.toString() + ")", ExtendedIllegalArgumentException.LENGTH_NOT_VALID);
}
// read the sign
int sign = inValue.signum();
// get just the digits from BigDecimal, "normalize" away sign, decimal place etc.
char[] inChars = inValue.abs().movePointRight(outDecimalPlaces).toBigInteger().toString().toCharArray();
// Check overall length
int inLength = inChars.length;
if (inLength > outDigits)
{
throw new ExtendedIllegalArgumentException("javaValue (" + javaValue.toString() + ")", ExtendedIllegalArgumentException.LENGTH_NOT_VALID);
}
int inPosition = 0; // position in char[]
// calculate number of leading zero's
int leadingZeros = (outDigits % 2 == 0) ? (outDigits - inLength + 1) : (outDigits - inLength);
// write correct number of leading zero's, allow ArrayIndexException to be thrown below
for (int i=0; i<leadingZeros-1; i+=2)
{
as400Value[offset++] = 0;
}
// if odd number of leading zero's, write leading zero and first digit
if (leadingZeros > 0)
{
if (leadingZeros % 2 != 0)
{
as400Value[offset++] = (byte)(inChars[inPosition++] & 0x000F);
}
}
else if (Trace.traceOn_)
{
Trace.log(Trace.DIAGNOSTIC, "The calculated number of leading zeros is negative.", leadingZeros);
}
int firstNibble;
int secondNibble;
// place all the digits except last one
while (inPosition < inChars.length-1)
{
firstNibble = (inChars[inPosition++] & 0x000F) << 4;
secondNibble = inChars[inPosition++] & 0x000F;
as400Value[offset++] = (byte)(firstNibble + secondNibble);
}
// place last digit and sign nibble
firstNibble = (inChars[inPosition++] & 0x000F) << 4;
if (sign != -1)
{
as400Value[offset++] = (byte)(firstNibble + 0x000F);
}
else
{
as400Value[offset++] = (byte)(firstNibble + 0x000D);
}
return outLength;
}
// @E0A
/**
* Converts the specified Java object to IBM i format.
*
* @param doubleValue The value to be converted to IBM i format. If the decimal part
* of this value needs to be truncated, it will be rounded towards
* zero. If the integral part of this value needs to be truncated,
* an exception will be thrown.
* @return The IBM i representation of the data type.
**/
public byte[] toBytes(double doubleValue)
{
byte[] as400Value = new byte[digits_/2+1];
toBytes(doubleValue, as400Value, 0);
return as400Value;
}
// @E0A
/**
* Converts the specified Java object into IBM i format in
* the specified byte array.
*
* @param doubleValue The value to be converted to IBM i format. If the decimal part
* of this value needs to be truncated, it will be rounded towards
* zero. If the integral part of this value needs to be truncated,
* an exception will be thrown.
* @param as400Value The array to receive the data type in IBM i format. There must
* be enough space to hold the IBM i value.
* @return The number of bytes in the IBM i representation of the data type.
**/
public int toBytes(double doubleValue, byte[] as400Value)
{
return toBytes(doubleValue, as400Value, 0);
}
// @E0A
/**
* Converts the specified Java object into IBM i format in
* the specified byte array.
*
* @param doubleValue The value to be converted to IBM i format. If the decimal part
* of this value needs to be truncated, it will be rounded towards
* zero. If the integral part of this value needs to be truncated,
* an exception will be thrown.
* @param as400Value The array to receive the data type in IBM i format.
* There must be enough space to hold the IBM i value.
* @param offset The offset into the byte array for the start of the IBM i value.
* It must be greater than or equal to zero.
* @return The number of bytes in the IBM i representation of the data type.
**/
public int toBytes(double doubleValue, byte[] as400Value, int offset)
{
// GOAL: For performance reasons, we need to do this conversion
// without creating any Java objects (e.g., BigDecimals,
// Strings).
// If the number is too big, we can't do anything with it.
double absValue = Math.abs(doubleValue);
if (absValue > Long.MAX_VALUE)
throw new ExtendedIllegalArgumentException("doubleValue", ExtendedIllegalArgumentException.LENGTH_NOT_VALID);
// Extract the normalized value. This is the value represented by
// two longs (one for each side of the decimal point). Using longs
// here improves the quality of the algorithm as well as the
// performance of arithmetic operations. We may need to use an
// "effective" scale due to the lack of precision representable
// by a long.
long leftSide = (long)absValue;
int effectiveScale = (scale_ > 15) ? 15 : scale_;
long rightSide = (long)Math.round((absValue - (double)leftSide) * Math.pow(10, effectiveScale));
// Ok, now we are done with any double arithmetic!
int length = digits_/2;
int b = offset + length;
boolean nibble = true; // true for left nibble, false for right nibble.
// If the effective scale is different than the actual scale,
// then pad with zeros.
int scaleDifference = scale_ - effectiveScale;
for (int i = 1; i <= scaleDifference; ++i) {
if (nibble) {
as400Value[b] &= (byte)(0x000F);
--b;
}
else {
as400Value[b] &= (byte)(0x00F0);
}
nibble = !nibble;
}
// Compute the bytes for the right side of the decimal point.
int nextDigit;
for (int i = 1; i <= effectiveScale; ++i) {
nextDigit = (int)(rightSide % 10);
if (nibble) {
as400Value[b] &= (byte)(0x000F);
as400Value[b] |= ((byte)nextDigit << 4);
--b;
}
else {
as400Value[b] &= (byte)(0x00F0);
as400Value[b] |= (byte)nextDigit;
}
nibble = !nibble;
rightSide /= 10;
}
// Compute the bytes for the left side of the decimal point.
int leftSideDigits = digits_ - scale_;
for (int i = 1; i <= leftSideDigits; ++i) {
nextDigit = (int)(leftSide % 10);
if (nibble) {
as400Value[b] &= (byte)(0x000F);
as400Value[b] |= ((byte)nextDigit << 4);
--b;
}
else {
as400Value[b] &= (byte)(0x00F0);
as400Value[b] |= (byte)nextDigit;
}
nibble = !nibble;
leftSide /= 10;
}
// Zero out the left part of the value, if needed.
while (b >= offset) {
if (nibble) {
as400Value[b] &= (byte)(0x000F);
--b;
}
else {
as400Value[b] &= (byte)(0x00F0);
}
nibble = !nibble;
}
// Fix the sign.
b = offset + length;
as400Value[b] &= (byte)(0x00F0);
as400Value[b] |= (byte)((doubleValue >= 0) ? 0x000F : 0x000D);
// If left side still has digits, then the value was too big
// to fit.
if (leftSide > 0)
throw new ExtendedIllegalArgumentException("doubleValue", ExtendedIllegalArgumentException.LENGTH_NOT_VALID);
return length+1;
}
// @E0A
/**
* Converts the specified IBM i data type to a Java double value. If the
* decimal part of the value needs to be truncated to be represented by a
* Java double value, then it is rounded towards zero. If the integral
* part of the value needs to be truncated to be represented by a Java
* double value, then it converted to either Double.POSITIVE_INFINITY
* or Double.NEGATIVE_INFINITY.
*
* @param as400Value The array containing the data type in IBM i format.
* The entire data type must be represented.
* @return The Java double value corresponding to the data type.
**/
public double toDouble(byte[] as400Value)
{
return toDouble(as400Value, 0);
}
// @E0A
/**
* Converts the specified IBM i data type to a Java double value. If the
* decimal part of the value needs to be truncated to be represented by a
* Java double value, then it is rounded towards zero. If the integral
* part of the value needs to be truncated to be represented by a Java
* double value, then it converted to either Double.POSITIVE_INFINITY
* or Double.NEGATIVE_INFINITY.
*
* @param as400Value The array containing the data type in IBM i format.
* The entire data type must be represented.
* @param offset The offset into the byte array for the start of the IBM i value.
* It must be greater than or equal to zero.
* @return The Java double value corresponding to the data type.
**/
public double toDouble(byte[] as400Value, int offset)
{
// Check the offset to prevent bogus NumberFormatException message.
if (offset < 0)
throw new ArrayIndexOutOfBoundsException(String.valueOf(offset));
// Compute the value.
double doubleValue = 0;
double multiplier = Math.pow(10, -scale_);
int rightMostOffset = offset + digits_/2;
boolean nibble = true; // true for left nibble, false for right nibble.
for(int i = rightMostOffset; i >= offset;) {
if (nibble) {
doubleValue += (byte)((as400Value[i] & 0x00F0) >> 4) * multiplier;
--i;
}
else {
doubleValue += ((byte)(as400Value[i] & 0x000F)) * multiplier;
}
multiplier *= 10;
nibble = ! nibble;
}
// Determine the sign.
switch(as400Value[rightMostOffset] & 0x000F) {
case 0x000B:
case 0x000D:
// Negative.
doubleValue *= -1;
break;
case 0x000A:
case 0x000C:
case 0x000E:
case 0x000F:
// Positive.
break;
default:
throwNumberFormatException(LOW_NIBBLE, rightMostOffset,
as400Value[rightMostOffset] & 0x00FF,
as400Value);
}
return doubleValue;
}
/**
* Converts the specified IBM i data type to a Java object.
* @param as400Value The array containing the data type in IBM i format. The entire data type must be represented.
* @return The BigDecimal object corresponding to the data type.
**/
public Object toObject(byte[] as400Value) {
return this.toObject(as400Value, 0);
}
/**
* Converts the specified IBM i data type to a Java object.
* @param as400Value The array containing the data type in IBM i format. The entire data type must be represented and the data type must have valid packed decimal format.
* @param offset The offset into the byte array for the start of the IBM i value. It must be greater than or equal to zero.
* @return The BigDecimal object corresponding to the data type.
**/
public Object toObject(byte[] as400Value, int offset) {
return toObject(as400Value, offset, false);
}
public Object toObject(byte[] as400Value, int offset, boolean ignoreErrors) { /*@Q2C*/
int startOffset = offset;
if (useDouble_) return new Double(toDouble(as400Value, offset));
// Check offset to prevent bogus NumberFormatException message
if (offset < 0)
{
if (ignoreErrors) { /*@Q2A*/
return null;
} else {
throw new ArrayIndexOutOfBoundsException(String.valueOf(offset));
}
}
int numDigits = this.digits_;
int inputSize = numDigits/2+1;
// even number of digits will have a leading zero
if (numDigits%2 == 0) ++numDigits;
char[] outputData = null;
int outputPosition = 0; // position in char[]
// read the sign nibble, allow ArrayIndexException to be thrown
int nibble = (as400Value[offset+inputSize-1] & 0x0F);
switch (nibble)
{
case 0x0B: // valid negative sign bits
case 0x0D:
outputData = new char[numDigits+1];
outputData[outputPosition++] = '-';
break;
case 0x0A: // valid positive sign bits
case 0x0C:
case 0x0E:
case 0x0F:
outputData = new char[numDigits];
break;
default: // others invalid
if (ignoreErrors) { /*@Q2A*/
return null;
} else {
throwNumberFormatException(LOW_NIBBLE, offset+inputSize-1,
as400Value[offset+inputSize-1] & 0xFF,
as400Value);
}
return null;
}
// read all the digits except last one
while (outputPosition < (outputData.length-1))
{
nibble = (as400Value[offset] & 0xFF) >>> 4;
if (nibble > 0x09) {
if (ignoreErrors) { /*@Q2A*/
return null;
} else {
throwNumberFormatException(HIGH_NIBBLE, offset,
as400Value[offset] & 0xFF,
as400Value);
}
}
outputData[outputPosition] = (char)(nibble | 0x0030);
outputPosition++;
nibble = (as400Value[offset] & 0x0F);
if (nibble > 0x09) {
if (Trace.traceOn_) Trace.log(Trace.ERROR,
" outputPosition="+outputPosition+
" outputData.length="+outputData.length +
" numDigits = "+numDigits +
" this.digits = "+this.digits_ +
" offset = "+offset+
" startOffset = "+startOffset);
if (ignoreErrors) { /*@Q2A*/
return null;
} else {
throwNumberFormatException(LOW_NIBBLE, offset,
as400Value[offset] & 0xFF,
as400Value);
}
}
offset++;
outputData[outputPosition] = (char)(nibble | 0x0030);
outputPosition++;
}
// read last digit
nibble = (as400Value[offset] & 0xFF) >>> 4;
if (nibble > 0x09) {
if (ignoreErrors) { /*@Q2A*/
return null;
} else {
throwNumberFormatException(HIGH_NIBBLE, offset,
as400Value[offset] & 0xFF,
as400Value);
}
}
outputData[outputPosition] = (char)(nibble | 0x0030);
// construct New BigDecimal object
return new BigDecimal(new BigInteger(new String(outputData)), this.scale_);
}
static final void throwNumberFormatException(boolean highNibble, int byteOffset, int byteValue, byte[] fieldBytes) throws NumberFormatException
{
String text;
if (highNibble) {
text = ResourceBundleLoader.getText("EXC_HIGH_NIBBLE_NOT_VALID", Integer.toString(byteOffset), byteToString(byteValue));
}
else {
text = ResourceBundleLoader.getText("EXC_LOW_NIBBLE_NOT_VALID", Integer.toString(byteOffset), byteToString(byteValue));
}
if (Trace.traceOn_) Trace.log(Trace.ERROR, "Byte sequence is not valid for a field of type 'packed decimal':", fieldBytes);
NumberFormatException nfe = new NumberFormatException(text);
if (Trace.traceOn_) Trace.log(Trace.ERROR, nfe);
throw nfe;
}
private static final String byteToString(int byteVal)
{
int leftDigitValue = (byteVal >>> 4) & 0x0F;
int rightDigitValue = byteVal & 0x0F;
char[] digitChars = new char[2];
// 0x30 = '0', 0x41 = 'A'
digitChars[0] = leftDigitValue < 0x0A ? (char)(0x30 + leftDigitValue) : (char)(leftDigitValue - 0x0A + 0x41);
digitChars[1] = rightDigitValue < 0x0A ? (char)(0x30 + rightDigitValue) : (char)(rightDigitValue - 0x0A + 0x41);
return new String(digitChars);
}
}
| devjunix/libjt400-java | src/com/ibm/as400/access/AS400PackedDecimal.java | Java | epl-1.0 | 24,379 |
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.ai4fm.proofprocess;
import org.eclipse.emf.cdo.CDOObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Intent</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link org.ai4fm.proofprocess.Intent#getName <em>Name</em>}</li>
* <li>{@link org.ai4fm.proofprocess.Intent#getDescription <em>Description</em>}</li>
* </ul>
* </p>
*
* @see org.ai4fm.proofprocess.ProofProcessPackage#getIntent()
* @model
* @extends CDOObject
* @generated
*/
public interface Intent extends CDOObject {
/**
* Returns the value of the '<em><b>Name</b></em>' attribute.
* The default value is <code>""</code>.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Name</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Name</em>' attribute.
* @see #setName(String)
* @see org.ai4fm.proofprocess.ProofProcessPackage#getIntent_Name()
* @model default="" required="true"
* @generated
*/
String getName();
/**
* Sets the value of the '{@link org.ai4fm.proofprocess.Intent#getName <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Name</em>' attribute.
* @see #getName()
* @generated
*/
void setName(String value);
/**
* Returns the value of the '<em><b>Description</b></em>' attribute.
* The default value is <code>""</code>.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Description</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Description</em>' attribute.
* @see #setDescription(String)
* @see org.ai4fm.proofprocess.ProofProcessPackage#getIntent_Description()
* @model default="" required="true"
* @generated
*/
String getDescription();
/**
* Sets the value of the '{@link org.ai4fm.proofprocess.Intent#getDescription <em>Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Description</em>' attribute.
* @see #getDescription()
* @generated
*/
void setDescription(String value);
} // Intent
| andriusvelykis/proofprocess | org.ai4fm.proofprocess/src/org/ai4fm/proofprocess/Intent.java | Java | epl-1.0 | 2,381 |
/*******************************************************************************
* Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* tware - initial implementation
******************************************************************************/
package org.eclipse.persistence.testing.models.collections.map;
public class AggregateMapValue {
private int value;
public int getValue(){
return value;
}
public void setValue(int value){
this.value = value;
}
public boolean equals(Object object){
if (!(object instanceof AggregateMapValue)){
return false;
} else {
return ((AggregateMapValue)object).getValue() == this.value;
}
}
public int hashCode(){
return value;
}
}
| bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs | foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/models/collections/map/AggregateMapValue.java | Java | epl-1.0 | 1,297 |
/*******************************************************************************
* Copyright (c) 2012-2015 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.ide.ext.runner.client.manager.button;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.MouseOutEvent;
import com.google.gwt.event.dom.client.MouseOutHandler;
import com.google.gwt.event.dom.client.MouseOverEvent;
import com.google.gwt.event.dom.client.MouseOverHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.SimpleLayoutPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import org.eclipse.che.ide.ext.runner.client.RunnerResources;
import org.eclipse.che.ide.ext.runner.client.manager.tooltip.TooltipWidget;
import org.vectomatic.dom.svg.ui.SVGResource;
import javax.validation.constraints.NotNull;
/**
* Class provides view representation of button.
*
* @author Dmitry Shnurenko
*/
public class ButtonWidgetImpl extends Composite implements ButtonWidget, ClickHandler, MouseOverHandler, MouseOutHandler {
interface ButtonWidgetImplUiBinder extends UiBinder<Widget, ButtonWidgetImpl> {
}
private static final int TOP_TOOLTIP_SHIFT = 35;
private static final ButtonWidgetImplUiBinder UI_BINDER = GWT.create(ButtonWidgetImplUiBinder.class);
@UiField
SimpleLayoutPanel image;
@UiField(provided = true)
final RunnerResources resources;
private final TooltipWidget tooltip;
private ActionDelegate delegate;
private boolean isEnable;
@Inject
public ButtonWidgetImpl(RunnerResources resources,
TooltipWidget tooltip,
@NotNull @Assisted String prompt,
@NotNull @Assisted SVGResource image) {
this.resources = resources;
this.tooltip = tooltip;
this.tooltip.setDescription(prompt);
initWidget(UI_BINDER.createAndBindUi(this));
this.image.getElement().appendChild(image.getSvg().getElement());
addDomHandler(this, ClickEvent.getType());
addDomHandler(this, MouseOutEvent.getType());
addDomHandler(this, MouseOverEvent.getType());
}
/** {@inheritDoc} */
@Override
public void setDisable() {
isEnable = false;
image.addStyleName(resources.runnerCss().opacityButton());
}
/** {@inheritDoc} */
@Override
public void setEnable() {
isEnable = true;
image.removeStyleName(resources.runnerCss().opacityButton());
}
/** {@inheritDoc} */
@Override
public void setDelegate(@NotNull ActionDelegate delegate) {
this.delegate = delegate;
}
/** {@inheritDoc} */
@Override
public void onClick(ClickEvent event) {
if (isEnable) {
delegate.onButtonClicked();
}
}
/** {@inheritDoc} */
@Override
public void onMouseOut(MouseOutEvent mouseOutEvent) {
tooltip.hide();
}
/** {@inheritDoc} */
@Override
public void onMouseOver(MouseOverEvent event) {
tooltip.setPopupPosition(getAbsoluteLeft(), getAbsoluteTop() + TOP_TOOLTIP_SHIFT);
tooltip.show();
}
} | riuvshin/che-plugins | plugin-runner/che-plugin-runner-ext-runner/src/main/java/org/eclipse/che/ide/ext/runner/client/manager/button/ButtonWidgetImpl.java | Java | epl-1.0 | 3,851 |
/*****************************************************************
SPINE - Signal Processing In-Node Environment is a framework that
allows dynamic on node configuration for feature extraction and a
OtA protocol for the management for WSN
Copyright (C) 2007 Telecom Italia S.p.A.
GNU Lesser General Public License
This library is free software; you can redistribute
modify it under the terms of the sub-license (below).
*****************************************************************/
/*****************************************************************
BSPAN - BlueTooth Sensor Processing for Android is a framework
that extends the SPINE framework to work on Android and the
Android Bluetooth communication services.
Copyright (C) 2011 The National Center for Telehealth and
Technology
Eclipse Public License 1.0 (EPL-1.0)
This library is free software; you can redistribute it and/or
modify it under the terms of the Eclipse Public License as
published by the Free Software Foundation, version 1.0 of the
License.
The Eclipse Public License is a reciprocal license, under
Section 3. REQUIREMENTS iv) states that source code for the
Program is available from such Contributor, and informs licensees
how to obtain it in a reasonable manner on or through a medium
customarily used for software exchange.
Post your updates and modifications to our GitHub or email to
t2@tee2.org.
This library is distributed WITHOUT ANY WARRANTY; without
the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the Eclipse Public License 1.0 (EPL-1.0)
for more details.
You should have received a copy of the Eclipse Public License
along with this library; if not,
visit http://www.opensource.org/licenses/EPL-1.0
*****************************************************************/
package spine.datamodel;
import android.content.Context;
public class ShimmerData extends Data {
private static final long serialVersionUID = 1L;
public static final int NUM_AXES = 8;
public static final int AXIS_X = 0;
public static final int AXIS_Y = 1;
public static final int AXIS_Z = 2;
// GSR Range
public static final byte HW_RES_40K = 0;
public static final byte HW_RES_287K = 1;
public static final byte HW_RES_1M = 2;
public static final byte HW_RES_3M3 = 3;
public static final byte AUTORANGE = 4;
// Sampling rates
public static final byte SAMPLING1000HZ = 1;
public static final byte SAMPLING500HZ = 2;
public static final byte SAMPLING250HZ = 4;
public static final byte SAMPLING200HZ = 5;
public static final byte SAMPLING166HZ = 6;
public static final byte SAMPLING125HZ = 8;
public static final byte SAMPLING100HZ = 10;
public static final byte SAMPLING50HZ = 20;
public static final byte SAMPLING10HZ = 100;
public static final byte SAMPLING0HZOFF = 25;
// packet types
public static final byte DATAPACKET = 0X00;
public static final byte INQUIRYCOMMAND = 0X01;
public static final byte INQUIRYRESPONSE = 0X02;
public static final byte GETSAMPLINGRATECOMMAND = 0X03;
public static final byte SAMPLINGRATERESPONSE = 0X04;
public static final byte SETSAMPLINGRATECOMMAND = 0X05;
public static final byte TOGGLELEDCOMMAND = 0X06;
public static final byte STARTSTREAMINGCOMMAND = 0X07;
public static final byte SETSENSORSCOMMAND = 0X08;
public static final byte SETACCELRANGECOMMAND = 0X09;
public static final byte ACCELRANGERESPONSE = 0X0A;
public static final byte GETACCELRANGECOMMAND = 0X0B;
public static final byte SET5VREGULATORCOMMAND = 0X0C;
public static final byte SETPOWERMUXCOMMAND = 0X0D;
public static final byte SETCONFIGSETUPBYTE0COMMAND = 0X0E;
public static final byte CONFIGSETUPBYTE0RESPONSE = 0X0F;
public static final byte GETCONFIGSETUPBYTE0COMMAND = 0X10;
public static final byte SETACCELCALIBRATIONCOMMAND = 0X11;
public static final byte ACCELCALIBRATIONRESPONSE = 0X12;
public static final byte GETACCELCALIBRATIONCOMMAND = 0X13;
public static final byte SETGYROCALIBRATIONCOMMAND = 0X14;
public static final byte GYROCALIBRATIONRESPONSE = 0X15;
public static final byte GETGYROCALIBRATIONCOMMAND = 0X16;
public static final byte SETMAGCALIBRATIONCOMMAND = 0X17;
public static final byte MAGCALIBRATIONRESPONSE = 0X18;
public static final byte GETMAGCALIBRATIONCOMMAND = 0X19;
public static final byte STOPSTREAMINGCOMMAND = 0X20;
public static final byte SETGSRRANGECOMMAND = 0X21;
public static final byte GSRRANGERESPONSE = 0X22;
public static final byte GETGSRRANGECOMMAND = 0X23;
public static final byte GETSHIMMERVERSIONCOMMAND = 0X24;
public static final byte SHIMMERVERSIONRESPONSE = 0X25;
public static final byte ACKCOMMANDPROCESSED = (byte) 0XFF;
public int timestamp;
public int gsr;
public int emg;
public int ecg;
public int vUnreg;
public int vReg;
public int gsrRange;
public int SamplingRate;
public int[] accel = new int[NUM_AXES];
public int accelRange;
public int ecgRaLL;
public int ecgLaLL;
private Node node;
public byte functionCode;
public byte sensorCode;
public byte packetType;
public ShimmerData(Context aContext) {
}
public ShimmerData( byte functionCode, byte sensorCode, byte packetType) {
this.functionCode = functionCode;
this.sensorCode = sensorCode;
this.packetType = packetType;
}
public String getLogDataLine() {
String line = ""; // Comment
line += this.timestamp + ", ";
line += this.accel[AXIS_X] + ", ";
line += this.gsrRange + ", ";
line += this.gsr;
return line;
}
public String getLogDataLineHeader() {
String line = "timestamp, accelX, range, gsr"; // Comment
return line;
}
}
| t2health/BSPAN---Bluetooth-Sensor-Processing-for-Android | AndroidSpineServer/src/spine/datamodel/ShimmerData.java | Java | epl-1.0 | 6,167 |
/*
* Copyright (c) 2014. Seonggyu Lee. All Rights Reserved.
* User: Seonggyu Lee
* Date: 14. 5. 15 오후 8:10
* Created Date : $today.year.month.day
* Last Modified : 14. 5. 15 오후 8:10
* User email: shalomeir@gmail.com
*/
package edu.kaist.irlab.classify.tui;
import cc.mallet.types.*;
import cc.mallet.util.CommandOption;
import cc.mallet.util.MalletLogger;
import java.io.*;
import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.logging.Logger;
/**
* Writing SVM Light style text.
@author Andrew McCallum <a href="mailto:mccallum@cs.umass.edu">mccallum@cs.umass.edu</a>
*/
public class Vectors2InfoForExp
{
private static Logger logger = MalletLogger.getLogger(Vectors2InfoForExp.class.getName());
static CommandOption.File inputFile = new CommandOption.File
(Vectors2InfoForExp.class, "input", "FILE", true, new File("-"),
"Read the instance list from this file; Using - indicates stdin.", null);
// static CommandOption.File weightedinputFile = new CommandOption.File
// (Vectors2InfoForExp.class, "weightedinput", "FILE", true, new File("-"),
// "Read the serialized typetopicweight double[] array from this file; Using - indicates stdin.", null);
static CommandOption.File outputFile = new CommandOption.File
(Vectors2InfoForExp.class, "output", "FILE", true, new File("text.vectors"),
"Write the SVM Style instance list to this file; Using - indicates stdout.", null);
// static CommandOption.File weightedoutputFile = new CommandOption.File
// (Vectors2InfoForExp.class, "weightedoutput", "FILE", true, new File("text.vectors"),
// "Write the SVM Style instance list to this file, and this is weighted type; Using - indicates stdout.", null);
static CommandOption.File featureFile = new CommandOption.File
(Vectors2InfoForExp.class, "featureoutput", "FILE", true, new File("text.vectors"),
"Write the feature dictonary to this file; Using - indicates stdout.", null);
static CommandOption.File statsFile = new CommandOption.File
(Vectors2InfoForExp.class, "statsoutput", "FILE", true, new File("text.vectors"),
"Write the statistics for this instance lists to this file; Using - indicates stdout.", null);
static CommandOption.Integer printInfogain = new CommandOption.Integer
(Vectors2InfoForExp.class, "print-infogain", "N", false, 0,
"Print top N words by information gain, sorted.", null);
static CommandOption.Boolean printLabels = new CommandOption.Boolean
(Vectors2InfoForExp.class, "print-labels", "[TRUE|FALSE]", false, false,
"Print class labels known to instance list, one per line.", null);
static CommandOption.Boolean printFileNames = new CommandOption.Boolean
(Vectors2InfoForExp.class, "print-FileNames", "[TRUE|FALSE]", false, true,
"Print file name with start character # after feature list.", null);
static CommandOption.String printMatrix = new CommandOption.String
(Vectors2InfoForExp.class, "print-matrix", "STRING", false, "sic",
"Print word/document matrix in the specified format (a|s)(b|i)(n|w|c|e), for (all vs. sparse), (binary vs. integer), (number vs. word vs. combined vs. empty)", null)
{
public void parseArg(java.lang.String arg) {
if (arg == null) arg = this.defaultValue;
//System.out.println("pa arg=" + arg);
// sanity check the raw printing options (a la Rainbow)
char c0 = arg.charAt(0);
char c1 = arg.charAt(1);
char c2 = arg.charAt(2);
if (arg.length() != 3 ||
(c0 != 's' && c0 != 'a') ||
(c1 != 'b' && c1 != 'i') ||
(c2 != 'n' && c2 != 'w' && c2 != 'c' && c2 != 'e')) {
throw new IllegalArgumentException("Illegal argument = " + arg + " in --print-matrix=" +arg);
}
value = arg;
}
};
static CommandOption.String encoding = new CommandOption.String
(Vectors2InfoForExp.class, "encoding", "STRING", true, Charset.defaultCharset().displayName(),
"Character encoding for input file", null);
public static void main (String[] args) throws FileNotFoundException, IOException, ClassNotFoundException {
// Process the command-line options
CommandOption.setSummary (Vectors2InfoForExp.class,
"A tool for printing information about instance lists of feature vectors.");
CommandOption.process (Vectors2InfoForExp.class, args);
// Print some helpful messages for error cases
if (args.length == 0) {
CommandOption.getList(Vectors2InfoForExp.class).printUsage(false);
System.exit (-1);
}
if (false && !inputFile.wasInvoked()) {
System.err.println ("You must specify an input instance list, with --input.");
System.exit (-1);
}
// Write classifications to the output file
PrintStream out = null;
if (outputFile.value.toString().equals ("-")) {
out = System.out;
}
else {
out = new PrintStream(outputFile.value, encoding.value);
}
// Write classifications to the output file
PrintStream featureOut = null;
if (featureFile.value.toString().equals ("-")) {
featureOut = System.out;
}
else {
featureOut = new PrintStream(featureFile.value, encoding.value);
}
// Write classifications to the output file
PrintStream statsOut = null;
if (statsFile.value.toString().equals ("-")) {
statsOut = System.out;
}
else {
statsOut = new PrintStream(statsFile.value, encoding.value);
}
// Read the InstanceList
InstanceList instances = InstanceList.load (inputFile.value);
//Read the searialized typetopicweight double[] array
// double[] typeTopicWeight = readStopwordsObject(weightedinputFile.value);
if (printLabels.value) {
Alphabet labelAlphabet = instances.getTargetAlphabet ();
for (int i = 0; i < labelAlphabet.size(); i++) {
System.out.println (labelAlphabet.lookupObject (i));
}
System.out.print ("\n");
}
if (statsFile.value.exists()) {
StringBuilder output = new StringBuilder();
output.append("#This is a statistics file for instance List file extrated same time. : "+outputFile.value.toString()+"\n");
int numInstances = instances.size();
Alphabet labelAlphabet = instances.getTargetAlphabet ();
int numClasses = labelAlphabet.size();
int numFeatures = instances.getDataAlphabet().size();
output.append("numInstances : "+numInstances+"\n");
output.append("numClasses : "+numClasses+"\n");
output.append("numFeatures : "+numFeatures+"\n");
output.append("#label statistics(Labelnum\tLabelname\tLabelInstancesNum)"+"\n");
//label 별 instance number 계산하기
Integer[] labelStats = new Integer[labelAlphabet.size()];
Arrays.fill(labelStats, 0);
for (int i = 0; i < instances.size(); i++) {
Instance instance = instances.get(i);
FeatureVector fv = (FeatureVector) instance.getData();
Label target = (Label) instance.getTarget();
labelStats[target.getIndex()]++;
}
int fullNumInstances = 0;
for (int i = 0; i < labelAlphabet.size(); i++) {
int labelInstancesNum = labelStats[i];
output.append((Integer)(i+1)+"\t"+labelAlphabet.lookupObject (i)+"\t"+labelInstancesNum+"\n");
fullNumInstances += labelInstancesNum;
}
output.append("*Full Label Instatnce List Number : "+fullNumInstances);
statsOut.println(output);
if (! statsFile.value.toString().equals ("-")) {
statsOut.close();
}
}
if (featureFile.value.exists()) {
StringBuilder output = new StringBuilder();
output.append("#This is feature List and Number of lines are same as feature word. So Next Line word's feature number is 1."); //dictionary[0]=1
featureOut.println(output);
Alphabet alphabet = instances.getDataAlphabet();
for (int i = 0; i < alphabet.size(); i++) {
output = new StringBuilder();
output.append(alphabet.lookupObject(i));
featureOut.println(output);
}
if (! featureFile.value.toString().equals ("-")) {
featureOut.close();
}
}
if (printInfogain.value > 0) {
InfoGain ig = new InfoGain (instances);
for (int i = 0; i < printInfogain.value; i++) {
System.out.println (""+i+" "+ig.getObjectAtRank(i));
}
System.out.print ("\n");
}
if (outputFile.value.exists()) {
printSVMStyleList(instances, out);
}
// if (weightedoutputFile.value.exists()) {
// printWeightedSVMStyleList(instances, out, typeTopicWeight);
// }
if (printMatrix.wasInvoked()) {
printInstanceList(instances, printMatrix.value);
}
}
/** print an instance list according to the SVM Style format */
private static void printSVMStyleList(InstanceList instances, PrintStream out) {
int numInstances = instances.size();
Alphabet labelAlphabet = instances.getTargetAlphabet ();
int numClasses = labelAlphabet.size();
int numFeatures = instances.getDataAlphabet().size();
Alphabet dataAlphabet = instances.getDataAlphabet();
double[] counts = new double[numFeatures];
double count;
StringBuilder output = new StringBuilder();
output.append("#This is svm light style Instance List. First column is a label(=target class, 0 means hidden.) Feature size : "+numFeatures+". Number of instances : "+numInstances+"."); //dictionary[0]=1
out.println(output);
for (int i = 0; i < instances.size(); i++) {
Instance instance = instances.get(i);
output = new StringBuilder();// line 출력용
if (instance.getData() instanceof FeatureVector) {
FeatureVector fv = (FeatureVector) instance.getData ();
// output.append(instance.getTarget());//text 용
Label target = (Label) instance.getTarget();
output.append((Integer)(target.getIndex()+1));//number (+1 은 실제 label number는 1부터 시작하므로)
// Sparse: Print features with non-zero values only.
for (int l = 0; l < fv.numLocations(); l++) {
int fvi = fv.indexAtLocation(l);
output.append(" "+(Integer)(fvi+1)+":"+(fv.valueAtLocation(l)));//Same +1 for vocabulary
//System.out.print(" " + dataAlphabet.lookupObject(j) + " " + ((int) fv.valueAtLocation(j)));
}
}
else {
throw new IllegalArgumentException ("Printing is supported for FeatureVector for SVM Style list, found " + instance.getData().getClass());
}
if(printFileNames.value) output.append(" #"+instance.getName());
out.println(output);
}
if (! outputFile.value.toString().equals ("-")) {
out.close();
}
}
/** print an instance list according to the SVM Style format */
private static void printWeightedSVMStyleList(InstanceList instances, PrintStream out, double[] typeTopicWeight ) {
int numInstances = instances.size();
Alphabet labelAlphabet = instances.getTargetAlphabet ();
int numClasses = labelAlphabet.size();
int numFeatures = instances.getDataAlphabet().size();
Alphabet dataAlphabet = instances.getDataAlphabet();
double[] counts = new double[numFeatures];
double count;
StringBuilder output = new StringBuilder();
output.append("#This is svm light style Instance List. First column is a label(=target class, 0 means hidden.) Feature size : "+numFeatures+". Number of instances : "+numInstances+"."); //dictionary[0]=1
out.println(output);
for (int i = 0; i < instances.size(); i++) {
Instance instance = instances.get(i);
output = new StringBuilder();// line 출력용
if (instance.getData() instanceof FeatureVector) {
FeatureVector fv = (FeatureVector) instance.getData ();
// output.append(instance.getTarget());//text 용
Label target = (Label) instance.getTarget();
output.append((Integer)(target.getIndex()+1));//number (+1 은 실제 label number는 1부터 시작하므로)
// Sparse: Print features with non-zero values only.
for (int l = 0; l < fv.numLocations(); l++) {
int fvi = fv.indexAtLocation(l);
output.append(" "+(Integer)(fvi+1)+":"+(fv.valueAtLocation(l)));//Same +1 for vocabulary
//System.out.print(" " + dataAlphabet.lookupObject(j) + " " + ((int) fv.valueAtLocation(j)));
}
}
else {
throw new IllegalArgumentException ("Printing is supported for FeatureVector for SVM Style list, found " + instance.getData().getClass());
}
if(printFileNames.value) output.append(" #"+instance.getName());
out.println(output);
}
if (! outputFile.value.toString().equals ("-")) {
out.close();
}
}
/** print an instance list according to the format string */
private static void printInstanceList(InstanceList instances, String formatString) {
int numInstances = instances.size();
int numClasses = instances.getTargetAlphabet().size();
int numFeatures = instances.getDataAlphabet().size();
Alphabet dataAlphabet = instances.getDataAlphabet();
double[] counts = new double[numFeatures];
double count;
for (int i = 0; i < instances.size(); i++) {
Instance instance = instances.get(i);
if (instance.getData() instanceof FeatureVector) {
FeatureVector fv = (FeatureVector) instance.getData ();
System.out.print(instance.getName() + " " + instance.getTarget());
if (formatString.charAt(0) == 'a') {
// Dense: Print all features, even those with value 0.
for (int fvi=0; fvi<numFeatures; fvi++){
printFeature(dataAlphabet.lookupObject(fvi), fvi, fv.value(fvi), formatString);
}
}
else {
// Sparse: Print features with non-zero values only.
for (int l = 0; l < fv.numLocations(); l++) {
int fvi = fv.indexAtLocation(l);
printFeature(dataAlphabet.lookupObject(fvi), fvi, fv.valueAtLocation(l), formatString);
//System.out.print(" " + dataAlphabet.lookupObject(j) + " " + ((int) fv.valueAtLocation(j)));
}
}
}
else if (instance.getData() instanceof FeatureSequence) {
FeatureSequence featureSequence = (FeatureSequence) instance.getData();
StringBuilder output = new StringBuilder();
output.append(instance.getName() + " " + instance.getTarget());
for (int position = 0; position < featureSequence.size(); position++) {
int featureIndex = featureSequence.getIndexAtPosition(position);
char featureFormat = formatString.charAt(2);
if (featureFormat == 'w') {
output.append(" " + dataAlphabet.lookupObject(featureIndex));
}
else if (featureFormat == 'n') {
output.append(" " + featureIndex);
}
else if (featureFormat == 'c') {
output.append(" " + dataAlphabet.lookupObject(featureIndex) + ":" + featureIndex);
}
}
System.out.println(output);
}
else {
throw new IllegalArgumentException ("Printing is supported for FeatureVector and FeatureSequence data, found " + instance.getData().getClass());
}
System.out.println();
}
System.out.println();
return; // counts;
}
/* helper for printInstanceList. prints a single feature within an instance */
private static void printFeature(Object o, int fvi, double featureValue, String formatString) {
// print object n,w,c,e
char c1 = formatString.charAt(2);
if (c1 == 'w') { // word
System.out.print(" " + o);
} else if (c1 == 'n') { // index of word
System.out.print(" " + fvi);
} else if (c1 == 'c') { //word and index
System.out.print(" " + o + ":" + fvi);
} else if (c1 == 'e'){ //no word identity
}
char c2 = formatString.charAt(1);
if (c2 == 'i') { // integer count
System.out.print(" " + ((int)(featureValue + .5)));
} else if (c2 == 'b') { // boolean present/not present
System.out.print(" " + ((featureValue>0.5) ? "1" : "0"));
}
}
public static double[] readStopwordsObject(File parameterFile) throws IOException, ClassNotFoundException {
ObjectInputStream in = new ObjectInputStream(new FileInputStream(parameterFile)); // object 쓰기위한 스트림
double[] typeTopicWeightObject = (double[]) in.readObject();
in.close();
return typeTopicWeightObject;
}
}
| shalomeir/tctm | src/edu/kaist/irlab/classify/tui/Vectors2InfoForExp.java | Java | epl-1.0 | 17,146 |
package com.openMap1.mapper.core;
import java.util.Vector;
/**
* Data item that gives one row of the Translation Summary View
* after running a translation test.
*
* @author robert
*
*/
public class TranslationSummaryItem implements SortableRow{
/**
* Make a new TranslationSummaryItem , before recording anything in it
* @param resultCode
*/
public TranslationSummaryItem(String resultCode)
{
this.resultCode = resultCode;
translationIssues = new Vector<TranslationIssue>();
sourceItemCount = 0;
resultItemCount = 0;
}
/**
* column titles for the Translation Summary View
*/
static public String[] columnTitle = {
"Code",
"Steps",
"Source items",
"Percent",
"Issues"
};
/**
* column widths for the Translation Summary View
*/
static public int[] columnWidth = {50,50,80,60,60};
static int CODE = 0;
static int STEPS = 1;
static int SOURCE_ITEMS = 2;
static int PERCENT_FIT = 3;
static int ISSUES = 4;
/**
* int constants STRING, NUMBER defined in RowSorter which define how
* each column is to be sorted
*/
public static int[] sortType()
{
int len = columnTitle.length;
int[] sType = new int[len];
sType[CODE] = STRING;
sType[STEPS] = NUMBER;
sType[SOURCE_ITEMS] = NUMBER;
sType[PERCENT_FIT] = NUMBER;
sType[ISSUES] = NUMBER;
return sType;
}
/**
* @param col column index
* @return column contents for the Translation Summary View
*/
public String cellContents(int col)
{
String cell = "";
if (col == CODE) cell = resultCode();
if (col == STEPS) cell = new Integer(resultCode().length() -1).toString();
if (col == SOURCE_ITEMS) cell = new Integer(sourceItemCount).toString();
if (col == PERCENT_FIT) cell = new Integer(percentFit()).toString();
if (col == ISSUES) cell = new Integer(translationIssues.size()).toString();
return cell;
}
/**
* for an object to serve as a sortable row for class RowSorter,
* it must be able to present the cell contents as a Vector.
* @return
*/
public Vector<?> rowVector()
{
Vector<String> row = new Vector<String>();
for (int i = 0; i < columnTitle.length;i++) row.add(cellContents(i));
return row;
}
/**
* @return coded name of the translation test result that this summarises,
* such as 'AB'
*/
public String resultCode() {return resultCode;}
private String resultCode;
/**
* @return number of information items (objects, links, or attribute values)
* in the first source of the translation chain giving the result
*/
public int sourceItemCount() {return sourceItemCount;}
public void setSourceItemCount(int sourceItemCount) {this.sourceItemCount = sourceItemCount;}
private int sourceItemCount;
/**
* @return number of information items (objects, links, or attribute values)
* in the final result of the translation chain, which exactly match the
* corresponding information items in the source
*/
public int resultItemCount() {return resultItemCount;}
public void setResultItemCount(int resultItemCount) {this.resultItemCount = resultItemCount;}
private int resultItemCount;
/**
* @return the matching result item count as a percentage of the source item count
*/
public int percentFit()
{
if (sourceItemCount == 0) return 0;
double numerator = 100*resultItemCount;
double denominator = sourceItemCount;
return (new Double(numerator/denominator).intValue());
}
/**
* @return the distinct translation issues detected
*/
public Vector<TranslationIssue> translationIssues() {return translationIssues;}
private Vector<TranslationIssue> translationIssues;
/** record a validation issue */
public void addValidationIssue(ValidationIssue vi) {translationIssues.add(vi);}
/** record a compilation issue */
public void addCompilationIssue(CompilationIssue ci) {translationIssues.add(ci);}
/** record a runtime issue */
public void addRunIssue(RunIssue ri) {translationIssues.add(ri);}
/** record a schema mismatch in a result */
public void addSchemaMismatch(SchemaMismatch sm) {translationIssues.add(sm);}
/** record a structure mismatch in a result */
public void addStructureMismatch(StructureMismatch sm) {translationIssues.add(sm);}
/** record a semantic mismatch in a result */
public void addSemanticMismatch(SemanticMismatch sm) {translationIssues.add(sm);}
}
| openmapsoftware/mappingtools | openmap-mapper-lib/src/main/java/com/openMap1/mapper/core/TranslationSummaryItem.java | Java | epl-1.0 | 4,491 |
/*
* Copyright (c) 2010-2013 NEC Corporation
* All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this
* distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
*/
/*
* refptr tests for hash list
*/
#include <pfc/listmodel.h>
#include "test_listm_cmn_ref.hh"
/*
* constants
*/
static const uint32_t nbuckets = 31;
static const uint32_t hflags = 0;
/*
* Test cases
*/
TEST(listm, hashlist_create_ref)
{
for (const pfc_refptr_ops_t **refops_p = listm_refops_set;
*refops_p != END_OF_REFOPS;
++refops_p)
{
pfc_listm_t list;
EXPECT_EQ(0, pfc_hashlist_create_ref(&list, *refops_p,
nbuckets, hflags));
pfc_listm_destroy(list);
}
}
TEST(listm, hashlist_mismatching_refops_error)
{
for (const pfc_refptr_ops_t **refops_p = listm_refops_set;
*refops_p != END_OF_REFOPS;
++refops_p)
{
// create hash list wiht refptr
pfc_listm_t list;
EXPECT_EQ(0, pfc_hashlist_create_ref(&list, *refops_p,
nbuckets, hflags));
// do test
test_listm_mismatching_refops_error(list, *refops_p,
LISTM_IMPL_HASHLIST);
// clean up
pfc_listm_destroy(list);
}
}
TEST(listm, hashlist_push_and_push_tail_refptr)
{
for (const pfc_refptr_ops_t **refops_p = listm_refops_set;
*refops_p != END_OF_REFOPS;
++refops_p)
{
// create hash list wiht refptr
pfc_listm_t list;
EXPECT_EQ(0, pfc_hashlist_create_ref(&list, *refops_p,
nbuckets, hflags));
// do test
test_listm_push_and_push_tail_refptr(list, *refops_p,
LISTM_IMPL_HASHLIST);
// clean up
pfc_listm_destroy(list);
}
}
TEST(listm, hashlist_pop_refptr)
{
for (const pfc_refptr_ops_t **refops_p = listm_refops_set;
*refops_p != END_OF_REFOPS;
++refops_p)
{
// create hash list wiht refptr
pfc_listm_t list;
EXPECT_EQ(0, pfc_hashlist_create_ref(&list, *refops_p,
nbuckets, hflags));
// do test
test_listm_pop_refptr(list, *refops_p, LISTM_IMPL_HASHLIST);
// clean up
pfc_listm_destroy(list);
}
}
TEST(listm, hashlist_remove_refptr)
{
for (const pfc_refptr_ops_t **refops_p = listm_refops_set;
*refops_p != END_OF_REFOPS;
++refops_p)
{
// create hash list wiht refptr
pfc_listm_t list;
EXPECT_EQ(0, pfc_hashlist_create_ref(&list, *refops_p,
nbuckets, hflags));
// do test
test_listm_remove_refptr(list, *refops_p, LISTM_IMPL_HASHLIST);
// clean up
pfc_listm_destroy(list);
}
}
TEST(listm, hashlist_clear_refptr)
{
for (const pfc_refptr_ops_t **refops_p = listm_refops_set;
*refops_p != END_OF_REFOPS;
++refops_p)
{
// create hash list wiht refptr
pfc_listm_t list;
EXPECT_EQ(0, pfc_hashlist_create_ref(&list, *refops_p,
nbuckets, hflags));
// do test
test_listm_clear_refptr(list, *refops_p, LISTM_IMPL_HASHLIST);
// clean up
pfc_listm_destroy(list);
}
}
TEST(listm, hashlist_destroy_refptr)
{
for (const pfc_refptr_ops_t **refops_p = listm_refops_set;
*refops_p != END_OF_REFOPS;
++refops_p)
{
for (pfc_bool_t test_dtor = 0; test_dtor < 2; ++test_dtor) {
// create hash list wiht refptr
pfc_listm_t list;
EXPECT_EQ(0, pfc_hashlist_create_ref(&list, *refops_p,
nbuckets, hflags));
// do test
test_listm_destroy_refptr(list, *refops_p, test_dtor,
LISTM_IMPL_HASHLIST);
// clean up is not necessary because list has been
// already destroyed.
}
}
}
TEST(listm, hashlist_first_refptr)
{
for (const pfc_refptr_ops_t **refops_p = listm_refops_set;
*refops_p != END_OF_REFOPS;
++refops_p)
{
// create hash list wiht refptr
pfc_listm_t list;
EXPECT_EQ(0, pfc_hashlist_create_ref(&list, *refops_p,
nbuckets, hflags));
// do test
test_listm_first_refptr(list, *refops_p, LISTM_IMPL_HASHLIST);
// clean up
pfc_listm_destroy(list);
}
}
TEST(listm, hashlist_getat_refptr)
{
for (const pfc_refptr_ops_t **refops_p = listm_refops_set;
*refops_p != END_OF_REFOPS;
++refops_p)
{
// create hash list wiht refptr
pfc_listm_t list;
EXPECT_EQ(0, pfc_hashlist_create_ref(&list, *refops_p,
nbuckets, hflags));
// do test
test_listm_getat_refptr(list, *refops_p, LISTM_IMPL_HASHLIST);
// clean up
pfc_listm_destroy(list);
}
}
TEST(listm, hashlist_sort_comp_refptr)
{
for (const pfc_refptr_ops_t **refops_p = listm_refops_set;
*refops_p != END_OF_REFOPS;
++refops_p)
{
// create hash list wiht refptr
pfc_listm_t list;
EXPECT_EQ(0, pfc_hashlist_create_ref(&list, *refops_p,
nbuckets, hflags));
// do test
test_listm_sort_comp_refptr(list, *refops_p, LISTM_IMPL_HASHLIST);
// clean up
pfc_listm_destroy(list);
}
}
| opendaylight/vtn | coordinator/core/test/libs/libpfc_util/test_listm_hash_ref.cc | C++ | epl-1.0 | 5,837 |
/*
* Copyright (c) 2015 NEC Corporation. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
package org.opendaylight.vtn.manager.it.util.action;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.util.ListIterator;
import org.opendaylight.vtn.manager.it.util.packet.Inet4Factory;
import org.opendaylight.vtn.manager.it.util.packet.EthernetFactory;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTosActionCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.tos.action._case.SetNwTosAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
/**
* {@code SetDscpVerifier} is a utility class used to verify a SET_NW_TOS
* (DSCP) action.
*/
public final class SetDscpVerifier extends ActionVerifier {
/**
* The DSCP value to be set.
*/
private final short dscp;
/**
* Ensure that the specified action is an expected SET_NW_TOS action.
*
* @param it Action list iterator.
* @param d Expected DSCP value.
*/
public static void verify(ListIterator<Action> it, short d) {
SetNwTosActionCase act = verify(it, SetNwTosActionCase.class);
SetNwTosAction snta = act.getSetNwTosAction();
Integer value = snta.getTos();
assertNotNull(value);
assertEquals(d, value.shortValue());
}
/**
* Construct a new instance.
*
* @param d The DSCP value to be set.
*/
public SetDscpVerifier(short d) {
dscp = d;
}
/**
* Return the DSCP value to be set.
*
* @return The DSCP value to be set.
*/
public short setDscp() {
return dscp;
}
// ActionVerifier
/**
* {@inheritDoc}
*/
@Override
public void verify(EthernetFactory efc, ListIterator<Action> it) {
Inet4Factory i4fc = getFactory(efc, Inet4Factory.class);
if (i4fc != null) {
verify(it, dscp);
}
}
/**
* {@inheritDoc}
*/
@Override
public void apply(EthernetFactory efc) {
Inet4Factory i4fc = getFactory(efc, Inet4Factory.class);
if (i4fc != null) {
i4fc.setDscp(dscp);
}
}
}
| opendaylight/vtn | manager/it/util/src/main/java/org/opendaylight/vtn/manager/it/util/action/SetDscpVerifier.java | Java | epl-1.0 | 2,520 |
/*
* MapReduceKernelConn.hpp
*
* Created on: Aug 16, 2013
* Author: garkenyon
*/
#ifndef MAPREDUCEKERNELCONN_HPP_
#define MAPREDUCEKERNELCONN_HPP_
#include "HyPerConn.hpp"
#include "../layers/Movie.hpp"
namespace PV {
class MapReduceKernelConn: public PV::HyPerConn {
public:
MapReduceKernelConn();
virtual ~MapReduceKernelConn();
MapReduceKernelConn(const char * name, HyPerCol * hc);
static const int MAX_WEIGHT_FILES = 1024; // arbitrary limit...
protected:
int initialize(const char * name, HyPerCol * hc);
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag);
virtual void ioParam_sharedWeights(enum ParamsIOFlag ioFlag);
virtual void ioParam_movieLayerName(enum ParamsIOFlag ioFlag);
virtual void ioParam_dWeightsListName(enum ParamsIOFlag ioFlag);
virtual void ioParam_num_dWeightFiles(enum ParamsIOFlag ioFlag);
virtual void ioParam_dWeightFileIndex(enum ParamsIOFlag ioFlag);
virtual int communicateInitInfo();
virtual int reduceKernels(int arborID);
private:
int initialize_base();
char * dWeightsListName;
char * dWeightsFilename;
char dWeightsList[MAX_WEIGHT_FILES][PV_PATH_MAX];
int num_dWeightFiles;
int dWeightFileIndex;
char * movieLayerName;
Movie * movieLayer;
};
} /* namespace PV */
#endif /* MAPREDUCEKERNELCONN_HPP_ */
| dpaiton/OpenPV | pv-core/src/obsolete/connections/MapReduceKernelConn.hpp | C++ | epl-1.0 | 1,311 |
/**
* ***************************************************************************** Copyright (c) 2004,
* 2006 Subclipse project and others. All rights reserved. This program and the accompanying
* materials are made available under the terms of the Eclipse Public License v1.0 which accompanies
* this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
*
* <p>Contributors: Subclipse project committers - initial API and implementation
* ****************************************************************************
*/
package org.tigris.subversion.subclipse.ui.subscriber;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.internal.ui.synchronize.ChangeSetDiffNode;
import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizeModelAction;
import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;
import org.tigris.subversion.subclipse.core.ISVNLocalResource;
import org.tigris.subversion.subclipse.core.SVNException;
import org.tigris.subversion.subclipse.core.resources.SVNWorkspaceRoot;
import org.tigris.subversion.subclipse.core.util.Util;
import org.tigris.subversion.subclipse.ui.ISVNUIConstants;
import org.tigris.subversion.subclipse.ui.SVNUIPlugin;
public class RevertSynchronizeAction extends SynchronizeModelAction {
private String url;
@SuppressWarnings("rawtypes")
private HashMap statusMap;
public RevertSynchronizeAction(String text, ISynchronizePageConfiguration configuration) {
super(text, configuration);
}
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.SynchronizeModelAction#getSyncInfoFilter()
*/
protected FastSyncInfoFilter getSyncInfoFilter() {
return new FastSyncInfoFilter() {
@SuppressWarnings("rawtypes")
public boolean select(SyncInfo info) {
SyncInfoDirectionFilter outgoingFilter =
new SyncInfoDirectionFilter(new int[] {SyncInfo.OUTGOING, SyncInfo.CONFLICTING});
if (!outgoingFilter.select(info)) return false;
IStructuredSelection selection = getStructuredSelection();
Iterator iter = selection.iterator();
boolean removeUnAdded =
SVNUIPlugin.getPlugin()
.getPreferenceStore()
.getBoolean(ISVNUIConstants.PREF_REMOVE_UNADDED_RESOURCES_ON_REPLACE);
while (iter.hasNext()) {
ISynchronizeModelElement element = (ISynchronizeModelElement) iter.next();
IResource resource = element.getResource();
if (resource == null) continue;
if (resource.isLinked()) return false;
if (!removeUnAdded) {
ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
try {
if (!svnResource.isManaged()) return false;
} catch (SVNException e) {
return false;
}
}
}
return true;
}
};
}
@SuppressWarnings({"rawtypes", "unchecked"})
protected SynchronizeModelOperation getSubscriberOperation(
ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
statusMap = new HashMap();
url = null;
IStructuredSelection selection = getStructuredSelection();
if (selection.size() == 1) {
ISynchronizeModelElement element = (ISynchronizeModelElement) selection.getFirstElement();
IResource resource = element.getResource();
if (resource != null) {
ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
try {
url = svnResource.getStatus().getUrlString();
if ((url == null) || (resource.getType() == IResource.FILE))
url = Util.getParentUrl(svnResource);
} catch (SVNException e) {
SVNUIPlugin.log(IStatus.ERROR, e.getMessage(), e);
}
}
}
List selectedResources = new ArrayList(elements.length);
for (int i = 0; i < elements.length; i++) {
if (elements[i] instanceof ISynchronizeModelElement) {
selectedResources.add(((ISynchronizeModelElement) elements[i]).getResource());
}
}
IResource[] resources = new IResource[selectedResources.size()];
selectedResources.toArray(resources);
boolean changeSetMode = isChangeSetMode();
List<IResource> topSelection = new ArrayList<IResource>();
if (!changeSetMode) {
Iterator iter = selection.iterator();
while (iter.hasNext()) {
ISynchronizeModelElement element = (ISynchronizeModelElement) iter.next();
topSelection.add(element.getResource());
}
}
IResource[] topSelectionArray;
if (changeSetMode) {
topSelectionArray = resources;
} else {
topSelectionArray = new IResource[topSelection.size()];
topSelection.toArray(topSelectionArray);
}
for (IResource resource : resources) {
ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
if (svnResource != null) {
try {
if (resource instanceof IContainer) {
statusMap.put(resource, svnResource.getStatus().getPropStatus());
} else {
statusMap.put(resource, svnResource.getStatus().getTextStatus());
}
} catch (SVNException e) {
// ignore
}
}
}
RevertSynchronizeOperation revertOperation =
new RevertSynchronizeOperation(configuration, elements, url, resources, statusMap);
revertOperation.setSelectedResources(topSelectionArray);
return revertOperation;
}
private boolean isChangeSetMode() {
Viewer viewer = getConfiguration().getPage().getViewer();
if (viewer instanceof TreeViewer) {
TreeItem[] items = ((TreeViewer) viewer).getTree().getItems();
for (TreeItem item : items) {
if (item.getData() instanceof ChangeSetDiffNode) {
return true;
}
}
}
return false;
}
}
| subclipse/subclipse | bundles/subclipse.ui/src/org/tigris/subversion/subclipse/ui/subscriber/RevertSynchronizeAction.java | Java | epl-1.0 | 6,541 |
#ifndef FLOBO_SERVERV2_SERVER_H
#define FLOBO_SERVERV2_SERVER_H
namespace flobopuyo {
namespace server {
namespace v2 {
struct GameResultInPool {
int gameid;
ios_fc::String name1;
ios_fc::String name2;
int winner;
int explode_count;
int drop_count;
bool is_dead;
bool is_winner;
};
class GameResultPool : public std::vector<GameResultInPool> {
public:
enum SimilarResult {
SIMILAR,
SIMILAR_BUT_SUSPECT,
NO_SIMILAR
};
SimilarResult contains(const GameResultInPool &result) const;
};
class Server {
public:
Server(ios_fc::MessageBox &mbox) : mMbox(mbox), mTimeMsBeforePeerTimeout(5000.) {}
// Process alive messages
void onIgpAlive(ios_fc::Message &msg, ios_fc::PeerAddress &address);
// Process chat messages
void onIgpChat(ios_fc::Message &msg);
// Check if a peer reached timeout.
void checkTimeouts();
// A game is over
void onIgpGameOver(ios_fc::Message &msg);
private:
// Called when a peer connects
void onPeerConnect(ios_fc::PeerAddress addr, int fpipVersion, const ios_fc::String name, const ios_fc::String password, int status);
// Called when a peer updates its status
void onPeerUpdate(Peer *peer, int status);
// Called when a peer is disconnected
void onPeerDisconnect(Peer *peer);
Database mDB;
PeersList mPeers;
ios_fc::MessageBox &mMbox; // Message box
double mTimeMsBeforePeerTimeout; // Peers are disconnected when last update gets older than this
};
void Server::checkTimeouts() {
double time_ms = ios_fc::getTimeMs();
for (int i = 0; i < mPeers.size() ; i++) {
Peer *currentPeer = mPeers[i];
if (currentPeer->isTimeout(time_ms)) {
#if DEBUG_PUYOPEERSLISTENERV2
printf("PuyoServer Peer timeout!\n");
#endif
onPeerDisconnect(currentPeer);
// Peer vector have been modified, stop looping it.
break;
}
}
}
void Server::onIgpAlive(ios_fc::Message &msg, ios_fc::PeerAddress &address)
{
Peer *currentPeer = mPeers.findByAddress(address);
if (currentPeer != NULL) { // Already know?
int status = msg.getInt("STATUS");
onPeerUpdate(currentPeer, status);
}
else { // No such peer? Connect it
#if DEBUG_PUYOPEERSLISTENERV2
printf("onIgpAlive: No such peer? Connect it\n");
#endif
int protocolVersion = msg.getInt("V"); // version of the FPIP protocol used by the client
int status = msg.getInt("STATUS");
ios_fc::String name = msg.getString("NAME");
printf("Name = %s\n", (const char*)name);
ios_fc::String pass;
if (msg.hasString("PASSWD"))
pass = msg.getString("PASSWD");
else
pass = "";
onPeerConnect(address, protocolVersion, name, pass, status);
}
}
void Server::onIgpChat(ios_fc::Message &msg)
{
#if DEBUG_PUYOPEERSLISTENERV2
printf("Message de %s: %s\n", (const char *)msg.getString("NAME"), (const char *)msg.getString("MSG"));
#endif
ios_fc::Message *newMsg = mMbox.createMessage();
try {
newMsg->addBoolProperty("RELIABLE", true);
newMsg->addInt("CMD", FLOBO_IGP_CHAT);
newMsg->addString("NAME", msg.getString("NAME"));
newMsg->addString("MSG", msg.getString("MSG"));
ios_fc::Dirigeable *dirNew = dynamic_cast<ios_fc::Dirigeable *>(newMsg);
for (int i = 0, j = mPeers.size() ; i < j ; i++) {
#if DEBUG_PUYOPEERSLISTENERV2
printf("Diffusion au peer num %d\n", i);
#endif
dirNew->setPeerAddress(mPeers[i]->addr);
newMsg->send();
}
} catch (ios_fc::Exception e) {
// TODO: something here
}
delete newMsg;
}
void Server::onPeerConnect(ios_fc::PeerAddress addr, int fpipVersion, const ios_fc::String name, const ios_fc::String password, int status)
{
ConnectionRequest request(mDB, mPeers, addr, fpipVersion, name, password, status);
bool accept = request.isAcceptable();
if (accept) {
// Send accept message
AcceptMessage acceptMsg(mMbox);
acceptMsg.sendTo(addr);
// Create the new peer
Peer *newPeer = new Peer(addr, name, mTimeMsBeforePeerTimeout);
#if DEBUG_PUYOPEERSLISTENERV2
printf("Nouveau peer: %s\n", (const char *)name);
#endif
mDB.storeConnection(name.c_str());
mDB.loadPeerInfos(newPeer);
// Envoyer tous les peers connectes au petit nouveau
for (int i = 0; i < mPeers.size(); i++) {
ConnectMessage newMsg(mMbox, mPeers[i]);
newMsg.sendTo(addr);
}
// Inserer le petit nouveau a la liste
mPeers.add(newPeer);
// Envoyer l'info de connexion a tous les peers
ConnectMessage newMsg(mMbox, newPeer);
for (int i = 0; i < mPeers.size(); i++) {
#if DEBUG_PUYOPEERSLISTENERV2
printf("Diffusion connexion au peer num %d\n", i);
#endif
newMsg.sendTo(mPeers[i]->addr);
}
}
else {
// Send deny message
#if DEBUG_PUYOPEERSLISTENERV2
printf("Connection refused for %s (%s)\n", (const char*)name, request.getDenyErrorString().c_str());
#endif
DenyMessage denyMsg(mMbox, request.getDenyErrorString(), request.getDenyErrorStringMore());
denyMsg.sendTo(addr);
}
}
void Server::onPeerUpdate(Peer *peer, int status)
{
peer->touch();
if (peer->status != status) {
peer->status = status;
// Send a STATUSCHANGE message to the other peers
ios_fc::Message *newMsg = mMbox.createMessage();
newMsg->addBoolProperty("RELIABLE", true);
newMsg->addInt("CMD", FLOBO_IGP_STATUSCHANGE);
newMsg->addString("NAME", peer->name);
newMsg->addInt("RANK", peer->rank);
newMsg->addInt("STATUS", status);
ios_fc::Dirigeable *dirNew = dynamic_cast<ios_fc::Dirigeable *>(newMsg);
dirNew->addPeerAddress("ADDR", peer->addr);
for (int i = 0; i < mPeers.size(); i++) {
#if DEBUG_PUYOPEERSLISTENERV2
printf("Diffusion connexion au peer num %d\n", i);
#endif
dirNew->setPeerAddress(mPeers[i]->addr);
newMsg->send();
}
delete newMsg;
}
}
void Server::onPeerDisconnect(Peer *peer) {
// Build disconnect message
ios_fc::Message *newMsg = mMbox.createMessage();
newMsg->addBoolProperty("RELIABLE", true);
newMsg->addInt("CMD", FLOBO_IGP_DISCONNECT);
newMsg->addString("NAME", peer->name);
ios_fc::Dirigeable *dirNew = dynamic_cast<ios_fc::Dirigeable *>(newMsg);
dirNew->addPeerAddress("ADDR", peer->addr);
// Delete peer
mPeers.remove(peer);
delete peer;
// Warn the others
for (int i = 0; i < mPeers.size(); i++) {
dirNew->setPeerAddress(mPeers[i]->addr);
newMsg->send();
}
delete newMsg;
}
struct PlayerGameStat
{
int combo_count[24]; //
int explode_count; //
int drop_count; //
int ghost_sent_count; //
double time_left;
bool is_dead;
bool is_winner;
int points; //
int total_points;
};
void Server::onIgpGameOver(ios_fc::Message &msg) {
int winner = msg.getInt("WINNER");
int gameId = msg.getInt("GAMEID");
ios_fc::String name1 = msg.getString("NAME1");
ios_fc::String name2 = msg.getString("NAME2");
PlayerGameStat gameStat;
gameStat.points = msg.getInt("SCORE");
gameStat.total_points = msg.getInt("TOTAL_SCORE");
for (int i = 0 ; i < 24 ; i++) {
ios_fc::String messageName = ios_fc::String("COMBO_COUNT") + i;
gameStat.combo_count[i] = msg.getInt(messageName);
}
gameStat.explode_count = msg.getInt("EXPLODE_COUNT");
gameStat.drop_count = msg.getInt("DROP_COUNT");
gameStat.ghost_sent_count = msg.getInt("GHOST_SENT_COUNT");
gameStat.time_left = msg.getFloat("TIME_LEFT");
gameStat.is_dead = msg.getBool("IS_DEAD");
gameStat.is_winner = msg.getBool("IS_WINNER");
// Store the result into a temporary pool.
// If the pool already contains a result for this game (sent by the other player),
// then log the result.
// Except if the result are different (the 2 players claims victory).
// In this case, give penalty points to both... (p = p*2 + 1)
printf("Game %d with %s and %s won by %d\n", gameId, name1.c_str(), name2.c_str(), winner);
}
}}}
#endif
| flboudet/flobz | fpserver/V2/Server.h | C | gpl-2.0 | 8,371 |
/**
* Instituto de Matemática e Estatística da Universidade de São Paulo (IME-USP)
* iVProg is a open source and free software of Laboratório de Informática na
* Educação (LInE) licensed under GNU GPL2.0 license.
* Prof. Dr. Leônidas de Oliveira Brandão - leo@ime.usp.br
* Romenig da Silva Ribeiro - romenig@ime.usp.br | romenig@gmail.com
* @author Romenig
*/
package usp.ime.line.ivprog;
import java.util.HashMap;
import java.util.Vector;
import usp.ime.line.ivprog.model.IVPDomainConverter;
import usp.ime.line.ivprog.model.IVPDomainModel;
import usp.ime.line.ivprog.model.utils.Services;
import usp.ime.line.ivprog.view.domaingui.IVPAuthoringGUI;
import usp.ime.line.ivprog.view.domaingui.IVPDomainGUI;
import ilm.framework.SystemFactory;
import ilm.framework.assignment.model.AssignmentState;
import ilm.framework.config.SystemConfig;
import ilm.framework.domain.DomainConverter;
import ilm.framework.domain.DomainGUI;
import ilm.framework.domain.DomainModel;
import ilm.framework.gui.AuthoringGUI;
/**
* @author Romenig
*
*/
public class IVPSystemFactory extends SystemFactory {
/*
* (non-Javadoc)
*
* @see ilm.framework.SystemFactory#createDomainModel()
*/
protected DomainModel createDomainModel() {
IVPDomainModel model = new IVPDomainModel();
Services.getService().getController().setModel(model);
return model;
}
/*
* (non-Javadoc)
*
* @see ilm.framework.SystemFactory#createDomainConverter()
*/
protected DomainConverter createDomainConverter() {
IVPDomainConverter converter = new IVPDomainConverter();
return converter;
}
/*
* (non-Javadoc)
*
* @see
* ilm.framework.SystemFactory#createDomainGUI(ilm.framework.config.SystemConfig
* , ilm.framework.domain.DomainModel)
*/
public DomainGUI createDomainGUI(SystemConfig config, DomainModel domainModel) {
IVPDomainGUI gui = new IVPDomainGUI();
gui.initDomainActionList(domainModel);
Services.getService().getController().setCurrentDomainGUI(gui);
return gui;
}
/*
* (non-Javadoc)
*
* @see
* ilm.framework.SystemFactory#createAuthoringGUI(ilm.framework.domain.DomainGUI
* , java.lang.String, ilm.framework.assignment.model.AssignmentState,
* ilm.framework.assignment.model.AssignmentState,
* ilm.framework.assignment.model.AssignmentState, java.util.HashMap,
* java.util.HashMap)
*/
public AuthoringGUI createAuthoringGUI(DomainGUI domainGUI, String proposition, AssignmentState initial, AssignmentState current,
AssignmentState expected, HashMap config, HashMap metadata) {
IVPAuthoringGUI gui = new IVPAuthoringGUI();
return gui;
}
protected Vector getIlmModuleList() {
Vector list = new Vector();
// list.add(new ScriptModule());
// list.add(new ExampleTracingTutorModule());
// list.add(new ScormModule());
return list;
}
}
| Romenig/iVProg_2 | src/usp/ime/line/ivprog/IVPSystemFactory.java | Java | gpl-2.0 | 2,904 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>spMonitor: tk.giesecke.spmonitor.spMonitor.onPostExecuteWrapper Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="splash.png"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname">spMonitor
</div>
<div id="projectbrief">Solar panel monitoring system (Android app, Arduino sketch, PHP scripts)</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Packages</span></a></li>
<li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="classes.html"><span>Data Structure Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Data Fields</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacetk.html">tk</a></li><li class="navelem"><a class="el" href="namespacetk_1_1giesecke.html">giesecke</a></li><li class="navelem"><a class="el" href="namespacetk_1_1giesecke_1_1spmonitor.html">spmonitor</a></li><li class="navelem"><a class="el" href="classtk_1_1giesecke_1_1spmonitor_1_1spMonitor.html">spMonitor</a></li><li class="navelem"><a class="el" href="classtk_1_1giesecke_1_1spmonitor_1_1spMonitor_1_1onPostExecuteWrapper.html">onPostExecuteWrapper</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
<div class="title">tk.giesecke.spmonitor.spMonitor.onPostExecuteWrapper Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Wrapper to send 2 parameters to onPostExecute of AsyncTask.
<a href="classtk_1_1giesecke_1_1spmonitor_1_1spMonitor_1_1onPostExecuteWrapper.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Data Fields</h2></td></tr>
<tr class="memitem:a2221a5e6c0aab4d104153ae3ecfa9bc2"><td class="memItemLeft" align="right" valign="top">String </td><td class="memItemRight" valign="bottom"><a class="el" href="classtk_1_1giesecke_1_1spmonitor_1_1spMonitor_1_1onPostExecuteWrapper.html#a2221a5e6c0aab4d104153ae3ecfa9bc2">taskResult</a></td></tr>
<tr class="separator:a2221a5e6c0aab4d104153ae3ecfa9bc2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a642e07057c24ec8834cc87fce6661a14"><td class="memItemLeft" align="right" valign="top">String </td><td class="memItemRight" valign="bottom"><a class="el" href="classtk_1_1giesecke_1_1spmonitor_1_1spMonitor_1_1onPostExecuteWrapper.html#a642e07057c24ec8834cc87fce6661a14">syncMonth</a></td></tr>
<tr class="separator:a642e07057c24ec8834cc87fce6661a14"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Wrapper to send 2 parameters to onPostExecute of AsyncTask. </p>
<p>Definition at line <a class="el" href="spMonitor_8java_source.html#l01060">1060</a> of file <a class="el" href="spMonitor_8java_source.html">spMonitor.java</a>.</p>
</div><h2 class="groupheader">Field Documentation</h2>
<a class="anchor" id="a642e07057c24ec8834cc87fce6661a14"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">String tk.giesecke.spmonitor.spMonitor.onPostExecuteWrapper.syncMonth</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="spMonitor_8java_source.html#l01062">1062</a> of file <a class="el" href="spMonitor_8java_source.html">spMonitor.java</a>.</p>
</div>
</div>
<a class="anchor" id="a2221a5e6c0aab4d104153ae3ecfa9bc2"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">String tk.giesecke.spmonitor.spMonitor.onPostExecuteWrapper.taskResult</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="spMonitor_8java_source.html#l01061">1061</a> of file <a class="el" href="spMonitor_8java_source.html">spMonitor.java</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>D:/Android-Dev/android-studio-others/projects/spMonitor/app/src/main/java/tk/giesecke/spmonitor/<a class="el" href="spMonitor_8java_source.html">spMonitor.java</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Nov 1 2015 19:24:12 for spMonitor by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
| beegee-tokyo/spMonitor | docs/html/classtk_1_1giesecke_1_1spmonitor_1_1spMonitor_1_1onPostExecuteWrapper.html | HTML | gpl-2.0 | 7,656 |
/*
This file is part of Ext JS 4.2
Copyright (c) 2011-2014 Sencha Inc
Contact: http://www.sencha.com/contact
Commercial Usage
Licensees holding valid commercial licenses may use this file in accordance with the Commercial
Software License Agreement provided with the Software or, alternatively, in accordance with the
terms contained in a written agreement between you and Sencha.
If you are unsure which license is appropriate for your use, please contact the sales department
at http://www.sencha.com/contact.
Build date: 2014-09-02 11:12:40 (ef1fa70924f51a26dacbe29644ca3f31501a5fce)
*/
// @tag foundation,core
// @require Number.js
// @define Ext.Array
/**
* @class Ext.Array
* @singleton
* @author Jacky Nguyen <jacky@sencha.com>
* @docauthor Jacky Nguyen <jacky@sencha.com>
*
* A set of useful static methods to deal with arrays; provide missing methods for older browsers.
*/
(function() {
var arrayPrototype = Array.prototype,
slice = arrayPrototype.slice,
supportsSplice = (function () {
var array = [],
lengthBefore,
j = 20;
if (!array.splice) {
return false;
}
// This detects a bug in IE8 splice method:
// see http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/6e946d03-e09f-4b22-a4dd-cd5e276bf05a/
while (j--) {
array.push("A");
}
array.splice(15, 0, "F", "F", "F", "F", "F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F");
lengthBefore = array.length; //41
array.splice(13, 0, "XXX"); // add one element
if (lengthBefore+1 != array.length) {
return false;
}
// end IE8 bug
return true;
}()),
supportsForEach = 'forEach' in arrayPrototype,
supportsMap = 'map' in arrayPrototype,
supportsIndexOf = 'indexOf' in arrayPrototype,
supportsEvery = 'every' in arrayPrototype,
supportsSome = 'some' in arrayPrototype,
supportsFilter = 'filter' in arrayPrototype,
supportsSort = (function() {
var a = [1,2,3,4,5].sort(function(){ return 0; });
return a[0] === 1 && a[1] === 2 && a[2] === 3 && a[3] === 4 && a[4] === 5;
}()),
supportsSliceOnNodeList = true,
ExtArray,
erase,
replace,
splice;
try {
// IE 6 - 8 will throw an error when using Array.prototype.slice on NodeList
if (typeof document !== 'undefined') {
slice.call(document.getElementsByTagName('body'));
}
} catch (e) {
supportsSliceOnNodeList = false;
}
function fixArrayIndex (array, index) {
return (index < 0) ? Math.max(0, array.length + index)
: Math.min(array.length, index);
}
/*
Does the same work as splice, but with a slightly more convenient signature. The splice
method has bugs in IE8, so this is the implementation we use on that platform.
The rippling of items in the array can be tricky. Consider two use cases:
index=2
removeCount=2
/=====\
+---+---+---+---+---+---+---+---+
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
+---+---+---+---+---+---+---+---+
/ \/ \/ \/ \
/ /\ /\ /\ \
/ / \/ \/ \ +--------------------------+
/ / /\ /\ +--------------------------+ \
/ / / \/ +--------------------------+ \ \
/ / / /+--------------------------+ \ \ \
/ / / / \ \ \ \
v v v v v v v v
+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+---+
| 0 | 1 | 4 | 5 | 6 | 7 | | 0 | 1 | a | b | c | 4 | 5 | 6 | 7 |
+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+---+
A B \=========/
insert=[a,b,c]
In case A, it is obvious that copying of [4,5,6,7] must be left-to-right so
that we don't end up with [0,1,6,7,6,7]. In case B, we have the opposite; we
must go right-to-left or else we would end up with [0,1,a,b,c,4,4,4,4].
*/
function replaceSim (array, index, removeCount, insert) {
var add = insert ? insert.length : 0,
length = array.length,
pos = fixArrayIndex(array, index),
remove,
tailOldPos,
tailNewPos,
tailCount,
lengthAfterRemove,
i;
// we try to use Array.push when we can for efficiency...
if (pos === length) {
if (add) {
array.push.apply(array, insert);
}
} else {
remove = Math.min(removeCount, length - pos);
tailOldPos = pos + remove;
tailNewPos = tailOldPos + add - remove;
tailCount = length - tailOldPos;
lengthAfterRemove = length - remove;
if (tailNewPos < tailOldPos) { // case A
for (i = 0; i < tailCount; ++i) {
array[tailNewPos+i] = array[tailOldPos+i];
}
} else if (tailNewPos > tailOldPos) { // case B
for (i = tailCount; i--; ) {
array[tailNewPos+i] = array[tailOldPos+i];
}
} // else, add == remove (nothing to do)
if (add && pos === lengthAfterRemove) {
array.length = lengthAfterRemove; // truncate array
array.push.apply(array, insert);
} else {
array.length = lengthAfterRemove + add; // reserves space
for (i = 0; i < add; ++i) {
array[pos+i] = insert[i];
}
}
}
return array;
}
function replaceNative (array, index, removeCount, insert) {
if (insert && insert.length) {
// Inserting at index zero with no removing: use unshift
if (index === 0 && !removeCount) {
array.unshift.apply(array, insert);
}
// Inserting/replacing in middle of array
else if (index < array.length) {
array.splice.apply(array, [index, removeCount].concat(insert));
}
// Appending to array
else {
array.push.apply(array, insert);
}
} else {
array.splice(index, removeCount);
}
return array;
}
function eraseSim (array, index, removeCount) {
return replaceSim(array, index, removeCount);
}
function eraseNative (array, index, removeCount) {
array.splice(index, removeCount);
return array;
}
function spliceSim (array, index, removeCount) {
var pos = fixArrayIndex(array, index),
removed = array.slice(index, fixArrayIndex(array, pos+removeCount));
if (arguments.length < 4) {
replaceSim(array, pos, removeCount);
} else {
replaceSim(array, pos, removeCount, slice.call(arguments, 3));
}
return removed;
}
function spliceNative (array) {
return array.splice.apply(array, slice.call(arguments, 1));
}
erase = supportsSplice ? eraseNative : eraseSim;
replace = supportsSplice ? replaceNative : replaceSim;
splice = supportsSplice ? spliceNative : spliceSim;
// NOTE: from here on, use erase, replace or splice (not native methods)...
ExtArray = Ext.Array = {
/**
* Iterates an array or an iterable value and invoke the given callback function for each item.
*
* var countries = ['Vietnam', 'Singapore', 'United States', 'Russia'];
*
* Ext.Array.each(countries, function(name, index, countriesItSelf) {
* console.log(name);
* });
*
* var sum = function() {
* var sum = 0;
*
* Ext.Array.each(arguments, function(value) {
* sum += value;
* });
*
* return sum;
* };
*
* sum(1, 2, 3); // returns 6
*
* The iteration can be stopped by returning false in the function callback.
*
* Ext.Array.each(countries, function(name, index, countriesItSelf) {
* if (name === 'Singapore') {
* return false; // break here
* }
* });
*
* {@link Ext#each Ext.each} is alias for {@link Ext.Array#each Ext.Array.each}
*
* @param {Array/NodeList/Object} iterable The value to be iterated. If this
* argument is not iterable, the callback function is called once.
* @param {Function} fn The callback function. If it returns false, the iteration stops and this method returns
* the current `index`.
* @param {Object} fn.item The item at the current `index` in the passed `array`
* @param {Number} fn.index The current `index` within the `array`
* @param {Array} fn.allItems The `array` itself which was passed as the first argument
* @param {Boolean} fn.return Return false to stop iteration.
* @param {Object} scope (Optional) The scope (`this` reference) in which the specified function is executed.
* @param {Boolean} reverse (Optional) Reverse the iteration order (loop from the end to the beginning)
* Defaults false
* @return {Boolean} See description for the `fn` parameter.
*/
each: function(array, fn, scope, reverse) {
array = ExtArray.from(array);
var i,
ln = array.length;
if (reverse !== true) {
for (i = 0; i < ln; i++) {
if (fn.call(scope || array[i], array[i], i, array) === false) {
return i;
}
}
}
else {
for (i = ln - 1; i > -1; i--) {
if (fn.call(scope || array[i], array[i], i, array) === false) {
return i;
}
}
}
return true;
},
/**
* Iterates an array and invoke the given callback function for each item. Note that this will simply
* delegate to the native Array.prototype.forEach method if supported. It doesn't support stopping the
* iteration by returning false in the callback function like {@link Ext.Array#each}. However, performance
* could be much better in modern browsers comparing with {@link Ext.Array#each}
*
* @param {Array} array The array to iterate
* @param {Function} fn The callback function.
* @param {Object} fn.item The item at the current `index` in the passed `array`
* @param {Number} fn.index The current `index` within the `array`
* @param {Array} fn.allItems The `array` itself which was passed as the first argument
* @param {Object} scope (Optional) The execution scope (`this`) in which the specified function is executed.
*/
forEach: supportsForEach ? function(array, fn, scope) {
array.forEach(fn, scope);
} : function(array, fn, scope) {
var i = 0,
ln = array.length;
for (; i < ln; i++) {
fn.call(scope, array[i], i, array);
}
},
/**
* Get the index of the provided `item` in the given `array`, a supplement for the
* missing arrayPrototype.indexOf in Internet Explorer.
*
* @param {Array} array The array to check
* @param {Object} item The item to look for
* @param {Number} from (Optional) The index at which to begin the search
* @return {Number} The index of item in the array (or -1 if it is not found)
*/
indexOf: supportsIndexOf ? function(array, item, from) {
return arrayPrototype.indexOf.call(array, item, from);
} : function(array, item, from) {
var i, length = array.length;
for (i = (from < 0) ? Math.max(0, length + from) : from || 0; i < length; i++) {
if (array[i] === item) {
return i;
}
}
return -1;
},
/**
* Checks whether or not the given `array` contains the specified `item`
*
* @param {Array} array The array to check
* @param {Object} item The item to look for
* @return {Boolean} True if the array contains the item, false otherwise
*/
contains: supportsIndexOf ? function(array, item) {
return arrayPrototype.indexOf.call(array, item) !== -1;
} : function(array, item) {
var i, ln;
for (i = 0, ln = array.length; i < ln; i++) {
if (array[i] === item) {
return true;
}
}
return false;
},
/**
* Converts any iterable (numeric indices and a length property) into a true array.
*
* function test() {
* var args = Ext.Array.toArray(arguments),
* fromSecondToLastArgs = Ext.Array.toArray(arguments, 1);
*
* alert(args.join(' '));
* alert(fromSecondToLastArgs.join(' '));
* }
*
* test('just', 'testing', 'here'); // alerts 'just testing here';
* // alerts 'testing here';
*
* Ext.Array.toArray(document.getElementsByTagName('div')); // will convert the NodeList into an array
* Ext.Array.toArray('splitted'); // returns ['s', 'p', 'l', 'i', 't', 't', 'e', 'd']
* Ext.Array.toArray('splitted', 0, 3); // returns ['s', 'p', 'l']
*
* {@link Ext#toArray Ext.toArray} is alias for {@link Ext.Array#toArray Ext.Array.toArray}
*
* @param {Object} iterable the iterable object to be turned into a true Array.
* @param {Number} start (Optional) a zero-based index that specifies the start of extraction. Defaults to 0
* @param {Number} end (Optional) a 1-based index that specifies the end of extraction. Defaults to the last
* index of the iterable value
* @return {Array} array
*/
toArray: function(iterable, start, end){
if (!iterable || !iterable.length) {
return [];
}
if (typeof iterable === 'string') {
iterable = iterable.split('');
}
if (supportsSliceOnNodeList) {
return slice.call(iterable, start || 0, end || iterable.length);
}
var array = [],
i;
start = start || 0;
end = end ? ((end < 0) ? iterable.length + end : end) : iterable.length;
for (i = start; i < end; i++) {
array.push(iterable[i]);
}
return array;
},
/**
* Plucks the value of a property from each item in the Array. Example:
*
* Ext.Array.pluck(Ext.query("p"), "className"); // [el1.className, el2.className, ..., elN.className]
*
* @param {Array/NodeList} array The Array of items to pluck the value from.
* @param {String} propertyName The property name to pluck from each element.
* @return {Array} The value from each item in the Array.
*/
pluck: function(array, propertyName) {
var ret = [],
i, ln, item;
for (i = 0, ln = array.length; i < ln; i++) {
item = array[i];
ret.push(item[propertyName]);
}
return ret;
},
/**
* Creates a new array with the results of calling a provided function on every element in this array.
*
* @param {Array} array
* @param {Function} fn Callback function for each item
* @param {Mixed} fn.item Current item.
* @param {Number} fn.index Index of the item.
* @param {Array} fn.array The whole array that's being iterated.
* @param {Object} [scope] Callback function scope
* @return {Array} results
*/
map: supportsMap ? function(array, fn, scope) {
//<debug>
if (!fn) {
Ext.Error.raise('Ext.Array.map must have a callback function passed as second argument.');
}
//</debug>
return array.map(fn, scope);
} : function(array, fn, scope) {
//<debug>
if (!fn) {
Ext.Error.raise('Ext.Array.map must have a callback function passed as second argument.');
}
//</debug>
var results = [],
i = 0,
len = array.length;
for (; i < len; i++) {
results[i] = fn.call(scope, array[i], i, array);
}
return results;
},
/**
* Executes the specified function for each array element until the function returns a falsy value.
* If such an item is found, the function will return false immediately.
* Otherwise, it will return true.
*
* @param {Array} array
* @param {Function} fn Callback function for each item
* @param {Mixed} fn.item Current item.
* @param {Number} fn.index Index of the item.
* @param {Array} fn.array The whole array that's being iterated.
* @param {Object} scope Callback function scope
* @return {Boolean} True if no false value is returned by the callback function.
*/
every: supportsEvery ? function(array, fn, scope) {
//<debug>
if (!fn) {
Ext.Error.raise('Ext.Array.every must have a callback function passed as second argument.');
}
//</debug>
return array.every(fn, scope);
} : function(array, fn, scope) {
//<debug>
if (!fn) {
Ext.Error.raise('Ext.Array.every must have a callback function passed as second argument.');
}
//</debug>
var i = 0,
ln = array.length;
for (; i < ln; ++i) {
if (!fn.call(scope, array[i], i, array)) {
return false;
}
}
return true;
},
/**
* Executes the specified function for each array element until the function returns a truthy value.
* If such an item is found, the function will return true immediately. Otherwise, it will return false.
*
* @param {Array} array
* @param {Function} fn Callback function for each item
* @param {Mixed} fn.item Current item.
* @param {Number} fn.index Index of the item.
* @param {Array} fn.array The whole array that's being iterated.
* @param {Object} scope Callback function scope
* @return {Boolean} True if the callback function returns a truthy value.
*/
some: supportsSome ? function(array, fn, scope) {
//<debug>
if (!fn) {
Ext.Error.raise('Ext.Array.some must have a callback function passed as second argument.');
}
//</debug>
return array.some(fn, scope);
} : function(array, fn, scope) {
//<debug>
if (!fn) {
Ext.Error.raise('Ext.Array.some must have a callback function passed as second argument.');
}
//</debug>
var i = 0,
ln = array.length;
for (; i < ln; ++i) {
if (fn.call(scope, array[i], i, array)) {
return true;
}
}
return false;
},
/**
* Shallow compares the contents of 2 arrays using strict equality.
* @param {Array} array1
* @param {Array} array2
* @return {Boolean} `true` if the arrays are equal.
*/
equals: function(array1, array2) {
var len1 = array1.length,
len2 = array2.length,
i;
// Short circuit if the same array is passed twice
if (array1 === array2) {
return true;
}
if (len1 !== len2) {
return false;
}
for (i = 0; i < len1; ++i) {
if (array1[i] !== array2[i]) {
return false;
}
}
return true;
},
/**
* Filter through an array and remove empty item as defined in {@link Ext#isEmpty Ext.isEmpty}
*
* See {@link Ext.Array#filter}
*
* @param {Array} array
* @return {Array} results
*/
clean: function(array) {
var results = [],
i = 0,
ln = array.length,
item;
for (; i < ln; i++) {
item = array[i];
if (!Ext.isEmpty(item)) {
results.push(item);
}
}
return results;
},
/**
* Returns a new array with unique items
*
* @param {Array} array
* @return {Array} results
*/
unique: function(array) {
var clone = [],
i = 0,
ln = array.length,
item;
for (; i < ln; i++) {
item = array[i];
if (ExtArray.indexOf(clone, item) === -1) {
clone.push(item);
}
}
return clone;
},
/**
* Creates a new array with all of the elements of this array for which
* the provided filtering function returns true.
*
* @param {Array} array
* @param {Function} fn Callback function for each item
* @param {Mixed} fn.item Current item.
* @param {Number} fn.index Index of the item.
* @param {Array} fn.array The whole array that's being iterated.
* @param {Object} scope Callback function scope
* @return {Array} results
*/
filter: supportsFilter ? function(array, fn, scope) {
//<debug>
if (!fn) {
Ext.Error.raise('Ext.Array.filter must have a filter function passed as second argument.');
}
//</debug>
return array.filter(fn, scope);
} : function(array, fn, scope) {
//<debug>
if (!fn) {
Ext.Error.raise('Ext.Array.filter must have a filter function passed as second argument.');
}
//</debug>
var results = [],
i = 0,
ln = array.length;
for (; i < ln; i++) {
if (fn.call(scope, array[i], i, array)) {
results.push(array[i]);
}
}
return results;
},
/**
* Returns the first item in the array which elicits a truthy return value from the
* passed selection function.
* @param {Array} array The array to search
* @param {Function} fn The selection function to execute for each item.
* @param {Mixed} fn.item The array item.
* @param {String} fn.index The index of the array item.
* @param {Object} scope (optional) The scope (<code>this</code> reference) in which the
* function is executed. Defaults to the array
* @return {Object} The first item in the array which returned true from the selection
* function, or null if none was found.
*/
findBy : function(array, fn, scope) {
var i = 0,
len = array.length;
for (; i < len; i++) {
if (fn.call(scope || array, array[i], i)) {
return array[i];
}
}
return null;
},
/**
* Converts a value to an array if it's not already an array; returns:
*
* - An empty array if given value is `undefined` or `null`
* - Itself if given value is already an array
* - An array copy if given value is {@link Ext#isIterable iterable} (arguments, NodeList and alike)
* - An array with one item which is the given value, otherwise
*
* @param {Object} value The value to convert to an array if it's not already is an array
* @param {Boolean} newReference (Optional) True to clone the given array and return a new reference if necessary,
* defaults to false
* @return {Array} array
*/
from: function(value, newReference) {
if (value === undefined || value === null) {
return [];
}
if (Ext.isArray(value)) {
return (newReference) ? slice.call(value) : value;
}
var type = typeof value;
// Both strings and functions will have a length property. In phantomJS, NodeList
// instances report typeof=='function' but don't have an apply method...
if (value && value.length !== undefined && type !== 'string' && (type !== 'function' || !value.apply)) {
return ExtArray.toArray(value);
}
return [value];
},
/**
* Removes the specified item from the array if it exists
*
* @param {Array} array The array
* @param {Object} item The item to remove
* @return {Array} The passed array itself
*/
remove: function(array, item) {
var index = ExtArray.indexOf(array, item);
if (index !== -1) {
erase(array, index, 1);
}
return array;
},
/**
* Push an item into the array only if the array doesn't contain it yet
*
* @param {Array} array The array
* @param {Object} item The item to include
*/
include: function(array, item) {
if (!ExtArray.contains(array, item)) {
array.push(item);
}
},
/**
* Clone a flat array without referencing the previous one. Note that this is different
* from Ext.clone since it doesn't handle recursive cloning. It's simply a convenient, easy-to-remember method
* for Array.prototype.slice.call(array)
*
* @param {Array} array The array
* @return {Array} The clone array
*/
clone: function(array) {
return slice.call(array);
},
/**
* Merge multiple arrays into one with unique items.
*
* {@link Ext.Array#union} is alias for {@link Ext.Array#merge}
*
* @param {Array} array1
* @param {Array} array2
* @param {Array} etc
* @return {Array} merged
*/
merge: function() {
var args = slice.call(arguments),
array = [],
i, ln;
for (i = 0, ln = args.length; i < ln; i++) {
array = array.concat(args[i]);
}
return ExtArray.unique(array);
},
/**
* Merge multiple arrays into one with unique items that exist in all of the arrays.
*
* @param {Array} array1
* @param {Array} array2
* @param {Array} etc
* @return {Array} intersect
*/
intersect: function() {
var intersection = [],
arrays = slice.call(arguments),
arraysLength,
array,
arrayLength,
minArray,
minArrayIndex,
minArrayCandidate,
minArrayLength,
element,
elementCandidate,
elementCount,
i, j, k;
if (!arrays.length) {
return intersection;
}
// Find the smallest array
arraysLength = arrays.length;
for (i = minArrayIndex = 0; i < arraysLength; i++) {
minArrayCandidate = arrays[i];
if (!minArray || minArrayCandidate.length < minArray.length) {
minArray = minArrayCandidate;
minArrayIndex = i;
}
}
minArray = ExtArray.unique(minArray);
erase(arrays, minArrayIndex, 1);
// Use the smallest unique'd array as the anchor loop. If the other array(s) do contain
// an item in the small array, we're likely to find it before reaching the end
// of the inner loop and can terminate the search early.
minArrayLength = minArray.length;
arraysLength = arrays.length;
for (i = 0; i < minArrayLength; i++) {
element = minArray[i];
elementCount = 0;
for (j = 0; j < arraysLength; j++) {
array = arrays[j];
arrayLength = array.length;
for (k = 0; k < arrayLength; k++) {
elementCandidate = array[k];
if (element === elementCandidate) {
elementCount++;
break;
}
}
}
if (elementCount === arraysLength) {
intersection.push(element);
}
}
return intersection;
},
/**
* Perform a set difference A-B by subtracting all items in array B from array A.
*
* @param {Array} arrayA
* @param {Array} arrayB
* @return {Array} difference
*/
difference: function(arrayA, arrayB) {
var clone = slice.call(arrayA),
ln = clone.length,
i, j, lnB;
for (i = 0,lnB = arrayB.length; i < lnB; i++) {
for (j = 0; j < ln; j++) {
if (clone[j] === arrayB[i]) {
erase(clone, j, 1);
j--;
ln--;
}
}
}
return clone;
},
/**
* Returns a shallow copy of a part of an array. This is equivalent to the native
* call "Array.prototype.slice.call(array, begin, end)". This is often used when "array"
* is "arguments" since the arguments object does not supply a slice method but can
* be the context object to Array.prototype.slice.
*
* @param {Array} array The array (or arguments object).
* @param {Number} begin The index at which to begin. Negative values are offsets from
* the end of the array.
* @param {Number} end The index at which to end. The copied items do not include
* end. Negative values are offsets from the end of the array. If end is omitted,
* all items up to the end of the array are copied.
* @return {Array} The copied piece of the array.
* @method slice
*/
// Note: IE6 will return [] on slice.call(x, undefined).
slice: ([1,2].slice(1, undefined).length ?
function (array, begin, end) {
return slice.call(array, begin, end);
} :
// at least IE6 uses arguments.length for variadic signature
function (array, begin, end) {
// After tested for IE 6, the one below is of the best performance
// see http://jsperf.com/slice-fix
if (typeof begin === 'undefined') {
return slice.call(array);
}
if (typeof end === 'undefined') {
return slice.call(array, begin);
}
return slice.call(array, begin, end);
}
),
/**
* Sorts the elements of an Array.
* By default, this method sorts the elements alphabetically and ascending.
*
* @param {Array} array The array to sort.
* @param {Function} sortFn (optional) The comparison function.
* @param {Mixed} sortFn.a An item to compare.
* @param {Mixed} sortFn.b Another item to compare.
* @return {Array} The sorted array.
*/
sort: supportsSort ? function(array, sortFn) {
if (sortFn) {
return array.sort(sortFn);
} else {
return array.sort();
}
} : function(array, sortFn) {
var length = array.length,
i = 0,
comparison,
j, min, tmp;
for (; i < length; i++) {
min = i;
for (j = i + 1; j < length; j++) {
if (sortFn) {
comparison = sortFn(array[j], array[min]);
if (comparison < 0) {
min = j;
}
} else if (array[j] < array[min]) {
min = j;
}
}
if (min !== i) {
tmp = array[i];
array[i] = array[min];
array[min] = tmp;
}
}
return array;
},
/**
* Recursively flattens into 1-d Array. Injects Arrays inline.
*
* @param {Array} array The array to flatten
* @return {Array} The 1-d array.
*/
flatten: function(array) {
var worker = [];
function rFlatten(a) {
var i, ln, v;
for (i = 0, ln = a.length; i < ln; i++) {
v = a[i];
if (Ext.isArray(v)) {
rFlatten(v);
} else {
worker.push(v);
}
}
return worker;
}
return rFlatten(array);
},
/**
* Returns the minimum value in the Array.
*
* @param {Array/NodeList} array The Array from which to select the minimum value.
* @param {Function} comparisonFn (optional) a function to perform the comparision which determines minimization.
* If omitted the "<" operator will be used. Note: gt = 1; eq = 0; lt = -1
* @param {Mixed} comparisonFn.min Current minimum value.
* @param {Mixed} comparisonFn.item The value to compare with the current minimum.
* @return {Object} minValue The minimum value
*/
min: function(array, comparisonFn) {
var min = array[0],
i, ln, item;
for (i = 0, ln = array.length; i < ln; i++) {
item = array[i];
if (comparisonFn) {
if (comparisonFn(min, item) === 1) {
min = item;
}
}
else {
if (item < min) {
min = item;
}
}
}
return min;
},
/**
* Returns the maximum value in the Array.
*
* @param {Array/NodeList} array The Array from which to select the maximum value.
* @param {Function} comparisonFn (optional) a function to perform the comparision which determines maximization.
* If omitted the ">" operator will be used. Note: gt = 1; eq = 0; lt = -1
* @param {Mixed} comparisonFn.max Current maximum value.
* @param {Mixed} comparisonFn.item The value to compare with the current maximum.
* @return {Object} maxValue The maximum value
*/
max: function(array, comparisonFn) {
var max = array[0],
i, ln, item;
for (i = 0, ln = array.length; i < ln; i++) {
item = array[i];
if (comparisonFn) {
if (comparisonFn(max, item) === -1) {
max = item;
}
}
else {
if (item > max) {
max = item;
}
}
}
return max;
},
/**
* Calculates the mean of all items in the array.
*
* @param {Array} array The Array to calculate the mean value of.
* @return {Number} The mean.
*/
mean: function(array) {
return array.length > 0 ? ExtArray.sum(array) / array.length : undefined;
},
/**
* Calculates the sum of all items in the given array.
*
* @param {Array} array The Array to calculate the sum value of.
* @return {Number} The sum.
*/
sum: function(array) {
var sum = 0,
i, ln, item;
for (i = 0,ln = array.length; i < ln; i++) {
item = array[i];
sum += item;
}
return sum;
},
/**
* Creates a map (object) keyed by the elements of the given array. The values in
* the map are the index+1 of the array element. For example:
*
* var map = Ext.Array.toMap(['a','b','c']);
*
* // map = { a: 1, b: 2, c: 3 };
*
* Or a key property can be specified:
*
* var map = Ext.Array.toMap([
* { name: 'a' },
* { name: 'b' },
* { name: 'c' }
* ], 'name');
*
* // map = { a: 1, b: 2, c: 3 };
*
* Lastly, a key extractor can be provided:
*
* var map = Ext.Array.toMap([
* { name: 'a' },
* { name: 'b' },
* { name: 'c' }
* ], function (obj) { return obj.name.toUpperCase(); });
*
* // map = { A: 1, B: 2, C: 3 };
*
* @param {Array} array The Array to create the map from.
* @param {String/Function} [getKey] Name of the object property to use
* as a key or a function to extract the key.
* @param {Object} [scope] Value of this inside callback.
* @return {Object} The resulting map.
*/
toMap: function(array, getKey, scope) {
var map = {},
i = array.length;
if (!getKey) {
while (i--) {
map[array[i]] = i+1;
}
} else if (typeof getKey == 'string') {
while (i--) {
map[array[i][getKey]] = i+1;
}
} else {
while (i--) {
map[getKey.call(scope, array[i])] = i+1;
}
}
return map;
},
/**
* Creates a map (object) keyed by a property of elements of the given array. The values in
* the map are the array element. For example:
*
* var map = Ext.Array.toMap(['a','b','c']);
*
* // map = { a: 'a', b: 'b', c: 'c' };
*
* Or a key property can be specified:
*
* var map = Ext.Array.toMap([
* { name: 'a' },
* { name: 'b' },
* { name: 'c' }
* ], 'name');
*
* // map = { a: {name: 'a'}, b: {name: 'b'}, c: {name: 'c'} };
*
* Lastly, a key extractor can be provided:
*
* var map = Ext.Array.toMap([
* { name: 'a' },
* { name: 'b' },
* { name: 'c' }
* ], function (obj) { return obj.name.toUpperCase(); });
*
* // map = { A: {name: 'a'}, B: {name: 'b'}, C: {name: 'c'} };
*
* @param {Array} array The Array to create the map from.
* @param {String/Function} [getKey] Name of the object property to use
* as a key or a function to extract the key.
* @param {Object} [scope] Value of this inside callback.
* @return {Object} The resulting map.
*/
toValueMap: function(array, getKey, scope) {
var map = {},
i = array.length;
if (!getKey) {
while (i--) {
map[array[i]] = array[i];
}
} else if (typeof getKey == 'string') {
while (i--) {
map[array[i][getKey]] = array[i];
}
} else {
while (i--) {
map[getKey.call(scope, array[i])] = array[i];
}
}
return map;
},
//<debug>
_replaceSim: replaceSim, // for unit testing
_spliceSim: spliceSim,
//</debug>
/**
* Removes items from an array. This is functionally equivalent to the splice method
* of Array, but works around bugs in IE8's splice method and does not copy the
* removed elements in order to return them (because very often they are ignored).
*
* @param {Array} array The Array on which to replace.
* @param {Number} index The index in the array at which to operate.
* @param {Number} removeCount The number of items to remove at index.
* @return {Array} The array passed.
* @method
*/
erase: erase,
/**
* Inserts items in to an array.
*
* @param {Array} array The Array in which to insert.
* @param {Number} index The index in the array at which to operate.
* @param {Array} items The array of items to insert at index.
* @return {Array} The array passed.
*/
insert: function (array, index, items) {
return replace(array, index, 0, items);
},
/**
* Replaces items in an array. This is functionally equivalent to the splice method
* of Array, but works around bugs in IE8's splice method and is often more convenient
* to call because it accepts an array of items to insert rather than use a variadic
* argument list.
*
* @param {Array} array The Array on which to replace.
* @param {Number} index The index in the array at which to operate.
* @param {Number} removeCount The number of items to remove at index (can be 0).
* @param {Array} insert (optional) An array of items to insert at index.
* @return {Array} The array passed.
* @method
*/
replace: replace,
/**
* Replaces items in an array. This is equivalent to the splice method of Array, but
* works around bugs in IE8's splice method. The signature is exactly the same as the
* splice method except that the array is the first argument. All arguments following
* removeCount are inserted in the array at index.
*
* @param {Array} array The Array on which to replace.
* @param {Number} index The index in the array at which to operate.
* @param {Number} removeCount The number of items to remove at index (can be 0).
* @param {Object...} elements The elements to add to the array. If you don't specify
* any elements, splice simply removes elements from the array.
* @return {Array} An array containing the removed items.
* @method
*/
splice: splice,
/**
* Pushes new items onto the end of an Array.
*
* Passed parameters may be single items, or arrays of items. If an Array is found in the argument list, all its
* elements are pushed into the end of the target Array.
*
* @param {Array} target The Array onto which to push new items
* @param {Object...} elements The elements to add to the array. Each parameter may
* be an Array, in which case all the elements of that Array will be pushed into the end of the
* destination Array.
* @return {Array} An array containing all the new items push onto the end.
*
*/
push: function(array) {
var len = arguments.length,
i = 1,
newItem;
if (array === undefined) {
array = [];
} else if (!Ext.isArray(array)) {
array = [array];
}
for (; i < len; i++) {
newItem = arguments[i];
Array.prototype.push[Ext.isIterable(newItem) ? 'apply' : 'call'](array, newItem);
}
return array;
}
};
/**
* @method
* @member Ext
* @inheritdoc Ext.Array#each
*/
Ext.each = ExtArray.each;
/**
* @method
* @member Ext.Array
* @inheritdoc Ext.Array#merge
*/
ExtArray.union = ExtArray.merge;
/**
* Old alias to {@link Ext.Array#min}
* @deprecated 4.0.0 Use {@link Ext.Array#min} instead
* @method
* @member Ext
* @inheritdoc Ext.Array#min
*/
Ext.min = ExtArray.min;
/**
* Old alias to {@link Ext.Array#max}
* @deprecated 4.0.0 Use {@link Ext.Array#max} instead
* @method
* @member Ext
* @inheritdoc Ext.Array#max
*/
Ext.max = ExtArray.max;
/**
* Old alias to {@link Ext.Array#sum}
* @deprecated 4.0.0 Use {@link Ext.Array#sum} instead
* @method
* @member Ext
* @inheritdoc Ext.Array#sum
*/
Ext.sum = ExtArray.sum;
/**
* Old alias to {@link Ext.Array#mean}
* @deprecated 4.0.0 Use {@link Ext.Array#mean} instead
* @method
* @member Ext
* @inheritdoc Ext.Array#mean
*/
Ext.mean = ExtArray.mean;
/**
* Old alias to {@link Ext.Array#flatten}
* @deprecated 4.0.0 Use {@link Ext.Array#flatten} instead
* @method
* @member Ext
* @inheritdoc Ext.Array#flatten
*/
Ext.flatten = ExtArray.flatten;
/**
* Old alias to {@link Ext.Array#clean}
* @deprecated 4.0.0 Use {@link Ext.Array#clean} instead
* @method
* @member Ext
* @inheritdoc Ext.Array#clean
*/
Ext.clean = ExtArray.clean;
/**
* Old alias to {@link Ext.Array#unique}
* @deprecated 4.0.0 Use {@link Ext.Array#unique} instead
* @method
* @member Ext
* @inheritdoc Ext.Array#unique
*/
Ext.unique = ExtArray.unique;
/**
* Old alias to {@link Ext.Array#pluck Ext.Array.pluck}
* @deprecated 4.0.0 Use {@link Ext.Array#pluck Ext.Array.pluck} instead
* @method
* @member Ext
* @inheritdoc Ext.Array#pluck
*/
Ext.pluck = ExtArray.pluck;
/**
* @method
* @member Ext
* @inheritdoc Ext.Array#toArray
*/
Ext.toArray = function() {
return ExtArray.toArray.apply(ExtArray, arguments);
};
}());
| cnitucson/cnde | extjs4/src/lang/Array.js | JavaScript | gpl-2.0 | 48,400 |
/*
* Copyright 2013-2015 Kreogist Dev Team
*
* This file is part of Kreogist Cuties.
*
* Kreogist Cuties 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.
*
* Kreogist Cuties 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 Kreogist Cuties. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sao/knsaosubmenu.h"
#include "kcmainmenu.h"
KCMainMenu::KCMainMenu(QWidget *parent) :
KNSAOMainMenu(parent)
{
//Initial the sub menus.
initialSubMenus();
//Retranslate.
retranslate();
}
KCMainMenu::~KCMainMenu()
{
;
}
void KCMainMenu::addCategoryAction(const int &category, QAction *action)
{
m_subMenus[category]->addAction(action);
}
void KCMainMenu::retranslate()
{
m_subMenus[File]->setTitle(tr("File"));
m_subMenus[Edit]->setTitle(tr("Edit"));
m_subMenus[View]->setTitle(tr("View"));
m_subMenus[Search]->setTitle(tr("Search"));
m_subMenus[Execute]->setTitle(tr("Execute"));
m_subMenus[Debug]->setTitle(tr("Debug"));
m_subMenus[Tools]->setTitle(tr("Tools"));
m_subMenus[Tabs]->setTitle(tr("Tabs"));
m_subMenus[Help]->setTitle(tr("Help"));
}
void KCMainMenu::initialSubMenus()
{
//Initial the menu icons.
QIcon menuIcons[MenuCategoriesCount];
menuIcons[File]=QIcon("://menu/file.png");
menuIcons[Edit]=QIcon("://menu/edit.png");
menuIcons[View]=QIcon("://menu/view.png");
menuIcons[Search]=QIcon("://menu/search.png");
menuIcons[Execute]=QIcon("://menu/execute.png");
menuIcons[Debug]=QIcon("://menu/debug.png");
menuIcons[Tools]=QIcon("://menu/tools.png");
menuIcons[Tabs]=QIcon("://menu/tabs.png");
menuIcons[Help]=QIcon("://menu/help.png");
for(int i=0; i<MenuCategoriesCount; i++)
{
//Initial the menu.
m_subMenus[i]=new KNSAOSubMenu(this);
//Set properties.
m_subMenus[i]->setIcon(menuIcons[i]);
//Add menu to main menu.
addMenu(m_subMenus[i]);
}
}
| bigchestnut/Cuties | src/app/plugins/kcmainmenu/kcmainmenu.cpp | C++ | gpl-2.0 | 2,484 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="es">
<head>
<!-- Generated by javadoc (version 1.7.0_45) on Fri Nov 22 15:43:22 CST 2013 -->
<title>D-Index</title>
<meta name="date" content="2013-11-22">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="D-Index";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="../overview-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li class="navBarCell1Rev">Index</li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="index-3.html">Prev Letter</a></li>
<li><a href="index-5.html">Next Letter</a></li>
</ul>
<ul class="navList">
<li><a href="../index.html?index-filesindex-4.html" target="_top">Frames</a></li>
<li><a href="index-4.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="contentContainer"><a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">D</a> <a href="index-5.html">E</a> <a href="index-6.html">G</a> <a href="index-7.html">H</a> <a href="index-8.html">I</a> <a href="index-9.html">L</a> <a href="index-10.html">P</a> <a href="index-11.html">Q</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">V</a> <a name="_D_">
<!-- -->
</a>
<h2 class="title">D</h2>
<dl>
<dt><a href="../datastructs/doublelist/package-summary.html">datastructs.doublelist</a> - package datastructs.doublelist</dt>
<dd> </dd>
<dt><a href="../datastructs/graphs/package-summary.html">datastructs.graphs</a> - package datastructs.graphs</dt>
<dd> </dd>
<dt><a href="../datastructs/interfaces/package-summary.html">datastructs.interfaces</a> - package datastructs.interfaces</dt>
<dd> </dd>
<dt><a href="../datastructs/queue/package-summary.html">datastructs.queue</a> - package datastructs.queue</dt>
<dd> </dd>
<dt><a href="../datastructs/simplelist/package-summary.html">datastructs.simplelist</a> - package datastructs.simplelist</dt>
<dd> </dd>
<dt><a href="../datastructs/interfaces/DataStructure.html" title="interface in datastructs.interfaces"><span class="strong">DataStructure</span></a><<a href="../datastructs/interfaces/DataStructure.html" title="type parameter in DataStructure">K</a>> - Interface in <a href="../datastructs/interfaces/package-summary.html">datastructs.interfaces</a></dt>
<dd> </dd>
<dt><span class="strong"><a href="../datastructs/doublelist/DoubleList.html#delete()">delete()</a></span> - Method in class datastructs.doublelist.<a href="../datastructs/doublelist/DoubleList.html" title="class in datastructs.doublelist">DoubleList</a></dt>
<dd>
<div class="block">Method that erase the first node on the DoubleList</div>
</dd>
<dt><span class="strong"><a href="../datastructs/doublelist/DoubleList.html#delete(K)">delete(K)</a></span> - Method in class datastructs.doublelist.<a href="../datastructs/doublelist/DoubleList.html" title="class in datastructs.doublelist">DoubleList</a></dt>
<dd>
<div class="block">Method that erase an specific node on the DoubleList</div>
</dd>
<dt><span class="strong"><a href="../datastructs/interfaces/ListInterface.html#delete()">delete()</a></span> - Method in interface datastructs.interfaces.<a href="../datastructs/interfaces/ListInterface.html" title="interface in datastructs.interfaces">ListInterface</a></dt>
<dd>
<div class="block">Deletes the first element</div>
</dd>
<dt><span class="strong"><a href="../datastructs/interfaces/ListInterface.html#delete(K)">delete(K)</a></span> - Method in interface datastructs.interfaces.<a href="../datastructs/interfaces/ListInterface.html" title="interface in datastructs.interfaces">ListInterface</a></dt>
<dd>
<div class="block">deletes the element specified as a parameter</div>
</dd>
<dt><span class="strong"><a href="../datastructs/simplelist/SimpleList.html#delete()">delete()</a></span> - Method in class datastructs.simplelist.<a href="../datastructs/simplelist/SimpleList.html" title="class in datastructs.simplelist">SimpleList</a></dt>
<dd>
<div class="block">Method that is for erase the first node on the list</div>
</dd>
<dt><span class="strong"><a href="../datastructs/simplelist/SimpleList.html#delete(K)">delete(K)</a></span> - Method in class datastructs.simplelist.<a href="../datastructs/simplelist/SimpleList.html" title="class in datastructs.simplelist">SimpleList</a></dt>
<dd>
<div class="block">Method that erase a specific node on the list</div>
</dd>
<dt><span class="strong"><a href="../datastructs/simplelist/SimpleList.html#deleteHead()">deleteHead()</a></span> - Method in class datastructs.simplelist.<a href="../datastructs/simplelist/SimpleList.html" title="class in datastructs.simplelist">SimpleList</a></dt>
<dd>
<div class="block">Method that erase the head of the list</div>
</dd>
<dt><span class="strong"><a href="../datastructs/interfaces/QueueInterface.html#Dequeue()">Dequeue()</a></span> - Method in interface datastructs.interfaces.<a href="../datastructs/interfaces/QueueInterface.html" title="interface in datastructs.interfaces">QueueInterface</a></dt>
<dd>
<div class="block">Removes the last element</div>
</dd>
<dt><span class="strong"><a href="../datastructs/queue/QueueWithList.html#Dequeue()">Dequeue()</a></span> - Method in class datastructs.queue.<a href="../datastructs/queue/QueueWithList.html" title="class in datastructs.queue">QueueWithList</a></dt>
<dd> </dd>
<dt><span class="strong"><a href="../datastructs/doublelist/DoubleList.html#describe()">describe()</a></span> - Method in class datastructs.doublelist.<a href="../datastructs/doublelist/DoubleList.html" title="class in datastructs.doublelist">DoubleList</a></dt>
<dd>
<div class="block">Method that shows the information of the DoubleList</div>
</dd>
<dt><span class="strong"><a href="../datastructs/graphs/Graph.html#describe()">describe()</a></span> - Method in class datastructs.graphs.<a href="../datastructs/graphs/Graph.html" title="class in datastructs.graphs">Graph</a></dt>
<dd> </dd>
<dt><span class="strong"><a href="../datastructs/interfaces/DataStructure.html#describe()">describe()</a></span> - Method in interface datastructs.interfaces.<a href="../datastructs/interfaces/DataStructure.html" title="interface in datastructs.interfaces">DataStructure</a></dt>
<dd>
<div class="block">Describes the list.</div>
</dd>
<dt><span class="strong"><a href="../datastructs/simplelist/SimpleList.html#describe()">describe()</a></span> - Method in class datastructs.simplelist.<a href="../datastructs/simplelist/SimpleList.html" title="class in datastructs.simplelist">SimpleList</a></dt>
<dd>
<div class="block">Method that describe the simple list</div>
</dd>
<dt><span class="strong"><a href="../GraphTester.html#describe(datastructs.graphs.Graph)">describe(Graph<String>)</a></span> - Method in class <a href="../GraphTester.html" title="class in <Unnamed>">GraphTester</a></dt>
<dd> </dd>
<dt><a href="../datastructs/graphs/Dijkstra.html" title="class in datastructs.graphs"><span class="strong">Dijkstra</span></a><<a href="../datastructs/graphs/Dijkstra.html" title="type parameter in Dijkstra">K</a>> - Class in <a href="../datastructs/graphs/package-summary.html">datastructs.graphs</a></dt>
<dd> </dd>
<dt><span class="strong"><a href="../datastructs/graphs/Dijkstra.html#Dijkstra(K, K, datastructs.graphs.Graph)">Dijkstra(K, K, Graph<K>)</a></span> - Constructor for class datastructs.graphs.<a href="../datastructs/graphs/Dijkstra.html" title="class in datastructs.graphs">Dijkstra</a></dt>
<dd> </dd>
<dt><a href="../projectstructures/Domain.html" title="class in projectstructures"><span class="strong">Domain</span></a><<a href="../projectstructures/Domain.html" title="type parameter in Domain">K</a>> - Class in <a href="../projectstructures/package-summary.html">projectstructures</a></dt>
<dd> </dd>
<dt><span class="strong"><a href="../projectstructures/Domain.html#Domain()">Domain()</a></span> - Constructor for class projectstructures.<a href="../projectstructures/Domain.html" title="class in projectstructures">Domain</a></dt>
<dd>
<div class="block">The constructor will initialize the variables and set the Domain's IP
using the current machine IP.</div>
</dd>
<dt><a href="../DomainAndRegionTester.html" title="class in <Unnamed>"><span class="strong">DomainAndRegionTester</span></a> - Class in <a href="../package-summary.html"><Unnamed></a></dt>
<dd> </dd>
<dt><span class="strong"><a href="../DomainAndRegionTester.html#DomainAndRegionTester()">DomainAndRegionTester()</a></span> - Constructor for class <a href="../DomainAndRegionTester.html" title="class in <Unnamed>">DomainAndRegionTester</a></dt>
<dd> </dd>
<dt><a href="../datastructs/doublelist/DoubleList.html" title="class in datastructs.doublelist"><span class="strong">DoubleList</span></a><<a href="../datastructs/doublelist/DoubleList.html" title="type parameter in DoubleList">K</a>> - Class in <a href="../datastructs/doublelist/package-summary.html">datastructs.doublelist</a></dt>
<dd> </dd>
<dt><span class="strong"><a href="../datastructs/doublelist/DoubleList.html#DoubleList()">DoubleList()</a></span> - Constructor for class datastructs.doublelist.<a href="../datastructs/doublelist/DoubleList.html" title="class in datastructs.doublelist">DoubleList</a></dt>
<dd> </dd>
<dt><a href="../datastructs/doublelist/DoubleListNode.html" title="class in datastructs.doublelist"><span class="strong">DoubleListNode</span></a><<a href="../datastructs/doublelist/DoubleListNode.html" title="type parameter in DoubleListNode">K</a>> - Class in <a href="../datastructs/doublelist/package-summary.html">datastructs.doublelist</a></dt>
<dd> </dd>
<dt><span class="strong"><a href="../datastructs/doublelist/DoubleListNode.html#DoubleListNode(K)">DoubleListNode(K)</a></span> - Constructor for class datastructs.doublelist.<a href="../datastructs/doublelist/DoubleListNode.html" title="class in datastructs.doublelist">DoubleListNode</a></dt>
<dd> </dd>
<dt><span class="strong"><a href="../datastructs/doublelist/DoubleListNode.html#DoubleListNode(K, datastructs.doublelist.DoubleListNode)">DoubleListNode(K, DoubleListNode<K>)</a></span> - Constructor for class datastructs.doublelist.<a href="../datastructs/doublelist/DoubleListNode.html" title="class in datastructs.doublelist">DoubleListNode</a></dt>
<dd> </dd>
</dl>
<a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">D</a> <a href="index-5.html">E</a> <a href="index-6.html">G</a> <a href="index-7.html">H</a> <a href="index-8.html">I</a> <a href="index-9.html">L</a> <a href="index-10.html">P</a> <a href="index-11.html">Q</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">V</a> </div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="../overview-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li class="navBarCell1Rev">Index</li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="index-3.html">Prev Letter</a></li>
<li><a href="index-5.html">Next Letter</a></li>
</ul>
<ul class="navList">
<li><a href="../index.html?index-filesindex-4.html" target="_top">Frames</a></li>
<li><a href="index-4.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| Zyoruk/3rdProject | doc/index-files/index-4.html | HTML | gpl-2.0 | 13,604 |
package com.larry.da.test
import org.apache.spark.SparkContext
import com.larry.da.util.{LogParseUtil => U}
import scala.collection.immutable.HashMap
import scala.collection.mutable.ArrayBuffer
/**
* Created by larry on 19/2/16.
*/
object test {
import scala.reflect.runtime.universe._
def tt(): Unit ={
var url="http://www.baidu.com"
val host = url.replaceAll("(^http(s)?:\\/\\/)?", "").replaceAll("\\/.*$|\\?.*$|:.*$", "").toLowerCase();
val regex = """([\w-]+(\.(com|net|org|gov|me|name|edu|info|tel|mobi|tv|cc|biz|asia|so|co))?(\.(cn|hk|us|sg|jp|in|pw|am|ph|tj))?)$""".r
val m = regex.findFirstIn(host)
}
def getUvPv(sc: SparkContext, channel: String, time: String, dtype: String): Unit = {
// import com.agrantsem.dm.util.{ LogParseUtil => U }
val rdd = U.dspRdd(sc, "bidder", channel, time)
val bidderFields = "url,agUserId,ads".split(",")
val bidder = rdd.map(x => {
val d = U.bidderLog(x);
val Array(url, uid, ads) = bidderFields.map(k => { val v = d.getOrElse(k, ""); if (v == "null") "" else v })
val domain = "" //if (dtype.equals("first")) U.getFirtDomainFromUrl(url) else U.getSecondDominFromUrl(url)
((domain,uid), (if (ads.contains("mid")) 1 else 0, 1))
}).reduceByKey((a,b)=>(a._1 + b._1,a._2 + b._2))
val res = bidder.map(x=>{
val((domain,uid),(pvmid,pv)) = x;
(domain,(pvmid,if(pvmid>0)1 else 0,pv,1))
}).reduceByKey((a,b)=>(a._1+b._1,a._2+b._2,a._3+b._3,a._4 + b._4))
}
}
object testHashMap extends App{
import com.larry.da.util.Timed
import scala.collection.mutable.HashMap
val hashMap = HashMap(1.toLong -> 1.toLong)
0 to 300 foreach(i => println( Timed.timed{ 0 to 200000 foreach(x=>hashMap += (x*i.toLong -> x*i.toLong) ); }) )
}
| larry88/spark_da | src/main/scala/com/larry/da/test/test.scala | Scala | gpl-2.0 | 1,773 |
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="fr">
<context>
<name>AmmoSchemeModel</name>
<message>
<source>new</source>
<translation>جديد</translation>
</message>
<message>
<source>copy of</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FreqSpinBox</name>
<message>
<source>Never</source>
<translation>ابدا</translation>
</message>
<message numerus="yes">
<source>Every %1 turn</source>
<translation type="unfinished">
<numerusform>كل %1 دور
</numerusform>
<numerusform></numerusform>
</translation>
</message>
</context>
<context>
<name>GameCFGWidget</name>
<message>
<source>Edit weapons</source>
<translation>تغيير سلاح</translation>
</message>
<message>
<source>Error</source>
<translation>خطأ</translation>
</message>
<message>
<source>Illegal ammo scheme</source>
<translation>نظام اسلحة غير صحيح</translation>
</message>
<message>
<source>Edit schemes</source>
<translation>Edit schemes</translation>
</message>
<message>
<source>When this option is enabled selecting a game scheme will auto-select a weapon</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>HWChatWidget</name>
<message>
<source>%1 *** %2 has been removed from your ignore list</source>
<translation>%1 *** %2 تم حذفة من قائمة الترك</translation>
</message>
<message>
<source>%1 *** %2 has been added to your ignore list</source>
<translation>%1 *** %2 تم اضافته الى قائمة النرك</translation>
</message>
<message>
<source>%1 *** %2 has been removed from your friends list</source>
<translation>%1 *** %2 تم حذقه الى قائمة الاصدقاء</translation>
</message>
<message>
<source>%1 *** %2 has been added to your friends list</source>
<translation>%1 *** %2 تم حذفة من قائمة الاصدقاء</translation>
</message>
</context>
<context>
<name>HWForm</name>
<message>
<source>new</source>
<translation type="obsolete">جديد</translation>
</message>
<message>
<source>Error</source>
<translation>خطا</translation>
</message>
<message>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<source>Unable to start the server</source>
<translation>لم اتمكن من بدا الخادم</translation>
</message>
<message>
<source>Cannot save record to file %1</source>
<translation>لم اتمكن من حقظ الملف %1</translation>
</message>
<message>
<source>Please select record from the list above</source>
<translation>اختار من القائمة</translation>
</message>
<message>
<source>DefaultTeam</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Hedgewars Demo File</source>
<comment>File Types</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Hedgewars Save File</source>
<comment>File Types</comment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>HWGame</name>
<message>
<source>en.txt</source>
<translation type="unfinished">ar.txt</translation>
</message>
<message>
<source>Cannot open demofile %1</source>
<translation>لم اتمكن من حفظ ملف اللعب %1</translation>
</message>
</context>
<context>
<name>HWMapContainer</name>
<message>
<source>Map</source>
<translation>خارطة</translation>
</message>
<message>
<source>Themes</source>
<translation>نمط</translation>
</message>
<message>
<source>Filter</source>
<translation>فلنر</translation>
</message>
<message>
<source>All</source>
<translation>كل</translation>
</message>
<message>
<source>Small</source>
<translation>صغير</translation>
</message>
<message>
<source>Medium</source>
<translation>متوسط</translation>
</message>
<message>
<source>Large</source>
<translation>كبير</translation>
</message>
<message>
<source>Cavern</source>
<translation>كهف</translation>
</message>
<message>
<source>Wacky</source>
<translation>تعبان</translation>
</message>
<message>
<source>Type</source>
<translation type="unfinished">نوع</translation>
</message>
<message>
<source>Small tunnels</source>
<translation type="unfinished">انقاق صغيرة</translation>
</message>
<message>
<source>Medium tunnels</source>
<translation type="unfinished">انفاق متوسطة</translation>
</message>
<message>
<source>Large tunnels</source>
<translation type="unfinished">انفاق كبيرة</translation>
</message>
<message>
<source>Small floating islands</source>
<translation type="unfinished">جزر طائفة صغيرة</translation>
</message>
<message>
<source>Medium floating islands</source>
<translation type="unfinished">جزر طائفة متوسطة</translation>
</message>
<message>
<source>Large floating islands</source>
<translation type="unfinished">جزر طائفة كبيرة</translation>
</message>
<message>
<source>Seed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Set</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>HWNetServersModel</name>
<message>
<source>Title</source>
<translation>عنوان</translation>
</message>
<message>
<source>IP</source>
<translation>IP</translation>
</message>
<message>
<source>Port</source>
<translation>Port</translation>
</message>
</context>
<context>
<name>HWNewNet</name>
<message>
<source>The host was not found. Please check the host name and port settings.</source>
<translation type="unfinished">الحاسوب لم يوجد. تأكد من الاعدادات</translation>
</message>
<message>
<source>Connection refused</source>
<translation>الاتصال رفض</translation>
</message>
<message>
<source>Room destroyed</source>
<translation>الغرفة اغلقت</translation>
</message>
<message>
<source>Quit reason: </source>
<translation type="unfinished">سبب الخروج</translation>
</message>
<message>
<source>You got kicked</source>
<translation>تم طردك</translation>
</message>
<message>
<source>Password</source>
<translation>كلمة السر</translation>
</message>
<message>
<source>Your nickname %1 is
registered on Hedgewars.org
Please provide your password
or pick another nickname:</source>
<translation type="obsolete">اسمك %1
سجلت على Hedgewars.org
اعطي كلمة السر
او اختر اسم ثاني</translation>
</message>
<message>
<source>%1 *** %2 has joined the room</source>
<translation>%1 *** %2 انضم للغرفة</translation>
</message>
<message>
<source>%1 *** %2 has joined</source>
<translation>%1 *** %2 انضم</translation>
</message>
<message>
<source>%1 *** %2 has left (%3)</source>
<translation>%1 *** %2 خرج (%3)</translation>
</message>
<message>
<source>%1 *** %2 has left</source>
<translation>%1 *** %2 خرج</translation>
</message>
<message>
<source>Your nickname %1 is
registered on Hedgewars.org
Please provide your password below
or pick another nickname in game config:</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>KB</name>
<message>
<source>SDL_ttf returned error while rendering text, most propably it is related to the bug in freetype2. It's recommended to update your freetype lib.</source>
<translation>SDL_ttf returned error while rendering text, most propably it is related to the bug in freetype2. It's recommended to update your freetype lib.</translation>
</message>
</context>
<context>
<name>PageAdmin</name>
<message>
<source>Server message:</source>
<translation type="obsolete">Server message:</translation>
</message>
<message>
<source>Set message</source>
<translation type="obsolete">Set message</translation>
</message>
<message>
<source>Clear Accounts Cache</source>
<translation>Clear Accounts Cache</translation>
</message>
<message>
<source>Fetch data</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server message for latest version:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server message for previous versions:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Latest version protocol number:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>MOTD preview:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Set data</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PageConnecting</name>
<message>
<source>Connecting...</source>
<translation type="unfinished">جاري الاتصال</translation>
</message>
</context>
<context>
<name>PageDrawMap</name>
<message>
<source>Undo</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Clear</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Load</source>
<translation type="unfinished">تحميل</translation>
</message>
<message>
<source>Save</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Load drawn map</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Drawn Maps (*.hwmap);;All files (*.*)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Save drawn map</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PageEditTeam</name>
<message>
<source>General</source>
<translation>عام</translation>
</message>
<message>
<source>Advanced</source>
<translation>متقدم</translation>
</message>
</context>
<context>
<name>PageGameStats</name>
<message>
<source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
<translation type="obsolete"><p>افضل ضربة كانت من قبل <b>%1</b> with <b>%2</b> pts.</p></translation>
</message>
<message>
<source><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
<translation type="obsolete"><p>افضل لاعب هو <b>%1</b> with <b>%2</b> kills in a turn.</p>
</translation>
</message>
<message>
<source><p>A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
<translation type="obsolete"><p>المجموع<b>%1</b> من اللاعبين قضوا في اللعبة.</p>
</translation>
</message>
<message>
<source>Details</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Health graph</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ranking</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<source>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<source>A total of <b>%1</b> hedgehog(s) were killed during this round.</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<source>(%1 kill)</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<source><b>%1</b> thought it's good to shoot his own hedgehogs with <b>%2</b> pts.</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<source><b>%1</b> killed <b>%2</b> of his own hedgehogs.</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<source><b>%1</b> was scared and skipped turn <b>%2</b> times.</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
</context>
<context>
<name>PageMain</name>
<message>
<source>Local Game (Play a game on a single computer)</source>
<translation>لعبة محلية</translation>
</message>
<message>
<source>Network Game (Play a game across a network)</source>
<translation>لعبة شبكية (عن طريق شبكة اتصال)</translation>
</message>
<message>
<source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Some weapons might do only low damage but they can be a lot more devastating in the right situation. Try to use the Desert Eagle to knock multiple hedgehogs into the water.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>If you're unsure what to do and don't want to waste ammo, skip one round. But don't let too much time pass as there will be Sudden Death!</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>If you'd like to keep others from using your preferred nickname on the official server, register an account at http://www.hedgewars.org/.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>You're bored of default gameplay? Try one of the missions - they'll offer different gameplay depending on the one you picked.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>By default the game will always record the last game played as a demo. Select 'Local Game' and pick the 'Demos' button on the lower right corner to play or manage them.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Hedgewars is Open Source and Freeware we create in our spare time. If you've got problems, ask on our forums but please don't expect 24/7 support!</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Hedgewars is Open Source and Freeware we create in our spare time. If you like it, help us with a small donation or contribute your own work!</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Hedgewars is Open Source and Freeware we create in our spare time. Share it with your family and friends as you like!</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Hedgewars is Open Source and Freeware we create in our spare time. If someone sold you the game, you should try get a refund!</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>From time to time there will be official tournaments. Upcoming events will be announced at http://www.hedgewars.org/ some days in advance.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Hedgewars is available in many languages. If the translation in your language seems to be missing or outdated, feel free to contact us!</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Hedgewars can be run on lots of different operating systems including Microsoft Windows, Mac OS X and Linux.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Always remember you're able to set up your own games in local and network/online play. You're not restricted to the 'Simple Game' option.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Connect one or more gamepads before starting the game to be able to assign their controls to your teams.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Create an account on %1 to keep others from using your most favourite nickname while playing on the official server.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>While playing you should give yourself a short break at least once an hour.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>If your graphics card isn't able to provide hardware accelerated OpenGL, try to enable the low quality mode to improve performance.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>If your graphics card isn't able to provide hardware accelerated OpenGL, try to update the associated drivers.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>We're open to suggestions and constructive feedback. If you don't like something or got a great idea, let us know!</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Especially while playing online be polite and always remember there might be some minors playing with or against you as well!</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Special game modes such as 'Vampirism' or 'Karma' allow you to develop completely new tactics. Try them in a custom game!</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>You should never install Hedgewars on computers you don't own (school, university, work, etc.). Please ask the responsible person instead!</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Hedgewars can be perfect for short games during breaks. Just ensure you don't add too many hedgehogs or use an huge map. Reducing time and health might help as well.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>No hedgehogs were harmed in making this game.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>There are three different jumps available. Tap [high jump] twice to do a very high/backwards jump.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Afraid of falling off a cliff? Hold down [precise] to turn [left] or [right] without actually moving.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Some weapons require special strategies or just lots of training, so don't give up on a particular tool if you miss an enemy once.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Most weapons won't work once they touch the water. The Homing Bee as well as the Cake are exceptions to this.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>The Old Limbuger only causes a small explosion. However the wind affected smelly cloud can poison lots of hogs at once.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>The Piano Strike is the most damaging air strike. You'll lose the hedgehog performing it, so there's a huge downside as well.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sticky Mines are a perfect tool to create small chain reactions knocking enemy hedgehogs into dire situations ... or water.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>The Hammer is most effective when used on bridges or girders. Hit hogs will just break through the ground.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>If you're stuck behind an enemy hedgehog, use the Hammer to free yourself without getting damaged by an explosion.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>The Cake's maximum walking distance depends on the ground it has to pass. Use [attack] to detonate it early.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>The Flame Thrower is a weapon but it can be used for tunnel digging as well.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Want to know who's behind the game? Click on the Hedgewars logo in the main menu to see the credits.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Like Hedgewars? Become a fan on %1 or follow us on %2!</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Feel free to draw your own graves, hats, flags or even maps and themes! But note that you'll have to share them somewhere to use them online.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Really want to wear a specific hat? Donate to us and receive an exclusive hat of your choice!</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Keep your video card drivers up to date to avoid issues playing the game.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>You can find your Hedgewars configuration files under "My Documents\Hedgewars". Create backups or take the files with you, but don't edit them by hand.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>You're able to associate Hedgewars related files (savegames and demo recordings) with the game to launch them right from your favorite file or internet browser.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Want to save ropes? Release the rope in mid air and then shoot again. As long as you don't touch the ground you'll reuse your rope without wasting ammo!</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>You can find your Hedgewars configuration files under "Library/Application Support/Hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>You can find your Hedgewars configuration files under ".hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>The Windows version of Hedgewars supports Xfire. Make sure to add Hedgewars to its game list so your friends can see you playing.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>The Homing Bee can be tricky to use. Its turn radius depends on it's velocity, so try to not use full power.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Use the Molotov or Flame Thrower to temporary keep hedgehogs from passing terrain such as tunnels or platforms.</source>
<comment>Tips</comment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PageMultiplayer</name>
<message>
<source>Start</source>
<translation>ابدا</translation>
</message>
</context>
<context>
<name>PageNet</name>
<message>
<source>Error</source>
<translation>خطا</translation>
</message>
<message>
<source>Please select server from the list above</source>
<translation>اختار من القائمة</translation>
</message>
</context>
<context>
<name>PageNetGame</name>
<message>
<source>Control</source>
<translation>تحكم</translation>
</message>
</context>
<context>
<name>PageNetType</name>
<message>
<source>LAN game</source>
<translation>لعبة شبكية</translation>
</message>
<message>
<source>Official server</source>
<translation>الخادم الرسمي</translation>
</message>
</context>
<context>
<name>PageOptions</name>
<message>
<source>New team</source>
<translation>فريق جديد</translation>
</message>
<message>
<source>Edit team</source>
<translation>تغيير فريق</translation>
</message>
<message>
<source>Delete team</source>
<translation>حذف فريق</translation>
</message>
<message>
<source>New weapon scheme</source>
<translation type="obsolete">طريقة اسلحة جديدة</translation>
</message>
<message>
<source>Edit weapon scheme</source>
<translation type="obsolete">تغيير طريقة الاسلحة</translation>
</message>
<message>
<source>Delete weapon scheme</source>
<translation type="obsolete">حذف طريقة الاسلحة</translation>
</message>
<message>
<source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>New scheme</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Edit scheme</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Delete scheme</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>New weapon set</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Edit weapon set</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Delete weapon set</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PagePlayDemo</name>
<message>
<source>Error</source>
<translation>خطأ</translation>
</message>
<message>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<source>Rename dialog</source>
<translation>تغيير الشباك</translation>
</message>
<message>
<source>Enter new file name:</source>
<translation type="unfinished">ادخل اسم الملف</translation>
</message>
<message>
<source>Cannot rename to</source>
<translation>لا استطيع التغيير الى</translation>
</message>
<message>
<source>Cannot delete file</source>
<translation>لا استطيع حذف الملف</translation>
</message>
<message>
<source>Please select record from the list</source>
<translation>اختر المقطع من القائمة</translation>
</message>
</context>
<context>
<name>PageRoomsList</name>
<message>
<source>Create</source>
<translation>اصنع</translation>
</message>
<message>
<source>Join</source>
<translation>انضم</translation>
</message>
<message>
<source>Refresh</source>
<translation>تحديث</translation>
</message>
<message>
<source>Error</source>
<translation>خطأ</translation>
</message>
<message>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<source>Admin features</source>
<translation>الادارة</translation>
</message>
<message>
<source>Room Name:</source>
<translation type="unfinished">رقم الغرقة</translation>
</message>
<message>
<source>This game is in lobby.
You may join and start playing once the game starts.</source>
<translation>هذه غرقة اللعب
يمكنك الانضمام و بدء اللعب عند الاتضمام الى غرفة
You may join and start playing once the game starts.</translation>
</message>
<message>
<source>This game is in progress.
You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
<translation type="unfinished">اللعبة قيد اللعب
يمكنك الانضمام و المشاهدة</translation>
</message>
<message>
<source>%1 is the host. He may adjust settings and start the game.</source>
<translation type="unfinished">%1هو المضيف الذي يبدا و يغيير اعدادات اللعبة</translation>
</message>
<message>
<source>Random Map</source>
<translation>خارطة عشوائية</translation>
</message>
<message>
<source>Games may be played on precreated or randomized maps.</source>
<translation type="unfinished">اللعبة يمكن ان تكون على خارطة عشوائية او يدوية</translation>
</message>
<message>
<source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
<translation type="unfinished">طراز اللعية يحدد الخيارات مثل وقت الجولة، الموت المفاجئ و مصاص الدماء</translation>
</message>
<message>
<source>The Weapon Scheme defines available weapons and their ammunition count.</source>
<translation type="unfinished">طراز الاسلحة يحدد المتوفرة منها و عددها</translation>
</message>
<message numerus="yes">
<source>There are %1 clients connected to this room.</source>
<translation type="unfinished">
<numerusform>يوجد %1 مرتبطون بالغرقة
</numerusform>
<numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<source>There are %1 teams participating in this room.</source>
<translation type="unfinished">
<numerusform>يوجد %1 فريق في الغرفة
</numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
<source>Please enter room name</source>
<translation>ادخل رقم الغرقة</translation>
</message>
<message>
<source>Please select room from the list</source>
<translation>اختر الغرقة من القائمة</translation>
</message>
<message>
<source>Random Maze</source>
<translation type="unfinished">متاهة عشوائية</translation>
</message>
<message>
<source>State:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Rules:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Weapons:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Search:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Clear</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The game you are trying to join has started.
Do you still want to join the room?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PageScheme</name>
<message>
<source>Defend your fort and destroy the opponents, two team colours max!</source>
<translation type="unfinished">دافع عن القلعة و دمر الاعداء. فريقان الحد الاقصى</translation>
</message>
<message>
<source>Teams will start on opposite sides of the terrain, two team colours max!</source>
<translation type="unfinished">الفرق تبدا في مكانين متقابلين. فريقان الحد الاقصى</translation>
</message>
<message>
<source>Land can not be destroyed!</source>
<translation type="unfinished">الارض لا يمكن ان تدمر</translation>
</message>
<message>
<source>Add an indestructable border around the terrain</source>
<translation>اضف اطار لا يمكن تدميره</translation>
</message>
<message>
<source>Lower gravity</source>
<translation>جاذبية قليلة</translation>
</message>
<message>
<source>Assisted aiming with laser sight</source>
<translation>منظار ليزري</translation>
</message>
<message>
<source>All hogs have a personal forcefield</source>
<translation>كل اللاعبين لهم حقل قوى</translation>
</message>
<message>
<source>Enable random mines</source>
<translation type="obsolete">فعل الالغام العشوائية</translation>
</message>
<message>
<source>Gain 80% of the damage you do back in health</source>
<translation>احصل على 80% من التدمير في صحتك</translation>
</message>
<message>
<source>Share your opponents pain, share their damage</source>
<translation>شارك في صحة عدوك</translation>
</message>
<message>
<source>Your hogs are unable to move, put your artillery skills to the test</source>
<translation>الاعبين لا يمكنهم التحرك</translation>
</message>
<message>
<source>Random</source>
<translation>عشوائي</translation>
</message>
<message>
<source>Seconds</source>
<translation>ثواني</translation>
</message>
<message>
<source>New</source>
<translation>جديد</translation>
</message>
<message>
<source>Delete</source>
<translation>حذف</translation>
</message>
<message>
<source>Order of play is random instead of in room order.</source>
<translation type="unfinished">تسلسل اللعب عشواي</translation>
</message>
<message>
<source>Play with a King. If he dies, your side dies.</source>
<translation type="unfinished">اذا مات الملك، خسر الفريق</translation>
</message>
<message>
<source>Take turns placing your hedgehogs before the start of play.</source>
<translation type="unfinished">ضع لاعبين بالادوار قبل اللعب</translation>
</message>
<message>
<source>Ammo is shared between all teams that share a colour.</source>
<translation type="unfinished">العتاد مشترك</translation>
</message>
<message>
<source>Disable girders when generating random maps.</source>
<translation type="unfinished">ابطال البناء</translation>
</message>
<message>
<source>Disable land objects when generating random maps.</source>
<translation type="unfinished">ابطال الاجسام الساقطة</translation>
</message>
<message>
<source>All (living) hedgehogs are fully restored at the end of turn</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>AI respawns on death.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Attacking does not end your turn.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Weapons are reset to starting values each turn.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Each hedgehog has its own ammo. It does not share with the team.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>You will not have to worry about wind anymore.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wind will affect almost everything.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copy</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PageSelectWeapon</name>
<message>
<source>Default</source>
<translation>التلقائي</translation>
</message>
<message>
<source>Delete</source>
<translation>حذف</translation>
</message>
<message>
<source>New</source>
<translation type="unfinished">جديد</translation>
</message>
<message>
<source>Copy</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PageSinglePlayer</name>
<message>
<source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
<translation>لعية بسيطة ضد الحاسوب</translation>
</message>
<message>
<source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
<translation>لعبة متعددة</translation>
</message>
<message>
<source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
<translation>نمط التدريب، تحت التطوير</translation>
</message>
<message>
<source>Demos (Watch recorded demos)</source>
<translation>عرض</translation>
</message>
<message>
<source>Load (Load a previously saved game)</source>
<translation>تحميل</translation>
</message>
<message>
<source>Campaign Mode (...). IN DEVELOPMENT</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QAction</name>
<message>
<source>Kick</source>
<translation>ارفس</translation>
</message>
<message>
<source>Info</source>
<translation>معلومات</translation>
</message>
<message>
<source>Start</source>
<translation>ابدا</translation>
</message>
<message>
<source>Restrict Joins</source>
<translation>امنع الانضمام</translation>
</message>
<message>
<source>Restrict Team Additions</source>
<translation>امنع اضافات الفرق</translation>
</message>
<message>
<source>Ban</source>
<translation>امنع</translation>
</message>
<message>
<source>Follow</source>
<translation>اتبع</translation>
</message>
<message>
<source>Ignore</source>
<translation>اهمل</translation>
</message>
<message>
<source>Add friend</source>
<translation>اضف صديق</translation>
</message>
<message>
<source>Unignore</source>
<translation>حذف الاهمال</translation>
</message>
<message>
<source>Remove friend</source>
<translation>امحي صديق</translation>
</message>
</context>
<context>
<name>QCheckBox</name>
<message>
<source>Check for updates at startup</source>
<translation>تحرى عن التحديثات</translation>
</message>
<message>
<source>Fullscreen</source>
<translation type="unfinished">ملء الشاشة</translation>
</message>
<message>
<source>Frontend fullscreen</source>
<translation>شاشة القائمة ملء العرض</translation>
</message>
<message>
<source>Enable sound</source>
<translation>فعل الصوت</translation>
</message>
<message>
<source>Enable music</source>
<translation>فعل الموسيقى</translation>
</message>
<message>
<source>Show FPS</source>
<translation>اضهر عدد الاطارات في الثانية</translation>
</message>
<message>
<source>Alternative damage show</source>
<translation>عرض الدمار</translation>
</message>
<message>
<source>Append date and time to record file name</source>
<translation>اضف التاريخ و اليوم الى الملف</translation>
</message>
<message>
<source>Reduced quality</source>
<translation type="obsolete">قلل الجودة</translation>
</message>
<message>
<source>Show ammo menu tooltips</source>
<translation>اضهر قوائم للعتاد</translation>
</message>
<message>
<source>Enable frontend sounds</source>
<translation>فعل اصوات شاشة المقدمة</translation>
</message>
<message>
<source>Enable frontend music</source>
<translation>فعل موسيقى شاشة المقدمة</translation>
</message>
<message>
<source>Frontend effects</source>
<translation>تأثيرات المقدمة</translation>
</message>
</context>
<context>
<name>QComboBox</name>
<message>
<source>generated map...</source>
<translation type="unfinished">ولد خارطة</translation>
</message>
<message>
<source>Human</source>
<translation>انسان</translation>
</message>
<message>
<source>Level</source>
<translation type="unfinished">مرحلة</translation>
</message>
<message>
<source>(System default)</source>
<translation>نمط النظام</translation>
</message>
<message>
<source>Mission</source>
<translation>مهمة</translation>
</message>
<message>
<source>generated maze...</source>
<translation type="unfinished">ولد متاهة</translation>
</message>
<message>
<source>Community</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Any</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>In lobby</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>In progress</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Default</source>
<translation type="obsolete">التلقائي</translation>
</message>
<message>
<source>hand drawn map...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Disabled</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Red/Cyan</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cyan/Red</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Red/Blue</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Blue/Red</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Red/Green</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Green/Red</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Side-by-side</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Top-Bottom</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wiggle</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QGroupBox</name>
<message>
<source>Team Members</source>
<translation>اعضاء الفريق</translation>
</message>
<message>
<source>Fort</source>
<translation>حصن</translation>
</message>
<message>
<source>Key binds</source>
<translation>ربط المفاتيج</translation>
</message>
<message>
<source>Teams</source>
<translation>فرق</translation>
</message>
<message>
<source>Weapons</source>
<translation type="obsolete">اسلحة</translation>
</message>
<message>
<source>Audio/Graphic options</source>
<translation>قوائم الصوتيات و المرئيات</translation>
</message>
<message>
<source>Net game</source>
<translation>لعبة شبكية</translation>
</message>
<message>
<source>Playing teams</source>
<translation>فرق اللعب</translation>
</message>
<message>
<source>Game Modifiers</source>
<translation>مغيرات اللعبة</translation>
</message>
<message>
<source>Basic Settings</source>
<translation>اعدادات الاساسية</translation>
</message>
<message>
<source>Team Settings</source>
<translation>اعدادات الفريق</translation>
</message>
<message>
<source>Misc</source>
<translation>متنوعة</translation>
</message>
<message>
<source>Schemes and Weapons</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QLabel</name>
<message>
<source>Mines Time</source>
<translation>وقت اللغم</translation>
</message>
<message>
<source>Mines</source>
<translation>الغام</translation>
</message>
<message>
<source>Version</source>
<translation>نسخة</translation>
</message>
<message>
<source>This program is distributed under the GNU General Public License</source>
<translation>This program is distributed under the GNU General Public License</translation>
</message>
<message>
<source>Developers:</source>
<translation type="unfinished">المطورون</translation>
</message>
<message>
<source>Art:</source>
<translation type="unfinished">قنون</translation>
</message>
<message>
<source>Sounds:</source>
<translation type="unfinished">الاصوات</translation>
</message>
<message>
<source>Translations:</source>
<translation type="unfinished">المترجمون</translation>
</message>
<message>
<source>Special thanks:</source>
<translation type="unfinished">شكر خاص</translation>
</message>
<message>
<source>Weapons</source>
<translation>اسلحة</translation>
</message>
<message>
<source>Host:</source>
<translation>Host:</translation>
</message>
<message>
<source>Port:</source>
<translation>Port:</translation>
</message>
<message>
<source>Net nick</source>
<translation>اسم اللاعب</translation>
</message>
<message>
<source>Resolution</source>
<translation>الوضوح</translation>
</message>
<message>
<source>FPS limit</source>
<translation>حد الاقصى لعدد الاطر في الثانية</translation>
</message>
<message>
<source>Server name:</source>
<translation type="unfinished">اسم الخادم</translation>
</message>
<message>
<source>Server port:</source>
<translation>Server port:</translation>
</message>
<message>
<source>Initial sound volume</source>
<translation>ارتقاع الصوت</translation>
</message>
<message>
<source>Damage Modifier</source>
<translation>مغير الدمار</translation>
</message>
<message>
<source>Turn Time</source>
<translation>وقت الجولة</translation>
</message>
<message>
<source>Initial Health</source>
<translation>الصحة الاولية</translation>
</message>
<message>
<source>Sudden Death Timeout</source>
<translation>وقت الموت المفاجئ</translation>
</message>
<message>
<source>Scheme Name:</source>
<translation type="unfinished">اسم النمط:</translation>
</message>
<message>
<source>Crate Drops</source>
<translation>المساعدات</translation>
</message>
<message>
<source>Game scheme</source>
<translation>نمط اللعبة</translation>
</message>
<message>
<source>% Dud Mines</source>
<translation>% الغام</translation>
</message>
<message>
<source>Name</source>
<translation>اسم</translation>
</message>
<message>
<source>Type</source>
<translation>نوع</translation>
</message>
<message>
<source>Grave</source>
<translation>تابوت</translation>
</message>
<message>
<source>Flag</source>
<translation>علم</translation>
</message>
<message>
<source>Voice</source>
<translation>صوت</translation>
</message>
<message>
<source>Locale</source>
<translation>محلي</translation>
</message>
<message>
<source>Restart game to apply</source>
<translation>اعد تشغيل اللعبة لتفعيل التغيير</translation>
</message>
<message>
<source>Explosives</source>
<translation>متفجرات</translation>
</message>
<message>
<source>Tip: </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>This development build is 'work in progress' and may not be compatible with other versions of the game. Some features might be broken or incomplete. Use at your own risk!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Quality</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>% Health Crates</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Health in Crates</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sudden Death Water Rise</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sudden Death Health Decrease</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>% Rope Length</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Gameplay</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Stereo rendering</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QLineEdit</name>
<message>
<source>unnamed</source>
<translation>غير مسمى</translation>
</message>
</context>
<context>
<name>QMainWindow</name>
<message>
<source>Hedgewars %1</source>
<translation>Hedgewars %1</translation>
</message>
</context>
<context>
<name>QMessageBox</name>
<message>
<source>Network</source>
<translation>شبكة</translation>
</message>
<message>
<source>Connection to server is lost</source>
<translation>ضاع الاتصال للخادم</translation>
</message>
<message>
<source>Error</source>
<translation>خطأ</translation>
</message>
<message>
<source>Failed to open data directory:
%1
Please check your installation</source>
<translation>Failed to open data directory:
%1
Please check your installation</translation>
</message>
<message>
<source>Weapons</source>
<translation>اسلحة</translation>
</message>
<message>
<source>Can not edit default weapon set</source>
<translation type="obsolete">Can not edit default weapon set</translation>
</message>
<message>
<source>Can not delete default weapon set</source>
<translation type="obsolete">Can not delete default weapon set</translation>
</message>
<message>
<source>Really delete this weapon set?</source>
<translation type="unfinished">هل تريد حذف قائمة الاسلحة</translation>
</message>
<message>
<source>All file associations have been set.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>File association failed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Can not overwrite default weapon set '%1'!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Teams</source>
<translation type="unfinished">فرق</translation>
</message>
<message>
<source>Really delete this team?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Schemes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Can not delete default scheme '%1'!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Really delete this game scheme?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Can not delete default weapon set '%1'!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<source>Error</source>
<translation>خطأ</translation>
</message>
<message>
<source>Cannot create directory %1</source>
<translation>Cannot create directory %1</translation>
</message>
<message>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<source>Nickname</source>
<translation>اسم اللاعب</translation>
</message>
<message>
<source>Please enter your nickname</source>
<translation>ادحل اسم اللاعب</translation>
</message>
</context>
<context>
<name>QPushButton</name>
<message>
<source>default</source>
<translation>التلقائي</translation>
</message>
<message>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<source>Cancel</source>
<translation>الغاء</translation>
</message>
<message>
<source>Start server</source>
<translation>تشغيل الخادم</translation>
</message>
<message>
<source>Connect</source>
<translation>اتصل</translation>
</message>
<message>
<source>Update</source>
<translation type="unfinished">تحديث</translation>
</message>
<message>
<source>Specify</source>
<translation>تحديد</translation>
</message>
<message>
<source>Start</source>
<translation>ابدا</translation>
</message>
<message>
<source>Go!</source>
<translation type="unfinished">ابدا</translation>
</message>
<message>
<source>Play demo</source>
<translation>ابدا العرض</translation>
</message>
<message>
<source>Rename</source>
<translation>تغيير الاسم</translation>
</message>
<message>
<source>Delete</source>
<translation>حذف</translation>
</message>
<message>
<source>Load</source>
<translation>تحميل</translation>
</message>
<message>
<source>Setup</source>
<translation>تنصيب</translation>
</message>
<message>
<source>Ready</source>
<translation>ابدا</translation>
</message>
<message>
<source>Random Team</source>
<translation>فريق عشوائي</translation>
</message>
<message>
<source>Associate file extensions</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>more</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QTableWidget</name>
<message>
<source>Room Name</source>
<translation>اسم الغرقة</translation>
</message>
<message>
<source>C</source>
<translation>C</translation>
</message>
<message>
<source>T</source>
<translation>T</translation>
</message>
<message>
<source>Owner</source>
<translation>المالك</translation>
</message>
<message>
<source>Map</source>
<translation>خارطة</translation>
</message>
<message>
<source>Rules</source>
<translation>قوانين</translation>
</message>
<message>
<source>Weapons</source>
<translation>اسلحة</translation>
</message>
</context>
<context>
<name>SelWeaponWidget</name>
<message>
<source>Weapon set</source>
<translation>نمط الاسلحة</translation>
</message>
<message>
<source>Probabilities</source>
<translation>احتماليات</translation>
</message>
<message>
<source>Ammo in boxes</source>
<translation>العتاد في الصناديق</translation>
</message>
<message>
<source>Delays</source>
<translation>التأخير</translation>
</message>
<message>
<source>new</source>
<translation type="unfinished">جديد</translation>
</message>
<message>
<source>copy of</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TCPBase</name>
<message>
<source>Error</source>
<translation>خطأ</translation>
</message>
<message>
<source>Unable to start the server: %1.</source>
<translation>Unable to start the server: %1.</translation>
</message>
<message>
<source>Unable to run engine: %1 (</source>
<translation>Unable to run engine: %1 (</translation>
</message>
</context>
<context>
<name>ToggleButtonWidget</name>
<message>
<source>Vampirism</source>
<translation>مصاص دماء</translation>
</message>
<message>
<source>Karma</source>
<translation>كارما</translation>
</message>
<message>
<source>Artillery</source>
<translation>مدفعية</translation>
</message>
<message>
<source>Fort Mode</source>
<translation type="unfinished">طريقة الحصن</translation>
</message>
<message>
<source>Divide Teams</source>
<translation>قسم الفرق</translation>
</message>
<message>
<source>Solid Land</source>
<translation>ارض صلبة</translation>
</message>
<message>
<source>Add Border</source>
<translation>اضف اطار</translation>
</message>
<message>
<source>Low Gravity</source>
<translation>جاذبية قليلة</translation>
</message>
<message>
<source>Laser Sight</source>
<translation>منظار ليزري</translation>
</message>
<message>
<source>Invulnerable</source>
<translation>غير قابل للتدمير</translation>
</message>
<message>
<source>Add Mines</source>
<translation type="obsolete">اضف الغام</translation>
</message>
<message>
<source>Random Order</source>
<translation>توزيع عشوائي</translation>
</message>
<message>
<source>King</source>
<translation>ملك</translation>
</message>
<message>
<source>Place Hedgehogs</source>
<translation>ضع الاعبين</translation>
</message>
<message>
<source>Clan Shares Ammo</source>
<translation>الفريق يتشارك بالعتاد</translation>
</message>
<message>
<source>Disable Girders</source>
<translation>ابطال البناء</translation>
</message>
<message>
<source>Disable Land Objects</source>
<translation type="unfinished">ابطال الاجسام الارضية</translation>
</message>
<message>
<source>Reset Health</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>AI Survival Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unlimited Attacks</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reset Weapons</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Per Hedgehog Ammo</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Disable Wind</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>More Wind</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>binds</name>
<message>
<source>up</source>
<translation>up</translation>
</message>
<message>
<source>left</source>
<translation>left</translation>
</message>
<message>
<source>right</source>
<translation>right</translation>
</message>
<message>
<source>down</source>
<translation>down</translation>
</message>
<message>
<source>attack</source>
<translation>attack</translation>
</message>
<message>
<source>precise aim</source>
<translation>precise aim</translation>
</message>
<message>
<source>put</source>
<translation>put</translation>
</message>
<message>
<source>switch</source>
<translation>switch</translation>
</message>
<message>
<source>find hedgehog</source>
<translation>find hedgehog</translation>
</message>
<message>
<source>ammo menu</source>
<translation>ammo menu</translation>
</message>
<message>
<source>slot 1</source>
<translation>slot 1</translation>
</message>
<message>
<source>slot 2</source>
<translation>slot 2</translation>
</message>
<message>
<source>slot 3</source>
<translation>slot 3</translation>
</message>
<message>
<source>slot 4</source>
<translation>slot 4</translation>
</message>
<message>
<source>slot 5</source>
<translation>slot 5</translation>
</message>
<message>
<source>slot 6</source>
<translation>slot 6</translation>
</message>
<message>
<source>slot 7</source>
<translation>slot 7</translation>
</message>
<message>
<source>slot 8</source>
<translation>slot 8</translation>
</message>
<message>
<source>slot 9</source>
<translation>slot 9</translation>
</message>
<message>
<source>timer 1 sec</source>
<translation>timer 1 sec</translation>
</message>
<message>
<source>timer 2 sec</source>
<translation>timer 2 sec</translation>
</message>
<message>
<source>timer 3 sec</source>
<translation>timer 3 sec</translation>
</message>
<message>
<source>timer 4 sec</source>
<translation>timer 4 sec</translation>
</message>
<message>
<source>timer 5 sec</source>
<translation>timer 5 sec</translation>
</message>
<message>
<source>chat</source>
<translation>chat</translation>
</message>
<message>
<source>chat history</source>
<translation>chat history</translation>
</message>
<message>
<source>pause</source>
<translation>pause</translation>
</message>
<message>
<source>confirmation</source>
<translation>confirmation</translation>
</message>
<message>
<source>volume down</source>
<translation>volume down</translation>
</message>
<message>
<source>volume up</source>
<translation>volume up</translation>
</message>
<message>
<source>change mode</source>
<translation>change mode</translation>
</message>
<message>
<source>capture</source>
<translation>capture</translation>
</message>
<message>
<source>hedgehogs
info</source>
<translation>hedgehogs
info</translation>
</message>
<message>
<source>quit</source>
<translation>quit</translation>
</message>
<message>
<source>zoom in</source>
<translation>zoom in</translation>
</message>
<message>
<source>zoom out</source>
<translation>zoom out</translation>
</message>
<message>
<source>reset zoom</source>
<translation>reset zoom</translation>
</message>
<message>
<source>long jump</source>
<translation>long jump</translation>
</message>
<message>
<source>high jump</source>
<translation>high jump</translation>
</message>
<message>
<source>slot 10</source>
<translation type="unfinished">slot 10</translation>
</message>
</context>
<context>
<name>binds (categories)</name>
<message>
<source>Basic controls</source>
<translation>الاسلحة الاولية</translation>
</message>
<message>
<source>Weapon controls</source>
<translation>السيطرة على الاسلحة</translation>
</message>
<message>
<source>Camera and cursor controls</source>
<translation type="unfinished">السيطرة على الكامرة و المؤشر</translation>
</message>
<message>
<source>Other</source>
<translation>اخرى</translation>
</message>
</context>
<context>
<name>binds (descriptions)</name>
<message>
<source>Move your hogs and aim:</source>
<translation type="unfinished">تحريك اللاعب و التصويب</translation>
</message>
<message>
<source>Traverse gaps and obstacles by jumping:</source>
<translation type="unfinished">قفز فوق الحواجز</translation>
</message>
<message>
<source>Fire your selected weapon or trigger an utility item:</source>
<translation type="unfinished">اطلاق السلاح</translation>
</message>
<message>
<source>Pick a weapon or a target location under the cursor:</source>
<translation type="unfinished">أخذ السلاح تحت المؤشر</translation>
</message>
<message>
<source>Switch your currently active hog (if possible):</source>
<translation type="unfinished">تغيير اختيار اللاعب الحالي</translation>
</message>
<message>
<source>Pick a weapon or utility item:</source>
<translation type="unfinished">اختر السلاح</translation>
</message>
<message>
<source>Set the timer on bombs and timed weapons:</source>
<translation type="unfinished">وقت الانفجار</translation>
</message>
<message>
<source>Move the camera to the active hog:</source>
<translation type="unfinished">الكامرة على اللاعب</translation>
</message>
<message>
<source>Move the cursor or camera without using the mouse:</source>
<translation type="unfinished">تحريك الكامرة او اللاعب بلا المؤشر</translation>
</message>
<message>
<source>Modify the camera's zoom level:</source>
<translation type="unfinished">تغيير مدى التقريب البصري</translation>
</message>
<message>
<source>Talk to your team or all participants:</source>
<translation type="unfinished">ارسال رسالة لاعضاء الفريق</translation>
</message>
<message>
<source>Pause, continue or leave your game:</source>
<translation type="unfinished">توقيف اللعبة، الاستمرار او الغائها</translation>
</message>
<message>
<source>Modify the game's volume while playing:</source>
<translation type="unfinished">تغيير ارتقاع الصوت اثناء اللعبة</translation>
</message>
<message>
<source>Toggle fullscreen mode:</source>
<translation type="unfinished">تبديل ملئ الشاشة</translation>
</message>
<message>
<source>Take a screenshot:</source>
<translation type="unfinished">خد صورة</translation>
</message>
<message>
<source>Toggle labels above hedgehogs:</source>
<translation type="unfinished">تغيير العناوبن فوق اللاعبين</translation>
</message>
</context>
<context>
<name>binds (keys)</name>
<message>
<source>Axis</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(Up)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(Down)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Hat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(Left)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(Right)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Button</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Keyboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Delete</source>
<translation>Delete</translation>
</message>
<message>
<source>Mouse: Left button</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Mouse: Middle button</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Mouse: Right button</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Mouse: Wheel up</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Mouse: Wheel down</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Backspace</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Tab</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Clear</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Return</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Pause</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Escape</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Space</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Numpad 0</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Numpad 1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Numpad 2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Numpad 3</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Numpad 4</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Numpad 5</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Numpad 6</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Numpad 7</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Numpad 8</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Numpad 9</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Numpad .</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Numpad /</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Numpad *</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Numpad -</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Numpad +</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enter</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Equals</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Up</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Down</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Right</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Left</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Insert</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Home</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>End</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Page up</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Page down</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Num lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Caps lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Scroll lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Right shift</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Left shift</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Right ctrl</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Left ctrl</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Right alt</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Left alt</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Right meta</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Left meta</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>A button</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>B button</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>X button</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Y button</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>LB button</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>RB button</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Back button</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start button</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Left stick</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Right stick</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Left stick (Right)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Left stick (Left)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Left stick (Down)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Left stick (Up)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Left trigger</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Right trigger</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Right stick (Down)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Right stick (Up)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Right stick (Right)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Right stick (Left)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>DPad</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
| jeffchao/hedgewars-accessible | share/hedgewars/Data/Locale/hedgewars_ar.ts | TypeScript | gpl-2.0 | 84,375 |
/*
* Copyright (C) 2016-2022 ActionTech.
* License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher.
*/
package com.actiontech.dble.plan.common.field.num;
import com.actiontech.dble.plan.common.item.FieldTypes;
import com.actiontech.dble.plan.common.item.Item.ItemResult;
/**
* mediumint(%d) |unsigned |zerofilled
*
* @author ActionTech
*/
public class FieldMedium extends FieldNum {
public FieldMedium(String name, String dbName, String table, String orgTable, int charsetIndex, int fieldLength, int decimals, long flags) {
super(name, dbName, table, orgTable, charsetIndex, fieldLength, decimals, flags);
}
@Override
public ItemResult resultType() {
return ItemResult.INT_RESULT;
}
@Override
public FieldTypes fieldType() {
return FieldTypes.MYSQL_TYPE_INT24;
}
}
| actiontech/dble | src/main/java/com/actiontech/dble/plan/common/field/num/FieldMedium.java | Java | gpl-2.0 | 849 |
/*! \file
\brief Declaration of library functions
Any definitions in this file will be shared among GLUE Layer and internal Driver Stack.
*/
#ifndef _OSAL_H_
#define _OSAL_H_
#include <linux/version.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/cdev.h>
#include <linux/sched.h>
#include <linux/poll.h>
#include <asm/current.h>
#include <asm/uaccess.h>
#include <linux/proc_fs.h>
#include <linux/workqueue.h>
#include <linux/wait.h>
#include <linux/time.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/vmalloc.h>
#include <linux/firmware.h>
#include <linux/kthread.h>
#include <linux/jiffies.h>
#include <linux/slab.h>
#if defined(WMT_PLAT_ALPS) && WMT_PLAT_ALPS
#include <linux/aee.h>
#endif
#include <linux/kfifo.h>
#include <linux/wakelock.h>
#include <linux/log2.h>
#include <osal_typedef.h>
#include <asm/atomic.h>
/*******************************************************************************
* C O M P I L E R F L A G S
********************************************************************************
*/
/*******************************************************************************
* M A C R O S
********************************************************************************
*/
#define OS_BIT_OPS_SUPPORT 1
#define _osal_inline_ inline
#define MAX_THREAD_NAME_LEN 16
#define MAX_WAKE_LOCK_NAME_LEN 16
#define OSAL_OP_BUF_SIZE 64
#define OSAL_OP_DATA_SIZE 32
#define DBG_LOG_STR_SIZE 512
#define osal_sizeof(x) sizeof(x)
#define osal_array_size(x) sizeof(x)/sizeof(x[0])
#ifndef NAME_MAX
#define NAME_MAX 256
#endif
#define WMT_OP_BIT(x) (0x1UL << x)
#define WMT_OP_HIF_BIT WMT_OP_BIT(0)
#define RB_SIZE(prb) ((prb)->size)
#define RB_MASK(prb) (RB_SIZE(prb) - 1)
#define RB_COUNT(prb) ((prb)->write - (prb)->read)
#define RB_FULL(prb) (RB_COUNT(prb) >= RB_SIZE(prb))
#define RB_EMPTY(prb) ((prb)->write == (prb)->read)
#define RB_INIT(prb, qsize) \
{ \
(prb)->read = (prb)->write = 0; \
(prb)->size = (qsize); \
}
#define RB_PUT(prb, value) \
{ \
if (!RB_FULL( prb )) { \
(prb)->queue[ (prb)->write & RB_MASK(prb) ] = value; \
++((prb)->write); \
} \
else { \
osal_assert(!RB_FULL(prb)); \
} \
}
#define RB_GET(prb, value) \
{ \
if (!RB_EMPTY(prb)) { \
value = (prb)->queue[ (prb)->read & RB_MASK(prb) ]; \
++((prb)->read); \
if (RB_EMPTY(prb)) { \
(prb)->read = (prb)->write = 0; \
} \
} \
else { \
value = NULL; \
} \
}
/*******************************************************************************
* E X T E R N A L R E F E R E N C E S
********************************************************************************
*/
/*******************************************************************************
* C O N S T A N T S
********************************************************************************
*/
/*******************************************************************************
* D A T A T Y P E S
********************************************************************************
*/
typedef VOID (*P_TIMEOUT_HANDLER)(ULONG);
typedef INT32 (*P_COND)(VOID *);
typedef struct _OSAL_TIMER_
{
struct timer_list timer;
P_TIMEOUT_HANDLER timeoutHandler;
ULONG timeroutHandlerData;
}OSAL_TIMER, *P_OSAL_TIMER;
typedef struct _OSAL_UNSLEEPABLE_LOCK_
{
spinlock_t lock;
ULONG flag;
}OSAL_UNSLEEPABLE_LOCK, *P_OSAL_UNSLEEPABLE_LOCK;
typedef struct _OSAL_SLEEPABLE_LOCK_
{
struct mutex lock;
}OSAL_SLEEPABLE_LOCK, *P_OSAL_SLEEPABLE_LOCK;
typedef struct _OSAL_SIGNAL_
{
struct completion comp;
UINT32 timeoutValue;
}OSAL_SIGNAL, *P_OSAL_SIGNAL;
typedef struct _OSAL_EVENT_
{
wait_queue_head_t waitQueue;
// VOID *pWaitQueueData;
UINT32 timeoutValue;
INT32 waitFlag;
}OSAL_EVENT, *P_OSAL_EVENT;
typedef struct _OSAL_THREAD_
{
struct task_struct *pThread;
VOID *pThreadFunc;
VOID *pThreadData;
char threadName[MAX_THREAD_NAME_LEN];
}OSAL_THREAD, *P_OSAL_THREAD;
typedef struct _OSAL_FIFO_
{
/*fifo definition*/
VOID *pFifoBody;
spinlock_t fifoSpinlock;
/*fifo operations*/
INT32 (*FifoInit)(struct _OSAL_FIFO_ *pFifo, UINT8 *buf, UINT32);
INT32 (*FifoDeInit)(struct _OSAL_FIFO_ *pFifo);
INT32 (*FifoReset)(struct _OSAL_FIFO_ *pFifo);
INT32 (*FifoSz)(struct _OSAL_FIFO_ *pFifo);
INT32 (*FifoAvailSz)(struct _OSAL_FIFO_ *pFifo);
INT32 (*FifoLen)(struct _OSAL_FIFO_ *pFifo);
INT32 (*FifoIsEmpty)(struct _OSAL_FIFO_ *pFifo);
INT32 (*FifoIsFull)(struct _OSAL_FIFO_ *pFifo);
INT32 (*FifoDataIn)(struct _OSAL_FIFO_ *pFifo, const VOID *buf, UINT32 len);
INT32 (*FifoDataOut)(struct _OSAL_FIFO_ *pFifo, void *buf, UINT32 len);
} OSAL_FIFO, *P_OSAL_FIFO;
typedef struct firmware osal_firmware;
typedef struct _OSAL_OP_DAT {
UINT32 opId; // Event ID
UINT32 u4InfoBit; // Reserved
UINT32 au4OpData[OSAL_OP_DATA_SIZE]; // OP Data
} OSAL_OP_DAT, *P_OSAL_OP_DAT;
typedef struct _OSAL_LXOP_ {
OSAL_OP_DAT op;
OSAL_SIGNAL signal;
INT32 result;
} OSAL_OP, *P_OSAL_OP;
typedef struct _OSAL_LXOP_Q {
OSAL_SLEEPABLE_LOCK sLock;
UINT32 write;
UINT32 read;
UINT32 size;
P_OSAL_OP queue[OSAL_OP_BUF_SIZE];
} OSAL_OP_Q, *P_OSAL_OP_Q;
typedef struct _OSAL_WAKE_LOCK_
{
struct wake_lock wake_lock;
UINT8 name[MAX_WAKE_LOCK_NAME_LEN];
} OSAL_WAKE_LOCK, *P_OSAL_WAKE_LOCK;
#if 1
typedef struct _OSAL_BIT_OP_VAR_
{
ULONG data;
OSAL_UNSLEEPABLE_LOCK opLock;
}OSAL_BIT_OP_VAR, *P_OSAL_BIT_OP_VAR;
#else
#define OSAL_BIT_OP_VAR ULONG
#define P_OSAL_BIT_OP_VAR ULONG*
#endif
typedef UINT32 (*P_OSAL_EVENT_CHECKER)(P_OSAL_THREAD pThread);
/*******************************************************************************
* P U B L I C D A T A
********************************************************************************
*/
/*******************************************************************************
* P R I V A T E D A T A
********************************************************************************
*/
/*******************************************************************************
* F U N C T I O N D E C L A R A T I O N S
********************************************************************************
*/
extern UINT32 osal_strlen(const char *str);
extern INT32 osal_strcmp(const char *dst, const char *src);
extern INT32 osal_strncmp(const char *dst, const char *src, UINT32 len);
extern char * osal_strcpy(char *dst, const char *src);
extern char * osal_strncpy(char *dst, const char *src, UINT32 len);
extern char * osal_strcat(char *dst, const char *src);
extern char * osal_strncat(char *dst, const char *src, UINT32 len);
extern char * osal_strchr(const char *str, UINT8 c);
extern char *osal_strnstr(char *str1, const char *str2, int n);
extern char * osal_strsep(char **str, const char *c);
extern void osal_bug_on(unsigned long val);
extern LONG osal_strtol(const char *str, char **c, UINT32 adecimal);
extern INT32 osal_snprintf(char *buf, UINT32 len, const char*fmt, ...);
extern char *osal_strstr(char *str1, const char *str2);
extern INT32 osal_print(const char *str, ...);
extern INT32 osal_dbg_print(const char *str, ...);
extern INT32 osal_dbg_assert(INT32 expr, const char *file, INT32 line);
extern INT32 osal_sprintf(char *str, const char *format, ...);
extern VOID* osal_malloc(UINT32 size);
extern VOID osal_free(const VOID *dst);
extern VOID* osal_memset(VOID *buf, INT32 i, UINT32 len);
extern VOID* osal_memcpy(VOID *dst, const VOID *src, UINT32 len);
extern INT32 osal_memcmp(const VOID *buf1, const VOID *buf2, UINT32 len);
extern INT32 osal_sleep_ms(UINT32 ms);
extern INT32 osal_timer_create(P_OSAL_TIMER);
extern INT32 osal_timer_start(P_OSAL_TIMER, UINT32);
extern INT32 osal_timer_stop(P_OSAL_TIMER);
extern INT32 osal_timer_stop_sync(P_OSAL_TIMER pTimer);
extern INT32 osal_timer_modify(P_OSAL_TIMER, UINT32);
extern INT32 osal_timer_delete(P_OSAL_TIMER);
extern INT32 osal_fifo_init(P_OSAL_FIFO pFifo, UINT8 *buffer, UINT32 size);
extern VOID osal_fifo_deinit(P_OSAL_FIFO pFifo);
extern INT32 osal_fifo_reset(P_OSAL_FIFO pFifo);
extern UINT32 osal_fifo_in(P_OSAL_FIFO pFifo, PUINT8 buffer, UINT32 size);
extern UINT32 osal_fifo_out(P_OSAL_FIFO pFifo, PUINT8 buffer, UINT32 size);
extern UINT32 osal_fifo_len(P_OSAL_FIFO pFifo);
extern UINT32 osal_fifo_sz(P_OSAL_FIFO pFifo);
extern UINT32 osal_fifo_avail(P_OSAL_FIFO pFifo);
extern UINT32 osal_fifo_is_empty(P_OSAL_FIFO pFifo);
extern UINT32 osal_fifo_is_full(P_OSAL_FIFO pFifo);
extern INT32 osal_wake_lock_init(P_OSAL_WAKE_LOCK plock);
extern INT32 osal_wake_lock(P_OSAL_WAKE_LOCK plock);
extern INT32 osal_wake_unlock(P_OSAL_WAKE_LOCK plock);
extern INT32 osal_wake_lock_count(P_OSAL_WAKE_LOCK plock);
#if defined(CONFIG_PROVE_LOCKING)
#define osal_unsleepable_lock_init(l) { spin_lock_init(&((l)->lock));}
#else
extern INT32 osal_unsleepable_lock_init (P_OSAL_UNSLEEPABLE_LOCK );
#endif
extern INT32 osal_lock_unsleepable_lock (P_OSAL_UNSLEEPABLE_LOCK );
extern INT32 osal_unlock_unsleepable_lock (P_OSAL_UNSLEEPABLE_LOCK );
extern INT32 osal_unsleepable_lock_deinit (P_OSAL_UNSLEEPABLE_LOCK );
#if defined(CONFIG_PROVE_LOCKING)
#define osal_sleepable_lock_init(l) { mutex_init(&((l)->lock));}
#else
extern INT32 osal_sleepable_lock_init (P_OSAL_SLEEPABLE_LOCK );
#endif
extern INT32 osal_lock_sleepable_lock (P_OSAL_SLEEPABLE_LOCK );
extern INT32 osal_unlock_sleepable_lock (P_OSAL_SLEEPABLE_LOCK );
extern INT32 osal_sleepable_lock_deinit (P_OSAL_SLEEPABLE_LOCK );
extern INT32 osal_signal_init (P_OSAL_SIGNAL);
extern INT32 osal_wait_for_signal (P_OSAL_SIGNAL);
extern INT32
osal_wait_for_signal_timeout (
P_OSAL_SIGNAL
);
extern INT32
osal_raise_signal (
P_OSAL_SIGNAL
);
extern INT32
osal_signal_deinit (
P_OSAL_SIGNAL
);
extern INT32
osal_signal_active_state (
P_OSAL_SIGNAL pSignal
);
extern INT32 osal_event_init(P_OSAL_EVENT);
extern INT32 osal_wait_for_event(P_OSAL_EVENT, P_COND , void *);
extern INT32 osal_wait_for_event_timeout(P_OSAL_EVENT , P_COND , void *);
extern INT32 osal_trigger_event(P_OSAL_EVENT);
extern INT32 osal_event_deinit (P_OSAL_EVENT);
extern INT32 osal_thread_create(P_OSAL_THREAD);
extern INT32 osal_thread_run(P_OSAL_THREAD);
extern INT32 osal_thread_should_stop(P_OSAL_THREAD);
extern INT32 osal_thread_stop(P_OSAL_THREAD);
/*extern INT32 osal_thread_wait_for_event(P_OSAL_THREAD, P_OSAL_EVENT);*/
extern INT32 osal_thread_wait_for_event(P_OSAL_THREAD, P_OSAL_EVENT, P_OSAL_EVENT_CHECKER);
/*check pOsalLxOp and OSAL_THREAD_SHOULD_STOP*/
extern INT32 osal_thread_destroy(P_OSAL_THREAD);
extern INT32 osal_clear_bit(UINT32 bitOffset, P_OSAL_BIT_OP_VAR pData);
extern INT32 osal_set_bit(UINT32 bitOffset, P_OSAL_BIT_OP_VAR pData);
extern INT32 osal_test_bit(UINT32 bitOffset, P_OSAL_BIT_OP_VAR pData);
extern INT32 osal_test_and_clear_bit(UINT32 bitOffset, P_OSAL_BIT_OP_VAR pData);
extern INT32 osal_test_and_set_bit(UINT32 bitOffset, P_OSAL_BIT_OP_VAR pData);
extern INT32 osal_dbg_assert_aee(const char *module, const char *detail_description);
extern INT32 osal_gettimeofday(PINT32 sec, PINT32 usec);
extern INT32 osal_printtimeofday(const PUINT8 prefix);
extern VOID
osal_buffer_dump (
const UINT8 *buf,
const UINT8 *title,
UINT32 len,
UINT32 limit
);
extern UINT32 osal_op_get_id(P_OSAL_OP pOp);
extern MTK_WCN_BOOL osal_op_is_wait_for_signal(P_OSAL_OP pOp);
extern VOID osal_op_raise_signal(P_OSAL_OP pOp, INT32 result);
extern UINT16 osal_crc16(const UINT8 *buffer, const UINT32 length);
/*******************************************************************************
* F U N C T I O N S
********************************************************************************
*/
#define osal_err_print(fmt, arg...) osal_print(KERN_ERR fmt, ##arg)
#define osal_warn_print(fmt, arg...) osal_print(KERN_ERR fmt, ##arg)
#define osal_info_print(fmt, arg...) osal_print(KERN_ERR fmt, ##arg)
#define osal_load_print(fmt, arg...) osal_print(KERN_DEBUG fmt, ##arg)
#define osal_assert(condition) if (!(condition)) {osal_err_print("%s, %d, (%s)\n", __FILE__, __LINE__, #condition);}
#endif /* _OSAL_H_ */
| meizuosc/m75 | mediatek/kernel/drivers/combo/common/linux/include/osal.h | C | gpl-2.0 | 12,550 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* @author Camille Mizony
* @copyright Copyright (c) 2013, Camille Mizony
* @filesource
*/
// ------------------------------------------------------------------------
class Acl
{
private static $CI = NULL;
// Cummulativ privileges in Order
public $default_roles = array (
'observer' => array (
),
'reporter' => array (
'create_tickets' => TRUE,
'create_thread' => TRUE,
// TODO Add privilege "add file" - custom
// TODO Add privilege "view_iteration" - custom
),
'member' => array (
'internal_access' => TRUE,
'manage_tickets' => TRUE,
'manage_iterations' => TRUE,
),
'manager' => array (
'manage_projects' => TRUE,
'manage_contacts' => TRUE,
),
);
public function __construct()
{
if (is_null(Acl::$CI))
Acl::$CI =& get_instance();
}
public function has_privilege ($privilege)
{
// TODO cache session array
$privileges = Acl::$CI->session->userdata('privileges');
if (!$privileges)
return FALSE;
return (in_array($privilege,$privileges));
}
public function get_roles ()
{
// TODO check custom config
return (array_keys($this->default_roles));
}
public function load_privileges ($user_role)
{
// TODO check custom config
$roles = $this->default_roles;
if (!array_key_exists($user_role,$roles))
return FALSE;
$user_privileges = array();
foreach ($roles as $role => $privileges)
{
foreach ($privileges as $privilege => $activated)
if ($activated)
array_push($user_privileges,$privilege);
if ($role == $user_role)
break;
}
Acl::$CI->session->set_userdata('privileges',$user_privileges);
}
}
| cmizony/project-tracker | application/libraries/Acl.php | PHP | gpl-2.0 | 1,704 |
/**************************************************************************************
* Copyright (C) 2008 EsperTech, Inc. All rights reserved. *
* http://esper.codehaus.org *
* http://www.espertech.com *
* ---------------------------------------------------------------------------------- *
* The software in this package is published under the terms of the GPL license *
* a copy of which has been included with this distribution in the license.txt file. *
**************************************************************************************/
package com.espertech.esper.epl.core;
import com.espertech.esper.client.EventPropertyDescriptor;
import com.espertech.esper.client.EventType;
import com.espertech.esper.collection.Pair;
import com.espertech.esper.core.EPServiceProviderSPI;
import com.espertech.esper.epl.parse.ASTFilterSpecHelper;
import com.espertech.esper.event.EventTypeSPI;
import com.espertech.esper.util.LevenshteinDistance;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* Implementation that provides stream number and property type information.
*/
public class StreamTypeServiceImpl implements StreamTypeService
{
private final EventType[] eventTypes;
private final String[] streamNames;
private final boolean[] isIStreamOnly;
private final String engineURIQualifier;
private boolean isStreamZeroUnambigous;
private boolean requireStreamNames;
private boolean isOnDemandStreams;
/**
* Ctor.
* @param engineURI engine URI
* @param isOnDemandStreams
*/
public StreamTypeServiceImpl(String engineURI, boolean isOnDemandStreams)
{
this(new EventType[0], new String[0], new boolean[0], engineURI, isOnDemandStreams);
}
/**
* Ctor.
* @param eventType a single event type for a single stream
* @param streamName the stream name of the single stream
* @param engineURI engine URI
* @param isIStreamOnly true for no datawindow for stream
*/
public StreamTypeServiceImpl (EventType eventType, String streamName, boolean isIStreamOnly, String engineURI)
{
this(new EventType[] {eventType}, new String[] {streamName}, new boolean[] {isIStreamOnly}, engineURI, false);
}
/**
* Ctor.
* @param eventTypes - array of event types, one for each stream
* @param streamNames - array of stream names, one for each stream
* @param isIStreamOnly true for no datawindow for stream
* @param engineURI - engine URI
* @param isOnDemandStreams - true to indicate that all streams are on-demand pull-based
*/
public StreamTypeServiceImpl(EventType[] eventTypes, String[] streamNames, boolean[] isIStreamOnly, String engineURI, boolean isOnDemandStreams)
{
this.eventTypes = eventTypes;
this.streamNames = streamNames;
this.isIStreamOnly = isIStreamOnly;
this.isOnDemandStreams = isOnDemandStreams;
if (engineURI == null || EPServiceProviderSPI.DEFAULT_ENGINE_URI.equals(engineURI))
{
engineURIQualifier = EPServiceProviderSPI.DEFAULT_ENGINE_URI__QUALIFIER;
}
else
{
engineURIQualifier = engineURI;
}
if (eventTypes.length != streamNames.length)
{
throw new IllegalArgumentException("Number of entries for event types and stream names differs");
}
}
/**
* Ctor.
* @param namesAndTypes is the ordered list of stream names and event types available (stream zero to N)
* @param isStreamZeroUnambigous indicates whether when a property is found in stream zero and another stream an exception should be
* thrown or the stream zero should be assumed
* @param engineURI uri of the engine
* @param requireStreamNames is true to indicate that stream names are required for any non-zero streams (for subqueries)
*/
public StreamTypeServiceImpl (LinkedHashMap<String, Pair<EventType, String>> namesAndTypes, String engineURI, boolean isStreamZeroUnambigous, boolean requireStreamNames)
{
this.isStreamZeroUnambigous = isStreamZeroUnambigous;
this.requireStreamNames = requireStreamNames;
this.engineURIQualifier = engineURI;
this.isIStreamOnly = new boolean[namesAndTypes.size()];
eventTypes = new EventType[namesAndTypes.size()] ;
streamNames = new String[namesAndTypes.size()] ;
int count = 0;
for (Map.Entry<String, Pair<EventType, String>> entry : namesAndTypes.entrySet())
{
streamNames[count] = entry.getKey();
eventTypes[count] = entry.getValue().getFirst();
count++;
}
}
public void setRequireStreamNames(boolean requireStreamNames) {
this.requireStreamNames = requireStreamNames;
}
public boolean isOnDemandStreams() {
return isOnDemandStreams;
}
public EventType[] getEventTypes()
{
return eventTypes;
}
public String[] getStreamNames()
{
return streamNames;
}
public boolean[] getIStreamOnly() {
return isIStreamOnly;
}
public int getStreamNumForStreamName(String streamWildcard) {
for (int i = 0; i < streamNames.length; i++) {
if (streamWildcard.equals(streamNames[i])) {
return i;
}
}
return -1;
}
public PropertyResolutionDescriptor resolveByPropertyName(String propertyName)
throws DuplicatePropertyException, PropertyNotFoundException
{
if (propertyName == null)
{
throw new IllegalArgumentException("Null property name");
}
PropertyResolutionDescriptor desc = findByPropertyName(propertyName);
if ((requireStreamNames) && (desc.getStreamNum() != 0))
{
throw new PropertyNotFoundException("Property named '" + propertyName + "' must be prefixed by a stream name, use the stream name itself or use the as-clause to name the stream with the property in the format \"stream.property\"", null);
}
return desc;
}
public PropertyResolutionDescriptor resolveByStreamAndPropName(String streamName, String propertyName)
throws PropertyNotFoundException, StreamNotFoundException
{
if (streamName == null)
{
throw new IllegalArgumentException("Null property name");
}
if (propertyName == null)
{
throw new IllegalArgumentException("Null property name");
}
return findByStreamAndEngineName(propertyName, streamName);
}
public PropertyResolutionDescriptor resolveByStreamAndPropName(String streamAndPropertyName) throws DuplicatePropertyException, PropertyNotFoundException
{
if (streamAndPropertyName == null)
{
throw new IllegalArgumentException("Null stream and property name");
}
PropertyResolutionDescriptor desc;
try
{
// first try to resolve as a property name
desc = findByPropertyName(streamAndPropertyName);
}
catch (PropertyNotFoundException ex)
{
// Attempt to resolve by extracting a stream name
int index = ASTFilterSpecHelper.unescapedIndexOfDot(streamAndPropertyName);
if (index == -1)
{
throw ex;
}
String streamName = streamAndPropertyName.substring(0, index);
String propertyName = streamAndPropertyName.substring(index + 1, streamAndPropertyName.length());
try
{
// try to resolve a stream and property name
desc = findByStreamAndEngineName(propertyName, streamName);
}
catch (StreamNotFoundException e)
{
// Consider the engine URI as a further prefix
Pair<String, String> propertyNoEnginePair = getIsEngineQualified(propertyName, streamName);
if (propertyNoEnginePair == null)
{
throw ex;
}
try
{
return findByStreamNameOnly(propertyNoEnginePair.getFirst(), propertyNoEnginePair.getSecond());
}
catch (StreamNotFoundException e1)
{
throw ex;
}
}
return desc;
}
return desc;
}
private PropertyResolutionDescriptor findByPropertyName(String propertyName)
throws DuplicatePropertyException, PropertyNotFoundException
{
int index = 0;
int foundIndex = 0;
int foundCount = 0;
EventType streamType = null;
for (int i = 0; i < eventTypes.length; i++)
{
if (eventTypes[i] != null)
{
Class propertyType = null;
boolean found = false;
if (eventTypes[i].isProperty(propertyName)) {
propertyType = eventTypes[i].getPropertyType(propertyName);
found = true;
}
else {
// mapped(expression) or array(expression) are not property names but expressions against a property by name "mapped" or "array"
EventPropertyDescriptor descriptor = eventTypes[i].getPropertyDescriptor(propertyName);
if (descriptor != null) {
found = true;
propertyType = descriptor.getPropertyType();
}
}
if (found) {
streamType = eventTypes[i];
foundCount++;
foundIndex = index;
// If the property could be resolved from stream 0 then we don't need to look further
if ((i == 0) && isStreamZeroUnambigous)
{
return new PropertyResolutionDescriptor(streamNames[0], eventTypes[0], propertyName, 0, propertyType);
}
}
}
index++;
}
if (foundCount > 1)
{
throw new DuplicatePropertyException("Property named '" + propertyName + "' is ambigous as is valid for more then one stream");
}
if (streamType == null)
{
Pair<Integer, String> possibleMatch = findLevMatch(propertyName);
String message = "Property named '" + propertyName + "' is not valid in any stream";
throw new PropertyNotFoundException(message, possibleMatch);
}
return new PropertyResolutionDescriptor(streamNames[foundIndex], eventTypes[foundIndex], propertyName, foundIndex, streamType.getPropertyType(propertyName));
}
private Pair<Integer, String> findLevMatch(String propertyName)
{
String bestMatch = null;
int bestMatchDiff = Integer.MAX_VALUE;
for (int i = 0; i < eventTypes.length; i++)
{
if (eventTypes[i] == null)
{
continue;
}
EventPropertyDescriptor[] props = eventTypes[i].getPropertyDescriptors();
for (int j = 0; j < props.length; j++)
{
int diff = LevenshteinDistance.computeLevenshteinDistance(propertyName, props[j].getPropertyName());
if (diff < bestMatchDiff)
{
bestMatchDiff = diff;
bestMatch = props[j].getPropertyName();
}
}
}
if (bestMatchDiff < Integer.MAX_VALUE)
{
return new Pair<Integer, String>(bestMatchDiff, bestMatch);
}
return null;
}
private Pair<Integer, String> findLevMatch(String propertyName, EventType eventType)
{
String bestMatch = null;
int bestMatchDiff = Integer.MAX_VALUE;
EventPropertyDescriptor[] props = eventType.getPropertyDescriptors();
for (int j = 0; j < props.length; j++)
{
int diff = LevenshteinDistance.computeLevenshteinDistance(propertyName, props[j].getPropertyName());
if (diff < bestMatchDiff)
{
bestMatchDiff = diff;
bestMatch = props[j].getPropertyName();
}
}
if (bestMatchDiff < Integer.MAX_VALUE)
{
return new Pair<Integer, String>(bestMatchDiff, bestMatch);
}
return null;
}
private PropertyResolutionDescriptor findByStreamAndEngineName(String propertyName, String streamName)
throws PropertyNotFoundException, StreamNotFoundException
{
PropertyResolutionDescriptor desc;
try
{
desc = findByStreamNameOnly(propertyName, streamName);
}
catch (PropertyNotFoundException ex)
{
Pair<String, String> propertyNoEnginePair = getIsEngineQualified(propertyName, streamName);
if (propertyNoEnginePair == null)
{
throw ex;
}
return findByStreamNameOnly(propertyNoEnginePair.getFirst(), propertyNoEnginePair.getSecond());
}
catch (StreamNotFoundException ex)
{
Pair<String, String> propertyNoEnginePair = getIsEngineQualified(propertyName, streamName);
if (propertyNoEnginePair == null)
{
throw ex;
}
return findByStreamNameOnly(propertyNoEnginePair.getFirst(), propertyNoEnginePair.getSecond());
}
return desc;
}
private Pair<String, String> getIsEngineQualified(String propertyName, String streamName) {
// If still not found, test for the stream name to contain the engine URI
if (!streamName.equals(engineURIQualifier))
{
return null;
}
int index = ASTFilterSpecHelper.unescapedIndexOfDot(propertyName);
if (index == -1)
{
return null;
}
String streamNameNoEngine = propertyName.substring(0, index);
String propertyNameNoEngine = propertyName.substring(index + 1, propertyName.length());
return new Pair<String, String>(propertyNameNoEngine, streamNameNoEngine);
}
private PropertyResolutionDescriptor findByStreamNameOnly(String propertyName, String streamName)
throws PropertyNotFoundException, StreamNotFoundException
{
int index = 0;
EventType streamType = null;
// Stream name resultion examples:
// A) select A1.price from Event.price as A2 => mismatch stream name, cannot resolve
// B) select Event1.price from Event2.price => mismatch event type name, cannot resolve
// C) select default.Event2.price from Event2.price => possible prefix of engine name
for (int i = 0; i < eventTypes.length; i++)
{
if (eventTypes[i] == null)
{
index++;
continue;
}
if ((streamNames[i] != null) && (streamNames[i].equals(streamName)))
{
streamType = eventTypes[i];
break;
}
// If the stream name is the event type name, that is also acceptable
if ((eventTypes[i].getName() != null) && (eventTypes[i].getName().equals(streamName)))
{
streamType = eventTypes[i];
break;
}
index++;
}
if (streamType == null)
{
// find a near match, textually
String bestMatch = null;
int bestMatchDiff = Integer.MAX_VALUE;
for (int i = 0; i < eventTypes.length; i++)
{
if (streamNames[i] != null)
{
int diff = LevenshteinDistance.computeLevenshteinDistance(streamNames[i], streamName);
if (diff < bestMatchDiff)
{
bestMatchDiff = diff;
bestMatch = streamNames[i];
}
}
if (eventTypes[i] == null)
{
continue;
}
// If the stream name is the event type name, that is also acceptable
if (eventTypes[i].getName() != null)
{
int diff = LevenshteinDistance.computeLevenshteinDistance(eventTypes[i].getName(), streamName);
if (diff < bestMatchDiff)
{
bestMatchDiff = diff;
bestMatch = eventTypes[i].getName();
}
}
}
Pair<Integer, String> suggestion = null;
if (bestMatchDiff < Integer.MAX_VALUE)
{
suggestion = new Pair<Integer, String>(bestMatchDiff, bestMatch);
}
throw new StreamNotFoundException("Failed to find a stream named '" + streamName + "'", suggestion);
}
Class propertyType = streamType.getPropertyType(propertyName);
if (propertyType == null)
{
EventPropertyDescriptor desc = streamType.getPropertyDescriptor(propertyName);
if (desc == null) {
Pair<Integer, String> possibleMatch = findLevMatch(propertyName, streamType);
String message = "Property named '" + propertyName + "' is not valid in stream '" + streamName + "'";
throw new PropertyNotFoundException(message, possibleMatch);
}
propertyType = desc.getPropertyType();
}
return new PropertyResolutionDescriptor(streamName, streamType, propertyName, index, propertyType);
}
public String getEngineURIQualifier() {
return engineURIQualifier;
}
public boolean hasPropertyAgnosticType() {
for (EventType type : eventTypes) {
if (type instanceof EventTypeSPI) {
EventTypeSPI spi = (EventTypeSPI) type;
if (spi.getMetadata().isPropertyAgnostic()) {
return true;
}
}
}
return false;
}
}
| intelie/esper | esper/src/main/java/com/espertech/esper/epl/core/StreamTypeServiceImpl.java | Java | gpl-2.0 | 18,945 |
/**
*
*/
package com.ankamagames.dofus.harvey.engine.numeric.bytes.sets.classes;
import com.ankamagames.dofus.harvey.engine.common.sets.interfaces.IContinuousBound;
import com.ankamagames.dofus.harvey.engine.numeric.bytes.sets.interfaces.ICommonContinuousByteSet;
import com.ankamagames.dofus.harvey.engine.numeric.bytes.sets.interfaces.IIByteBound;
import com.ankamagames.dofus.harvey.engine.numeric.bytes.sets.interfaces.IIByteBoundFactory;
import org.eclipse.jdt.annotation.NonNullByDefault;
/**
* @author sgros
*
*/
@NonNullByDefault
public class CommonDegenerateContinuousByteSetBridge<Bound extends IContinuousBound<Bound>&IIByteBound, Type extends ICommonContinuousByteSet<Bound, ?, ?, ?>>
extends CommonDegenerateByteSetBridge<Bound, Type>
{
public CommonDegenerateContinuousByteSetBridge(final byte value, final IIByteBoundFactory<Bound> boundFactory, final Type emptySet, final Type bridged)
{
super(value, boundFactory, emptySet, bridged);
}
} | Ankama/harvey | src/com/ankamagames/dofus/harvey/engine/numeric/bytes/sets/classes/CommonDegenerateContinuousByteSetBridge.java | Java | gpl-2.0 | 967 |
/*
* This file is part of the KDE project
*
* Copyright (c) 2005 Cyrille Berger <cberger@cberger.net>
*
* 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KIS_MATH_TOOLBOX_H
#define KIS_MATH_TOOLBOX_H
#include <QObject>
#include <QRect>
#include <KoGenericRegistry.h>
#include <KoColorSpace.h>
#include "kis_types.h"
#include "kis_paint_device.h"
#include <new>
#ifdef _MSC_VER
#pragma warning(disable: 4290) // disable "C++ exception specification ignored" warning
#endif
#pragma GCC diagnostic ignored "-Wcast-align"
typedef double(*PtrToDouble)(const quint8*, int);
typedef void (*PtrFromDouble)(quint8*, int, double);
class KRITAIMAGE_EXPORT KisMathToolbox : public QObject
{
Q_OBJECT
public:
struct KisFloatRepresentation {
KisFloatRepresentation(uint nsize, uint ndepth)
throw(std::bad_alloc)
: coeffs(new float[nsize*nsize*ndepth])
, size(nsize)
, depth(ndepth) {
// XXX: Valgrind shows that these are being used without being initialised.
for (quint32 i = 0; i < nsize * nsize * ndepth; ++i) {
coeffs[i] = 0;
}
}
~KisFloatRepresentation() {
if (coeffs) delete[] coeffs;
}
float* coeffs;
uint size;
uint depth;
};
typedef KisFloatRepresentation KisWavelet;
public:
KisMathToolbox(KoID id);
virtual ~KisMathToolbox();
public:
inline QString id() {
return m_id.id();
}
inline QString name() {
return m_id.name();
}
/**
* This function initialize a wavelet structure
* @param lay the layer that will be used for the transformation
*/
inline KisWavelet* initWavelet(KisPaintDeviceSP lay, const QRect&) throw(std::bad_alloc);
inline uint fastWaveletTotalSteps(const QRect&);
/**
* This function reconstruct the layer from the information of a wavelet
* @param src layer from which the wavelet will be computed
* @param buff if set to 0, the buffer will be initialized by the function,
* you might want to give a buff to the function if you want to use the same buffer
* in transformToWavelet and in untransformToWavelet, use initWavelet to initialize
* the buffer
*/
virtual KisWavelet* fastWaveletTransformation(KisPaintDeviceSP src, const QRect&, KisWavelet* buff = 0) = 0;
/**
* This function reconstruct the layer from the information of a wavelet
* @param dst layer on which the wavelet will be untransform
* @param wav the wavelet
* @param buff if set to 0, the buffer will be initialized by the function,
* you might want to give a buff to the function if you want to use the same buffer
* in transformToWavelet and in untransformToWavelet, use initWavelet to initialize
* the buffer
*/
virtual void fastWaveletUntransformation(KisPaintDeviceSP dst, const QRect&, KisWavelet* wav, KisWavelet* buff = 0) = 0;
bool getToDoubleChannelPtr(QList<KoChannelInfo *> cis, QVector<PtrToDouble>& f);
bool getFromDoubleChannelPtr(QList<KoChannelInfo *> cis, QVector<PtrFromDouble>& f);
double minChannelValue(KoChannelInfo *);
double maxChannelValue(KoChannelInfo *);
signals:
void nextStep();
protected:
/**
* This function transform a paint device into a KisFloatRepresentation, this function is colorspace independent,
* for Wavelet, Pyramid and FFT the data is always the exact value of the channel stored in a float.
*/
void transformToFR(KisPaintDeviceSP src, KisFloatRepresentation*, const QRect&);
/**
* This function transform a KisFloatRepresentation into a paint device, this function is colorspace independent,
* for Wavelet, Pyramid and FFT the data is always the exact value of the channel stored in a float.
*/
void transformFromFR(KisPaintDeviceSP dst, KisFloatRepresentation*, const QRect&);
private:
KoID m_id;
};
class KRITAIMAGE_EXPORT KisMathToolboxRegistry
: public KoGenericRegistry<KisMathToolbox*>
{
public:
virtual ~KisMathToolboxRegistry();
static KisMathToolboxRegistry * instance();
private:
KisMathToolboxRegistry();
KisMathToolboxRegistry(const KisMathToolboxRegistry&);
KisMathToolboxRegistry operator=(const KisMathToolboxRegistry&);
};
inline KisMathToolbox::KisWavelet* KisMathToolbox::initWavelet(KisPaintDeviceSP src, const QRect& rect)
throw(std::bad_alloc)
{
int size;
int maxrectsize = (rect.height() < rect.width()) ? rect.width() : rect.height();
for (size = 2; size < maxrectsize; size *= 2) ;
qint32 depth = src->colorSpace()->colorChannelCount();
return new KisWavelet(size, depth);
}
inline uint KisMathToolbox::fastWaveletTotalSteps(const QRect& rect)
{
int size, steps;
int maxrectsize = (rect.height() < rect.width()) ? rect.width() : rect.height();
steps = 0;
for (size = 2; size < maxrectsize; size *= 2) steps += size / 2; ;
return steps;
}
#endif
| ddelemeny/calligra | krita/image/kis_math_toolbox.h | C | gpl-2.0 | 5,725 |
#include "licensepage.h"
LicensePage::LicensePage(void)
{
setupUi(this);
connect(acceptButton, SIGNAL(clicked()), SIGNAL(completeChanged()));
connect(rejectButton, SIGNAL(clicked()), SIGNAL(completeChanged()));
}
LicensePage::~LicensePage(void)
{
}
bool LicensePage::isComplete(void) const
{
return acceptButton->isChecked();
}
| canercandan/iot-project | deprecated/wizard/src/licensepage.cpp | C++ | gpl-2.0 | 339 |
"""
Python environments and packages
================================
This module provides tools for using Python `virtual environments`_
and installing Python packages using the `pip`_ installer.
.. _virtual environments: http://www.virtualenv.org/
.. _pip: http://www.pip-installer.org/
"""
from __future__ import with_statement
from contextlib import contextmanager
from distutils.version import StrictVersion as V
from pipes import quote
import os
import posixpath
import re
from fabric.api import cd, hide, prefix, run, settings, sudo
from fabric.utils import puts
from fabtools.files import is_file
from fabtools.utils import abspath, download, run_as_root
GET_PIP_URL = 'https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py'
def is_pip_installed(version=None, pip_cmd='pip'):
"""
Check if `pip`_ is installed.
.. _pip: http://www.pip-installer.org/
"""
with settings(hide('running', 'warnings', 'stderr', 'stdout'), warn_only=True):
res = run('%(pip_cmd)s --version 2>/dev/null' % locals())
if res.failed:
return False
if version is None:
return res.succeeded
else:
m = re.search(r'pip (?P<version>.*) from', res)
if m is None:
return False
installed = m.group('version')
if V(installed) < V(version):
puts("pip %s found (version >= %s required)" % (installed, version))
return False
else:
return True
def install_pip(python_cmd='python', use_sudo=True):
"""
Install the latest version of `pip`_, using the given Python
interpreter.
::
import fabtools
if not fabtools.python.is_pip_installed():
fabtools.python.install_pip()
.. note::
pip is automatically installed inside a virtualenv, so there
is no need to install it yourself in this case.
.. _pip: http://www.pip-installer.org/
"""
with cd('/tmp'):
download(GET_PIP_URL)
command = '%(python_cmd)s get-pip.py' % locals()
if use_sudo:
run_as_root(command, pty=False)
else:
run(command, pty=False)
run('rm -f get-pip.py')
def is_installed(package, pip_cmd='pip'):
"""
Check if a Python package is installed (using pip).
Package names are case insensitive.
Example::
from fabtools.python import virtualenv
import fabtools
with virtualenv('/path/to/venv'):
fabtools.python.install('Flask')
assert fabtools.python.is_installed('flask')
.. _pip: http://www.pip-installer.org/
"""
with settings(hide('running', 'stdout', 'stderr', 'warnings'), warn_only=True):
res = run('%(pip_cmd)s freeze' % locals())
packages = [line.split('==')[0].lower() for line in res.splitlines()]
return (package.lower() in packages)
def install(packages, upgrade=False, download_cache=None, allow_external=None,
allow_unverified=None, quiet=False, pip_cmd='pip', use_sudo=False,
user=None, exists_action=None):
"""
Install Python package(s) using `pip`_.
Package names are case insensitive.
Starting with version 1.5, pip no longer scrapes insecure external
urls by default and no longer installs externally hosted files by
default. Use ``allow_external=['foo', 'bar']`` or
``allow_unverified=['bar', 'baz']`` to change these behaviours
for specific packages.
Examples::
import fabtools
# Install a single package
fabtools.python.install('package', use_sudo=True)
# Install a list of packages
fabtools.python.install(['pkg1', 'pkg2'], use_sudo=True)
.. _pip: http://www.pip-installer.org/
"""
if isinstance(packages, basestring):
packages = [packages]
if allow_external in (None, False):
allow_external = []
elif allow_external == True:
allow_external = packages
if allow_unverified in (None, False):
allow_unverified = []
elif allow_unverified == True:
allow_unverified = packages
options = []
if upgrade:
options.append('--upgrade')
if download_cache:
options.append('--download-cache="%s"' % download_cache)
if quiet:
options.append('--quiet')
for package in allow_external:
options.append('--allow-external="%s"' % package)
for package in allow_unverified:
options.append('--allow-unverified="%s"' % package)
if exists_action:
options.append('--exists-action=%s' % exists_action)
options = ' '.join(options)
packages = ' '.join(packages)
command = '%(pip_cmd)s install %(options)s %(packages)s' % locals()
if use_sudo:
sudo(command, user=user, pty=False)
else:
run(command, pty=False)
def install_requirements(filename, upgrade=False, download_cache=None,
allow_external=None, allow_unverified=None,
quiet=False, pip_cmd='pip', use_sudo=False,
user=None, exists_action=None):
"""
Install Python packages from a pip `requirements file`_.
::
import fabtools
fabtools.python.install_requirements('project/requirements.txt')
.. _requirements file: http://www.pip-installer.org/en/latest/requirements.html
"""
if allow_external is None:
allow_external = []
if allow_unverified is None:
allow_unverified = []
options = []
if upgrade:
options.append('--upgrade')
if download_cache:
options.append('--download-cache="%s"' % download_cache)
for package in allow_external:
options.append('--allow-external="%s"' % package)
for package in allow_unverified:
options.append('--allow-unverified="%s"' % package)
if quiet:
options.append('--quiet')
if exists_action:
options.append('--exists-action=%s' % exists_action)
options = ' '.join(options)
command = '%(pip_cmd)s install %(options)s -r %(filename)s' % locals()
if use_sudo:
sudo(command, user=user, pty=False)
else:
run(command, pty=False)
def create_virtualenv(directory, system_site_packages=False, venv_python=None,
use_sudo=False, user=None, clear=False, prompt=None,
virtualenv_cmd='virtualenv'):
"""
Create a Python `virtual environment`_.
::
import fabtools
fabtools.python.create_virtualenv('/path/to/venv')
.. _virtual environment: http://www.virtualenv.org/
"""
options = ['--quiet']
if system_site_packages:
options.append('--system-site-packages')
if venv_python:
options.append('--python=%s' % quote(venv_python))
if clear:
options.append('--clear')
if prompt:
options.append('--prompt=%s' % quote(prompt))
options = ' '.join(options)
directory = quote(directory)
command = '%(virtualenv_cmd)s %(options)s %(directory)s' % locals()
if use_sudo:
sudo(command, user=user)
else:
run(command)
def virtualenv_exists(directory):
"""
Check if a Python `virtual environment`_ exists.
.. _virtual environment: http://www.virtualenv.org/
"""
return is_file(posixpath.join(directory, 'bin', 'python'))
@contextmanager
def virtualenv(directory, local=False):
"""
Context manager to activate an existing Python `virtual environment`_.
::
from fabric.api import run
from fabtools.python import virtualenv
with virtualenv('/path/to/virtualenv'):
run('python -V')
.. _virtual environment: http://www.virtualenv.org/
"""
path_mod = os.path if local else posixpath
# Build absolute path to the virtualenv activation script
venv_path = abspath(directory)
activate_path = path_mod.join(venv_path, 'bin', 'activate')
# Source the activation script
with prefix('. %s' % quote(activate_path)):
yield
| juanantoniofm/accesible-moodle | fabtools/python.py | Python | gpl-2.0 | 8,076 |
<!doctype html public "✰">
<!--[if lt IE 7]> <html lang="en-us" class="no-js ie6"> <![endif]-->
<!--[if IE 7]> <html lang="en-us" class="no-js ie7"> <![endif]-->
<!--[if IE 8]> <html lang="en-us" class="no-js ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en-us" class="no-js ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en-us" class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title>Adminica | The Professional Admin Theme</title>
<meta name="description" content="http://themeforest.net/item/adminica-the-professional-admin-template/160638">
<meta name="author" content="Oisin Lavery - Tricycle Labs">
<!-- iPhone, iPad and Android specific settings -->
<meta name="viewport" content="width=device-width; initial-scale=1; maximum-scale=1;">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link href="images/interface/iOS_icon.png" rel="apple-touch-icon">
<!-- Styles -->
<link rel="stylesheet" href="styles/adminica/reset.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,700">
<!-- NOTE: The following css files have been combined and minified into plugins.css
<link rel="stylesheet" href="styles/plugins/colorpicker/colorpicker.css">
<link rel="stylesheet" href="styles/plugins/datatables/datatables.css">
<link rel="stylesheet" href="styles/plugins/elfinder/elfinder.css">
<link rel="stylesheet" href="styles/plugins/fancybox/fancybox.css">
<link rel="stylesheet" href="styles/plugins/fullcalendar/fullcalendar.css">
<link rel="stylesheet" href="styles/plugins/isotope/isotope.css">
<link rel="stylesheet" href="styles/plugins/multiselect/multiselect.css">
<link rel="stylesheet" href="styles/plugins/select2/select2.css">
<link rel="stylesheet" href="styles/plugins/selectbox/selectbox.css">
<link rel="stylesheet" href="styles/plugins/slidernav/slidernav.css">
<link rel="stylesheet" href="styles/plugins/slidernav/smallipop.css">
<link rel="stylesheet" href="styles/plugins/syntaxhighlighter/syntaxhighlighter.css">
<link rel="stylesheet" href="styles/plugins/syntaxhighlighter/shThemeDefault.css">
<link rel="stylesheet" href="styles/plugins/tagit/tagit.css">
<link rel="stylesheet" href="styles/plugins/themeroller/themeroller.css">
<link rel="stylesheet" href="styles/plugins/tinyeditor/tinyeditor.css">
<link rel="stylesheet" href="styles/plugins/tiptip/tiptip.css">
<link rel="stylesheet" href="styles/plugins/uistars/uistars.css">
<link rel="stylesheet" href="styles/plugins/uitotop/uitotop.css">
<link rel="stylesheet" href="styles/plugins/uniform/uniform.css"> -->
<link rel="stylesheet" href="styles/plugins/all/plugins.css">
<!-- NOTE: The following css files have been combined and minified into all.css
<link rel="stylesheet" href="styles/adminica/text.css">
<link rel="stylesheet" href="styles/adminica/grid.css">
<link rel="stylesheet" href="styles/adminica/main.css">
<link rel="stylesheet" href="styles/adminica/mobile.css">
<link rel="stylesheet" href="styles/adminica/base.css">
<link rel="stylesheet" href="styles/adminica/ie.css">
<link rel="stylesheet" href="styles/themes/switcher.css"> -->
<link rel="stylesheet" href="styles/adminica/all.css">
<!-- Style Switcher
The following stylesheet links are used by the styleswitcher to allow for dynamically changing the Adminica layout, nav, skin, theme and background.
Styleswitcher documentation: http://style-switcher.webfactoryltd.com/documentation/
layout_switcher.php : layout - fluid by default. (eg. styles/themes/layout_switcher.php?default=layout_fixed.css)
nav_switcher.php : header and sidebar nav positioning - sidebar by default. (eg. styles/themes/nav_switcher.php?default=header_top.css)
skin_switcher.php : Adminica skin - dark by default. (eg. styles/themes/skin_switcher.php?default=theme_light.css)
theme_switcher.php : colour theme - black/grey by default. (eg. styles/themes/theme_switcher.php?default=theme_red.css)
bg_switcher.php : background image - dark boxes by default. (eg. styles/themes/bg_switcher.php?default=bg_honeycomb.css) -->
<link rel="stylesheet" href="styles/themes/layout_switcher.php?default=layout_fixed.css" >
<link rel="stylesheet" href="styles/themes/nav_switcher.php?default=nav_top.css" >
<link rel="stylesheet" href="styles/themes/skin_switcher.php?default=switcher.css" >
<link rel="stylesheet" href="styles/themes/theme_switcher.php?default=theme_blue.css" >
<link rel="stylesheet" href="styles/themes/bg_switcher.php?default=bg_honeycomb.css" >
<link rel="stylesheet" href="styles/adminica/colours.css"> <!-- this file overrides the theme's default colour scheme, allowing more colour combinations (see layout example page)
<!-- NOTE: The following js files have been conbined and minified into plugins-min.js
<script src="scripts/jquery/jquery.js"></script>
<script src="scripts/jquery/jqueryui.js"></script>
<script src="scripts/modernizr/modernizr.js"></script>
<script src="scripts/prefixfree/prefixfree.js"></script>
<script src="scripts/pjax/pjax.js"></script>
<script src="scripts/isotope/isotope.js"></script>
<script src="scripts/autogrow/autogrow.js"></script>
<script src="scripts/colorpicker/colorpicker.js"></script>
<script src="scripts/cookie/cookie.js"></script>
<script src="scripts/datatables/datatables.js"></script>
<script src="scripts/elfinder/elfinder.js"></script>
<script src="scripts/dragscroll/dragScroll.js"></script>
<script src="scripts/tinyeditor/tinyeditor.js"></script>
<script src="scripts/fancybox/fancybox.js"></script>
<script src="scripts/flot/flot_excanvas.js"></script>
<script src="scripts/flot/flot.js"></script>
<script src="scripts/flot/flot_resize.js"></script>
<script src="scripts/flot/flot_pie.js"></script>
<script src="scripts/flot/flot_pie_update.js"></script>
<script src="scripts/fullcalendar/fullcalendar.js"></script>
<script src="scripts/fullcalendar/fullcalendar_gcal.js"></script>
<script src="scripts/hoverintent/hoverIntent.js"></script>
<script src="scripts/iscroll/iscroll.js"></script>
<script src="scripts/knob/knob.js"></script>
<script src="scripts/multiselect/multiselect.js"></script>
<script src="scripts/select2/select2.js"></script>
<script src="scripts/selectbox/selectbox.js"></script>
<script src="scripts/slidernav/slidernav.js"></script>
<script src="scripts/smallipop/smallipop.js"></script>
<script src="scripts/sparkline/sparkline.js"></script>
<script src="scripts/syntaxhighlighter/shCore.js"></script>
<script src="scripts/syntaxhighlighter/shBrushJScript.js"></script>
<script src="scripts/syntaxhighlighter/shBrushXml.js"></script>
<script src="scripts/tagit/tagit.js"></script>
<script src="scripts/timepicker/timepicker.js"></script>
<script src="scripts/tinyeditor/tinyeditor.js"></script>
<script src="scripts/tiptip/tiptip.js"></script>
<script src="scripts/touchpunch/touchpunch.js"></script>
<script src="scripts/uistars/uistars.js"></script>
<script src="scripts/uitotop/uitotop.js"></script>
<script src="scripts/uniform/uniform.js"></script>
<script src="scripts/validation/validation.js"></script> -->
<script src="scripts/plugins-min.js"></script>
<!-- NOTE: The following js files have been conbined and minified into adminica_all-min.js
<script src="scripts/adminica/adminica_ui.js"></script>
<script src="scripts/adminica/adminica_mobile.js"></script>
<script src="scripts/adminica/adminica_datatables.js"></script>
<script src="scripts/adminica/adminica_calendar.js"></script>
<script src="scripts/adminica/adminica_charts.js"></script>
<script src="scripts/adminica/adminica_gallery.js"></script>
<script src="scripts/adminica/adminica_various.js"></script>
<script src="scripts/adminica/adminica_wizard.js"></script>
<script src="scripts/adminica/adminica_forms.js"></script>
<script src="scripts/adminica/adminica_load.js"></script> -->
<script src="scripts/adminica/adminica_all-min.js"></script>
</head>
<body> <div id="pjax">
<div id="wrapper">
<div class="isolate">
<div class="center narrow">
<div class="main_container full_size container_16 clearfix">
<div class="box">
<div class="block">
<div class="section">
<div class="alert dismissible alert_light">
<img width="24" height="24" src="images/icons/small/grey/locked.png">
<strong>Welcome to Adminica.</strong> Please enter your details to login.
</div>
</div>
<form action="index.php" class="validate_form">
<fieldset class="label_side top">
<label for="username_field">Username<span>or email address</span></label>
<div>
<input type="text" id="username_field" name="username_field" class="required">
</div>
</fieldset>
<fieldset class="label_side bottom">
<label for="password_field">Password<span><a href="#">Do you remember?</a></span></label>
<div>
<input type="password" id="password_field" name="password_field" class="required">
</div>
</fieldset>
<div class="button_bar clearfix">
<button class="wide" type="submit">
<img src="images/icons/small/white/key_2.png">
<span>Login</span>
</button>
</div>
</form>
</div>
</div>
</div>
<a href="index.php" id="login_logo"><span>Adminica</span></a>
<button data-dialog="dialog_register" class="dialog_button send_right" style="margin-top:10px;">
<img src="images/icons/small/white/user.png">
<span>Not Registered ?</span>
</button>
</div>
</div>
<div class="display_none">
<div id="dialog_register" class="dialog_content no_dialog_titlebar wide" title="Register for Adminica">
<div class="block">
<div class="section">
<h2>Registration Form</h2>
</div>
<div class="columns clearfix">
<div class="col_50">
<fieldset class="label_top top">
<label for="text_field_inline">Username<span>Between 5 and 20 characters</span></label>
<div>
<input type="text">
</div>
</fieldset>
</div>
<div class="col_50">
<fieldset class="label_top top right">
<label for="text_field_inline">Username again…<span>so we know you're human</span></label>
<div>
<input type="text">
</div>
</fieldset>
</div>
</div>
<div class="columns clearfix">
<div class="col_50">
<fieldset class="label_top">
<label for="text_field_inline">Password<span>Between 5 and 20 characters</span></label>
<div>
<input type="text">
</div>
</fieldset>
</div>
<div class="col_50">
<fieldset class="label_top right">
<label for="text_field_inline">Repeat Password again…</label>
<div>
<input type="text">
</div>
</fieldset>
</div>
</div>
<fieldset class="label_side bottom">
<label>Permission</label>
<div class="uniform inline clearfix">
<label for="agree_1"><input type="checkbox" name="agree_1" value="yes" id="agree_1"/>I agree with the terms and conditions</label>
</div>
</fieldset>
<div class="button_bar clearfix">
<button class="dark blue no_margin_bottom link_button" data-link="index.php">
<div class="ui-icon ui-icon-check"></div>
<span>Register</span>
</button>
<button class="light send_right close_dialog">
<div class="ui-icon ui-icon-closethick"></div>
<span>Cancel</span>
</button>
</div>
</div>
</div>
</div> <div class="display_none">
<div id="dialog_register" class="dialog_content no_dialog_titlebar wide" title="Register for Adminica">
<div class="block">
<div class="section">
<h2>Registration Form</h2>
</div>
<div class="columns clearfix">
<div class="col_50">
<fieldset class="label_top top">
<label for="text_field_inline">Username<span>Between 5 and 20 characters</span></label>
<div>
<input type="text">
</div>
</fieldset>
</div>
<div class="col_50">
<fieldset class="label_top top right">
<label for="text_field_inline">Username again…<span>so we know you're human</span></label>
<div>
<input type="text">
</div>
</fieldset>
</div>
</div>
<div class="columns clearfix">
<div class="col_50">
<fieldset class="label_top">
<label for="text_field_inline">Password<span>Between 5 and 20 characters</span></label>
<div>
<input type="text">
</div>
</fieldset>
</div>
<div class="col_50">
<fieldset class="label_top right">
<label for="text_field_inline">Repeat Password again…</label>
<div>
<input type="text">
</div>
</fieldset>
</div>
</div>
<fieldset class="label_side bottom">
<label>Permission</label>
<div class="uniform inline clearfix">
<label for="agree_1"><input type="checkbox" name="agree_1" value="yes" id="agree_1"/>I agree with the terms and conditions</label>
</div>
</fieldset>
<div class="button_bar clearfix">
<button class="dark blue no_margin_bottom link_button" data-link="index.php">
<div class="ui-icon ui-icon-check"></div>
<span>Register</span>
</button>
<button class="light send_right close_dialog">
<div class="ui-icon ui-icon-closethick"></div>
<span>Cancel</span>
</button>
</div>
</div>
</div>
</div> <div class="display_none">
<div id="dialog_form" class="dialog_content" title="Dialog with Form fields">
<div class="block">
<div class="section">
<div class="alert dismissible alert_black">
<img width="24" height="24" src="images/icons/small/white/alert_2.png">
<strong>All the form fields</strong> can be just as easily used in a dialog.
</div>
</div>
<fieldset class="label_side top">
<label>Text Field<span>Label placed beside the Input</span></label>
<div>
<input type="text">
</div>
</fieldset>
<fieldset class="label_side">
<label>Textarea<span>Regular Textarea</span></label>
<div class="clearfix">
<textarea class="autogrow"></textarea>
</div>
</fieldset>
<fieldset class="label_side">
<label>Bounce Slider<span>Slide to Unlock</span></label>
<div style="padding-top:25px;">
<div class="slider_unlock" title="Slide to Close"></div>
<button class="close_dialog display_none"></button>
</div>
</fieldset>
<div class="button_bar clearfix">
<button class="dark green close_dialog">
<div class="ui-icon ui-icon-check"></div>
<span>Submit</span>
</button>
<button class="dark red close_dialog">
<div class="ui-icon ui-icon-closethick"></div>
<span>Cancel</span>
</button>
</div>
</div>
</div>
</div> <div class="display_none">
<div id="dialog_delete" class="dialog_content narrow no_dialog_titlebar" title="Delete Confirmation">
<div class="block">
<div class="section">
<h1>Delete File</h1>
<div class="dashed_line"></div>
<p>Please confirm that you want to delete this file.</p>
</div>
<div class="button_bar clearfix">
<button class="delete_confirm dark red no_margin_bottom close_dialog">
<div class="ui-icon ui-icon-check"></div>
<span>Delete</span>
</button>
<button class="light send_right close_dialog">
<div class="ui-icon ui-icon-closethick"></div>
<span>Cancel</span>
</button>
</div>
</div>
</div>
</div> <div class="display_none">
<div id="dialog_welcome" class="dialog_content no_dialog_titlebar wide" title="Welcome to Adminica">
<div class="block lines">
<div class="columns clearfix">
<div class="col_50 no_border_top">
<div class="section">
<h1>Adminica</h1>
<p><strong>Adminica</strong> is a <strong>cleanly coded</strong>, <strong>beautifully styled</strong>, easily <strong>customisable</strong>, <strong>cross-browser</strong> compatible <strong>Web Application Interface</strong>.</p>
<p><strong>Adminica</strong> is packed full of features, allowing you<strong> unlimited combinations</strong> of layouts, controls and styles to ensure you have a <strong>trully unique app</strong>. </p>
<p><strong>Adminica</strong> can <strong>scale itself automatically</strong> to fit whatever screen resolution the user has. The interface<strong> works perfectly all the way down to iPhone size</strong></p>
</div>
</div>
<div class="col_50 no_border_top no_border_right">
<div class="section">
<h2>Features</h2>
</div>
<ul class="flat large text">
<li><a href="styles/themes/skin_switcher.php?style=theme_light.css">Light</a> and <a href="styles/themes/skin_switcher.php?style=switcher.css">Dark</a> Theme</li>
<li><a href="styles/themes/layout_switcher.php?style=layout_fixed.css">Fixed</a> and <a href="styles/themes/layout_switcher.php?style=switcher.css">Fluid</a> width layout</li>
<li><a href="styles/themes/nav_switcher.php?style=switcher.css">Sidebar</a>, <a href="styles/themes/nav_switcher.php?style=nav_top.css">Full Width</a>, <a href="styles/themes/nav_switcher.php?style=nav_slideout.css">Slide Menu</a> or <a href="styles/themes/nav_switcher.php?style=nav_slideout.css">Stack Menu</a>.</li>
<li class="theme_colour">
<a class="black" href="styles/themes/theme_switcher.php?style=switcher.css">
<span>Black</span></a>
<a class="blue" href="styles/themes/theme_switcher.php?style=theme_blue.css">
<span>Blue</span></a>
<a class="navy" href="styles/themes/theme_switcher.php?style=theme_navy.css">
<span>Navy</span></a>
<a class="red" href="styles/themes/theme_switcher.php?style=theme_red.css">
<span>Red</span></a>
<a class="green" href="styles/themes/theme_switcher.php?style=theme_green.css">
<span>Green</span></a>
<a class="magenta" href="styles/themes/theme_switcher.php?style=theme_magenta.css">
<span>Magenta</span></a>
<a class="orange" href="styles/themes/theme_switcher.php?style=theme_brown.css">
<span>Brown</span></a>
</li>
</ul>
<fieldset class="label_side label_small no_lines" style="border-top:0;">
<label>All Pages</label>
<div class="clearfix">
<div id="pagesSelect"></div>
</div>
</fieldset>
</div>
</div>
<div class="columns clearfix no_lines">
<div class="col_33">
<fieldset class="no_label">
<div class="clearfix">
<button class="full_width light">
<img src="images/icons/small/grey/book.png">
<span>Documentation</span>
</button>
</div>
</fieldset>
</div>
<div class="col_33">
<fieldset class="no_label">
<div class="clearfix">
<button class="full_width light">
<img src="images/icons/small/grey/help.png">
<span>Support Forum</span>
</button>
</div>
</fieldset>
</div>
<div class="col_33 no_border_right">
<fieldset class="no_label">
<div class="clearfix">
<button class="full_width light link_button" data-link="http://themeforest.net/user/Tricycle">
<img src="images/icons/small/grey/speech_bubble_2.png">
<span>Contact</span>
</button>
</div>
</fieldset>
</div>
</div>
<div class="columns clearfix no_lines">
<div class="col_33">
<fieldset class="label_top">
<label for="text_field_inline">Themeforest Username</label>
<div>
<input type="text">
</div>
</fieldset>
</div>
<div class="col_33">
<fieldset class="label_top">
<label for="text_field_inline">Email Address<span>required</span></label>
<div>
<input type="email" >
</div>
</fieldset>
</div>
<div class="col_33 no_border_right">
<fieldset class="label_top empty_label">
<div class="clearfix">
<button class="full_width" ><span>Subscribe for Updates</span></button>
</div>
</fieldset>
</div>
</div>
<div class="button_bar clearfix" type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe">
<button class="dark blue close_dialog wide">
<div class="ui-icon ui-icon-check"></div>
<span>Submit</span>
</button>
<button class="light send_right close_dialog wide">
<div class="ui-icon ui-icon-closethick"></div>
<span>Close</span>
</button>
</div>
</div>
</div>
</div> <div class="display_none">
<div id="dialog_logout" class="dialog_content narrow" title="Logout">
<div class="block">
<div class="section">
<h1>Thank you</h1>
<div class="dashed_line"></div>
<p>We will now log you out of Adminica in a 10 seconds...</p>
</div>
<div class="button_bar clearfix">
<button class="dark blue no_margin_bottom link_button" data-link="login_slide.php">
<div class="ui-icon ui-icon-check"></div>
<span>Ok</span>
</button>
<button class="light send_right close_dialog">
<div class="ui-icon ui-icon-closethick"></div>
<span>Cancel</span>
</button>
</div>
</div>
</div>
</div>
<div id="loading_overlay">
<div class="loading_message round_bottom">
<img src="images/interface/loading.gif" alt="loading" />
</div>
</div>
<div id="template_options" class="clearfix">
<h3><img src="images/interface/adminica.png" alt="Adminica"></h3>
<div class="layout_size">
<label>Layout:</label>
<a href="styles/themes/layout_switcher.php?style=switcher.css">Fluid</a><span>|</span>
<a href="styles/themes/layout_switcher.php?style=layout_fixed.css">Fixed</a>
</div>
<div class="layout_position">
<label class="display_none">Header: </label>
<a href="styles/themes/nav_switcher.php?style=switcher.css">Side</a><span>|</span>
<a href="styles/themes/nav_switcher.php?style=nav_stacks.css">Stacks</a><span>|</span>
<a href="styles/themes/nav_switcher.php?style=nav_top.css">Top</a><span>|</span>
<a href="styles/themes/nav_switcher.php?style=nav_slideout.css">Slide</a>
</div>
<div class="layout_position">
<label>Theme: </label>
<a href="styles/themes/skin_switcher.php?style=multiple&skin_switcher.php=switcher.css&bg_switcher.php=switcher.css">Dark</a><span>|</span>
<a href="styles/themes/skin_switcher.php?style=multiple&skin_switcher.php=skin_light.css&bg_switcher.php=switcher.css">Light</a>
</div>
<div class="theme_colour">
<label class="display_none">Colour:</label>
<a class="black" href="styles/themes/theme_switcher.php?style=switcher.css"><span>Black</span></a>
<a class="blue" href="styles/themes/theme_switcher.php?style=theme_blue.css"><span>Blue</span></a>
<a class="navy" href="styles/themes/theme_switcher.php?style=theme_navy.css"><span>Navy</span></a>
<a class="red" href="styles/themes/theme_switcher.php?style=theme_red.css"><span>Red</span></a>
<a class="green" href="styles/themes/theme_switcher.php?style=theme_green.css"><span>Green</span></a>
<a class="magenta" href="styles/themes/theme_switcher.php?style=theme_magenta.css"><span>Magenta</span></a>
<a class="orange" href="styles/themes/theme_switcher.php?style=theme_brown.css"><span>Brown</span></a>
</div>
<div class="theme_background" id="bg_dark">
<label>BGs:</label>
<a href="styles/themes/bg_switcher.php?style=bg_wunder.css">NEW</a><span>|</span>
<a href="styles/themes/bg_switcher.php?style=switcher.css">Boxes</a><span>|</span>
<a href="styles/themes/bg_switcher.php?style=bg_punched.css">Punched</a><span>|</span>
<a href="styles/themes/bg_switcher.php?style=bg_honeycomb.css">Honeycomb</a><span>|</span>
<a href="styles/themes/bg_switcher.php?style=bg_wood.css">Wood</a><span>|</span>
<a href="styles/themes/bg_switcher.php?style=bg_dark_wood.css">Timber</a><span>|</span>
<a href="styles/themes/bg_switcher.php?style=bg_noise.css">Noise</a>
</div>
<div class="theme_background" id="bg_light">
<label>BGs:</label>
<a href="styles/themes/bg_switcher.php?style=switcher.css">Silver</a><span>|</span>
<a href="styles/themes/bg_switcher.php?style=bg_white_wood.css">Wood</a><span>|</span>
<a href="styles/themes/bg_switcher.php?style=bg_squares.css">Squares</a><span>|</span>
<a href="styles/themes/bg_switcher.php?style=bg_noise_zero.css">Noise</a><span>|</span>
<a href="styles/themes/bg_switcher.php?style=bg_stripes.css">Stripes</a>
</div>
</div>
<!-- Google Analytics Code (Remove if not needed)
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-*******-*']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
-->
</div>
</body>
</html> | salem/aman | skins/admin/adminica/login_button.html | HTML | gpl-2.0 | 25,255 |
from setuptools import setup
def readme():
with open('README.rst.example') as f:
return f.read()
setup(name='manifold_gui',
version='0.1',
description='GUI for a manifold technique',
long_description=readme(),
classifiers=[
'Development Status :: 1 - Alpha',
'Environment :: Console',
'Environment :: X11 Applications',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Programming Language :: Python :: 2.7 :: chimera',
'Intended Audience :: End Users/Desktop',
],
keywords='manifold chimera',
author='Hstau Y Liao',
platform='linux chimera',
author_email='hstau.y.liao@gmail.com',
packages=['gui'],
include_package_data=True,
zip_safe=False)
| hstau/manifold-cryo | setup.py | Python | gpl-2.0 | 792 |
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
#ifndef __javax_print_attribute_Attribute__
#define __javax_print_attribute_Attribute__
#pragma interface
#include <java/lang/Object.h>
extern "Java"
{
namespace javax
{
namespace print
{
namespace attribute
{
class Attribute;
}
}
}
}
class javax::print::attribute::Attribute : public ::java::lang::Object
{
public:
virtual ::java::lang::Class *getCategory () = 0;
virtual ::java::lang::String *getName () = 0;
static ::java::lang::Class class$;
} __attribute__ ((java_interface));
#endif /* __javax_print_attribute_Attribute__ */
| cmathx/mingw | include/javax/print/attribute/Attribute.h | C | gpl-2.0 | 651 |
package nobugs.team.shopping.mvp.interactor;
import java.util.List;
import nobugs.team.shopping.mvp.model.Product;
import nobugs.team.shopping.repo.RepoCallback;
import nobugs.team.shopping.repo.Repository;
/**
* Created by xiayong on 2015/8/31.
*/
public class ProductInteractorImpl implements ProductInteractor {
@Override
public void getProducts(String shopId, final Callback callback) {
Repository.getInstance().getProductList(Integer.parseInt(shopId),new RepoCallback.GetList<Product>(){
@Override
public void onGotDataListSuccess(List<Product> products) {
callback.onSuccess(products);
}
@Override
public void onError(int errType, String errMsg) {
callback.onFailure();
}
});
}
@Override
public void getProductUnit(final TypeCallback callback) {
Repository.getInstance().getUnitList(new RepoCallback.GetList<String>() {
@Override
public void onGotDataListSuccess(List<String> strings) {
callback.onTypeSuccess(strings);
}
@Override
public void onError(int errType, String errMsg) {
callback.onFailure();
}
});
}
}
| 10211509/maketaobao | app/src/main/java/nobugs/team/shopping/mvp/interactor/ProductInteractorImpl.java | Java | gpl-2.0 | 1,294 |
<?php
class WPBakeryShortCode_tab_links extends WPBakeryShortCode {
/*
*
* @param $atts - shortcode attributes
* @param @content - shortcode content
*
* @access protected
* vc_filter: VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG vc_shortcodes_css_class - hook to edit element class
* @return string
*/
protected function content( $atts, $content = null ) {
extract( shortcode_atts( array(
'links' => 'tab_1|layers-1|Tab Link Title|Buy products online from our awesome shop or you can visit us at our real shop om San Francisco'
), $atts ) );
// $width_class = '';
// $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $width_class, $this->settings['base'], $atts );
$links_list = explode(',', $links);
ob_start(); ?>
<ul class='theshop_tabs_wraper'>
<?php foreach ($links_list as $link): $item = explode('|', $link);?>
<li>
<a href="#<?php echo esc_attr($item[0]); ?>"></a>
<div class="icon_tab">
<span><i class="icon icon-<?php echo esc_attr($item[1]); ?>"></i></span>
</div>
<div class="content_tab">
<h2><?php echo esc_html($item[2]); ?></h2>
<p><?php echo esc_html($item[3]); ?></p>
</div>
</li>
<?php endforeach ?>
</ul>
<?php
$output = ob_get_contents();
ob_end_clean();
return $output;
}
}
vc_map( array(
"base" => "tab_links",
"name" => __( "Tab Links", "js_composer" ),
"class" => "",
"icon" => "icon icon-information",
"category" => 'AVAThemes',
"content_element" => true,
"params" => array(
array(
'type' => 'exploded_textarea',
'heading' => __( 'Links', 'js_composer' ),
'param_name' => 'links',
'description' => __( 'Enter values for link - ID, icon, title and description. Divide value sets with linebreak "Enter" (Example: tab_1|layers-1|Tab Link Title|Buy products online from our awesome shop or you can visit us at our real shop om San Francisco).', 'js_composer' ),
),
)
) );
| estrategasdigitales/Dagutorio | wp-content/themes/theshop/avathemes_vc/shortcodes/tab_links.php | PHP | gpl-2.0 | 1,973 |
/* PR c/7652 */
/* { dg-do compile } */
/* { dg-require-effective-target alloca } */
/* { dg-options "-Wimplicit-fallthrough" } */
extern void bar (int);
extern int bar2 (void);
extern int *map;
void
f (int i)
{
switch (i)
{
case 1:
bar (0); /* { dg-warning "statement may fall through" } */
static int i = 10;
case 2:
bar (99);
}
switch (i)
{
case 1:
{ /* { dg-warning "statement may fall through" "" { target c } . } */
int a[i]; /* { dg-warning "statement may fall through" "" { target c++ } . } */
}
case 2:
bar (99);
}
switch (i)
{
case 1:
for (int j = 0; j < 10; j++) /* { dg-warning "statement may fall through" "" { target c } . } */
map[j] = j; /* { dg-warning "statement may fall through" "" { target c++ } . } */
case 2:
bar (99);
}
switch (i)
{
case 1:
do
bar (2);
while (--i); /* { dg-warning "statement may fall through" } */
case 2:
bar (99);
}
switch (i)
{
case 1:
{
switch (i + 2)
case 4:
bar (1); /* { dg-warning "statement may fall through" } */
case 5:
bar (5);
return;
}
case 2:
bar (99);
}
switch (i)
{
case 1:;
case 2:;
}
switch (i)
{
}
switch (i)
{
case 1:
if (i & 1) /* { dg-warning "statement may fall through" } */
{
bar (23);
break;
}
case 2:
bar (99);
}
switch (i)
{
case 1:
if (i > 9) /* { dg-warning "statement may fall through" } */
{
bar (9);
if (i == 10)
{
bar (10);
break;
}
}
case 2:
bar (99);
}
int r;
switch (i)
{
case 1:
r = bar2 ();
if (r) /* { dg-warning "statement may fall through" } */
break;
case 2:
bar (99);
}
switch (i)
{
case 1:
r = bar2 ();
if (r)
return;
if (!i) /* { dg-warning "statement may fall through" } */
return;
case 2:
bar (99);
}
}
| mydongistiny/gcc | gcc/testsuite/c-c++-common/Wimplicit-fallthrough-7.c | C | gpl-2.0 | 2,000 |
/*
* Copyright (C) 2007, 2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 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 Apple Inc. ("Apple") 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 APPLE AND ITS 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 APPLE 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.
*/
#include "WebInspector.h"
#include "WebInspectorClient.h"
#include "WebKitDLL.h"
#include "WebView.h"
#include <WebCore/InspectorController.h>
#include <WebCore/Page.h>
#include <wtf/Assertions.h>
using namespace WebCore;
WebInspector* WebInspector::createInstance(WebView* inspectedWebView, WebInspectorClient* inspectorClient)
{
WebInspector* inspector = new WebInspector(inspectedWebView, inspectorClient);
inspector->AddRef();
return inspector;
}
WebInspector::WebInspector(WebView* inspectedWebView, WebInspectorClient* inspectorClient)
: m_inspectedWebView(inspectedWebView)
, m_inspectorClient(inspectorClient)
{
ASSERT_ARG(inspectedWebView, inspectedWebView);
gClassCount++;
gClassNameCount().add("WebInspector");
}
WebInspector::~WebInspector()
{
gClassCount--;
gClassNameCount().remove("WebInspector");
}
WebInspectorFrontendClient* WebInspector::frontendClient()
{
return m_inspectorClient ? m_inspectorClient->frontendClient() : nullptr;
}
void WebInspector::inspectedWebViewClosed()
{
m_inspectedWebView = nullptr;
m_inspectorClient = nullptr;
}
HRESULT WebInspector::QueryInterface(_In_ REFIID riid, _COM_Outptr_ void** ppvObject)
{
if (!ppvObject)
return E_POINTER;
*ppvObject = nullptr;
if (IsEqualGUID(riid, IID_IWebInspector))
*ppvObject = static_cast<IWebInspector*>(this);
else if (IsEqualGUID(riid, IID_IWebInspectorPrivate))
*ppvObject = static_cast<IWebInspectorPrivate*>(this);
else if (IsEqualGUID(riid, IID_IUnknown))
*ppvObject = static_cast<IWebInspector*>(this);
else
return E_NOINTERFACE;
AddRef();
return S_OK;
}
ULONG WebInspector::AddRef()
{
return ++m_refCount;
}
ULONG WebInspector::Release()
{
ULONG newRef = --m_refCount;
if (!newRef)
delete this;
return newRef;
}
HRESULT WebInspector::show()
{
if (m_inspectedWebView)
if (Page* page = m_inspectedWebView->page())
page->inspectorController().show();
return S_OK;
}
HRESULT WebInspector::showConsole()
{
if (frontendClient())
frontendClient()->showConsole();
return S_OK;
}
HRESULT WebInspector::unused1()
{
return S_OK;
}
HRESULT WebInspector::close()
{
if (frontendClient())
frontendClient()->closeWindow();
return S_OK;
}
HRESULT WebInspector::attach()
{
return S_OK;
}
HRESULT WebInspector::detach()
{
return S_OK;
}
HRESULT WebInspector::isDebuggingJavaScript(_Out_ BOOL* isDebugging)
{
if (!isDebugging)
return E_POINTER;
*isDebugging = FALSE;
if (!frontendClient())
return S_OK;
*isDebugging = frontendClient()->isDebuggingEnabled();
return S_OK;
}
HRESULT WebInspector::toggleDebuggingJavaScript()
{
show();
if (!frontendClient())
return S_OK;
if (frontendClient()->isDebuggingEnabled())
frontendClient()->setDebuggingEnabled(false);
else
frontendClient()->setDebuggingEnabled(true);
return S_OK;
}
HRESULT WebInspector::isProfilingJavaScript(_Out_ BOOL* isProfiling)
{
if (!isProfiling)
return E_POINTER;
*isProfiling = FALSE;
if (!frontendClient())
return S_OK;
*isProfiling = frontendClient()->isProfilingJavaScript();
return S_OK;
}
HRESULT WebInspector::toggleProfilingJavaScript()
{
show();
if (!frontendClient())
return S_OK;
if (frontendClient()->isProfilingJavaScript())
frontendClient()->stopProfilingJavaScript();
else
frontendClient()->startProfilingJavaScript();
return S_OK;
}
HRESULT WebInspector::isJavaScriptProfilingEnabled(_Out_ BOOL* isProfilingEnabled)
{
if (!isProfilingEnabled)
return E_POINTER;
*isProfilingEnabled = FALSE;
if (!m_inspectedWebView)
return S_OK;
Page* inspectedPage = m_inspectedWebView->page();
if (!inspectedPage)
return S_OK;
*isProfilingEnabled = inspectedPage->inspectorController().legacyProfilerEnabled();
return S_OK;
}
HRESULT WebInspector::setJavaScriptProfilingEnabled(BOOL enabled)
{
if (!m_inspectedWebView)
return S_OK;
Page* inspectedPage = m_inspectedWebView->page();
if (!inspectedPage)
return S_OK;
inspectedPage->inspectorController().setLegacyProfilerEnabled(enabled);
return S_OK;
}
HRESULT WebInspector::evaluateInFrontend(_In_ BSTR bScript)
{
if (!m_inspectedWebView)
return S_OK;
Page* inspectedPage = m_inspectedWebView->page();
if (!inspectedPage)
return S_OK;
String script(bScript, SysStringLen(bScript));
inspectedPage->inspectorController().evaluateForTestInFrontend(script);
return S_OK;
}
HRESULT WebInspector::isTimelineProfilingEnabled(_Out_ BOOL* isEnabled)
{
if (!isEnabled)
return E_POINTER;
*isEnabled = FALSE;
if (!frontendClient())
return S_OK;
*isEnabled = frontendClient()->isTimelineProfilingEnabled();
return S_OK;
}
HRESULT WebInspector::setTimelineProfilingEnabled(BOOL enabled)
{
show();
if (!frontendClient())
return S_OK;
frontendClient()->setTimelineProfilingEnabled(enabled);
return S_OK;
}
| teamfx/openjfx-9-dev-rt | modules/javafx.web/src/main/native/Source/WebKit/win/WebInspector.cpp | C++ | gpl-2.0 | 6,767 |
<?xml version="1.0" encoding="iso-8859-1"?>
<!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>
<title>Docs for page wrapper.php</title>
<link rel="stylesheet" href="../../media/stylesheet.css" />
<script src="../../media/lib/classTree.js"></script>
<link id="webfx-tab-style-sheet" type="text/css" rel="stylesheet" href="../../media/lib/tab.webfx.css" />
<script type="text/javascript" src="../../media/lib/tabpane.js"></script>
<script language="javascript" type="text/javascript" src="../../media/lib/ua.js"></script>
<script language="javascript" type="text/javascript">
var imgPlus = new Image();
var imgMinus = new Image();
imgPlus.src = "../../media/images/plus.gif";
imgMinus.src = "../../media/images/minus.gif";
function showNode(Node){
switch(navigator.family){
case 'nn4':
// Nav 4.x code fork...
var oTable = document.layers["span" + Node];
var oImg = document.layers["img" + Node];
break;
case 'ie4':
// IE 4/5 code fork...
var oTable = document.all["span" + Node];
var oImg = document.all["img" + Node];
break;
case 'gecko':
// Standards Compliant code fork...
var oTable = document.getElementById("span" + Node);
var oImg = document.getElementById("img" + Node);
break;
}
oImg.src = imgMinus.src;
oTable.style.display = "block";
}
function hideNode(Node){
switch(navigator.family){
case 'nn4':
// Nav 4.x code fork...
var oTable = document.layers["span" + Node];
var oImg = document.layers["img" + Node];
break;
case 'ie4':
// IE 4/5 code fork...
var oTable = document.all["span" + Node];
var oImg = document.all["img" + Node];
break;
case 'gecko':
// Standards Compliant code fork...
var oTable = document.getElementById("span" + Node);
var oImg = document.getElementById("img" + Node);
break;
}
oImg.src = imgPlus.src;
oTable.style.display = "none";
}
function nodeIsVisible(Node){
switch(navigator.family){
case 'nn4':
// Nav 4.x code fork...
var oTable = document.layers["span" + Node];
break;
case 'ie4':
// IE 4/5 code fork...
var oTable = document.all["span" + Node];
break;
case 'gecko':
// Standards Compliant code fork...
var oTable = document.getElementById("span" + Node);
break;
}
return (oTable && oTable.style.display == "block");
}
function toggleNodeVisibility(Node){
if (nodeIsVisible(Node)){
hideNode(Node);
}else{
showNode(Node);
}
}
</script>
<!-- template designed by Julien Damon based on PHPEdit's generated templates, and tweaked by Greg Beaver -->
<body bgcolor="#ffffff" ><h2>File: /com_wrapper/wrapper.php</h2>
<div class="tab-pane" id="tabPane1">
<script type="text/javascript">
tp1 = new WebFXTabPane( document.getElementById( "tabPane1" ) );
</script>
<div class="tab-page" id="Description">
<h2 class="tab">Description</h2>
<!-- ========== Info from phpDoc block ========= -->
<ul>
<li><strong>copyright:</strong> - Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.</li>
<li><strong>license:</strong> - GNU</li>
</ul>
<!-- =========== Used Classes =========== -->
<A NAME='classes_summary'><!-- --></A>
<h3>Classes defined in this file</h3>
<TABLE CELLPADDING='3' CELLSPACING='0' WIDTH='100%' CLASS="border">
<THEAD>
<TR><TD STYLE="width:20%"><h4>CLASS NAME</h4></TD><TD STYLE="width: 80%"><h4>DESCRIPTION</h4></TD></TR>
</THEAD>
<TBODY>
</TBODY>
</TABLE>
</div>
<script type="text/javascript">tp1.addTabPage( document.getElementById( "Description" ) );</script>
<div class="tab-page" id="tabPage1">
<!-- ============ Includes DETAIL =========== -->
<h2 class="tab">Include/Require Statements</h2>
<script type="text/javascript">tp1.addTabPage( document.getElementById( "tabPage1" ) );</script>
</div>
<div class="tab-page" id="tabPage2">
<!-- ============ GLOBAL DETAIL =========== -->
<h2 class="tab">Global Variables</h2>
<script type="text/javascript">tp1.addTabPage( document.getElementById( "tabPage2" ) );</script>
</div>
<div class="tab-page" id="tabPage3">
<!-- ============ CONSTANT DETAIL =========== -->
<A NAME='constant_detail'></A>
<h2 class="tab">Constants</h2>
<script type="text/javascript">tp1.addTabPage( document.getElementById( "tabPage3" ) );</script>
</div>
<div class="tab-page" id="tabPage4">
<!-- ============ FUNCTION DETAIL =========== -->
<h2 class="tab">Functions</h2>
<script type="text/javascript">tp1.addTabPage( document.getElementById( "tabPage4" ) );</script>
</div>
</div>
<script type="text/javascript">
//<![CDATA[
setupAllTabs();
//]]>
</script>
<div id="credit">
<hr />
Documentation generated on Sun, 29 Jul 2012 11:23:51 +0400 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.3</a>
</div>
</body>
</html> | srgg6701/WebApps | .phpDocumentation/HTMLframesConverter/Joomla-Site/com_wrapper/_com_wrapper---wrapper.php.html | HTML | gpl-2.0 | 5,128 |
PSPSDK=$(shell psp-config --pspsdk-path)
PSPDIR=$(shell psp-config --psp-prefix)
TARGET_LIB = libpng.a
OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
CFLAGS = -O2 -G0
INCDIR = ../zlib
PSP_FW_VERSION=639
include $(PSPSDK)/lib/build.mak
install: $(TARGET_LIB)
@echo "Installing libpng into $(PSPDIR)"
@mkdir -p $(PSPDIR)/include $(PSPDIR)/lib
@cp png.h pngconf.h $(PSPDIR)/include
@cp libpng.a $(PSPDIR)/lib
@echo "Done"
| DreamingPiggy/xreader-hg | contrib/libpng/Makefile | Makefile | gpl-2.0 | 543 |
contosdeifa
===========
Site-jogo sobre a matriz afro-indígena
| rbrazileiro/contosdeifa | README.md | Markdown | gpl-2.0 | 65 |
<?php get_header(); ?>
</div><!-- header-area -->
</div><!-- end rays -->
</div><!-- end header-holder -->
</div><!-- end header -->
<?php truethemes_before_main_hook();// action hook, see truethemes_framework/global/hooks.php ?>
<div id="main">
<?php
$ka_blogtitle = get_option('ka_blogtitle');
$ka_searchbar = get_option('ka_searchbar');
$ka_crumbs = get_option('ka_crumbs');
$ka_blogbutton = get_option('ka_blogbutton');
$ka_posted_by = get_option('ka_posted_by');
$ka_post_date = get_option('ka_post_date');
if ($ka_post_date != "false"){ $ka_post_date_result = 'style="background:none !important;"';}else{$ka_post_date_result = '';}
$ka_dragshare = get_option('ka_dragshare');
$blog_image_frame = get_option('ka_blog_image_frame');
global $ttso;
$show_tools_panel = $ttso->ka_tools_panel;
?>
<div class="main-area">
<?php
/*
* Check to display or hide tools panel
* @since version 2.6 development
*/
if($show_tools_panel != 'false'):
?>
<div class="tools">
<div class="holder">
<div class="frame">
<?php truethemes_before_article_title_hook();// action hook, see truethemes_framework/global/hooks.php ?>
<?php
//@since 3.0.3, modified by denzel, the following titles are wrapped with _e() to make them translatable.
?>
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php /* If this is a category archive */ if (is_category()) { ?>
<h1><?php _e('Archive for','truethemes_localize');?> '<?php single_cat_title(); ?>'</h1>
<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
<h1><?php _e('Posts Tagged','truethemes_localize');?> '<?php single_tag_title(); ?>'</h1>
<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
<h1><?php _e('Archive for','truethemes_localize');?> <?php the_time('F jS, Y'); ?></h1>
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<h1><?php _e('Archive for','truethemes_localize');?> <?php the_time('F, Y'); ?></h1>
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<h1><?php _e('Archive for','truethemes_localize');?> <?php the_time('Y'); ?></h1>
<?php /* If this is an author archive */ } elseif (is_author()) { ?>
<h1><?php _e('Author Archive','truethemes_localize');?></h1>
<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h1><?php _e('Blog Archives','truethemes_localize');?></h1>
<?php } ?>
<?php if ($ka_searchbar == "true"){get_template_part('searchform','childtheme');} else {} ?>
<?php if ($ka_crumbs == "true"){ $bc = new simple_breadcrumb;} else {} ?>
<?php truethemes_after_searchform_hook();// action hook, see truethemes_framework/global/hooks.php ?>
</div><!-- end frame -->
</div><!-- end holder -->
</div><!-- end tools -->
<?php endif; //end show tools panel check @since version 2.6 dev ?>
<div class="main-holder">
<div id="content" class="content_blog">
<?php
//create a file in child theme called content-blog-childtheme.php to overwrite this.
get_template_part('theme-template-part-content-blog','childtheme');
?>
</div><!-- end content -->
<div id="sidebar" class="sidebar_blog">
<?php dynamic_sidebar("Blog Sidebar"); ?>
</div><!-- end sidebar -->
</div><!-- end main-holder -->
</div><!-- main-area -->
<?php get_footer(); ?> | paulwalker/schulteinsurance | wp-content/themes/Karma/archive.php | PHP | gpl-2.0 | 3,278 |
/*
Theme Name: BuddyBoss Child Theme
Theme URI: http://www.buddyboss.com/child-themes/
Description: A child theme of BuddyBoss. To ensure easy updates, make your own edits to BuddyBoss in this theme.
Author: BuddyBoss.com
Author URI: http://www.buddyboss.com
License: GNU General Public License v3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Template: buddyboss
Version: 3.1.6
*/
/*
-- Stylesheet locations --
Add your own customizations into /css/custom.css in this child theme.
Parent styles are called from /buddyboss-inc/theme-functions.php in the
parent theme and are located in /buddyboss/css/ in the parent theme.
--- If you are editing CSS via the WordPress admin, do the following ---
1. Install the plugin WP Editor: http://wordpress.org/plugins/wp-editor/
2. Navigate to Appearance > Theme Editor in the WordPress admin.
3. Navigate into the /css/ folder of your child theme to edit custom.css.
--- The styles are loaded in the following order ---
-- PARENT THEME --
1. buddyboss-slides.css BuddyBoss homepage slider
2. buddyboss-pics.css BuddyBoss photos (only if User Photo Uploading is activated)
3. wordpress.css WordPress styles (always loaded)
4. buddypress.css BuddyPress (only if BuddyPress is activated)
5. bbpress.css bbPress (only if bbPress is activated)
6. plugins.css Support for 3rd party plugins
7. adminbar-mobile.css adminbar (for phones) left and right slide out panels
8. adminbar-desktop-fixed.css adminbar (for large screens) set to 'Full Width' in Appearance > Customize
8. adminbar-desktop-floating.css adminbar (for large screens) set to 'Float Right' in Appearance > Customize
-- CHILD THEME --
9. custom.css
The later on a stylesheet is loaded, the higher precedent it gets.
So for example, if you define a CSS element in custom.css that has already
been defined in wordpress.css, the version in custom.css will be used.
Each stylesheet includes a table of contents to help you navigate
through it. You will notice that many of them include a section with
media queries. Media queries allow us to detect a browser's screen
size, and load specific styles only if the screen is larger or smaller
than that particular size. This allows us to define a large set of
global styles, and then specific styles for phones, tablets,
and desktops & laptops - just based on the predicted screen size
of these devices. That's boss!
*/
| illectronic/LeadTracker | wp-content/themes/buddyboss-child/buddyboss-child.backup/style.css | CSS | gpl-2.0 | 2,444 |
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>PHPXRef 0.7.1 : Unnamed Project : Variable Reference: $ecmp_email_title</title>
<link rel="stylesheet" href="../sample.css" type="text/css">
<link rel="stylesheet" href="../sample-print.css" type="text/css" media="print">
<style id="hilight" type="text/css"></style>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000" link="#801800" vlink="#300540" alink="#ffffff">
<table class="pagetitle" width="100%">
<tr>
<td valign="top" class="pagetitle">
[ <a href="../index.html">Index</a> ]
</td>
<td align="right" class="pagetitle">
<h2 style="margin-bottom: 0px">PHP Cross Reference of Unnamed Project</h2>
</td>
</tr>
</table>
<!-- Generated by PHPXref 0.7.1 at Sat Nov 21 22:13:19 2015 -->
<!-- PHPXref (c) 2000-2010 Gareth Watts - gareth@omnipotent.net -->
<!-- http://phpxref.sourceforge.net/ -->
<script src="../phpxref.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
ext='.html';
relbase='../';
subdir='_variables';
filename='index.html';
cookiekey='phpxref';
handleNavFrame(relbase, subdir, filename);
logVariable('ecmp_email_title');
// -->
</script>
<script language="JavaScript" type="text/javascript">
if (gwGetCookie('xrefnav')=='off')
document.write('<p class="navlinks">[ <a href="javascript:navOn()">Show Explorer<\/a> ]<\/p>');
else
document.write('<p class="navlinks">[ <a href="javascript:navOff()">Hide Explorer<\/a> ]<\/p>');
</script>
<noscript>
<p class="navlinks">
[ <a href="../nav.html" target="_top">Show Explorer</a> ]
[ <a href="index.html" target="_top">Hide Navbar</a> ]
</p>
</noscript>
[<a href="../index.html">Top level directory</a>]<br>
<script language="JavaScript" type="text/javascript">
<!--
document.writeln('<table align="right" class="searchbox-link"><tr><td><a class="searchbox-link" href="javascript:void(0)" onMouseOver="showSearchBox()">Search</a><br>');
document.writeln('<table border="0" cellspacing="0" cellpadding="0" class="searchbox" id="searchbox">');
document.writeln('<tr><td class="searchbox-title">');
document.writeln('<a class="searchbox-title" href="javascript:showSearchPopup()">Search History +</a>');
document.writeln('<\/td><\/tr>');
document.writeln('<tr><td class="searchbox-body" id="searchbox-body">');
document.writeln('<form name="search" style="margin:0px; padding:0px" onSubmit=\'return jump()\'>');
document.writeln('<a class="searchbox-body" href="../_classes/index.html">Class<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="classname"><br>');
document.writeln('<a id="funcsearchlink" class="searchbox-body" href="../_functions/index.html">Function<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="funcname"><br>');
document.writeln('<a class="searchbox-body" href="../_variables/index.html">Variable<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="varname"><br>');
document.writeln('<a class="searchbox-body" href="../_constants/index.html">Constant<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="constname"><br>');
document.writeln('<a class="searchbox-body" href="../_tables/index.html">Table<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="tablename"><br>');
document.writeln('<input type="submit" class="searchbox-button" value="Search">');
document.writeln('<\/form>');
document.writeln('<\/td><\/tr><\/table>');
document.writeln('<\/td><\/tr><\/table>');
// -->
</script>
<div id="search-popup" class="searchpopup"><p id="searchpopup-title" class="searchpopup-title">title</p><div id="searchpopup-body" class="searchpopup-body">Body</div><p class="searchpopup-close"><a href="javascript:gwCloseActive()">[close]</a></p></div>
<h3>Variable Cross Reference</h3>
<h2><a href="index.html#ecmp_email_title">$ecmp_email_title</a></h2>
<br><b>Referenced 2 times:</b><ul>
<li><a href="../inc/email_campaigns/model/_emailcampaign.class.php.html">/inc/email_campaigns/model/_emailcampaign.class.php</a> -> <a href="../inc/email_campaigns/model/_emailcampaign.class.php.source.html#l63"> line 63</a></li>
<li><a href="../inc/email_campaigns/views/_campaigns.view.php.html">/inc/email_campaigns/views/_campaigns.view.php</a> -> <a href="../inc/email_campaigns/views/_campaigns.view.php.source.html#l66"> line 66</a></li>
</ul>
<!-- A link to the phpxref site in your customized footer file is appreciated ;-) -->
<br><hr>
<table width="100%">
<tr><td>Generated: Sat Nov 21 22:13:19 2015</td>
<td align="right"><i>Cross-referenced by <a href="http://phpxref.sourceforge.net/">PHPXref 0.7.1</a></i></td>
</tr>
</table>
</body></html>
| mgsolipa/b2evolution_phpxref | _variables/ecmp_email_title.html | HTML | gpl-2.0 | 4,839 |
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.Infrastructure.Annotations;
using System.Data.Entity.ModelConfiguration.Configuration;
namespace QuizWebApp.Helpers
{
internal static class TypeConfigurationExtensions
{
public static PrimitivePropertyConfiguration HasUniqueIndexAnnotation(
this PrimitivePropertyConfiguration property,
string indexName,
int columnOrder)
{
var indexAttribute = new IndexAttribute(indexName, columnOrder) { IsUnique = true };
var indexAnnotation = new IndexAnnotation(indexAttribute);
return property.HasColumnAnnotation(IndexAnnotation.AnnotationName, indexAnnotation);
}
}
} | Samjayyy/Thesamwiser.WebQuizApp | QuizWebApp/Helpers/TypeConfigurationExtensions.cs | C# | gpl-2.0 | 750 |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.ssanalytics.snapshotplugin.domainModel.crawlerData.sqlWrapper.shared;
import org.ssanalytics.snapshotplugin.domainModel.crawlerData.contract.shared.ISharedLocation;
import org.ssanalytics.snapshotplugin.domainModel.crawlerData.sqlWrapper.superClasses.AbstractBaseDomainSql;
/**
*
* @author chw
*/
public class SharedLocationSql extends AbstractBaseDomainSql implements ISharedLocation {
private Double longitude;
private Double latitude;
private String city;
private String zip;
private String state;
private String country;
private String street;
public SharedLocationSql(Double longitude, Double latitude, String city, String street, String zip, String country, String state){
this.longitude = longitude;
this.latitude = latitude;
this.city = city;
this.street = street;
this.zip = zip;
this.country = country;
this.state = state;
}
@Override
public Double getLongitude() {
return this.longitude;
}
@Override
public Double getLatitude() {
return this.latitude;
}
@Override
public String getCity() {
return this.city;
}
@Override
public String getCountry() {
return this.country;
}
@Override
public String getStreet() {
return this.street;
}
@Override
public String getZip() {
return this.zip;
}
@Override
public String getState() {
return this.state;
}
}
| christianbors/snapshot-plugin | src/main/java/org/ssanalytics/snapshotplugin/domainModel/crawlerData/sqlWrapper/shared/SharedLocationSql.java | Java | gpl-2.0 | 1,646 |
#!/usr/bin/python
import csv
import datetime
import os
import copy
class Trip:
dols = []
dists = []
gals = []
octs = []
eths = []
drivers = []
tires = []
miles = 0
gallons = 0
actualGals = 0
days = 0
octane = 0
snowtires = 0
make = 0
model = 0
year = 0
engineIV = 0
enginecyl = 0
engineL = 0
ethanol = 0
driver = 0
avgMileage = 0
beginDate = 0
hybrid = 0
def write(self):
out = [self.miles,self.gallons,self.actualGals,self.dollars,self.days,self.octane,self.snowtires,self.make,self.model,self.year,self.engineIV,self.enginecyl,self.engineL,self.ethanol,self.driver,self.avgMileage,self.beginDate,self.hybrid]
return out
def clear(self):
self.dols[:] = []
self.dists[:] = []
self.gals[:] = []
self.octs[:] = []
self.eths[:] = []
self.drivers[:] = []
self.tires[:] = []
self.miles = 0
self.gallons = 0
self.actualGals = 0
self.days = 0
self.octane = 0
self.snowtires = 0
self.make = 0
self.model = 0
self.year = 0
self.engineIV = 0
self.enginecyl = 0
self.engineL = 0
self.ethanol = 0
self.driver = ""
self.avgMileage = 0
self.beginDate = 0
self.hybrid = 0
def wavg(series, weight):
avg = 0
if (weight[0] <= 0):
weight = weight[1:]
assert(len(series) == len(weight))
for i in range(len(weight)):
avg += float(series[i])*float(weight[i])/float(sum(weight))
return avg
def octaneCode(inOct):
if (inOct == 1):
return 87;
elif (inOct == 2):
return 89;
elif (inOct == 3):
return 93;
else:
print "Unknown octane code", inOct
assert(1 == 0)
def driverCode(driver):
if (driver == "Mark"):
return 0
elif (driver == "Mary"):
return 1
elif (driver == "Andy"):
return 2
elif (driver == "Jeff"):
return 3
else:
print "Unknown driver: ", driver
assert(1 == 0)
def makeCode(make):
if (make == "Chevrolet"):
return 0
elif (make == "Buick"):
return 1
elif (make == "Oldsmobile"):
return 2
elif (make == "Mercury"):
return 3
elif (make == "Plymouth"):
return 4
elif (make == "Volkswagen"):
return 5
elif (make == "Toyota"):
return 6
elif (make == "Honda"):
return 7
else:
print "Unknown make: ", make
assert(1 == 0)
def modelCode(model):
if (model == "Concourse"):
return 0
elif (model == "Vega"):
return 1
elif (model == "Century"):
return 2
elif (model == "Cierra"):
return 3
elif (model == "Sable"):
return 4
elif (model == "Voyager"):
return 5
elif (model == "Highlander"):
return 6
elif (model == "CRV"):
return 7
elif (model == "Jetta"):
return 8
else:
print "Unknown model: ", model
assert(1 == 0)
def gasTank(model,year):
if (model == "Concourse"):
return 21.0
elif (model == "Vega"):
return 16.0
elif (model == "Century"):
return 15.0
elif (model == "Cierra"):
return 15.7
elif (model == "Sable"):
return 16.0
elif (model == "Voyager"):
return 20.0
elif (model == "Highlander"):
if (year == 2003):
return 19.8
elif (year == 2008):
return 17.2
elif (model == "CRV"):
return 15.3
elif (model == "Jetta"):
return 14.5
else:
print "Unknown model: ", model
assert(1 == 0)
def dateMaker(date):
start = 0
while date.find("/",start) > -1:
start = date.find("/",start) + 1
year = date[start:]
if len(year) == 2:
if (int(year) > 50):
year = 1900 + int(year)
if (int(year) <= 50):
year = 2000 + int(year)
return date[0:start] + str(year)
def check(fill,gastype,driver,snowtires,ethanol,hybrid):
assert(fill == 0 or fill == 1)
assert(gastype == 1 or gastype == 2 or gastype == 3)
assert(driver == "Andy" or driver == "Mark" or driver == "Mary" or driver == "Jeff")
assert(snowtires == 0 or snowtires == 1)
assert(ethanol == 0 or ethanol == 1)
assert(hybrid == 0 or hybrid == 1)
#ethanol
def checkTrip(a):
a.miles = sum(a.dists)
a.dollars = sum(a.dols)
a.actualGals = sum(i for i in a.gals if i > 0)
a.gallons = sum(a.gals)
a.octane = wavg(a.octs,a.gals)
print "octane",a.octane
a.ethanol = wavg(a.eths,a.gals)
print "ethanol",a.ethanol
a.snowtires = wavg(a.tires,a.dists)
a.driver = sorted(a.drivers)[len(a.drivers)/2]
print a.beginDate
assert(min(a.dists) > 0)
assert(min(a.dols) > 0)
assert(a.days > 0)
assert(a.miles > 0)
assert(a.dollars > 0)
assert(a.gallons > 0)
def checkInterTrip(a,b):
print a.beginDate
print "mpg: ", a.miles/a.gallons, b.miles/b.gallons
print "price: ", a.dollars/a.actualGals, b.dollars/b.actualGals
if(abs((a.miles/a.gallons)/(b.miles/b.gallons) - 1) > 0.5):
status = raw_input("Press Enter to continue... (mpg)")
if(abs((a.dollars/a.actualGals)/(b.dollars/b.actualGals) - 1) > 0.2):
status = raw_input("Press Enter to continue... (price)")
print ""
def main(dir,outfile):
trips = []
for file in os.listdir(dir):
if not file.endswith('.csv'):
continue
print file
f = open(dir+file,'rU')
datareader = csv.reader(f, dialect = csv.excel_tab)
lineNum = 0
beginMiles = 0
beginDate = 0
for row in datareader:
lineNum += 1
line = str(row)
line = line[2:-2].split(',')
if (line[0] == "Date"):
continue
date = dateMaker(str(line[0]))
odometer = int(line[1])
fill = int(line[2])
gastype = int(line[3])
gallons = float(line[4])
dollars = float(line[5])
driver = str(line[6])
snowtires = int(line[7])
ethanol = int(line[8])
make = str(line[9])
model = str(line[10])
year = int(line[11])
engineL = float(line[12])
enginecyl = int(line[13])
engineIV = int(line[14])
hybrid = int(line[15])
if (fill == -1):
#begin trip
#make trip opject
a = Trip()
beginMiles = odometer
beginDate = date
beginOctane = 87
beginEthanol = 0
if (year >= 1994):
beginEthanol = 1
a.gals.append(gallons)
else:
#check and add to trip
a.dols.append(dollars)
a.gals.append(gallons)
a.dists.append(odometer - beginMiles)
a.octs.append(beginOctane)
a.eths.append(beginEthanol)
a.drivers.append(driverCode(driver))
a.tires.append(snowtires)
check(fill,gastype,driver,snowtires,ethanol,hybrid)
beginMiles = odometer
#update gas contents
tank = gasTank(model, year)
beginOctane = (gallons * octaneCode(gastype) + (tank - gallons) * beginOctane) / tank
beginEthanol = (gallons * ethanol + (tank - gallons) * beginEthanol) / tank
if (fill == 1):
#end trip
tripMiles = sum(a.dists)
dateobj1 = datetime.datetime.strptime(beginDate,'%m/%d/%Y').date()
dateobj2 = datetime.datetime.strptime(date,'%m/%d/%Y').date()
tripDate = dateobj2 - dateobj1
tripDays = tripDate.days
if (tripDays == 0):
tripDays += 1
a.days = tripDays
a.make = makeCode(make)
a.model = modelCode(model)
a.year = year
a.engineIV = engineIV
a.enginecyl = enginecyl
a.engineL = engineL
a.beginDate = beginDate
a.hybrid = hybrid
a.avgMileage = odometer - 0.5*tripMiles
#check and save trip
checkTrip(a)
if (len(trips) > 0):
checkInterTrip(a,trips[-1])
trips.append(copy.deepcopy(a))
#reset dollars and gallons
#make trip opject
a.clear()
beginDate = date
beginMiles = odometer
fo = open(outfile,'wb')
datareader = csv.writer(fo, delimiter=',')
#print trips
for thisTrip in trips:
out = thisTrip.write()
datareader.writerow(out)
dir = './raw/'
outfile = './car_data.csv'
main(dir,outfile)
| andybond13/fontina | fontina.py | Python | gpl-2.0 | 7,414 |
<!DOCTYPE html>
<html>
<head>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:600italic,400,700,600' rel='stylesheet' type='text/css' />
<style type="text/css">
<!--
body {
width: 80%;
color: #343434;
margin: 1em auto;
font-family: 'Open Sans', Verdana, sans-serif;
}
details {
font-size: 18px;
line-height: 25px;
margin-bottom: 2em;
display: block;
}
details summary {
padding: 1em;
margin-bottom: 1em;
display: block;
}
details.error summary {
background-color: #ffd5d5;
}
details.warning summary {
background-color: #fff3bb;
}
a {
color: #095cb1;
font-weight: bold;
text-decoration: none;
}
h5 {
font-size: 1em;
}
aside {
font-style: italic;
line-height: 20px;
font-size: 15px;
}
.group {
border: 1px solid #ececec;
padding: 1em;
display: block;
}
.group > summary {
padding: 0;
color: #c8c8c8;
margin-bottom: 0;;
font-weight: bold;
letter-spacing: .1em;
text-transform: uppercase;
display: block;
}
.group[open] > summary {
margin-bottom: 1em;
}
.group > details:last-child {
margin-bottom: 0;
}
-->
</style>
</head>
<body>
<details open="true" class="group">
<summary></summary>
<details class="warning">
<summary>Many common functions, shared variables, and constants have been renamed.</summary>
<h5>Documentation</h5>
<ul>
<li><a target="_blank" href="https://www.drupal.org/node/2324935">The global theme variables have been replaced by an ActiveTheme object</a></li>
</ul>
</details>
<details class="error">
<summary>Module info files' <code>core</code> key must have a value of <code>8.x</code>.</summary>
<h5>Documentation</h5>
<ul>
<li><a target="_blank" href="https://www.drupal.org/node/1935708"><code>.info</code> files are now <code>.info.yml</code> files</a></li>
</ul>
<h5>Files Affected</h5>
<ul>
<li>/Users/jpamental/Sites/devdesktop/drupal-8.1.1/modules/typogrify/typogrify.info</li>
</ul>
<aside>Flagged by info</aside> </details>
<details class="error">
<summary>Info files must contain a <code>type</code> key.</summary>
<h5>Documentation</h5>
<ul>
<li><a target="_blank" href="https://www.drupal.org/node/1935708#type"><code>.info</code> files are now <code>.info.yml</code> files</a></li>
</ul>
<h5>Files Affected</h5>
<ul>
<li>/Users/jpamental/Sites/devdesktop/drupal-8.1.1/modules/typogrify/typogrify.info</li>
</ul>
<aside>Flagged by info</aside> </details>
<details class="error">
<summary>Modules no longer declare classes in their info file.</summary>
<h5>Documentation</h5>
<ul>
<li><a target="_blank" href="https://www.drupal.org/node/1935708#files"><code>.info</code> files are now <code>.info.yml</code> files</a></li>
</ul>
<h5>Files Affected</h5>
<ul>
<li>/Users/jpamental/Sites/devdesktop/drupal-8.1.1/modules/typogrify/typogrify.info</li>
</ul>
<aside>Flagged by info</aside> </details>
<details class="error">
<summary>Classes must be PSR-4 compliant.</summary>
<h5>Documentation</h5>
<ul>
<li><a target="_blank" href="https://www.drupal.org/node/2246699">PSR-4 compatible class loader in Drupal core</a></li>
</ul>
</details>
<details class="error">
<summary>Automated web tests must be in a PSR-4 namespace, and unit tests must be converted to PHPUnit.</summary>
<h5>Documentation</h5>
<ul>
<li><a target="_blank" href="https://www.drupal.org/node/1543796">Namespacing of automated tests has changed</a></li>
<li><a target="_blank" href="https://www.drupal.org/node/2301125"><code>getInfo()</code> in test classes replaced by doc comments</a></li>
<li><a target="_blank" href="https://www.drupal.org/node/1710766">Test classes should define a <code>$modules</code> property declaring dependencies</a></li>
<li><a target="_blank" href="https://www.drupal.org/node/1911318">SimpleTest tests now use empty "testing" profile by default</a></li>
<li><a target="_blank" href="https://www.drupal.org/node/1829160">New <code>KernelTestBase</code> class for API-level integration tests</a></li>
<li><a target="_blank" href="https://www.drupal.org/node/2012184">PHPUnit added to Drupal core</a></li>
</ul>
</details>
</details>
</body>
</html>
| jpamental/typogrify | upgrade-info.html | HTML | gpl-2.0 | 4,910 |
import itertools
import subprocess
import sys
#http://pastebin.com/zj72xk4N
#run when system password box is showing eg. keychain password dialog
#apple script for automating dialog box input
sys_script = '''
tell application "System Events" to tell process "SecurityAgent"
set value of text field 1 of window 1 to $(PASS)
click button 1 of group 1 of window 1
end tell
'''
#fill this array with chars for combination
keys = ['s','t','a','r','t']
def automate_login():
for l in xrange(0, len(keys)+1):
for subset in itertools.permutations(keys, l):
guess = ''.join(subset)
tmp = sys_script.replace('$(PASS)', '"%s"' % guess)
try:
subprocess.check_output('osascript -e \'%s\'' % tmp, shell=True)
sys.stdout.write('\rtrying %s ' % guess)
sys.stdout.flush()
except subprocess.CalledProcessError:
print('\nfailed')
return
return
automate_login() | Jacobious52/PythonLab | osxpasscrack.py | Python | gpl-2.0 | 886 |
<?php
/**
* @copyright 2009-2017 Vanilla Forums Inc.
* @license http://www.opensource.org/licenses/gpl-2.0.php GNU GPL v2
* @package EmojiExtender
*/
$PluginInfo['EmojiExtender'] = array(
'Name' => "Emoji Sets",
'Description' => "Change your emoji set!",
'Version' => '1.1',
'Author' => "Becky Van Bussel",
'AuthorEmail' => 'rvanbussel@vanillaforums.com',
'AuthorUrl' => 'http://vanillaforums.com',
'License' => 'GNU GPL2',
'Icon' => 'emoji_set.png',
'SettingsUrl' => '/settings/EmojiExtender',
'MobileFriendly' => true
);
/**
* Emoji Extender Plugin
*
* @author Becky Van Bussel <rvanbussel@vanillaforums.com>
* @copyright 2015 Vanilla Forums Inc.
* @license GNU GPL2
* @package EmojiExtender
* @since 1.0.0
*
* Users can change or delete emoji sets for their forums.
*/
class EmojiExtenderPlugin extends Gdn_Plugin {
/**
* @var array List of all available emoji sets.
*/
protected $emojiSets;
/**
* Setup some variables and change emoji set.
*/
public function __construct() {
parent::__construct();
}
/**
* Change the emoji set used, either by merging or or overriding the default set.
*
* @param Emoji $emoji The emoji object to change.
* @param string $emojiSetKey The name of the emoji set to enable.
*/
public function changeEmojiSet($emoji, $emojiSetKey) {
if (!array_key_exists($emojiSetKey, $this->getEmojiSets())) {
trigger_error("Emoji set not found: $emojiSetKey.", E_USER_NOTICE);
return;
}
// First grab the manifest to the emoji.
$emojiSet = $this->emojiSets[$emojiSetKey];
$manifest = $this->getManifest($emojiSet);
if ($manifest) {
$emoji->setFromManifest($manifest, $emojiSet['basePath']);
}
}
/**
* Get the manifest for am emoji set.
*
* @param array $emojiSet The emoji set to look up.
* @return array|null Returns the manifest on success,
* `false` if the emoji should be disabled, or `null` otherwise.
*/
protected function getManifest($emojiSet) {
$manifest = val('manifest', $emojiSet);
if (!$manifest) {
return null; // this is the default emoji set.
} elseif (is_string($manifest)) {
if (!file_exists($manifest)) {
trigger_error("Emoji manifest does not exist: $manifest.", E_USER_NOTICE);
return null;
}
try {
$manifest = require $manifest;
} catch (Exception $ex) {
trigger_error($ex->getMessage(), E_USER_NOTICE);
return null;
}
}
if (!is_array($manifest)) {
trigger_error("Invalid emoji manifest. The manifest is not an array.", E_USER_NOTICE);
return null;
}
return $manifest;
}
/**
* Add an emoji set.
*
* @param string $key The key that defines the emoji set.
* @param string|array $manifest The path to the manifest or the manifest itself.
* @param string $basePath The url path to the emoji.
* @param string $iconPath The url path to the icon.
*/
public function addEmojiSet($key, $manifest, $basePath) {
$this->emojiSets[$key] = array(
'manifest' => $manifest,
'basePath' => $basePath
);
}
/**
* Get all of the registered emoji sets.
*
* @return array Returns an array of all of the emoji sets.
*/
public function getEmojiSets() {
if (!isset($this->emojiSets)) {
$root = '/plugins/EmojiExtender/emoji';
$this->addEmojiSet(
'',
array(
'name' => 'Apple Emoji',
'author' => 'Apple Inc.',
'description' => 'A modern set of emoji you might recognize from any of your ubiquitous iDevices.',
'icon' => 'icon.png'
),
'/resources/emoji'
);
$this->addEmojiSet('twitter', PATH_ROOT."$root/twitter/manifest.php", "$root/twitter");
$this->addEmojiSet('little', PATH_ROOT."$root/little/manifest.php", "$root/little");
$this->addEmojiSet('rice', PATH_ROOT."$root/rice/manifest.php", "$root/rice");
$this->addEmojiSet('yahoo', PATH_ROOT."$root/yahoo/manifest.php", "$root/yahoo");
$this->fireEvent('Init');
$this->addEmojiSet('none', PATH_ROOT."$root/none/manifest.php", "$root/none");
}
return $this->emojiSets;
}
/**
* Subscribe to event in Emoji class instance method.
*
* @param Emoji $sender
* @param array $args
*/
public function emoji_init_handler($sender, $args) {
// Get the currently selected emoji set & switch to it.
$emojiSetKey = c('Garden.EmojiSet');
if (!$emojiSetKey || !array_key_exists($emojiSetKey, $this->getEmojiSets())) {
return;
}
$this->changeEmojiSet($sender, $emojiSetKey);
}
/**
* Configure settings page in dashboard.
*
* @param SettingsController $sender
* @param array $args
*/
public function settingsController_emojiExtender_create($sender, $args) {
$sender->permission('Garden.Settings.Manage');
$cf = new ConfigurationModule($sender);
$items = array();
foreach ($this->getEmojiSets() as $key => $emojiSet) {
$manifest = $this->getManifest($emojiSet);
$selected = '<svg class="icon icon-svg-checkmark" viewBox="0 0 17 17"><use xlink:href="#checkmark" /></svg>';
$icon = (isset($manifest['icon'])) ? img($emojiSet['basePath'].'/'.$manifest['icon'], array('alt' => $manifest['name'], 'class' => 'label-selector-image')) : '';
$items[$key] =
'@<div class="image-wrap">'.
$icon.
'<div class="overlay">'.
'<div class="buttons">'.
'<a class="btn btn-overlay">'.t('Select').'</a>'.
'</div>'.
'<div class="selected">'.$selected.'</div>'.
'</div>'.
'</div>'.
'<div emojiset-body>'.
'<div><b>'.htmlspecialchars($manifest['name']).'</b></div>'.
(empty($manifest['author']) ? '' : '<div class="emojiset-author info">'.sprintf(t('by %s'), $manifest['author']).'</div>').
(empty($manifest['description']) ? '' : '<p class="emojiset-description">'.Gdn_Format::wysiwyg($manifest['description']).'</p>').
'</div>';
}
$cf->initialize(array(
'Garden.EmojiSet' => array(
'LabelCode' => 'Emoji Set',
'Control' => 'radiolist',
'Items' => $items,
'Options' => array('list' => true, 'list-item-class' => 'label-selector-item', 'listclass' => 'emojiext-list label-selector', 'display' => 'after', 'class' => 'label-selector-input', 'no-grid' => true)
),
//If ever you want the functionality to merge the custom emoji set with the default set, uncomment below
//'Plugins.EmojiExtender.merge' => array('LabelCode' => 'Merge set', 'Control' => 'Checkbox', 'Description' => '<p>Would you like to merge the selected emoji set with the default set?</p> <p><small><strong>Note:</strong> Some emojis in the default set may not be represented in the selected set and vice-versa.</small></p>'),
));
$sender->setData('Title', t('Choose Your Emoji Set'));
$cf->renderAll();
}
}
| rwmcoder/Vanilla | plugins/EmojiExtender/class.emojiextender.plugin.php | PHP | gpl-2.0 | 7,756 |
/*
*********************************************************************
REPORT.C -- Reporting Routines for EPANET Program
VERSION: 2.00
DATE: 5/30/00
6/24/02
8/15/07 (2.00.11)
2/14/08 (2.00.12)
AUTHOR: L. Rossman
US EPA - NRMRL
This module contains various procedures (all beginning with
'write') that are called from other modules to write formatted
output to a report file.
It also contains function disconnected(), called from writehydwarn()
and writehyderr(), that checks if a hydraulic solution causes a
network to become disconnected.
The function writeline(S) is used throughout to write a
formatted string S to the report file.
********************************************************************
*/
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <math.h>
#include <time.h>
#ifdef ENABLE_NLS
#include <libintl.h>
#else
#define _(string) string
#endif
#include <locale.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#else
#define CLE 1
#endif
#include "hash.h"
#include "text.h"
#include "types.h"
#include "funcs.h"
#define EXTERN extern
#include "vars.h"
#define MAXCOUNT 10 /* Max. # of disconnected nodes listed */
long LineNum; /* Current line number */
long PageNum; /* Current page number */
char DateStamp[26]; /* Current date & time */
char Fprinterr; /* File write error flag */
/* Defined in enumstxt.h in EPANET.C */
extern char *NodeTxt[];
extern char *LinkTxt[];
extern char *StatTxt[];
extern char *TstatTxt[];
extern char *LogoTxt[];
extern char *RptFormTxt[];
typedef REAL4 *Pfloat;
void writenodetable(Pfloat *);
void writelinktable(Pfloat *);
int writereport()
/*
**------------------------------------------------------
** Input: none
** Output: returns error code
** Purpose: writes formatted output report to file
**
** Calls strcomp() from the EPANET.C module.
**------------------------------------------------------
*/
{
char tflag;
FILE *tfile;
int errcode = 0;
/* If no secondary report file specified then */
/* write formatted output to primary report file. */
Fprinterr = FALSE;
if (Rptflag && strlen(Rpt2Fname) == 0 && RptFile != NULL)
{
writecon(FMT17);
writecon(Rpt1Fname);
if (Energyflag) writeenergy();
errcode = writeresults();
}
/* A secondary report file was specified */
else if (strlen(Rpt2Fname) > 0)
{
/* If secondary report file has same name as either input */
/* or primary report file then use primary report file. */
if (strcomp(Rpt2Fname,InpFname) ||
strcomp(Rpt2Fname,Rpt1Fname))
{
writecon(FMT17);
writecon(Rpt1Fname);
if (Energyflag) writeenergy();
errcode = writeresults();
}
/* Otherwise write report to secondary report file. */
else
{
/* Try to open file */
tfile = RptFile;
tflag = Rptflag;
if ((RptFile = fopen(Rpt2Fname,"wt")) == NULL)
{
RptFile = tfile;
Rptflag = tflag;
errcode = 303;
}
/* Write full formatted report to file */
else
{
Rptflag = 1;
writecon(FMT17);
writecon(Rpt2Fname);
writelogo();
if (Summaryflag) writesummary();
if (Energyflag) writeenergy();
errcode = writeresults();
fclose(RptFile);
RptFile = tfile;
Rptflag = tflag;
}
}
}
/* Special error handler for write-to-file error */
if (Fprinterr) errmsg(309);
return(errcode);
} /* End of writereport */
void writelogo()
/*
**--------------------------------------------------------------
** Input: none
** Output: none
** Purpose: writes program logo to report file.
**--------------------------------------------------------------
*/
{
int i;
time_t timer; /* time_t structure & functions time() & */
/* ctime() are defined in time.h */
time(&timer);
strcpy(DateStamp,ctime(&timer));
PageNum = 1;
LineNum = 2;
fprintf(RptFile,FMT18);
fprintf(RptFile,"%s",DateStamp);
for (i=0; LogoTxt[i] != NULL; i++) writeline(_(LogoTxt[i]));
writeline("");
} /* End of writelogo */
void writesummary()
/*
**--------------------------------------------------------------
** Input: none
** Output: none
** Purpose: writes summary system information to report file
**--------------------------------------------------------------
*/
{
char s[MAXFNAME+1];
int i;
int nres = 0;
for (i=0; i<3; i++)
{
if (strlen(Title[i]) > 0)
{
sprintf(s,"%-.70s",Title[i]);
writeline(s);
}
}
writeline(" ");
sprintf(s,FMT19,InpFname);
writeline(s);
sprintf(s,FMT20,Njuncs);
writeline(s);
for (i=1; i<=Ntanks; i++)
if (Tank[i].A == 0.0) nres++;
sprintf(s,FMT21a,nres);
writeline(s);
sprintf(s,FMT21b,Ntanks-nres);
writeline(s);
sprintf(s,FMT22,Npipes);
writeline(s);
sprintf(s,FMT23,Npumps);
writeline(s);
sprintf(s,FMT24,Nvalves);
writeline(s);
sprintf(s,FMT25,RptFormTxt[Formflag]);
writeline(s);
sprintf(s,FMT26,Hstep*Ucf[TIME],Field[TIME].Units);
writeline(s);
sprintf(s,FMT27,Hacc);
writeline(s);
sprintf(s,FMT27a,CheckFreq); //(2.00.12 - LR)
writeline(s); //(2.00.12 - LR)
sprintf(s,FMT27b,MaxCheck); //(2.00.12 - LR)
writeline(s); //(2.00.12 - LR)
sprintf(s,FMT27c,DampLimit); //(2.00.12 - LR)
writeline(s); //(2.00.12 - LR)
sprintf(s,FMT28,MaxIter);
writeline(s);
if (Qualflag == NONE || Dur == 0.0)
sprintf(s,FMT29);
else if (Qualflag == CHEM)
sprintf(s,FMT30,ChemName);
else if (Qualflag == TRACE)
sprintf(s,FMT31,Node[TraceNode].ID);
else if (Qualflag == AGE)
sprintf(s,FMT32);
writeline(s);
if (Qualflag != NONE && Dur > 0)
{
sprintf(s,FMT33,(float)Qstep/60.0);
writeline(s);
sprintf(s,FMT34,Ctol*Ucf[QUALITY],Field[QUALITY].Units);
writeline(s);
}
sprintf(s,FMT36,SpGrav);
writeline(s);
sprintf(s,FMT37a,Viscos/VISCOS);
writeline(s);
sprintf(s,FMT37b,Diffus/DIFFUS);
writeline(s);
sprintf(s,FMT38,Dmult);
writeline(s);
sprintf(s,FMT39,Dur*Ucf[TIME],Field[TIME].Units);
writeline(s);
if (Rptflag)
{
sprintf(s,FMT40);
writeline(s);
if (Nodeflag == 0) writeline(FMT41);
if (Nodeflag == 1) writeline(FMT42);
if (Nodeflag == 2) writeline(FMT43);
writelimits(DEMAND,QUALITY);
if (Linkflag == 0) writeline(FMT44);
if (Linkflag == 1) writeline(FMT45);
if (Linkflag == 2) writeline(FMT46);
writelimits(DIAM,HEADLOSS);
}
writeline(" ");
} /* End of writesummary */
void writehydstat(int iter, double relerr)
/*
**--------------------------------------------------------------
** Input: iter = # iterations to find hydraulic solution
** relerr = convergence error in hydraulic solution
** Output: none
** Purpose: writes hydraulic status report for solution found
** at current time period to report file
**--------------------------------------------------------------
*/
{
int i,n;
char newstat;
char s1[MAXLINE+1];
/*** Updated 6/24/02 ***/
char atime[13];
/* Display system status */
strcpy(atime,clocktime(Atime,Htime));
if (iter > 0)
{
if (relerr <= Hacc)
sprintf(s1,FMT58,atime,iter);
else
sprintf(s1,FMT59,atime,iter,relerr);
writeline(s1);
}
/*
Display status changes for tanks.
D[n] is net inflow to tank at node n.
Old tank status is stored in OldStat[]
at indexes Nlinks+1 to Nlinks+Ntanks.
*/
for (i=1; i<=Ntanks; i++)
{
n = Tank[i].Node;
if (ABS(D[n]) < 0.001) newstat = CLOSED;
else if (D[n] > 0.0) newstat = FILLING;
else if (D[n] < 0.0) newstat = EMPTYING;
else newstat = OldStat[Nlinks+i];
if (newstat != OldStat[Nlinks+i])
{
if (Tank[i].A > 0.0)
sprintf(s1,FMT50,atime,Node[n].ID,_(StatTxt[newstat]),
(H[n]-Node[n].El)*Ucf[HEAD],Field[HEAD].Units);
else sprintf(s1,FMT51,atime,Node[n].ID,_(StatTxt[newstat]));
writeline(s1);
OldStat[Nlinks+i] = newstat;
}
}
/* Display status changes for links */
for (i=1; i<=Nlinks; i++)
{
if (S[i] != OldStat[i])
{
if (Htime == 0)
sprintf(s1,FMT52,atime,LinkTxt[Link[i].Type],Link[i].ID,
_(StatTxt[S[i]]));
else sprintf(s1,FMT53,atime,LinkTxt[Link[i].Type],Link[i].ID,
_(StatTxt[OldStat[i]]),_(StatTxt[S[i]]));
writeline(s1);
OldStat[i] = S[i];
}
}
writeline(" ");
} /* End of writehydstat */
void writeenergy()
/*
**-------------------------------------------------------------
** Input: none
** Output: none
** Purpose: writes energy usage report to report file
**-------------------------------------------------------------
*/
{
int j;
double csum;
char s[MAXLINE+1];
if (Npumps == 0) return;
writeline(" ");
writeheader(ENERHDR,0);
csum = 0.0;
for (j=1; j<=Npumps; j++)
{
csum += Pump[j].Energy[5];
if (LineNum == (long)PageSize) writeheader(ENERHDR,1);
sprintf(s,"%-8s %6.2f %6.2f %9.2f %9.2f %9.2f %9.2f",
Link[Pump[j].Link].ID,Pump[j].Energy[0],Pump[j].Energy[1],
Pump[j].Energy[2],Pump[j].Energy[3],Pump[j].Energy[4],
Pump[j].Energy[5]);
writeline(s);
}
fillstr(s,'-',63);
writeline(s);
/*** Updated 6/24/02 ***/
sprintf(s,FMT74,"",Emax*Dcost);
writeline(s);
sprintf(s,FMT75,"",csum+Emax*Dcost);
/*** End of update ***/
writeline(s);
writeline(" ");
} /* End of writeenergy */
int writeresults()
/*
**--------------------------------------------------------------
** Input: none
** Output: returns error code
** Purpose: writes simulation results to report file
**--------------------------------------------------------------
*/
{
Pfloat *x; /* Array of pointers to floats */
int j,m,n,np,nnv,nlv;
int errcode = 0;
/*
**-----------------------------------------------------------
** NOTE: The OutFile contains results for 4 node variables
** (demand, head, pressure, & quality) and 8 link
** variables (flow, velocity, headloss, quality,
** status, setting, reaction rate & friction factor)
** at each reporting time.
**-----------------------------------------------------------
*/
/* Return if no output file */
if (OutFile == NULL) return(106);
/* Return if no nodes or links selected for reporting */
/* or if no node or link report variables enabled. */
if (!Nodeflag && !Linkflag) return(errcode);
nnv = 0;
for (j=ELEV; j<=QUALITY; j++) nnv += Field[j].Enabled;
nlv = 0;
for (j=LENGTH; j<=FRICTION; j++) nlv += Field[j].Enabled;
if (nnv == 0 && nlv == 0) return(errcode);
/* Allocate memory for output variables. */
/* m = larger of # node variables & # link variables */
/* n = larger of # nodes & # links */
m = MAX( (QUALITY-DEMAND+1), (FRICTION-FLOW+1) );
n = MAX( (Nnodes+1), (Nlinks+1));
x = (Pfloat *) calloc(m, sizeof(Pfloat));
ERRCODE( MEMCHECK(x) );
if (errcode) return(errcode);
for (j=0; j<m; j++)
{
x[j] = (REAL4 *) calloc(n, sizeof(REAL4));
ERRCODE( MEMCHECK(x[j]) );
}
if (errcode) return(errcode);
/* Re-position output file & initialize report time. */
fseek(OutFile,OutOffset2,SEEK_SET);
Htime = Rstart;
/* For each reporting time: */
for (np=1; np<=Nperiods; np++)
{
/* Read in node results & write node table. */
/* (Remember to offset x[j] by 1 because array is zero-based). */
for (j=DEMAND; j<=QUALITY; j++)
fread((x[j-DEMAND])+1,sizeof(REAL4),Nnodes,OutFile);
if (nnv > 0 && Nodeflag > 0) writenodetable(x);
/* Read in link results & write link table. */
for (j=FLOW; j<=FRICTION; j++)
fread((x[j-FLOW])+1,sizeof(REAL4),Nlinks,OutFile);
if (nlv > 0 && Linkflag > 0) writelinktable(x);
Htime += Rstep;
}
/* Free allocated memory */
for (j=0; j<m; j++) free(x[j]);
free(x);
return(errcode);
} /* End of writereport */
void writenodetable(Pfloat *x)
/*
**---------------------------------------------------------------
** Input: x = pointer to node results for current time
** Output: none
** Purpose: writes node results for current time to report file
**---------------------------------------------------------------
*/
{
int i,j;
char s[MAXLINE+1],s1[16];
double y[MAXVAR];
/* Write table header */
writeheader(NODEHDR,0);
/* For each node: */
for (i=1; i<=Nnodes; i++)
{
/* Place results for each node variable in y */
y[ELEV] = Node[i].El*Ucf[ELEV];
for (j=DEMAND; j<=QUALITY; j++) y[j] = *((x[j-DEMAND])+i);
/* Check if node gets reported on */
if ((Nodeflag == 1 || Node[i].Rpt) && checklimits(y,ELEV,QUALITY))
{
/* Check if new page needed */
if (LineNum == (long)PageSize) writeheader(NODEHDR,1);
/* Add node ID and each reported field to string s */
sprintf(s,"%-15s",Node[i].ID);
for (j=ELEV; j<=QUALITY; j++)
{
if (Field[j].Enabled == TRUE)
{
/*** Updated 6/24/02 ***/
if (fabs(y[j]) > 1.e6) sprintf(s1, "%10.2e", y[j]);
else sprintf(s1, "%10.*f", Field[j].Precision, y[j]);
/*** End of update ***/
strcat(s, s1);
}
}
/* Note if node is a reservoir/tank */
if (i > Njuncs)
{
strcat(s, " ");
strcat(s, NodeTxt[getnodetype(i)]);
}
/* Write results for node */
writeline(s);
}
}
writeline(" ");
}
void writelinktable(Pfloat *x)
/*
**---------------------------------------------------------------
** Input: x = pointer to link results for current time
** Output: none
** Purpose: writes link results for current time to report file
**---------------------------------------------------------------
*/
{
int i,j,k;
char s[MAXLINE+1],s1[16];
double y[MAXVAR];
/* Write table header */
writeheader(LINKHDR,0);
/* For each link: */
for (i=1; i<=Nlinks; i++)
{
/* Place results for each link variable in y */
y[LENGTH] = Link[i].Len*Ucf[LENGTH];
y[DIAM] = Link[i].Diam*Ucf[DIAM];
for (j=FLOW; j<=FRICTION; j++) y[j] = *((x[j-FLOW])+i);
/* Check if link gets reported on */
if ((Linkflag == 1 || Link[i].Rpt) && checklimits(y,DIAM,FRICTION))
{
/* Check if new page needed */
if (LineNum == (long)PageSize) writeheader(LINKHDR,1);
/* Add link ID and each reported field to string s */
sprintf(s,"%-15s",Link[i].ID);
for (j=LENGTH; j<=FRICTION; j++)
{
if (Field[j].Enabled == TRUE)
{
if (j == STATUS)
{
if (y[j] <= CLOSED) k = CLOSED;
else if (y[j] == ACTIVE) k = ACTIVE;
else k = OPEN;
sprintf(s1, "%10s", _(StatTxt[k]));
}
/*** Updated 6/24/02 ***/
else
{
if (fabs(y[j]) > 1.e6) sprintf(s1, "%10.2e", y[j]);
else sprintf(s1, "%10.*f", Field[j].Precision, y[j]);
}
/*** End of update ***/
strcat(s, s1);
}
}
/* Note if link is a pump or valve */
if ( (j = Link[i].Type) > PIPE)
{
strcat(s, " ");
strcat(s, LinkTxt[j]);
}
/* Write results for link */
writeline(s);
}
}
writeline(" ");
}
void writeheader(int type, int contin)
/*
**--------------------------------------------------------------
** Input: type = table type
** contin = table continuation flag
** Output: none
** Purpose: writes column headings for output report tables
**--------------------------------------------------------------
*/
{
char s[MAXLINE+1],s1[MAXLINE+1],s2[MAXLINE+1],s3[MAXLINE+1];
int i,n;
/* Move to next page if < 11 lines remain on current page. */
if (Rptflag && LineNum+11 > (long)PageSize)
{
while (LineNum < (long)PageSize) writeline(" ");
}
writeline(" ");
/* Hydraulic Status Table */
if (type == STATHDR)
{
sprintf(s,FMT49);
if (contin) strcat(s,t_CONTINUED);
writeline(s);
fillstr(s,'-',70);
writeline(s);
}
/* Energy Usage Table */
if (type == ENERHDR)
{
if (Unitsflag == SI) strcpy(s1,t_perM3);
else strcpy(s1,t_perMGAL);
sprintf(s,FMT71);
if (contin) strcat(s,t_CONTINUED);
writeline(s);
fillstr(s,'-',63);
writeline(s);
sprintf(s,FMT72);
writeline(s);
sprintf(s,FMT73,s1);
writeline(s);
fillstr(s,'-',63);
writeline(s);
}
/* Node Results Table */
if (type == NODEHDR)
{
if (Tstatflag == RANGE) sprintf(s,FMT76,t_DIFFER);
else if (Tstatflag != SERIES) sprintf(s,FMT76,_(TstatTxt[Tstatflag]));
else if (Dur == 0) sprintf(s,FMT77);
else sprintf(s,FMT78,clocktime(Atime,Htime));
if (contin) strcat(s,t_CONTINUED);
writeline(s);
n = 15;
sprintf(s2,"%15s","");
strcpy(s,t_NODEID);
sprintf(s3,"%-15s",s);
for (i=ELEV; i<QUALITY; i++) if (Field[i].Enabled == TRUE)
{
n += 10;
sprintf(s,"%10s",Field[i].Name);
strcat(s2,s);
sprintf(s,"%10s",Field[i].Units);
strcat(s3,s);
}
if (Field[QUALITY].Enabled == TRUE)
{
n += 10;
sprintf(s,"%10s",ChemName);
strcat(s2,s);
sprintf(s,"%10s",ChemUnits);
strcat(s3,s);
}
fillstr(s1,'-',n);
writeline(s1);
writeline(s2);
writeline(s3);
writeline(s1);
}
/* Link Results Table */
if (type == LINKHDR)
{
if (Tstatflag == RANGE) sprintf(s,FMT79,t_DIFFER);
else if (Tstatflag != SERIES) sprintf(s,FMT79,_(TstatTxt[Tstatflag]));
else if (Dur == 0) sprintf(s,FMT80);
else sprintf(s,FMT81,clocktime(Atime,Htime));
if (contin) strcat(s,t_CONTINUED);
writeline(s);
n = 15;
sprintf(s2,"%15s","");
strcpy(s,t_LINKID);
sprintf(s3,"%-15s",s);
for (i=LENGTH; i<=FRICTION; i++) if (Field[i].Enabled == TRUE)
{
n += 10;
sprintf(s,"%10s",Field[i].Name);
strcat(s2,s);
sprintf(s,"%10s",Field[i].Units);
strcat(s3,s);
}
fillstr(s1,'-',n);
writeline(s1);
writeline(s2);
writeline(s3);
writeline(s1);
}
} /* End of writeheader */
void writeline(char *s)
/*
**--------------------------------------------------------------
** Input: *s = text string
** Output: none
** Purpose: writes a line of output to report file
**--------------------------------------------------------------
*/
{
if (RptFile == NULL) return;
if (Rptflag)
{
if (LineNum == (long)PageSize)
{
PageNum++;
if (fprintf(RptFile,FMT82,PageNum,Title[0]) == EOF)
Fprinterr = TRUE;
LineNum = 3;
}
}
if (fprintf(RptFile,"\n %s",s) == EOF) Fprinterr = TRUE;
LineNum++;
} /* End of writeline */
void writerelerr(int iter, double relerr)
/*
**-----------------------------------------------------------------
** Input: iter = current iteration of hydraulic solution
** relerr = current convergence error
** Output: none
** Purpose: writes out convergence status of hydraulic solution
**-----------------------------------------------------------------
*/
{
if (iter == 0)
{
sprintf(Msg, FMT64, clocktime(Atime,Htime));
writeline(Msg);
}
else
{
sprintf(Msg,FMT65,iter,relerr);
writeline(Msg);
}
} /* End of writerelerr */
void writestatchange(int k, char s1, char s2)
/*
**--------------------------------------------------------------
** Input: k = link index
** s1 = old link status
** s2 = new link status
** Output: none
** Purpose: writes change in link status to output report
**--------------------------------------------------------------
*/
{
int j1,j2;
double setting;
/* We have a pump/valve setting change instead of a status change */
if (s1 == s2)
{
/*** Updated 10/25/00 ***/
setting = K[k]; //Link[k].Kc;
switch (Link[k].Type)
{
case PRV:
case PSV:
case PBV: setting *= Ucf[PRESSURE]; break;
case FCV: setting *= Ucf[FLOW];
}
sprintf(Msg,FMT56,LinkTxt[Link[k].Type],Link[k].ID,setting);
writeline(Msg);
return;
}
/* We have a status change. Write the old & new status types. */
if (s1 == ACTIVE) j1 = ACTIVE;
else if (s1 <= CLOSED) j1 = CLOSED;
else j1 = OPEN;
if (s2 == ACTIVE) j2 = ACTIVE;
else if (s2 <= CLOSED) j2 = CLOSED;
else j2 = OPEN;
if (j1 != j2)
{
sprintf(Msg,FMT57,LinkTxt[Link[k].Type],Link[k].ID,
_(StatTxt[j1]),_(StatTxt[j2]));
writeline(Msg);
}
} /* End of writestatchange */
void writecontrolaction(int k, int i)
/*
----------------------------------------------------------------
** Input: k = link index
** i = control index
** Output: none
** Purpose: writes control action taken to status report
**--------------------------------------------------------------
*/
{
int n;
switch (Control[i].Type)
{
case LOWLEVEL:
case HILEVEL:
n = Control[i].Node;
sprintf(Msg,FMT54,clocktime(Atime,Htime),LinkTxt[Link[k].Type],
Link[k].ID,NodeTxt[getnodetype(n)],Node[n].ID);
break;
case TIMER:
case TIMEOFDAY:
sprintf(Msg,FMT55,clocktime(Atime,Htime),LinkTxt[Link[k].Type],
Link[k].ID);
break;
default: return;
}
writeline(Msg);
}
void writeruleaction(int k, char *ruleID)
/*
**--------------------------------------------------------------
** Input: k = link index
** *ruleID = rule ID
** Output: none
** Purpose: writes rule action taken to status report
**--------------------------------------------------------------
*/
{
sprintf(Msg,FMT63,clocktime(Atime,Htime),LinkTxt[Link[k].Type],
Link[k].ID,ruleID);
writeline(Msg);
}
int writehydwarn(int iter, double relerr)
/*
**--------------------------------------------------------------
** Input: iter = # iterations to find hydraulic solution
** Output: warning flag code
** Purpose: writes hydraulic warning message to report file
**
** Note: Warning conditions checked in following order:
** 1. System balanced but unstable
** 2. Negative pressures
** 3. FCV cannot supply flow or PRV/PSV cannot maintain pressure
** 4. Pump out of range
** 5. Network disconnected
** 6. System unbalanced
**--------------------------------------------------------------
*/
{
int i,j;
char flag = 0;
char s; //(2.00.11 - LR)
/* Check if system unstable */
if (iter > MaxIter && relerr <= Hacc)
{
sprintf(Msg,WARN02,clocktime(Atime,Htime));
if (Messageflag) writeline(Msg);
flag = 2;
}
/* Check for negative pressures */
for (i=1; i<=Njuncs; i++)
{
if (H[i] < Node[i].El && D[i] > 0.0)
{
sprintf(Msg,WARN06,clocktime(Atime,Htime));
if (Messageflag) writeline(Msg);
flag = 6;
break;
}
}
/* Check for abnormal valve condition */
for (i=1; i<=Nvalves; i++)
{
j = Valve[i].Link;
if (S[j] >= XFCV)
{
sprintf(Msg,WARN05,LinkTxt[Link[j].Type],Link[j].ID,
_(StatTxt[S[j]]),clocktime(Atime,Htime));
if (Messageflag) writeline(Msg);
flag = 5;
}
}
/* Check for abnormal pump condition */
for (i=1; i<=Npumps; i++)
{
j = Pump[i].Link;
s = S[j]; //(2.00.11 - LR)
if (S[j] >= OPEN) //(2.00.11 - LR)
{ //(2.00.11 - LR)
if (Q[j] > K[j]*Pump[i].Qmax) s = XFLOW; //(2.00.11 - LR)
if (Q[j] < 0.0) s = XHEAD; //(2.00.11 - LR)
} //(2.00.11 - LR)
if (s == XHEAD || s == XFLOW) //(2.00.11 - LR)
{
sprintf(Msg,WARN04,Link[j].ID,_(StatTxt[s]), //(2.00.11 - LR)
clocktime(Atime,Htime));
if (Messageflag) writeline(Msg);
flag = 4;
}
}
/* Check if system is unbalanced */
if (iter > MaxIter && relerr > Hacc)
{
sprintf(Msg,WARN01,clocktime(Atime,Htime));
if (ExtraIter == -1) strcat(Msg,t_HALTED);
if (Messageflag) writeline(Msg);
flag = 1;
}
/* Check for disconnected network */
/* & update global warning flag */
if (flag > 0)
{
disconnected();
Warnflag = flag;
}
return(flag);
} /* End of writehydwarn */
void writehyderr(int errnode)
/*
**-----------------------------------------------------------
** Input: none
** Output: none
** Purpose: outputs status & checks connectivity when
** network hydraulic equations cannot be solved.
**-----------------------------------------------------------
*/
{
sprintf(Msg,FMT62,clocktime(Atime,Htime),Node[errnode].ID);
if (Messageflag) writeline(Msg);
writehydstat(0,0);
disconnected();
} /* End of writehyderr */
int disconnected()
/*
**-------------------------------------------------------------------
** Input: None
** Output: Returns number of disconnected nodes
** Purpose: Tests current hydraulic solution to see if any closed
** links have caused the network to become disconnected.
**-------------------------------------------------------------------
*/
{
int i, j;
int count, mcount;
int errcode = 0;
int *nodelist;
char *marked;
/* Allocate memory for node list & marked list */
nodelist = (int *) calloc(Nnodes+1,sizeof(int));
marked = (char *) calloc(Nnodes+1,sizeof(char));
ERRCODE(MEMCHECK(nodelist));
ERRCODE(MEMCHECK(marked));
if (errcode) return(0);
/* Place tanks on node list and marked list */
for (i=1; i<=Ntanks; i++)
{
j = Njuncs + i;
nodelist[i] = j;
marked[j] = 1;
}
/* Place junctions with negative demands on the lists */
mcount = Ntanks;
for (i=1; i<=Njuncs; i++)
{
if (D[i] < 0.0)
{
mcount++;
nodelist[mcount] = i;
marked[i] = 1;
}
}
/* Mark all nodes that can be connected to tanks */
/* and count number of nodes remaining unmarked. */
marknodes(mcount,nodelist,marked);
j = 0;
count = 0;
for (i=1; i<=Njuncs; i++)
{
if (!marked[i] && D[i] != 0.0) /* Skip if no demand */
{
count++;
if (count <= MAXCOUNT && Messageflag)
{
sprintf(Msg,WARN03a,Node[i].ID,clocktime(Atime,Htime));
writeline(Msg);
}
j = i; /* Last unmarked node */
}
}
/* Report number of unmarked nodes and find closed link */
/* on path from node j back to a tank. */
if (count > 0 && Messageflag)
{
if (count > MAXCOUNT)
{
sprintf(Msg, WARN03b, count-MAXCOUNT, clocktime(Atime,Htime));
writeline(Msg);
}
getclosedlink(j,marked);
}
/* Free allocated memory */
free(nodelist);
free(marked);
return(count);
} /* End of disconnected() */
void marknodes(int m, int *nodelist, char *marked)
/*
**----------------------------------------------------------------
** Input: m = number of source nodes
** nodelist[] = list of nodes to be traced from
** marked[] = TRUE if node connected to source
** Output: None.
** Purpose: Marks all junction nodes connected to tanks.
**----------------------------------------------------------------
*/
{
int i, j, k, n;
Padjlist alink;
/* Scan each successive entry of node list */
n = 1;
while (n <= m )
{
/* Scan all nodes connected to current node */
i = nodelist[n];
for (alink = Adjlist[i]; alink != NULL; alink = alink->next)
{
/* Get indexes of connecting link and node */
k = alink->link;
j = alink->node;
if (marked[j]) continue;
/* Check if valve connection is in correct direction */
switch (Link[k].Type)
{
case CV:
case PRV:
case PSV: if (j == Link[k].N1) continue;
}
/* Mark connection node if link not closed */
if (S[k] > CLOSED)
{
marked[j] = 1;
m++;
nodelist[m] = j;
}
}
n++;
}
} /* End of marknodes() */
void getclosedlink(int i, char *marked)
/*
**----------------------------------------------------------------
** Input: i = junction index
** marked[] = marks nodes already examined
** Output: None.
** Purpose: Determines if a closed link connects to junction i.
**----------------------------------------------------------------
*/
{
int j,k;
Padjlist alink;
marked[i] = 2;
for (alink = Adjlist[i]; alink != NULL; alink = alink->next)
{
k = alink->link;
j = alink->node;
if (marked[j] == 2) continue;
if (marked[j] == 1)
{
sprintf(Msg, WARN03c, Link[k].ID);
writeline(Msg);
return;
}
else getclosedlink(j,marked);
}
}
void writelimits(int j1, int j2)
/*
**--------------------------------------------------------------
** Input: j1 = index of first output variable
** j2 = index of last output variable
** Output: none
** Purpose: writes reporting criteria to output report
**--------------------------------------------------------------
*/
{
int j;
for (j=j1; j<=j2; j++)
{
if (Field[j].RptLim[LOW] < BIG)
{
sprintf(Msg,FMT47,
Field[j].Name,Field[j].RptLim[LOW],Field[j].Units);
writeline(Msg);
}
if (Field[j].RptLim[HI] > -BIG)
{
sprintf(Msg,FMT48,
Field[j].Name,Field[j].RptLim[HI],Field[j].Units);
writeline(Msg);
}
}
} /* End of writelimits */
int checklimits(double *y, int j1, int j2)
/*
**--------------------------------------------------------------
** Input: *y = array of output results
** j1 = index of first output variable
** j2 = index of last output variable
** Output: returns 1 if criteria met, 0 otherwise
** Purpose: checks if output reporting criteria is met
**--------------------------------------------------------------
*/
{
int j;
for (j=j1; j<=j2; j++)
{
if (y[j] > Field[j].RptLim[LOW]
|| y[j] < Field[j].RptLim[HI]) return(0);
}
return(1);
} /* End of checklim */
void writetime(char *fmt)
/*
**----------------------------------------------------------------
** Input: fmt = format string
** Output: none
** Purpose: writes starting/ending time of a run to report file
**----------------------------------------------------------------
*/
{
time_t timer;
time(&timer);
sprintf(Msg, fmt, ctime(&timer));
writeline(Msg);
}
char *clocktime(char *atime, long seconds)
/*
**--------------------------------------------------------------
** Input: seconds = time in seconds
** Output: atime = time in hrs:min
** (returns pointer to atime)
** Purpose: converts time in seconds to hours:minutes format
**--------------------------------------------------------------
*/
{
/*** Updated 6/24/02 ***/
int h,m,s;
h = seconds/3600;
m = (seconds % 3600) / 60;
s = seconds - 3600*h - 60*m;
sprintf(atime, "%01d:%02d:%02d", h,m,s);
return(atime);
} /* End of clocktime */
char *fillstr(char *s, char ch, int n)
/*
**---------------------------------------------------------
** Fills n bytes of s to character ch.
** NOTE: does not check for overwriting s.
**---------------------------------------------------------
*/
{
int i;
for (i=0; i<=n; i++) s[i] = ch;
s[n+1] = '\0';
return(s);
}
int getnodetype(int i)
/*
**---------------------------------------------------------
** Determines type of node with index i
** (junction = 0, reservoir = 1, tank = 2).
**---------------------------------------------------------
*/
{
if (i <= Njuncs) return(0);
if (Tank[i-Njuncs].A == 0.0) return(1);
return(2);
}
/********************* END OF REPORT.C ********************/
| sdteffen/epanetl | src/report.c | C | gpl-2.0 | 38,304 |
/* ncmpc (Ncurses MPD Client)
* (c) 2004-2010 The Music Player Daemon Project
* Project homepage: http://musicpd.org
*
* 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, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef NCMPC_H
#define NCMPC_H
#include "command.h"
/** put the terminal in a sane mode and stop/suspend ncmpc */
void
sigstop(void);
void begin_input_event(void);
void end_input_event(void);
int do_input_event(command_t cmd);
#endif /* NCMPC_H */
| djrtl/ncmpc-dj | src/ncmpc.h | C | gpl-2.0 | 1,097 |
/* ---------- Fjalla One, Cantarell ---------- */
h1,
h2,
h1 a,
h2 a {
font-family: 'Fjalla One', sans-serif;
font-weight: normal;
text-transform: uppercase;
}
h3,
h4,
h5,
h6,
h3 a {
font-family: 'Cantarell', sans-serif;
font-weight: 700;
text-transform: uppercase;
letter-spacing: -1px;
}
body,
p,
a,
li {
font-family: 'Cantarell', sans-serif;
}
| alexrayu/sitecat8 | web/themes/contrib/bootstrap_barrio/fonts/fjalla_cantarell.css | CSS | gpl-2.0 | 364 |
--[[
* qr plugin uses:
* - http://goqr.me/api/doc/create-qr-code/
* psykomantis
]]
local function get_hex(str)
local colors = {
red = "f00",
blue = "00f",
green = "0f0",
yellow = "ff0",
purple = "f0f",
white = "fff",
black = "000",
gray = "ccc"
}
for color, value in pairs(colors) do
if color == str then
return value
end
end
return str
end
local function qr(receiver, text, color, bgcolor)
local url = "http://api.qrserver.com/v1/create-qr-code/?"
.."size=600x600" --fixed size otherways it's low detailed
.."&data="..URL.escape(text:trim())
if color then
url = url.."&color="..get_hex(color)
end
if bgcolor then
url = url.."&bgcolor="..get_hex(bgcolor)
end
local response, code, headers = http.request(url)
if code ~= 200 then
return "Oops! Error: " .. code
end
if #response > 0 then
send_photo_from_url(receiver, url)
return
end
return "Oops! Something strange happened :("
end
local function run(msg, matches)
local receiver = get_receiver(msg)
local text = matches[1]
local color
local back
if #matches > 1 then
text = matches[3]
color = matches[2]
back = matches[1]
end
return qr(receiver, text, color, back)
end
return {
description = {"qr code plugin for telegram, given a text it returns the qr code"},
usage = {
" [text]",
' "[background color]" "[data color]" [text]\n'
.."Color through text: red|green|blue|purple|black|white|gray\n"
.."Colors through hex notation: (\"a56729\" is brown)\n"
.."Or colors through decimals: (\"255-192-203\" is pink)"
},
patterns = {
'^qr "(%w+)" "(%w+)" (.+)$',
"^qr (.+)$"
},
run = run
}
| theblacks/TTB | plugins/qr code.lua | Lua | gpl-2.0 | 1,723 |
/*****************************************************************************
* EbmlParser for the matroska demuxer
*****************************************************************************
* Copyright (C) 2003-2004 VLC authors and VideoLAN
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Steve Lhomme <steve.lhomme@free.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "Ebml_parser.hpp"
#include "stream_io_callback.hpp"
/*****************************************************************************
* Ebml Stream parser
*****************************************************************************/
EbmlParser::EbmlParser( EbmlStream *es, EbmlElement *el_start, demux_t *p_demux ) :
p_demux( p_demux ),
m_es( es ),
mi_level( 1 ),
m_got( NULL ),
mi_user_level( 1 ),
mb_keep( false )
{
mi_remain_size[0] = el_start->GetSize();
memset( m_el, 0, 6 * sizeof( *m_el ) );
m_el[0] = el_start;
mb_dummy = var_InheritBool( p_demux, "mkv-use-dummy" );
}
EbmlParser::~EbmlParser( void )
{
if( !mi_level )
{
assert( !mb_keep );
delete m_el[1];
return;
}
for( int i = 1; i <= mi_level; i++ )
{
if( !mb_keep )
{
delete m_el[i];
}
mb_keep = false;
}
}
EbmlElement* EbmlParser::UnGet( uint64 i_block_pos, uint64 i_cluster_pos )
{
if ( mi_user_level > mi_level )
{
while ( mi_user_level != mi_level )
{
delete m_el[mi_user_level];
m_el[mi_user_level] = NULL;
mi_user_level--;
}
}
/* Avoid data skip in BlockGet */
delete m_el[mi_level];
m_el[mi_level] = NULL;
m_got = NULL;
mb_keep = false;
if ( m_el[1] && m_el[1]->GetElementPosition() == i_cluster_pos )
{
m_es->I_O().setFilePointer( i_block_pos, seek_beginning );
return m_el[1];
}
else
{
// seek to the previous Cluster
m_es->I_O().setFilePointer( i_cluster_pos, seek_beginning );
while(mi_level > 1)
{
mi_level--;
mi_user_level--;
delete m_el[mi_level];
m_el[mi_level] = NULL;
}
return NULL;
}
}
void EbmlParser::Up( void )
{
if( mi_user_level == mi_level )
{
msg_Warn( p_demux, "MKV/Ebml Parser: Up cannot escape itself" );
}
mi_user_level--;
}
void EbmlParser::Down( void )
{
mi_user_level++;
mi_level++;
}
void EbmlParser::Keep( void )
{
mb_keep = true;
}
int EbmlParser::GetLevel( void ) const
{
return mi_user_level;
}
void EbmlParser::Reset( demux_t *p_demux )
{
while ( mi_level > 0)
{
delete m_el[mi_level];
m_el[mi_level] = NULL;
mi_level--;
}
this->p_demux = p_demux;
mi_user_level = mi_level = 1;
// a little faster and cleaner
m_es->I_O().setFilePointer( static_cast<KaxSegment*>(m_el[0])->GetGlobalPosition(0) );
mb_dummy = var_InheritBool( p_demux, "mkv-use-dummy" );
}
EbmlElement *EbmlParser::Get( int n_call )
{
int i_ulev = 0;
EbmlElement *p_prev = NULL;
if( mi_user_level != mi_level )
{
return NULL;
}
if( m_got )
{
EbmlElement *ret = m_got;
m_got = NULL;
return ret;
}
p_prev = m_el[mi_level];
if( m_el[mi_level] )
{
m_el[mi_level]->SkipData( *m_es, EBML_CONTEXT(m_el[mi_level]) );
}
vlc_stream_io_callback & io_stream = (vlc_stream_io_callback &) m_es->I_O();
uint64 i_size = io_stream.toRead();
/* Ignore unknown level 0 or 1 elements */
m_el[mi_level] = m_es->FindNextElement( EBML_CONTEXT(m_el[mi_level - 1]),
i_ulev, i_size,
( mb_dummy | (mi_level > 1) ), 1 );
if( i_ulev > 0 )
{
if( p_prev )
{
if( !mb_keep )
{
if( MKV_IS_ID( p_prev, KaxBlockVirtual ) )
static_cast<KaxBlockVirtualWorkaround*>(p_prev)->Fix();
delete p_prev;
}
mb_keep = false;
}
while( i_ulev > 0 )
{
if( mi_level == 1 )
{
mi_level = 0;
return NULL;
}
delete m_el[mi_level - 1];
m_got = m_el[mi_level -1] = m_el[mi_level];
m_el[mi_level] = NULL;
mi_level--;
i_ulev--;
}
return NULL;
}
else if( m_el[mi_level] == NULL )
{
msg_Warn( p_demux,"MKV/Ebml Parser: m_el[mi_level] == NULL\n" );
}
else if( m_el[mi_level]->IsDummy() && !mb_dummy )
{
bool b_bad_position = false;
/* We got a dummy element but don't want those...
* perform a sanity check */
if( !mi_level )
{
msg_Err(p_demux, "Got invalid lvl 0 element... Aborting");
return NULL;
}
if( p_prev && p_prev->IsFiniteSize() &&
p_prev->GetEndPosition() != m_el[mi_level]->GetElementPosition() &&
mi_level > 1 )
{
msg_Err( p_demux, "Dummy Element at unexpected position... corrupted file?" );
b_bad_position = true;
}
if( n_call < 10 && !b_bad_position && m_el[mi_level]->IsFiniteSize() &&
( !m_el[mi_level-1]->IsFiniteSize() ||
m_el[mi_level]->GetEndPosition() <= m_el[mi_level-1]->GetEndPosition() ) )
{
/* The element fits inside its upper element */
msg_Warn( p_demux, "Dummy element found %"PRIu64"... skipping it",
m_el[mi_level]->GetElementPosition() );
return Get( ++n_call );
}
else
{
/* Too large, misplaced or 10 successive dummy elements */
msg_Err( p_demux,
"Dummy element too large or misplaced at %"PRIu64"... skipping to next upper element",
m_el[mi_level]->GetElementPosition() );
if( mi_level >= 1 &&
m_el[mi_level]->GetElementPosition() >= m_el[mi_level-1]->GetEndPosition() )
{
msg_Err(p_demux, "This element is outside its known parent... upping level");
delete m_el[mi_level - 1];
m_got = m_el[mi_level -1] = m_el[mi_level];
m_el[mi_level] = NULL;
mi_level--;
return NULL;
}
delete m_el[mi_level];
m_el[mi_level] = NULL;
m_el[mi_level - 1]->SkipData( *m_es, EBML_CONTEXT(m_el[mi_level - 1]) );
return Get();
}
}
if( p_prev )
{
if( !mb_keep )
{
if( MKV_IS_ID( p_prev, KaxBlockVirtual ) )
static_cast<KaxBlockVirtualWorkaround*>(p_prev)->Fix();
delete p_prev;
}
mb_keep = false;
}
return m_el[mi_level];
}
bool EbmlParser::IsTopPresent( EbmlElement *el ) const
{
for( int i = 0; i < mi_level; i++ )
{
if( m_el[i] && m_el[i] == el )
return true;
}
return false;
}
| mikhail-angelov/vlc | modules/demux/mkv/Ebml_parser.cpp | C++ | gpl-2.0 | 7,953 |
/*
* Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/*
* This file was originally distributed by Qualcomm Atheros, Inc.
* under proprietary terms before Copyright ownership was assigned
* to the Linux Foundation.
*/
#ifndef _QC_SAP_IOCTL_H_
#define _QC_SAP_IOCTL_H_
/*
* QCSAP ioctls.
*/
/*
* Max size of optional information elements. We artificially
* constrain this; it's limited only by the max frame size (and
* the max parameter size of the wireless extensions).
*/
#define QCSAP_MAX_OPT_IE 256
#define QCSAP_MAX_WSC_IE 256
#define QCSAP_MAX_GET_STA_INFO 512
typedef struct sSSID
{
u_int8_t length;
u_int8_t ssId[32];
} tSSID;
typedef struct sSSIDInfo
{
tSSID ssid;
u_int8_t ssidHidden;
}tSSIDInfo;
typedef enum {
eQC_DOT11_MODE_ALL = 0,
eQC_DOT11_MODE_ABG = 0x0001, //11a/b/g only, no HT, no proprietary
eQC_DOT11_MODE_11A = 0x0002,
eQC_DOT11_MODE_11B = 0x0004,
eQC_DOT11_MODE_11G = 0x0008,
eQC_DOT11_MODE_11N = 0x0010,
eQC_DOT11_MODE_11G_ONLY = 0x0020,
eQC_DOT11_MODE_11N_ONLY = 0x0040,
eQC_DOT11_MODE_11B_ONLY = 0x0080,
eQC_DOT11_MODE_11A_ONLY = 0x0100,
//This is for WIFI test. It is same as eWNIAPI_MAC_PROTOCOL_ALL except when it starts IBSS in 11B of 2.4GHz
//It is for CSR internal use
eQC_DOT11_MODE_AUTO = 0x0200,
} tQcPhyMode;
#define QCSAP_ADDR_LEN 6
typedef u_int8_t qcmacaddr[QCSAP_ADDR_LEN];
struct qc_mac_acl_entry {
qcmacaddr addr;
int vlan_id;
};
typedef enum {
eQC_AUTH_TYPE_OPEN_SYSTEM,
eQC_AUTH_TYPE_SHARED_KEY,
eQC_AUTH_TYPE_AUTO_SWITCH
} eQcAuthType;
typedef enum {
eQC_WPS_BEACON_IE,
eQC_WPS_PROBE_RSP_IE,
eQC_WPS_ASSOC_RSP_IE
} eQCWPSType;
/*
* Retrieve the WPA/RSN information element for an associated station.
*/
struct sQcSapreq_wpaie {
u_int8_t wpa_ie[QCSAP_MAX_OPT_IE];
u_int8_t wpa_macaddr[QCSAP_ADDR_LEN];
};
/*
* Retrieve the WSC information element for an associated station.
*/
struct sQcSapreq_wscie {
u_int8_t wsc_macaddr[QCSAP_ADDR_LEN];
u_int8_t wsc_ie[QCSAP_MAX_WSC_IE];
};
/*
* Retrieve the WPS PBC Probe Request IEs.
*/
typedef struct sQcSapreq_WPSPBCProbeReqIES {
u_int8_t macaddr[QCSAP_ADDR_LEN];
u_int16_t probeReqIELen;
u_int8_t probeReqIE[512];
} sQcSapreq_WPSPBCProbeReqIES_t ;
/*
* Channel List Info
*/
typedef struct
{
v_U8_t num_channels;
v_U8_t channels[WNI_CFG_VALID_CHANNEL_LIST_LEN];
}tChannelListInfo, *tpChannelListInfo;
#ifdef __linux__
/*
* Wireless Extensions API, private ioctl interfaces.
*
* NB: Even-numbered ioctl numbers have set semantics and are privileged!
* (regardless of the incorrect comment in wireless.h!)
*/
#define QCSAP_IOCTL_SETPARAM (SIOCIWFIRSTPRIV+0)
#define QCSAP_IOCTL_GETPARAM (SIOCIWFIRSTPRIV+1)
/* (SIOCIWFIRSTPRIV+2) is unused */
#define QCSAP_IOCTL_SET_NONE_GET_THREE (SIOCIWFIRSTPRIV+3)
#define WE_GET_TSF 1
#define QCSAP_IOCTL_GET_STAWPAIE (SIOCIWFIRSTPRIV+4)
#define QCSAP_IOCTL_STOPBSS (SIOCIWFIRSTPRIV+6)
#define QCSAP_IOCTL_VERSION (SIOCIWFIRSTPRIV+7)
#define QCSAP_IOCTL_GET_WPS_PBC_PROBE_REQ_IES (SIOCIWFIRSTPRIV+8)
#define QCSAP_IOCTL_GET_CHANNEL (SIOCIWFIRSTPRIV+9)
#define QCSAP_IOCTL_ASSOC_STA_MACADDR (SIOCIWFIRSTPRIV+10)
#define QCSAP_IOCTL_DISASSOC_STA (SIOCIWFIRSTPRIV+11)
#define QCSAP_IOCTL_AP_STATS (SIOCIWFIRSTPRIV+12)
/* Private ioctls and their sub-ioctls */
#define QCSAP_PRIV_GET_CHAR_SET_NONE (SIOCIWFIRSTPRIV + 13)
#define QCSAP_GET_STATS 1
#define QCSAP_IOCTL_CLR_STATS (SIOCIWFIRSTPRIV+14)
#define QCSAP_IOCTL_PRIV_SET_THREE_INT_GET_NONE (SIOCIWFIRSTPRIV+15)
#define WE_SET_WLAN_DBG 1
/* 2 is unused */
#define WE_SET_SAP_CHANNELS 3
#define QCSAP_IOCTL_PRIV_SET_VAR_INT_GET_NONE (SIOCIWFIRSTPRIV+16)
#define QCSAP_IOCTL_SET_CHANNEL_RANGE (SIOCIWFIRSTPRIV+17)
#define WE_LOG_DUMP_CMD 1
#define WE_P2P_NOA_CMD 2
//IOCTL to configure MCC params
#define WE_MCC_CONFIG_CREDENTIAL 3
#define WE_MCC_CONFIG_PARAMS 4
#define WE_UNIT_TEST_CMD 7
#ifdef MEMORY_DEBUG
#define WE_MEM_TRACE_DUMP 11
#endif
#define QCSAP_IOCTL_MODIFY_ACL (SIOCIWFIRSTPRIV+18)
#define QCSAP_IOCTL_GET_CHANNEL_LIST (SIOCIWFIRSTPRIV+19)
#define QCSAP_IOCTL_SET_TX_POWER (SIOCIWFIRSTPRIV+20)
#define QCSAP_IOCTL_GET_STA_INFO (SIOCIWFIRSTPRIV+21)
#define QCSAP_IOCTL_SET_MAX_TX_POWER (SIOCIWFIRSTPRIV+22)
#define QCSAP_IOCTL_DATAPATH_SNAP_SHOT (SIOCIWFIRSTPRIV+23)
#define QCSAP_IOCTL_GET_INI_CFG (SIOCIWFIRSTPRIV+25)
#define QCSAP_IOCTL_SET_INI_CFG (SIOCIWFIRSTPRIV+26)
#define QCSAP_IOCTL_WOWL_CONFIG_PTRN (SIOCIWFIRSTPRIV+27)
#define WE_WOWL_ADD_PTRN 1
#define WE_WOWL_DEL_PTRN 2
#define QCSAP_IOCTL_SET_TWO_INT_GET_NONE (SIOCIWFIRSTPRIV + 28)
#ifdef DEBUG
#define QCSAP_IOCTL_SET_FW_CRASH_INJECT 1
#endif
#define MAX_VAR_ARGS 7
#define QCSAP_IOCTL_PRIV_GET_RSSI (SIOCIWFIRSTPRIV + 29)
#define QCSAP_IOCTL_PRIV_GET_SOFTAP_LINK_SPEED (SIOCIWFIRSTPRIV + 31)
#define QCSAP_IOCTL_MAX_STR_LEN 1024
#define RC_2_RATE_IDX(_rc) ((_rc) & 0x7)
#define HT_RC_2_STREAMS(_rc) ((((_rc) & 0x78) >> 3) + 1)
#define RC_2_RATE_IDX_11AC(_rc) ((_rc) & 0xf)
#define HT_RC_2_STREAMS_11AC(_rc) ((((_rc) & 0x30) >> 4) + 1)
enum {
QCSAP_PARAM_MAX_ASSOC = 1,
QCSAP_PARAM_GET_WLAN_DBG,
QCSAP_PARAM_CLR_ACL = 4,
QCSAP_PARAM_ACL_MODE,
QCSAP_PARAM_HIDE_SSID,
QCSAP_PARAM_AUTO_CHANNEL,
QCSAP_PARAM_SET_MC_RATE = 8,
QCSAP_PARAM_SET_TXRX_FW_STATS,
QCSAP_PARAM_SET_MCC_CHANNEL_LATENCY,
QCSAP_PARAM_SET_MCC_CHANNEL_QUOTA,
QCSAP_DBGLOG_LOG_LEVEL,
QCSAP_DBGLOG_VAP_ENABLE,
QCSAP_DBGLOG_VAP_DISABLE,
QCSAP_DBGLOG_MODULE_ENABLE,
QCSAP_DBGLOG_MODULE_DISABLE,
QCSAP_DBGLOG_MOD_LOG_LEVEL,
QCSAP_DBGLOG_TYPE,
QCSAP_DBGLOG_REPORT_ENABLE,
QCASAP_TXRX_FWSTATS_RESET,
QCSAP_PARAM_RTSCTS,
QCASAP_SET_11N_RATE,
QCASAP_SET_VHT_RATE,
QCASAP_SHORT_GI,
QCSAP_SET_AMPDU,
QCSAP_SET_AMSDU,
QCSAP_GTX_HT_MCS,
QCSAP_GTX_VHT_MCS,
QCSAP_GTX_USRCFG,
QCSAP_GTX_THRE,
QCSAP_GTX_MARGIN,
QCSAP_GTX_STEP,
QCSAP_GTX_MINTPC,
QCSAP_GTX_BWMASK,
#ifdef QCA_PKT_PROTO_TRACE
QCASAP_SET_DEBUG_LOG,
#endif
QCASAP_SET_TM_LEVEL,
QCASAP_SET_DFS_IGNORE_CAC,
QCASAP_GET_DFS_NOL,
QCASAP_SET_DFS_NOL,
QCSAP_PARAM_SET_CHANNEL_CHANGE,
QCASAP_SET_DFS_TARGET_CHNL,
QCASAP_SET_RADAR_CMD,
QCSAP_GET_ACL,
QCASAP_TX_CHAINMASK_CMD,
QCASAP_RX_CHAINMASK_CMD,
QCASAP_NSS_CMD,
QCSAP_IPA_UC_STAT,
QCASAP_SET_PHYMODE,
QCASAP_GET_TEMP_CMD,
QCSAP_GET_FW_STATUS,
QCASAP_DUMP_STATS,
QCASAP_CLEAR_STATS,
QCSAP_CAP_TSF,
QCSAP_GET_TSF,
QCASAP_PARAM_LDPC,
QCASAP_PARAM_TX_STBC,
QCASAP_PARAM_RX_STBC,
QCASAP_SET_RADAR_DBG,
};
int iw_softap_get_channel_list(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra);
#endif /* __linux__ */
#endif /*_QC_SAP_IOCTL_H_*/
| squllcx/Axon7 | drivers/staging/qcacld-2.0/CORE/HDD/inc/qc_sap_ioctl.h | C | gpl-2.0 | 7,994 |
/*
Copyright (C) 2006 - 2015 Evan Teran
evan.teran@gmail.com
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/>.
*/
#include "DialogHeap.h"
#include "Configuration.h"
#include "edb.h"
#include "IDebugger.h"
#include "ISymbolManager.h"
#include "MemoryRegions.h"
#include "Util.h"
#include <QFileInfo>
#include <QHeaderView>
#include <QMessageBox>
#include <QSortFilterProxyModel>
#include <QStack>
#include <QString>
#include <QVector>
#include <QtDebug>
#include <algorithm>
#include <functional>
#ifdef ENABLE_GRAPH
#include "GraphWidget.h"
#include "GraphNode.h"
#include "GraphEdge.h"
#endif
#if QT_VERSION >= 0x050000
#include <QtConcurrent>
#elif QT_VERSION >= 0x040800
#include <QtConcurrentMap>
#endif
#include "ui_DialogHeap.h"
namespace HeapAnalyzer {
#define PREV_INUSE 0x1
#define IS_MMAPPED 0x2
#define NON_MAIN_ARENA 0x4
#define SIZE_BITS (PREV_INUSE|IS_MMAPPED|NON_MAIN_ARENA)
#define next_chunk(p, c) ((p) + ((c).chunk_size()))
#define prev_chunk(p, c) ((p) - ((c).prev_size))
namespace {
// NOTE: the details of this structure are 32/64-bit sensitive!
template<class MallocChunkPtr>
struct malloc_chunk {
typedef MallocChunkPtr ULong; // ulong has the same size
ULong prev_size; /* Size of previous chunk (if free). */
ULong size; /* Size in bytes, including overhead. */
MallocChunkPtr fd; /* double links -- used only if free. */
MallocChunkPtr bk;
edb::address_t chunk_size() const { return edb::address_t::fromZeroExtended(size & ~(SIZE_BITS)); }
bool prev_inuse() const { return size & PREV_INUSE; }
};
//------------------------------------------------------------------------------
// Name: block_start
// Desc:
//------------------------------------------------------------------------------
edb::address_t block_start(edb::address_t pointer) {
return pointer + edb::v1::pointer_size() * 2; // pointer_size() is malloc_chunk*
}
//------------------------------------------------------------------------------
// Name: block_start
// Desc:
//------------------------------------------------------------------------------
edb::address_t block_start(const Result &result) {
return block_start(result.block);
}
}
//------------------------------------------------------------------------------
// Name: DialogHeap
// Desc:
//------------------------------------------------------------------------------
DialogHeap::DialogHeap(QWidget *parent) : QDialog(parent), ui(new Ui::DialogHeap) {
ui->setupUi(this);
model_ = new ResultViewModel(this);
ui->tableView->setModel(model_);
ui->tableView->verticalHeader()->hide();
#if QT_VERSION >= 0x050000
ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
#else
ui->tableView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
#endif
#ifdef ENABLE_GRAPH
ui->btnGraph->setEnabled(true);
#else
ui->btnGraph->setEnabled(false);
#endif
}
//------------------------------------------------------------------------------
// Name: ~DialogHeap
// Desc:
//------------------------------------------------------------------------------
DialogHeap::~DialogHeap() {
delete ui;
}
//------------------------------------------------------------------------------
// Name: showEvent
// Desc:
//------------------------------------------------------------------------------
void DialogHeap::showEvent(QShowEvent *) {
model_->clearResults();
ui->progressBar->setValue(0);
}
//------------------------------------------------------------------------------
// Name: on_resultTable_cellDoubleClicked
// Desc:
//------------------------------------------------------------------------------
void DialogHeap::on_tableView_doubleClicked(const QModelIndex &index) {
// NOTE: remember that if we use a sort filter, we need to map the indexes
// to get at the data we need
if(auto item = static_cast<Result *>(index.internalPointer())) {
edb::v1::dump_data_range(item->block, item->block + item->size, false);
}
}
//------------------------------------------------------------------------------
// Name: get_library_names
// Desc:
//------------------------------------------------------------------------------
void DialogHeap::get_library_names(QString *libcName, QString *ldName) const {
Q_ASSERT(libcName);
Q_ASSERT(ldName);
if(edb::v1::debugger_core) {
if(IProcess *process = edb::v1::debugger_core->process()) {
const QList<Module> libs = process->loaded_modules();
for(const Module &module: libs) {
if(!ldName->isEmpty() && !libcName->isEmpty()) {
break;
}
const QFileInfo fileinfo(module.name);
// this tries its best to cover all possible libc library versioning
// possibilities we need to find out if this is 100% accurate, so far
// seems correct based on my system
if(fileinfo.completeBaseName().startsWith("libc-")) {
*libcName = fileinfo.completeBaseName() + "." + fileinfo.suffix();
qDebug() << "[Heap Analyzer] libc library appears to be:" << *libcName;
continue;
}
if(fileinfo.completeBaseName().startsWith("libc.so")) {
*libcName = fileinfo.completeBaseName() + "." + fileinfo.suffix();
qDebug() << "[Heap Analyzer] libc library appears to be:" << *libcName;
continue;
}
if(fileinfo.completeBaseName().startsWith("ld-")) {
*ldName = fileinfo.completeBaseName() + "." + fileinfo.suffix();
qDebug() << "[Heap Analyzer] ld library appears to be:" << *ldName;
continue;
}
}
}
}
}
//------------------------------------------------------------------------------
// Name: process_potential_pointer
// Desc:
//------------------------------------------------------------------------------
void DialogHeap::process_potential_pointer(const QHash<edb::address_t, edb::address_t> &targets, Result &result) {
if(IProcess *process = edb::v1::debugger_core->process()) {
if(result.data.isEmpty()) {
edb::address_t pointer(0);
edb::address_t block_ptr = block_start(result);
edb::address_t block_end = block_ptr + result.size;
while(block_ptr < block_end) {
if(process->read_bytes(block_ptr, &pointer, edb::v1::pointer_size())) {
auto it = targets.find(pointer);
if(it != targets.end()) {
#if QT_POINTER_SIZE == 4
result.data += QString("dword ptr [%1] |").arg(edb::v1::format_pointer(it.key()));
#elif QT_POINTER_SIZE == 8
result.data += QString("qword ptr [%1] |").arg(edb::v1::format_pointer(it.key()));
#endif
result.points_to.push_back(it.value());
}
}
block_ptr += edb::v1::pointer_size();
}
result.data.truncate(result.data.size() - 2);
}
}
}
//------------------------------------------------------------------------------
// Name: detect_pointers
// Desc:
//------------------------------------------------------------------------------
void DialogHeap::detect_pointers() {
qDebug() << "[Heap Analyzer] detecting pointers in heap blocks";
QHash<edb::address_t, edb::address_t> targets;
QVector<Result> &results = model_->results();
// the potential targets
qDebug() << "[Heap Analyzer] collecting possible targets addresses";
for(const Result &result: results) {
edb::address_t block_ptr = block_start(result);
edb::address_t block_end = block_ptr + result.size;
while(block_ptr < block_end) {
targets.insert(block_ptr, result.block);
block_ptr += edb::v1::pointer_size();
}
}
#if QT_VERSION >= 0x040800
QtConcurrent::blockingMap(results, [this, targets](Result &result) {
process_potential_pointer(targets, result);
});
#else
std::for_each(results.begin(), results.end(), [this, targets](Result &result) {
process_potential_pointer(targets, result);
});
#endif
model_->update();
}
//------------------------------------------------------------------------------
// Name: collect_blocks
// Desc:
//------------------------------------------------------------------------------
template<class Addr>
void DialogHeap::collect_blocks(edb::address_t start_address, edb::address_t end_address) {
model_->clearResults();
if(IProcess *process = edb::v1::debugger_core->process()) {
const int min_string_length = edb::v1::config().min_string_length;
if(start_address != 0 && end_address != 0) {
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
malloc_chunk<Addr> currentChunk;
malloc_chunk<Addr> nextChunk;
edb::address_t currentChunkAddress = start_address;
model_->setUpdatesEnabled(false);
const edb::address_t how_many = end_address - start_address;
while(currentChunkAddress != end_address) {
// read in the current chunk..
process->read_bytes(currentChunkAddress, ¤tChunk, sizeof(currentChunk));
// figure out the address of the next chunk
const edb::address_t nextChunkAddress = next_chunk(currentChunkAddress, currentChunk);
// is this the last chunk (if so, it's the 'top')
if(nextChunkAddress == end_address) {
const Result r(
currentChunkAddress,
currentChunk.chunk_size(),
tr("Top"));
model_->addResult(r);
} else {
// make sure we aren't following a broken heap...
if(nextChunkAddress > end_address || nextChunkAddress < start_address) {
break;
}
QString data;
// read in the next chunk
process->read_bytes(nextChunkAddress, &nextChunk, sizeof(nextChunk));
// if this block is a container for an ascii string, display it...
// there is a lot of room for improvement here, but it's a start
QString asciiData;
QString utf16Data;
int asciisz;
int utf16sz;
if(edb::v1::get_ascii_string_at_address(
block_start(currentChunkAddress),
asciiData,
min_string_length,
currentChunk.chunk_size(),
asciisz)) {
data = QString("ASCII \"%1\"").arg(asciiData);
} else if(edb::v1::get_utf16_string_at_address(
block_start(currentChunkAddress),
utf16Data,
min_string_length,
currentChunk.chunk_size(),
utf16sz)) {
data = QString("UTF-16 \"%1\"").arg(utf16Data);
} else {
using std::memcmp;
quint8 bytes[16];
process->read_bytes(block_start(currentChunkAddress), bytes, sizeof(bytes));
if(memcmp(bytes, "\x89\x50\x4e\x47", 4) == 0) {
data = "PNG IMAGE";
} else if(memcmp(bytes, "\x2f\x2a\x20\x58\x50\x4d\x20\x2a\x2f", 9) == 0) {
data = "XPM IMAGE";
} else if(memcmp(bytes, "\x42\x5a", 2) == 0) {
data = "BZIP FILE";
} else if(memcmp(bytes, "\x1f\x9d", 2) == 0) {
data = "COMPRESS FILE";
} else if(memcmp(bytes, "\x1f\x8b", 2) == 0) {
data = "GZIP FILE";
}
}
const Result r(
currentChunkAddress,
currentChunk.chunk_size() + sizeof(unsigned int),
nextChunk.prev_inuse() ? tr("Busy") : tr("Free"),
data);
model_->addResult(r);
}
// avoif self referencing blocks
if(currentChunkAddress == nextChunkAddress) {
break;
}
currentChunkAddress = nextChunkAddress;
ui->progressBar->setValue(util::percentage(currentChunkAddress - start_address, how_many));
}
detect_pointers();
model_->setUpdatesEnabled(true);
#else
#error "Unsupported Platform"
#endif
}
}
}
//------------------------------------------------------------------------------
// Name: find_heap_start_heuristic
// Desc:
//------------------------------------------------------------------------------
edb::address_t DialogHeap::find_heap_start_heuristic(edb::address_t end_address, size_t offset) const {
const edb::address_t start_address = end_address - offset;
const edb::address_t heap_symbol = start_address - 4*edb::v1::pointer_size();
edb::address_t test_addr(0);
if(IProcess *process = edb::v1::debugger_core->process()) {
process->read_bytes(heap_symbol, &test_addr, edb::v1::pointer_size());
if(test_addr != edb::v1::debugger_core->page_size()) {
return 0;
}
return start_address;
}
return 0;
}
//------------------------------------------------------------------------------
// Name: do_find
// Desc:
//------------------------------------------------------------------------------
template<class Addr>
void DialogHeap::do_find() {
// get both the libc and ld symbols of __curbrk
// this will be the 'before/after libc' addresses
if(IProcess *process = edb::v1::debugger_core->process()) {
edb::address_t start_address = 0;
edb::address_t end_address = 0;
QString libcName;
QString ldName;
get_library_names(&libcName, &ldName);
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
Symbol::pointer s = edb::v1::symbol_manager().find(libcName + "::__curbrk");
if(s) {
end_address = s->address;
} else {
qDebug() << "[Heap Analyzer] __curbrk symbol not found in libc, falling back on heuristic! This may or may not work.";
}
s = edb::v1::symbol_manager().find(ldName + "::__curbrk");
if(s) {
start_address = s->address;
} else {
qDebug() << "[Heap Analyzer] __curbrk symbol not found in ld, falling back on heuristic! This may or may not work.";
for(edb::address_t offset = 0x0000; offset != 0x1000; offset += edb::v1::pointer_size()) {
start_address = find_heap_start_heuristic(end_address, offset);
if(start_address != 0) {
break;
}
}
}
if(start_address != 0 && end_address != 0) {
qDebug() << "[Heap Analyzer] heap start symbol : " << edb::v1::format_pointer(start_address);
qDebug() << "[Heap Analyzer] heap end symbol : " << edb::v1::format_pointer(end_address);
// read the contents of those symbols
process->read_bytes(end_address, &end_address, edb::v1::pointer_size());
process->read_bytes(start_address, &start_address, edb::v1::pointer_size());
}
// just assume it's the bounds of the [heap] memory region for now
if(start_address == 0 || end_address == 0) {
const QList<IRegion::pointer> ®ions = edb::v1::memory_regions().regions();
for(IRegion::pointer region: regions) {
if(region->name() == "[heap]") {
qDebug() << "Found a memory region named '[heap]', assuming that it provides sane bounds";
if(start_address == 0) {
start_address = region->start();
}
if(end_address == 0) {
end_address = region->end();
}
break;
}
}
}
// ok, I give up
if(start_address == 0 || end_address == 0) {
QMessageBox::information(this, tr("Could not calculate heap bounds"), tr("Failed to calculate the bounds of the heap."));
return;
}
#else
#error "Unsupported Platform"
#endif
qDebug() << "[Heap Analyzer] heap start : " << edb::v1::format_pointer(start_address);
qDebug() << "[Heap Analyzer] heap end : " << edb::v1::format_pointer(end_address);
collect_blocks<Addr>(start_address, end_address);
}
}
//------------------------------------------------------------------------------
// Name: on_btnFind_clicked
// Desc:
//------------------------------------------------------------------------------
void DialogHeap::on_btnFind_clicked() {
ui->btnFind->setEnabled(false);
ui->progressBar->setValue(0);
if(edb::v1::debuggeeIs32Bit())
do_find<edb::value32>();
else
do_find<edb::value64>();
ui->progressBar->setValue(100);
ui->btnFind->setEnabled(true);
}
//------------------------------------------------------------------------------
// Name: on_btnGraph_clicked
// Desc:
//------------------------------------------------------------------------------
void DialogHeap::on_btnGraph_clicked() {
#ifdef ENABLE_GRAPH
auto graph = new GraphWidget(nullptr);
graph->setAttribute(Qt::WA_DeleteOnClose);
const QVector<Result> &results = model_->results();
do {
QMap<edb::address_t, GraphNode *> nodes;
QHash<edb::address_t, const Result *> result_map;
QStack<const Result *> result_stack;
QSet<const Result *> seen_results;
// first we make a nice index for our results, this is likely redundant,
// but won't take long
for(const Result &result: results) {
result_map.insert(result.block, &result);
}
// seed our search with the selected blocks
const QItemSelectionModel *const selModel = ui->tableView->selectionModel();
const QModelIndexList sel = selModel->selectedRows();
if(sel.size() != 0) {
for(const QModelIndex &index: sel) {
auto item = static_cast<Result *>(index.internalPointer());
result_stack.push(item);
seen_results.insert(item);
}
}
while(!result_stack.isEmpty()) {
const Result *const result = result_stack.pop();
GraphNode *node;
if(result->type == tr("Busy")) {
node = new GraphNode(graph, edb::v1::format_pointer(result->block), Qt::lightGray);
} else {
node = new GraphNode(graph, edb::v1::format_pointer(result->block), Qt::red);
}
nodes.insert(result->block, node);
for(edb::address_t pointer: result->points_to) {
const Result *next_result = result_map[pointer];
if(!seen_results.contains(next_result)) {
seen_results.insert(next_result);
result_stack.push(next_result);
}
}
}
qDebug("[Heap Analyzer] Done Processing %d Nodes", nodes.size());
#if 1
if(nodes.size() > 5000) {
qDebug("[Heap Analyzer] Too Many Nodes! (%d)", nodes.size());
delete graph;
return;
}
#endif
for(const Result *result: result_map) {
const edb::address_t addr = result->block;
if(nodes.contains(addr)) {
for(edb::address_t pointer: result->points_to) {
new GraphEdge(nodes[addr], nodes[pointer]);
}
}
}
qDebug("[Heap Analyzer] Done Processing Edges");
} while(0);
graph->layout();
graph->show();
#endif
}
}
| Northern-Lights/edb-debugger | plugins/HeapAnalyzer/DialogHeap.cpp | C++ | gpl-2.0 | 18,197 |
<?php
/**
* Template for displaying search forms in Twenty Sixteen
*
* @package WordPress
* @subpackage metro
* @since Twenty Sixteen 1.0
*/
?>
<?php $search_text = "Search …"; ?>
<h2 class="widget-title"><?php echo _x( 'Search Blog:', 'label', 'twentysixteen' ); ?></h2>
<form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
<input type="text" value="<?php echo $search_text; ?>"
name="s" id="s"
onblur="if (this.value == '')
{this.value = '<?php echo $search_text; ?>';}"
onfocus="if (this.value == '<?php echo $search_text; ?>')
{this.value = '';}" />
<input type="hidden" id="searchsubmit" />
</form>
| jasonHalsey/metro | wp-content/themes/metro/searchform.php | PHP | gpl-2.0 | 658 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_65) on Sun Jan 11 16:07:03 EST 2015 -->
<title>C12PacketUpdateSign (Forge API)</title>
<meta name="date" content="2015-01-11">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="C12PacketUpdateSign (Forge API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../net/minecraft/network/play/client/C11PacketEnchantItem.html" title="class in net.minecraft.network.play.client"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../net/minecraft/network/play/client/C13PacketPlayerAbilities.html" title="class in net.minecraft.network.play.client"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?net/minecraft/network/play/client/C12PacketUpdateSign.html" target="_top">Frames</a></li>
<li><a href="C12PacketUpdateSign.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">net.minecraft.network.play.client</div>
<h2 title="Class C12PacketUpdateSign" class="title">Class C12PacketUpdateSign</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="../../../../../net/minecraft/network/Packet.html" title="class in net.minecraft.network">net.minecraft.network.Packet</a></li>
<li>
<ul class="inheritance">
<li>net.minecraft.network.play.client.C12PacketUpdateSign</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">C12PacketUpdateSign</span>
extends <a href="../../../../../net/minecraft/network/Packet.html" title="class in net.minecraft.network">Packet</a></pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../net/minecraft/network/play/client/C12PacketUpdateSign.html#C12PacketUpdateSign()">C12PacketUpdateSign</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../net/minecraft/network/play/client/C12PacketUpdateSign.html#C12PacketUpdateSign(int,%20int,%20int,%20java.lang.String[])">C12PacketUpdateSign</a></strong>(int p_i45264_1_,
int p_i45264_2_,
int p_i45264_3_,
java.lang.String[] p_i45264_4_)</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../net/minecraft/network/play/client/C12PacketUpdateSign.html#func_149585_e()">func_149585_e</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../net/minecraft/network/play/client/C12PacketUpdateSign.html#func_149586_d()">func_149586_d</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../net/minecraft/network/play/client/C12PacketUpdateSign.html#func_149588_c()">func_149588_c</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../net/minecraft/network/play/client/C12PacketUpdateSign.html#func_149589_f()">func_149589_f</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../net/minecraft/network/play/client/C12PacketUpdateSign.html#processPacket(net.minecraft.network.INetHandler)">processPacket</a></strong>(<a href="../../../../../net/minecraft/network/INetHandler.html" title="interface in net.minecraft.network">INetHandler</a> p_148833_1_)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../net/minecraft/network/play/client/C12PacketUpdateSign.html#processPacket(net.minecraft.network.play.INetHandlerPlayServer)">processPacket</a></strong>(<a href="../../../../../net/minecraft/network/play/INetHandlerPlayServer.html" title="interface in net.minecraft.network.play">INetHandlerPlayServer</a> p_148833_1_)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../net/minecraft/network/play/client/C12PacketUpdateSign.html#readPacketData(net.minecraft.network.PacketBuffer)">readPacketData</a></strong>(<a href="../../../../../net/minecraft/network/PacketBuffer.html" title="class in net.minecraft.network">PacketBuffer</a> p_148837_1_)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../net/minecraft/network/play/client/C12PacketUpdateSign.html#writePacketData(net.minecraft.network.PacketBuffer)">writePacketData</a></strong>(<a href="../../../../../net/minecraft/network/PacketBuffer.html" title="class in net.minecraft.network">PacketBuffer</a> p_148840_1_)</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_net.minecraft.network.Packet">
<!-- -->
</a>
<h3>Methods inherited from class net.minecraft.network.<a href="../../../../../net/minecraft/network/Packet.html" title="class in net.minecraft.network">Packet</a></h3>
<code><a href="../../../../../net/minecraft/network/Packet.html#generatePacket(com.google.common.collect.BiMap,%20int)">generatePacket</a>, <a href="../../../../../net/minecraft/network/Packet.html#hasPriority()">hasPriority</a>, <a href="../../../../../net/minecraft/network/Packet.html#readBlob(io.netty.buffer.ByteBuf)">readBlob</a>, <a href="../../../../../net/minecraft/network/Packet.html#serialize()">serialize</a>, <a href="../../../../../net/minecraft/network/Packet.html#toString()">toString</a>, <a href="../../../../../net/minecraft/network/Packet.html#writeBlob(io.netty.buffer.ByteBuf,%20byte[])">writeBlob</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="C12PacketUpdateSign()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>C12PacketUpdateSign</h4>
<pre>public C12PacketUpdateSign()</pre>
</li>
</ul>
<a name="C12PacketUpdateSign(int, int, int, java.lang.String[])">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>C12PacketUpdateSign</h4>
<pre>public C12PacketUpdateSign(int p_i45264_1_,
int p_i45264_2_,
int p_i45264_3_,
java.lang.String[] p_i45264_4_)</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="readPacketData(net.minecraft.network.PacketBuffer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readPacketData</h4>
<pre>public void readPacketData(<a href="../../../../../net/minecraft/network/PacketBuffer.html" title="class in net.minecraft.network">PacketBuffer</a> p_148837_1_)
throws java.io.IOException</pre>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../net/minecraft/network/Packet.html#readPacketData(net.minecraft.network.PacketBuffer)">readPacketData</a></code> in class <code><a href="../../../../../net/minecraft/network/Packet.html" title="class in net.minecraft.network">Packet</a></code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code></dd></dl>
</li>
</ul>
<a name="writePacketData(net.minecraft.network.PacketBuffer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writePacketData</h4>
<pre>public void writePacketData(<a href="../../../../../net/minecraft/network/PacketBuffer.html" title="class in net.minecraft.network">PacketBuffer</a> p_148840_1_)
throws java.io.IOException</pre>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../net/minecraft/network/Packet.html#writePacketData(net.minecraft.network.PacketBuffer)">writePacketData</a></code> in class <code><a href="../../../../../net/minecraft/network/Packet.html" title="class in net.minecraft.network">Packet</a></code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code></dd></dl>
</li>
</ul>
<a name="processPacket(net.minecraft.network.play.INetHandlerPlayServer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>processPacket</h4>
<pre>public void processPacket(<a href="../../../../../net/minecraft/network/play/INetHandlerPlayServer.html" title="interface in net.minecraft.network.play">INetHandlerPlayServer</a> p_148833_1_)</pre>
</li>
</ul>
<a name="func_149588_c()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>func_149588_c</h4>
<pre>public int func_149588_c()</pre>
</li>
</ul>
<a name="func_149586_d()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>func_149586_d</h4>
<pre>public int func_149586_d()</pre>
</li>
</ul>
<a name="func_149585_e()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>func_149585_e</h4>
<pre>public int func_149585_e()</pre>
</li>
</ul>
<a name="func_149589_f()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>func_149589_f</h4>
<pre>public java.lang.String[] func_149589_f()</pre>
</li>
</ul>
<a name="processPacket(net.minecraft.network.INetHandler)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>processPacket</h4>
<pre>public void processPacket(<a href="../../../../../net/minecraft/network/INetHandler.html" title="interface in net.minecraft.network">INetHandler</a> p_148833_1_)</pre>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../net/minecraft/network/Packet.html#processPacket(net.minecraft.network.INetHandler)">processPacket</a></code> in class <code><a href="../../../../../net/minecraft/network/Packet.html" title="class in net.minecraft.network">Packet</a></code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../net/minecraft/network/play/client/C11PacketEnchantItem.html" title="class in net.minecraft.network.play.client"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../net/minecraft/network/play/client/C13PacketPlayerAbilities.html" title="class in net.minecraft.network.play.client"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?net/minecraft/network/play/client/C12PacketUpdateSign.html" target="_top">Frames</a></li>
<li><a href="C12PacketUpdateSign.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| Gullanshire/Minecraft_Mod-The_Exorcist | 1.7.10_Forge_Documents/net/minecraft/network/play/client/C12PacketUpdateSign.html | HTML | gpl-2.0 | 16,257 |
/* Copyright Statement:
*
* This software/firmware and related documentation ("MediaTek Software") are
* protected under relevant copyright laws. The information contained herein
* is confidential and proprietary to MediaTek Inc. and/or its licensors.
* Without the prior written permission of MediaTek inc. and/or its licensors,
* any reproduction, modification, use or disclosure of MediaTek Software,
* and information contained herein, in whole or in part, shall be strictly prohibited.
*
* MediaTek Inc. (C) 2012. All rights reserved.
*
* BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
* THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
* CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
* SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
* STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
* CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* The following software/firmware and/or related documentation ("MediaTek Software")
* have been modified by MediaTek Inc. All revisions are subject to any receiver's
* applicable license agreements with MediaTek Inc.
*/
package com.mediatek.rcse.mvc;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.os.Message;
import android.os.ParcelUuid;
import android.os.RemoteException;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import android.util.Log;
import com.mediatek.rcse.activities.ChatScreenActivity;
import com.mediatek.rcse.activities.PluginProxyActivity;
import com.mediatek.rcse.activities.SettingsFragment;
import com.mediatek.rcse.activities.widgets.ContactsListManager;
import com.mediatek.rcse.activities.widgets.UnreadMessagesContainer;
import com.mediatek.rcse.api.CapabilityApi;
import com.mediatek.rcse.api.CapabilityApi.ICapabilityListener;
import com.mediatek.rcse.api.Logger;
import com.mediatek.rcse.api.Participant;
import com.mediatek.rcse.api.RegistrationApi;
import com.mediatek.rcse.api.RegistrationApi.IRegistrationStatusListener;
import com.mediatek.rcse.fragments.ChatFragment;
import com.mediatek.rcse.interfaces.ChatController;
import com.mediatek.rcse.interfaces.ChatModel.IChat;
import com.mediatek.rcse.interfaces.ChatModel.IChatManager;
import com.mediatek.rcse.interfaces.ChatModel.IChatMessage;
import com.mediatek.rcse.interfaces.ChatView;
import com.mediatek.rcse.interfaces.ChatView.IChatEventInformation.Information;
import com.mediatek.rcse.interfaces.ChatView.IChatWindow;
import com.mediatek.rcse.interfaces.ChatView.IFileTransfer;
import com.mediatek.rcse.interfaces.ChatView.IFileTransfer.Status;
import com.mediatek.rcse.interfaces.ChatView.IGroupChatWindow;
import com.mediatek.rcse.interfaces.ChatView.IOne2OneChatWindow;
import com.mediatek.rcse.plugin.message.PluginGroupChatWindow;
import com.mediatek.rcse.service.ApiManager;
import com.mediatek.rcse.service.RcsNotification;
import com.orangelabs.rcs.R;
import com.orangelabs.rcs.core.ims.service.im.chat.imdn.ImdnDocument;
import com.orangelabs.rcs.core.ims.service.im.filetransfer.FileSharingError;
import com.orangelabs.rcs.platform.AndroidFactory;
import com.orangelabs.rcs.provider.eab.ContactsManager;
import com.orangelabs.rcs.provider.messaging.RichMessagingData;
import com.orangelabs.rcs.provider.settings.RcsSettings;
import com.orangelabs.rcs.service.api.client.ClientApiException;
import com.orangelabs.rcs.service.api.client.capability.Capabilities;
import com.orangelabs.rcs.service.api.client.eventslog.EventsLogApi;
import com.orangelabs.rcs.service.api.client.messaging.IChatSession;
import com.orangelabs.rcs.service.api.client.messaging.IFileTransferEventListener;
import com.orangelabs.rcs.service.api.client.messaging.IFileTransferSession;
import com.orangelabs.rcs.service.api.client.messaging.InstantMessage;
import com.orangelabs.rcs.service.api.client.messaging.MessagingApi;
import com.orangelabs.rcs.service.api.client.messaging.MessagingApiIntents;
import com.orangelabs.rcs.utils.PhoneUtils;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Timer;
import java.util.TreeSet;
import java.util.UUID;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicReference;
/**
* This is the virtual Module part in the MVC pattern
*/
public class ModelImpl implements IChatManager {
public static final String TAG = "ModelImpl";
private static final String CONTACT_NAME = "contactDisplayname";
private static final String INTENT_MESSAGE = "messages";
private static final String EMPTY_STRING = "";
private static final String COMMA = ", ";
private static final String SEMICOLON = ";";
public static final Timer TIMER = new Timer();
public static final int INDEXT_ONE = 1;
private static int sIdleTimeout = 0;
private static final IChatManager INSTANCE = new ModelImpl();
private static final HandlerThread CHAT_WORKER_THREAD = new HandlerThread("Chat Worker");
static {
CHAT_WORKER_THREAD.start();
AsyncTask<Void, Void, Void> task = new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... arg0) {
sIdleTimeout = RcsSettings.getInstance().getIsComposingTimeout() * 1000;
return null;
}
};
task.execute();
}
// The map retains Object&IChat&List<Participant>
private final Map<Object, IChat> mChatMap = new HashMap<Object, IChat>();
public static IChatManager getInstance() {
return INSTANCE;
}
@Override
public IChat addChat(List<Participant> participants, Object chatTag) {
Logger.d(TAG, "addChat() entry, participants: " + participants + " chatTag: " + chatTag);
int size = 0;
IChat chat = null;
ParcelUuid parcelUuid = null;
if (chatTag == null) {
UUID uuid = UUID.randomUUID();
parcelUuid = new ParcelUuid(uuid);
} else {
parcelUuid = (ParcelUuid) chatTag;
}
Logger.d(TAG, "addChat() parcelUuid: " + parcelUuid + ",participants = " + participants);
if (null != participants && participants.size() > 0) {
size = participants.size();
if (size > 1) {
chat = new GroupChat(this, null, participants, parcelUuid);
mChatMap.put(parcelUuid, chat);
IGroupChatWindow chatWindow = ViewImpl.getInstance().addGroupChatWindow(parcelUuid,
((GroupChat) chat).getParticipantInfos());
((GroupChat) chat).setChatWindow(chatWindow);
} else {
chat = getOne2OneChat(participants.get(0));
if (null == chat) {
Logger.i(TAG, "addChat() The one-2-one chat with " + participants
+ "doesn't exist.");
Participant participant = participants.get(0);
chat = new One2OneChat(this, null, participant, parcelUuid);
mChatMap.put(parcelUuid, chat);
String number = participant.getContact();
if (ContactsListManager.getInstance().isLocalContact(number)
|| ContactsListManager.getInstance().isStranger(number)) {
Logger.d(TAG, "addChat() the number is local or stranger" + number);
} else {
CapabilityApi capabilityApi = ApiManager.getInstance()
.getCapabilityApi();
Logger.d(TAG,
"addChat() the number is not local or stranger"
+ number + ", capabilityApi= "
+ capabilityApi);
if (capabilityApi != null) {
Capabilities capability = capabilityApi
.getContactCapabilities(number);
Logger.d(TAG, "capability = " + capability);
if (capability != null) {
if (capability.isSupportedRcseContact()) {
ContactsListManager.getInstance()
.setStrangerList(number, true);
} else {
ContactsListManager.getInstance()
.setStrangerList(number, false);
}
}
}
}
IOne2OneChatWindow chatWindow = ViewImpl.getInstance().addOne2OneChatWindow(
parcelUuid, participants.get(0));
((One2OneChat) chat).setChatWindow(chatWindow);
} else {
Logger.i(TAG, "addChat() The one-2-one chat with " + participants
+ "has existed.");
ViewImpl.getInstance().switchChatWindowByTag(
(ParcelUuid) (((One2OneChat) chat).mTag));
}
}
}
Logger.d(TAG, "addChat(),the chat is " + chat);
return chat;
}
private IChat addChat(List<Participant> participants) {
return addChat(participants, null);
}
public IChat getOne2oneChatByContact(String contact) {
Logger.i(TAG, "getOne2oneChatByContact() contact: " + contact);
IChat chat = null;
if (TextUtils.isEmpty(contact)) {
return chat;
}
ArrayList<Participant> participant = new ArrayList<Participant>();
participant.add(new Participant(contact, contact));
chat = addChat(participant, null);
return chat;
}
private IChat getOne2OneChat(Participant participant) {
Logger.i(TAG, "getOne2OneChat() entry the participant is " + participant);
Collection<IChat> chats = mChatMap.values();
for (IChat chat : chats) {
if (chat instanceof One2OneChat && ((One2OneChat) chat).isDuplicated(participant)) {
Logger.d(TAG, "getOne2OneChat() find the 1-2-1 chat with " + participant
+ " has existed");
return chat;
}
}
Logger.d(TAG, "getOne2OneChat() could not find the 1-2-1 chat with " + participant);
return null;
}
private void switchGroupChat(IChat chat) {
Logger.d(TAG, "switchGroupChat() entry, chat: " + chat);
ParcelUuid tag = (ParcelUuid) (((GroupChat) chat).mTag);
ViewImpl.getInstance().switchChatWindowByTag(tag);
Logger.d(TAG, "switchGroupChat() exit, tag: " + tag);
}
@Override
public IChat getChat(Object tag) {
Logger.v(TAG, "getChat(),tag = " + tag);
if (tag instanceof ParcelUuid) {
Logger.v(TAG, "tgetChat(),tag instanceof ParcelUuid");
} else {
Logger.v(TAG, "tgetChat(),tag not instanceof ParcelUuid");
}
if (tag == null) {
Logger.v(TAG, "tag is null so return null");
return null;
}
if (mChatMap.isEmpty()) {
Logger.v(TAG, "mChatMap is empty so no chat exist");
return null;
}
IChat chat = mChatMap.get(tag);
Logger.v(TAG, "return chat = " + chat);
return chat;
}
@Override
public List<IChat> listAllChat() {
List<IChat> list = new ArrayList<IChat>();
if (mChatMap.isEmpty()) {
Logger.w(TAG, "mChatMap is empty");
return list;
}
Collection<IChat> collection = mChatMap.values();
Iterator<IChat> iter = collection.iterator();
while (iter.hasNext()) {
IChat chat = iter.next();
if (chat != null) {
Logger.w(TAG, "listAllChat()-IChat is empty");
list.add(chat);
}
}
return list;
}
@Override
public boolean removeChat(Object tag) {
if (tag == null) {
Logger.w(TAG, "removeChat()-The tag is null");
return false;
}
ParcelUuid uuid = new ParcelUuid(UUID.fromString(tag.toString()));
IChat chat = mChatMap.remove(uuid);
if (chat != null) {
((ChatImpl) chat).onDestroy();
mOutGoingFileTransferManager.onChatDestroy(tag);
ViewImpl.getInstance().removeChatWindow(((ChatImpl) chat).getChatWindow());
return true;
} else {
Logger.d(TAG, "removeChat()-The chat is null");
return false;
}
}
/**
* Remove group chat, but does not close the window associated with the
* chat.
*
* @param tag The tag of the group chat to be removed.
* @return True if success, else false.
*/
public boolean quitGroupChat(Object tag) {
Logger.d(TAG, "quitGroupChat() entry, with tag is " + tag);
if (tag == null) {
Logger.w(TAG, "quitGroupChat() tag is null");
return false;
}
IChat chat = getChat(tag);
if (chat instanceof GroupChat) {
((GroupChat) chat).onQuit();
mOutGoingFileTransferManager.onChatDestroy(tag);
return true;
} else {
Logger.d(TAG, "quitGroupChat() chat is null");
return false;
}
}
/**
* when there is not not file transfer capability, cancel all the file
* transfer
*
* @param tag The tag of the chat.
* @param reason the reason for file transfer not available.
*/
public void handleFileTransferNotAvailable(Object tag, int reason) {
Logger.d(TAG, "handleFileTransferNotAvailable() entry, with tag is " + tag + " reason is "
+ reason);
if (tag == null) {
Logger.w(TAG, "handleFileTransferNotAvailable() tag is null");
} else {
mOutGoingFileTransferManager.clearTransferWithTag(tag, reason);
}
}
/**
* remove chat according the relevant participant
*
* @param the participant of the chat
*/
public void removeChatByContact(Participant participant) {
IChat chat = getOne2OneChat(participant);
Logger.v(TAG, "removeChatByContact(),participant = " + participant
+ ", chat = " + chat);
if (chat != null) {
removeChat((ChatImpl) chat);
}
}
private boolean removeChat(final ChatImpl chat) {
if (mChatMap.isEmpty()) {
Logger.w(TAG, "removeChat()-mChatMap is empty");
return false;
}
if (!mChatMap.containsValue(chat)) {
Logger.w(TAG, "removeChat()-mChatMap didn't contains this IChat");
return false;
} else {
Logger.v(TAG, "mchatMap size is " + mChatMap.size());
mChatMap.values().remove(chat);
Logger.v(TAG, "After removded mchatMap size is " + mChatMap.size() + ", chat = "
+ chat);
if (chat != null) {
chat.onDestroy();
mOutGoingFileTransferManager.onChatDestroy(chat.mTag);
ViewImpl.getInstance().removeChatWindow(chat.getChatWindow());
}
return true;
}
}
/**
* Clear all the chat messages. Include clear all the messages in date base
* ,clear messages in all the chat window and clear the last message in each
* chat list item.
*/
public void clearAllChatHistory() {
ContentResolver contentResolver =
ApiManager.getInstance().getContext().getContentResolver();
contentResolver.delete(RichMessagingData.CONTENT_URI, null, null);
List<IChat> list = INSTANCE.listAllChat();
int size = list.size();
Logger.d(TAG, "clearAllChatHistory(), the size of the chat list is " + size);
for (int i = 0; i < size; i++) {
IChat chat = list.get(i);
if (chat != null) {
((ChatImpl) chat).clearChatWindowAndList();
}
}
}
/**
* This class is the implementation of a chat message used in model part
*/
private static class ChatMessage implements IChatMessage {
private InstantMessage mInstantMessage;
public ChatMessage(InstantMessage instantMessage) {
mInstantMessage = instantMessage;
}
@Override
public InstantMessage getInstantMessage() {
return mInstantMessage;
}
}
/**
* This class is the implementation of a sent chat message used in model
* part
*/
public static class ChatMessageSent extends ChatMessage {
public ChatMessageSent(InstantMessage instantMessage) {
super(instantMessage);
}
}
/**
* This class is the implementation of a received chat message used in model
* part
*/
public static class ChatMessageReceived extends ChatMessage {
public ChatMessageReceived(InstantMessage instantMessage) {
super(instantMessage);
}
}
/**
* The call-back method of the interface called when the unread message
* number changed
*/
public interface UnreadMessageListener {
/**
* The call-back method to update the unread message when the number of
* unread message changed
*
* @param chatWindowTag The chat window tag indicates which to update
* @param clear Whether cleared all unread message
*/
void onUnreadMessageNumberChanged(Object chatWindowTag, boolean clear);
}
/**
* It's a implementation of IChat, it indicates a specify chat model.
*/
public abstract class ChatImpl implements IChat, IRegistrationStatusListener,
ICapabilityListener {
private static final String TAG = "ChatImpl";
// Chat message list
private final List<IChatMessage> mMessageList = new LinkedList<IChatMessage>();
protected final AtomicReference<IChatSession> mCurrentSession =
new AtomicReference<IChatSession>();
protected ComposingManager mComposingManager = new ComposingManager();
protected Object mTag = null;
protected boolean mIsInBackground = true;
protected IChatWindow mChatWindow = null;
protected List<InstantMessage> mReceivedInBackgroundToBeDisplayed =
new ArrayList<InstantMessage>();
protected List<InstantMessage> mReceivedInBackgroundToBeRead =
new ArrayList<InstantMessage>();
protected RegistrationApi mRegistrationApi = null;
protected Thread mWorkerThread = CHAT_WORKER_THREAD;
protected Handler mWorkerHandler = new Handler(CHAT_WORKER_THREAD.getLooper());
/**
* Clear all the messages in chat Window and the latest message in chat
* list.
*/
public void clearChatWindowAndList() {
Logger.d(TAG, "clearChatWindowAndList() entry");
mChatWindow.removeAllMessages();
Logger.d(TAG, "clearChatWindowAndList() exit");
}
/**
* Set chat window for this chat.
*
* @param chatWindow The chat window to be set.
*/
public void setChatWindow(IChatWindow chatWindow) {
Logger.d(TAG, "setChatWindow entry");
mChatWindow = chatWindow;
}
/**
* Add the unread message of this chat
*
* @param message The unread message to add
*/
protected void addUnreadMessage(InstantMessage message) {
if (message.isImdnDisplayedRequested()) {
Logger.d(TAG, "mReceivedInBackgroundToBeDisplayed = "
+ mReceivedInBackgroundToBeDisplayed);
if (mReceivedInBackgroundToBeDisplayed != null) {
mReceivedInBackgroundToBeDisplayed.add(message);
if (mTag instanceof UUID) {
ParcelUuid parcelUuid = new ParcelUuid((UUID) mTag);
UnreadMessagesContainer.getInstance().add(parcelUuid);
} else {
UnreadMessagesContainer.getInstance().add((ParcelUuid) mTag);
}
UnreadMessagesContainer.getInstance().loadLatestUnreadMessage();
}
} else {
Logger.d(TAG, "mReceivedInBackgroundToBeRead = "
+ mReceivedInBackgroundToBeRead);
if (mReceivedInBackgroundToBeRead != null) {
mReceivedInBackgroundToBeRead.add(message);
if (mTag instanceof UUID) {
ParcelUuid parcelUuid = new ParcelUuid((UUID) mTag);
UnreadMessagesContainer.getInstance().add(parcelUuid);
} else {
UnreadMessagesContainer.getInstance().add(
(ParcelUuid) mTag);
}
UnreadMessagesContainer.getInstance()
.loadLatestUnreadMessage();
}
}
}
/**
* Get unread messages of this chat.
*
* @return The unread messages.
*/
public List<InstantMessage> getUnreadMessages() {
if (mReceivedInBackgroundToBeDisplayed != null
&& mReceivedInBackgroundToBeDisplayed.size() > 0) {
return mReceivedInBackgroundToBeDisplayed;
} else {
return mReceivedInBackgroundToBeRead;
}
}
/**
* Clear all the unread message of this chat
*/
protected void clearUnreadMessage() {
Logger.v(TAG,
"clearUnreadMessage(): mReceivedInBackgroundToBeDisplayed = "
+ mReceivedInBackgroundToBeDisplayed
+ ", mReceivedInBackgroundToBeRead = "
+ mReceivedInBackgroundToBeRead);
if (null != mReceivedInBackgroundToBeDisplayed) {
mReceivedInBackgroundToBeDisplayed.clear();
UnreadMessagesContainer.getInstance().remove((ParcelUuid) mTag);
UnreadMessagesContainer.getInstance().loadLatestUnreadMessage();
}
if (null != mReceivedInBackgroundToBeRead) {
mReceivedInBackgroundToBeRead.clear();
UnreadMessagesContainer.getInstance().remove((ParcelUuid) mTag);
UnreadMessagesContainer.getInstance().loadLatestUnreadMessage();
}
}
protected ChatImpl(Object tag) {
mTag = tag;
// register IRegistrationStatusListener
ApiManager apiManager = ApiManager.getInstance();
Logger.v(TAG, "ChatImpl() entry: apiManager = " + apiManager);
if (null != apiManager) {
mRegistrationApi = ApiManager.getInstance().getRegistrationApi();
Logger.v(TAG, "mRegistrationApi = " + mRegistrationApi);
if (mRegistrationApi != null) {
mRegistrationApi.addRegistrationStatusListener(this);
}
CapabilityApi capabilityApi = ApiManager.getInstance().getCapabilityApi();
Logger.v(TAG, "capabilityApi = " + capabilityApi);
if (capabilityApi != null) {
capabilityApi.registerCapabilityListener(this);
}
}
}
/**
* Get the chat tag of current chat
*
* @return The chat tag of current chat
*/
public Object getChatTag() {
return mTag;
}
protected void onPause() {
Logger.v(TAG, "onPause() entry, tag: " + mTag);
mIsInBackground = true;
}
protected void onResume() {
Logger.v(TAG, "onResume() entry, tag: " + mTag);
mIsInBackground = false;
if (mChatWindow != null) {
mChatWindow.updateAllMsgAsRead();
}
markUnreadMessageDisplayed();
loadChatMessages(One2OneChat.LOAD_ZERO_SHOW_HEADER);
}
protected synchronized void onDestroy() {
this.queryCapabilities();
ApiManager apiManager = ApiManager.getInstance();
Logger.v(TAG, "onDestroy() apiManager = " + apiManager);
if (null != apiManager) {
CapabilityApi capabilityApi = ApiManager.getInstance().getCapabilityApi();
Logger.v(TAG, "onDestroy() capabilityApi = " + capabilityApi);
if (capabilityApi != null) {
capabilityApi.unregisterCapabilityListener(this);
}
}
Logger.v(TAG, "onDestroy() mRegistrationApi = " + mRegistrationApi
+ ",mCurrentSession = " + mCurrentSession.get());
if (mRegistrationApi != null) {
mRegistrationApi.removeRegistrationStatusListener(this);
}
if (mCurrentSession.get() != null) {
try {
terminateSession();
} catch (RemoteException e) {
e.printStackTrace();
}
}
}
/**
* Return the IChatWindow
*
* @return IChatWindow
*/
IChatWindow getChatWindow() {
return mChatWindow;
}
protected void markMessageAsDisplayed(InstantMessage msg) {
Logger.d(TAG, "markMessageAsDisplayed() entry");
if (msg == null) {
Logger.d(TAG, "markMessageAsDisplayed(),msg is null");
return;
}
try {
IChatSession tmpChatSession = mCurrentSession.get();
SharedPreferences settings =
PreferenceManager.getDefaultSharedPreferences(ApiManager.getInstance()
.getContext());
boolean isSendReadReceiptChecked =
settings.getBoolean(SettingsFragment.RCS_SEND_READ_RECEIPT, true);
Logger.d(TAG, "markMessageAsDisplayed() ,the value of isSendReadReceiptChecked is "
+ isSendReadReceiptChecked);
if (tmpChatSession == null) {
Logger.d(TAG, "markMessageAsDisplayed() ,tmpChatSession is null");
return;
}
Logger.d(TAG,
"markMessageAsDisplayed() ,the value of isSendReadReceiptChecked is "
+ isSendReadReceiptChecked);
if (isSendReadReceiptChecked) {
if (tmpChatSession.isStoreAndForward()) {
Logger.v(TAG,
"markMessageAsDisplayed(),send displayed message by sip message");
tmpChatSession.setMessageDisplayedStatusBySipMessage(tmpChatSession
.getReferredByHeader(), msg.getMessageId(),
ImdnDocument.DELIVERY_STATUS_DISPLAYED);
} else {
Logger.v(TAG,
"markMessageAsDisplayed(),send displayed message by msrp message");
tmpChatSession.setMessageDeliveryStatus(msg.getMessageId(),
ImdnDocument.DELIVERY_STATUS_DISPLAYED);
}
}
} catch (RemoteException e) {
e.printStackTrace();
}
Logger.d(TAG, "markMessageAsDisplayed() exit");
}
protected void markMessageAsRead(InstantMessage msg) {
Logger.d(TAG, "markMessageAsRead() entry");
EventsLogApi events = null;
if (ApiManager.getInstance() != null) {
events = ApiManager.getInstance().getEventsLogApi();
events.markChatMessageAsRead(msg.getMessageId(), true);
}
Logger.d(TAG, "markMessageAsRead() exit");
}
protected void markUnreadMessageDisplayed() {
Logger.v(TAG, "markUnreadMessageDisplayed() entry");
int size = mReceivedInBackgroundToBeDisplayed.size();
for (int i = 0; i < size; i++) {
InstantMessage msg = mReceivedInBackgroundToBeDisplayed.get(i);
markMessageAsDisplayed(msg);
Logger.v(TAG, "The message " + msg.getTextMessage() + " is displayed");
}
size = mReceivedInBackgroundToBeRead.size();
for (int i = 0; i < size; i++) {
InstantMessage msg = mReceivedInBackgroundToBeRead.get(i);
markMessageAsRead(msg);
Logger.v(TAG, "The message " + msg.getTextMessage() + " is read");
}
clearUnreadMessage();
Logger.v(TAG, "markUnreadMessageDisplayed() exit");
}
private void terminateSession() throws RemoteException {
if (mCurrentSession.get() != null) {
mCurrentSession.get().cancelSession();
mCurrentSession.set(null);
Logger.i(TAG, "terminateSession()---mCurrentSession cancel and is null");
}
}
protected void reloadMessage(InstantMessage message, int messageType, int status) {
Logger.w(TAG, "reloadMessage() sub-class needs to override this method");
}
protected void reloadFileTransfer(FileStruct fileStruct, int transferType, int status) {
Logger.w(TAG, "reloadFileTransfer() sub-class needs to override this method");
}
protected class ComposingManager {
private static final int ACT_STATE_TIME_OUT = 60 * 1000;
private boolean mIsComposing = false;
private static final int STARTING_COMPOSING = 1;
private static final int STILL_COMPOSING = 2;
private static final int MESSAGE_WAS_SENT = 3;
private static final int ACTIVE_MESSAGE_REFRESH = 4;
private static final int IS_IDLE = 5;
private ComposingHandler mWorkerHandler =
new ComposingHandler(CHAT_WORKER_THREAD.getLooper());
public ComposingManager() {
}
protected class ComposingHandler extends Handler {
public static final String TAG = "ComposingHandler";
public ComposingHandler(Looper looper) {
super(looper);
}
@Override
public void handleMessage(Message msg) {
Logger.i(TAG, "handleMessage() the msg is:" + msg.what);
switch (msg.what) {
case STARTING_COMPOSING:
if (setIsComposing(true)) {
mIsComposing = true;
mWorkerHandler.sendEmptyMessageDelayed(IS_IDLE, sIdleTimeout);
mWorkerHandler.sendEmptyMessageDelayed(ACTIVE_MESSAGE_REFRESH,
ACT_STATE_TIME_OUT);
} else {
Logger.d(TAG,
"STARTING_COMPOSING-> failed to set isComposing to true");
}
break;
case STILL_COMPOSING:
mWorkerHandler.removeMessages(IS_IDLE);
mWorkerHandler.sendEmptyMessageDelayed(IS_IDLE, sIdleTimeout);
break;
case MESSAGE_WAS_SENT:
if (setIsComposing(false)) {
mComposingManager.hasNoText();
mWorkerHandler.removeMessages(IS_IDLE);
mWorkerHandler.removeMessages(ACTIVE_MESSAGE_REFRESH);
} else {
Logger.d(TAG,
"MESSAGE_WAS_SENT-> failed to set isComposing to false");
}
break;
case ACTIVE_MESSAGE_REFRESH:
if (setIsComposing(true)) {
mWorkerHandler.sendEmptyMessageDelayed(ACTIVE_MESSAGE_REFRESH,
ACT_STATE_TIME_OUT);
} else {
Logger
.d(TAG,
"ACTIVE_MESSAGE_REFRESH-> failed to set isComposing to true");
}
break;
case IS_IDLE:
if (setIsComposing(false)) {
mComposingManager.hasNoText();
mWorkerHandler.removeMessages(ACTIVE_MESSAGE_REFRESH);
} else {
Logger.d(TAG, "IS_IDLE-> failed to set isComposing to false");
}
break;
default:
Logger.i(TAG, "handlemessage()--message" + msg.what);
break;
}
}
}
public void hasText(Boolean isEmpty) {
Logger.d(TAG, "hasText() entry the edit is " + isEmpty);
if (isEmpty) {
mWorkerHandler.sendEmptyMessage(MESSAGE_WAS_SENT);
} else {
if (!mIsComposing) {
mWorkerHandler.sendEmptyMessage(STARTING_COMPOSING);
} else {
mWorkerHandler.sendEmptyMessage(STILL_COMPOSING);
}
}
}
public void hasNoText() {
mIsComposing = false;
}
public void messageWasSent() {
mWorkerHandler.sendEmptyMessage(MESSAGE_WAS_SENT);
}
}
protected boolean setIsComposing(boolean isComposing) {
if (mCurrentSession.get() == null) {
Logger.e(TAG, "setIsComposing() -- The chat with the tag " + " doesn't exist!");
return false;
} else {
try {
mCurrentSession.get().setIsComposingStatus(isComposing);
} catch (RemoteException e) {
e.printStackTrace();
}
return true;
}
}
@Override
public IChatMessage getSentChatMessage(int index) {
if (index < 0 || index > mMessageList.size()) {
return null;
}
return mMessageList.get(index);
}
@Override
public int getChatMessageCount() {
return mMessageList.size();
}
@Override
public List<IChatMessage> listAllChatMessages() {
return mMessageList;
}
@Override
public abstract void loadChatMessages(int count);
@Override
public boolean removeMessage(int index) {
if (index < 0 || index > mMessageList.size()) {
return false;
}
mMessageList.remove(index);
return true;
}
@Override
public boolean removeMessages(int start, int end) {
if (start < 0 || start > mMessageList.size()) {
return false;
}
return true;
}
/**
* Check capabilities before inviting a chat
*/
protected abstract void checkCapabilities();
/**
* Query capabilities after terminating a chat
*/
protected abstract void queryCapabilities();
@Override
public void hasTextChanged(boolean isEmpty) {
mComposingManager.hasText(isEmpty);
}
@Override
public abstract void onCapabilityChanged(String contact, Capabilities capabilities);
@Override
public abstract void onStatusChanged(boolean status);
}
private boolean isChatExisted(Participant participant) {
Logger.v(TAG, "isHaveChat() The participant is " + participant);
boolean bIsHaveChat = false;
// Find the chat in the chat list
Collection<IChat> chatList = mChatMap.values();
if (chatList != null) {
for (IChat chat : chatList) {
if (chat instanceof One2OneChat) {
if (null != participant && (((One2OneChat) chat).isDuplicated(participant))) {
bIsHaveChat = true;
}
}
}
}
Logger.i(TAG, "isHaveChat() end, bIsHaveChat = " + bIsHaveChat);
return bIsHaveChat;
}
@Override
public boolean handleInvitation(Intent intent, boolean isCheckSessionExist) {
Logger.v(TAG, "handleInvitation entry");
String action = null;
if (intent == null) {
Logger.d(TAG, "handleInvitation intent is null");
return false;
} else {
action = intent.getAction();
}
if (MessagingApiIntents.CHAT_SESSION_REPLACED.equalsIgnoreCase(action)) {
Logger.d(TAG, " handleInvitation() the action is CHAT_SESSION_REPLACED ");
} else if (MessagingApiIntents.CHAT_INVITATION.equalsIgnoreCase(action)) {
return handleChatInvitation(intent, isCheckSessionExist);
}
Logger.v(TAG, "handleInvitation exit: action = " + action);
return false;
}
private boolean handleChatInvitation(Intent intent, boolean isCheckSessionExist) {
ApiManager instance = ApiManager.getInstance();
String sessionId = intent.getStringExtra("sessionId");
if (instance != null) {
MessagingApi messageApi = instance.getMessagingApi();
if (messageApi != null) {
try {
IChatSession chatSession = messageApi.getChatSession(sessionId);
if (chatSession == null) {
Logger.e(TAG, "The getChatSession is null");
return false;
}
List<String> participants = chatSession.getInivtedParticipants();
if (participants == null || participants.size() == 0) {
Logger.e(TAG, "The getParticipants is null, or size is 0");
return false;
}
int participantCount = participants.size();
ArrayList<InstantMessage> messages =
intent.getParcelableArrayListExtra(INTENT_MESSAGE);
ArrayList<IChatMessage> chatMessages = new ArrayList<IChatMessage>();
if (null != messages) {
int size = messages.size();
for (int i = 0; i < size; i++) {
InstantMessage msg = messages.get(i);
Logger.d(TAG, "InstantMessage:" + msg);
if (msg != null) {
chatMessages.add(new ChatMessageReceived(msg));
}
}
}
if (participantCount == 1) {
List<Participant> participantsList = new ArrayList<Participant>();
String remoteParticipant = participants.get(0);
String number = PhoneUtils.extractNumberFromUri(remoteParticipant);
String name = intent.getStringExtra(CONTACT_NAME);
Participant fromSessionParticipant = new Participant(number, name);
participantsList.add(fromSessionParticipant);
if (!isCheckSessionExist) {
IChat currentChat = addChat(participantsList);
currentChat.handleInvitation(chatSession, chatMessages);
return true;
} else {
if (isChatExisted(fromSessionParticipant)) {
IChat currentChat = addChat(participantsList);
currentChat.handleInvitation(chatSession, chatMessages);
Logger.v(TAG, "handleInvitation exit with true");
return true;
} else {
Logger.v(TAG, "handleInvitation exit with false");
return false;
}
}
} else if (participantCount > 1) {
List<Participant> participantsList = new ArrayList<Participant>();
for (int i = 0; i < participantCount; i++) {
String remoteParticipant = participants.get(i);
String number = PhoneUtils.extractNumberFromUri(remoteParticipant);
String name = number;
if (PhoneUtils.isANumber(number)) {
name = ContactsListManager.getInstance().getDisplayNameByPhoneNumber(number);
} else {
Logger
.e(TAG, "the participant " + number
+ " is not a real number");
}
Participant fromSessionParticipant = new Participant(number, name);
participantsList.add(fromSessionParticipant);
}
String chatId = intent.getStringExtra(RcsNotification.CHAT_ID);
ParcelUuid tag = (ParcelUuid) intent
.getParcelableExtra(ChatScreenActivity.KEY_CHAT_TAG);
IChat chat = getGroupChat(chatId);
if (chat == null) {
chat = addChat(participantsList, tag);
} else {
// restart chat.
chatMessages.clear();
}
chat.handleInvitation(chatSession, chatMessages);
return true;
} else {
Logger.e(TAG, "Illegal paticipants");
return false;
}
} catch (ClientApiException e) {
Logger.e(TAG, "getChatSession fail");
e.printStackTrace();
} catch (RemoteException e) {
Logger.e(TAG, "getParticipants fail");
e.printStackTrace();
}
}
}
return false;
}
@Override
public boolean handleFileTransferInvitation(String sessionId) {
ApiManager instance = ApiManager.getInstance();
if (instance != null) {
MessagingApi messageApi = instance.getMessagingApi();
if (messageApi != null) {
try {
IFileTransferSession fileTransferSession =
messageApi.getFileTransferSession(sessionId);
if (fileTransferSession == null) {
Logger.e(TAG,
"handleFileTransferInvitation-The getFileTransferSession is null");
return false;
}
List<Participant> participantsList = new ArrayList<Participant>();
String number =
PhoneUtils.extractNumberFromUri(fileTransferSession.getRemoteContact());
// Get the contact name from contact list
String name = EMPTY_STRING;
Logger.e(TAG, "handleFileTransferInvitation, number = " + name);
if (null != number) {
String tmpContact = ContactsListManager.getInstance().getDisplayNameByPhoneNumber(number);
if (tmpContact != null) {
name = tmpContact;
} else {
name = number;
}
}
Participant fromSessionParticipant = new Participant(number, name);
participantsList.add(fromSessionParticipant);
if (isChatExisted(fromSessionParticipant)) {
IChat chat = addChat(participantsList);
((One2OneChat) chat).addReceiveFileTransfer(fileTransferSession);
if (!((One2OneChat) chat).mIsInBackground) {
Logger.v(TAG, "handleFileTransferInvitation()" +
"-handleInvitation exit with true, is the current chat!");
return true;
} else {
Logger.v(TAG, "handleFileTransferInvitation()" +
"-handleInvitation exit with true, is not the current chat!");
return false;
}
} else {
Logger.v(TAG,
"handleFileTransferInvitation-handleInvitation exit with false");
IChat chat = addChat(participantsList);
((One2OneChat) chat).addReceiveFileTransfer(fileTransferSession);
return false;
}
} catch (ClientApiException e) {
Logger.e(TAG, "handleFileTransferInvitation-getChatSession fail");
e.printStackTrace();
} catch (RemoteException e) {
Logger.e(TAG, "handleFileTransferInvitation-getParticipants fail");
e.printStackTrace();
}
}
}
return false;
}
@Override
public void handleMessageDeliveryStatus(String contact, String msgId,
String status, long timeStamp) {
IChat chat = getOne2OneChat(new Participant(contact, contact));
Logger.d(TAG, "handleMessageDeliveryStatus() entry, contact:" + contact
+ " msgId:" + msgId + " status:" + status + " ,timeStamp: "
+ timeStamp + ",chat = " + chat);
if (null != chat) {
((One2OneChat) chat).onMessageDelivered(msgId, status, timeStamp);
}
}
/**
* Called by the controller when the user needs to cancel an on-going file
* transfer
*
* @param tag The chat window tag where the file transfer is in
* @param fileTransferTag The tag indicating which file transfer will be
* canceled
*/
public void handleCancelFileTransfer(Object tag, Object fileTransferTag) {
Logger.v(TAG, "handleCancelFileTransfer(),tag = " + tag + ",fileTransferTag = "
+ fileTransferTag);
IChat chat = getChat(tag);
if (chat == null) {
chat = getOne2oneChatByContact((String) tag);
}
if (chat instanceof One2OneChat) {
One2OneChat oneOneChat = ((One2OneChat) chat);
oneOneChat.handleCancelFileTransfer(fileTransferTag);
}
Logger.d(TAG, "handleCancelFileTransfer() it's a sent file transfer");
mOutGoingFileTransferManager.cancelFileTransfer(fileTransferTag);
}
/**
* Called by the controller when the user needs to resend a file
*
* @param fileTransferTag The tag of file which the user needs to resend
*/
public void handleResendFileTransfer(Object fileTransferTag) {
mOutGoingFileTransferManager.resendFileTransfer(fileTransferTag);
}
/**
* This class represents a file structure used to be shared
*/
public static class FileStruct {
public static final String TAG = "FileStruct";
/**
* Generate a file struct instance using a session and a path, this
* method should only be called for Received File Transfer
*
* @param fileTransferSession The session of the file transfer
* @param filePath The path of the file
* @return The file struct instance
* @throws RemoteException
*/
public static FileStruct from(IFileTransferSession fileTransferSession, String filePath)
throws RemoteException {
FileStruct fileStruct = null;
String fileName = fileTransferSession.getFilename();
long fileSize = fileTransferSession.getFilesize();
String sessionId = fileTransferSession.getSessionID();
Date date = new Date();
fileStruct = new FileStruct(filePath, fileName, fileSize, sessionId, date);
return fileStruct;
}
/**
* Generate a file struct instance using a path, this method should only
* be called for Sent File Transfer
*
* @param filePath The path of the file
* @return The file struct instance
*/
public static FileStruct from(String filePath) {
FileStruct fileStruct = null;
File file = new File(filePath);
if (file.exists()) {
Date date = new Date();
fileStruct =
new FileStruct(filePath, file.getName(), file.length(), new ParcelUuid(UUID
.randomUUID()), date);
}
Logger.d(TAG, "from() fileStruct: " + fileStruct);
return fileStruct;
}
public FileStruct(String filePath, String name, long size, Object fileTransferTag, Date date) {
mFilePath = filePath;
mName = name;
mSize = size;
mFileTransferTag = fileTransferTag;
mDate = (Date) date.clone();
}
public FileStruct(String filePath, String name, long size, Object fileTransferTag, Date date, String remote) {
mFilePath = filePath;
mName = name;
mSize = size;
mFileTransferTag = fileTransferTag;
mDate = (Date) date.clone();
mRemote = remote;
}
public String mFilePath = null;
public String mName = null;
public long mSize = -1;
public Object mFileTransferTag = null;
public Date mDate = null;
public String mRemote = null;
public String toString() {
return TAG + "file path is " + mFilePath + " file name is " + mName + " size is "
+ mSize + " FileTransferTag is " + mFileTransferTag + " date is " + mDate;
}
}
/**
* This class represents a chat event structure used to be shared
*/
public static class ChatEventStruct {
public static final String TAG = "ChatEventStruct";
public ChatEventStruct(Information info, Object relatedInfo, Date dt) {
information = info;
relatedInformation = relatedInfo;
date = (Date) dt.clone();
}
public Information information = null;
public Object relatedInformation = null;
public Date date = null;
public String toString() {
return TAG + "information is " + information + " relatedInformation is "
+ relatedInformation + " date is " + date;
}
}
/**
* Clear all history of the chats, include both one2one chat and group chat.
*
* @return True if successfully clear, false otherwise.
*/
public boolean clearAllHistory() {
Logger.d(TAG, "clearAllHistory() entry");
ControllerImpl controller = ControllerImpl.getInstance();
boolean result = false;
if (null != controller) {
Message controllerMessage = controller.obtainMessage(
ChatController.EVENT_CLEAR_CHAT_HISTORY, null, null);
controllerMessage.sendToTarget();
result = true;
}
Logger.d(TAG, "clearAllHistory() exit with result = " + result);
return result;
}
/**
* Called by the controller when the user needs to start a file transfer
*
* @param target The tag of the chat window in which the file transfer
* starts or the contact to receive this file
* @param filePath The path of the file to be transfered
*/
public void handleSendFileTransferInvitation(Object target, String filePath,
Object fileTransferTag) {
Logger.d(TAG, "handleSendFileTransferInvitation() user starts to send file " + filePath
+ " to target " + target + ", fileTransferTag: " + fileTransferTag);
IChat chat = null;
if (target instanceof String) {
String contact = (String) target;
List<Participant> participants = new ArrayList<Participant>();
participants.add(new Participant(contact,contact));
chat = addChat(participants);
} else {
chat = getChat(target);
}
Logger.d(TAG, "handleSendFileTransferInvitation() chat: " + chat);
if (chat instanceof One2OneChat) {
Participant participant = ((One2OneChat) chat).getParticipant();
Logger.d(TAG, "handleSendFileTransferInvitation() user starts to send file " + filePath
+ " to " + participant + ", fileTransferTag: " + fileTransferTag);
mOutGoingFileTransferManager.onAddSentFileTransfer(((One2OneChat) chat).generateSentFileTransfer(
filePath, fileTransferTag));
}
}
/**
* This class describe one single out-going file transfer, and control the
* status itself
*/
public static class SentFileTransfer {
private static final String TAG = "SentFileTransfer";
public static final String KEY_FILE_TRANSFER_TAG = "file transfer tag";
protected Object mChatTag = null;
protected Object mFileTransferTag = null;
protected FileStruct mFileStruct = null;
protected IFileTransfer mFileTransfer = null;
protected IFileTransferSession mFileTransferSession = null;
protected IFileTransferEventListener mFileTransferListener = null;
protected Participant mParticipant = null;
public SentFileTransfer(Object chatTag, IOne2OneChatWindow one2OneChat,
String filePath, Participant participant, Object fileTransferTag) {
Logger.d(TAG, "SentFileTransfer() constructor chatTag is "
+ chatTag + " one2OneChat is " + one2OneChat
+ " filePath is " + filePath + "fileTransferTag: "
+ fileTransferTag);
if (null != chatTag && null != one2OneChat && null != filePath
&& null != participant) {
mChatTag = chatTag;
mFileTransferTag = (fileTransferTag != null ? fileTransferTag
: UUID.randomUUID());
mFileStruct = new FileStruct(filePath,
extractFileNameFromPath(filePath), 0, mFileTransferTag,
new Date());
mFileTransfer = one2OneChat.addSentFileTransfer(mFileStruct);
mFileTransfer.setStatus(Status.PENDING);
mParticipant = participant;
}
}
protected void send() {
ApiManager instance = ApiManager.getInstance();
if (instance != null) {
MessagingApi messageApi = instance.getMessagingApi();
if (messageApi != null) {
try {
mFileTransferSession =
messageApi.transferFile(mParticipant.getContact(),
mFileStruct.mFilePath);
if (null != mFileTransferSession) {
mFileStruct.mSize = mFileTransferSession.getFilesize();
String sessionId = mFileTransferSession.getSessionID();
mFileTransfer.updateTag(sessionId,
mFileStruct.mSize);
mFileTransferTag = sessionId;
mFileStruct.mFileTransferTag = sessionId;
mFileTransferListener = new FileTransferSenderListener();
mFileTransferSession.addSessionListener(mFileTransferListener);
mFileTransfer.setStatus(Status.WAITING);
setNotification();
} else {
Logger.e(TAG,
"send() failed, mFileTransferSession is null, filePath is "
+ mFileStruct.mFilePath);
onFailed();
onFileTransferFinished(IOnSendFinishListener.Result.REMOVABLE);
}
} catch (ClientApiException e) {
e.printStackTrace();
onFailed();
onFileTransferFinished(IOnSendFinishListener.Result.REMOVABLE);
} catch (RemoteException e) {
e.printStackTrace();
onFailed();
onFileTransferFinished(IOnSendFinishListener.Result.REMOVABLE);
}
}
}
}
private void onPrepareResend() {
Logger.d(TAG, "onPrepareResend() file " + mFileStruct.mFilePath
+ " to " + mParticipant);
if (null != mFileTransfer) {
mFileTransfer.setStatus(Status.PENDING);
}
}
private void onCancel() {
Logger.d(TAG, "onCancel() entry: mFileTransfer = " + mFileTransfer);
if (null != mFileTransfer) {
mFileTransfer.setStatus(Status.CANCEL);
}
}
private void onFailed() {
Logger.d(TAG, "onFailed() entry: mFileTransfer = " + mFileTransfer);
if (null != mFileTransfer) {
mFileTransfer.setStatus(Status.FAILED);
}
}
private void onNotAvailable(int reason) {
Logger.d(TAG, "onNotAvailable() reason is " + reason);
if (One2OneChat.FILETRANSFER_ENABLE_OK == reason) {
return;
} else {
switch (reason) {
case One2OneChat.FILETRANSFER_DISABLE_REASON_REMOTE:
onFailed();
break;
case One2OneChat.FILETRANSFER_DISABLE_REASON_CAPABILITY_FAILED:
case One2OneChat.FILETRANSFER_DISABLE_REASON_NOT_REGISTER:
onCancel();
break;
default:
Logger.w(TAG, "onNotAvailable() unknown reason " + reason);
break;
}
}
}
private void onDestroy() {
Logger.d(TAG, "onDestroy() sent file transfer mFilePath "
+ ((null == mFileStruct) ? null : mFileStruct.mFilePath)
+ " mFileTransferSession = " + mFileTransferSession
+ ", mFileTransferListener = " + mFileTransferListener);
if (null != mFileTransferSession) {
try {
if (null != mFileTransferListener) {
mFileTransferSession
.removeSessionListener(mFileTransferListener);
}
cancelNotification();
mFileTransferSession.cancelSession();
} catch (RemoteException e) {
e.printStackTrace();
}
}
}
protected void onFileTransferFinished(
IOnSendFinishListener.Result result) {
Logger.d(TAG, "onFileTransferFinished() mFileStruct = "
+ mFileStruct + ", file = "
+ ((null == mFileStruct) ? null : mFileStruct.mFilePath)
+ ", mOnSendFinishListener = " + mOnSendFinishListener
+ ", mFileTransferListener = " + mFileTransferListener
+ ", result = " + result);
if (null != mOnSendFinishListener) {
mOnSendFinishListener.onSendFinish(SentFileTransfer.this,
result);
if (null != mFileTransferSession) {
try {
if (null != mFileTransferListener) {
mFileTransferSession
.removeSessionListener(mFileTransferListener);
}
} catch (RemoteException e) {
e.printStackTrace();
}
}
}
}
public static String extractFileNameFromPath(String filePath) {
if (null != filePath) {
int lastDashIndex = filePath.lastIndexOf("/");
if (-1 != lastDashIndex && lastDashIndex < filePath.length() - 1) {
String fileName = filePath.substring(lastDashIndex + 1);
return fileName;
} else {
Logger.e(TAG, "extractFileNameFromPath() invalid file path:" + filePath);
return null;
}
} else {
Logger.e(TAG, "extractFileNameFromPath() filePath is null");
return null;
}
}
/**
* File transfer session event listener
*/
private class FileTransferSenderListener extends IFileTransferEventListener.Stub {
private static final String TAG = "FileTransferSenderListener";
// Session is started
@Override
public void handleSessionStarted() {
Logger.d(TAG, "handleSessionStarted() this file is " + mFileStruct.mFilePath);
}
// Session has been aborted
@Override
public void handleSessionAborted() {
Logger.v(TAG,
"File transfer handleSessionAborted(): mFileTransfer = "
+ mFileTransfer);
if (mParticipant == null) {
Logger.d(TAG,
"FileTransferSenderListener handleSessionAborted mParticipant is null");
return;
}
if (mFileTransfer != null) {
mFileTransfer.setStatus(Status.CANCEL);
IChat chat = ModelImpl.getInstance().getChat(mChatTag);
Logger.v(TAG, "handleSessionAborted(): chat = " + chat);
if (chat instanceof ChatImpl) {
((ChatImpl) chat).checkCapabilities();
}
}
try {
mFileTransferSession.removeSessionListener(this);
} catch (RemoteException e) {
e.printStackTrace();
}
mFileTransferSession = null;
onFileTransferFinished(IOnSendFinishListener.Result.REMOVABLE);
}
// Session has been terminated by remote
@Override
public void handleSessionTerminatedByRemote() {
Logger.v(TAG,
"File transfer handleSessionTerminatedByRemote(): mFileTransfer = "
+ mFileTransfer);
if (mFileTransfer != null) {
mFileTransfer.setStatus(Status.CANCELED);
IChat chat = ModelImpl.getInstance().getChat(mChatTag);
Log.v(TAG, "chat = " + chat);
if (chat instanceof ChatImpl) {
((ChatImpl) chat).checkCapabilities();
}
}
mFileTransferSession = null;
onFileTransferFinished(IOnSendFinishListener.Result.REMOVABLE);
}
// File transfer progress
@Override
public void handleTransferProgress(final long currentSize, final long totalSize) {
// Because of can't received file transfered callback, so add
// current size equals total size change status to finished
Logger.d(TAG, "handleTransferProgress() the file "
+ mFileStruct.mFilePath + " with " + mParticipant
+ " is transferring, currentSize is " + currentSize
+ " total size is " + totalSize + ", mFileTransfer = "
+ mFileTransfer);
if (mFileTransfer != null) {
if (currentSize < totalSize) {
mFileTransfer
.setStatus(com.mediatek.rcse.interfaces.ChatView.IFileTransfer.Status.TRANSFERING);
mFileTransfer.setProgress(currentSize);
updateNotification(currentSize);
} else {
mFileTransfer
.setStatus(com.mediatek.rcse.interfaces.ChatView.IFileTransfer.Status.FINISHED);
onFileTransferFinished(IOnSendFinishListener.Result.REMOVABLE);
}
}
}
// File transfer error
@Override
public void handleTransferError(final int error) {
Logger.v(TAG, "handleTransferError(),error = " + error + ", mFileTransfer ="
+ mFileTransfer);
switch (error) {
case FileSharingError.SESSION_INITIATION_FAILED:
Logger.d(TAG,
"handleTransferError(), the file transfer invitation is failed.");
if (mFileTransfer != null) {
mFileTransfer.setStatus(ChatView.IFileTransfer.Status.FAILED);
}
onFileTransferFinished(IOnSendFinishListener.Result.REMOVABLE);
break;
case FileSharingError.SESSION_INITIATION_TIMEOUT:
Logger.d(TAG,
"handleTransferError(), the file transfer invitation is failed.");
if (mFileTransfer != null) {
mFileTransfer.setStatus(ChatView.IFileTransfer.Status.TIMEOUT);
}
onFileTransferFinished(IOnSendFinishListener.Result.REMOVABLE);
break;
case FileSharingError.SESSION_INITIATION_DECLINED:
Logger.d(TAG,
"handleTransferError(), your file transfer invitation has been rejected");
if (mFileTransfer != null) {
mFileTransfer.setStatus(ChatView.IFileTransfer.Status.REJECTED);
}
onFileTransferFinished(IOnSendFinishListener.Result.RESENDABLE);
break;
case FileSharingError.SESSION_INITIATION_CANCELLED:
Logger.d(TAG,
"handleTransferError(), your file transfer invitation has been rejected");
if (mFileTransfer != null) {
mFileTransfer.setStatus(ChatView.IFileTransfer.Status.TIMEOUT);
}
onFileTransferFinished(IOnSendFinishListener.Result.REMOVABLE);
break;
default:
Logger.e(TAG, "handleTransferError() unknown error " + error);
onFailed();
onFileTransferFinished(IOnSendFinishListener.Result.REMOVABLE);
break;
}
}
// File has been transfered
@Override
public void handleFileTransfered(final String fileName) {
Logger.d(TAG, "handleFileTransfered() entry, fileName is "
+ fileName + ", mFileTransfer = " + mFileTransfer);
if (mFileTransfer != null) {
mFileTransfer
.setStatus(com.mediatek.rcse.interfaces.ChatView.IFileTransfer.Status.FINISHED);
}
onFileTransferFinished(IOnSendFinishListener.Result.REMOVABLE);
}
}
private NotificationManager getNotificationManager() {
ApiManager apiManager = ApiManager.getInstance();
if (null != apiManager) {
Context context = apiManager.getContext();
if (null != context) {
Object systemService = context.getSystemService(Context.NOTIFICATION_SERVICE);
return (NotificationManager) systemService;
} else {
Logger.e(TAG, "getNotificationManager() context is null");
return null;
}
} else {
Logger.e(TAG, "getNotificationManager() apiManager is null");
return null;
}
}
private int getNotificationId() {
if (null != mFileTransferTag) {
return mFileTransferTag.hashCode();
} else {
Logger.w(TAG, "getNotificationId() mFileTransferTag: " + mFileTransferTag);
return 0;
}
}
private void setNotification() {
updateNotification(0);
}
private void updateNotification(long currentSize) {
Logger.d(TAG, "updateNotification() entry, currentSize is "
+ currentSize + ", mFileTransferTag is " + mFileTransferTag
+ ", mFileStruct = " + mFileStruct);
NotificationManager notificationManager = getNotificationManager();
if (null != notificationManager) {
if (null != mFileStruct) {
Context context = ApiManager.getInstance().getContext();
Notification.Builder builder = new Notification.Builder(context);
builder
.setProgress((int) mFileStruct.mSize, (int) currentSize,
currentSize < 0);
String title =
context.getResources().getString(
R.string.ft_progress_bar_title,
ContactsListManager.getInstance().getDisplayNameByPhoneNumber(
mParticipant
.getContact()));
builder.setContentTitle(title);
builder.setAutoCancel(false);
builder.setContentText(extractFileNameFromPath(mFileStruct.mFilePath));
builder.setContentInfo(buildPercentageLabel(context, mFileStruct.mSize,
currentSize));
builder.setSmallIcon(R.drawable.rcs_notify_file_transfer);
PendingIntent pendingIntent;
if (Logger.getIsIntegrationMode()) {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SENDTO);
Uri uri = Uri.parse(PluginProxyActivity.MMSTO + mParticipant.getContact());
intent.setData(uri);
pendingIntent =
PendingIntent.getActivity(context, 0, intent,
PendingIntent.FLAG_UPDATE_CURRENT);
} else {
Intent intent = new Intent(context, ChatScreenActivity.class);
intent.putExtra(ChatScreenActivity.KEY_CHAT_TAG, (ParcelUuid) mChatTag);
pendingIntent = PendingIntent.getActivity(context, 0, intent,
PendingIntent.FLAG_UPDATE_CURRENT);
}
builder.setContentIntent(pendingIntent);
notificationManager.notify(getNotificationId(), builder.getNotification());
}
}
}
private void cancelNotification() {
NotificationManager notificationManager = getNotificationManager();
Logger.d(TAG, "cancelNotification() entry, mFileTransferTag is "
+ mFileTransferTag + ",notificationManager = "
+ notificationManager);
if (null != notificationManager) {
notificationManager.cancel(getNotificationId());
}
}
private static String buildPercentageLabel(Context context, long totalBytes,
long currentBytes) {
if (totalBytes <= 0) {
return null;
} else {
final int percent = (int) (100 * currentBytes / totalBytes);
return context.getString(R.string.ft_percent, percent);
}
}
protected IOnSendFinishListener mOnSendFinishListener = null;
protected interface IOnSendFinishListener {
static enum Result {
REMOVABLE, // This kind of result indicates that this File
// transfer should be removed from the manager
RESENDABLE
// This kind of result indicates that this File transfer will
// have a chance to be resent in the future
};
void onSendFinish(SentFileTransfer sentFileTransfer, Result result);
}
}
private SentFileTransferManager mOutGoingFileTransferManager = new SentFileTransferManager();
/**
* This class is used to manage the whole sent file transfers and make it
* work in queue
*/
private static class SentFileTransferManager implements SentFileTransfer.IOnSendFinishListener {
private static final String TAG = "SentFileTransferManager";
private static final int MAX_ACTIVATED_SENT_FILE_TRANSFER_NUM = 1;
private ConcurrentLinkedQueue<SentFileTransfer> mPendingList =
new ConcurrentLinkedQueue<SentFileTransfer>();
private CopyOnWriteArrayList<SentFileTransfer> mActiveList =
new CopyOnWriteArrayList<SentFileTransfer>();
private CopyOnWriteArrayList<SentFileTransfer> mResendableList =
new CopyOnWriteArrayList<SentFileTransfer>();
private synchronized void checkNext() {
int activatedNum = mActiveList.size();
if (activatedNum < MAX_ACTIVATED_SENT_FILE_TRANSFER_NUM) {
Logger.d(TAG, "checkNext() current activatedNum is " + activatedNum
+ " will find next file transfer to send");
SentFileTransfer nextFileTransfer = mPendingList.poll();
if (null != nextFileTransfer) {
Logger.d(TAG, "checkNext() next file transfer found, just send it!");
nextFileTransfer.send();
mActiveList.add(nextFileTransfer);
} else {
Logger.d(TAG, "checkNext() next file transfer not found, pending list is null");
}
} else {
Logger.d(TAG, "checkNext() current activatedNum is " + activatedNum
+ " MAX_ACTIVATED_SENT_FILE_TRANSFER_NUM is "
+ MAX_ACTIVATED_SENT_FILE_TRANSFER_NUM
+ " so no need to find next pending file transfer");
}
}
public void onAddSentFileTransfer(SentFileTransfer sentFileTransfer) {
Logger.d(TAG, "onAddSentFileTransfer() entry, sentFileTransfer = "
+ sentFileTransfer);
if (null != sentFileTransfer) {
Logger.d(TAG, "onAddSentFileTransfer() entry, file "
+ sentFileTransfer.mFileStruct + " is going to be sent");
sentFileTransfer.mOnSendFinishListener = this;
mPendingList.add(sentFileTransfer);
checkNext();
}
}
public void onChatDestroy(Object tag) {
Logger.d(TAG, "onChatDestroy entry, tag is " + tag);
clearTransferWithTag(tag, One2OneChat.FILETRANSFER_ENABLE_OK);
}
public void clearTransferWithTag(Object tag, int reason) {
Logger.d(TAG, "onFileTransferNotAvalible() entry tag is " + tag + " reason is "
+ reason);
if (null != tag) {
Logger.d(TAG, "onFileTransferNotAvalible() tag is " + tag);
ArrayList<SentFileTransfer> toBeDeleted = new ArrayList<SentFileTransfer>();
for (SentFileTransfer fileTransfer : mActiveList) {
if (tag.equals(fileTransfer.mChatTag)) {
Logger.d(TAG,
"onFileTransferNotAvalible() sent file transfer with chatTag "
+ tag + " found in activated list");
fileTransfer.onNotAvailable(reason);
fileTransfer.onDestroy();
toBeDeleted.add(fileTransfer);
}
}
if (toBeDeleted.size() > 0) {
Logger
.d(TAG,
"onFileTransferNotAvalible() need to remove some file transfer from activated list");
mActiveList.removeAll(toBeDeleted);
toBeDeleted.clear();
}
for (SentFileTransfer fileTransfer : mPendingList) {
if (tag.equals(fileTransfer.mChatTag)) {
Logger.d(TAG,
"onFileTransferNotAvalible() sent file transfer with chatTag "
+ tag + " found in pending list");
fileTransfer.onNotAvailable(reason);
toBeDeleted.add(fileTransfer);
}
}
if (toBeDeleted.size() > 0) {
Logger
.d(TAG,
"onFileTransferNotAvalible() need to remove some file transfer from pending list");
mPendingList.removeAll(toBeDeleted);
toBeDeleted.clear();
}
for (SentFileTransfer fileTransfer : mResendableList) {
if (tag.equals(fileTransfer.mChatTag)) {
Logger.d(TAG,
"onFileTransferNotAvalible() sent file transfer with chatTag "
+ tag + " found in mResendableList list");
fileTransfer.onNotAvailable(reason);
toBeDeleted.add(fileTransfer);
}
}
if (toBeDeleted.size() > 0) {
Logger.d(TAG, "onFileTransferNotAvalible() " +
"need to remove some file transfer from mResendableList list");
mResendableList.removeAll(toBeDeleted);
toBeDeleted.clear();
}
}
}
public void resendFileTransfer(Object targetFileTransferTag) {
SentFileTransfer fileTransfer = findResendableFileTransfer(targetFileTransferTag);
Logger.d(TAG, "resendFileTransfer() the file transfer with tag "
+ targetFileTransferTag + " is " + fileTransfer);
if (null != fileTransfer) {
fileTransfer.onPrepareResend();
Logger.d(TAG, "resendFileTransfer() the file transfer with tag "
+ targetFileTransferTag
+ " found, remove it from resendable list and add it into pending list");
mResendableList.remove(fileTransfer);
mPendingList.add(fileTransfer);
checkNext();
}
}
public void cancelFileTransfer(Object targetFileTransferTag) {
Logger.d(TAG, "cancelFileTransfer() begin to cancel file transfer with tag "
+ targetFileTransferTag);
SentFileTransfer fileTransfer = findPendingFileTransfer(targetFileTransferTag);
if (null != fileTransfer) {
Logger.d(TAG, "cancelFileTransfer() the target file transfer with tag "
+ targetFileTransferTag + " found in pending list");
fileTransfer.onCancel();
mPendingList.remove(fileTransfer);
} else {
fileTransfer = findActiveFileTransfer(targetFileTransferTag);
Logger.d(TAG,
"cancelFileTransfer() the target file transfer with tag "
+ targetFileTransferTag
+ " found in active list is " + fileTransfer);
if (null != fileTransfer) {
Logger.d(TAG,
"cancelFileTransfer() the target file transfer with tag "
+ targetFileTransferTag
+ " found in active list");
fileTransfer.onCancel();
fileTransfer.onDestroy();
onSendFinish(fileTransfer, Result.REMOVABLE);
}
}
}
@Override
public void onSendFinish(final SentFileTransfer sentFileTransfer, final Result result) {
Logger.d(TAG, "onSendFinish(): sentFileTransfer = "
+ sentFileTransfer + ", result = " + result);
if (mActiveList.contains(sentFileTransfer)) {
sentFileTransfer.cancelNotification();
Logger.d(TAG, "onSendFinish() file transfer " + sentFileTransfer.mFileStruct
+ " with " + sentFileTransfer.mParticipant + " finished with " + result
+ " remove it from activated list");
switch (result) {
case RESENDABLE:
mResendableList.add(sentFileTransfer);
mActiveList.remove(sentFileTransfer);
break;
case REMOVABLE:
mActiveList.remove(sentFileTransfer);
break;
default:
break;
}
checkNext();
}
}
private SentFileTransfer findActiveFileTransfer(Object targetTag) {
Logger.d(TAG, "findActiveFileTransfer entry, targetTag is " + targetTag);
return findFileTransferByTag(mActiveList, targetTag);
}
private SentFileTransfer findPendingFileTransfer(Object targetTag) {
Logger.d(TAG, "findPendingFileTransfer entry, targetTag is " + targetTag);
return findFileTransferByTag(mPendingList, targetTag);
}
private SentFileTransfer findResendableFileTransfer(Object targetTag) {
Logger.d(TAG, "findResendableFileTransfer entry, targetTag is " + targetTag);
return findFileTransferByTag(mResendableList, targetTag);
}
private SentFileTransfer findFileTransferByTag(Collection<SentFileTransfer> whereToFind,
Object targetTag) {
if (null != whereToFind && null != targetTag) {
for (SentFileTransfer sentFileTransfer : whereToFind) {
Object fileTransferTag = sentFileTransfer.mFileTransferTag;
if (targetTag.equals(fileTransferTag)) {
Logger.d(TAG, "findFileTransferByTag() the file transfer with targetTag "
+ targetTag + " found");
return sentFileTransfer;
}
}
Logger.d(TAG, "findFileTransferByTag() not found targetTag " + targetTag);
return null;
} else {
Logger.e(TAG, "findFileTransferByTag() whereToFind is " + whereToFind
+ " targetTag is " + targetTag);
return null;
}
}
}
@Override
public void reloadMessages(String tag, List<Integer> messageIds) {
Logger.d(TAG, "reloadMessages() messageIds: " + messageIds + " tag is " + tag);
ContentResolver contentResolver = AndroidFactory.getApplicationContext()
.getContentResolver();
if (tag != null) {
reloadGroupMessage(tag, messageIds, contentResolver);
} else {
reloadOne2OneMessages(messageIds, contentResolver);
}
}
private void reloadGroupMessage(String tag, List<Integer> messageIds,
ContentResolver contentResolver) {
Logger.d(TAG, "reloadGroupMessage() entry");
int length = PluginGroupChatWindow.GROUP_CONTACT_STRING_BEGINNER.length();
String realTag = tag.substring(length);
ParcelUuid parcelUuid = ParcelUuid.fromString(realTag);
HashSet<Participant> participantList = new HashSet<Participant>();
ArrayList<ReloadMessageInfo> messageList = new ArrayList<ReloadMessageInfo>();
TreeSet<Long> sessionIdList = new TreeSet<Long>();
for (Integer messageId : messageIds) {
ReloadMessageInfo messageInfo =
loadMessageFromId(sessionIdList, messageId, contentResolver);
if (null != messageInfo) {
Object obj = messageInfo.getMessage();
messageList.add(messageInfo);
if (obj instanceof InstantMessage) {
InstantMessage message = (InstantMessage) obj;
String contact = message.getRemote();
contact = PhoneUtils.extractNumberFromUri(contact);
if (!ContactsManager.getInstance().isRcsValidNumber(contact)) {
Logger.d(TAG, "reloadGroupMessage() the contact is not valid user "
+ contact);
continue;
}
Logger.d(TAG, "reloadGroupMessage() the contact is " + contact);
if (!TextUtils.isEmpty(contact)) {
Participant participant = new Participant(contact, contact);
participantList.add(participant);
}
}
}
}
Logger.d(TAG, "reloadGroupMessage() the sessionIdList is " + sessionIdList);
fillParticipantList(sessionIdList, participantList, contentResolver);
Logger.d(TAG, "reloadGroupMessage() participantList is " + participantList);
if (participantList.size() < ChatFragment.GROUP_MIN_MEMBER_NUM) {
Logger.d(TAG, "reloadGroupMessage() not group");
return;
}
IChat chat = mChatMap.get(parcelUuid);
if (chat != null) {
Logger.d(TAG, "reloadGroupMessage() the chat already exist chat is " + chat);
} else {
chat = new GroupChat(this, null, new ArrayList<Participant>(participantList), parcelUuid);
mChatMap.put(parcelUuid, chat);
IGroupChatWindow chatWindow = ViewImpl.getInstance().addGroupChatWindow(parcelUuid,
((GroupChat) chat).getParticipantInfos());
((GroupChat) chat).setChatWindow(chatWindow);
}
for (ReloadMessageInfo messageInfo : messageList) {
if (null != messageInfo) {
InstantMessage message = (InstantMessage) messageInfo.getMessage();
int messageType = messageInfo.getMessageType();
((ChatImpl) chat).reloadMessage(message, messageType, -1);
}
}
}
private void fillParticipantList(TreeSet<Long> sessionIdList,
HashSet<Participant> participantList, ContentResolver contentResolver) {
Logger.d(TAG, "fillParticipantList() entry the sessionIdList is " + sessionIdList
+ " participantList is " + participantList);
for (Long sessionId : sessionIdList) {
Cursor cursor = null;
String[] selectionArg = {
Long.toString(sessionId),
Integer.toString(EventsLogApi.TYPE_GROUP_CHAT_SYSTEM_MESSAGE)
};
try {
cursor = contentResolver.query(RichMessagingData.CONTENT_URI, null,
RichMessagingData.KEY_CHAT_SESSION_ID + "=? AND "
+ RichMessagingData.KEY_TYPE + "=?", selectionArg, null);
if (cursor != null && cursor.moveToFirst()) {
do {
String remote = cursor.getString(cursor
.getColumnIndex(RichMessagingData.KEY_CONTACT));
Logger.d(TAG, "fillParticipantList() the remote is " + remote);
if (remote.length() - INDEXT_ONE <= INDEXT_ONE) {
Logger.e(TAG, "fillParticipantList() the remote is no content");
continue;
}
if (remote.contains(COMMA)) {
Logger.d(TAG, "fillParticipantList() the remote has COMMA ");
String subString = remote.substring(INDEXT_ONE, remote.length()
- INDEXT_ONE);
Logger.d(TAG, "fillParticipantList() the remote is " + subString);
String[] contacts = subString.split(COMMA);
for (String contact : contacts) {
Logger.d(TAG, "fillParticipantList() arraylist the contact is "
+ contact);
Participant participant = new Participant(contact, contact);
participantList.add(participant);
}
} else if (remote.contains(SEMICOLON)) {
Logger.d(TAG, "fillParticipantList() the remote has SEMICOLON ");
String[] contacts = remote.split(SEMICOLON);
for (String contact : contacts) {
Logger.d(TAG, "fillParticipantList() arraylist the contact is "
+ contact);
Participant participant = new Participant(contact, contact);
participantList.add(participant);
}
} else {
Logger.d(TAG, "fillParticipantList() remote is single ");
Participant participant = new Participant(remote, remote);
participantList.add(participant);
}
} while (cursor.moveToNext());
} else {
Logger.e(TAG, "fillParticipantList() the cursor is null");
}
} finally {
if (null != cursor) {
cursor.close();
}
}
}
}
private void reloadOne2OneMessages(List<Integer> messageIds, ContentResolver contentResolver) {
Logger.d(TAG, "reloadOne2OneMessages() entry");
TreeSet<Long> sessionIdList = new TreeSet<Long>();
for (Integer messageId : messageIds) {
ReloadMessageInfo info = loadMessageFromId(sessionIdList, messageId, contentResolver);
if (null != info) {
Object obj = info.getMessage();
int messageType = info.getMessageType();
if (obj instanceof InstantMessage) {
InstantMessage message = (InstantMessage) obj;
int messageStatus = info.getMessageStatus();
String contact = message.getRemote();
contact = PhoneUtils.extractNumberFromUri(contact);
Logger.v(TAG, "reloadOne2OneMessages() : contact = " + contact);
if (!TextUtils.isEmpty(contact)) {
ArrayList<Participant> participantList = new ArrayList<Participant>();
participantList.add(new Participant(contact, contact));
IChat chat = addChat(participantList);
((ChatImpl) chat).reloadMessage(message, messageType, messageStatus);
}
} else if (obj instanceof FileStruct) {
FileStruct fileStruct = (FileStruct) obj;
String contact = fileStruct.mRemote;
Logger.v(TAG, "reloadOne2OneMessages() : contact = " + contact);
if (!TextUtils.isEmpty(contact)) {
ArrayList<Participant> participantList = new ArrayList<Participant>();
participantList.add(new Participant(contact, contact));
IChat chat = addChat(participantList);
((ChatImpl) chat).reloadFileTransfer(fileStruct, messageType, info.getMessageStatus());
}
}
}
}
}
private ReloadMessageInfo loadMessageFromId(TreeSet<Long> sessionIdList, Integer msgId,
ContentResolver contentResolver) {
Logger.d(TAG, "loadMessageFronId() msgId: " + msgId);
Cursor cursor = null;
String[] selectionArg = {msgId.toString()};
try {
cursor = contentResolver.query(RichMessagingData.CONTENT_URI,
null, RichMessagingData.KEY_ID + "=?", selectionArg, null);
if (cursor.moveToFirst()) {
int messageType = cursor.getInt(cursor.getColumnIndex(RichMessagingData.KEY_TYPE));
String messageId = cursor.getString(cursor
.getColumnIndex(RichMessagingData.KEY_MESSAGE_ID));
String remote = cursor.getString(cursor
.getColumnIndex(RichMessagingData.KEY_CONTACT));
String text = cursor.getString(cursor.getColumnIndex(RichMessagingData.KEY_DATA));
long sessionId =
cursor
.getLong(cursor
.getColumnIndex(RichMessagingData.KEY_CHAT_SESSION_ID));
int messageStatus =
cursor.getInt(cursor.getColumnIndex(RichMessagingData.KEY_STATUS));
sessionIdList.add(sessionId);
Date date = new Date();
long timeStamp = cursor.getLong(cursor
.getColumnIndex(RichMessagingData.KEY_TIMESTAMP));
date.setTime(timeStamp);
if (EventsLogApi.TYPE_INCOMING_CHAT_MESSAGE == messageType
|| EventsLogApi.TYPE_OUTGOING_CHAT_MESSAGE == messageType
|| EventsLogApi.TYPE_INCOMING_GROUP_CHAT_MESSAGE == messageType
|| EventsLogApi.TYPE_OUTGOING_GROUP_CHAT_MESSAGE == messageType) {
InstantMessage message = new InstantMessage(messageId, remote, text, false);
message.setDate(date);
Logger.d(TAG, "loadMessageFronId() messageId: " + messageId + " , remote: "
+ remote + " , text: " + text + " , timeStamp: " + timeStamp
+ " , messageType: " + messageType + " , messageStatus: "
+ messageStatus);
ReloadMessageInfo messageInfo =
new ReloadMessageInfo(message, messageType, messageStatus);
return messageInfo;
} else if (EventsLogApi.TYPE_INCOMING_FILE_TRANSFER == messageType
|| EventsLogApi.TYPE_OUTGOING_FILE_TRANSFER == messageType) {
String fileName = cursor.getString(cursor
.getColumnIndex(RichMessagingData.KEY_NAME));
long fileSize = cursor.getLong(cursor
.getColumnIndex(RichMessagingData.KEY_TOTAL_SIZE));
FileStruct fileStruct = new FileStruct(text, fileName, fileSize, messageId,
date, remote);
ReloadMessageInfo fileInfo = new ReloadMessageInfo(fileStruct, messageType, messageStatus);
return fileInfo;
}
return null;
} else {
Logger.w(TAG, "loadMessageFronId() empty cursor");
return null;
}
} finally {
if (null != cursor) {
cursor.close();
}
}
}
@Override
public void closeAllChat() {
Logger.d(TAG, "closeAllChat()");
Collection<IChat> chatSet = mChatMap.values();
List<Object> tagList = new ArrayList<Object>();
for (IChat iChat : chatSet) {
tagList.add(((ChatImpl) iChat).getChatTag());
}
for (Object object : tagList) {
removeChat(object);
}
}
/**
* Get group chat with chat id.
*
* @param chatId The chat id.
* @return The group chat.
*/
public IChat getGroupChat(String chatId) {
Logger.d(TAG, "getGroupChat() entry, chatId: " + chatId);
Collection<IChat> chats = mChatMap.values();
IChat result = null;
for (IChat chat : chats) {
if (chat instanceof GroupChat) {
String id = ((GroupChat) chat).getChatId();
if (id != null && id.equals(chatId)) {
result = chat;
break;
}
}
}
Logger.d(TAG, "getGroupChat() exit, result: " + result);
return result;
}
/**
* Used to reload message information
*/
private static class ReloadMessageInfo {
private Object mMessage;
private int mMessageType;
private int mMessageStatus;
/**
* Constructor
*
* @param message The message
* @param type The message type
* @param status The message status
*/
public ReloadMessageInfo(Object message, int type, int status) {
this.mMessage = message;
this.mMessageType = type;
this.mMessageStatus = status;
}
/**
* Constructor
*
* @param message The message
* @param type The message type
*/
public ReloadMessageInfo(Object message, int type) {
this.mMessage = message;
this.mMessageType = type;
}
/**
* Get the message
*
* @return The message
*/
public Object getMessage() {
return mMessage;
}
/**
* Get the message type
*
* @return The message type
*/
public int getMessageType() {
return mMessageType;
}
/**
* Get the message status
*
* @return The message status
*/
public int getMessageStatus() {
return mMessageStatus;
}
}
}
| rex-xxx/mt6572_x201 | mediatek/packages/apps/RCSe/core/src/com/mediatek/rcse/mvc/ModelImpl.java | Java | gpl-2.0 | 102,722 |
#region License
/*
* Copyright (C) 2006-2007 Gabriel Handford <gabrielh@gmail.com>
*
* 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#endregion License
using System;
using Slickr.Util;
using Slickr.Util.Windows;
using System.Windows.Forms;
using System.Drawing;
using System.Threading;
using System.Reflection;
namespace Slickr.ScreenSaver
{
/// <summary>
/// Draws in the Display Properties Screensaver preview window exclusively.
/// </summary>
public class MiniPreview
{
/// <summary>
/// Do the mini preview until the mini-preview window vanishes.
/// </summary>
/// <param name="argHandle"> a 10 based handle to the Display Properties window.</param>
/// <param name="useStyleDoubleBuffer">Use double buffering</param>
public void DoMiniPreview(int argHandle, bool useStyleDoubleBuffer)
{
// Pointer to windows Display Properties window.
IntPtr ParentWindowHandle = new IntPtr(0);
ParentWindowHandle = (IntPtr) argHandle; // Get the pointer to Windows Display Properties dialog.
Rect rect = new Rect();
// The Using construct is to make sure all resources used here are cleared in case of unhandled exceptions.
using(Graphics PreviewGraphic = Graphics.FromHwnd(ParentWindowHandle)) // This is the mini-preview window from the OS.
{
WindowsUtils.GetClientRectApi(ParentWindowHandle, ref rect); // Get the dimensions and location of the preview window.
DateTime dt30Seconds = DateTime.Now.AddSeconds(30);
while (WindowsUtils.IsWindowVisibleApi(ParentWindowHandle) == false)
{
if (DateTime.Now > dt30Seconds) return; // If time runs out, exit program.
Application.DoEvents(); // We don't want to ignore windows, or we might be sorry! :) Respond to events.
}
// Create a bitmap for double buffering
int width = rect.right - rect.left;
int height = rect.bottom - rect.top;
Bitmap OffScreenBitmap = new Bitmap(width, height, PreviewGraphic);
Graphics OffScreenBitmapGraphic = Graphics.FromImage(OffScreenBitmap); // Create a Graphics object
OffScreenBitmapGraphic.Clear(Color.Black);
Bitmap image = null;
try {
Assembly a = Assembly.GetExecutingAssembly();
//image = new Bitmap(this.GetType(), "Slickr.slickr.png");
image = new Bitmap(a.GetManifestResourceStream("Slickr.slickr.png"));
//image = Properties.Resources.slickr;
OffScreenBitmapGraphic.DrawImage(image, 0, 0);
}
catch (Exception e)
{
Log.Error("Error loading slickr icon", e);
//OffScreenBitmapGraphic.Clear(Color.Red);
}
while (WindowsUtils.IsWindowVisibleApi(ParentWindowHandle) == true) // Now that the window is visible ...
{
//if (useStyleDoubleBuffer) // Will black out if we are using built in double-buffering.
// OffScreenBitmapGraphic.Clear(Color.Black);
Thread.Sleep(50); // Slow down the mini-preview.
try
{ // Draw the image created by insects.DrawWaspThenSwrm(OffscreenBitmapGraphic).
PreviewGraphic.DrawImage(OffScreenBitmap,0,0,OffScreenBitmap.Width,OffScreenBitmap.Height);
}
catch // the most likely reason we get an exception here is because
{ // the user hits cancel button while drawing to mini-preview.
break; // Either way we must get out of the program.
}
Application.DoEvents();
}
OffScreenBitmap.Dispose();
OffScreenBitmapGraphic.Dispose();
PreviewGraphic.Dispose();
}
}
}
}
| gabriel/slickr-dotnet | Source/ScreenSaver/MiniPreview.cs | C# | gpl-2.0 | 4,416 |
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/input.h>
#include <linux/init.h>
#include <linux/serio.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/jiffies.h>
#include <linux/timer.h>
#include <linux/input.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <mach/hardware.h>
#include <mach/regs-saradc.h>
/* For ts.dev.id.version */
#define spmpTSVERSION 0x0101
#define DEBUG_LVL KERN_DEBUG
MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");
MODULE_DESCRIPTION("spmp touchscreen driver");
MODULE_LICENSE("GPL");
/*
* Definitions & global arrays.
*/
static char *spmpts_name = "spmp TouchScreen";
/*
* Per-touchscreen data.
*/
struct spmpts {
struct input_dev *dev;
long xp;
long yp;
int count;
int shift;
};
static struct spmpts ts;
static struct resource *ress;
static void __iomem *base_addr;
static struct clk *saacc_clock;
static int irq_saacc;
static int g_uiXhigh = 970, g_uiXlow = 40,g_uiYhigh = 970 ,g_uiYlow = 40;
static int pendown;
static struct timer_list aux_timer;
static struct input_dev *adc_key_dev;
static unsigned short keymap[8] = {KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_BACK, KEY_HOME, KEY_MENU, 0};
static int keyadc[8] = {321, 470, 618, 927, 768, 6, 161, 0};
static unsigned short last_key;
static int adc_key_open(struct input_dev *dev)
{
return 0;
}
static void adc_key_close(struct input_dev *dev)
{
}
static void adc_key_update(int adc_value)
{
int i;
unsigned short key = 0;
//printk("adc_value = %d\n", adc_value);
for (i = 0; keymap[i] != 0; i++) {
if (adc_value > keyadc[i] - 50 && adc_value < keyadc[i] + 50) {
key = keymap[i];
break;
}
}
if (last_key == key)
return;
if (last_key != 0) {
input_report_key(adc_key_dev, last_key, 0);
//printk("adc key up = %d\n", last_key);
}
last_key = key;
if (key != 0) {
input_report_key(adc_key_dev, key, 1);
//printk("adc key down = %d\n", key);
}
input_sync(adc_key_dev);
}
static int adc_key_init(void)
{
int error;
unsigned short *pkey;
int i;
adc_key_dev = input_allocate_device();
if (!adc_key_dev) {
printk(KERN_ERR "spmp_touch.c: Not enough memory\n");
error = -ENOMEM;
goto err_free_dev;
}
set_bit(EV_KEY, adc_key_dev->evbit);
for (pkey = keymap; *pkey != 0; pkey++)
set_bit(*pkey, adc_key_dev->keybit);
error = input_register_device(adc_key_dev);
if (error) {
printk(KERN_ERR "spmp_touch.c: Failed to register device\n");
goto err_free_dev;
}
adc_key_dev->open = adc_key_open;
adc_key_dev->close = adc_key_close;
return 0;
err_free_dev:
input_free_device(adc_key_dev);
return error;
}
static int adc_key_exit(void)
{
input_unregister_device(adc_key_dev);
input_free_device(adc_key_dev);
}
static void start_aux_timer()
{
del_timer(&aux_timer);
//printk("start_aux_timer\n");
aux_timer.expires = jiffies + HZ / 10;
add_timer(&aux_timer);
}
static void stop_aux_timer()
{
//printk("stop_aux_timer\n");
del_timer(&aux_timer);
}
static void aux_timeout(unsigned long arg)
{
int sarctrl;
writel(0 , base_addr + SAACC_INTEN_OFST);
sarctrl = readl(base_addr + SAACC_SARCTRL_OFST);
sarctrl &= ~(SAACC_SAR_SARS_MASK << SAACC_SAR_SARS_OFST);
sarctrl |= 0x04 << SAACC_SAR_SARS_OFST;
sarctrl &= ~(SAACC_SAR_MODE_MASK << SAACC_SAR_MODE_OFST);
sarctrl |= 0x04 << SAACC_SAR_MODE_OFST;
sarctrl &= ~(SAACC_SAR_TPS_MASK << SAACC_SAR_TPS_OFST);
sarctrl |= 0x01 << SAACC_SAR_TPS_OFST;
sarctrl &= ~(SARCTL_SAR_AUTO_CON_ON);
sarctrl |= SARCTL_SAR_MAN_CON_ON;
writel(SAACC_SAR_IENAUX, base_addr + SAACC_INTEN_OFST);
writel(sarctrl,base_addr + SAACC_SARCTRL_OFST);
//start_aux_timer();
}
static void init_aux_timer()
{
init_timer(&aux_timer);
aux_timer.function = aux_timeout;
}
static void del_aux_timer()
{
del_timer(&aux_timer);
}
static irqreturn_t stylus_action(int irq, void *dev_id)
{
unsigned long uiIntrFlags;
unsigned long data1;
int sarctrl;
uiIntrFlags = readl(base_addr + SAACC_INTF_OFST);
//printk("uiIntrFlags =%08x\n",uiIntrFlags);
if(uiIntrFlags & SAACC_SAR_IENAUX)
{
unsigned int v;
v = 0x3ff & (unsigned short)( (readl(base_addr + SAACC_AUX_OFST) & 0xFFFF) + 1024);
//printk("AUX %d\n",v);
adc_key_update(v);
sarctrl = readl(base_addr + SAACC_SARCTRL_OFST);
//printk("sarctrl %08x\n",sarctrl);
sarctrl &= ~(SAACC_SAR_MODE_MASK << SAACC_SAR_MODE_OFST);
sarctrl |= 0x01 << SAACC_SAR_MODE_OFST;
sarctrl &= ~(SAACC_SAR_TPS_MASK << SAACC_SAR_TPS_OFST);
sarctrl |= 0x03 << SAACC_SAR_TPS_OFST;
sarctrl &= ~(SARCTL_SAR_AUTO_CON_ON);
sarctrl |= SARCTL_SAR_MAN_CON_ON;
writel(SAACC_SAR_IENPNL | SAACC_SAR_IENPENUP | SAACC_SAR_IENPENDN , base_addr + SAACC_INTEN_OFST);
writel(sarctrl,base_addr + SAACC_SARCTRL_OFST);
start_aux_timer();
}
if(uiIntrFlags & SAACC_SAR_IENPNL)
{
unsigned short sPosx,sPosy,tmpPosx,tmpPosy;
unsigned long tPosx,tPosy,g_uiPanelXY;
g_uiPanelXY = readl(base_addr + SAACC_PNL_OFST);
ts.yp = 0x3ff & (unsigned short)( (g_uiPanelXY & 0xFFFF) + 1024);
ts.xp = 0x3ff & (unsigned short)( (g_uiPanelXY >> 16) + 1024);
ts.count++;
pendown = 1;
if(ts.count > 1)
{
if(pendown == 1 )
{
input_report_abs(ts.dev, ABS_X, ts.xp);
input_report_abs(ts.dev, ABS_Y, ts.yp);
input_report_key(ts.dev, BTN_TOUCH, 1);
input_report_abs(ts.dev, ABS_PRESSURE, 1);
printk("[out] %d %d \n",ts.xp,ts.yp);
input_sync(ts.dev);
}
}
sarctrl = readl(base_addr + SAACC_SARCTRL_OFST);
sarctrl &= 0xFFFF80;
sarctrl |= (SARCTL_SAR_AUTO_CON_ON | 0x40);
writel(sarctrl,base_addr + SAACC_SARCTRL_OFST);
}
if(uiIntrFlags & SAACC_SAR_IENPENUP)
{
sarctrl = readl(base_addr + SAACC_SARCTRL_OFST);
sarctrl &= 0xFFFF80;
sarctrl &= ~(SARCTL_SAR_AUTO_CON_ON);
sarctrl |= SARCTL_SAR_MAN_CON_ON | 0x60;
writel(sarctrl,base_addr + SAACC_SARCTRL_OFST);
if(pendown == 1)
{
input_report_key(ts.dev, BTN_TOUCH, 0);
input_report_abs(ts.dev, ABS_PRESSURE, 0);
input_sync(ts.dev);
printk("penup\n");
start_aux_timer();
}
pendown = 0;
}
if(uiIntrFlags & SAACC_SAR_IENPENDN)
{
stop_aux_timer();
ts.xp = 0;
ts.yp = 0;
ts.count = 0;
sarctrl = readl(base_addr + SAACC_SARCTRL_OFST);
sarctrl &= 0xFFFF80;
sarctrl |= SARCTL_SAR_MAN_CON_ON | 0x40;
printk("pendwon\n");
writel(sarctrl,base_addr + SAACC_SARCTRL_OFST);
}
return IRQ_HANDLED;
}
/*
* The functions for inserting/removing us as a module.
*/
static void start_sar()
{
#define SARCTL_SARS_TPXP (0x00<<2)
#define SARCTL_SARS_TPXN (0x01<<2)
#define SARCTL_SARS_TPYP (0x02<<2)
#define SARCTL_SARS_TPYN (0x03<<2)
#define SARCTL_SARS_AUX1 (0x04<<2)
int sarctrl;
int debtime;
// setup clock divider number
sarctrl = readl(base_addr + SAACC_SARCTRL_OFST);
sarctrl &= ~(SAACC_SAR_DIVNUM_MASK << SAACC_SAR_DIVNUM_OFST);
sarctrl |= ( 16 << SAACC_SAR_DIVNUM_OFST);
writel(sarctrl,base_addr + SAACC_SARCTRL_OFST);
writel(SAACC_SAR_IENPNL | SAACC_SAR_IENPENUP | SAACC_SAR_IENPENDN , base_addr + SAACC_INTEN_OFST);
debtime = readl(base_addr + SAACC_DEBTIME_OFST);
debtime = 0x2000 |(0x20<<16);
writel(debtime,base_addr + SAACC_DEBTIME_OFST);
printk("debtime =%d\n",debtime);
// debtime = readl(base_addr + SAACC_CONDLY_OFST);
// debtime = 0x60;
// writel(debtime,base_addr + SAACC_CONDLY_OFST);
// printk("sarctrl =%d\n",debtime);
sarctrl = readl(base_addr + SAACC_SARCTRL_OFST);
sarctrl &= ~(SAACC_SAR_MODE_MASK << SAACC_SAR_MODE_OFST);
sarctrl |= 0x01 << SAACC_SAR_MODE_OFST;
sarctrl &= ~(SAACC_SAR_TPS_MASK << SAACC_SAR_TPS_OFST);
sarctrl |= 0x03 << SAACC_SAR_TPS_OFST;
sarctrl &= ~(SARCTL_SAR_AUTO_CON_ON);
sarctrl |= SARCTL_SAR_MAN_CON_ON;
printk("sarctrl =%x\n",sarctrl);
writel(sarctrl,base_addr + SAACC_SARCTRL_OFST);
init_aux_timer();
start_aux_timer();
}
static void stop_sar()
{
del_aux_timer();
writel(0 , base_addr + SAACC_INTEN_OFST);
}
static int __init spmpts_probe(struct platform_device *pdev)
{
int rc,ret;
struct input_dev *input_dev;
printk("Entering spmpts_init\n");
ret = -ENXIO;
ress = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!ress) {
printk("SAACC : No I/O memory resource defined\n");
goto err_ress;
}
irq_saacc = platform_get_irq(pdev, 0);
if (irq_saacc < 0) {
printk("SAACC : No IRQ resource defined\n");
goto err_ress;
}
ret = -ENOMEM;
base_addr = ioremap(ress->start,
resource_size(ress));
if (!base_addr) {
dev_err(&pdev->dev, "SAACC : Unable to map I/O memory\n");
goto err_map;
}
saacc_clock= clk_get(&pdev->dev, "SAACC");
if (!saacc_clock) {
dev_err(&pdev->dev, "Unable to get saacc clock\n");
ret = -ENOENT;
goto err_saacc_reg;
}
clk_enable(saacc_clock);
printk("got and enabled clock\n");
memset(&ts, 0, sizeof(struct spmpts));
input_dev = input_allocate_device();
if (!input_dev) {
printk(KERN_ERR "Unable to allocate the input device !!\n");
goto err_saacc_clock;
}
ts.dev = input_dev;
ts.dev->evbit[0] = BIT_MASK(EV_SYN)| BIT_MASK(EV_KEY) |BIT_MASK(EV_ABS);
ts.dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
set_bit(EV_SW, input_dev->evbit);
bitmap_fill(input_dev->swbit, SW_MAX);
// bitmap_fill(input_dev->absbit, ABS_MAX);
input_set_abs_params(ts.dev, ABS_X, g_uiXlow, g_uiXhigh, 0, 0);
input_set_abs_params(ts.dev, ABS_Y, g_uiYlow, g_uiYhigh, 0, 0);
input_set_abs_params(ts.dev, ABS_PRESSURE, 0, 1, 0, 0);
// input_set_abs_params(ts.dev, ABS_TOOL_WIDTH, 0, 15, 0, 0);
// ts.dev->private = &ts;
ts.dev->name = spmpts_name;
ts.dev->id.bustype = BUS_RS232;
ts.dev->id.vendor = 0xDEAD;
ts.dev->id.product = 0xBEEF;
ts.dev->id.version = spmpTSVERSION;
ts.shift = 2; //info->oversampling_shift;
/* Get irqs */
if (request_irq(irq_saacc, stylus_action, IRQF_SAMPLE_RANDOM,
"spmp_saacc", ts.dev)) {
printk(KERN_ERR "spmp_ts.c: Could not allocate ts IRQ_ADC !\n");
goto err_saacc_input;
}
printk(KERN_INFO "%s successfully loaded\n", spmpts_name);
/* All went ok, so register to the input system */
rc = input_register_device(ts.dev);
if (rc) {
ret = -EIO;
goto err_irq;
}
adc_key_init();
start_sar();
return 0;
err_irq:
free_irq(irq_saacc, ts.dev);
err_saacc_input:
input_free_device(input_dev);
err_saacc_clock:
clk_disable(saacc_clock);
err_saacc_reg:
iounmap(base_addr);
err_ress:
err_map:
return ret;
}
static int spmpts_remove(struct platform_device *pdev)
{
stop_sar();
free_irq(irq_saacc, ts.dev);
if (saacc_clock) {
clk_disable(saacc_clock);
clk_put(saacc_clock);
saacc_clock = NULL;
}
input_unregister_device(ts.dev);
iounmap(base_addr);
adc_key_exit();
return 0;
}
#ifdef CONFIG_PM
static int spmpts_suspend(struct platform_device *pdev, pm_message_t state)
{
#if 0
writel(TSC_SLEEP, base_addr+spmp_ADCTSC);
writel(readl(base_addr+spmp_ADCCON) | spmp_ADCCON_STDBM,
base_addr+spmp_ADCCON);
disable_irq(IRQ_ADC);
disable_irq(IRQ_TC);
clk_disable(adc_clock);
#endif
return 0;
}
static int spmpts_resume(struct platform_device *pdev)
{
#if 0
struct spmp_ts_mach_info *info =
( struct spmp_ts_mach_info *)pdev->dev.platform_data;
clk_enable(adc_clock);
msleep(1);
enable_irq(IRQ_ADC);
enable_irq(IRQ_TC);
if ((info->presc&0xff) > 0)
writel(spmp_ADCCON_PRSCEN | spmp_ADCCON_PRSCVL(info->presc&0xFF),\
base_addr+spmp_ADCCON);
else
writel(0,base_addr+spmp_ADCCON);
/* Initialise registers */
if ((info->delay&0xffff) > 0)
writel(info->delay & 0xffff, base_addr+spmp_ADCDLY);
writel(WAIT4INT(0), base_addr+spmp_ADCTSC);
#endif
return 0;
}
#else
#define spmpts_suspend NULL
#define spmpts_resume NULL
#endif
static struct platform_driver spmpts_driver = {
.driver = {
.name = "spmp-saacc",
.owner = THIS_MODULE,
},
.probe = spmpts_probe,
.remove = spmpts_remove,
.suspend = spmpts_suspend,
.resume = spmpts_resume,
};
static int __init spmpts_init(void)
{
int rc;
rc = platform_driver_register(&spmpts_driver);
return rc;
}
static void __exit spmpts_exit(void)
{
platform_driver_unregister(&spmpts_driver);
}
module_init(spmpts_init);
module_exit(spmpts_exit);
| go2ev-devteam/Gplus_2159_0801 | openplatform/sdk/os/kernel-2.6.32/arch/arm/mach-spmp8050/spmp_touch.c | C | gpl-2.0 | 13,007 |
cmd_net/ipv6/protocol.o := arm-none-linux-gnueabi-gcc -Wp,-MD,net/ipv6/.protocol.o.d -nostdinc -isystem /home/stesalit/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/include -I/root/kernel-dev/linux-2.6.37/arch/arm/include -Iinclude -include include/generated/autoconf.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-davinci/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -marm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -mabi=aapcs-linux -mno-thumb-interwork -D__LINUX_ARM_ARCH__=5 -march=armv5te -mtune=arm9tdmi -msoft-float -Uarm -fno-stack-protector -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -DMODULE -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(protocol)" -D"KBUILD_MODNAME=KBUILD_STR(ipv6)" -c -o net/ipv6/.tmp_protocol.o net/ipv6/protocol.c
deps_net/ipv6/protocol.o := \
net/ipv6/protocol.c \
include/linux/module.h \
$(wildcard include/config/symbol/prefix.h) \
$(wildcard include/config/modules.h) \
$(wildcard include/config/modversions.h) \
$(wildcard include/config/unused/symbols.h) \
$(wildcard include/config/generic/bug.h) \
$(wildcard include/config/kallsyms.h) \
$(wildcard include/config/smp.h) \
$(wildcard include/config/tracepoints.h) \
$(wildcard include/config/tracing.h) \
$(wildcard include/config/event/tracing.h) \
$(wildcard include/config/ftrace/mcount/record.h) \
$(wildcard include/config/module/unload.h) \
$(wildcard include/config/constructors.h) \
$(wildcard include/config/sysfs.h) \
include/linux/list.h \
$(wildcard include/config/debug/list.h) \
include/linux/types.h \
$(wildcard include/config/uid16.h) \
$(wildcard include/config/lbdaf.h) \
$(wildcard include/config/phys/addr/t/64bit.h) \
$(wildcard include/config/64bit.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/types.h \
include/asm-generic/int-ll64.h \
include/asm-generic/bitsperlong.h \
include/linux/posix_types.h \
include/linux/stddef.h \
include/linux/compiler.h \
$(wildcard include/config/sparse/rcu/pointer.h) \
$(wildcard include/config/trace/branch/profiling.h) \
$(wildcard include/config/profile/all/branches.h) \
$(wildcard include/config/enable/must/check.h) \
$(wildcard include/config/enable/warn/deprecated.h) \
include/linux/compiler-gcc.h \
$(wildcard include/config/arch/supports/optimized/inlining.h) \
$(wildcard include/config/optimize/inlining.h) \
include/linux/compiler-gcc4.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/posix_types.h \
include/linux/poison.h \
$(wildcard include/config/illegal/pointer/value.h) \
include/linux/prefetch.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/processor.h \
$(wildcard include/config/have/hw/breakpoint.h) \
$(wildcard include/config/mmu.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/hw_breakpoint.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/ptrace.h \
$(wildcard include/config/cpu/endian/be8.h) \
$(wildcard include/config/arm/thumb.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/hwcap.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/cache.h \
$(wildcard include/config/arm/l1/cache/shift.h) \
$(wildcard include/config/aeabi.h) \
include/linux/stat.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/stat.h \
include/linux/time.h \
$(wildcard include/config/arch/uses/gettimeoffset.h) \
include/linux/cache.h \
$(wildcard include/config/arch/has/cache/line/size.h) \
include/linux/kernel.h \
$(wildcard include/config/preempt/voluntary.h) \
$(wildcard include/config/debug/spinlock/sleep.h) \
$(wildcard include/config/prove/locking.h) \
$(wildcard include/config/ring/buffer.h) \
$(wildcard include/config/numa.h) \
/home/stesalit/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/include/stdarg.h \
include/linux/linkage.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/linkage.h \
include/linux/bitops.h \
$(wildcard include/config/generic/find/last/bit.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/bitops.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/system.h \
$(wildcard include/config/cpu/xsc3.h) \
$(wildcard include/config/cpu/fa526.h) \
$(wildcard include/config/arch/has/barriers.h) \
$(wildcard include/config/arm/dma/mem/bufferable.h) \
$(wildcard include/config/cpu/sa1100.h) \
$(wildcard include/config/cpu/sa110.h) \
$(wildcard include/config/cpu/32v6k.h) \
include/linux/irqflags.h \
$(wildcard include/config/trace/irqflags.h) \
$(wildcard include/config/irqsoff/tracer.h) \
$(wildcard include/config/preempt/tracer.h) \
$(wildcard include/config/trace/irqflags/support.h) \
include/linux/typecheck.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/irqflags.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/outercache.h \
$(wildcard include/config/outer/cache/sync.h) \
$(wildcard include/config/outer/cache.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/memory.h \
$(wildcard include/config/page/offset.h) \
$(wildcard include/config/thumb2/kernel.h) \
$(wildcard include/config/highmem.h) \
$(wildcard include/config/dram/size.h) \
$(wildcard include/config/dram/base.h) \
$(wildcard include/config/have/tcm.h) \
$(wildcard include/config/zone/dma.h) \
include/linux/const.h \
arch/arm/mach-davinci/include/mach/memory.h \
$(wildcard include/config/arch/davinci/da8xx.h) \
$(wildcard include/config/arch/davinci/dmx.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/page.h \
$(wildcard include/config/cpu/copy/v3.h) \
$(wildcard include/config/cpu/copy/v4wt.h) \
$(wildcard include/config/cpu/copy/v4wb.h) \
$(wildcard include/config/cpu/copy/feroceon.h) \
$(wildcard include/config/cpu/copy/fa.h) \
$(wildcard include/config/cpu/xscale.h) \
$(wildcard include/config/cpu/copy/v6.h) \
$(wildcard include/config/sparsemem.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/glue.h \
$(wildcard include/config/cpu/arm610.h) \
$(wildcard include/config/cpu/arm710.h) \
$(wildcard include/config/cpu/abrt/lv4t.h) \
$(wildcard include/config/cpu/abrt/ev4.h) \
$(wildcard include/config/cpu/abrt/ev4t.h) \
$(wildcard include/config/cpu/abrt/ev5tj.h) \
$(wildcard include/config/cpu/abrt/ev5t.h) \
$(wildcard include/config/cpu/abrt/ev6.h) \
$(wildcard include/config/cpu/abrt/ev7.h) \
$(wildcard include/config/cpu/pabrt/legacy.h) \
$(wildcard include/config/cpu/pabrt/v6.h) \
$(wildcard include/config/cpu/pabrt/v7.h) \
include/asm-generic/getorder.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/sizes.h \
include/asm-generic/memory_model.h \
$(wildcard include/config/flatmem.h) \
$(wildcard include/config/discontigmem.h) \
$(wildcard include/config/sparsemem/vmemmap.h) \
include/asm-generic/cmpxchg-local.h \
include/asm-generic/cmpxchg.h \
include/asm-generic/bitops/non-atomic.h \
include/asm-generic/bitops/fls64.h \
include/asm-generic/bitops/sched.h \
include/asm-generic/bitops/hweight.h \
include/asm-generic/bitops/arch_hweight.h \
include/asm-generic/bitops/const_hweight.h \
include/asm-generic/bitops/lock.h \
include/linux/log2.h \
$(wildcard include/config/arch/has/ilog2/u32.h) \
$(wildcard include/config/arch/has/ilog2/u64.h) \
include/linux/printk.h \
$(wildcard include/config/printk.h) \
$(wildcard include/config/dynamic/debug.h) \
include/linux/dynamic_debug.h \
include/linux/jump_label.h \
$(wildcard include/config/jump/label.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/byteorder.h \
include/linux/byteorder/little_endian.h \
include/linux/swab.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/swab.h \
include/linux/byteorder/generic.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/bug.h \
$(wildcard include/config/bug.h) \
$(wildcard include/config/debug/bugverbose.h) \
include/asm-generic/bug.h \
$(wildcard include/config/generic/bug/relative/pointers.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/div64.h \
include/linux/seqlock.h \
include/linux/spinlock.h \
$(wildcard include/config/debug/spinlock.h) \
$(wildcard include/config/generic/lockbreak.h) \
$(wildcard include/config/preempt.h) \
$(wildcard include/config/debug/lock/alloc.h) \
include/linux/preempt.h \
$(wildcard include/config/debug/preempt.h) \
$(wildcard include/config/preempt/notifiers.h) \
include/linux/thread_info.h \
$(wildcard include/config/compat.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/thread_info.h \
$(wildcard include/config/arm/thumbee.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/fpstate.h \
$(wildcard include/config/vfpv3.h) \
$(wildcard include/config/iwmmxt.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/domain.h \
$(wildcard include/config/io/36.h) \
include/linux/stringify.h \
include/linux/bottom_half.h \
include/linux/spinlock_types.h \
include/linux/spinlock_types_up.h \
include/linux/lockdep.h \
$(wildcard include/config/lockdep.h) \
$(wildcard include/config/lock/stat.h) \
$(wildcard include/config/prove/rcu.h) \
include/linux/rwlock_types.h \
include/linux/spinlock_up.h \
include/linux/rwlock.h \
include/linux/spinlock_api_up.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/atomic.h \
$(wildcard include/config/generic/atomic64.h) \
include/asm-generic/atomic64.h \
include/asm-generic/atomic-long.h \
include/linux/math64.h \
include/linux/kmod.h \
include/linux/gfp.h \
$(wildcard include/config/kmemcheck.h) \
$(wildcard include/config/zone/dma32.h) \
$(wildcard include/config/debug/vm.h) \
include/linux/mmzone.h \
$(wildcard include/config/force/max/zoneorder.h) \
$(wildcard include/config/memory/hotplug.h) \
$(wildcard include/config/compaction.h) \
$(wildcard include/config/arch/populates/node/map.h) \
$(wildcard include/config/flat/node/mem/map.h) \
$(wildcard include/config/cgroup/mem/res/ctlr.h) \
$(wildcard include/config/no/bootmem.h) \
$(wildcard include/config/have/memory/present.h) \
$(wildcard include/config/have/memoryless/nodes.h) \
$(wildcard include/config/need/node/memmap/size.h) \
$(wildcard include/config/need/multiple/nodes.h) \
$(wildcard include/config/have/arch/early/pfn/to/nid.h) \
$(wildcard include/config/sparsemem/extreme.h) \
$(wildcard include/config/nodes/span/other/nodes.h) \
$(wildcard include/config/holes/in/zone.h) \
$(wildcard include/config/arch/has/holes/memorymodel.h) \
include/linux/wait.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/current.h \
include/linux/threads.h \
$(wildcard include/config/nr/cpus.h) \
$(wildcard include/config/base/small.h) \
include/linux/numa.h \
$(wildcard include/config/nodes/shift.h) \
include/linux/init.h \
$(wildcard include/config/hotplug.h) \
include/linux/nodemask.h \
include/linux/bitmap.h \
include/linux/string.h \
$(wildcard include/config/binary/printf.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/string.h \
include/linux/pageblock-flags.h \
$(wildcard include/config/hugetlb/page.h) \
$(wildcard include/config/hugetlb/page/size/variable.h) \
include/generated/bounds.h \
include/linux/memory_hotplug.h \
$(wildcard include/config/memory/hotremove.h) \
$(wildcard include/config/have/arch/nodedata/extension.h) \
include/linux/notifier.h \
include/linux/errno.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/errno.h \
include/asm-generic/errno.h \
include/asm-generic/errno-base.h \
include/linux/mutex.h \
$(wildcard include/config/debug/mutexes.h) \
include/linux/rwsem.h \
$(wildcard include/config/rwsem/generic/spinlock.h) \
include/linux/rwsem-spinlock.h \
include/linux/srcu.h \
include/linux/topology.h \
$(wildcard include/config/sched/smt.h) \
$(wildcard include/config/sched/mc.h) \
$(wildcard include/config/sched/book.h) \
$(wildcard include/config/use/percpu/numa/node/id.h) \
include/linux/cpumask.h \
$(wildcard include/config/cpumask/offstack.h) \
$(wildcard include/config/hotplug/cpu.h) \
$(wildcard include/config/debug/per/cpu/maps.h) \
$(wildcard include/config/disable/obsolete/cpumask/functions.h) \
include/linux/smp.h \
$(wildcard include/config/use/generic/smp/helpers.h) \
include/linux/percpu.h \
$(wildcard include/config/need/per/cpu/embed/first/chunk.h) \
$(wildcard include/config/need/per/cpu/page/first/chunk.h) \
$(wildcard include/config/have/setup/per/cpu/area.h) \
include/linux/pfn.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/percpu.h \
include/asm-generic/percpu.h \
include/linux/percpu-defs.h \
$(wildcard include/config/debug/force/weak/per/cpu.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/topology.h \
include/asm-generic/topology.h \
include/linux/mmdebug.h \
$(wildcard include/config/debug/virtual.h) \
include/linux/workqueue.h \
$(wildcard include/config/debug/objects/work.h) \
$(wildcard include/config/freezer.h) \
include/linux/timer.h \
$(wildcard include/config/timer/stats.h) \
$(wildcard include/config/debug/objects/timers.h) \
include/linux/ktime.h \
$(wildcard include/config/ktime/scalar.h) \
include/linux/jiffies.h \
include/linux/timex.h \
include/linux/param.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/param.h \
$(wildcard include/config/hz.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/timex.h \
arch/arm/mach-davinci/include/mach/timex.h \
include/linux/debugobjects.h \
$(wildcard include/config/debug/objects.h) \
$(wildcard include/config/debug/objects/free.h) \
include/linux/elf.h \
include/linux/elf-em.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/elf.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/user.h \
include/linux/kobject.h \
include/linux/sysfs.h \
include/linux/kobject_ns.h \
include/linux/kref.h \
include/linux/moduleparam.h \
$(wildcard include/config/alpha.h) \
$(wildcard include/config/ia64.h) \
$(wildcard include/config/ppc64.h) \
include/linux/tracepoint.h \
include/linux/rcupdate.h \
$(wildcard include/config/rcu/torture/test.h) \
$(wildcard include/config/preempt/rcu.h) \
$(wildcard include/config/no/hz.h) \
$(wildcard include/config/tree/rcu.h) \
$(wildcard include/config/tree/preempt/rcu.h) \
$(wildcard include/config/tiny/rcu.h) \
$(wildcard include/config/tiny/preempt/rcu.h) \
$(wildcard include/config/debug/objects/rcu/head.h) \
$(wildcard include/config/preempt/rt.h) \
include/linux/completion.h \
include/linux/rcutree.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/module.h \
$(wildcard include/config/arm/unwind.h) \
include/trace/events/module.h \
include/trace/define_trace.h \
include/linux/netdevice.h \
$(wildcard include/config/dcb.h) \
$(wildcard include/config/wlan.h) \
$(wildcard include/config/ax25.h) \
$(wildcard include/config/mac80211/mesh.h) \
$(wildcard include/config/tr.h) \
$(wildcard include/config/net/ipip.h) \
$(wildcard include/config/net/ipgre.h) \
$(wildcard include/config/ipv6/sit.h) \
$(wildcard include/config/ipv6/tunnel.h) \
$(wildcard include/config/netpoll.h) \
$(wildcard include/config/rps.h) \
$(wildcard include/config/net/poll/controller.h) \
$(wildcard include/config/fcoe.h) \
$(wildcard include/config/wireless/ext.h) \
$(wildcard include/config/vlan/8021q.h) \
$(wildcard include/config/net/dsa.h) \
$(wildcard include/config/net/ns.h) \
$(wildcard include/config/net/dsa/tag/dsa.h) \
$(wildcard include/config/net/dsa/tag/trailer.h) \
$(wildcard include/config/netpoll/trap.h) \
$(wildcard include/config/proc/fs.h) \
include/linux/if.h \
include/linux/socket.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/socket.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/sockios.h \
include/linux/sockios.h \
include/linux/uio.h \
include/linux/hdlc/ioctl.h \
include/linux/if_ether.h \
$(wildcard include/config/sysctl.h) \
include/linux/skbuff.h \
$(wildcard include/config/nf/conntrack.h) \
$(wildcard include/config/bridge/netfilter.h) \
$(wildcard include/config/xfrm.h) \
$(wildcard include/config/net/sched.h) \
$(wildcard include/config/net/cls/act.h) \
$(wildcard include/config/ipv6/ndisc/nodetype.h) \
$(wildcard include/config/net/dma.h) \
$(wildcard include/config/network/secmark.h) \
$(wildcard include/config/network/phy/timestamping.h) \
include/linux/kmemcheck.h \
include/linux/mm_types.h \
$(wildcard include/config/split/ptlock/cpus.h) \
$(wildcard include/config/want/page/debug/flags.h) \
$(wildcard include/config/aio.h) \
$(wildcard include/config/mm/owner.h) \
$(wildcard include/config/mmu/notifier.h) \
include/linux/auxvec.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/auxvec.h \
include/linux/prio_tree.h \
include/linux/rbtree.h \
include/linux/page-debug-flags.h \
$(wildcard include/config/page/poisoning.h) \
$(wildcard include/config/page/debug/something/else.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/mmu.h \
$(wildcard include/config/cpu/has/asid.h) \
include/linux/net.h \
include/linux/random.h \
include/linux/ioctl.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/ioctl.h \
include/asm-generic/ioctl.h \
include/linux/irqnr.h \
$(wildcard include/config/generic/hardirqs.h) \
include/linux/fcntl.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/fcntl.h \
include/asm-generic/fcntl.h \
include/linux/sysctl.h \
include/linux/ratelimit.h \
include/linux/textsearch.h \
include/linux/err.h \
include/linux/slab.h \
$(wildcard include/config/slab/debug.h) \
$(wildcard include/config/failslab.h) \
$(wildcard include/config/slub.h) \
$(wildcard include/config/slob.h) \
$(wildcard include/config/debug/slab.h) \
$(wildcard include/config/slab.h) \
include/linux/slub_def.h \
$(wildcard include/config/slub/stats.h) \
$(wildcard include/config/slub/debug.h) \
include/linux/kmemleak.h \
$(wildcard include/config/debug/kmemleak.h) \
include/trace/events/kmem.h \
include/trace/events/gfpflags.h \
include/net/checksum.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/uaccess.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/unified.h \
$(wildcard include/config/arm/asm/unified.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/checksum.h \
include/linux/in6.h \
include/linux/dmaengine.h \
$(wildcard include/config/async/tx/enable/channel/switch.h) \
$(wildcard include/config/dma/engine.h) \
$(wildcard include/config/async/tx/dma.h) \
include/linux/device.h \
$(wildcard include/config/of.h) \
$(wildcard include/config/debug/devres.h) \
$(wildcard include/config/devtmpfs.h) \
$(wildcard include/config/sysfs/deprecated.h) \
include/linux/ioport.h \
include/linux/klist.h \
include/linux/pm.h \
$(wildcard include/config/pm.h) \
$(wildcard include/config/pm/sleep.h) \
$(wildcard include/config/pm/runtime.h) \
$(wildcard include/config/pm/ops.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/device.h \
$(wildcard include/config/dmabounce.h) \
include/linux/pm_wakeup.h \
include/linux/dma-mapping.h \
$(wildcard include/config/has/dma.h) \
$(wildcard include/config/have/dma/attrs.h) \
$(wildcard include/config/need/dma/map/state.h) \
include/linux/dma-attrs.h \
include/linux/bug.h \
include/linux/scatterlist.h \
$(wildcard include/config/debug/sg.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/scatterlist.h \
include/asm-generic/scatterlist.h \
$(wildcard include/config/need/sg/dma/length.h) \
include/linux/mm.h \
$(wildcard include/config/stack/growsup.h) \
$(wildcard include/config/ksm.h) \
$(wildcard include/config/debug/pagealloc.h) \
$(wildcard include/config/hibernation.h) \
$(wildcard include/config/memory/failure.h) \
include/linux/debug_locks.h \
$(wildcard include/config/debug/locking/api/selftests.h) \
include/linux/range.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/pgtable.h \
$(wildcard include/config/highpte.h) \
include/asm-generic/4level-fixup.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/proc-fns.h \
$(wildcard include/config/cpu/arm7tdmi.h) \
$(wildcard include/config/cpu/arm720t.h) \
$(wildcard include/config/cpu/arm740t.h) \
$(wildcard include/config/cpu/arm9tdmi.h) \
$(wildcard include/config/cpu/arm920t.h) \
$(wildcard include/config/cpu/arm922t.h) \
$(wildcard include/config/cpu/arm925t.h) \
$(wildcard include/config/cpu/arm926t.h) \
$(wildcard include/config/cpu/arm940t.h) \
$(wildcard include/config/cpu/arm946e.h) \
$(wildcard include/config/cpu/arm1020.h) \
$(wildcard include/config/cpu/arm1020e.h) \
$(wildcard include/config/cpu/arm1022.h) \
$(wildcard include/config/cpu/arm1026.h) \
$(wildcard include/config/cpu/mohawk.h) \
$(wildcard include/config/cpu/feroceon.h) \
$(wildcard include/config/cpu/v6.h) \
$(wildcard include/config/cpu/v7.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/cpu-single.h \
arch/arm/mach-davinci/include/mach/vmalloc.h \
arch/arm/mach-davinci/include/mach/hardware.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/pgtable-hwdef.h \
include/asm-generic/pgtable.h \
include/linux/page-flags.h \
$(wildcard include/config/pageflags/extended.h) \
$(wildcard include/config/arch/uses/pg/uncached.h) \
$(wildcard include/config/swap.h) \
$(wildcard include/config/s390.h) \
include/linux/vmstat.h \
$(wildcard include/config/vm/event/counters.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/io.h \
arch/arm/mach-davinci/include/mach/io.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/dma-mapping.h \
include/asm-generic/dma-coherent.h \
$(wildcard include/config/have/generic/dma/coherent.h) \
include/linux/hrtimer.h \
$(wildcard include/config/high/res/timers.h) \
include/linux/if_packet.h \
include/linux/if_link.h \
include/linux/netlink.h \
include/linux/capability.h \
include/linux/pm_qos_params.h \
include/linux/plist.h \
$(wildcard include/config/debug/pi/list.h) \
include/linux/miscdevice.h \
include/linux/major.h \
include/linux/delay.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/delay.h \
include/linux/rculist.h \
include/linux/ethtool.h \
include/net/net_namespace.h \
$(wildcard include/config/ipv6.h) \
$(wildcard include/config/ip/dccp.h) \
$(wildcard include/config/netfilter.h) \
$(wildcard include/config/wext/core.h) \
$(wildcard include/config/net.h) \
include/net/netns/core.h \
include/net/netns/mib.h \
$(wildcard include/config/xfrm/statistics.h) \
include/net/snmp.h \
include/linux/snmp.h \
include/linux/u64_stats_sync.h \
include/net/netns/unix.h \
include/net/netns/packet.h \
include/net/netns/ipv4.h \
$(wildcard include/config/ip/multiple/tables.h) \
$(wildcard include/config/security.h) \
$(wildcard include/config/ip/mroute.h) \
$(wildcard include/config/ip/mroute/multiple/tables.h) \
include/net/inet_frag.h \
include/net/netns/ipv6.h \
$(wildcard include/config/ipv6/multiple/tables.h) \
$(wildcard include/config/ipv6/mroute.h) \
$(wildcard include/config/ipv6/mroute/multiple/tables.h) \
include/net/dst_ops.h \
include/linux/percpu_counter.h \
include/net/netns/dccp.h \
include/net/netns/x_tables.h \
$(wildcard include/config/bridge/nf/ebtables.h) \
include/linux/netfilter.h \
$(wildcard include/config/netfilter/debug.h) \
$(wildcard include/config/nf/nat/needed.h) \
include/linux/in.h \
include/net/flow.h \
include/linux/proc_fs.h \
$(wildcard include/config/proc/devicetree.h) \
$(wildcard include/config/proc/kcore.h) \
include/linux/fs.h \
$(wildcard include/config/quota.h) \
$(wildcard include/config/fsnotify.h) \
$(wildcard include/config/ima.h) \
$(wildcard include/config/fs/posix/acl.h) \
$(wildcard include/config/epoll.h) \
$(wildcard include/config/debug/writecount.h) \
$(wildcard include/config/file/locking.h) \
$(wildcard include/config/auditsyscall.h) \
$(wildcard include/config/block.h) \
$(wildcard include/config/fs/xip.h) \
$(wildcard include/config/migration.h) \
include/linux/limits.h \
include/linux/blk_types.h \
$(wildcard include/config/blk/dev/integrity.h) \
include/linux/kdev_t.h \
include/linux/dcache.h \
include/linux/path.h \
include/linux/radix-tree.h \
include/linux/pid.h \
include/linux/semaphore.h \
include/linux/fiemap.h \
include/linux/quota.h \
$(wildcard include/config/quota/netlink/interface.h) \
include/linux/dqblk_xfs.h \
include/linux/dqblk_v1.h \
include/linux/dqblk_v2.h \
include/linux/dqblk_qtree.h \
include/linux/nfs_fs_i.h \
include/linux/nfs.h \
include/linux/sunrpc/msg_prot.h \
include/linux/inet.h \
include/linux/magic.h \
include/net/netns/conntrack.h \
include/linux/list_nulls.h \
include/net/netns/xfrm.h \
include/linux/xfrm.h \
include/linux/seq_file_net.h \
include/linux/seq_file.h \
include/net/dsa.h \
include/linux/interrupt.h \
$(wildcard include/config/generic/irq/probe.h) \
include/linux/irqreturn.h \
include/linux/hardirq.h \
$(wildcard include/config/bkl.h) \
$(wildcard include/config/virt/cpu/accounting.h) \
$(wildcard include/config/irq/time/accounting.h) \
include/linux/ftrace_irq.h \
$(wildcard include/config/ftrace/nmi/enter.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/hardirq.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/irq.h \
arch/arm/mach-davinci/include/mach/irqs.h \
include/linux/irq_cpustat.h \
include/linux/sched.h \
$(wildcard include/config/sched/debug.h) \
$(wildcard include/config/lockup/detector.h) \
$(wildcard include/config/detect/hung/task.h) \
$(wildcard include/config/core/dump/default/elf/headers.h) \
$(wildcard include/config/bsd/process/acct.h) \
$(wildcard include/config/taskstats.h) \
$(wildcard include/config/audit.h) \
$(wildcard include/config/inotify/user.h) \
$(wildcard include/config/fanotify.h) \
$(wildcard include/config/posix/mqueue.h) \
$(wildcard include/config/keys.h) \
$(wildcard include/config/perf/events.h) \
$(wildcard include/config/schedstats.h) \
$(wildcard include/config/task/delay/acct.h) \
$(wildcard include/config/fair/group/sched.h) \
$(wildcard include/config/rt/group/sched.h) \
$(wildcard include/config/blk/dev/io/trace.h) \
$(wildcard include/config/cc/stackprotector.h) \
$(wildcard include/config/sysvipc.h) \
$(wildcard include/config/rt/mutexes.h) \
$(wildcard include/config/task/xacct.h) \
$(wildcard include/config/cpusets.h) \
$(wildcard include/config/cgroups.h) \
$(wildcard include/config/futex.h) \
$(wildcard include/config/fault/injection.h) \
$(wildcard include/config/latencytop.h) \
$(wildcard include/config/function/graph/tracer.h) \
$(wildcard include/config/have/unstable/sched/clock.h) \
$(wildcard include/config/debug/stack/usage.h) \
$(wildcard include/config/cgroup/sched.h) \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/cputime.h \
include/asm-generic/cputime.h \
include/linux/sem.h \
include/linux/ipc.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/ipcbuf.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/sembuf.h \
include/linux/signal.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/signal.h \
include/asm-generic/signal-defs.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/sigcontext.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/siginfo.h \
include/asm-generic/siginfo.h \
include/linux/proportions.h \
include/linux/seccomp.h \
$(wildcard include/config/seccomp.h) \
include/linux/rtmutex.h \
$(wildcard include/config/debug/rt/mutexes.h) \
include/linux/resource.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/resource.h \
include/asm-generic/resource.h \
include/linux/task_io_accounting.h \
$(wildcard include/config/task/io/accounting.h) \
include/linux/latencytop.h \
include/linux/cred.h \
$(wildcard include/config/debug/credentials.h) \
include/linux/key.h \
include/linux/selinux.h \
$(wildcard include/config/security/selinux.h) \
include/linux/aio.h \
include/linux/aio_abi.h \
include/trace/events/irq.h \
include/net/protocol.h \
include/linux/ipv6.h \
$(wildcard include/config/ipv6/privacy.h) \
$(wildcard include/config/ipv6/router/pref.h) \
$(wildcard include/config/ipv6/route/info.h) \
$(wildcard include/config/ipv6/optimistic/dad.h) \
$(wildcard include/config/ipv6/mip6.h) \
$(wildcard include/config/ipv6/subtrees.h) \
include/linux/icmpv6.h \
include/linux/tcp.h \
$(wildcard include/config/tcp/md5sig.h) \
include/net/sock.h \
include/linux/security.h \
$(wildcard include/config/security/path.h) \
$(wildcard include/config/security/network.h) \
$(wildcard include/config/security/network/xfrm.h) \
$(wildcard include/config/securityfs.h) \
include/linux/fsnotify.h \
include/linux/fsnotify_backend.h \
$(wildcard include/config/fanotify/access/permissions.h) \
include/linux/idr.h \
include/linux/audit.h \
$(wildcard include/config/change.h) \
include/linux/binfmts.h \
include/linux/shm.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/shmparam.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/shmbuf.h \
include/linux/msg.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/msgbuf.h \
include/linux/filter.h \
include/linux/rculist_nulls.h \
include/linux/poll.h \
/root/kernel-dev/linux-2.6.37/arch/arm/include/asm/poll.h \
include/asm-generic/poll.h \
include/net/dst.h \
$(wildcard include/config/net/cls/route.h) \
include/linux/rtnetlink.h \
include/linux/if_addr.h \
include/linux/neighbour.h \
include/net/neighbour.h \
include/net/rtnetlink.h \
include/net/netlink.h \
include/net/inet_connection_sock.h \
include/net/inet_sock.h \
include/linux/jhash.h \
include/net/request_sock.h \
include/net/netns/hash.h \
include/net/inet_timewait_sock.h \
include/net/tcp_states.h \
include/net/timewait_sock.h \
include/linux/udp.h \
net/ipv6/protocol.o: $(deps_net/ipv6/protocol.o)
$(deps_net/ipv6/protocol.o):
| srinugnt2000/linux-2.6.37 | net/ipv6/.protocol.o.cmd | Batchfile | gpl-2.0 | 31,312 |
var x := false ? 'foo' : fun () { 'bar'; };
.print("x: @{x}");
if (x.call) {
print('x is callable -> calling');
var y := x();
print("result of x: @{y}");
}
| panos--/ella | test/test.sql | SQL | gpl-2.0 | 169 |
package fr.nonimad.ld32;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.g2d.GlyphLayout;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.kotcrab.vis.ui.VisUI;
public class ScreenGameOver extends ScreenAdapter {
private Stage stage = new Stage();
@Override
public void show() {
Gdx.input.setInputProcessor(stage);
TextButton btn_return = new TextButton("Return to Menu", VisUI.getSkin());
btn_return.setPosition(362, 350);
btn_return.setSize(300, 40);
btn_return.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
((LudumDare32)Gdx.app.getApplicationListener()).setScreen(new ScreenMainMenu());
}
});
stage.addActor(btn_return);
Label title = new Label("Game Over", new Label.LabelStyle(Assets.f_mainTitle, Color.WHITE));
title.setPosition(512 - new GlyphLayout(Assets.f_mainTitle, "Game Over").width / 2, 550);
stage.addActor(title);
}
@Override
public void render(float delta) {
Gdx.gl.glClearColor(1, 1, 1, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
stage.act();
stage.draw();
}
@Override
public void hide() {
dispose();
}
@Override
public void dispose() {
stage.dispose();
}
}
| NoNiMad/VoiceFighter | core/src/fr/nonimad/ld32/ScreenGameOver.java | Java | gpl-2.0 | 1,751 |
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#include "precomp.h"
#include "qwt_plot_tradingcurve.h"
#include "qwt_scale_map.h"
#include "qwt_clipper.h"
#include "qwt_painter.h"
#include <qpainter.h>
static inline bool qwtIsSampleInside( const QwtOHLCSample &sample,
double tMin, double tMax, double vMin, double vMax )
{
const double t = sample.time;
const QwtInterval interval = sample.boundingInterval();
const bool isOffScreen = ( t < tMin ) || ( t > tMax )
|| ( interval.maxValue() < vMin ) || ( interval.minValue() > vMax );
return !isOffScreen;
}
class QwtPlotTradingCurve::PrivateData
{
public:
PrivateData():
symbolStyle( QwtPlotTradingCurve::CandleStick ),
symbolExtent( 0.6 ),
minSymbolWidth( 2.0 ),
maxSymbolWidth( -1.0 ),
paintAttributes( QwtPlotTradingCurve::ClipSymbols )
{
symbolBrush[0] = QBrush( Qt::white );
symbolBrush[1] = QBrush( Qt::black );
}
QwtPlotTradingCurve::SymbolStyle symbolStyle;
double symbolExtent;
double minSymbolWidth;
double maxSymbolWidth;
QPen symbolPen;
QBrush symbolBrush[2]; // Increasing/Decreasing
QwtPlotTradingCurve::PaintAttributes paintAttributes;
};
/*!
Constructor
\param title Title of the curve
*/
QwtPlotTradingCurve::QwtPlotTradingCurve( const QwtText &title ):
QwtPlotSeriesItem( title )
{
init();
}
/*!
Constructor
\param title Title of the curve
*/
QwtPlotTradingCurve::QwtPlotTradingCurve( const QString &title ):
QwtPlotSeriesItem( QwtText( title ) )
{
init();
}
//! Destructor
QwtPlotTradingCurve::~QwtPlotTradingCurve()
{
delete d_data;
}
//! Initialize internal members
void QwtPlotTradingCurve::init()
{
setItemAttribute( QwtPlotItem::Legend, true );
setItemAttribute( QwtPlotItem::AutoScale, true );
d_data = new PrivateData;
setData( new QwtTradingChartData() );
setZ( 19.0 );
}
//! \return QwtPlotItem::Rtti_PlotTradingCurve
int QwtPlotTradingCurve::rtti() const
{
return QwtPlotTradingCurve::Rtti_PlotTradingCurve;
}
/*!
Specify an attribute how to draw the curve
\param attribute Paint attribute
\param on On/Off
\sa testPaintAttribute()
*/
void QwtPlotTradingCurve::setPaintAttribute(
PaintAttribute attribute, bool on )
{
if ( on )
d_data->paintAttributes |= attribute;
else
d_data->paintAttributes &= ~attribute;
}
/*!
\return True, when attribute is enabled
\sa PaintAttribute, setPaintAttribute()
*/
bool QwtPlotTradingCurve::testPaintAttribute(
PaintAttribute attribute ) const
{
return ( d_data->paintAttributes & attribute );
}
/*!
Initialize data with an array of samples.
\param samples Vector of samples
\sa QwtPlotSeriesItem::setData()
*/
void QwtPlotTradingCurve::setSamples(
const QVector<QwtOHLCSample> &samples )
{
setData( new QwtTradingChartData( samples ) );
}
/*!
Assign a series of samples
setSamples() is just a wrapper for setData() without any additional
value - beside that it is easier to find for the developer.
\param data Data
\warning The item takes ownership of the data object, deleting
it when its not used anymore.
*/
void QwtPlotTradingCurve::setSamples(
QwtSeriesData<QwtOHLCSample> *data )
{
setData( data );
}
/*!
Set the symbol style
\param style Symbol style
\sa symbolStyle(), setSymbolExtent(),
setSymbolPen(), setSymbolBrush()
*/
void QwtPlotTradingCurve::setSymbolStyle( SymbolStyle style )
{
if ( style != d_data->symbolStyle )
{
d_data->symbolStyle = style;
legendChanged();
itemChanged();
}
}
/*!
\return Symbol style
\sa setSymbolStyle(), symbolExtent(), symbolPen(), symbolBrush()
*/
QwtPlotTradingCurve::SymbolStyle QwtPlotTradingCurve::symbolStyle() const
{
return d_data->symbolStyle;
}
/*!
Build and assign the symbol pen
In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 ) what makes it
non cosmetic ( see QPen::isCosmetic() ). This method has been introduced
to hide this incompatibility.
\param color Pen color
\param width Pen width
\param style Pen style
\sa pen(), brush()
*/
void QwtPlotTradingCurve::setSymbolPen(
const QColor &color, qreal width, Qt::PenStyle style )
{
setSymbolPen( QPen( color, width, style ) );
}
/*!
\brief Set the symbol pen
The symbol pen is used for rendering the lines of the
bar or candlestick symbols
\sa symbolPen(), setSymbolBrush()
*/
void QwtPlotTradingCurve::setSymbolPen( const QPen &pen )
{
if ( pen != d_data->symbolPen )
{
d_data->symbolPen = pen;
legendChanged();
itemChanged();
}
}
/*!
\return Symbol pen
\sa setSymbolPen(), symbolBrush()
*/
QPen QwtPlotTradingCurve::symbolPen() const
{
return d_data->symbolPen;
}
/*!
Set the symbol brush
\param direction Direction type
\param brush Brush used to fill the body of all candlestick
symbols with the direction
\sa symbolBrush(), setSymbolPen()
*/
void QwtPlotTradingCurve::setSymbolBrush(
Direction direction, const QBrush &brush )
{
if ( direction < 0 || direction >= 2 )
return;
if ( brush != d_data->symbolBrush[ direction ] )
{
d_data->symbolBrush[ direction ] = brush;
legendChanged();
itemChanged();
}
}
/*!
\param direction
\return Brush used to fill the body of all candlestick
symbols with the direction
\sa setSymbolPen(), symbolBrush()
*/
QBrush QwtPlotTradingCurve::symbolBrush( Direction direction ) const
{
if ( direction < 0 || direction >= 2 )
return QBrush();
return d_data->symbolBrush[ direction ];
}
/*!
\brief Set the extent of the symbol
The width of the symbol is given in scale coordinates. When painting
a symbol the width is scaled into paint device coordinates
by scaledSymbolWidth(). The scaled width is bounded by
minSymbolWidth(), maxSymbolWidth()
\param extent Symbol width in scale coordinates
\sa symbolExtent(), scaledSymbolWidth(),
setMinSymbolWidth(), setMaxSymbolWidth()
*/
void QwtPlotTradingCurve::setSymbolExtent( double extent )
{
extent = qMax( 0.0, extent );
if ( extent != d_data->symbolExtent )
{
d_data->symbolExtent = extent;
legendChanged();
itemChanged();
}
}
/*!
\return Extent of a symbol in scale coordinates
\sa setSymbolExtent(), scaledSymbolWidth(),
minSymbolWidth(), maxSymbolWidth()
*/
double QwtPlotTradingCurve::symbolExtent() const
{
return d_data->symbolExtent;
}
/*!
Set a minimum for the symbol width
\param width Width in paint device coordinates
\sa minSymbolWidth(), setMaxSymbolWidth(), setSymbolExtent()
*/
void QwtPlotTradingCurve::setMinSymbolWidth( double width )
{
width = qMax( width, 0.0 );
if ( width != d_data->minSymbolWidth )
{
d_data->minSymbolWidth = width;
legendChanged();
itemChanged();
}
}
/*!
\return Minmum for the symbol width
\sa setMinSymbolWidth(), maxSymbolWidth(), symbolExtent()
*/
double QwtPlotTradingCurve::minSymbolWidth() const
{
return d_data->minSymbolWidth;
}
/*!
Set a maximum for the symbol width
A value <= 0.0 means an unlimited width
\param width Width in paint device coordinates
\sa maxSymbolWidth(), setMinSymbolWidth(), setSymbolExtent()
*/
void QwtPlotTradingCurve::setMaxSymbolWidth( double width )
{
if ( width != d_data->maxSymbolWidth )
{
d_data->maxSymbolWidth = width;
legendChanged();
itemChanged();
}
}
/*!
\return Maximum for the symbol width
\sa setMaxSymbolWidth(), minSymbolWidth(), symbolExtent()
*/
double QwtPlotTradingCurve::maxSymbolWidth() const
{
return d_data->maxSymbolWidth;
}
/*!
\return Bounding rectangle of all samples.
For an empty series the rectangle is invalid.
*/
QRectF QwtPlotTradingCurve::boundingRect() const
{
QRectF rect = QwtPlotSeriesItem::boundingRect();
if ( rect.isValid() && orientation() == Qt::Vertical )
rect.setRect( rect.y(), rect.x(), rect.height(), rect.width() );
return rect;
}
/*!
Draw an interval of the curve
\param painter Painter
\param xMap Maps x-values into pixel coordinates.
\param yMap Maps y-values into pixel coordinates.
\param canvasRect Contents rectangle of the canvas
\param from Index of the first point to be painted
\param to Index of the last point to be painted. If to < 0 the
curve will be painted to its last point.
\sa drawSymbols()
*/
void QwtPlotTradingCurve::drawSeries( QPainter *painter,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRectF &canvasRect, int from, int to ) const
{
if ( to < 0 )
to = dataSize() - 1;
if ( from < 0 )
from = 0;
if ( from > to )
return;
painter->save();
if ( d_data->symbolStyle != QwtPlotTradingCurve::NoSymbol )
drawSymbols( painter, xMap, yMap, canvasRect, from, to );
painter->restore();
}
/*!
Draw symbols
\param painter Painter
\param xMap x map
\param yMap y map
\param canvasRect Contents rectangle of the canvas
\param from Index of the first point to be painted
\param to Index of the last point to be painted
\sa drawSeries()
*/
void QwtPlotTradingCurve::drawSymbols( QPainter *painter,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRectF &canvasRect, int from, int to ) const
{
const QRectF tr = QwtScaleMap::invTransform( xMap, yMap, canvasRect );
const QwtScaleMap *timeMap, *valueMap;
double tMin, tMax, vMin, vMax;
const Qt::Orientation orient = orientation();
if ( orient == Qt::Vertical )
{
timeMap = &xMap;
valueMap = &yMap;
tMin = tr.left();
tMax = tr.right();
vMin = tr.top();
vMax = tr.bottom();
}
else
{
timeMap = &yMap;
valueMap = &xMap;
vMin = tr.left();
vMax = tr.right();
tMin = tr.top();
tMax = tr.bottom();
}
const bool inverted = timeMap->isInverting();
const bool doClip = d_data->paintAttributes & ClipSymbols;
const bool doAlign = QwtPainter::roundingAlignment( painter );
double symbolWidth = scaledSymbolWidth( xMap, yMap, canvasRect );
if ( doAlign )
symbolWidth = qFloor( 0.5 * symbolWidth ) * 2.0;
QPen pen = d_data->symbolPen;
pen.setCapStyle( Qt::FlatCap );
painter->setPen( pen );
for ( int i = from; i <= to; i++ )
{
const QwtOHLCSample s = sample( i );
if ( !doClip || qwtIsSampleInside( s, tMin, tMax, vMin, vMax ) )
{
QwtOHLCSample translatedSample;
translatedSample.time = timeMap->transform( s.time );
translatedSample.open = valueMap->transform( s.open );
translatedSample.high = valueMap->transform( s.high );
translatedSample.low = valueMap->transform( s.low );
translatedSample.close = valueMap->transform( s.close );
const int brushIndex = ( s.open < s.close )
? QwtPlotTradingCurve::Increasing
: QwtPlotTradingCurve::Decreasing;
if ( doAlign )
{
translatedSample.time = qRound( translatedSample.time );
translatedSample.open = qRound( translatedSample.open );
translatedSample.high = qRound( translatedSample.high );
translatedSample.low = qRound( translatedSample.low );
translatedSample.close = qRound( translatedSample.close );
}
switch( d_data->symbolStyle )
{
case Bar:
{
drawBar( painter, translatedSample,
orient, inverted, symbolWidth );
break;
}
case CandleStick:
{
painter->setBrush( d_data->symbolBrush[ brushIndex ] );
drawCandleStick( painter, translatedSample,
orient, symbolWidth );
break;
}
default:
{
if ( d_data->symbolStyle >= UserSymbol )
{
painter->setBrush( d_data->symbolBrush[ brushIndex ] );
drawUserSymbol( painter, d_data->symbolStyle,
translatedSample, orient, inverted, symbolWidth );
}
}
}
}
}
}
/*!
\brief Draw a symbol for a symbol style >= UserSymbol
The implementation does nothing and is intended to be overloaded
\param painter Qt painter, initialized with pen/brush
\param symbolStyle Symbol style
\param sample Samples already translated into paint device coordinates
\param orientation Vertical or horizontal
\param inverted True, when the opposite scale
( Qt::Vertical: x, Qt::Horizontal: y ) is increasing
in the opposite direction as QPainter coordinates.
\param symbolWidth Width of the symbol in paint device coordinates
*/
void QwtPlotTradingCurve::drawUserSymbol( QPainter *painter,
SymbolStyle symbolStyle, const QwtOHLCSample &sample,
Qt::Orientation orientation, bool inverted, double symbolWidth ) const
{
Q_UNUSED( painter )
Q_UNUSED( symbolStyle )
Q_UNUSED( orientation )
Q_UNUSED( inverted )
Q_UNUSED( symbolWidth )
Q_UNUSED( sample )
}
/*!
\brief Draw a bar
\param painter Qt painter, initialized with pen/brush
\param sample Sample, already translated into paint device coordinates
\param orientation Vertical or horizontal
\param inverted When inverted is false the open tick is painted
to the left/top, otherwise it is painted right/bottom.
The close tick is painted in the opposite direction
of the open tick.
painted in the opposite d
opposite direction.
\param width Width or height of the candle, depending on the orientation
\sa Bar
*/
void QwtPlotTradingCurve::drawBar( QPainter *painter,
const QwtOHLCSample &sample, Qt::Orientation orientation,
bool inverted, double width ) const
{
double w2 = 0.5 * width;
if ( inverted )
w2 *= -1;
if ( orientation == Qt::Vertical )
{
QwtPainter::drawLine( painter,
sample.time, sample.low, sample.time, sample.high );
QwtPainter::drawLine( painter,
sample.time - w2, sample.open, sample.time, sample.open );
QwtPainter::drawLine( painter,
sample.time + w2, sample.close, sample.time, sample.close );
}
else
{
QwtPainter::drawLine( painter, sample.low, sample.time,
sample.high, sample.time );
QwtPainter::drawLine( painter,
sample.open, sample.time - w2, sample.open, sample.time );
QwtPainter::drawLine( painter,
sample.close, sample.time + w2, sample.close, sample.time );
}
}
/*!
\brief Draw a candle stick
\param painter Qt painter, initialized with pen/brush
\param sample Samples already translated into paint device coordinates
\param orientation Vertical or horizontal
\param width Width or height of the candle, depending on the orientation
\sa CandleStick
*/
void QwtPlotTradingCurve::drawCandleStick( QPainter *painter,
const QwtOHLCSample &sample, Qt::Orientation orientation,
double width ) const
{
const double t = sample.time;
const double v1 = qMin( sample.low, sample.high );
const double v2 = qMin( sample.open, sample.close );
const double v3 = qMax( sample.low, sample.high );
const double v4 = qMax( sample.open, sample.close );
if ( orientation == Qt::Vertical )
{
QwtPainter::drawLine( painter, t, v1, t, v2 );
QwtPainter::drawLine( painter, t, v3, t, v4 );
QRectF rect( t - 0.5 * width, sample.open,
width, sample.close - sample.open );
QwtPainter::drawRect( painter, rect );
}
else
{
QwtPainter::drawLine( painter, v1, t, v2, t );
QwtPainter::drawLine( painter, v3, t, v4, t );
const QRectF rect( sample.open, t - 0.5 * width,
sample.close - sample.open, width );
QwtPainter::drawRect( painter, rect );
}
}
/*!
\return A rectangle filled with the color of the symbol pen
\param index Index of the legend entry
( usually there is only one )
\param size Icon size
\sa setLegendIconSize(), legendData()
*/
QwtGraphic QwtPlotTradingCurve::legendIcon( int index,
const QSizeF &size ) const
{
Q_UNUSED( index );
return defaultIcon( d_data->symbolPen.color(), size );
}
/*!
Calculate the symbol width in paint coordinates
The width is calculated by scaling the symbol extent into
paint device coordinates bounded by the minimum/maximum
symbol width.
\param xMap Maps x-values into pixel coordinates.
\param yMap Maps y-values into pixel coordinates.
\param canvasRect Contents rectangle of the canvas
\return Symbol width in paint coordinates
\sa symbolExtent(), minSymbolWidth(), maxSymbolWidth()
*/
double QwtPlotTradingCurve::scaledSymbolWidth(
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRectF &canvasRect ) const
{
Q_UNUSED( canvasRect );
if ( d_data->maxSymbolWidth > 0.0 &&
d_data->minSymbolWidth >= d_data->maxSymbolWidth )
{
return d_data->minSymbolWidth;
}
const QwtScaleMap *map =
( orientation() == Qt::Vertical ) ? &xMap : &yMap;
const double pos = map->transform( map->s1() + d_data->symbolExtent );
double width = qAbs( pos - map->p1() );
width = qMax( width, d_data->minSymbolWidth );
if ( d_data->maxSymbolWidth > 0.0 )
width = qMin( width, d_data->maxSymbolWidth );
return width;
}
| iclosure/jframework | src/3rdpart/qwt/src/qwt_plot_tradingcurve.cpp | C++ | gpl-2.0 | 18,342 |
/*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* 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 _OBJECT_H
#define _OBJECT_H
#include "Common.h"
#include "UpdateFields.h"
#include "UpdateData.h"
#include "GridReference.h"
#include "ObjectDefines.h"
#include "GridDefines.h"
#include "Map.h"
#include <set>
#include <string>
#include <sstream>
#define CONTACT_DISTANCE 0.5f
#define INTERACTION_DISTANCE 5.0f
#define ATTACK_DISTANCE 5.0f
#define MAX_VISIBILITY_DISTANCE 500.0f // max distance for visible objects
#define SIGHT_RANGE_UNIT 50.0f
#define DEFAULT_VISIBILITY_DISTANCE 90.0f // default visible distance, 90 yards on continents
#define DEFAULT_VISIBILITY_INSTANCE 120.0f // default visible distance in instances, 120 yards
#define DEFAULT_VISIBILITY_BGARENAS 180.0f // default visible distance in BG/Arenas, 180 yards
#define DEFAULT_WORLD_OBJECT_SIZE 0.388999998569489f // player size, also currently used (correctly?) for any non Unit world objects
#define DEFAULT_COMBAT_REACH 1.5f
#define MIN_MELEE_REACH 2.0f
#define NOMINAL_MELEE_RANGE 5.0f
#define MELEE_RANGE (NOMINAL_MELEE_RANGE - MIN_MELEE_REACH * 2) //center to center for players
enum TypeMask
{
TYPEMASK_OBJECT = 0x0001,
TYPEMASK_ITEM = 0x0002,
TYPEMASK_CONTAINER = 0x0006, // TYPEMASK_ITEM | 0x0004
TYPEMASK_UNIT = 0x0008, // creature
TYPEMASK_PLAYER = 0x0010,
TYPEMASK_GAMEOBJECT = 0x0020,
TYPEMASK_DYNAMICOBJECT = 0x0040,
TYPEMASK_CORPSE = 0x0080,
TYPEMASK_SEER = TYPEMASK_UNIT | TYPEMASK_DYNAMICOBJECT
};
enum TypeID
{
TYPEID_OBJECT = 0,
TYPEID_ITEM = 1,
TYPEID_CONTAINER = 2,
TYPEID_UNIT = 3,
TYPEID_PLAYER = 4,
TYPEID_GAMEOBJECT = 5,
TYPEID_DYNAMICOBJECT = 6,
TYPEID_CORPSE = 7
};
#define NUM_CLIENT_OBJECT_TYPES 8
uint32 GuidHigh2TypeId(uint32 guid_hi);
enum TempSummonType
{
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN = 1, // despawns after a specified time OR when the creature disappears
TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN = 2, // despawns after a specified time OR when the creature dies
TEMPSUMMON_TIMED_DESPAWN = 3, // despawns after a specified time
TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT = 4, // despawns after a specified time after the creature is out of combat
TEMPSUMMON_CORPSE_DESPAWN = 5, // despawns instantly after death
TEMPSUMMON_CORPSE_TIMED_DESPAWN = 6, // despawns after a specified time after death
TEMPSUMMON_DEAD_DESPAWN = 7, // despawns when the creature disappears
TEMPSUMMON_MANUAL_DESPAWN = 8 // despawns when UnSummon() is called
};
enum PhaseMasks
{
PHASEMASK_NORMAL = 0x00000001,
PHASEMASK_ANYWHERE = 0xFFFFFFFF
};
enum NotifyFlags
{
NOTIFY_NONE = 0x00,
NOTIFY_AI_RELOCATION = 0x01,
NOTIFY_VISIBILITY_CHANGED = 0x02,
NOTIFY_ALL = 0xFF
};
class WorldPacket;
class UpdateData;
class ByteBuffer;
class WorldSession;
class Creature;
class Player;
class UpdateMask;
class InstanceScript;
class GameObject;
class TempSummon;
class Vehicle;
class CreatureAI;
class ZoneScript;
class Unit;
class Transport;
typedef UNORDERED_MAP<Player*, UpdateData> UpdateDataMapType;
class Object
{
public:
virtual ~Object();
bool IsInWorld() const { return m_inWorld; }
virtual void AddToWorld();
virtual void RemoveFromWorld();
uint64 GetGUID() const { return GetUInt64Value(0); }
uint32 GetGUIDLow() const { return GUID_LOPART(GetUInt64Value(0)); }
uint32 GetGUIDMid() const { return GUID_ENPART(GetUInt64Value(0)); }
uint32 GetGUIDHigh() const { return GUID_HIPART(GetUInt64Value(0)); }
const ByteBuffer& GetPackGUID() const { return m_PackGUID; }
uint32 GetEntry() const { return GetUInt32Value(OBJECT_FIELD_ENTRY); }
void SetEntry(uint32 entry) { SetUInt32Value(OBJECT_FIELD_ENTRY, entry); }
TypeID GetTypeId() const { return m_objectTypeId; }
bool isType(uint16 mask) const { return (mask & m_objectType); }
virtual void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const;
void SendUpdateToPlayer(Player* player);
void BuildValuesUpdateBlockForPlayer(UpdateData* data, Player* target) const;
void BuildOutOfRangeUpdateBlock(UpdateData* data) const;
void BuildMovementUpdateBlock(UpdateData* data, uint32 flags = 0) const;
virtual void DestroyForPlayer(Player* target, bool onDeath = false) const;
int32 GetInt32Value(uint16 index) const
{
ASSERT(index < m_valuesCount || PrintIndexError(index, false));
return m_int32Values[index];
}
uint32 GetUInt32Value(uint16 index) const
{
ASSERT(index < m_valuesCount || PrintIndexError(index, false));
return m_uint32Values[index];
}
uint64 GetUInt64Value(uint16 index) const
{
ASSERT(index + 1 < m_valuesCount || PrintIndexError(index, false));
return *((uint64*)&(m_uint32Values[index]));
}
float GetFloatValue(uint16 index) const
{
ASSERT(index < m_valuesCount || PrintIndexError(index, false));
return m_floatValues[index];
}
uint8 GetByteValue(uint16 index, uint8 offset) const
{
ASSERT(index < m_valuesCount || PrintIndexError(index, false));
ASSERT(offset < 4);
return *(((uint8*)&m_uint32Values[index])+offset);
}
uint16 GetUInt16Value(uint16 index, uint8 offset) const
{
ASSERT(index < m_valuesCount || PrintIndexError(index, false));
ASSERT(offset < 2);
return *(((uint16*)&m_uint32Values[index])+offset);
}
void SetInt32Value(uint16 index, int32 value);
void SetUInt32Value(uint16 index, uint32 value);
void UpdateUInt32Value(uint16 index, uint32 value);
void SetUInt64Value(uint16 index, uint64 value);
void SetFloatValue(uint16 index, float value);
void SetByteValue(uint16 index, uint8 offset, uint8 value);
void SetUInt16Value(uint16 index, uint8 offset, uint16 value);
void SetInt16Value(uint16 index, uint8 offset, int16 value) { SetUInt16Value(index, offset, (uint16)value); }
void SetStatFloatValue(uint16 index, float value);
void SetStatInt32Value(uint16 index, int32 value);
bool AddUInt64Value(uint16 index, uint64 value);
bool RemoveUInt64Value(uint16 index, uint64 value);
void ApplyModUInt32Value(uint16 index, int32 val, bool apply);
void ApplyModInt32Value(uint16 index, int32 val, bool apply);
void ApplyModUInt64Value(uint16 index, int32 val, bool apply);
void ApplyModPositiveFloatValue(uint16 index, float val, bool apply);
void ApplyModSignedFloatValue(uint16 index, float val, bool apply);
void ApplyPercentModFloatValue(uint16 index, float val, bool apply)
{
float value = GetFloatValue(index);
ApplyPercentModFloatVar(value, val, apply);
SetFloatValue(index, value);
}
void SetFlag(uint16 index, uint32 newFlag);
void RemoveFlag(uint16 index, uint32 oldFlag);
void ToggleFlag(uint16 index, uint32 flag)
{
if (HasFlag(index, flag))
RemoveFlag(index, flag);
else
SetFlag(index, flag);
}
bool HasFlag(uint16 index, uint32 flag) const
{
if (index >= m_valuesCount && !PrintIndexError(index, false))
return false;
return (m_uint32Values[index] & flag) != 0;
}
void SetByteFlag(uint16 index, uint8 offset, uint8 newFlag);
void RemoveByteFlag(uint16 index, uint8 offset, uint8 newFlag);
void ToggleFlag(uint16 index, uint8 offset, uint8 flag)
{
if (HasByteFlag(index, offset, flag))
RemoveByteFlag(index, offset, flag);
else
SetByteFlag(index, offset, flag);
}
bool HasByteFlag(uint16 index, uint8 offset, uint8 flag) const
{
ASSERT(index < m_valuesCount || PrintIndexError(index, false));
ASSERT(offset < 4);
return (((uint8*)&m_uint32Values[index])[offset] & flag) != 0;
}
void ApplyModFlag(uint16 index, uint32 flag, bool apply)
{
if (apply) SetFlag(index, flag); else RemoveFlag(index, flag);
}
void SetFlag64(uint16 index, uint64 newFlag)
{
uint64 oldval = GetUInt64Value(index);
uint64 newval = oldval | newFlag;
SetUInt64Value(index, newval);
}
void RemoveFlag64(uint16 index, uint64 oldFlag)
{
uint64 oldval = GetUInt64Value(index);
uint64 newval = oldval & ~oldFlag;
SetUInt64Value(index, newval);
}
void ToggleFlag64(uint16 index, uint64 flag)
{
if (HasFlag64(index, flag))
RemoveFlag64(index, flag);
else
SetFlag64(index, flag);
}
bool HasFlag64(uint16 index, uint64 flag) const
{
ASSERT(index < m_valuesCount || PrintIndexError(index, false));
return (GetUInt64Value(index) & flag) != 0;
}
void ApplyModFlag64(uint16 index, uint64 flag, bool apply)
{
if (apply) SetFlag64(index, flag); else RemoveFlag64(index, flag);
}
void ClearUpdateMask(bool remove);
uint16 GetValuesCount() const { return m_valuesCount; }
virtual bool hasQuest(uint32 /* quest_id */) const { return false; }
virtual bool hasInvolvedQuest(uint32 /* quest_id */) const { return false; }
virtual void BuildUpdate(UpdateDataMapType&) {}
void BuildFieldsUpdate(Player*, UpdateDataMapType &) const;
// FG: some hacky helpers
void ForceValuesUpdateAtIndex(uint32);
Player* ToPlayer() { if (GetTypeId() == TYPEID_PLAYER) return reinterpret_cast<Player*>(this); else return NULL; }
Player const* ToPlayer() const { if (GetTypeId() == TYPEID_PLAYER) return (Player const*)((Player*)this); else return NULL; }
Creature* ToCreature() { if (GetTypeId() == TYPEID_UNIT) return reinterpret_cast<Creature*>(this); else return NULL; }
Creature const* ToCreature() const { if (GetTypeId() == TYPEID_UNIT) return (Creature const*)((Creature*)this); else return NULL; }
Unit* ToUnit() { if (GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) return reinterpret_cast<Unit*>(this); else return NULL; }
Unit const* ToUnit() const { if (GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) return (const Unit*)((Unit*)this); else return NULL; }
GameObject* ToGameObject() { if (GetTypeId() == TYPEID_GAMEOBJECT) return reinterpret_cast<GameObject*>(this); else return NULL; }
GameObject const* ToGameObject() const { if (GetTypeId() == TYPEID_GAMEOBJECT) return (const GameObject*)((GameObject*)this); else return NULL; }
Corpse* ToCorpse() { if (GetTypeId() == TYPEID_CORPSE) return reinterpret_cast<Corpse*>(this); else return NULL; }
Corpse const* ToCorpse() const { if (GetTypeId() == TYPEID_CORPSE) return (const Corpse*)((Corpse*)this); else return NULL; }
protected:
Object();
void _InitValues();
void _Create (uint32 guidlow, uint32 entry, HighGuid guidhigh);
std::string _ConcatFields(uint16 startIndex, uint16 size) const;
void _LoadIntoDataField(const char* data, uint32 startOffset, uint32 count);
virtual void _SetUpdateBits(UpdateMask* updateMask, Player* target) const;
virtual void _SetCreateBits(UpdateMask* updateMask, Player* target) const;
void _BuildMovementUpdate(ByteBuffer * data, uint16 flags) const;
void _BuildValuesUpdate(uint8 updatetype, ByteBuffer *data, UpdateMask* updateMask, Player* target) const;
uint16 m_objectType;
TypeID m_objectTypeId;
uint16 m_updateFlag;
union
{
int32 *m_int32Values;
uint32 *m_uint32Values;
float *m_floatValues;
};
bool* _changedFields;
uint16 m_valuesCount;
bool m_objectUpdated;
private:
bool m_inWorld;
ByteBuffer m_PackGUID;
// for output helpfull error messages from asserts
bool PrintIndexError(uint32 index, bool set) const;
Object(const Object&); // prevent generation copy constructor
Object& operator=(Object const&); // prevent generation assigment operator
};
struct Position
{
struct PositionXYZStreamer
{
explicit PositionXYZStreamer(Position& pos) : m_pos(&pos) {}
Position* m_pos;
};
struct PositionXYZOStreamer
{
explicit PositionXYZOStreamer(Position& pos) : m_pos(&pos) {}
Position* m_pos;
};
float m_positionX;
float m_positionY;
float m_positionZ;
float m_orientation;
void Relocate(float x, float y)
{ m_positionX = x; m_positionY = y;}
void Relocate(float x, float y, float z)
{ m_positionX = x; m_positionY = y; m_positionZ = z; }
void Relocate(float x, float y, float z, float orientation)
{ m_positionX = x; m_positionY = y; m_positionZ = z; m_orientation = orientation; }
void Relocate(const Position &pos)
{ m_positionX = pos.m_positionX; m_positionY = pos.m_positionY; m_positionZ = pos.m_positionZ; m_orientation = pos.m_orientation; }
void Relocate(const Position* pos)
{ m_positionX = pos->m_positionX; m_positionY = pos->m_positionY; m_positionZ = pos->m_positionZ; m_orientation = pos->m_orientation; }
void RelocateOffset(const Position &offset);
void SetOrientation(float orientation)
{ m_orientation = orientation; }
float GetPositionX() const { return m_positionX; }
float GetPositionY() const { return m_positionY; }
float GetPositionZ() const { return m_positionZ; }
float GetOrientation() const { return m_orientation; }
void GetPosition(float &x, float &y) const
{ x = m_positionX; y = m_positionY; }
void GetPosition(float &x, float &y, float &z) const
{ x = m_positionX; y = m_positionY; z = m_positionZ; }
void GetPosition(float &x, float &y, float &z, float &o) const
{ x = m_positionX; y = m_positionY; z = m_positionZ; o = m_orientation; }
void GetPosition(Position* pos) const
{
if (pos)
pos->Relocate(m_positionX, m_positionY, m_positionZ, m_orientation);
}
Position::PositionXYZStreamer PositionXYZStream()
{
return PositionXYZStreamer(*this);
}
Position::PositionXYZOStreamer PositionXYZOStream()
{
return PositionXYZOStreamer(*this);
}
bool IsPositionValid() const;
float GetExactDist2dSq(float x, float y) const
{ float dx = m_positionX - x; float dy = m_positionY - y; return dx*dx + dy*dy; }
float GetExactDist2d(const float x, const float y) const
{ return sqrt(GetExactDist2dSq(x, y)); }
float GetExactDist2dSq(const Position* pos) const
{ float dx = m_positionX - pos->m_positionX; float dy = m_positionY - pos->m_positionY; return dx*dx + dy*dy; }
float GetExactDist2d(const Position* pos) const
{ return sqrt(GetExactDist2dSq(pos)); }
float GetExactDistSq(float x, float y, float z) const
{ float dz = m_positionZ - z; return GetExactDist2dSq(x, y) + dz*dz; }
float GetExactDist(float x, float y, float z) const
{ return sqrt(GetExactDistSq(x, y, z)); }
float GetExactDistSq(const Position* pos) const
{ float dx = m_positionX - pos->m_positionX; float dy = m_positionY - pos->m_positionY; float dz = m_positionZ - pos->m_positionZ; return dx*dx + dy*dy + dz*dz; }
float GetExactDist(const Position* pos) const
{ return sqrt(GetExactDistSq(pos)); }
void GetPositionOffsetTo(const Position & endPos, Position & retOffset) const;
float GetAngle(const Position* pos) const;
float GetAngle(float x, float y) const;
float GetRelativeAngle(const Position* pos) const
{ return GetAngle(pos) - m_orientation; }
float GetRelativeAngle(float x, float y) const { return GetAngle(x, y) - m_orientation; }
void GetSinCos(float x, float y, float &vsin, float &vcos) const;
bool IsInDist2d(float x, float y, float dist) const
{ return GetExactDist2dSq(x, y) < dist * dist; }
bool IsInDist2d(const Position* pos, float dist) const
{ return GetExactDist2dSq(pos) < dist * dist; }
bool IsInDist(float x, float y, float z, float dist) const
{ return GetExactDistSq(x, y, z) < dist * dist; }
bool IsInDist(const Position* pos, float dist) const
{ return GetExactDistSq(pos) < dist * dist; }
bool HasInArc(float arcangle, const Position* pos) const;
bool HasInLine(WorldObject const* target, float width) const;
std::string ToString() const;
};
ByteBuffer& operator>>(ByteBuffer& buf, Position::PositionXYZOStreamer const& streamer);
ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYZStreamer const& streamer);
ByteBuffer& operator>>(ByteBuffer& buf, Position::PositionXYZStreamer const& streamer);
ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYZOStreamer const& streamer);
struct MovementInfo
{
// common
uint64 guid;
uint32 flags;
uint16 flags2;
Position pos;
uint32 time;
// transport
uint64 t_guid;
Position t_pos;
uint32 t_time;
uint32 t_time2;
int8 t_seat;
// swimming/flying
float pitch;
// falling
uint32 fallTime;
// jumping
float j_zspeed, j_sinAngle, j_cosAngle, j_xyspeed;
// spline
float splineElevation;
MovementInfo()
{
pos.Relocate(0, 0, 0, 0);
guid = 0;
flags = 0;
flags2 = 0;
time = t_time = t_time2 = fallTime = 0;
splineElevation = 0;
pitch = j_zspeed = j_sinAngle = j_cosAngle = j_xyspeed = 0.0f;
t_guid = 0;
t_pos.Relocate(0, 0, 0, 0);
t_seat = -1;
}
uint32 GetMovementFlags() { return flags; }
void SetMovementFlags(uint32 flag) { flags = flag; }
void AddMovementFlag(uint32 flag) { flags |= flag; }
void RemoveMovementFlag(uint32 flag) { flags &= ~flag; }
bool HasMovementFlag(uint32 flag) const { return flags & flag; }
uint16 GetExtraMovementFlags() { return flags2; }
void AddExtraMovementFlag(uint16 flag) { flags2 |= flag; }
bool HasExtraMovementFlag(uint16 flag) const { return flags2 & flag; }
void SetFallTime(uint32 time) { fallTime = time; }
void OutDebug();
};
#define MAPID_INVALID 0xFFFFFFFF
class WorldLocation : public Position
{
public:
explicit WorldLocation(uint32 _mapid = MAPID_INVALID, float _x = 0, float _y = 0, float _z = 0, float _o = 0)
: m_mapId(_mapid) { Relocate(_x, _y, _z, _o); }
WorldLocation(const WorldLocation &loc) { WorldRelocate(loc); }
void WorldRelocate(const WorldLocation &loc)
{ m_mapId = loc.GetMapId(); Relocate(loc); }
uint32 GetMapId() const { return m_mapId; }
uint32 m_mapId;
};
template<class T>
class GridObject
{
public:
bool IsInGrid() const { return _gridRef.isValid(); }
void AddToGrid(GridRefManager<T>& m) { ASSERT(!IsInGrid()); _gridRef.link(&m, (T*)this); }
void RemoveFromGrid() { ASSERT(IsInGrid()); _gridRef.unlink(); }
private:
GridReference<T> _gridRef;
};
template <class T_VALUES, class T_FLAGS, class FLAG_TYPE, uint8 ARRAY_SIZE>
class FlaggedValuesArray32
{
public:
FlaggedValuesArray32()
{
memset(&m_values, 0x00, sizeof(T_VALUES) * ARRAY_SIZE);
m_flags = 0;
}
T_FLAGS GetFlags() const { return m_flags; }
bool HasFlag(FLAG_TYPE flag) const { return m_flags & (1 << flag); }
void AddFlag(FLAG_TYPE flag) { m_flags |= (1 << flag); }
void DelFlag(FLAG_TYPE flag) { m_flags &= ~(1 << flag); }
T_VALUES GetValue(FLAG_TYPE flag) const { return m_values[flag]; }
void SetValue(FLAG_TYPE flag, T_VALUES value) { m_values[flag] = value; }
void AddValue(FLAG_TYPE flag, T_VALUES value) { m_values[flag] += value; }
private:
T_VALUES m_values[ARRAY_SIZE];
T_FLAGS m_flags;
};
class WorldObject : public Object, public WorldLocation
{
protected:
explicit WorldObject(bool isWorldObject); //note: here it means if it is in grid object list or world object list
public:
virtual ~WorldObject();
virtual void Update (uint32 /*time_diff*/) { }
void _Create(uint32 guidlow, HighGuid guidhigh, uint32 phaseMask);
virtual void RemoveFromWorld()
{
if (!IsInWorld())
return;
DestroyForNearbyPlayers();
Object::RemoveFromWorld();
}
void GetNearPoint2D(float &x, float &y, float distance, float absAngle) const;
void GetNearPoint(WorldObject const* searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle) const;
void GetClosePoint(float &x, float &y, float &z, float size, float distance2d = 0, float angle = 0) const
{
// angle calculated from current orientation
GetNearPoint(NULL, x, y, z, size, distance2d, GetOrientation() + angle);
}
void MovePosition(Position &pos, float dist, float angle);
void GetNearPosition(Position &pos, float dist, float angle)
{
GetPosition(&pos);
MovePosition(pos, dist, angle);
}
void MovePositionToFirstCollision(Position &pos, float dist, float angle);
void GetFirstCollisionPosition(Position &pos, float dist, float angle)
{
GetPosition(&pos);
MovePositionToFirstCollision(pos, dist, angle);
}
void GetRandomNearPosition(Position &pos, float radius)
{
GetPosition(&pos);
MovePosition(pos, radius * (float)rand_norm(), (float)rand_norm() * static_cast<float>(2 * M_PI));
}
void GetContactPoint(const WorldObject* obj, float &x, float &y, float &z, float distance2d = CONTACT_DISTANCE) const
{
// angle to face `obj` to `this` using distance includes size of `obj`
GetNearPoint(obj, x, y, z, obj->GetObjectSize(), distance2d, GetAngle(obj));
}
float GetObjectSize() const
{
return (m_valuesCount > UNIT_FIELD_COMBATREACH) ? m_floatValues[UNIT_FIELD_COMBATREACH] : DEFAULT_WORLD_OBJECT_SIZE;
}
void UpdateGroundPositionZ(float x, float y, float &z) const;
void UpdateAllowedPositionZ(float x, float y, float &z) const;
void GetRandomPoint(const Position &srcPos, float distance, float &rand_x, float &rand_y, float &rand_z) const;
void GetRandomPoint(const Position &srcPos, float distance, Position &pos) const
{
float x, y, z;
GetRandomPoint(srcPos, distance, x, y, z);
pos.Relocate(x, y, z, GetOrientation());
}
uint32 GetInstanceId() const { return m_InstanceId; }
virtual void SetPhaseMask(uint32 newPhaseMask, bool update);
uint32 GetPhaseMask() const { return m_phaseMask; }
bool InSamePhase(WorldObject const* obj) const { return InSamePhase(obj->GetPhaseMask()); }
bool InSamePhase(uint32 phasemask) const { return (GetPhaseMask() & phasemask); }
uint32 GetZoneId() const;
uint32 GetAreaId() const;
void GetZoneAndAreaId(uint32& zoneid, uint32& areaid) const;
InstanceScript* GetInstanceScript();
const char* GetName() const { return m_name.c_str(); }
void SetName(const std::string& newname) { m_name=newname; }
virtual const char* GetNameForLocaleIdx(LocaleConstant /*locale_idx*/) const { return GetName(); }
float GetDistance(const WorldObject* obj) const
{
float d = GetExactDist(obj) - GetObjectSize() - obj->GetObjectSize();
return d > 0.0f ? d : 0.0f;
}
float GetDistance(const Position &pos) const
{
float d = GetExactDist(&pos) - GetObjectSize();
return d > 0.0f ? d : 0.0f;
}
float GetDistance(float x, float y, float z) const
{
float d = GetExactDist(x, y, z) - GetObjectSize();
return d > 0.0f ? d : 0.0f;
}
float GetDistance2d(const WorldObject* obj) const
{
float d = GetExactDist2d(obj) - GetObjectSize() - obj->GetObjectSize();
return d > 0.0f ? d : 0.0f;
}
float GetDistance2d(float x, float y) const
{
float d = GetExactDist2d(x, y) - GetObjectSize();
return d > 0.0f ? d : 0.0f;
}
float GetDistanceZ(const WorldObject* obj) const;
bool IsSelfOrInSameMap(const WorldObject* obj) const
{
if (this == obj)
return true;
return IsInMap(obj);
}
bool IsInMap(const WorldObject* obj) const
{
if (obj)
return IsInWorld() && obj->IsInWorld() && (GetMap() == obj->GetMap()) && InSamePhase(obj);
return false;
}
bool IsWithinDist3d(float x, float y, float z, float dist) const
{ return IsInDist(x, y, z, dist + GetObjectSize()); }
bool IsWithinDist3d(const Position* pos, float dist) const
{ return IsInDist(pos, dist + GetObjectSize()); }
bool IsWithinDist2d(float x, float y, float dist) const
{ return IsInDist2d(x, y, dist + GetObjectSize()); }
bool IsWithinDist2d(const Position* pos, float dist) const
{ return IsInDist2d(pos, dist + GetObjectSize()); }
// use only if you will sure about placing both object at same map
bool IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D = true) const
{
return obj && _IsWithinDist(obj, dist2compare, is3D);
}
bool IsWithinDistInMap(WorldObject const* obj, float dist2compare, bool is3D = true) const
{
return obj && IsInMap(obj) && _IsWithinDist(obj, dist2compare, is3D);
}
bool IsWithinLOS(float x, float y, float z) const;
bool IsWithinLOSInMap(const WorldObject* obj) const;
bool GetDistanceOrder(WorldObject const* obj1, WorldObject const* obj2, bool is3D = true) const;
bool IsInRange(WorldObject const* obj, float minRange, float maxRange, bool is3D = true) const;
bool IsInRange2d(float x, float y, float minRange, float maxRange) const;
bool IsInRange3d(float x, float y, float z, float minRange, float maxRange) const;
bool isInFront(WorldObject const* target, float arc = M_PI) const;
bool isInFront1(WorldObject const* target, float distance, float arc = M_PI) const;
bool isInBack(WorldObject const* target, float arc = M_PI) const;
bool IsInBetween(const WorldObject* obj1, const WorldObject* obj2, float size = 0) const;
virtual void CleanupsBeforeDelete(bool finalCleanup = true); // used in destructor or explicitly before mass creature delete to remove cross-references to already deleted units
virtual void SendMessageToSet(WorldPacket* data, bool self);
virtual void SendMessageToSetInRange(WorldPacket* data, float dist, bool self);
virtual void SendMessageToSet(WorldPacket* data, Player const* skipped_rcvr);
virtual uint8 getLevelForTarget(WorldObject const* /*target*/) const { return 1; }
void MonsterSay(const char* text, uint32 language, uint64 TargetGuid);
void MonsterYell(const char* text, uint32 language, uint64 TargetGuid);
void MonsterTextEmote(const char* text, uint64 TargetGuid, bool IsBossEmote = false);
void MonsterWhisper(const char* text, uint64 receiver, bool IsBossWhisper = false);
void MonsterSay(int32 textId, uint32 language, uint64 TargetGuid);
void MonsterYell(int32 textId, uint32 language, uint64 TargetGuid);
void MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote = false);
void MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisper = false);
void MonsterYellToZone(int32 textId, uint32 language, uint64 TargetGuid);
void BuildMonsterChat(WorldPacket* data, uint8 msgtype, char const* text, uint32 language, char const* name, uint64 TargetGuid) const;
void PlayDistanceSound(uint32 sound_id, Player* target = NULL);
void PlayDirectSound(uint32 sound_id, Player* target = NULL);
void SendObjectDeSpawnAnim(uint64 guid);
virtual void SaveRespawnTime() {}
void AddObjectToRemoveList();
float GetGridActivationRange() const;
float GetVisibilityRange() const;
float GetSightRange(const WorldObject* target = NULL) const;
bool canSeeOrDetect(WorldObject const* obj, bool ignoreStealth = false, bool distanceCheck = false) const;
FlaggedValuesArray32<int32, uint32, StealthType, TOTAL_STEALTH_TYPES> m_stealth;
FlaggedValuesArray32<int32, uint32, StealthType, TOTAL_STEALTH_TYPES> m_stealthDetect;
FlaggedValuesArray32<int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPES> m_invisibility;
FlaggedValuesArray32<int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPES> m_invisibilityDetect;
FlaggedValuesArray32<int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES> m_serverSideVisibility;
FlaggedValuesArray32<int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES> m_serverSideVisibilityDetect;
// Low Level Packets
void SendPlaySound(uint32 Sound, bool OnlySelf);
virtual void SetMap(Map* map);
virtual void ResetMap();
Map* GetMap() const { ASSERT(m_currMap); return m_currMap; }
Map* FindMap() const { return m_currMap; }
//used to check all object's GetMap() calls when object is not in world!
//this function should be removed in nearest time...
Map const* GetBaseMap() const;
void SetZoneScript();
ZoneScript* GetZoneScript() const { return m_zoneScript; }
TempSummon* SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0, uint32 vehId = 0) const;
TempSummon* SummonCreature(uint32 id, float x, float y, float z, float ang = 0, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0)
{
if (!x && !y && !z)
{
GetClosePoint(x, y, z, GetObjectSize());
ang = GetOrientation();
}
Position pos;
pos.Relocate(x, y, z, ang);
return SummonCreature(id, pos, spwtype, despwtime, 0);
}
GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime);
Creature* SummonTrigger(float x, float y, float z, float ang, uint32 dur, CreatureAI* (*GetAI)(Creature*) = NULL);
Creature* FindNearestCreature(uint32 entry, float range, bool alive = true) const;
GameObject* FindNearestGameObject(uint32 entry, float range) const;
Player* FindNearestPlayer(float range, bool alive = true);
std::list<Player*> GetNearestPlayersList(float range, bool alive = true);
void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& lList, uint32 uiEntry, float fMaxSearchRange) const;
void GetCreatureListWithEntryInGrid(std::list<Creature*>& lList, uint32 uiEntry, float fMaxSearchRange) const;
void DestroyForNearbyPlayers();
virtual void UpdateObjectVisibility(bool forced = true);
void BuildUpdate(UpdateDataMapType&);
//relocation and visibility system functions
void AddToNotify(uint16 f) { m_notifyflags |= f;}
bool isNeedNotify(uint16 f) const { return m_notifyflags & f;}
uint16 GetNotifyFlags() const { return m_notifyflags; }
bool NotifyExecuted(uint16 f) const { return m_executed_notifies & f;}
void SetNotified(uint16 f) { m_executed_notifies |= f;}
void ResetAllNotifies() { m_notifyflags = 0; m_executed_notifies = 0; }
bool isActiveObject() const { return m_isActive; }
void setActive(bool isActiveObject);
void SetWorldObject(bool apply);
bool IsPermanentWorldObject() const { return m_isWorldObject; }
bool IsWorldObject() const;
template<class NOTIFIER> void VisitNearbyObject(float const& radius, NOTIFIER& notifier) const { if (IsInWorld()) GetMap()->VisitAll(GetPositionX(), GetPositionY(), radius, notifier); }
template<class NOTIFIER> void VisitNearbyGridObject(float const& radius, NOTIFIER& notifier) const { if (IsInWorld()) GetMap()->VisitGrid(GetPositionX(), GetPositionY(), radius, notifier); }
template<class NOTIFIER> void VisitNearbyWorldObject(float const& radius, NOTIFIER& notifier) const { if (IsInWorld()) GetMap()->VisitWorld(GetPositionX(), GetPositionY(), radius, notifier); }
#ifdef MAP_BASED_RAND_GEN
int32 irand(int32 min, int32 max) const { return int32 (GetMap()->mtRand.randInt(max - min)) + min; }
uint32 urand(uint32 min, uint32 max) const { return GetMap()->mtRand.randInt(max - min) + min;}
int32 rand32() const { return GetMap()->mtRand.randInt();}
double rand_norm() const { return GetMap()->mtRand.randExc();}
double rand_chance() const { return GetMap()->mtRand.randExc(100.0);}
#endif
uint32 LastUsedScriptID;
// Transports
Transport* GetTransport() const { return m_transport; }
virtual float GetTransOffsetX() const { return 0; }
virtual float GetTransOffsetY() const { return 0; }
virtual float GetTransOffsetZ() const { return 0; }
virtual float GetTransOffsetO() const { return 0; }
virtual uint32 GetTransTime() const { return 0; }
virtual int8 GetTransSeat() const { return -1; }
virtual uint64 GetTransGUID() const;
void SetTransport(Transport* t) { m_transport = t; }
MovementInfo m_movementInfo;
protected:
std::string m_name;
bool m_isActive;
const bool m_isWorldObject;
ZoneScript* m_zoneScript;
// transports
Transport* m_transport;
//these functions are used mostly for Relocate() and Corpse/Player specific stuff...
//use them ONLY in LoadFromDB()/Create() funcs and nowhere else!
//mapId/instanceId should be set in SetMap() function!
void SetLocationMapId(uint32 _mapId) { m_mapId = _mapId; }
void SetLocationInstanceId(uint32 _instanceId) { m_InstanceId = _instanceId; }
virtual bool IsNeverVisible() const { return !IsInWorld(); }
virtual bool IsAlwaysVisibleFor(WorldObject const* /*seer*/) const { return false; }
virtual bool IsInvisibleDueToDespawn() const { return false; }
//difference from IsAlwaysVisibleFor: 1. after distance check; 2. use owner or charmer as seer
virtual bool IsAlwaysDetectableFor(WorldObject const* /*seer*/) const { return false; }
private:
Map* m_currMap; //current object's Map location
//uint32 m_mapId; // object at map with map_id
uint32 m_InstanceId; // in map copy with instance id
uint32 m_phaseMask; // in area phase state
uint16 m_notifyflags;
uint16 m_executed_notifies;
virtual bool _IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D) const;
bool CanNeverSee(WorldObject const* obj) const { return GetMap() != obj->GetMap() || !InSamePhase(obj); }
virtual bool CanAlwaysSee(WorldObject const* /*obj*/) const { return false; }
bool CanDetect(WorldObject const* obj, bool ignoreStealth) const;
bool CanDetectInvisibilityOf(WorldObject const* obj) const;
bool CanDetectStealthOf(WorldObject const* obj) const;
};
namespace Trinity
{
template<class T>
void RandomResizeList(std::list<T> &_list, uint32 _size)
{
size_t list_size = _list.size();
while (list_size > _size)
{
typename std::list<T>::iterator itr = _list.begin();
std::advance(itr, urand(0, list_size - 1));
_list.erase(itr);
--list_size;
}
}
// Binary predicate to sort WorldObjects based on the distance to a reference WorldObject
class ObjectDistanceOrderPred
{
public:
ObjectDistanceOrderPred(const WorldObject* pRefObj, bool ascending = true) : m_refObj(pRefObj), m_ascending(ascending) {}
bool operator()(const WorldObject* pLeft, const WorldObject* pRight) const
{
return m_ascending ? m_refObj->GetDistanceOrder(pLeft, pRight) : !m_refObj->GetDistanceOrder(pLeft, pRight);
}
private:
const WorldObject* m_refObj;
const bool m_ascending;
};
}
#endif
| dk123546/trinity-mmaps | src/server/game/Entities/Object/Object.h | C | gpl-2.0 | 38,833 |
/* Copyright_License {
XCSoar Glide Computer - http://www.xcsoar.org/
Copyright (C) 2000-2016 The XCSoar Project
A detailed list of copyright holders can be found in the file "AUTHORS".
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, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
}
*/
package org.LK8000;
import android.content.Context;
import android.content.Intent;
import android.content.BroadcastReceiver;
import android.os.BatteryManager;
class BatteryReceiver extends BroadcastReceiver {
private static native void setBatteryPercent(int level, int plugged, int status);
@Override public void onReceive(Context context, Intent intent) {
int level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0);
int plugged = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0);
int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, 0);
setBatteryPercent(level, plugged, status);
}
}
| brunotl/LK8000 | android/src/org/LK8000/BatteryReceiver.java | Java | gpl-2.0 | 1,524 |
//
// EnemyFactory.h
// TowerDefense
//
// Created by jowu on 15/11/30.
//
//
#ifndef __TowerDefense__EnemyFactory__
#define __TowerDefense__EnemyFactory__
#include "cocos2d.h"
#include "Enemy.h"
class EnemyFactory
{
public:
static Enemy* create(EnemyID id);
};
#endif /* defined(__TowerDefense__EnemyFactory__) */
| ODelbert/TowerDefense | Classes/Enemy/EnemyFactory.h | C | gpl-2.0 | 326 |
/* Copyright (c) 2008-2011, Hisilicon Tech. Co., Ltd. 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 Code Aurora Forum, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* 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.
*
*/
#ifndef K3_FB_DEF_H
#define K3_FB_DEF_H
#include <linux/delay.h>
#include <linux/string.h>
#include <linux/platform_device.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <asm/bug.h>
#ifndef MAX
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
#endif
#ifndef MIN
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
#endif
/* align */
#ifndef ALIGN_DOWN
#define ALIGN_DOWN(val, al) ((val) & ~((al)-1))
#endif
#ifndef ALIGN_UP
#define ALIGN_UP(val, al) (((val) + ((al)-1)) & ~((al)-1))
#endif
#ifndef BIT
#define BIT(x) (1<<(x))
#endif
/*--------------------------------------------------------------------------*/
#define NDEBUG 0
#if NDEBUG
#define k3fb_logd(fmt, ...)
#else
#define k3fb_logd(fmt, ...) \
pr_debug("[k3fb]%s: "fmt, __func__, ##__VA_ARGS__)
#endif
#define k3fb_logi(fmt, ...) \
pr_info("[k3fb]%s: "fmt, __func__, ##__VA_ARGS__)
#define k3fb_logw(fmt, ...) \
pr_warn("[k3fb]%s:"fmt, __func__, ##__VA_ARGS__)
#define k3fb_loge(fmt, ...) \
pr_err("[k3fb]%s: "fmt, __func__, ##__VA_ARGS__)
/*--------------------------------------------------------------------------*/
#ifdef PC_UT_TEST_ON
#define STATIC
extern volatile unsigned int g_pc_ut_reg_data[0x2000];
#define outp32(addr, val) ( g_pc_ut_reg_data[addr] = val )
#define outp16(addr, val)
#define outp8(addr, val)
#define outp(addr, val) outp32(addr, val)
#define inp32(addr) ( g_pc_ut_reg_data[addr] )
#define inp16(addr)
#define inp8(addr)
#define inp(addr)
#define inpw(port)
#define outpw(port, val)
#define inpdw(port)
#define outpdw(port, val)
#else
#define STATIC static
#define outp32(addr, val) writel(val, addr)
#define outp16(addr, val) writew(val, addr)
#define outp8(addr, val) writeb(val, addr)
#define outp(addr, val) outp32(addr, val)
#define inp32(addr) readl(addr)
#define inp16(addr) readw(addr)
#define inp8(addr) readb(addr)
#define inp(addr) inp32(addr)
#define inpw(port) readw(port)
#define outpw(port, val) writew(val, port)
#define inpdw(port) readl(port)
#define outpdw(port, val) writel(val, port)
#endif
#ifdef CONFIG_DEBUG_FS
void k3fb_logi_vsync_debugfs (const char* fmt, ...);
void k3fb_logi_display_debugfs(const char* fmt, ...);
void k3fb_logi_backlight_debugfs(const char* fmt, ...);
#else
#define k3fb_logi_vsync_debugfs(fmt, ...)
#define k3fb_logi_display_debugfs(fmt, ...)
#define k3fb_logi_backlight_debugfs(fmt, ...)
#endif
#endif /* K3_FB_DEF_H */
| araca/Zen-Kernel-Huawei-P7 | drivers/video/hi6620/k3_fb_def.h | C | gpl-2.0 | 4,156 |
/* $Id: exception.c 2878 2009-08-14 10:41:00Z bennylp $ */
/*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
*
* 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, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "test.h"
/**
* \page page_pjlib_exception_test Test: Exception Handling
*
* This file provides implementation of \b exception_test(). It tests the
* functionality of the exception handling API.
*
* @note This test use static ID not acquired through proper registration.
* This is not recommended, since it may create ID collissions.
*
* \section exception_test_sec Scope of the Test
*
* Some scenarios tested:
* - no exception situation
* - basic TRY/CATCH
* - multiple exception handlers
* - default handlers
*
*
* This file is <b>pjlib-test/exception.c</b>
*
* \include pjlib-test/exception.c
*/
#if INCLUDE_EXCEPTION_TEST
#include <pjlib.h>
#define ID_1 1
#define ID_2 2
static int throw_id_1(void)
{
PJ_THROW( ID_1 );
PJ_UNREACHED(return -1;)
}
static int throw_id_2(void)
{
PJ_THROW( ID_2 );
PJ_UNREACHED(return -1;)
}
static int try_catch_test(void)
{
PJ_USE_EXCEPTION;
int rc = -200;
PJ_TRY {
PJ_THROW(ID_1);
}
PJ_CATCH_ANY {
rc = 0;
}
PJ_END;
return rc;
}
static int throw_in_handler(void)
{
PJ_USE_EXCEPTION;
int rc = 0;
PJ_TRY {
PJ_THROW(ID_1);
}
PJ_CATCH_ANY {
if (PJ_GET_EXCEPTION() != ID_1)
rc = -300;
else
PJ_THROW(ID_2);
}
PJ_END;
return rc;
}
static int return_in_handler(void)
{
PJ_USE_EXCEPTION;
PJ_TRY {
PJ_THROW(ID_1);
}
PJ_CATCH_ANY {
return 0;
}
PJ_END;
return -400;
}
static int test(void)
{
int rc = 0;
PJ_USE_EXCEPTION;
/*
* No exception situation.
*/
PJ_TRY {
rc = rc;
}
PJ_CATCH_ANY {
rc = -3;
}
PJ_END;
if (rc != 0)
return rc;
/*
* Basic TRY/CATCH
*/
PJ_TRY {
rc = throw_id_1();
// should not reach here.
rc = -10;
}
PJ_CATCH_ANY {
int id = PJ_GET_EXCEPTION();
if (id != ID_1) {
PJ_LOG(3,("", "...error: got unexpected exception %d (%s)",
id, pj_exception_id_name(id)));
if (!rc) rc = -20;
}
}
PJ_END;
if (rc != 0)
return rc;
/*
* Multiple exceptions handlers
*/
PJ_TRY {
rc = throw_id_2();
// should not reach here.
rc = -25;
}
PJ_CATCH_ANY {
switch (PJ_GET_EXCEPTION()) {
case ID_1:
if (!rc) rc = -30; break;
case ID_2:
if (!rc) rc = 0; break;
default:
if (!rc) rc = -40;
break;
}
}
PJ_END;
if (rc != 0)
return rc;
/*
* Test default handler.
*/
PJ_TRY {
rc = throw_id_1();
// should not reach here
rc = -50;
}
PJ_CATCH_ANY {
switch (PJ_GET_EXCEPTION()) {
case ID_1:
if (!rc) rc = 0;
break;
default:
if (!rc) rc = -60;
break;
}
}
PJ_END;
if (rc != 0)
return rc;
/*
* Nested handlers
*/
PJ_TRY {
rc = try_catch_test();
}
PJ_CATCH_ANY {
rc = -70;
}
PJ_END;
if (rc != 0)
return rc;
/*
* Throwing exception inside handler
*/
rc = -80;
PJ_TRY {
int rc2;
rc2 = throw_in_handler();
if (rc2)
rc = rc2;
}
PJ_CATCH_ANY {
if (PJ_GET_EXCEPTION() == ID_2) {
rc = 0;
} else {
rc = -90;
}
}
PJ_END;
if (rc != 0)
return rc;
/*
* Return from handler. Returning from the function inside a handler
* should be okay (though returning from the function inside the
* PJ_TRY block IS NOT OKAY!!). We want to test to see if handler
* is cleaned up properly, but not sure how to do this.
*/
PJ_TRY {
int rc2;
rc2 = return_in_handler();
if (rc2)
rc = rc2;
}
PJ_CATCH_ANY {
rc = -100;
}
PJ_END;
return 0;
}
int exception_test(void)
{
int i, rc;
enum { LOOP = 10 };
for (i=0; i<LOOP; ++i) {
if ((rc=test()) != 0) {
PJ_LOG(3,("", "...failed at i=%d (rc=%d)", i, rc));
return rc;
}
}
return 0;
}
#else
/* To prevent warning about "translation unit is empty"
* when this test is disabled.
*/
int dummy_exception_test;
#endif /* INCLUDE_EXCEPTION_TEST */
| kaaustubh/pjsip | pjlib/src/pjlib-test/exception.c | C | gpl-2.0 | 4,926 |
// Copyright (c) Microsoft Corporation. All rights reserved.
//Copyright (c) Microsoft Corporation. All rights reserved.
using System;
using System.Collections.Generic;
using System.Text;
namespace Microsoft.SDK.Samples.VistaBridge.Library
{
/// <summary>
/// Indicates that the implementing class is a dialog that can host
/// customizable dialog controls (subclasses of DialogControl).
/// </summary>
internal interface IDialogControlHost
{
// Handle notifications of pseudo-controls being added
// or removed from the collection.
// PreFilter should throw if a control cannot
// be added/removed in the dialog's current state.
// PostProcess should pass on changes to native control,
// if appropriate.
bool IsCollectionChangeAllowed();
void ApplyCollectionChanged();
// Handle notifications of individual child
// pseudo-controls' properties changing..
// Prefilter should throw if the property
// cannot be set in the dialog's current state.
// PostProcess should pass on changes to native control,
// if appropriate.
bool IsControlPropertyChangeAllowed(string propertyName, DialogControl control);
void ApplyControlPropertyChange(string propertyName, DialogControl control);
}
} | totalretribution/Blurip | vistabridgelibrary/dialogs/idialogcontrolhost.cs | C# | gpl-2.0 | 1,386 |
'''
Created on 17/2/2015
@author: PC06
Primer cambio en el proyecto
'''
from include import app
if __name__ == '__main__':
app.run("127.0.0.1", 9000, debug=True) | javiteri/reposdmpdos | miltonvz/run.py | Python | gpl-2.0 | 176 |
cmd_drivers/usb/gadget/g_ether.o := arm-poky-linux-gnueabi-ld -EL -r -o drivers/usb/gadget/g_ether.o drivers/usb/gadget/ether.o
| heyoufei2/yocto3.14.38_kernel | drivers/usb/gadget/.g_ether.o.cmd | Batchfile | gpl-2.0 | 132 |
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
This software is distributed under the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Axel Kohlmeyer (Temple U)
------------------------------------------------------------------------- */
#include "omp_compat.h"
#include "pair_lj_cut_tip4p_long_omp.h"
#include <cmath>
#include "atom.h"
#include "domain.h"
#include "comm.h"
#include "force.h"
#include "neighbor.h"
#include "error.h"
#include "memory.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
#define A2 -0.284496736
#define A3 1.421413741
#define A4 -1.453152027
#define A5 1.061405429
/* ---------------------------------------------------------------------- */
PairLJCutTIP4PLongOMP::PairLJCutTIP4PLongOMP(LAMMPS *lmp) :
PairLJCutTIP4PLong(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
newsite_thr = NULL;
hneigh_thr = NULL;
// TIP4P cannot compute virial as F dot r
// due to finding bonded H atoms which are not near O atom
no_virial_fdotr_compute = 1;
}
/* ---------------------------------------------------------------------- */
PairLJCutTIP4PLongOMP::~PairLJCutTIP4PLongOMP()
{
memory->destroy(hneigh_thr);
memory->destroy(newsite_thr);
}
/* ---------------------------------------------------------------------- */
void PairLJCutTIP4PLongOMP::compute(int eflag, int vflag)
{
ev_init(eflag,vflag);
const int nlocal = atom->nlocal;
const int nall = nlocal + atom->nghost;
// reallocate hneigh_thr & newsite_thr if necessary
// initialize hneigh_thr[0] to -1 on steps when reneighboring occurred
// initialize hneigh_thr[2] to 0 every step
if (atom->nmax > nmax) {
nmax = atom->nmax;
memory->destroy(hneigh_thr);
memory->create(hneigh_thr,nmax,"pair:hneigh_thr");
memory->destroy(newsite_thr);
memory->create(newsite_thr,nmax,"pair:newsite_thr");
}
int i;
// tag entire list as completely invalid after a neighbor
// list update, since that can change the order of atoms.
if (neighbor->ago == 0)
for (i = 0; i < nall; i++) hneigh_thr[i].a = -1;
// indicate that the coordinates for the M point need to
// be updated. this needs to be done in every step.
for (i = 0; i < nall; i++) hneigh_thr[i].t = 0;
const int nthreads = comm->nthreads;
const int inum = list->inum;
#if defined(_OPENMP)
#pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(eflag,vflag)
#endif
{
int ifrom, ito, tid;
loop_setup_thr(ifrom, ito, tid, inum, nthreads);
ThrData *thr = fix->get_thr(tid);
thr->timer(Timer::START);
ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr);
if (ncoultablebits) {
if (evflag) {
if (eflag) {
if (vflag) eval<1,1,1,1>(ifrom, ito, thr);
else eval<1,1,1,0>(ifrom, ito, thr);
} else {
if (vflag) eval<1,1,0,1>(ifrom, ito, thr);
else eval<1,1,0,0>(ifrom, ito, thr);
}
} else eval<1,0,0,0>(ifrom, ito, thr);
} else {
if (evflag) {
if (eflag) {
if (vflag) eval<0,1,1,1>(ifrom, ito, thr);
else eval<0,1,1,0>(ifrom, ito, thr);
} else {
if (vflag) eval<0,1,0,1>(ifrom, ito, thr);
else eval<0,1,0,0>(ifrom, ito, thr);
}
} else eval<0,0,0,0>(ifrom, ito, thr);
}
thr->timer(Timer::PAIR);
reduce_thr(this, eflag, vflag, thr);
} // end of omp parallel region
}
/* ---------------------------------------------------------------------- */
template <int CTABLE, int EVFLAG, int EFLAG, int VFLAG>
void PairLJCutTIP4PLongOMP::eval(int iifrom, int iito, ThrData * const thr)
{
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul;
double fraction,table;
double r,rsq,r2inv,r6inv,forcecoul,forcelj,cforce;
double factor_coul,factor_lj;
double grij,expm2,prefactor,t,erfc;
double v[6];
double fdx,fdy,fdz,fOx,fOy,fOz,fHx,fHy,fHz;
dbl3_t x1,x2,xH1,xH2;
int *ilist,*jlist,*numneigh,**firstneigh;
int i,j,ii,jj,jnum,itype,jtype,itable, key=0;
int n,vlist[6];
int iH1,iH2,jH1,jH2;
evdwl = ecoul = 0.0;
const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0];
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const double * _noalias const q = atom->q;
const int * _noalias const type = atom->type;
const tagint * _noalias const tag = atom->tag;
const int nlocal = atom->nlocal;
const double * _noalias const special_coul = force->special_coul;
const double * _noalias const special_lj = force->special_lj;
const double qqrd2e = force->qqrd2e;
const double cut_coulsqplus = (cut_coul+2.0*qdist) * (cut_coul+2.0*qdist);
double fxtmp,fytmp,fztmp;
ilist = list->ilist;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
// loop over neighbors of my atoms
for (ii = iifrom; ii < iito; ++ii) {
i = ilist[ii];
qtmp = q[i];
xtmp = x[i].x;
ytmp = x[i].y;
ztmp = x[i].z;
itype = type[i];
// if atom I = water O, set x1 = offset charge site
// else x1 = x of atom I
// NOTE: to make this part thread safe, we need to
// make sure that the hneigh_thr[][] entries only get
// updated, when all data is in place. worst case,
// some calculation is repeated, but since the results
// will be the same, there is no race condition.
if (itype == typeO) {
if (hneigh_thr[i].a < 0) {
iH1 = atom->map(tag[i] + 1);
iH2 = atom->map(tag[i] + 2);
if (iH1 == -1 || iH2 == -1)
error->one(FLERR,"TIP4P hydrogen is missing");
if (atom->type[iH1] != typeH || atom->type[iH2] != typeH)
error->one(FLERR,"TIP4P hydrogen has incorrect atom type");
// set iH1,iH2 to index of closest image to O
iH1 = domain->closest_image(i,iH1);
iH2 = domain->closest_image(i,iH2);
compute_newsite_thr(x[i],x[iH1],x[iH2],newsite_thr[i]);
hneigh_thr[i].t = 1;
hneigh_thr[i].b = iH2;
hneigh_thr[i].a = iH1;
} else {
iH1 = hneigh_thr[i].a;
iH2 = hneigh_thr[i].b;
if (hneigh_thr[i].t == 0) {
compute_newsite_thr(x[i],x[iH1],x[iH2],newsite_thr[i]);
hneigh_thr[i].t = 1;
}
}
x1 = newsite_thr[i];
} else x1 = x[i];
jlist = firstneigh[i];
jnum = numneigh[i];
fxtmp=fytmp=fztmp=0.0;
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
factor_coul = special_coul[sbmask(j)];
j &= NEIGHMASK;
delx = xtmp - x[j].x;
dely = ytmp - x[j].y;
delz = ztmp - x[j].z;
rsq = delx*delx + dely*dely + delz*delz;
jtype = type[j];
// LJ interaction based on true rsq
if (rsq < cut_ljsq[itype][jtype]) {
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
forcelj *= factor_lj * r2inv;
fxtmp += delx*forcelj;
fytmp += dely*forcelj;
fztmp += delz*forcelj;
f[j].x -= delx*forcelj;
f[j].y -= dely*forcelj;
f[j].z -= delz*forcelj;
if (EFLAG) {
evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
offset[itype][jtype];
evdwl *= factor_lj;
} else evdwl = 0.0;
if (EVFLAG) ev_tally_thr(this,i,j,nlocal, /* newton_pair = */ 1,
evdwl,0.0,forcelj,delx,dely,delz,thr);
}
// adjust rsq and delxyz for off-site O charge(s) if necessary
// but only if they are within reach
// NOTE: to make this part thread safe, we need to
// make sure that the hneigh_thr[][] entries only get
// updated, when all data is in place. worst case,
// some calculation is repeated, but since the results
// will be the same, there is no race condition.
if (rsq < cut_coulsqplus) {
if (itype == typeO || jtype == typeO) {
// if atom J = water O, set x2 = offset charge site
// else x2 = x of atom J
if (jtype == typeO) {
if (hneigh_thr[j].a < 0) {
jH1 = atom->map(tag[j] + 1);
jH2 = atom->map(tag[j] + 2);
if (jH1 == -1 || jH2 == -1)
error->one(FLERR,"TIP4P hydrogen is missing");
if (atom->type[jH1] != typeH || atom->type[jH2] != typeH)
error->one(FLERR,"TIP4P hydrogen has incorrect atom type");
// set jH1,jH2 to closest image to O
jH1 = domain->closest_image(j,jH1);
jH2 = domain->closest_image(j,jH2);
compute_newsite_thr(x[j],x[jH1],x[jH2],newsite_thr[j]);
hneigh_thr[j].t = 1;
hneigh_thr[j].b = jH2;
hneigh_thr[j].a = jH1;
} else {
jH1 = hneigh_thr[j].a;
jH2 = hneigh_thr[j].b;
if (hneigh_thr[j].t == 0) {
compute_newsite_thr(x[j],x[jH1],x[jH2],newsite_thr[j]);
hneigh_thr[j].t = 1;
}
}
x2 = newsite_thr[j];
} else x2 = x[j];
delx = x1.x - x2.x;
dely = x1.y - x2.y;
delz = x1.z - x2.z;
rsq = delx*delx + dely*dely + delz*delz;
}
// Coulombic interaction based on modified rsq
if (rsq < cut_coulsq) {
r2inv = 1 / rsq;
if (!CTABLE || rsq <= tabinnersq) {
r = sqrt(rsq);
grij = g_ewald * r;
expm2 = exp(-grij*grij);
t = 1.0 / (1.0 + EWALD_P*grij);
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
prefactor = qqrd2e * qtmp*q[j]/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) {
forcecoul -= (1.0-factor_coul)*prefactor;
}
} else {
union_int_float_t rsq_lookup;
rsq_lookup.f = rsq;
itable = rsq_lookup.i & ncoulmask;
itable >>= ncoulshiftbits;
fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
table = ftable[itable] + fraction*dftable[itable];
forcecoul = qtmp*q[j] * table;
if (factor_coul < 1.0) {
table = ctable[itable] + fraction*dctable[itable];
prefactor = qtmp*q[j] * table;
forcecoul -= (1.0-factor_coul)*prefactor;
}
}
cforce = forcecoul * r2inv;
// if i,j are not O atoms, force is applied directly
// if i or j are O atoms, force is on fictitious atom & partitioned
// force partitioning due to Feenstra, J Comp Chem, 20, 786 (1999)
// f_f = fictitious force, fO = f_f (1 - 2 alpha), fH = alpha f_f
// preserves total force and torque on water molecule
// virial = sum(r x F) where each water's atoms are near xi and xj
// vlist stores 2,4,6 atoms whose forces contribute to virial
if (VFLAG) {
n = 0;
key = 0;
}
if (itype != typeO) {
fxtmp += delx * cforce;
fytmp += dely * cforce;
fztmp += delz * cforce;
if (VFLAG) {
v[0] = x[i].x * delx * cforce;
v[1] = x[i].y * dely * cforce;
v[2] = x[i].z * delz * cforce;
v[3] = x[i].x * dely * cforce;
v[4] = x[i].x * delz * cforce;
v[5] = x[i].y * delz * cforce;
vlist[n++] = i;
}
} else {
if (VFLAG) key++;
fdx = delx*cforce;
fdy = dely*cforce;
fdz = delz*cforce;
fOx = fdx*(1 - alpha);
fOy = fdy*(1 - alpha);
fOz = fdz*(1 - alpha);
fHx = 0.5*alpha * fdx;
fHy = 0.5*alpha * fdy;
fHz = 0.5*alpha * fdz;
fxtmp += fOx;
fytmp += fOy;
fztmp += fOz;
f[iH1].x += fHx;
f[iH1].y += fHy;
f[iH1].z += fHz;
f[iH2].x += fHx;
f[iH2].y += fHy;
f[iH2].z += fHz;
if (VFLAG) {
xH1 = x[iH1];
xH2 = x[iH2];
v[0] = x[i].x*fOx + xH1.x*fHx + xH2.x*fHx;
v[1] = x[i].y*fOy + xH1.y*fHy + xH2.y*fHy;
v[2] = x[i].z*fOz + xH1.z*fHz + xH2.z*fHz;
v[3] = x[i].x*fOy + xH1.x*fHy + xH2.x*fHy;
v[4] = x[i].x*fOz + xH1.x*fHz + xH2.x*fHz;
v[5] = x[i].y*fOz + xH1.y*fHz + xH2.y*fHz;
vlist[n++] = i;
vlist[n++] = iH1;
vlist[n++] = iH2;
}
}
if (jtype != typeO) {
f[j].x -= delx * cforce;
f[j].y -= dely * cforce;
f[j].z -= delz * cforce;
if (VFLAG) {
v[0] -= x[j].x * delx * cforce;
v[1] -= x[j].y * dely * cforce;
v[2] -= x[j].z * delz * cforce;
v[3] -= x[j].x * dely * cforce;
v[4] -= x[j].x * delz * cforce;
v[5] -= x[j].y * delz * cforce;
vlist[n++] = j;
}
} else {
if (VFLAG) key += 2;
fdx = -delx*cforce;
fdy = -dely*cforce;
fdz = -delz*cforce;
fOx = fdx*(1 - alpha);
fOy = fdy*(1 - alpha);
fOz = fdz*(1 - alpha);
fHx = 0.5*alpha * fdx;
fHy = 0.5*alpha * fdy;
fHz = 0.5*alpha * fdz;
f[j].x += fOx;
f[j].y += fOy;
f[j].z += fOz;
f[jH1].x += fHx;
f[jH1].y += fHy;
f[jH1].z += fHz;
f[jH2].x += fHx;
f[jH2].y += fHy;
f[jH2].z += fHz;
if (VFLAG) {
xH1 = x[jH1];
xH2 = x[jH2];
v[0] += x[j].x*fOx + xH1.x*fHx + xH2.x*fHx;
v[1] += x[j].y*fOy + xH1.y*fHy + xH2.y*fHy;
v[2] += x[j].z*fOz + xH1.z*fHz + xH2.z*fHz;
v[3] += x[j].x*fOy + xH1.x*fHy + xH2.x*fHy;
v[4] += x[j].x*fOz + xH1.x*fHz + xH2.x*fHz;
v[5] += x[j].y*fOz + xH1.y*fHz + xH2.y*fHz;
vlist[n++] = j;
vlist[n++] = jH1;
vlist[n++] = jH2;
}
}
if (EFLAG) {
if (!CTABLE || rsq <= tabinnersq)
ecoul = prefactor*erfc;
else {
table = etable[itable] + fraction*detable[itable];
ecoul = qtmp*q[j] * table;
}
if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
} else ecoul = 0.0;
if (EVFLAG) ev_tally_list_thr(this,key,vlist,v,ecoul,alpha,thr);
}
}
}
f[i].x += fxtmp;
f[i].y += fytmp;
f[i].z += fztmp;
}
}
/* ----------------------------------------------------------------------
compute position xM of fictitious charge site for O atom and 2 H atoms
return it as xM
------------------------------------------------------------------------- */
void PairLJCutTIP4PLongOMP::compute_newsite_thr(const dbl3_t &xO,
const dbl3_t &xH1,
const dbl3_t &xH2,
dbl3_t &xM) const
{
double delx1 = xH1.x - xO.x;
double dely1 = xH1.y - xO.y;
double delz1 = xH1.z - xO.z;
double delx2 = xH2.x - xO.x;
double dely2 = xH2.y - xO.y;
double delz2 = xH2.z - xO.z;
const double prefac = alpha * 0.5;
xM.x = xO.x + prefac * (delx1 + delx2);
xM.y = xO.y + prefac * (dely1 + dely2);
xM.z = xO.z + prefac * (delz1 + delz2);
}
/* ---------------------------------------------------------------------- */
double PairLJCutTIP4PLongOMP::memory_usage()
{
double bytes = memory_usage_thr();
bytes += PairLJCutTIP4PLong::memory_usage();
return bytes;
}
| pastewka/lammps | src/USER-OMP/pair_lj_cut_tip4p_long_omp.cpp | C++ | gpl-2.0 | 16,412 |
//@HEADER
// ************************************************************************
//
// Kokkos v. 3.0
// Copyright (2020) National Technology & Engineering
// Solutions of Sandia, LLC (NTESS).
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Kokkos is licensed under 3-clause BSD terms of use:
//
// 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 Corporation nor the names of the
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY NTESS "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 NTESS OR THE
// 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.
//
// Questions? Contact Christian R. Trott (crtrott@sandia.gov)
//
// ************************************************************************
//@HEADER
#define KOKKOS_IMPL_COMPILING_LIBRARY true
#include <Kokkos_Core.hpp>
namespace Kokkos {
namespace Impl {
KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutRight,
Experimental::ROCm, int64_t)
KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutLeft,
Experimental::ROCm, int64_t)
KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutStride,
Experimental::ROCm, int64_t)
KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutRight, Experimental::ROCm,
int64_t)
} // namespace Impl
} // namespace Kokkos
| pastewka/lammps | lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp | C++ | gpl-2.0 | 2,670 |
<?php
namespace TYPO3\CMS\Backend\Form\Element;
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* TCEforms wizard for rendering an AJAX selector for records
*
* @author Andreas Wolf <andreas.wolf@ikt-werk.de>
* @author Benjamin Mack <benni@typo3.org>
*/
class SuggestElement {
// Count the number of ajax selectors used
public $suggestCount = 0;
public $cssClass = 'typo3-TCEforms-suggest';
/**
* @var \TYPO3\CMS\Backend\Form\FormEngine
*/
public $TCEformsObj;
/**
* Initialize an instance of SuggestElement
*
* @param \TYPO3\CMS\Backend\Form\FormEngine $tceForms Reference to an TCEforms instance
* @return void
*/
public function init(&$tceForms) {
$this->TCEformsObj = &$tceForms;
}
/**
* Renders an ajax-enabled text field. Also adds required JS
*
* @param string $fieldname The fieldname in the form
* @param string $table The table we render this selector for
* @param string $field The field we render this selector for
* @param array $row The row which is currently edited
* @param array $config The TSconfig of the field
* @return string The HTML code for the selector
*/
public function renderSuggestSelector($fieldname, $table, $field, array $row, array $config) {
$this->suggestCount++;
$containerCssClass = $this->cssClass . ' ' . $this->cssClass . '-position-right';
$suggestId = 'suggest-' . $table . '-' . $field . '-' . $row['uid'];
if ($GLOBALS['TCA'][$table]['columns'][$field]['config']['type'] === 'flex') {
$fieldPattern = 'data[' . $table . '][' . $row['uid'] . '][';
$flexformField = str_replace($fieldPattern, '', $fieldname);
$flexformField = substr($flexformField, 0, -1);
$field = str_replace(array(']['), '|', $flexformField);
}
$selector = '
<div class="' . $containerCssClass . '" id="' . $suggestId . '">
<input type="text" id="' . $fieldname . 'Suggest" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.findRecord') . '" class="' . $this->cssClass . '-search" />
<div class="' . $this->cssClass . '-indicator" style="display: none;" id="' . $fieldname . 'SuggestIndicator">
<img src="' . $GLOBALS['BACK_PATH'] . 'gfx/spinner.gif" alt="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:alttext.suggestSearching') . '" />
</div>
<div class="' . $this->cssClass . '-choices" style="display: none;" id="' . $fieldname . 'SuggestChoices"></div>
</div>';
// Get minimumCharacters from TCA
if (isset($config['fieldConf']['config']['wizards']['suggest']['default']['minimumCharacters'])) {
$minChars = (int)$config['fieldConf']['config']['wizards']['suggest']['default']['minimumCharacters'];
}
// Overwrite it with minimumCharacters from TSConfig (TCEFORM) if given
if (isset($config['fieldTSConfig']['suggest.']['default.']['minimumCharacters'])) {
$minChars = (int)$config['fieldTSConfig']['suggest.']['default.']['minimumCharacters'];
}
$minChars = $minChars > 0 ? $minChars : 2;
// fetch the TCA field type to hand it over to the JS class
$type = '';
if (isset($config['fieldConf']['config']['type'])) {
$type = $config['fieldConf']['config']['type'];
}
// Replace "-" with ucwords for the JS object name
$jsObj = str_replace(' ', '', ucwords(str_replace('-', ' ', GeneralUtility::strtolower($suggestId))));
$this->TCEformsObj->additionalJS_post[] = '
var ' . $jsObj . ' = new TCEForms.Suggest("' . $fieldname . '", "' . $table . '", "' . $field . '", "' . $row['uid'] . '", ' . $row['pid'] . ', ' . $minChars . ', "' . $type . '");
' . $jsObj . '.defaultValue = "' . GeneralUtility::slashJS($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.findRecord')) . '";
';
return $selector;
}
/**
* Search a data structure array recursively -- including within nested
* (repeating) elements -- for a particular field config.
*
* @param array $dataStructure The data structure
* @param string $fieldName The field name
* @return array
*/
protected function getNestedDsFieldConfig(array $dataStructure, $fieldName) {
$fieldConfig = array();
$elements = $dataStructure['ROOT']['el'] ? $dataStructure['ROOT']['el'] : $dataStructure['el'];
if (is_array($elements)) {
foreach ($elements as $k => $ds) {
if ($k === $fieldName) {
$fieldConfig = $ds['TCEforms']['config'];
break;
} elseif (isset($ds['el'][$fieldName]['TCEforms']['config'])) {
$fieldConfig = $ds['el'][$fieldName]['TCEforms']['config'];
break;
} else {
$fieldConfig = $this->getNestedDsFieldConfig($ds, $fieldName);
}
}
}
return $fieldConfig;
}
/**
* Ajax handler for the "suggest" feature in TCEforms.
*
* @param array $params The parameters from the AJAX call
* @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj The AJAX object representing the AJAX call
* @return void
*/
public function processAjaxRequest($params, &$ajaxObj) {
// Get parameters from $_GET/$_POST
$search = GeneralUtility::_GP('value');
$table = GeneralUtility::_GP('table');
$field = GeneralUtility::_GP('field');
$uid = GeneralUtility::_GP('uid');
$pageId = GeneralUtility::_GP('pid');
// If the $uid is numeric, we have an already existing element, so get the
// TSconfig of the page itself or the element container (for non-page elements)
// otherwise it's a new element, so use given id of parent page (i.e., don't modify it here)
if (is_numeric($uid)) {
if ($table == 'pages') {
$pageId = $uid;
} else {
$row = BackendUtility::getRecord($table, $uid);
$pageId = $row['pid'];
}
}
$TSconfig = BackendUtility::getPagesTSconfig($pageId);
$queryTables = array();
$foreign_table_where = '';
$fieldConfig = $GLOBALS['TCA'][$table]['columns'][$field]['config'];
$parts = explode('|', $field);
if ($GLOBALS['TCA'][$table]['columns'][$parts[0]]['config']['type'] === 'flex') {
if (is_array($row) && count($row) > 0) {
$flexfieldTCAConfig = $GLOBALS['TCA'][$table]['columns'][$parts[0]]['config'];
$flexformDSArray = BackendUtility::getFlexFormDS($flexfieldTCAConfig, $row, $table, $parts[0]);
$flexformDSArray = GeneralUtility::resolveAllSheetsInDS($flexformDSArray);
$flexformElement = $parts[count($parts) - 2];
$continue = TRUE;
foreach ($flexformDSArray as $sheet) {
foreach ($sheet as $_ => $dataStructure) {
$fieldConfig = $this->getNestedDsFieldConfig($dataStructure, $flexformElement);
if (count($fieldConfig) > 0) {
$continue = FALSE;
break;
}
}
if (!$continue) {
break;
}
}
$field = str_replace('|', '][', $field);
}
}
$wizardConfig = $fieldConfig['wizards']['suggest'];
if (isset($fieldConfig['allowed'])) {
if ($fieldConfig['allowed'] === '*') {
foreach ($GLOBALS['TCA'] as $tableName => $tableConfig) {
// TODO: Refactor function to BackendUtility
if (empty($tableConfig['ctrl']['hideTable'])
&& ($GLOBALS['BE_USER']->isAdmin()
|| (empty($tableConfig['ctrl']['adminOnly'])
&& (empty($tableConfig['ctrl']['rootLevel'])
|| !empty($tableConfig['ctrl']['security']['ignoreRootLevelRestriction']))))
) {
$queryTables[] = $tableName;
}
}
unset($tableName, $tableConfig);
} else {
$queryTables = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $fieldConfig['allowed']);
}
} elseif (isset($fieldConfig['foreign_table'])) {
$queryTables = array($fieldConfig['foreign_table']);
$foreign_table_where = $fieldConfig['foreign_table_where'];
// strip ORDER BY clause
$foreign_table_where = trim(preg_replace('/ORDER[[:space:]]+BY.*/i', '', $foreign_table_where));
}
$resultRows = array();
// fetch the records for each query table. A query table is a table from which records are allowed to
// be added to the TCEForm selector, originally fetched from the "allowed" config option in the TCA
foreach ($queryTables as $queryTable) {
// if the table does not exist, skip it
if (!is_array($GLOBALS['TCA'][$queryTable]) || !count($GLOBALS['TCA'][$queryTable])) {
continue;
}
$config = (array) $wizardConfig['default'];
if (is_array($wizardConfig[$queryTable])) {
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($config, $wizardConfig[$queryTable]);
}
// merge the configurations of different "levels" to get the working configuration for this table and
// field (i.e., go from the most general to the most special configuration)
if (is_array($TSconfig['TCEFORM.']['suggest.']['default.'])) {
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($config, $TSconfig['TCEFORM.']['suggest.']['default.']);
}
if (is_array($TSconfig['TCEFORM.']['suggest.'][$queryTable . '.'])) {
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($config, $TSconfig['TCEFORM.']['suggest.'][$queryTable . '.']);
}
// use $table instead of $queryTable here because we overlay a config
// for the input-field here, not for the queried table
if (is_array($TSconfig['TCEFORM.'][$table . '.'][$field . '.']['suggest.']['default.'])) {
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($config, $TSconfig['TCEFORM.'][$table . '.'][$field . '.']['suggest.']['default.']);
}
if (is_array($TSconfig['TCEFORM.'][$table . '.'][$field . '.']['suggest.'][$queryTable . '.'])) {
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($config, $TSconfig['TCEFORM.'][$table . '.'][$field . '.']['suggest.'][$queryTable . '.']);
}
//process addWhere
if (!isset($config['addWhere']) && $foreign_table_where) {
$config['addWhere'] = $foreign_table_where;
}
if (isset($config['addWhere'])) {
$config['addWhere'] = strtr(' ' . $config['addWhere'], array(
'###THIS_UID###' => (int)$uid,
'###CURRENT_PID###' => (int)$pageId
));
}
// instantiate the class that should fetch the records for this $queryTable
$receiverClassName = $config['receiverClass'];
if (!class_exists($receiverClassName)) {
$receiverClassName = 'TYPO3\\CMS\\Backend\\Form\\Element\\SuggestDefaultReceiver';
}
$receiverObj = GeneralUtility::makeInstance($receiverClassName, $queryTable, $config);
$params = array('value' => $search);
$rows = $receiverObj->queryTable($params);
if (empty($rows)) {
continue;
}
$resultRows = GeneralUtility::array_merge($resultRows, $rows);
unset($rows);
}
$listItems = array();
if (count($resultRows) > 0) {
// traverse all found records and sort them
$rowsSort = array();
foreach ($resultRows as $key => $row) {
$rowsSort[$key] = $row['text'];
}
asort($rowsSort);
$rowsSort = array_keys($rowsSort);
// Limit the number of items in the result list
$maxItems = $config['maxItemsInResultList'] ?: 10;
$maxItems = min(count($resultRows), $maxItems);
// put together the selector entry
for ($i = 0; $i < $maxItems; $i++) {
$row = $resultRows[$rowsSort[$i]];
$rowId = $row['table'] . '-' . $row['uid'] . '-' . $table . '-' . $uid . '-' . $field;
$listItems[] = '<li' . ($row['class'] != '' ? ' class="' . $row['class'] . '"' : '') . ' id="' . $rowId . '"' . ($row['style'] != '' ? ' style="' . $row['style'] . '"' : '') . '>' . $row['sprite'] . $row['text'] . '</li>';
}
}
if (count($listItems) > 0) {
$list = implode('', $listItems);
} else {
$list = '<li class="suggest-noresults"><i>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.noRecordFound') . '</i></li>';
}
$list = '<ul class="' . $this->cssClass . '-resultlist">' . $list . '</ul>';
$ajaxObj->addContent(0, $list);
}
}
| TYPO3-coreapi/TYPO3CMS | typo3/sysext/backend/Classes/Form/Element/SuggestElement.php | PHP | gpl-2.0 | 12,118 |
/*
* 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.commons.io;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import junit.framework.Assert;
import junit.framework.TestCase;
import org.apache.commons.io.filefilter.FileFilterUtils;
import org.apache.commons.io.filefilter.IOFileFilter;
import org.apache.commons.io.filefilter.NameFileFilter;
import org.apache.commons.io.filefilter.OrFileFilter;
/**
* This is used to test DirectoryWalker for correctness.
*
* @version $Id: DirectoryWalkerTestCase.java 1302748 2012-03-20 01:35:32Z ggregory $
* @see DirectoryWalker
*
*/
public class DirectoryWalkerTestCase extends TestCase {
// Directories
private static final File current = new File(".");
private static final File javaDir = new File("src/main/java");
private static final File orgDir = new File(javaDir, "org");
private static final File apacheDir = new File(orgDir, "apache");
private static final File commonsDir = new File(apacheDir, "commons");
private static final File ioDir = new File(commonsDir, "io");
private static final File outputDir = new File(ioDir, "output");
private static final File[] dirs = new File[] {orgDir, apacheDir, commonsDir, ioDir, outputDir};
// Files
private static final File filenameUtils = new File(ioDir, "FilenameUtils.java");
private static final File ioUtils = new File(ioDir, "IOUtils.java");
private static final File proxyWriter = new File(outputDir, "ProxyWriter.java");
private static final File nullStream = new File(outputDir, "NullOutputStream.java");
private static final File[] ioFiles = new File[] {filenameUtils, ioUtils};
private static final File[] outputFiles = new File[] {proxyWriter, nullStream};
// Filters
private static final IOFileFilter dirsFilter = createNameFilter(dirs);
private static final IOFileFilter iofilesFilter = createNameFilter(ioFiles);
private static final IOFileFilter outputFilesFilter = createNameFilter(outputFiles);
private static final IOFileFilter ioDirAndFilesFilter = new OrFileFilter(dirsFilter, iofilesFilter);
private static final IOFileFilter dirsAndFilesFilter = new OrFileFilter(ioDirAndFilesFilter, outputFilesFilter);
// Filter to exclude SVN files
private static final IOFileFilter NOT_SVN = FileFilterUtils.makeSVNAware(null);
/** Construct the TestCase using the name */
public DirectoryWalkerTestCase(String name) {
super(name);
}
/** Set Up */
@Override
protected void setUp() throws Exception {
super.setUp();
}
/** Tear Down */
@Override
protected void tearDown() throws Exception {
super.tearDown();
}
//-----------------------------------------------------------------------
/**
* Test Filtering
*/
public void testFilter() {
List<File> results = new TestFileFinder(dirsAndFilesFilter, -1).find(javaDir);
assertEquals("Result Size", 1 + dirs.length + ioFiles.length + outputFiles.length, results.size());
assertTrue("Start Dir", results.contains(javaDir));
checkContainsFiles("Dir", dirs, results);
checkContainsFiles("IO File", ioFiles, results);
checkContainsFiles("Output File", outputFiles, results);
}
/**
* Test Filtering and limit to depth 0
*/
public void testFilterAndLimitA() {
List<File> results = new TestFileFinder(NOT_SVN, 0).find(javaDir);
assertEquals("[A] Result Size", 1, results.size());
assertTrue("[A] Start Dir", results.contains(javaDir));
}
/**
* Test Filtering and limit to depth 1
*/
public void testFilterAndLimitB() {
List<File> results = new TestFileFinder(NOT_SVN, 1).find(javaDir);
assertEquals("[B] Result Size", 2, results.size());
assertTrue("[B] Start Dir", results.contains(javaDir));
assertTrue("[B] Org Dir", results.contains(orgDir));
}
/**
* Test Filtering and limit to depth 3
*/
public void testFilterAndLimitC() {
List<File> results = new TestFileFinder(NOT_SVN, 3).find(javaDir);
assertEquals("[C] Result Size", 4, results.size());
assertTrue("[C] Start Dir", results.contains(javaDir));
assertTrue("[C] Org Dir", results.contains(orgDir));
assertTrue("[C] Apache Dir", results.contains(apacheDir));
assertTrue("[C] Commons Dir", results.contains(commonsDir));
}
/**
* Test Filtering and limit to depth 5
*/
public void testFilterAndLimitD() {
List<File> results = new TestFileFinder(dirsAndFilesFilter, 5).find(javaDir);
assertEquals("[D] Result Size", 1 + dirs.length + ioFiles.length, results.size());
assertTrue("[D] Start Dir", results.contains(javaDir));
checkContainsFiles("[D] Dir", dirs, results);
checkContainsFiles("[D] File", ioFiles, results);
}
/**
* Test separate dir and file filters
*/
public void testFilterDirAndFile1() {
List<File> results = new TestFileFinder(dirsFilter, iofilesFilter, -1).find(javaDir);
assertEquals("[DirAndFile1] Result Size", 1 + dirs.length + ioFiles.length, results.size());
assertTrue("[DirAndFile1] Start Dir", results.contains(javaDir));
checkContainsFiles("[DirAndFile1] Dir", dirs, results);
checkContainsFiles("[DirAndFile1] File", ioFiles, results);
}
/**
* Test separate dir and file filters
*/
public void testFilterDirAndFile2() {
List<File> results = new TestFileFinder((IOFileFilter) null, (IOFileFilter) null, -1).find(javaDir);
assertTrue("[DirAndFile2] Result Size", results.size() > 1 + dirs.length + ioFiles.length);
assertTrue("[DirAndFile2] Start Dir", results.contains(javaDir));
checkContainsFiles("[DirAndFile2] Dir", dirs, results);
checkContainsFiles("[DirAndFile2] File", ioFiles, results);
}
/**
* Test separate dir and file filters
*/
public void testFilterDirAndFile3() {
List<File> results = new TestFileFinder(dirsFilter, (IOFileFilter) null, -1).find(javaDir);
List<File> resultDirs = directoriesOnly(results);
assertEquals("[DirAndFile3] Result Size", 1 + dirs.length, resultDirs.size());
assertTrue("[DirAndFile3] Start Dir", results.contains(javaDir));
checkContainsFiles("[DirAndFile3] Dir", dirs, resultDirs);
}
/**
* Test separate dir and file filters
*/
public void testFilterDirAndFile4() {
List<File> results = new TestFileFinder((IOFileFilter) null, iofilesFilter, -1).find(javaDir);
List<File> resultFiles = filesOnly(results);
assertEquals("[DirAndFile4] Result Size", ioFiles.length, resultFiles.size());
assertTrue("[DirAndFile4] Start Dir", results.contains(javaDir));
checkContainsFiles("[DirAndFile4] File", ioFiles, resultFiles);
}
/**
* Test Limiting to current directory
*/
public void testLimitToCurrent() {
List<File> results = new TestFileFinder(null, 0).find(current);
assertEquals("Result Size", 1, results.size());
assertTrue("Current Dir", results.contains(new File(".")));
}
/**
* test an invalid start directory
*/
public void testMissingStartDirectory() {
// TODO is this what we want with invalid directory?
File invalidDir = new File("invalid-dir");
List<File> results = new TestFileFinder(null, -1).find(invalidDir);
assertEquals("Result Size", 1, results.size());
assertTrue("Current Dir", results.contains(invalidDir));
try {
new TestFileFinder(null, -1).find(null);
fail("Null start directory didn't throw Exception");
} catch (NullPointerException ignore) {
// expected result
}
}
/**
* test an invalid start directory
*/
public void testHandleStartDirectoryFalse() {
List<File> results = new TestFalseFileFinder(null, -1).find(current);
assertEquals("Result Size", 0, results.size());
}
// ------------ Convenience Test Methods ------------------------------------
/**
* Check the files in the array are in the results list.
*/
private void checkContainsFiles(String prefix, File[] files, Collection<File> results) {
for (int i = 0; i < files.length; i++) {
assertTrue(prefix + "["+i+"] " + files[i], results.contains(files[i]));
}
}
private void checkContainsString(String prefix, File[] files, Collection<String> results) {
for (int i = 0; i < files.length; i++) {
assertTrue(prefix + "["+i+"] " + files[i], results.contains(files[i].toString()));
}
}
/**
* Extract the directories.
*/
private List<File> directoriesOnly(Collection<File> results) {
List<File> list = new ArrayList<File>(results.size());
for (File file : results) {
if (file.isDirectory()) {
list.add(file);
}
}
return list;
}
/**
* Extract the files.
*/
private List<File> filesOnly(Collection<File> results) {
List<File> list = new ArrayList<File>(results.size());
for (File file : results) {
if (file.isFile()) {
list.add(file);
}
}
return list;
}
/**
* Create an name filter containg the names of the files
* in the array.
*/
private static IOFileFilter createNameFilter(File[] files) {
String[] names = new String[files.length];
for (int i = 0; i < files.length; i++) {
names[i] = files[i].getName();
}
return new NameFileFilter(names);
}
/**
* Test Cancel
*/
public void testCancel() {
String cancelName = null;
// Cancel on a file
try {
cancelName = "DirectoryWalker.java";
new TestCancelWalker(cancelName, false).find(javaDir);
fail("CancelException not thrown for '" + cancelName + "'");
} catch (DirectoryWalker.CancelException cancel) {
assertEquals("File: " + cancelName, cancelName, cancel.getFile().getName());
assertEquals("Depth: " + cancelName, 5, cancel.getDepth());
} catch(IOException ex) {
fail("IOException: " + cancelName + " " + ex);
}
// Cancel on a directory
try {
cancelName = "commons";
new TestCancelWalker(cancelName, false).find(javaDir);
fail("CancelException not thrown for '" + cancelName + "'");
} catch (DirectoryWalker.CancelException cancel) {
assertEquals("File: " + cancelName, cancelName, cancel.getFile().getName());
assertEquals("Depth: " + cancelName, 3, cancel.getDepth());
} catch(IOException ex) {
fail("IOException: " + cancelName + " " + ex);
}
// Suppress CancelException (use same file name as preceeding test)
try {
List<File> results = new TestCancelWalker(cancelName, true).find(javaDir);
File lastFile = results.get(results.size() - 1);
assertEquals("Suppress: " + cancelName, cancelName, lastFile.getName());
} catch(IOException ex) {
fail("Suppress threw " + ex);
}
}
/**
* Test Cancel
*/
public void testMultiThreadCancel() {
String cancelName = "DirectoryWalker.java";
TestMultiThreadCancelWalker walker = new TestMultiThreadCancelWalker(cancelName, false);
// Cancel on a file
try {
walker.find(javaDir);
fail("CancelException not thrown for '" + cancelName + "'");
} catch (DirectoryWalker.CancelException cancel) {
File last = walker.results.get(walker.results.size() - 1);
assertEquals(cancelName, last.getName());
assertEquals("Depth: " + cancelName, 5, cancel.getDepth());
} catch(IOException ex) {
fail("IOException: " + cancelName + " " + ex);
}
// Cancel on a directory
try {
cancelName = "commons";
walker = new TestMultiThreadCancelWalker(cancelName, false);
walker.find(javaDir);
fail("CancelException not thrown for '" + cancelName + "'");
} catch (DirectoryWalker.CancelException cancel) {
assertEquals("File: " + cancelName, cancelName, cancel.getFile().getName());
assertEquals("Depth: " + cancelName, 3, cancel.getDepth());
} catch(IOException ex) {
fail("IOException: " + cancelName + " " + ex);
}
// Suppress CancelException (use same file name as preceeding test)
try {
walker = new TestMultiThreadCancelWalker(cancelName, true);
List<File> results = walker.find(javaDir);
File lastFile = results.get(results.size() - 1);
assertEquals("Suppress: " + cancelName, cancelName, lastFile.getName());
} catch(IOException ex) {
fail("Suppress threw " + ex);
}
}
/**
* Test Filtering
*/
public void testFilterString() {
List<String> results = new TestFileFinderString(dirsAndFilesFilter, -1).find(javaDir);
assertEquals("Result Size", outputFiles.length + ioFiles.length, results.size());
checkContainsString("IO File", ioFiles, results);
checkContainsString("Output File", outputFiles, results);
}
// ------------ Test DirectoryWalker implementation --------------------------
/**
* Test DirectoryWalker implementation that finds files in a directory hierarchy
* applying a file filter.
*/
private static class TestFileFinder extends DirectoryWalker<File> {
protected TestFileFinder(FileFilter filter, int depthLimit) {
super(filter, depthLimit);
}
protected TestFileFinder(IOFileFilter dirFilter, IOFileFilter fileFilter, int depthLimit) {
super(dirFilter, fileFilter, depthLimit);
}
/** find files. */
protected List<File> find(File startDirectory) {
List<File> results = new ArrayList<File>();
try {
walk(startDirectory, results);
} catch(IOException ex) {
Assert.fail(ex.toString());
}
return results;
}
/** Handles a directory end by adding the File to the result set. */
@Override
protected void handleDirectoryEnd(File directory, int depth, Collection<File> results) {
results.add(directory);
}
/** Handles a file by adding the File to the result set. */
@Override
protected void handleFile(File file, int depth, Collection<File> results) {
results.add(file);
}
}
// ------------ Test DirectoryWalker implementation --------------------------
/**
* Test DirectoryWalker implementation that always returns false
* from handleDirectoryStart()
*/
private static class TestFalseFileFinder extends TestFileFinder {
protected TestFalseFileFinder(FileFilter filter, int depthLimit) {
super(filter, depthLimit);
}
/** Always returns false. */
@Override
protected boolean handleDirectory(File directory, int depth, Collection<File> results) {
return false;
}
}
// ------------ Test DirectoryWalker implementation --------------------------
/**
* Test DirectoryWalker implementation that finds files in a directory hierarchy
* applying a file filter.
*/
static class TestCancelWalker extends DirectoryWalker<File> {
private String cancelFileName;
private boolean suppressCancel;
TestCancelWalker(String cancelFileName,boolean suppressCancel) {
super();
this.cancelFileName = cancelFileName;
this.suppressCancel = suppressCancel;
}
/** find files. */
protected List<File> find(File startDirectory) throws IOException {
List<File> results = new ArrayList<File>();
walk(startDirectory, results);
return results;
}
/** Handles a directory end by adding the File to the result set. */
@Override
protected void handleDirectoryEnd(File directory, int depth, Collection<File> results) throws IOException {
results.add(directory);
if (cancelFileName.equals(directory.getName())) {
throw new CancelException(directory, depth);
}
}
/** Handles a file by adding the File to the result set. */
@Override
protected void handleFile(File file, int depth, Collection<File> results) throws IOException {
results.add(file);
if (cancelFileName.equals(file.getName())) {
throw new CancelException(file, depth);
}
}
/** Handles Cancel. */
@Override
protected void handleCancelled(File startDirectory, Collection<File> results,
CancelException cancel) throws IOException {
if (!suppressCancel) {
super.handleCancelled(startDirectory, results, cancel);
}
}
}
/**
* Test DirectoryWalker implementation that finds files in a directory hierarchy
* applying a file filter.
*/
static class TestMultiThreadCancelWalker extends DirectoryWalker<File> {
private String cancelFileName;
private boolean suppressCancel;
private boolean cancelled;
public List<File> results;
TestMultiThreadCancelWalker(String cancelFileName, boolean suppressCancel) {
super();
this.cancelFileName = cancelFileName;
this.suppressCancel = suppressCancel;
}
/** find files. */
protected List<File> find(File startDirectory) throws IOException {
results = new ArrayList<File>();
walk(startDirectory, results);
return results;
}
/** Handles a directory end by adding the File to the result set. */
@Override
protected void handleDirectoryEnd(File directory, int depth, Collection<File> results) throws IOException {
results.add(directory);
assertFalse(cancelled);
if (cancelFileName.equals(directory.getName())) {
cancelled = true;
}
}
/** Handles a file by adding the File to the result set. */
@Override
protected void handleFile(File file, int depth, Collection<File> results) throws IOException {
results.add(file);
assertFalse(cancelled);
if (cancelFileName.equals(file.getName())) {
cancelled = true;
}
}
/** Handles Cancelled. */
@Override
protected boolean handleIsCancelled(File file, int depth, Collection<File> results) throws IOException {
return cancelled;
}
/** Handles Cancel. */
@Override
protected void handleCancelled(File startDirectory, Collection<File> results,
CancelException cancel) throws IOException {
if (!suppressCancel) {
super.handleCancelled(startDirectory, results, cancel);
}
}
}
/**
* Test DirectoryWalker implementation that finds files in a directory hierarchy
* applying a file filter.
*/
private static class TestFileFinderString extends DirectoryWalker<String> {
protected TestFileFinderString(FileFilter filter, int depthLimit) {
super(filter, depthLimit);
}
/** find files. */
protected List<String> find(File startDirectory) {
List<String> results = new ArrayList<String>();
try {
walk(startDirectory, results);
} catch(IOException ex) {
Assert.fail(ex.toString());
}
return results;
}
/** Handles a file by adding the File to the result set. */
@Override
protected void handleFile(File file, int depth, Collection<String> results) {
results.add(file.toString());
}
}
}
| BIORIMP/biorimp | BIO-RIMP/test_data/code/cio/src/test/java/org/apache/commons/io/DirectoryWalkerTestCase.java | Java | gpl-2.0 | 21,473 |
/*
Minetest
Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "mapgen.h"
#include "voxel.h"
#include "noise.h"
#include "biome.h"
#include "mapblock.h"
#include "mapnode.h"
#include "map.h"
#include "content_sao.h"
#include "nodedef.h"
#include "content_mapnode.h" // For content_mapnode_get_new_name
#include "voxelalgorithms.h"
#include "profiler.h"
#include "settings.h" // For g_settings
#include "main.h" // For g_profiler
#include "treegen.h"
#include "mapgen_v6.h"
#include "mapgen_v7.h"
#include "serialization.h"
#include "util/serialize.h"
#include "filesys.h"
#include "log.h"
FlagDesc flagdesc_mapgen[] = {
{"trees", MG_TREES},
{"caves", MG_CAVES},
{"dungeons", MG_DUNGEONS},
{"flat", MG_FLAT},
{"light", MG_LIGHT},
{NULL, 0}
};
FlagDesc flagdesc_ore[] = {
{"absheight", OREFLAG_ABSHEIGHT},
{"scatter_noisedensity", OREFLAG_DENSITY},
{"claylike_nodeisnt", OREFLAG_NODEISNT},
{NULL, 0}
};
FlagDesc flagdesc_deco_schematic[] = {
{"place_center_x", DECO_PLACE_CENTER_X},
{"place_center_y", DECO_PLACE_CENTER_Y},
{"place_center_z", DECO_PLACE_CENTER_Z},
{NULL, 0}
};
FlagDesc flagdesc_gennotify[] = {
{"dungeon", 1 << GENNOTIFY_DUNGEON},
{"temple", 1 << GENNOTIFY_TEMPLE},
{"cave_begin", 1 << GENNOTIFY_CAVE_BEGIN},
{"cave_end", 1 << GENNOTIFY_CAVE_END},
{"large_cave_begin", 1 << GENNOTIFY_LARGECAVE_BEGIN},
{"large_cave_end", 1 << GENNOTIFY_LARGECAVE_END},
{NULL, 0}
};
///////////////////////////////////////////////////////////////////////////////
Ore *createOre(OreType type) {
switch (type) {
case ORE_SCATTER:
return new OreScatter;
case ORE_SHEET:
return new OreSheet;
//case ORE_CLAYLIKE: //TODO: implement this!
// return new OreClaylike;
default:
return NULL;
}
}
Ore::~Ore() {
delete np;
delete noise;
}
void Ore::resolveNodeNames(INodeDefManager *ndef) {
if (ore == CONTENT_IGNORE) {
ore = ndef->getId(ore_name);
if (ore == CONTENT_IGNORE) {
errorstream << "Ore::resolveNodeNames: ore node '"
<< ore_name << "' not defined";
ore = CONTENT_AIR;
wherein.push_back(CONTENT_AIR);
return;
}
}
for (size_t i=0; i != wherein_names.size(); i++) {
std::string name = wherein_names[i];
content_t c = ndef->getId(name);
if (c != CONTENT_IGNORE) {
wherein.push_back(c);
}
}
}
void Ore::placeOre(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) {
int in_range = 0;
in_range |= (nmin.Y <= height_max && nmax.Y >= height_min);
if (flags & OREFLAG_ABSHEIGHT)
in_range |= (nmin.Y >= -height_max && nmax.Y <= -height_min) << 1;
if (!in_range)
return;
int ymin, ymax;
if (in_range & ORE_RANGE_MIRROR) {
ymin = MYMAX(nmin.Y, -height_max);
ymax = MYMIN(nmax.Y, -height_min);
} else {
ymin = MYMAX(nmin.Y, height_min);
ymax = MYMIN(nmax.Y, height_max);
}
if (clust_size >= ymax - ymin + 1)
return;
nmin.Y = ymin;
nmax.Y = ymax;
generate(mg->vm, mg->seed, blockseed, nmin, nmax);
}
void OreScatter::generate(ManualMapVoxelManipulator *vm, int seed,
u32 blockseed, v3s16 nmin, v3s16 nmax) {
PseudoRandom pr(blockseed);
MapNode n_ore(ore, 0, ore_param2);
int volume = (nmax.X - nmin.X + 1) *
(nmax.Y - nmin.Y + 1) *
(nmax.Z - nmin.Z + 1);
int csize = clust_size;
int orechance = (csize * csize * csize) / clust_num_ores;
int nclusters = volume / clust_scarcity;
for (int i = 0; i != nclusters; i++) {
int x0 = pr.range(nmin.X, nmax.X - csize + 1);
int y0 = pr.range(nmin.Y, nmax.Y - csize + 1);
int z0 = pr.range(nmin.Z, nmax.Z - csize + 1);
if (np && (NoisePerlin3D(np, x0, y0, z0, seed) < nthresh))
continue;
for (int z1 = 0; z1 != csize; z1++)
for (int y1 = 0; y1 != csize; y1++)
for (int x1 = 0; x1 != csize; x1++) {
if (pr.range(1, orechance) != 1)
continue;
u32 i = vm->m_area.index(x0 + x1, y0 + y1, z0 + z1);
for (size_t ii = 0; ii < wherein.size(); ii++)
if (vm->m_data[i].getContent() == wherein[ii])
vm->m_data[i] = n_ore;
}
}
}
void OreSheet::generate(ManualMapVoxelManipulator *vm, int seed,
u32 blockseed, v3s16 nmin, v3s16 nmax) {
PseudoRandom pr(blockseed + 4234);
MapNode n_ore(ore, 0, ore_param2);
int max_height = clust_size;
int y_start = pr.range(nmin.Y, nmax.Y - max_height);
if (!noise) {
int sx = nmax.X - nmin.X + 1;
int sz = nmax.Z - nmin.Z + 1;
noise = new Noise(np, 0, sx, sz);
}
noise->seed = seed + y_start;
noise->perlinMap2D(nmin.X, nmin.Z);
int index = 0;
for (int z = nmin.Z; z <= nmax.Z; z++)
for (int x = nmin.X; x <= nmax.X; x++) {
float noiseval = noise->result[index++];
if (noiseval < nthresh)
continue;
int height = max_height * (1. / pr.range(1, 3));
int y0 = y_start + np->scale * noiseval; //pr.range(1, 3) - 1;
int y1 = y0 + height;
for (int y = y0; y != y1; y++) {
u32 i = vm->m_area.index(x, y, z);
if (!vm->m_area.contains(i))
continue;
for (size_t ii = 0; ii < wherein.size(); ii++)
if (vm->m_data[i].getContent() == wherein[ii])
vm->m_data[i] = n_ore;
}
}
}
///////////////////////////////////////////////////////////////////////////////
Decoration *createDecoration(DecorationType type) {
switch (type) {
case DECO_SIMPLE:
return new DecoSimple;
case DECO_SCHEMATIC:
return new DecoSchematic;
//case DECO_LSYSTEM:
// return new DecoLSystem;
default:
return NULL;
}
}
Decoration::Decoration() {
mapseed = 0;
np = NULL;
fill_ratio = 0;
sidelen = 1;
}
Decoration::~Decoration() {
delete np;
}
void Decoration::resolveNodeNames(INodeDefManager *ndef) {
this->ndef = ndef;
if (c_place_on == CONTENT_IGNORE)
c_place_on = ndef->getId(place_on_name);
}
void Decoration::placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) {
PseudoRandom ps(blockseed + 53);
int carea_size = nmax.X - nmin.X + 1;
// Divide area into parts
if (carea_size % sidelen) {
errorstream << "Decoration::placeDeco: chunk size is not divisible by "
"sidelen; setting sidelen to " << carea_size << std::endl;
sidelen = carea_size;
}
s16 divlen = carea_size / sidelen;
int area = sidelen * sidelen;
for (s16 z0 = 0; z0 < divlen; z0++)
for (s16 x0 = 0; x0 < divlen; x0++) {
v2s16 p2d_center( // Center position of part of division
nmin.X + sidelen / 2 + sidelen * x0,
nmin.Z + sidelen / 2 + sidelen * z0
);
v2s16 p2d_min( // Minimum edge of part of division
nmin.X + sidelen * x0,
nmin.Z + sidelen * z0
);
v2s16 p2d_max( // Maximum edge of part of division
nmin.X + sidelen + sidelen * x0 - 1,
nmin.Z + sidelen + sidelen * z0 - 1
);
// Amount of decorations
float nval = np ?
NoisePerlin2D(np, p2d_center.X, p2d_center.Y, mapseed) :
fill_ratio;
u32 deco_count = area * MYMAX(nval, 0.f);
for (u32 i = 0; i < deco_count; i++) {
s16 x = ps.range(p2d_min.X, p2d_max.X);
s16 z = ps.range(p2d_min.Y, p2d_max.Y);
int mapindex = carea_size * (z - nmin.Z) + (x - nmin.X);
s16 y = mg->heightmap ?
mg->heightmap[mapindex] :
mg->findGroundLevel(v2s16(x, z), nmin.Y, nmax.Y);
if (y < nmin.Y || y > nmax.Y)
continue;
int height = getHeight();
int max_y = nmax.Y;// + MAP_BLOCKSIZE - 1;
if (y + 1 + height > max_y) {
continue;
#if 0
printf("Decoration at (%d %d %d) cut off\n", x, y, z);
//add to queue
JMutexAutoLock cutofflock(cutoff_mutex);
cutoffs.push_back(CutoffData(x, y, z, height));
#endif
}
if (mg->biomemap) {
std::set<u8>::iterator iter;
if (biomes.size()) {
iter = biomes.find(mg->biomemap[mapindex]);
if (iter == biomes.end())
continue;
}
}
generate(mg, &ps, max_y, v3s16(x, y, z));
}
}
}
#if 0
void Decoration::placeCutoffs(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) {
PseudoRandom pr(blockseed + 53);
std::vector<CutoffData> handled_cutoffs;
// Copy over the cutoffs we're interested in so we don't needlessly hold a lock
{
JMutexAutoLock cutofflock(cutoff_mutex);
for (std::list<CutoffData>::iterator i = cutoffs.begin();
i != cutoffs.end(); ++i) {
CutoffData cutoff = *i;
v3s16 p = cutoff.p;
s16 height = cutoff.height;
if (p.X < nmin.X || p.X > nmax.X ||
p.Z < nmin.Z || p.Z > nmax.Z)
continue;
if (p.Y + height < nmin.Y || p.Y > nmax.Y)
continue;
handled_cutoffs.push_back(cutoff);
}
}
// Generate the cutoffs
for (size_t i = 0; i != handled_cutoffs.size(); i++) {
v3s16 p = handled_cutoffs[i].p;
s16 height = handled_cutoffs[i].height;
if (p.Y + height > nmax.Y) {
//printf("Decoration at (%d %d %d) cut off again!\n", p.X, p.Y, p.Z);
cuttoffs.push_back(v3s16(p.X, p.Y, p.Z));
}
generate(mg, &pr, nmax.Y, nmin.Y - p.Y, v3s16(p.X, nmin.Y, p.Z));
}
// Remove cutoffs that were handled from the cutoff list
{
JMutexAutoLock cutofflock(cutoff_mutex);
for (std::list<CutoffData>::iterator i = cutoffs.begin();
i != cutoffs.end(); ++i) {
for (size_t j = 0; j != handled_cutoffs.size(); j++) {
CutoffData coff = *i;
if (coff.p == handled_cutoffs[j].p)
i = cutoffs.erase(i);
}
}
}
}
#endif
///////////////////////////////////////////////////////////////////////////////
void DecoSimple::resolveNodeNames(INodeDefManager *ndef) {
Decoration::resolveNodeNames(ndef);
if (c_deco == CONTENT_IGNORE && !decolist_names.size()) {
c_deco = ndef->getId(deco_name);
if (c_deco == CONTENT_IGNORE) {
errorstream << "DecoSimple::resolveNodeNames: decoration node '"
<< deco_name << "' not defined" << std::endl;
c_deco = CONTENT_AIR;
}
}
if (c_spawnby == CONTENT_IGNORE) {
c_spawnby = ndef->getId(spawnby_name);
if (c_spawnby == CONTENT_IGNORE) {
errorstream << "DecoSimple::resolveNodeNames: spawnby node '"
<< spawnby_name << "' not defined" << std::endl;
nspawnby = -1;
c_spawnby = CONTENT_AIR;
}
}
if (c_decolist.size())
return;
for (size_t i = 0; i != decolist_names.size(); i++) {
content_t c = ndef->getId(decolist_names[i]);
if (c == CONTENT_IGNORE) {
errorstream << "DecoSimple::resolveNodeNames: decolist node '"
<< decolist_names[i] << "' not defined" << std::endl;
c = CONTENT_AIR;
}
c_decolist.push_back(c);
}
}
void DecoSimple::generate(Mapgen *mg, PseudoRandom *pr, s16 max_y, v3s16 p) {
ManualMapVoxelManipulator *vm = mg->vm;
u32 vi = vm->m_area.index(p);
if (vm->m_data[vi].getContent() != c_place_on &&
c_place_on != CONTENT_IGNORE)
return;
if (nspawnby != -1) {
int nneighs = 0;
v3s16 dirs[8] = { // a Moore neighborhood
v3s16( 0, 0, 1),
v3s16( 0, 0, -1),
v3s16( 1, 0, 0),
v3s16(-1, 0, 0),
v3s16( 1, 0, 1),
v3s16(-1, 0, 1),
v3s16(-1, 0, -1),
v3s16( 1, 0, -1)
};
for (int i = 0; i != 8; i++) {
u32 index = vm->m_area.index(p + dirs[i]);
if (vm->m_area.contains(index) &&
vm->m_data[index].getContent() == c_spawnby)
nneighs++;
}
if (nneighs < nspawnby)
return;
}
size_t ndecos = c_decolist.size();
content_t c_place = ndecos ? c_decolist[pr->range(0, ndecos - 1)] : c_deco;
s16 height = (deco_height_max > 0) ?
pr->range(deco_height, deco_height_max) : deco_height;
height = MYMIN(height, max_y - p.Y);
v3s16 em = vm->m_area.getExtent();
for (int i = 0; i < height; i++) {
vm->m_area.add_y(em, vi, 1);
content_t c = vm->m_data[vi].getContent();
if (c != CONTENT_AIR && c != CONTENT_IGNORE)
break;
vm->m_data[vi] = MapNode(c_place);
}
}
int DecoSimple::getHeight() {
return (deco_height_max > 0) ? deco_height_max : deco_height;
}
std::string DecoSimple::getName() {
return deco_name;
}
///////////////////////////////////////////////////////////////////////////////
DecoSchematic::DecoSchematic() {
node_names = NULL;
schematic = NULL;
slice_probs = NULL;
flags = 0;
size = v3s16(0, 0, 0);
}
DecoSchematic::~DecoSchematic() {
delete node_names;
delete []schematic;
delete []slice_probs;
}
void DecoSchematic::resolveNodeNames(INodeDefManager *ndef) {
Decoration::resolveNodeNames(ndef);
if (filename.empty())
return;
if (!node_names) {
errorstream << "DecoSchematic::resolveNodeNames: node name list was "
"not created" << std::endl;
return;
}
for (size_t i = 0; i != node_names->size(); i++) {
std::string name = node_names->at(i);
std::map<std::string, std::string>::iterator it;
it = replacements.find(name);
if (it != replacements.end())
name = it->second;
content_t c = ndef->getId(name);
if (c == CONTENT_IGNORE) {
errorstream << "DecoSchematic::resolveNodeNames: node '"
<< name << "' not defined" << std::endl;
c = CONTENT_AIR;
}
c_nodes.push_back(c);
}
for (int i = 0; i != size.X * size.Y * size.Z; i++)
schematic[i].setContent(c_nodes[schematic[i].getContent()]);
delete node_names;
node_names = NULL;
}
void DecoSchematic::generate(Mapgen *mg, PseudoRandom *pr, s16 max_y, v3s16 p) {
ManualMapVoxelManipulator *vm = mg->vm;
if (flags & DECO_PLACE_CENTER_X)
p.X -= (size.X + 1) / 2;
if (flags & DECO_PLACE_CENTER_Y)
p.Y -= (size.Y + 1) / 2;
if (flags & DECO_PLACE_CENTER_Z)
p.Z -= (size.Z + 1) / 2;
u32 vi = vm->m_area.index(p);
if (vm->m_data[vi].getContent() != c_place_on &&
c_place_on != CONTENT_IGNORE)
return;
Rotation rot = (rotation == ROTATE_RAND) ?
(Rotation)pr->range(ROTATE_0, ROTATE_270) : rotation;
blitToVManip(p, vm, rot, false);
}
int DecoSchematic::getHeight() {
return size.Y;
}
std::string DecoSchematic::getName() {
return filename;
}
void DecoSchematic::blitToVManip(v3s16 p, ManualMapVoxelManipulator *vm,
Rotation rot, bool force_placement) {
int xstride = 1;
int ystride = size.X;
int zstride = size.X * size.Y;
s16 sx = size.X;
s16 sy = size.Y;
s16 sz = size.Z;
int i_start, i_step_x, i_step_z;
switch (rot) {
case ROTATE_90:
i_start = sx - 1;
i_step_x = zstride;
i_step_z = -xstride;
SWAP(s16, sx, sz);
break;
case ROTATE_180:
i_start = zstride * (sz - 1) + sx - 1;
i_step_x = -xstride;
i_step_z = -zstride;
break;
case ROTATE_270:
i_start = zstride * (sz - 1);
i_step_x = -zstride;
i_step_z = xstride;
SWAP(s16, sx, sz);
break;
default:
i_start = 0;
i_step_x = xstride;
i_step_z = zstride;
}
s16 y_map = p.Y;
for (s16 y = 0; y != sy; y++) {
if (slice_probs[y] != MTSCHEM_PROB_ALWAYS &&
myrand_range(1, 255) > slice_probs[y])
continue;
for (s16 z = 0; z != sz; z++) {
u32 i = z * i_step_z + y * ystride + i_start;
for (s16 x = 0; x != sx; x++, i += i_step_x) {
u32 vi = vm->m_area.index(p.X + x, y_map, p.Z + z);
if (!vm->m_area.contains(vi))
continue;
if (schematic[i].getContent() == CONTENT_IGNORE)
continue;
if (schematic[i].param1 == MTSCHEM_PROB_NEVER)
continue;
if (!force_placement) {
content_t c = vm->m_data[vi].getContent();
if (c != CONTENT_AIR && c != CONTENT_IGNORE)
continue;
}
if (schematic[i].param1 != MTSCHEM_PROB_ALWAYS &&
myrand_range(1, 255) > schematic[i].param1)
continue;
vm->m_data[vi] = schematic[i];
vm->m_data[vi].param1 = 0;
if (rot)
vm->m_data[vi].rotateAlongYAxis(ndef, rot);
}
}
y_map++;
}
}
void DecoSchematic::placeStructure(Map *map, v3s16 p, bool force_placement) {
assert(schematic != NULL);
ManualMapVoxelManipulator *vm = new ManualMapVoxelManipulator(map);
Rotation rot = (rotation == ROTATE_RAND) ?
(Rotation)myrand_range(ROTATE_0, ROTATE_270) : rotation;
v3s16 s = (rot == ROTATE_90 || rot == ROTATE_270) ?
v3s16(size.Z, size.Y, size.X) : size;
if (flags & DECO_PLACE_CENTER_X)
p.X -= (s.X + 1) / 2;
if (flags & DECO_PLACE_CENTER_Y)
p.Y -= (s.Y + 1) / 2;
if (flags & DECO_PLACE_CENTER_Z)
p.Z -= (s.Z + 1) / 2;
v3s16 bp1 = getNodeBlockPos(p);
v3s16 bp2 = getNodeBlockPos(p + s - v3s16(1,1,1));
vm->initialEmerge(bp1, bp2);
blitToVManip(p, vm, rot, force_placement);
std::map<v3s16, MapBlock *> lighting_modified_blocks;
std::map<v3s16, MapBlock *> modified_blocks;
vm->blitBackAll(&modified_blocks);
// TODO: Optimize this by using Mapgen::calcLighting() instead
lighting_modified_blocks.insert(modified_blocks.begin(), modified_blocks.end());
map->updateLighting(lighting_modified_blocks, modified_blocks);
MapEditEvent event;
event.type = MEET_OTHER;
for (std::map<v3s16, MapBlock *>::iterator
it = modified_blocks.begin();
it != modified_blocks.end(); ++it)
event.modified_blocks.insert(it->first);
map->dispatchEvent(&event);
}
bool DecoSchematic::loadSchematicFile() {
content_t cignore = CONTENT_IGNORE;
bool have_cignore = false;
std::ifstream is(filename.c_str(), std::ios_base::binary);
u32 signature = readU32(is);
if (signature != MTSCHEM_FILE_SIGNATURE) {
errorstream << "loadSchematicFile: invalid schematic "
"file" << std::endl;
return false;
}
u16 version = readU16(is);
if (version > MTSCHEM_FILE_VER_HIGHEST_READ) {
errorstream << "loadSchematicFile: unsupported schematic "
"file version" << std::endl;
return false;
}
size = readV3S16(is);
delete []slice_probs;
slice_probs = new u8[size.Y];
if (version >= 3) {
for (int y = 0; y != size.Y; y++)
slice_probs[y] = readU8(is);
} else {
for (int y = 0; y != size.Y; y++)
slice_probs[y] = MTSCHEM_PROB_ALWAYS;
}
int nodecount = size.X * size.Y * size.Z;
u16 nidmapcount = readU16(is);
node_names = new std::vector<std::string>;
for (int i = 0; i != nidmapcount; i++) {
std::string name = deSerializeString(is);
if (name == "ignore") {
name = "air";
cignore = i;
have_cignore = true;
}
node_names->push_back(name);
}
delete []schematic;
schematic = new MapNode[nodecount];
MapNode::deSerializeBulk(is, SER_FMT_VER_HIGHEST_READ, schematic,
nodecount, 2, 2, true);
if (version == 1) { // fix up the probability values
for (int i = 0; i != nodecount; i++) {
if (schematic[i].param1 == 0)
schematic[i].param1 = MTSCHEM_PROB_ALWAYS;
if (have_cignore && schematic[i].getContent() == cignore)
schematic[i].param1 = MTSCHEM_PROB_NEVER;
}
}
return true;
}
/*
Minetest Schematic File Format
All values are stored in big-endian byte order.
[u32] signature: 'MTSM'
[u16] version: 3
[u16] size X
[u16] size Y
[u16] size Z
For each Y:
[u8] slice probability value
[Name-ID table] Name ID Mapping Table
[u16] name-id count
For each name-id mapping:
[u16] name length
[u8[]] name
ZLib deflated {
For each node in schematic: (for z, y, x)
[u16] content
For each node in schematic:
[u8] probability of occurance (param1)
For each node in schematic:
[u8] param2
}
Version changes:
1 - Initial version
2 - Fixed messy never/always place; 0 probability is now never, 0xFF is always
3 - Added y-slice probabilities; this allows for variable height structures
*/
void DecoSchematic::saveSchematicFile(INodeDefManager *ndef) {
std::ostringstream ss(std::ios_base::binary);
writeU32(ss, MTSCHEM_FILE_SIGNATURE); // signature
writeU16(ss, MTSCHEM_FILE_VER_HIGHEST_WRITE); // version
writeV3S16(ss, size); // schematic size
for (int y = 0; y != size.Y; y++) // Y slice probabilities
writeU8(ss, slice_probs[y]);
std::vector<content_t> usednodes;
int nodecount = size.X * size.Y * size.Z;
build_nnlist_and_update_ids(schematic, nodecount, &usednodes);
u16 numids = usednodes.size();
writeU16(ss, numids); // name count
for (int i = 0; i != numids; i++)
ss << serializeString(ndef->get(usednodes[i]).name); // node names
// compressed bulk node data
MapNode::serializeBulk(ss, SER_FMT_VER_HIGHEST_WRITE, schematic,
nodecount, 2, 2, true);
fs::safeWriteToFile(filename, ss.str());
}
void build_nnlist_and_update_ids(MapNode *nodes, u32 nodecount,
std::vector<content_t> *usednodes) {
std::map<content_t, content_t> nodeidmap;
content_t numids = 0;
for (u32 i = 0; i != nodecount; i++) {
content_t id;
content_t c = nodes[i].getContent();
std::map<content_t, content_t>::const_iterator it = nodeidmap.find(c);
if (it == nodeidmap.end()) {
id = numids;
numids++;
usednodes->push_back(c);
nodeidmap.insert(std::make_pair(c, id));
} else {
id = it->second;
}
nodes[i].setContent(id);
}
}
bool DecoSchematic::getSchematicFromMap(Map *map, v3s16 p1, v3s16 p2) {
ManualMapVoxelManipulator *vm = new ManualMapVoxelManipulator(map);
v3s16 bp1 = getNodeBlockPos(p1);
v3s16 bp2 = getNodeBlockPos(p2);
vm->initialEmerge(bp1, bp2);
size = p2 - p1 + 1;
slice_probs = new u8[size.Y];
for (s16 y = 0; y != size.Y; y++)
slice_probs[y] = MTSCHEM_PROB_ALWAYS;
schematic = new MapNode[size.X * size.Y * size.Z];
u32 i = 0;
for (s16 z = p1.Z; z <= p2.Z; z++)
for (s16 y = p1.Y; y <= p2.Y; y++) {
u32 vi = vm->m_area.index(p1.X, y, z);
for (s16 x = p1.X; x <= p2.X; x++, i++, vi++) {
schematic[i] = vm->m_data[vi];
schematic[i].param1 = MTSCHEM_PROB_ALWAYS;
}
}
delete vm;
return true;
}
void DecoSchematic::applyProbabilities(v3s16 p0,
std::vector<std::pair<v3s16, u8> > *plist,
std::vector<std::pair<s16, u8> > *splist) {
for (size_t i = 0; i != plist->size(); i++) {
v3s16 p = (*plist)[i].first - p0;
int index = p.Z * (size.Y * size.X) + p.Y * size.X + p.X;
if (index < size.Z * size.Y * size.X) {
u8 prob = (*plist)[i].second;
schematic[index].param1 = prob;
// trim unnecessary node names from schematic
if (prob == MTSCHEM_PROB_NEVER)
schematic[index].setContent(CONTENT_AIR);
}
}
for (size_t i = 0; i != splist->size(); i++) {
s16 y = (*splist)[i].first - p0.Y;
slice_probs[y] = (*splist)[i].second;
}
}
///////////////////////////////////////////////////////////////////////////////
Mapgen::Mapgen() {
seed = 0;
water_level = 0;
generating = false;
id = -1;
vm = NULL;
ndef = NULL;
heightmap = NULL;
biomemap = NULL;
for (unsigned int i = 0; i != NUM_GEN_NOTIFY; i++)
gen_notifications[i] = new std::vector<v3s16>;
}
Mapgen::~Mapgen() {
for (unsigned int i = 0; i != NUM_GEN_NOTIFY; i++)
delete gen_notifications[i];
}
// Returns Y one under area minimum if not found
s16 Mapgen::findGroundLevelFull(v2s16 p2d) {
v3s16 em = vm->m_area.getExtent();
s16 y_nodes_max = vm->m_area.MaxEdge.Y;
s16 y_nodes_min = vm->m_area.MinEdge.Y;
u32 i = vm->m_area.index(p2d.X, y_nodes_max, p2d.Y);
s16 y;
for (y = y_nodes_max; y >= y_nodes_min; y--) {
MapNode &n = vm->m_data[i];
if (ndef->get(n).walkable)
break;
vm->m_area.add_y(em, i, -1);
}
return (y >= y_nodes_min) ? y : y_nodes_min - 1;
}
s16 Mapgen::findGroundLevel(v2s16 p2d, s16 ymin, s16 ymax) {
v3s16 em = vm->m_area.getExtent();
u32 i = vm->m_area.index(p2d.X, ymax, p2d.Y);
s16 y;
for (y = ymax; y >= ymin; y--) {
MapNode &n = vm->m_data[i];
if (ndef->get(n).walkable)
break;
vm->m_area.add_y(em, i, -1);
}
return y;
}
void Mapgen::updateHeightmap(v3s16 nmin, v3s16 nmax) {
if (!heightmap)
return;
//TimeTaker t("Mapgen::updateHeightmap", NULL, PRECISION_MICRO);
int index = 0;
for (s16 z = nmin.Z; z <= nmax.Z; z++) {
for (s16 x = nmin.X; x <= nmax.X; x++, index++) {
s16 y = findGroundLevel(v2s16(x, z), nmin.Y, nmax.Y);
// if the values found are out of range, trust the old heightmap
if (y == nmax.Y && heightmap[index] > nmax.Y)
continue;
if (y == nmin.Y - 1 && heightmap[index] < nmin.Y)
continue;
heightmap[index] = y;
}
}
//printf("updateHeightmap: %dus\n", t.stop());
}
void Mapgen::updateLiquid(UniqueQueue<v3s16> *trans_liquid, v3s16 nmin, v3s16 nmax) {
bool isliquid, wasliquid;
v3s16 em = vm->m_area.getExtent();
for (s16 z = nmin.Z; z <= nmax.Z; z++) {
for (s16 x = nmin.X; x <= nmax.X; x++) {
wasliquid = true;
u32 i = vm->m_area.index(x, nmax.Y, z);
for (s16 y = nmax.Y; y >= nmin.Y; y--) {
isliquid = ndef->get(vm->m_data[i]).isLiquid();
// there was a change between liquid and nonliquid, add to queue.
if (isliquid != wasliquid)
trans_liquid->push_back(v3s16(x, y, z));
wasliquid = isliquid;
vm->m_area.add_y(em, i, -1);
}
}
}
}
void Mapgen::setLighting(v3s16 nmin, v3s16 nmax, u8 light) {
ScopeProfiler sp(g_profiler, "EmergeThread: mapgen lighting update", SPT_AVG);
VoxelArea a(nmin, nmax);
for (int z = a.MinEdge.Z; z <= a.MaxEdge.Z; z++) {
for (int y = a.MinEdge.Y; y <= a.MaxEdge.Y; y++) {
u32 i = vm->m_area.index(a.MinEdge.X, y, z);
for (int x = a.MinEdge.X; x <= a.MaxEdge.X; x++, i++)
vm->m_data[i].param1 = light;
}
}
}
void Mapgen::lightSpread(VoxelArea &a, v3s16 p, u8 light) {
if (light <= 1 || !a.contains(p))
return;
u32 vi = vm->m_area.index(p);
MapNode &nn = vm->m_data[vi];
light--;
// should probably compare masked, but doesn't seem to make a difference
if (light <= nn.param1 || !ndef->get(nn).light_propagates)
return;
nn.param1 = light;
lightSpread(a, p + v3s16(0, 0, 1), light);
lightSpread(a, p + v3s16(0, 1, 0), light);
lightSpread(a, p + v3s16(1, 0, 0), light);
lightSpread(a, p - v3s16(0, 0, 1), light);
lightSpread(a, p - v3s16(0, 1, 0), light);
lightSpread(a, p - v3s16(1, 0, 0), light);
}
void Mapgen::calcLighting(v3s16 nmin, v3s16 nmax) {
VoxelArea a(nmin, nmax);
bool block_is_underground = (water_level >= nmax.Y);
ScopeProfiler sp(g_profiler, "EmergeThread: mapgen lighting update", SPT_AVG);
//TimeTaker t("updateLighting");
// first, send vertical rays of sunshine downward
v3s16 em = vm->m_area.getExtent();
for (int z = a.MinEdge.Z; z <= a.MaxEdge.Z; z++) {
for (int x = a.MinEdge.X; x <= a.MaxEdge.X; x++) {
// see if we can get a light value from the overtop
u32 i = vm->m_area.index(x, a.MaxEdge.Y + 1, z);
if (vm->m_data[i].getContent() == CONTENT_IGNORE) {
if (block_is_underground)
continue;
} else if ((vm->m_data[i].param1 & 0x0F) != LIGHT_SUN) {
continue;
}
vm->m_area.add_y(em, i, -1);
for (int y = a.MaxEdge.Y; y >= a.MinEdge.Y; y--) {
MapNode &n = vm->m_data[i];
if (!ndef->get(n).sunlight_propagates)
break;
n.param1 = LIGHT_SUN;
vm->m_area.add_y(em, i, -1);
}
}
}
// now spread the sunlight and light up any sources
for (int z = a.MinEdge.Z; z <= a.MaxEdge.Z; z++) {
for (int y = a.MinEdge.Y; y <= a.MaxEdge.Y; y++) {
u32 i = vm->m_area.index(a.MinEdge.X, y, z);
for (int x = a.MinEdge.X; x <= a.MaxEdge.X; x++, i++) {
MapNode &n = vm->m_data[i];
if (n.getContent() == CONTENT_IGNORE ||
!ndef->get(n).light_propagates)
continue;
u8 light_produced = ndef->get(n).light_source & 0x0F;
if (light_produced)
n.param1 = light_produced;
u8 light = n.param1 & 0x0F;
if (light) {
lightSpread(a, v3s16(x, y, z + 1), light - 1);
lightSpread(a, v3s16(x, y + 1, z ), light - 1);
lightSpread(a, v3s16(x + 1, y, z ), light - 1);
lightSpread(a, v3s16(x, y, z - 1), light - 1);
lightSpread(a, v3s16(x, y - 1, z ), light - 1);
lightSpread(a, v3s16(x - 1, y, z ), light - 1);
}
}
}
}
//printf("updateLighting: %dms\n", t.stop());
}
void Mapgen::calcLightingOld(v3s16 nmin, v3s16 nmax) {
enum LightBank banks[2] = {LIGHTBANK_DAY, LIGHTBANK_NIGHT};
VoxelArea a(nmin, nmax);
bool block_is_underground = (water_level > nmax.Y);
bool sunlight = !block_is_underground;
ScopeProfiler sp(g_profiler, "EmergeThread: mapgen lighting update", SPT_AVG);
for (int i = 0; i < 2; i++) {
enum LightBank bank = banks[i];
std::set<v3s16> light_sources;
std::map<v3s16, u8> unlight_from;
voxalgo::clearLightAndCollectSources(*vm, a, bank, ndef,
light_sources, unlight_from);
voxalgo::propagateSunlight(*vm, a, sunlight, light_sources, ndef);
vm->unspreadLight(bank, unlight_from, light_sources, ndef);
vm->spreadLight(bank, light_sources, ndef);
}
}
| Megaf/MinetestPi-Raspbian | src/mapgen.cpp | C++ | gpl-2.0 | 28,598 |
// qt-redmine client
// Copyright (C) 2015, Danila Demidow
// Author: dandemidow@gmail.com (Danila Demidow)
#ifndef INCLUDING
#define INCLUDING
#include <QString>
#include <QUrl>
#include "parameter.h"
template <class Self>
class Includeble {
QString _include;
public:
explicit Includeble() {}
Self &operator <<(const Include &i) {
this->_include = i.getInclude();
return *(static_cast<Self*>(this));
}
Self &operator <<(const Filter &f) {
this->_include = f.getFilter();
return *(static_cast<Self*>(this));
}
QString query() const {
return _include;
}
void setQuery(QUrl &url) const {
url.setQuery(_include);
}
};
#endif // INCLUDING
| dandemidow/qt-redmine | including.h | C | gpl-2.0 | 687 |
/*
* Copyright (c) 2011 NVIDIA Corporation. All Rights Reserved.
*
* NVIDIA Corporation and its licensors retain all intellectual property and
* proprietary rights in and to this software and related documentation. Any
* use, reproduction, disclosure or distribution of this software and related
* documentation without an express license agreement from NVIDIA Corporation
* is strictly prohibited.
*/
#include <stdio.h>
#include <cutils/properties.h>
#include "Config.h"
#undef LOG_TAG
#define LOG_TAG "nvcpu:Config"
namespace android {
namespace nvcpu {
//This is infrequent by default
const Config::Property Config::refreshMsProp("nvcpud.config_refresh_ms", "45555");
const Config::Property Config::enabledProp("nvcpud.enabled", "false");
const Config::Property Config::bootCompleteProp("dev.bootcomplete", "false");
void Config::Property::get(char* out) const
{
property_get(key.string(), out, def.string());
}
bool Config::checkBootComplete()
{
char buff[PROPERTY_VALUE_MAX];
// reading property while the system is not completely
// booted can return 0 because the property service think
// the key does not exist at the time we read.
// However, it is safe to read dev.bootcomplete here since
// we are waiting it to be 1 or true
bootCompleteProp.get(buff);
if ((0 == strcmp(buff, "false")) ||
(0 == strcmp(buff, "0"))) {
bootCompleted = false;
} else if ((0 == strcmp(buff, "true")) ||
(0 == strcmp(buff, "1"))) {
bootCompleted = true;
}
return bootCompleted;
}
void Config::refresh()
{
char buff[PROPERTY_VALUE_MAX];
refreshMsProp.get(buff);
//We accept negative values for "never again"
int refreshMs;
if (sscanf(buff, "%d", &refreshMs) == 1) {
configRefreshNs = milliseconds_to_nanoseconds(refreshMs);
}
enabledProp.get(buff);
if (0 == strcmp(buff, "false")) {
enabled = false;
} else if (0 == strcmp(buff, "true")) {
enabled = true;
}
}
}; //nvcpu
}; //android
| DmitryADP/diff_qc750 | vendor/nvidia/tegra/hal/libnvcpud/services/Config.cpp | C++ | gpl-2.0 | 2,049 |
# Copyright (c) 2008 Duncan Fordyce
# 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.
import socket
import time
import traceback
from oyoyo.parse import *
from oyoyo import helpers
from oyoyo.cmdhandler import CommandError
class IRCClientError(Exception):
pass
class IRCClient:
""" IRC Client class. This handles one connection to a server.
This can be used either with or without IRCApp ( see connect() docs )
"""
def __init__(self, cmd_handler, **kwargs):
""" the first argument should be an object with attributes/methods named
as the irc commands. You may subclass from one of the classes in
oyoyo.cmdhandler for convenience but it is not required. The
methods should have arguments (prefix, args). prefix is
normally the sender of the command. args is a list of arguments.
Its recommened you subclass oyoyo.cmdhandler.DefaultCommandHandler,
this class provides defaults for callbacks that are required for
normal IRC operation.
all other arguments should be keyword arguments. The most commonly
used will be nick, host and port. You can also specify an "on connect"
callback. ( check the source for others )
Warning: By default this class will not block on socket operations, this
means if you use a plain while loop your app will consume 100% cpu.
To enable blocking pass blocking=True.
>>> from oyoyo import helpers >>> class My_Handler(DefaultCommandHandler):
... def privmsg(self, prefix, command, args):
... print "%s said %s" % (prefix, args[1])
...
>>> def connect_callback(c):
... helpers.join(c, '#myroom')
...
>>> cli = IRCClient(My_Handler,
... host="irc.freenode.net",
... port=6667,
... nick="myname",
... connect_cb=connect_callback)
...
>>> cli_con = cli.connect()
>>> while 1:
... cli_con.next()
...
"""
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.nick = None
self.real_name = None
self.host = None
self.port = None
self.connect_cb = None
self.blocking = False
self.__dict__.update(kwargs)
self.command_handler = cmd_handler(self)
self._end = 0
def send(self, *args, **kwargs):
""" send a message to the connected server. all arguments are joined
with a space for convenience, for example the following are identical
>>> cli.send("JOIN %s" % some_room)
>>> cli.send("JOIN", some_room)
In python 2, all args must be of type str or unicode, *BUT* if they are
unicode they will be converted to str with the encoding specified by
the 'encoding' keyword argument (default 'utf8').
In python 3, all args must be of type str or bytes, *BUT* if they are
str they will be converted to bytes with the encoding specified by the
'encoding' keyword argument (default 'utf8').
"""
# Convert all args to bytes if not already
encoding = kwargs.get('encoding') or 'utf8'
bargs = []
for arg in args:
if isinstance(arg, str):
bargs.append(bytes(arg, encoding))
elif isinstance(arg, bytes):
bargs.append(arg)
elif type(arg).__name__ == 'unicode':
bargs.append(arg.encode(encoding))
else:
raise IRCClientError('Refusing to send one of the args from provided: %s'
% repr([(type(arg), arg) for arg in args]))
msg = bytes(" ", "ascii").join(bargs)
logging.info('---> send "%s"' % msg)
self.socket.send(msg + bytes("\r\n", "ascii"))
def connect(self):
""" initiates the connection to the server set in self.host:self.port
and returns a generator object.
>>> cli = IRCClient(my_handler, host="irc.freenode.net", port=6667)
>>> g = cli.connect()
>>> while 1:
... g.next()
"""
try:
logging.info('connecting to %s:%s' % (self.host, self.port))
self.socket.connect(("%s" % self.host, self.port))
if self.blocking:
# this also overrides default timeout
self.socket.setblocking(1)
else:
self.socket.setblocking(0)
helpers.nick(self, self.nick)
helpers.user(self, self.nick, self.real_name)
if self.connect_cb:
self.connect_cb(self)
buffer = bytes()
while not self._end:
try:
buffer += self.socket.recv(1024)
except socket.error as e:
try: # a little dance of compatibility to get the errno
errno = e.errno
except AttributeError:
errno = e[0]
if not self.blocking and errno == 11:
pass
else:
raise e
else:
data = buffer.split(bytes("\n", "ascii"))
buffer = data.pop()
for el in data:
prefix, command, args = parse_raw_irc_command(el)
try:
self.command_handler.run(command, prefix, *args)
except CommandError:
# error will of already been loggingged by the handler
pass
yield True
finally:
if self.socket:
logging.info('closing socket')
self.socket.close()
# noinspection PyPep8Naming
class IRCApp:
""" This class manages several IRCClient instances without the use of threads.
(Non-threaded) Timer functionality is also included.
"""
class _ClientDesc:
def __init__(self, **kwargs):
self.con = None
self.autoreconnect = False
self.__dict__.update(kwargs)
def __init__(self):
self._clients = {}
self._timers = []
self.running = False
self.sleep_time = 0.5
def addClient(self, client, autoreconnect=False):
""" add a client object to the application. setting autoreconnect
to true will mean the application will attempt to reconnect the client
after every disconnect. you can also set autoreconnect to a number
to specify how many reconnects should happen.
warning: if you add a client that has blocking set to true,
timers will no longer function properly """
logging.info('added client %s (ar=%s)' % (client, autoreconnect))
self._clients[client] = self._ClientDesc(autoreconnect=autoreconnect)
def addTimer(self, seconds, cb):
""" add a timed callback. accuracy is not specified, you can only
garuntee the callback will be called after seconds has passed.
( the only advantage to these timers is they dont use threads )
"""
assert callable(cb)
logging.info('added timer to call %s in %ss' % (cb, seconds))
self._timers.append((time.time() + seconds, cb))
def run(self):
""" run the application. this will block until stop() is called """
# TODO: convert this to use generators too?
self.running = True
while self.running:
found_one_alive = False
for client, clientdesc in self._clients.items():
if clientdesc.con is None:
clientdesc.con = client.connect()
try:
clientdesc.con.next()
except Exception as e:
logging.error('client error %s' % e)
logging.error(traceback.format_exc())
if clientdesc.autoreconnect:
clientdesc.con = None
if isinstance(clientdesc.autoreconnect, (int, float)):
clientdesc.autoreconnect -= 1
found_one_alive = True
else:
clientdesc.con = False
else:
found_one_alive = True
if not found_one_alive:
logging.info('nothing left alive... quiting')
self.stop()
now = time.time()
timers = self._timers[:]
self._timers = []
for target_time, cb in timers:
if now > target_time:
logging.info('calling timer cb %s' % cb)
cb()
else:
self._timers.append((target_time, cb))
time.sleep(self.sleep_time)
def stop(self):
""" stop the application """
self.running = False
| FrodeSolheim/fs-uae-launcher | oyoyo/client.py | Python | gpl-2.0 | 10,090 |
<?php
/**
* Full Content Template
*
* Template Name: Logistics Da Nang Page
*
* @file sl-dng.php
* @package OMORI VN
* @author Ngoc Men
*
*/
get_header(); ?>
<img src="<?php echo get_template_directory_uri(); ?>/images/main-visual/logistics-bg.png" alt="" width="100%"/>
<div class="container">
<div class="row">
<h3 class="name-bg">ベトナムから日本までの輸送ルートと時間</h3>
</div>
</div>
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<div class="wrapper-body container">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 text-center">
<img src="<?php echo get_template_directory_uri(); ?>/images/services/sl_dng-bg-details.png" alt="" width="80%" height="80%">
</div>
</div>
</div>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?> | m0m0taku/omori | wp-content/themes/twentythirteen/sl-dng.php | PHP | gpl-2.0 | 908 |
<?php
/**
* Manages the social plugins.
*
* @copyright 2009-2015 Vanilla Forums Inc.
* @license http://www.opensource.org/licenses/gpl-2.0.php GNU GPL v2
* @package Dashboard
* @since 2.1
*/
/**
* Handles /social endpoint, so it must be an extrovert.
*/
class SocialController extends DashboardController {
/** @var array Models to automatically instantiate. */
public $Uses = array('Form', 'Database');
/**
* Runs before every call to this controller.
*/
public function initialize() {
parent::initialize();
Gdn_Theme::section('Dashboard');
}
/**
* Default method.
*/
public function index() {
redirect('social/manage');
}
/**
* Settings page.
*/
public function manage() {
$this->permission('Garden.Settings.Manage');
$this->title("Social Integration");
$this->addSideMenu('dashboard/social');
$Connections = $this->GetConnections();
$this->setData('Connections', $Connections);
$this->render();
}
/**
* Find available social plugins.
*
* @return array|mixed
* @throws Exception
*/
protected function getConnections() {
$this->fireEvent('GetConnections');
$Connections = $this->data('Connections', array());
if (!is_array($Connections)) {
$Connections = array();
}
foreach (Gdn::pluginManager()->AvailablePlugins() as $PluginKey => $PluginInfo) {
if (!array_key_exists('SocialConnect', $PluginInfo)) {
continue;
}
if (!array_key_exists($PluginKey, $Connections)) {
$Connections[$PluginKey] = array();
}
$ConnectionName = $PluginInfo['Index'];
if (Gdn::pluginManager()->CheckPlugin($PluginKey)) {
$Configured = Gdn::pluginManager()->GetPluginInstance($ConnectionName, Gdn_PluginManager::ACCESS_PLUGINNAME)->IsConfigured();
} else {
$Configured = null;
}
$Connections[$PluginKey] = array_merge($Connections[$PluginKey], $PluginInfo, array(
'Enabled' => Gdn::pluginManager()->CheckPlugin($PluginKey),
'Configured' => $Configured
), array(
'Icon' => sprintf("/plugins/%s/icon.png", $PluginInfo['Folder'])
));
}
return $Connections;
}
/**
* Turn off a social plugin.
*
* @param $Plugin
* @throws Exception
*/
public function disable($Plugin) {
$this->permission('Garden.Settings.Manage');
if (!Gdn::request()->isAuthenticatedPostBack(true)) {
throw new Exception('Requires POST', 405);
}
$Connections = $this->GetConnections();
unset($this->Data['Connections']);
if (!array_key_exists($Plugin, $Connections)) {
throw notFoundException('SocialConnect Plugin');
}
Gdn::pluginManager()->DisablePlugin($Plugin);
$Connections = $this->GetConnections();
$Connection = val($Plugin, $Connections);
require_once($this->fetchViewLocation('connection_functions'));
ob_start();
WriteConnection($Connection);
$Row = ob_get_clean();
$this->jsonTarget("#Provider_{$Connection['Index']}", $Row);
$this->informMessage(t("Plugin disabled."));
unset($this->Data['Connections']);
$this->render('blank', 'utility');
}
/**
* Turn on a social plugin.
*
* @param $Plugin
* @throws Exception
* @throws Gdn_UserException
*/
public function enable($Plugin) {
$this->permission('Garden.Settings.Manage');
if (!Gdn::request()->isAuthenticatedPostBack(true)) {
throw new Exception('Requires POST', 405);
}
$Connections = $this->GetConnections();
if (!array_key_exists($Plugin, $Connections)) {
throw notFoundException('SocialConnect Plugin');
}
Gdn::pluginManager()->EnablePlugin($Plugin, null);
$Connections = $this->GetConnections();
$Connection = val($Plugin, $Connections);
require_once($this->fetchViewLocation('connection_functions'));
ob_start();
WriteConnection($Connection);
$Row = ob_get_clean();
$this->jsonTarget("#Provider_{$Connection['Index']}", $Row);
$this->informMessage(t("Plugin enabled."));
unset($this->Data['Connections']);
$this->render('blank', 'utility');
}
}
| hgtonight/Garden | applications/dashboard/controllers/class.socialcontroller.php | PHP | gpl-2.0 | 4,592 |
@import url(http://fonts.googleapis.com/css?family=Oxygen:400,700);
/*
Created on : Feb 16, 2015, 5:35:50 PM
Author : snapper
*/
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%; }
body {
margin: 0; }
article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary {
display: block; }
audio, canvas, progress, video {
display: inline-block;
vertical-align: baseline; }
audio:not([controls]) {
display: none;
height: 0; }
[hidden], template {
display: none; }
a {
background-color: transparent; }
a:active, a:hover {
outline: 0; }
abbr[title] {
border-bottom: 1px dotted; }
b, strong {
font-weight: bold; }
dfn {
font-style: italic; }
h1 {
font-size: 2em;
margin: 0.67em 0; }
mark {
background: #ff0;
color: #000; }
small {
font-size: 80%; }
sub, sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline; }
sup {
top: -0.5em; }
sub {
bottom: -0.25em; }
img {
border: 0; }
svg:not(:root) {
overflow: hidden; }
figure {
margin: 1em 40px; }
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0; }
pre {
overflow: auto; }
code, kbd, pre, samp {
font-family: monospace, monospace;
font-size: 1em; }
button, input, optgroup, select, textarea {
color: inherit;
font: inherit;
margin: 0; }
button {
overflow: visible; }
button, select {
text-transform: none; }
button, html input[type="button"], input[type="reset"], input[type="submit"] {
-webkit-appearance: button;
cursor: pointer; }
button[disabled], html input[disabled] {
cursor: default; }
button::-moz-focus-inner, input::-moz-focus-inner {
border: 0;
padding: 0; }
input {
line-height: normal; }
input[type="checkbox"], input[type="radio"] {
box-sizing: border-box;
padding: 0; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button {
height: auto; }
input[type="search"] {
-webkit-appearance: textfield;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box; }
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none; }
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em; }
legend {
border: 0;
padding: 0; }
textarea {
overflow: auto; }
optgroup {
font-weight: bold; }
table {
border-collapse: collapse;
border-spacing: 0; }
td, th {
padding: 0; }
/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
@media print {
*, *:before, *:after {
background: transparent !important;
color: #000 !important;
box-shadow: none !important;
text-shadow: none !important; }
a, a:visited {
text-decoration: underline; }
a[href]:after {
content: " (" attr(href) ")"; }
abbr[title]:after {
content: " (" attr(title) ")"; }
a[href^="#"]:after, a[href^="javascript:"]:after {
content: ""; }
pre, blockquote {
border: 1px solid #999;
page-break-inside: avoid; }
thead {
display: table-header-group; }
tr, img {
page-break-inside: avoid; }
img {
max-width: 100% !important; }
p, h2, h3 {
orphans: 3;
widows: 3; }
h2, h3 {
page-break-after: avoid; }
select {
background: #fff !important; }
.navbar {
display: none; }
.btn > .caret, .dropup > .btn > .caret {
border-top-color: #000 !important; }
.label {
border: 1px solid #000; }
.table {
border-collapse: collapse !important; }
.table td, .table th {
background-color: #fff !important; }
.table-bordered th, .table-bordered td {
border: 1px solid #ddd !important; } }
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../fonts/bootstrap/glyphicons-halflings-regular.eot');
src: url('../fonts/bootstrap/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/bootstrap/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/bootstrap/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/bootstrap/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/bootstrap/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); }
.glyphicon {
position: relative;
top: 1px;
display: inline-block;
font-family: 'Glyphicons Halflings';
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; }
.glyphicon-asterisk:before {
content: "\2a"; }
.glyphicon-plus:before {
content: "\2b"; }
.glyphicon-euro:before, .glyphicon-eur:before {
content: "\20ac"; }
.glyphicon-minus:before {
content: "\2212"; }
.glyphicon-cloud:before {
content: "\2601"; }
.glyphicon-envelope:before {
content: "\2709"; }
.glyphicon-pencil:before {
content: "\270f"; }
.glyphicon-glass:before {
content: "\e001"; }
.glyphicon-music:before {
content: "\e002"; }
.glyphicon-search:before {
content: "\e003"; }
.glyphicon-heart:before {
content: "\e005"; }
.glyphicon-star:before {
content: "\e006"; }
.glyphicon-star-empty:before {
content: "\e007"; }
.glyphicon-user:before {
content: "\e008"; }
.glyphicon-film:before {
content: "\e009"; }
.glyphicon-th-large:before {
content: "\e010"; }
.glyphicon-th:before {
content: "\e011"; }
.glyphicon-th-list:before {
content: "\e012"; }
.glyphicon-ok:before {
content: "\e013"; }
.glyphicon-remove:before {
content: "\e014"; }
.glyphicon-zoom-in:before {
content: "\e015"; }
.glyphicon-zoom-out:before {
content: "\e016"; }
.glyphicon-off:before {
content: "\e017"; }
.glyphicon-signal:before {
content: "\e018"; }
.glyphicon-cog:before {
content: "\e019"; }
.glyphicon-trash:before {
content: "\e020"; }
.glyphicon-home:before {
content: "\e021"; }
.glyphicon-file:before {
content: "\e022"; }
.glyphicon-time:before {
content: "\e023"; }
.glyphicon-road:before {
content: "\e024"; }
.glyphicon-download-alt:before {
content: "\e025"; }
.glyphicon-download:before {
content: "\e026"; }
.glyphicon-upload:before {
content: "\e027"; }
.glyphicon-inbox:before {
content: "\e028"; }
.glyphicon-play-circle:before {
content: "\e029"; }
.glyphicon-repeat:before {
content: "\e030"; }
.glyphicon-refresh:before {
content: "\e031"; }
.glyphicon-list-alt:before {
content: "\e032"; }
.glyphicon-lock:before {
content: "\e033"; }
.glyphicon-flag:before {
content: "\e034"; }
.glyphicon-headphones:before {
content: "\e035"; }
.glyphicon-volume-off:before {
content: "\e036"; }
.glyphicon-volume-down:before {
content: "\e037"; }
.glyphicon-volume-up:before {
content: "\e038"; }
.glyphicon-qrcode:before {
content: "\e039"; }
.glyphicon-barcode:before {
content: "\e040"; }
.glyphicon-tag:before {
content: "\e041"; }
.glyphicon-tags:before {
content: "\e042"; }
.glyphicon-book:before {
content: "\e043"; }
.glyphicon-bookmark:before {
content: "\e044"; }
.glyphicon-print:before {
content: "\e045"; }
.glyphicon-camera:before {
content: "\e046"; }
.glyphicon-font:before {
content: "\e047"; }
.glyphicon-bold:before {
content: "\e048"; }
.glyphicon-italic:before {
content: "\e049"; }
.glyphicon-text-height:before {
content: "\e050"; }
.glyphicon-text-width:before {
content: "\e051"; }
.glyphicon-align-left:before {
content: "\e052"; }
.glyphicon-align-center:before {
content: "\e053"; }
.glyphicon-align-right:before {
content: "\e054"; }
.glyphicon-align-justify:before {
content: "\e055"; }
.glyphicon-list:before {
content: "\e056"; }
.glyphicon-indent-left:before {
content: "\e057"; }
.glyphicon-indent-right:before {
content: "\e058"; }
.glyphicon-facetime-video:before {
content: "\e059"; }
.glyphicon-picture:before {
content: "\e060"; }
.glyphicon-map-marker:before {
content: "\e062"; }
.glyphicon-adjust:before {
content: "\e063"; }
.glyphicon-tint:before {
content: "\e064"; }
.glyphicon-edit:before {
content: "\e065"; }
.glyphicon-share:before {
content: "\e066"; }
.glyphicon-check:before {
content: "\e067"; }
.glyphicon-move:before {
content: "\e068"; }
.glyphicon-step-backward:before {
content: "\e069"; }
.glyphicon-fast-backward:before {
content: "\e070"; }
.glyphicon-backward:before {
content: "\e071"; }
.glyphicon-play:before {
content: "\e072"; }
.glyphicon-pause:before {
content: "\e073"; }
.glyphicon-stop:before {
content: "\e074"; }
.glyphicon-forward:before {
content: "\e075"; }
.glyphicon-fast-forward:before {
content: "\e076"; }
.glyphicon-step-forward:before {
content: "\e077"; }
.glyphicon-eject:before {
content: "\e078"; }
.glyphicon-chevron-left:before {
content: "\e079"; }
.glyphicon-chevron-right:before {
content: "\e080"; }
.glyphicon-plus-sign:before {
content: "\e081"; }
.glyphicon-minus-sign:before {
content: "\e082"; }
.glyphicon-remove-sign:before {
content: "\e083"; }
.glyphicon-ok-sign:before {
content: "\e084"; }
.glyphicon-question-sign:before {
content: "\e085"; }
.glyphicon-info-sign:before {
content: "\e086"; }
.glyphicon-screenshot:before {
content: "\e087"; }
.glyphicon-remove-circle:before {
content: "\e088"; }
.glyphicon-ok-circle:before {
content: "\e089"; }
.glyphicon-ban-circle:before {
content: "\e090"; }
.glyphicon-arrow-left:before {
content: "\e091"; }
.glyphicon-arrow-right:before {
content: "\e092"; }
.glyphicon-arrow-up:before {
content: "\e093"; }
.glyphicon-arrow-down:before {
content: "\e094"; }
.glyphicon-share-alt:before {
content: "\e095"; }
.glyphicon-resize-full:before {
content: "\e096"; }
.glyphicon-resize-small:before {
content: "\e097"; }
.glyphicon-exclamation-sign:before {
content: "\e101"; }
.glyphicon-gift:before {
content: "\e102"; }
.glyphicon-leaf:before {
content: "\e103"; }
.glyphicon-fire:before {
content: "\e104"; }
.glyphicon-eye-open:before {
content: "\e105"; }
.glyphicon-eye-close:before {
content: "\e106"; }
.glyphicon-warning-sign:before {
content: "\e107"; }
.glyphicon-plane:before {
content: "\e108"; }
.glyphicon-calendar:before {
content: "\e109"; }
.glyphicon-random:before {
content: "\e110"; }
.glyphicon-comment:before {
content: "\e111"; }
.glyphicon-magnet:before {
content: "\e112"; }
.glyphicon-chevron-up:before {
content: "\e113"; }
.glyphicon-chevron-down:before {
content: "\e114"; }
.glyphicon-retweet:before {
content: "\e115"; }
.glyphicon-shopping-cart:before {
content: "\e116"; }
.glyphicon-folder-close:before {
content: "\e117"; }
.glyphicon-folder-open:before {
content: "\e118"; }
.glyphicon-resize-vertical:before {
content: "\e119"; }
.glyphicon-resize-horizontal:before {
content: "\e120"; }
.glyphicon-hdd:before {
content: "\e121"; }
.glyphicon-bullhorn:before {
content: "\e122"; }
.glyphicon-bell:before {
content: "\e123"; }
.glyphicon-certificate:before {
content: "\e124"; }
.glyphicon-thumbs-up:before {
content: "\e125"; }
.glyphicon-thumbs-down:before {
content: "\e126"; }
.glyphicon-hand-right:before {
content: "\e127"; }
.glyphicon-hand-left:before {
content: "\e128"; }
.glyphicon-hand-up:before {
content: "\e129"; }
.glyphicon-hand-down:before {
content: "\e130"; }
.glyphicon-circle-arrow-right:before {
content: "\e131"; }
.glyphicon-circle-arrow-left:before {
content: "\e132"; }
.glyphicon-circle-arrow-up:before {
content: "\e133"; }
.glyphicon-circle-arrow-down:before {
content: "\e134"; }
.glyphicon-globe:before {
content: "\e135"; }
.glyphicon-wrench:before {
content: "\e136"; }
.glyphicon-tasks:before {
content: "\e137"; }
.glyphicon-filter:before {
content: "\e138"; }
.glyphicon-briefcase:before {
content: "\e139"; }
.glyphicon-fullscreen:before {
content: "\e140"; }
.glyphicon-dashboard:before {
content: "\e141"; }
.glyphicon-paperclip:before {
content: "\e142"; }
.glyphicon-heart-empty:before {
content: "\e143"; }
.glyphicon-link:before {
content: "\e144"; }
.glyphicon-phone:before {
content: "\e145"; }
.glyphicon-pushpin:before {
content: "\e146"; }
.glyphicon-usd:before {
content: "\e148"; }
.glyphicon-gbp:before {
content: "\e149"; }
.glyphicon-sort:before {
content: "\e150"; }
.glyphicon-sort-by-alphabet:before {
content: "\e151"; }
.glyphicon-sort-by-alphabet-alt:before {
content: "\e152"; }
.glyphicon-sort-by-order:before {
content: "\e153"; }
.glyphicon-sort-by-order-alt:before {
content: "\e154"; }
.glyphicon-sort-by-attributes:before {
content: "\e155"; }
.glyphicon-sort-by-attributes-alt:before {
content: "\e156"; }
.glyphicon-unchecked:before {
content: "\e157"; }
.glyphicon-expand:before {
content: "\e158"; }
.glyphicon-collapse-down:before {
content: "\e159"; }
.glyphicon-collapse-up:before {
content: "\e160"; }
.glyphicon-log-in:before {
content: "\e161"; }
.glyphicon-flash:before {
content: "\e162"; }
.glyphicon-log-out:before {
content: "\e163"; }
.glyphicon-new-window:before {
content: "\e164"; }
.glyphicon-record:before {
content: "\e165"; }
.glyphicon-save:before {
content: "\e166"; }
.glyphicon-open:before {
content: "\e167"; }
.glyphicon-saved:before {
content: "\e168"; }
.glyphicon-import:before {
content: "\e169"; }
.glyphicon-export:before {
content: "\e170"; }
.glyphicon-send:before {
content: "\e171"; }
.glyphicon-floppy-disk:before {
content: "\e172"; }
.glyphicon-floppy-saved:before {
content: "\e173"; }
.glyphicon-floppy-remove:before {
content: "\e174"; }
.glyphicon-floppy-save:before {
content: "\e175"; }
.glyphicon-floppy-open:before {
content: "\e176"; }
.glyphicon-credit-card:before {
content: "\e177"; }
.glyphicon-transfer:before {
content: "\e178"; }
.glyphicon-cutlery:before {
content: "\e179"; }
.glyphicon-header:before {
content: "\e180"; }
.glyphicon-compressed:before {
content: "\e181"; }
.glyphicon-earphone:before {
content: "\e182"; }
.glyphicon-phone-alt:before {
content: "\e183"; }
.glyphicon-tower:before {
content: "\e184"; }
.glyphicon-stats:before {
content: "\e185"; }
.glyphicon-sd-video:before {
content: "\e186"; }
.glyphicon-hd-video:before {
content: "\e187"; }
.glyphicon-subtitles:before {
content: "\e188"; }
.glyphicon-sound-stereo:before {
content: "\e189"; }
.glyphicon-sound-dolby:before {
content: "\e190"; }
.glyphicon-sound-5-1:before {
content: "\e191"; }
.glyphicon-sound-6-1:before {
content: "\e192"; }
.glyphicon-sound-7-1:before {
content: "\e193"; }
.glyphicon-copyright-mark:before {
content: "\e194"; }
.glyphicon-registration-mark:before {
content: "\e195"; }
.glyphicon-cloud-download:before {
content: "\e197"; }
.glyphicon-cloud-upload:before {
content: "\e198"; }
.glyphicon-tree-conifer:before {
content: "\e199"; }
.glyphicon-tree-deciduous:before {
content: "\e200"; }
.glyphicon-cd:before {
content: "\e201"; }
.glyphicon-save-file:before {
content: "\e202"; }
.glyphicon-open-file:before {
content: "\e203"; }
.glyphicon-level-up:before {
content: "\e204"; }
.glyphicon-copy:before {
content: "\e205"; }
.glyphicon-paste:before {
content: "\e206"; }
.glyphicon-alert:before {
content: "\e209"; }
.glyphicon-equalizer:before {
content: "\e210"; }
.glyphicon-king:before {
content: "\e211"; }
.glyphicon-queen:before {
content: "\e212"; }
.glyphicon-pawn:before {
content: "\e213"; }
.glyphicon-bishop:before {
content: "\e214"; }
.glyphicon-knight:before {
content: "\e215"; }
.glyphicon-baby-formula:before {
content: "\e216"; }
.glyphicon-tent:before {
content: "\26fa"; }
.glyphicon-blackboard:before {
content: "\e218"; }
.glyphicon-bed:before {
content: "\e219"; }
.glyphicon-apple:before {
content: "\f8ff"; }
.glyphicon-erase:before {
content: "\e221"; }
.glyphicon-hourglass:before {
content: "\231b"; }
.glyphicon-lamp:before {
content: "\e223"; }
.glyphicon-duplicate:before {
content: "\e224"; }
.glyphicon-piggy-bank:before {
content: "\e225"; }
.glyphicon-scissors:before {
content: "\e226"; }
.glyphicon-bitcoin:before {
content: "\e227"; }
.glyphicon-yen:before {
content: "\00a5"; }
.glyphicon-ruble:before {
content: "\20bd"; }
.glyphicon-scale:before {
content: "\e230"; }
.glyphicon-ice-lolly:before {
content: "\e231"; }
.glyphicon-ice-lolly-tasted:before {
content: "\e232"; }
.glyphicon-education:before {
content: "\e233"; }
.glyphicon-option-horizontal:before {
content: "\e234"; }
.glyphicon-option-vertical:before {
content: "\e235"; }
.glyphicon-menu-hamburger:before {
content: "\e236"; }
.glyphicon-modal-window:before {
content: "\e237"; }
.glyphicon-oil:before {
content: "\e238"; }
.glyphicon-grain:before {
content: "\e239"; }
.glyphicon-sunglasses:before {
content: "\e240"; }
.glyphicon-text-size:before {
content: "\e241"; }
.glyphicon-text-color:before {
content: "\e242"; }
.glyphicon-text-background:before {
content: "\e243"; }
.glyphicon-object-align-top:before {
content: "\e244"; }
.glyphicon-object-align-bottom:before {
content: "\e245"; }
.glyphicon-object-align-horizontal:before {
content: "\e246"; }
.glyphicon-object-align-left:before {
content: "\e247"; }
.glyphicon-object-align-vertical:before {
content: "\e248"; }
.glyphicon-object-align-right:before {
content: "\e249"; }
.glyphicon-triangle-right:before {
content: "\e250"; }
.glyphicon-triangle-left:before {
content: "\e251"; }
.glyphicon-triangle-bottom:before {
content: "\e252"; }
.glyphicon-triangle-top:before {
content: "\e253"; }
.glyphicon-console:before {
content: "\e254"; }
.glyphicon-superscript:before {
content: "\e255"; }
.glyphicon-subscript:before {
content: "\e256"; }
.glyphicon-menu-left:before {
content: "\e257"; }
.glyphicon-menu-right:before {
content: "\e258"; }
.glyphicon-menu-down:before {
content: "\e259"; }
.glyphicon-menu-up:before {
content: "\e260"; }
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box; }
*:before, *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box; }
html {
font-size: 10px;
-webkit-tap-highlight-color: transparent; }
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.428571429;
color: #333333;
background-color: #fff; }
input, button, select, textarea {
font-family: inherit;
font-size: inherit;
line-height: inherit; }
a {
color: #337ab7;
text-decoration: none; }
a:hover, a:focus {
color: #23527c;
text-decoration: underline; }
a:focus {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px; }
figure {
margin: 0; }
img {
vertical-align: middle; }
.img-responsive {
display: block;
max-width: 100%;
height: auto; }
.img-rounded {
border-radius: 6px; }
.img-thumbnail {
padding: 4px;
line-height: 1.428571429;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 4px;
-webkit-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
display: inline-block;
max-width: 100%;
height: auto; }
.img-circle {
border-radius: 50%; }
hr {
margin-top: 20px;
margin-bottom: 20px;
border: 0;
border-top: 1px solid #eeeeee; }
.sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0; }
.sr-only-focusable:active, .sr-only-focusable:focus {
position: static;
width: auto;
height: auto;
margin: 0;
overflow: visible;
clip: auto; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
font-family: inherit;
font-weight: 500;
line-height: 1.1;
color: inherit; }
h1 small, h1 .small, h2 small, h2 .small, h3 small, h3 .small, h4 small, h4 .small, h5 small, h5 .small, h6 small, h6 .small, .h1 small, .h1 .small, .h2 small, .h2 .small, .h3 small, .h3 .small, .h4 small, .h4 .small, .h5 small, .h5 .small, .h6 small, .h6 .small {
font-weight: normal;
line-height: 1;
color: #777777; }
h1, .h1, h2, .h2, h3, .h3 {
margin-top: 20px;
margin-bottom: 10px; }
h1 small, h1 .small, .h1 small, .h1 .small, h2 small, h2 .small, .h2 small, .h2 .small, h3 small, h3 .small, .h3 small, .h3 .small {
font-size: 65%; }
h4, .h4, h5, .h5, h6, .h6 {
margin-top: 10px;
margin-bottom: 10px; }
h4 small, h4 .small, .h4 small, .h4 .small, h5 small, h5 .small, .h5 small, .h5 .small, h6 small, h6 .small, .h6 small, .h6 .small {
font-size: 75%; }
h1, .h1 {
font-size: 36px; }
h2, .h2 {
font-size: 30px; }
h3, .h3 {
font-size: 24px; }
h4, .h4 {
font-size: 18px; }
h5, .h5 {
font-size: 14px; }
h6, .h6 {
font-size: 12px; }
p {
margin: 0 0 10px; }
.lead {
margin-bottom: 20px;
font-size: 16px;
font-weight: 300;
line-height: 1.4; }
@media (min-width: 768px) {
.lead {
font-size: 21px; } }
small, .small {
font-size: 85%; }
mark, .mark {
background-color: #fcf8e3;
padding: .2em; }
.text-left {
text-align: left; }
.text-right {
text-align: right; }
.text-center {
text-align: center; }
.text-justify {
text-align: justify; }
.text-nowrap {
white-space: nowrap; }
.text-lowercase {
text-transform: lowercase; }
.text-uppercase {
text-transform: uppercase; }
.text-capitalize {
text-transform: capitalize; }
.text-muted {
color: #777777; }
.text-primary {
color: #337ab7; }
a.text-primary:hover {
color: #286090; }
.text-success {
color: #3c763d; }
a.text-success:hover {
color: #2b542c; }
.text-info {
color: #31708f; }
a.text-info:hover {
color: #245269; }
.text-warning {
color: #8a6d3b; }
a.text-warning:hover {
color: #66512c; }
.text-danger {
color: #a94442; }
a.text-danger:hover {
color: #843534; }
.bg-primary {
color: #fff; }
.bg-primary {
background-color: #337ab7; }
a.bg-primary:hover {
background-color: #286090; }
.bg-success {
background-color: #dff0d8; }
a.bg-success:hover {
background-color: #c1e2b3; }
.bg-info {
background-color: #d9edf7; }
a.bg-info:hover {
background-color: #afd9ee; }
.bg-warning {
background-color: #fcf8e3; }
a.bg-warning:hover {
background-color: #f7ecb5; }
.bg-danger {
background-color: #f2dede; }
a.bg-danger:hover {
background-color: #e4b9b9; }
.page-header {
padding-bottom: 9px;
margin: 40px 0 20px;
border-bottom: 1px solid #eeeeee; }
ul, ol {
margin-top: 0;
margin-bottom: 10px; }
ul ul, ul ol, ol ul, ol ol {
margin-bottom: 0; }
.list-unstyled {
padding-left: 0;
list-style: none; }
.list-inline {
padding-left: 0;
list-style: none;
margin-left: -5px; }
.list-inline > li {
display: inline-block;
padding-left: 5px;
padding-right: 5px; }
dl {
margin-top: 0;
margin-bottom: 20px; }
dt, dd {
line-height: 1.428571429; }
dt {
font-weight: bold; }
dd {
margin-left: 0; }
.dl-horizontal dd:before, .dl-horizontal dd:after {
content: " ";
display: table; }
.dl-horizontal dd:after {
clear: both; }
@media (min-width: 768px) {
.dl-horizontal dt {
float: left;
width: 160px;
clear: left;
text-align: right;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; }
.dl-horizontal dd {
margin-left: 180px; } }
abbr[title], abbr[data-original-title] {
cursor: help;
border-bottom: 1px dotted #777777; }
.initialism {
font-size: 90%;
text-transform: uppercase; }
blockquote {
padding: 10px 20px;
margin: 0 0 20px;
font-size: 17.5px;
border-left: 5px solid #eeeeee; }
blockquote p:last-child, blockquote ul:last-child, blockquote ol:last-child {
margin-bottom: 0; }
blockquote footer, blockquote small, blockquote .small {
display: block;
font-size: 80%;
line-height: 1.428571429;
color: #777777; }
blockquote footer:before, blockquote small:before, blockquote .small:before {
content: '\2014 \00A0'; }
.blockquote-reverse, blockquote.pull-right {
padding-right: 15px;
padding-left: 0;
border-right: 5px solid #eeeeee;
border-left: 0;
text-align: right; }
.blockquote-reverse footer:before, .blockquote-reverse small:before, .blockquote-reverse .small:before, blockquote.pull-right footer:before, blockquote.pull-right small:before, blockquote.pull-right .small:before {
content: ''; }
.blockquote-reverse footer:after, .blockquote-reverse small:after, .blockquote-reverse .small:after, blockquote.pull-right footer:after, blockquote.pull-right small:after, blockquote.pull-right .small:after {
content: '\00A0 \2014'; }
address {
margin-bottom: 20px;
font-style: normal;
line-height: 1.428571429; }
code, kbd, pre, samp {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace; }
code {
padding: 2px 4px;
font-size: 90%;
color: #c7254e;
background-color: #f9f2f4;
border-radius: 4px; }
kbd {
padding: 2px 4px;
font-size: 90%;
color: #fff;
background-color: #333;
border-radius: 3px;
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); }
kbd kbd {
padding: 0;
font-size: 100%;
font-weight: bold;
box-shadow: none; }
pre {
display: block;
padding: 9.5px;
margin: 0 0 10px;
font-size: 13px;
line-height: 1.428571429;
word-break: break-all;
word-wrap: break-word;
color: #333333;
background-color: #f5f5f5;
border: 1px solid #ccc;
border-radius: 4px; }
pre code {
padding: 0;
font-size: inherit;
color: inherit;
white-space: pre-wrap;
background-color: transparent;
border-radius: 0; }
.pre-scrollable {
max-height: 340px;
overflow-y: scroll; }
.container {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px; }
.container:before, .container:after {
content: " ";
display: table; }
.container:after {
clear: both; }
@media (min-width: 768px) {
.container {
width: 750px; } }
@media (min-width: 992px) {
.container {
width: 970px; } }
@media (min-width: 1200px) {
.container {
width: 1170px; } }
.container-fluid {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px; }
.container-fluid:before, .container-fluid:after {
content: " ";
display: table; }
.container-fluid:after {
clear: both; }
.row {
margin-left: -15px;
margin-right: -15px; }
.row:before, .row:after {
content: " ";
display: table; }
.row:after {
clear: both; }
.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
position: relative;
min-height: 1px;
padding-left: 15px;
padding-right: 15px; }
.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
float: left; }
.col-xs-1 {
width: 8.3333333333%; }
.col-xs-2 {
width: 16.6666666667%; }
.col-xs-3 {
width: 25%; }
.col-xs-4 {
width: 33.3333333333%; }
.col-xs-5 {
width: 41.6666666667%; }
.col-xs-6 {
width: 50%; }
.col-xs-7 {
width: 58.3333333333%; }
.col-xs-8 {
width: 66.6666666667%; }
.col-xs-9 {
width: 75%; }
.col-xs-10 {
width: 83.3333333333%; }
.col-xs-11 {
width: 91.6666666667%; }
.col-xs-12 {
width: 100%; }
.col-xs-pull-0 {
right: auto; }
.col-xs-pull-1 {
right: 8.3333333333%; }
.col-xs-pull-2 {
right: 16.6666666667%; }
.col-xs-pull-3 {
right: 25%; }
.col-xs-pull-4 {
right: 33.3333333333%; }
.col-xs-pull-5 {
right: 41.6666666667%; }
.col-xs-pull-6 {
right: 50%; }
.col-xs-pull-7 {
right: 58.3333333333%; }
.col-xs-pull-8 {
right: 66.6666666667%; }
.col-xs-pull-9 {
right: 75%; }
.col-xs-pull-10 {
right: 83.3333333333%; }
.col-xs-pull-11 {
right: 91.6666666667%; }
.col-xs-pull-12 {
right: 100%; }
.col-xs-push-0 {
left: auto; }
.col-xs-push-1 {
left: 8.3333333333%; }
.col-xs-push-2 {
left: 16.6666666667%; }
.col-xs-push-3 {
left: 25%; }
.col-xs-push-4 {
left: 33.3333333333%; }
.col-xs-push-5 {
left: 41.6666666667%; }
.col-xs-push-6 {
left: 50%; }
.col-xs-push-7 {
left: 58.3333333333%; }
.col-xs-push-8 {
left: 66.6666666667%; }
.col-xs-push-9 {
left: 75%; }
.col-xs-push-10 {
left: 83.3333333333%; }
.col-xs-push-11 {
left: 91.6666666667%; }
.col-xs-push-12 {
left: 100%; }
.col-xs-offset-0 {
margin-left: 0%; }
.col-xs-offset-1 {
margin-left: 8.3333333333%; }
.col-xs-offset-2 {
margin-left: 16.6666666667%; }
.col-xs-offset-3 {
margin-left: 25%; }
.col-xs-offset-4 {
margin-left: 33.3333333333%; }
.col-xs-offset-5 {
margin-left: 41.6666666667%; }
.col-xs-offset-6 {
margin-left: 50%; }
.col-xs-offset-7 {
margin-left: 58.3333333333%; }
.col-xs-offset-8 {
margin-left: 66.6666666667%; }
.col-xs-offset-9 {
margin-left: 75%; }
.col-xs-offset-10 {
margin-left: 83.3333333333%; }
.col-xs-offset-11 {
margin-left: 91.6666666667%; }
.col-xs-offset-12 {
margin-left: 100%; }
@media (min-width: 768px) {
.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
float: left; }
.col-sm-1 {
width: 8.3333333333%; }
.col-sm-2 {
width: 16.6666666667%; }
.col-sm-3 {
width: 25%; }
.col-sm-4 {
width: 33.3333333333%; }
.col-sm-5 {
width: 41.6666666667%; }
.col-sm-6 {
width: 50%; }
.col-sm-7 {
width: 58.3333333333%; }
.col-sm-8 {
width: 66.6666666667%; }
.col-sm-9 {
width: 75%; }
.col-sm-10 {
width: 83.3333333333%; }
.col-sm-11 {
width: 91.6666666667%; }
.col-sm-12 {
width: 100%; }
.col-sm-pull-0 {
right: auto; }
.col-sm-pull-1 {
right: 8.3333333333%; }
.col-sm-pull-2 {
right: 16.6666666667%; }
.col-sm-pull-3 {
right: 25%; }
.col-sm-pull-4 {
right: 33.3333333333%; }
.col-sm-pull-5 {
right: 41.6666666667%; }
.col-sm-pull-6 {
right: 50%; }
.col-sm-pull-7 {
right: 58.3333333333%; }
.col-sm-pull-8 {
right: 66.6666666667%; }
.col-sm-pull-9 {
right: 75%; }
.col-sm-pull-10 {
right: 83.3333333333%; }
.col-sm-pull-11 {
right: 91.6666666667%; }
.col-sm-pull-12 {
right: 100%; }
.col-sm-push-0 {
left: auto; }
.col-sm-push-1 {
left: 8.3333333333%; }
.col-sm-push-2 {
left: 16.6666666667%; }
.col-sm-push-3 {
left: 25%; }
.col-sm-push-4 {
left: 33.3333333333%; }
.col-sm-push-5 {
left: 41.6666666667%; }
.col-sm-push-6 {
left: 50%; }
.col-sm-push-7 {
left: 58.3333333333%; }
.col-sm-push-8 {
left: 66.6666666667%; }
.col-sm-push-9 {
left: 75%; }
.col-sm-push-10 {
left: 83.3333333333%; }
.col-sm-push-11 {
left: 91.6666666667%; }
.col-sm-push-12 {
left: 100%; }
.col-sm-offset-0 {
margin-left: 0%; }
.col-sm-offset-1 {
margin-left: 8.3333333333%; }
.col-sm-offset-2 {
margin-left: 16.6666666667%; }
.col-sm-offset-3 {
margin-left: 25%; }
.col-sm-offset-4 {
margin-left: 33.3333333333%; }
.col-sm-offset-5 {
margin-left: 41.6666666667%; }
.col-sm-offset-6 {
margin-left: 50%; }
.col-sm-offset-7 {
margin-left: 58.3333333333%; }
.col-sm-offset-8 {
margin-left: 66.6666666667%; }
.col-sm-offset-9 {
margin-left: 75%; }
.col-sm-offset-10 {
margin-left: 83.3333333333%; }
.col-sm-offset-11 {
margin-left: 91.6666666667%; }
.col-sm-offset-12 {
margin-left: 100%; } }
@media (min-width: 992px) {
.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
float: left; }
.col-md-1 {
width: 8.3333333333%; }
.col-md-2 {
width: 16.6666666667%; }
.col-md-3 {
width: 25%; }
.col-md-4 {
width: 33.3333333333%; }
.col-md-5 {
width: 41.6666666667%; }
.col-md-6 {
width: 50%; }
.col-md-7 {
width: 58.3333333333%; }
.col-md-8 {
width: 66.6666666667%; }
.col-md-9 {
width: 75%; }
.col-md-10 {
width: 83.3333333333%; }
.col-md-11 {
width: 91.6666666667%; }
.col-md-12 {
width: 100%; }
.col-md-pull-0 {
right: auto; }
.col-md-pull-1 {
right: 8.3333333333%; }
.col-md-pull-2 {
right: 16.6666666667%; }
.col-md-pull-3 {
right: 25%; }
.col-md-pull-4 {
right: 33.3333333333%; }
.col-md-pull-5 {
right: 41.6666666667%; }
.col-md-pull-6 {
right: 50%; }
.col-md-pull-7 {
right: 58.3333333333%; }
.col-md-pull-8 {
right: 66.6666666667%; }
.col-md-pull-9 {
right: 75%; }
.col-md-pull-10 {
right: 83.3333333333%; }
.col-md-pull-11 {
right: 91.6666666667%; }
.col-md-pull-12 {
right: 100%; }
.col-md-push-0 {
left: auto; }
.col-md-push-1 {
left: 8.3333333333%; }
.col-md-push-2 {
left: 16.6666666667%; }
.col-md-push-3 {
left: 25%; }
.col-md-push-4 {
left: 33.3333333333%; }
.col-md-push-5 {
left: 41.6666666667%; }
.col-md-push-6 {
left: 50%; }
.col-md-push-7 {
left: 58.3333333333%; }
.col-md-push-8 {
left: 66.6666666667%; }
.col-md-push-9 {
left: 75%; }
.col-md-push-10 {
left: 83.3333333333%; }
.col-md-push-11 {
left: 91.6666666667%; }
.col-md-push-12 {
left: 100%; }
.col-md-offset-0 {
margin-left: 0%; }
.col-md-offset-1 {
margin-left: 8.3333333333%; }
.col-md-offset-2 {
margin-left: 16.6666666667%; }
.col-md-offset-3 {
margin-left: 25%; }
.col-md-offset-4 {
margin-left: 33.3333333333%; }
.col-md-offset-5 {
margin-left: 41.6666666667%; }
.col-md-offset-6 {
margin-left: 50%; }
.col-md-offset-7 {
margin-left: 58.3333333333%; }
.col-md-offset-8 {
margin-left: 66.6666666667%; }
.col-md-offset-9 {
margin-left: 75%; }
.col-md-offset-10 {
margin-left: 83.3333333333%; }
.col-md-offset-11 {
margin-left: 91.6666666667%; }
.col-md-offset-12 {
margin-left: 100%; } }
@media (min-width: 1200px) {
.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
float: left; }
.col-lg-1 {
width: 8.3333333333%; }
.col-lg-2 {
width: 16.6666666667%; }
.col-lg-3 {
width: 25%; }
.col-lg-4 {
width: 33.3333333333%; }
.col-lg-5 {
width: 41.6666666667%; }
.col-lg-6 {
width: 50%; }
.col-lg-7 {
width: 58.3333333333%; }
.col-lg-8 {
width: 66.6666666667%; }
.col-lg-9 {
width: 75%; }
.col-lg-10 {
width: 83.3333333333%; }
.col-lg-11 {
width: 91.6666666667%; }
.col-lg-12 {
width: 100%; }
.col-lg-pull-0 {
right: auto; }
.col-lg-pull-1 {
right: 8.3333333333%; }
.col-lg-pull-2 {
right: 16.6666666667%; }
.col-lg-pull-3 {
right: 25%; }
.col-lg-pull-4 {
right: 33.3333333333%; }
.col-lg-pull-5 {
right: 41.6666666667%; }
.col-lg-pull-6 {
right: 50%; }
.col-lg-pull-7 {
right: 58.3333333333%; }
.col-lg-pull-8 {
right: 66.6666666667%; }
.col-lg-pull-9 {
right: 75%; }
.col-lg-pull-10 {
right: 83.3333333333%; }
.col-lg-pull-11 {
right: 91.6666666667%; }
.col-lg-pull-12 {
right: 100%; }
.col-lg-push-0 {
left: auto; }
.col-lg-push-1 {
left: 8.3333333333%; }
.col-lg-push-2 {
left: 16.6666666667%; }
.col-lg-push-3 {
left: 25%; }
.col-lg-push-4 {
left: 33.3333333333%; }
.col-lg-push-5 {
left: 41.6666666667%; }
.col-lg-push-6 {
left: 50%; }
.col-lg-push-7 {
left: 58.3333333333%; }
.col-lg-push-8 {
left: 66.6666666667%; }
.col-lg-push-9 {
left: 75%; }
.col-lg-push-10 {
left: 83.3333333333%; }
.col-lg-push-11 {
left: 91.6666666667%; }
.col-lg-push-12 {
left: 100%; }
.col-lg-offset-0 {
margin-left: 0%; }
.col-lg-offset-1 {
margin-left: 8.3333333333%; }
.col-lg-offset-2 {
margin-left: 16.6666666667%; }
.col-lg-offset-3 {
margin-left: 25%; }
.col-lg-offset-4 {
margin-left: 33.3333333333%; }
.col-lg-offset-5 {
margin-left: 41.6666666667%; }
.col-lg-offset-6 {
margin-left: 50%; }
.col-lg-offset-7 {
margin-left: 58.3333333333%; }
.col-lg-offset-8 {
margin-left: 66.6666666667%; }
.col-lg-offset-9 {
margin-left: 75%; }
.col-lg-offset-10 {
margin-left: 83.3333333333%; }
.col-lg-offset-11 {
margin-left: 91.6666666667%; }
.col-lg-offset-12 {
margin-left: 100%; } }
table {
background-color: transparent; }
caption {
padding-top: 8px;
padding-bottom: 8px;
color: #777777;
text-align: left; }
th {
text-align: left; }
.table {
width: 100%;
max-width: 100%;
margin-bottom: 20px; }
.table > thead > tr > th, .table > thead > tr > td, .table > tbody > tr > th, .table > tbody > tr > td, .table > tfoot > tr > th, .table > tfoot > tr > td {
padding: 8px;
line-height: 1.428571429;
vertical-align: top;
border-top: 1px solid #ddd; }
.table > thead > tr > th {
vertical-align: bottom;
border-bottom: 2px solid #ddd; }
.table > caption + thead > tr:first-child > th, .table > caption + thead > tr:first-child > td, .table > colgroup + thead > tr:first-child > th, .table > colgroup + thead > tr:first-child > td, .table > thead:first-child > tr:first-child > th, .table > thead:first-child > tr:first-child > td {
border-top: 0; }
.table > tbody + tbody {
border-top: 2px solid #ddd; }
.table .table {
background-color: #fff; }
.table-condensed > thead > tr > th, .table-condensed > thead > tr > td, .table-condensed > tbody > tr > th, .table-condensed > tbody > tr > td, .table-condensed > tfoot > tr > th, .table-condensed > tfoot > tr > td {
padding: 5px; }
.table-bordered {
border: 1px solid #ddd; }
.table-bordered > thead > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > th, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > th, .table-bordered > tfoot > tr > td {
border: 1px solid #ddd; }
.table-bordered > thead > tr > th, .table-bordered > thead > tr > td {
border-bottom-width: 2px; }
.table-striped > tbody > tr:nth-of-type(odd) {
background-color: #f9f9f9; }
.table-hover > tbody > tr:hover {
background-color: #f5f5f5; }
table col[class*="col-"] {
position: static;
float: none;
display: table-column; }
table td[class*="col-"], table th[class*="col-"] {
position: static;
float: none;
display: table-cell; }
.table > thead > tr > td.active, .table > thead > tr > th.active, .table > thead > tr.active > td, .table > thead > tr.active > th, .table > tbody > tr > td.active, .table > tbody > tr > th.active, .table > tbody > tr.active > td, .table > tbody > tr.active > th, .table > tfoot > tr > td.active, .table > tfoot > tr > th.active, .table > tfoot > tr.active > td, .table > tfoot > tr.active > th {
background-color: #f5f5f5; }
.table-hover > tbody > tr > td.active:hover, .table-hover > tbody > tr > th.active:hover, .table-hover > tbody > tr.active:hover > td, .table-hover > tbody > tr:hover > .active, .table-hover > tbody > tr.active:hover > th {
background-color: #e8e8e8; }
.table > thead > tr > td.success, .table > thead > tr > th.success, .table > thead > tr.success > td, .table > thead > tr.success > th, .table > tbody > tr > td.success, .table > tbody > tr > th.success, .table > tbody > tr.success > td, .table > tbody > tr.success > th, .table > tfoot > tr > td.success, .table > tfoot > tr > th.success, .table > tfoot > tr.success > td, .table > tfoot > tr.success > th {
background-color: #dff0d8; }
.table-hover > tbody > tr > td.success:hover, .table-hover > tbody > tr > th.success:hover, .table-hover > tbody > tr.success:hover > td, .table-hover > tbody > tr:hover > .success, .table-hover > tbody > tr.success:hover > th {
background-color: #d0e9c6; }
.table > thead > tr > td.info, .table > thead > tr > th.info, .table > thead > tr.info > td, .table > thead > tr.info > th, .table > tbody > tr > td.info, .table > tbody > tr > th.info, .table > tbody > tr.info > td, .table > tbody > tr.info > th, .table > tfoot > tr > td.info, .table > tfoot > tr > th.info, .table > tfoot > tr.info > td, .table > tfoot > tr.info > th {
background-color: #d9edf7; }
.table-hover > tbody > tr > td.info:hover, .table-hover > tbody > tr > th.info:hover, .table-hover > tbody > tr.info:hover > td, .table-hover > tbody > tr:hover > .info, .table-hover > tbody > tr.info:hover > th {
background-color: #c4e3f3; }
.table > thead > tr > td.warning, .table > thead > tr > th.warning, .table > thead > tr.warning > td, .table > thead > tr.warning > th, .table > tbody > tr > td.warning, .table > tbody > tr > th.warning, .table > tbody > tr.warning > td, .table > tbody > tr.warning > th, .table > tfoot > tr > td.warning, .table > tfoot > tr > th.warning, .table > tfoot > tr.warning > td, .table > tfoot > tr.warning > th {
background-color: #fcf8e3; }
.table-hover > tbody > tr > td.warning:hover, .table-hover > tbody > tr > th.warning:hover, .table-hover > tbody > tr.warning:hover > td, .table-hover > tbody > tr:hover > .warning, .table-hover > tbody > tr.warning:hover > th {
background-color: #faf2cc; }
.table > thead > tr > td.danger, .table > thead > tr > th.danger, .table > thead > tr.danger > td, .table > thead > tr.danger > th, .table > tbody > tr > td.danger, .table > tbody > tr > th.danger, .table > tbody > tr.danger > td, .table > tbody > tr.danger > th, .table > tfoot > tr > td.danger, .table > tfoot > tr > th.danger, .table > tfoot > tr.danger > td, .table > tfoot > tr.danger > th {
background-color: #f2dede; }
.table-hover > tbody > tr > td.danger:hover, .table-hover > tbody > tr > th.danger:hover, .table-hover > tbody > tr.danger:hover > td, .table-hover > tbody > tr:hover > .danger, .table-hover > tbody > tr.danger:hover > th {
background-color: #ebcccc; }
.table-responsive {
overflow-x: auto;
min-height: 0.01%; }
@media screen and (max-width: 767px) {
.table-responsive {
width: 100%;
margin-bottom: 15px;
overflow-y: hidden;
-ms-overflow-style: -ms-autohiding-scrollbar;
border: 1px solid #ddd; }
.table-responsive > .table {
margin-bottom: 0; }
.table-responsive > .table > thead > tr > th, .table-responsive > .table > thead > tr > td, .table-responsive > .table > tbody > tr > th, .table-responsive > .table > tbody > tr > td, .table-responsive > .table > tfoot > tr > th, .table-responsive > .table > tfoot > tr > td {
white-space: nowrap; }
.table-responsive > .table-bordered {
border: 0; }
.table-responsive > .table-bordered > thead > tr > th:first-child, .table-responsive > .table-bordered > thead > tr > td:first-child, .table-responsive > .table-bordered > tbody > tr > th:first-child, .table-responsive > .table-bordered > tbody > tr > td:first-child, .table-responsive > .table-bordered > tfoot > tr > th:first-child, .table-responsive > .table-bordered > tfoot > tr > td:first-child {
border-left: 0; }
.table-responsive > .table-bordered > thead > tr > th:last-child, .table-responsive > .table-bordered > thead > tr > td:last-child, .table-responsive > .table-bordered > tbody > tr > th:last-child, .table-responsive > .table-bordered > tbody > tr > td:last-child, .table-responsive > .table-bordered > tfoot > tr > th:last-child, .table-responsive > .table-bordered > tfoot > tr > td:last-child {
border-right: 0; }
.table-responsive > .table-bordered > tbody > tr:last-child > th, .table-responsive > .table-bordered > tbody > tr:last-child > td, .table-responsive > .table-bordered > tfoot > tr:last-child > th, .table-responsive > .table-bordered > tfoot > tr:last-child > td {
border-bottom: 0; } }
fieldset {
padding: 0;
margin: 0;
border: 0;
min-width: 0; }
legend {
display: block;
width: 100%;
padding: 0;
margin-bottom: 20px;
font-size: 21px;
line-height: inherit;
color: #333333;
border: 0;
border-bottom: 1px solid #e5e5e5; }
label {
display: inline-block;
max-width: 100%;
margin-bottom: 5px;
font-weight: bold; }
input[type="search"] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box; }
input[type="radio"], input[type="checkbox"] {
margin: 4px 0 0;
margin-top: 1px \9;
line-height: normal; }
input[type="file"] {
display: block; }
input[type="range"] {
display: block;
width: 100%; }
select[multiple], select[size] {
height: auto; }
input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px; }
output {
display: block;
padding-top: 7px;
font-size: 14px;
line-height: 1.428571429;
color: #555555; }
.form-control {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
color: #555555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; }
.form-control:focus {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); }
.form-control::-moz-placeholder {
color: #999;
opacity: 1; }
.form-control:-ms-input-placeholder {
color: #999; }
.form-control::-webkit-input-placeholder {
color: #999; }
.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control {
cursor: false;
background-color: #eeeeee;
opacity: 1; }
textarea.form-control {
height: auto; }
input[type="search"] {
-webkit-appearance: none; }
@media screen and (-webkit-min-device-pixel-ratio: 0) {
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"] {
line-height: 34px; }
input[type="date"].input-sm, .input-group-sm > input[type="date"].form-control, .input-group-sm > input[type="date"].input-group-addon, .input-group-sm > .input-group-btn > input[type="date"].btn, .input-group-sm input[type="date"], input[type="time"].input-sm, .input-group-sm > input[type="time"].form-control, .input-group-sm > input[type="time"].input-group-addon, .input-group-sm > .input-group-btn > input[type="time"].btn, .input-group-sm input[type="time"], input[type="datetime-local"].input-sm, .input-group-sm > input[type="datetime-local"].form-control, .input-group-sm > input[type="datetime-local"].input-group-addon, .input-group-sm > .input-group-btn > input[type="datetime-local"].btn, .input-group-sm input[type="datetime-local"], input[type="month"].input-sm, .input-group-sm > input[type="month"].form-control, .input-group-sm > input[type="month"].input-group-addon, .input-group-sm > .input-group-btn > input[type="month"].btn, .input-group-sm input[type="month"] {
line-height: 30px; }
input[type="date"].input-lg, .input-group-lg > input[type="date"].form-control, .input-group-lg > input[type="date"].input-group-addon, .input-group-lg > .input-group-btn > input[type="date"].btn, .input-group-lg input[type="date"], input[type="time"].input-lg, .input-group-lg > input[type="time"].form-control, .input-group-lg > input[type="time"].input-group-addon, .input-group-lg > .input-group-btn > input[type="time"].btn, .input-group-lg input[type="time"], input[type="datetime-local"].input-lg, .input-group-lg > input[type="datetime-local"].form-control, .input-group-lg > input[type="datetime-local"].input-group-addon, .input-group-lg > .input-group-btn > input[type="datetime-local"].btn, .input-group-lg input[type="datetime-local"], input[type="month"].input-lg, .input-group-lg > input[type="month"].form-control, .input-group-lg > input[type="month"].input-group-addon, .input-group-lg > .input-group-btn > input[type="month"].btn, .input-group-lg input[type="month"] {
line-height: 46px; } }
.form-group {
margin-bottom: 15px; }
.radio, .checkbox {
position: relative;
display: block;
margin-top: 10px;
margin-bottom: 10px; }
.radio label, .checkbox label {
min-height: 20px;
padding-left: 20px;
margin-bottom: 0;
font-weight: normal;
cursor: pointer; }
.radio input[type="radio"], .radio-inline input[type="radio"], .checkbox input[type="checkbox"], .checkbox-inline input[type="checkbox"] {
position: absolute;
margin-left: -20px;
margin-top: 4px \9; }
.radio + .radio, .checkbox + .checkbox {
margin-top: -5px; }
.radio-inline, .checkbox-inline {
display: inline-block;
padding-left: 20px;
margin-bottom: 0;
vertical-align: middle;
font-weight: normal;
cursor: pointer; }
.radio-inline + .radio-inline, .checkbox-inline + .checkbox-inline {
margin-top: 0;
margin-left: 10px; }
input[type="radio"][disabled], input[type="radio"].disabled, fieldset[disabled] input[type="radio"], input[type="checkbox"][disabled], input[type="checkbox"].disabled, fieldset[disabled] input[type="checkbox"] {
cursor: false; }
.radio-inline.disabled, fieldset[disabled] .radio-inline, .checkbox-inline.disabled, fieldset[disabled] .checkbox-inline {
cursor: false; }
.radio.disabled label, fieldset[disabled] .radio label, .checkbox.disabled label, fieldset[disabled] .checkbox label {
cursor: false; }
.form-control-static {
padding-top: 7px;
padding-bottom: 7px;
margin-bottom: 0; }
.form-control-static.input-lg, .input-group-lg > .form-control-static.form-control, .input-group-lg > .form-control-static.input-group-addon, .input-group-lg > .input-group-btn > .form-control-static.btn, .form-control-static.input-sm, .input-group-sm > .form-control-static.form-control, .input-group-sm > .form-control-static.input-group-addon, .input-group-sm > .input-group-btn > .form-control-static.btn {
padding-left: 0;
padding-right: 0; }
.input-sm, .input-group-sm > .form-control, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .btn {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px; }
select.input-sm, .input-group-sm > select.form-control, .input-group-sm > select.input-group-addon, .input-group-sm > .input-group-btn > select.btn {
height: 30px;
line-height: 30px; }
textarea.input-sm, .input-group-sm > textarea.form-control, .input-group-sm > textarea.input-group-addon, .input-group-sm > .input-group-btn > textarea.btn, select[multiple].input-sm, .input-group-sm > select[multiple].form-control, .input-group-sm > select[multiple].input-group-addon, .input-group-sm > .input-group-btn > select[multiple].btn {
height: auto; }
.form-group-sm .form-control {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px; }
.form-group-sm select.form-control {
height: 30px;
line-height: 30px; }
.form-group-sm textarea.form-control, .form-group-sm select[multiple].form-control {
height: auto; }
.form-group-sm .form-control-static {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5; }
.input-lg, .input-group-lg > .form-control, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .btn {
height: 46px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.3333333;
border-radius: 6px; }
select.input-lg, .input-group-lg > select.form-control, .input-group-lg > select.input-group-addon, .input-group-lg > .input-group-btn > select.btn {
height: 46px;
line-height: 46px; }
textarea.input-lg, .input-group-lg > textarea.form-control, .input-group-lg > textarea.input-group-addon, .input-group-lg > .input-group-btn > textarea.btn, select[multiple].input-lg, .input-group-lg > select[multiple].form-control, .input-group-lg > select[multiple].input-group-addon, .input-group-lg > .input-group-btn > select[multiple].btn {
height: auto; }
.form-group-lg .form-control {
height: 46px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.3333333;
border-radius: 6px; }
.form-group-lg select.form-control {
height: 46px;
line-height: 46px; }
.form-group-lg textarea.form-control, .form-group-lg select[multiple].form-control {
height: auto; }
.form-group-lg .form-control-static {
height: 46px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.3333333; }
.has-feedback {
position: relative; }
.has-feedback .form-control {
padding-right: 42.5px; }
.form-control-feedback {
position: absolute;
top: 0;
right: 0;
z-index: 2;
display: block;
width: 34px;
height: 34px;
line-height: 34px;
text-align: center;
pointer-events: none; }
.input-lg + .form-control-feedback, .input-group-lg > .form-control + .form-control-feedback, .input-group-lg > .input-group-addon + .form-control-feedback, .input-group-lg > .input-group-btn > .btn + .form-control-feedback {
width: 46px;
height: 46px;
line-height: 46px; }
.input-sm + .form-control-feedback, .input-group-sm > .form-control + .form-control-feedback, .input-group-sm > .input-group-addon + .form-control-feedback, .input-group-sm > .input-group-btn > .btn + .form-control-feedback {
width: 30px;
height: 30px;
line-height: 30px; }
.has-success .help-block, .has-success .control-label, .has-success .radio, .has-success .checkbox, .has-success .radio-inline, .has-success .checkbox-inline, .has-success.radio label, .has-success.checkbox label, .has-success.radio-inline label, .has-success.checkbox-inline label {
color: #3c763d; }
.has-success .form-control {
border-color: #3c763d;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); }
.has-success .form-control:focus {
border-color: #2b542c;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; }
.has-success .input-group-addon {
color: #3c763d;
border-color: #3c763d;
background-color: #dff0d8; }
.has-success .form-control-feedback {
color: #3c763d; }
.has-warning .help-block, .has-warning .control-label, .has-warning .radio, .has-warning .checkbox, .has-warning .radio-inline, .has-warning .checkbox-inline, .has-warning.radio label, .has-warning.checkbox label, .has-warning.radio-inline label, .has-warning.checkbox-inline label {
color: #8a6d3b; }
.has-warning .form-control {
border-color: #8a6d3b;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); }
.has-warning .form-control:focus {
border-color: #66512c;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; }
.has-warning .input-group-addon {
color: #8a6d3b;
border-color: #8a6d3b;
background-color: #fcf8e3; }
.has-warning .form-control-feedback {
color: #8a6d3b; }
.has-error .help-block, .has-error .control-label, .has-error .radio, .has-error .checkbox, .has-error .radio-inline, .has-error .checkbox-inline, .has-error.radio label, .has-error.checkbox label, .has-error.radio-inline label, .has-error.checkbox-inline label {
color: #a94442; }
.has-error .form-control {
border-color: #a94442;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); }
.has-error .form-control:focus {
border-color: #843534;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; }
.has-error .input-group-addon {
color: #a94442;
border-color: #a94442;
background-color: #f2dede; }
.has-error .form-control-feedback {
color: #a94442; }
.has-feedback label ~ .form-control-feedback {
top: 25px; }
.has-feedback label.sr-only ~ .form-control-feedback {
top: 0; }
.help-block {
display: block;
margin-top: 5px;
margin-bottom: 10px;
color: #737373; }
@media (min-width: 768px) {
.form-inline .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle; }
.form-inline .form-control {
display: inline-block;
width: auto;
vertical-align: middle; }
.form-inline .form-control-static {
display: inline-block; }
.form-inline .input-group {
display: inline-table;
vertical-align: middle; }
.form-inline .input-group .input-group-addon, .form-inline .input-group .input-group-btn, .form-inline .input-group .form-control {
width: auto; }
.form-inline .input-group > .form-control {
width: 100%; }
.form-inline .control-label {
margin-bottom: 0;
vertical-align: middle; }
.form-inline .radio, .form-inline .checkbox {
display: inline-block;
margin-top: 0;
margin-bottom: 0;
vertical-align: middle; }
.form-inline .radio label, .form-inline .checkbox label {
padding-left: 0; }
.form-inline .radio input[type="radio"], .form-inline .checkbox input[type="checkbox"] {
position: relative;
margin-left: 0; }
.form-inline .has-feedback .form-control-feedback {
top: 0; } }
.form-horizontal .radio, .form-horizontal .checkbox, .form-horizontal .radio-inline, .form-horizontal .checkbox-inline {
margin-top: 0;
margin-bottom: 0;
padding-top: 7px; }
.form-horizontal .radio, .form-horizontal .checkbox {
min-height: 27px; }
.form-horizontal .form-group {
margin-left: -15px;
margin-right: -15px; }
.form-horizontal .form-group:before, .form-horizontal .form-group:after {
content: " ";
display: table; }
.form-horizontal .form-group:after {
clear: both; }
@media (min-width: 768px) {
.form-horizontal .control-label {
text-align: right;
margin-bottom: 0;
padding-top: 7px; } }
.form-horizontal .has-feedback .form-control-feedback {
right: 15px; }
@media (min-width: 768px) {
.form-horizontal .form-group-lg .control-label {
padding-top: 14.333333px; } }
@media (min-width: 768px) {
.form-horizontal .form-group-sm .control-label {
padding-top: 6px; } }
.btn {
display: inline-block;
margin-bottom: 0;
font-weight: normal;
text-align: center;
vertical-align: middle;
touch-action: manipulation;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
white-space: nowrap;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
.btn:focus, .btn.focus, .btn:active:focus, .btn:active.focus, .btn.active:focus, .btn.active.focus {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px; }
.btn:hover, .btn:focus, .btn.focus {
color: #333;
text-decoration: none; }
.btn:active, .btn.active {
outline: 0;
background-image: none;
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); }
.btn.disabled, .btn[disabled], fieldset[disabled] .btn {
cursor: false;
pointer-events: none;
opacity: 0.65;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none; }
.btn-default {
color: #333;
background-color: #fff;
border-color: #ccc; }
.btn-default:hover, .btn-default:focus, .btn-default.focus, .btn-default:active, .btn-default.active, .open > .btn-default.dropdown-toggle {
color: #333;
background-color: #e6e6e6;
border-color: #adadad; }
.btn-default:active, .btn-default.active, .open > .btn-default.dropdown-toggle {
background-image: none; }
.btn-default.disabled, .btn-default.disabled:hover, .btn-default.disabled:focus, .btn-default.disabled.focus, .btn-default.disabled:active, .btn-default.disabled.active, .btn-default[disabled], .btn-default[disabled]:hover, .btn-default[disabled]:focus, .btn-default[disabled].focus, .btn-default[disabled]:active, .btn-default[disabled].active, fieldset[disabled] .btn-default, fieldset[disabled] .btn-default:hover, fieldset[disabled] .btn-default:focus, fieldset[disabled] .btn-default.focus, fieldset[disabled] .btn-default:active, fieldset[disabled] .btn-default.active {
background-color: #fff;
border-color: #ccc; }
.btn-default .badge {
color: #fff;
background-color: #333; }
.btn-primary {
color: #fff;
background-color: #337ab7;
border-color: #2e6da4; }
.btn-primary:hover, .btn-primary:focus, .btn-primary.focus, .btn-primary:active, .btn-primary.active, .open > .btn-primary.dropdown-toggle {
color: #fff;
background-color: #286090;
border-color: #204d74; }
.btn-primary:active, .btn-primary.active, .open > .btn-primary.dropdown-toggle {
background-image: none; }
.btn-primary.disabled, .btn-primary.disabled:hover, .btn-primary.disabled:focus, .btn-primary.disabled.focus, .btn-primary.disabled:active, .btn-primary.disabled.active, .btn-primary[disabled], .btn-primary[disabled]:hover, .btn-primary[disabled]:focus, .btn-primary[disabled].focus, .btn-primary[disabled]:active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary, fieldset[disabled] .btn-primary:hover, fieldset[disabled] .btn-primary:focus, fieldset[disabled] .btn-primary.focus, fieldset[disabled] .btn-primary:active, fieldset[disabled] .btn-primary.active {
background-color: #337ab7;
border-color: #2e6da4; }
.btn-primary .badge {
color: #337ab7;
background-color: #fff; }
.btn-success {
color: #fff;
background-color: #5cb85c;
border-color: #4cae4c; }
.btn-success:hover, .btn-success:focus, .btn-success.focus, .btn-success:active, .btn-success.active, .open > .btn-success.dropdown-toggle {
color: #fff;
background-color: #449d44;
border-color: #398439; }
.btn-success:active, .btn-success.active, .open > .btn-success.dropdown-toggle {
background-image: none; }
.btn-success.disabled, .btn-success.disabled:hover, .btn-success.disabled:focus, .btn-success.disabled.focus, .btn-success.disabled:active, .btn-success.disabled.active, .btn-success[disabled], .btn-success[disabled]:hover, .btn-success[disabled]:focus, .btn-success[disabled].focus, .btn-success[disabled]:active, .btn-success[disabled].active, fieldset[disabled] .btn-success, fieldset[disabled] .btn-success:hover, fieldset[disabled] .btn-success:focus, fieldset[disabled] .btn-success.focus, fieldset[disabled] .btn-success:active, fieldset[disabled] .btn-success.active {
background-color: #5cb85c;
border-color: #4cae4c; }
.btn-success .badge {
color: #5cb85c;
background-color: #fff; }
.btn-info {
color: #fff;
background-color: #5bc0de;
border-color: #46b8da; }
.btn-info:hover, .btn-info:focus, .btn-info.focus, .btn-info:active, .btn-info.active, .open > .btn-info.dropdown-toggle {
color: #fff;
background-color: #31b0d5;
border-color: #269abc; }
.btn-info:active, .btn-info.active, .open > .btn-info.dropdown-toggle {
background-image: none; }
.btn-info.disabled, .btn-info.disabled:hover, .btn-info.disabled:focus, .btn-info.disabled.focus, .btn-info.disabled:active, .btn-info.disabled.active, .btn-info[disabled], .btn-info[disabled]:hover, .btn-info[disabled]:focus, .btn-info[disabled].focus, .btn-info[disabled]:active, .btn-info[disabled].active, fieldset[disabled] .btn-info, fieldset[disabled] .btn-info:hover, fieldset[disabled] .btn-info:focus, fieldset[disabled] .btn-info.focus, fieldset[disabled] .btn-info:active, fieldset[disabled] .btn-info.active {
background-color: #5bc0de;
border-color: #46b8da; }
.btn-info .badge {
color: #5bc0de;
background-color: #fff; }
.btn-warning {
color: #fff;
background-color: #f0ad4e;
border-color: #eea236; }
.btn-warning:hover, .btn-warning:focus, .btn-warning.focus, .btn-warning:active, .btn-warning.active, .open > .btn-warning.dropdown-toggle {
color: #fff;
background-color: #ec971f;
border-color: #d58512; }
.btn-warning:active, .btn-warning.active, .open > .btn-warning.dropdown-toggle {
background-image: none; }
.btn-warning.disabled, .btn-warning.disabled:hover, .btn-warning.disabled:focus, .btn-warning.disabled.focus, .btn-warning.disabled:active, .btn-warning.disabled.active, .btn-warning[disabled], .btn-warning[disabled]:hover, .btn-warning[disabled]:focus, .btn-warning[disabled].focus, .btn-warning[disabled]:active, .btn-warning[disabled].active, fieldset[disabled] .btn-warning, fieldset[disabled] .btn-warning:hover, fieldset[disabled] .btn-warning:focus, fieldset[disabled] .btn-warning.focus, fieldset[disabled] .btn-warning:active, fieldset[disabled] .btn-warning.active {
background-color: #f0ad4e;
border-color: #eea236; }
.btn-warning .badge {
color: #f0ad4e;
background-color: #fff; }
.btn-danger {
color: #fff;
background-color: #d9534f;
border-color: #d43f3a; }
.btn-danger:hover, .btn-danger:focus, .btn-danger.focus, .btn-danger:active, .btn-danger.active, .open > .btn-danger.dropdown-toggle {
color: #fff;
background-color: #c9302c;
border-color: #ac2925; }
.btn-danger:active, .btn-danger.active, .open > .btn-danger.dropdown-toggle {
background-image: none; }
.btn-danger.disabled, .btn-danger.disabled:hover, .btn-danger.disabled:focus, .btn-danger.disabled.focus, .btn-danger.disabled:active, .btn-danger.disabled.active, .btn-danger[disabled], .btn-danger[disabled]:hover, .btn-danger[disabled]:focus, .btn-danger[disabled].focus, .btn-danger[disabled]:active, .btn-danger[disabled].active, fieldset[disabled] .btn-danger, fieldset[disabled] .btn-danger:hover, fieldset[disabled] .btn-danger:focus, fieldset[disabled] .btn-danger.focus, fieldset[disabled] .btn-danger:active, fieldset[disabled] .btn-danger.active {
background-color: #d9534f;
border-color: #d43f3a; }
.btn-danger .badge {
color: #d9534f;
background-color: #fff; }
.btn-link {
color: #337ab7;
font-weight: normal;
border-radius: 0; }
.btn-link, .btn-link:active, .btn-link.active, .btn-link[disabled], fieldset[disabled] .btn-link {
background-color: transparent;
-webkit-box-shadow: none;
box-shadow: none; }
.btn-link, .btn-link:hover, .btn-link:focus, .btn-link:active {
border-color: transparent; }
.btn-link:hover, .btn-link:focus {
color: #23527c;
text-decoration: underline;
background-color: transparent; }
.btn-link[disabled]:hover, .btn-link[disabled]:focus, fieldset[disabled] .btn-link:hover, fieldset[disabled] .btn-link:focus {
color: #777777;
text-decoration: none; }
.btn-lg, .btn-group-lg > .btn {
padding: 10px 16px;
font-size: 18px;
line-height: 1.3333333;
border-radius: 6px; }
.btn-sm, .btn-group-sm > .btn {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px; }
.btn-xs, .btn-group-xs > .btn {
padding: 1px 5px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px; }
.btn-block {
display: block;
width: 100%; }
.btn-block + .btn-block {
margin-top: 5px; }
input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="button"].btn-block {
width: 100%; }
.fade {
opacity: 0;
-webkit-transition: opacity .15s linear;
-o-transition: opacity .15s linear;
transition: opacity .15s linear; }
.fade.in {
opacity: 1; }
.collapse {
display: none;
visibility: hidden; }
.collapse.in {
display: block;
visibility: visible; }
tr.collapse.in {
display: table-row; }
tbody.collapse.in {
display: table-row-group; }
.collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition-property: height, visibility;
transition-property: height, visibility;
-webkit-transition-duration: .35s;
transition-duration: .35s;
-webkit-transition-timing-function: ease;
transition-timing-function: ease; }
.caret {
display: inline-block;
width: 0;
height: 0;
margin-left: 2px;
vertical-align: middle;
border-top: 4px solid;
border-right: 4px solid transparent;
border-left: 4px solid transparent; }
.dropup, .dropdown {
position: relative; }
.dropdown-toggle:focus {
outline: 0; }
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
list-style: none;
font-size: 14px;
text-align: left;
background-color: #fff;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
background-clip: padding-box; }
.dropdown-menu.pull-right {
right: 0;
left: auto; }
.dropdown-menu .divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5; }
.dropdown-menu > li > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.428571429;
color: #333333;
white-space: nowrap; }
.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus {
text-decoration: none;
color: #262626;
background-color: #f5f5f5; }
.dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus {
color: #fff;
text-decoration: none;
outline: 0;
background-color: #337ab7; }
.dropdown-menu > .disabled > a, .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus {
color: #777777; }
.dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus {
text-decoration: none;
background-color: transparent;
background-image: none;
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
cursor: false; }
.open > .dropdown-menu {
display: block; }
.open > a {
outline: 0; }
.dropdown-menu-right {
left: auto;
right: 0; }
.dropdown-menu-left {
left: 0;
right: auto; }
.dropdown-header {
display: block;
padding: 3px 20px;
font-size: 12px;
line-height: 1.428571429;
color: #777777;
white-space: nowrap; }
.dropdown-backdrop {
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
z-index: 990; }
.pull-right > .dropdown-menu {
right: 0;
left: auto; }
.dropup .caret, .navbar-fixed-bottom .dropdown .caret {
border-top: 0;
border-bottom: 4px solid;
content: ""; }
.dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu {
top: auto;
bottom: 100%;
margin-bottom: 2px; }
@media (min-width: 768px) {
.navbar-right .dropdown-menu {
right: 0;
left: auto; }
.navbar-right .dropdown-menu-left {
left: 0;
right: auto; } }
.btn-group, .btn-group-vertical {
position: relative;
display: inline-block;
vertical-align: middle; }
.btn-group > .btn, .btn-group-vertical > .btn {
position: relative;
float: left; }
.btn-group > .btn:hover, .btn-group > .btn:focus, .btn-group > .btn:active, .btn-group > .btn.active, .btn-group-vertical > .btn:hover, .btn-group-vertical > .btn:focus, .btn-group-vertical > .btn:active, .btn-group-vertical > .btn.active {
z-index: 2; }
.btn-group .btn + .btn, .btn-group .btn + .btn-group, .btn-group .btn-group + .btn, .btn-group .btn-group + .btn-group {
margin-left: -1px; }
.btn-toolbar {
margin-left: -5px; }
.btn-toolbar:before, .btn-toolbar:after {
content: " ";
display: table; }
.btn-toolbar:after {
clear: both; }
.btn-toolbar .btn-group, .btn-toolbar .input-group {
float: left; }
.btn-toolbar > .btn, .btn-toolbar > .btn-group, .btn-toolbar > .input-group {
margin-left: 5px; }
.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
border-radius: 0; }
.btn-group > .btn:first-child {
margin-left: 0; }
.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
border-bottom-right-radius: 0;
border-top-right-radius: 0; }
.btn-group > .btn:last-child:not(:first-child), .btn-group > .dropdown-toggle:not(:first-child) {
border-bottom-left-radius: 0;
border-top-left-radius: 0; }
.btn-group > .btn-group {
float: left; }
.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0; }
.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child, .btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
border-bottom-right-radius: 0;
border-top-right-radius: 0; }
.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {
border-bottom-left-radius: 0;
border-top-left-radius: 0; }
.btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle {
outline: 0; }
.btn-group > .btn + .dropdown-toggle {
padding-left: 8px;
padding-right: 8px; }
.btn-group > .btn-lg + .dropdown-toggle, .btn-group-lg.btn-group > .btn + .dropdown-toggle {
padding-left: 12px;
padding-right: 12px; }
.btn-group.open .dropdown-toggle {
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); }
.btn-group.open .dropdown-toggle.btn-link {
-webkit-box-shadow: none;
box-shadow: none; }
.btn .caret {
margin-left: 0; }
.btn-lg .caret, .btn-group-lg > .btn .caret {
border-width: 5px 5px 0;
border-bottom-width: 0; }
.dropup .btn-lg .caret, .dropup .btn-group-lg > .btn .caret {
border-width: 0 5px 5px; }
.btn-group-vertical > .btn, .btn-group-vertical > .btn-group, .btn-group-vertical > .btn-group > .btn {
display: block;
float: none;
width: 100%;
max-width: 100%; }
.btn-group-vertical > .btn-group:before, .btn-group-vertical > .btn-group:after {
content: " ";
display: table; }
.btn-group-vertical > .btn-group:after {
clear: both; }
.btn-group-vertical > .btn-group > .btn {
float: none; }
.btn-group-vertical > .btn + .btn, .btn-group-vertical > .btn + .btn-group, .btn-group-vertical > .btn-group + .btn, .btn-group-vertical > .btn-group + .btn-group {
margin-top: -1px;
margin-left: 0; }
.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
border-radius: 0; }
.btn-group-vertical > .btn:first-child:not(:last-child) {
border-top-right-radius: 4px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0; }
.btn-group-vertical > .btn:last-child:not(:first-child) {
border-bottom-left-radius: 4px;
border-top-right-radius: 0;
border-top-left-radius: 0; }
.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0; }
.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, .btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0; }
.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
border-top-right-radius: 0;
border-top-left-radius: 0; }
.btn-group-justified {
display: table;
width: 100%;
table-layout: fixed;
border-collapse: separate; }
.btn-group-justified > .btn, .btn-group-justified > .btn-group {
float: none;
display: table-cell;
width: 1%; }
.btn-group-justified > .btn-group .btn {
width: 100%; }
.btn-group-justified > .btn-group .dropdown-menu {
left: auto; }
[data-toggle="buttons"] > .btn input[type="radio"], [data-toggle="buttons"] > .btn input[type="checkbox"], [data-toggle="buttons"] > .btn-group > .btn input[type="radio"], [data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] {
position: absolute;
clip: rect(0, 0, 0, 0);
pointer-events: none; }
.input-group {
position: relative;
display: table;
border-collapse: separate; }
.input-group[class*="col-"] {
float: none;
padding-left: 0;
padding-right: 0; }
.input-group .form-control {
position: relative;
z-index: 2;
float: left;
width: 100%;
margin-bottom: 0; }
.input-group-addon, .input-group-btn, .input-group .form-control {
display: table-cell; }
.input-group-addon:not(:first-child):not(:last-child), .input-group-btn:not(:first-child):not(:last-child), .input-group .form-control:not(:first-child):not(:last-child) {
border-radius: 0; }
.input-group-addon, .input-group-btn {
width: 1%;
white-space: nowrap;
vertical-align: middle; }
.input-group-addon {
padding: 6px 12px;
font-size: 14px;
font-weight: normal;
line-height: 1;
color: #555555;
text-align: center;
background-color: #eeeeee;
border: 1px solid #ccc;
border-radius: 4px; }
.input-group-addon.input-sm, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .input-group-addon.btn {
padding: 5px 10px;
font-size: 12px;
border-radius: 3px; }
.input-group-addon.input-lg, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .input-group-addon.btn {
padding: 10px 16px;
font-size: 18px;
border-radius: 6px; }
.input-group-addon input[type="radio"], .input-group-addon input[type="checkbox"] {
margin-top: 0; }
.input-group .form-control:first-child, .input-group-addon:first-child, .input-group-btn:first-child > .btn, .input-group-btn:first-child > .btn-group > .btn, .input-group-btn:first-child > .dropdown-toggle, .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), .input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
border-bottom-right-radius: 0;
border-top-right-radius: 0; }
.input-group-addon:first-child {
border-right: 0; }
.input-group .form-control:last-child, .input-group-addon:last-child, .input-group-btn:last-child > .btn, .input-group-btn:last-child > .btn-group > .btn, .input-group-btn:last-child > .dropdown-toggle, .input-group-btn:first-child > .btn:not(:first-child), .input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
border-bottom-left-radius: 0;
border-top-left-radius: 0; }
.input-group-addon:last-child {
border-left: 0; }
.input-group-btn {
position: relative;
font-size: 0;
white-space: nowrap; }
.input-group-btn > .btn {
position: relative; }
.input-group-btn > .btn + .btn {
margin-left: -1px; }
.input-group-btn > .btn:hover, .input-group-btn > .btn:focus, .input-group-btn > .btn:active {
z-index: 2; }
.input-group-btn:first-child > .btn, .input-group-btn:first-child > .btn-group {
margin-right: -1px; }
.input-group-btn:last-child > .btn, .input-group-btn:last-child > .btn-group {
margin-left: -1px; }
.nav {
margin-bottom: 0;
padding-left: 0;
list-style: none; }
.nav:before, .nav:after {
content: " ";
display: table; }
.nav:after {
clear: both; }
.nav > li {
position: relative;
display: block; }
.nav > li > a {
position: relative;
display: block;
padding: 10px 15px; }
.nav > li > a:hover, .nav > li > a:focus {
text-decoration: none;
background-color: #eeeeee; }
.nav > li.disabled > a {
color: #777777; }
.nav > li.disabled > a:hover, .nav > li.disabled > a:focus {
color: #777777;
text-decoration: none;
background-color: transparent;
cursor: false; }
.nav .open > a, .nav .open > a:hover, .nav .open > a:focus {
background-color: #eeeeee;
border-color: #337ab7; }
.nav .nav-divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5; }
.nav > li > a > img {
max-width: none; }
.nav-tabs {
border-bottom: 1px solid #ddd; }
.nav-tabs > li {
float: left;
margin-bottom: -1px; }
.nav-tabs > li > a {
margin-right: 2px;
line-height: 1.428571429;
border: 1px solid transparent;
border-radius: 4px 4px 0 0; }
.nav-tabs > li > a:hover {
border-color: #eeeeee #eeeeee #ddd; }
.nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus {
color: #555555;
background-color: #fff;
border: 1px solid #ddd;
border-bottom-color: transparent;
cursor: default; }
.nav-pills > li {
float: left; }
.nav-pills > li > a {
border-radius: 4px; }
.nav-pills > li + li {
margin-left: 2px; }
.nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus {
color: #fff;
background-color: #337ab7; }
.nav-stacked > li {
float: none; }
.nav-stacked > li + li {
margin-top: 2px;
margin-left: 0; }
.nav-justified, .nav-tabs.nav-justified {
width: 100%; }
.nav-justified > li, .nav-tabs.nav-justified > li {
float: none; }
.nav-justified > li > a, .nav-tabs.nav-justified > li > a {
text-align: center;
margin-bottom: 5px; }
.nav-justified > .dropdown .dropdown-menu {
top: auto;
left: auto; }
@media (min-width: 768px) {
.nav-justified > li, .nav-tabs.nav-justified > li {
display: table-cell;
width: 1%; }
.nav-justified > li > a, .nav-tabs.nav-justified > li > a {
margin-bottom: 0; } }
.nav-tabs-justified, .nav-tabs.nav-justified {
border-bottom: 0; }
.nav-tabs-justified > li > a, .nav-tabs.nav-justified > li > a {
margin-right: 0;
border-radius: 4px; }
.nav-tabs-justified > .active > a, .nav-tabs.nav-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus, .nav-tabs.nav-justified > .active > a:focus {
border: 1px solid #ddd; }
@media (min-width: 768px) {
.nav-tabs-justified > li > a, .nav-tabs.nav-justified > li > a {
border-bottom: 1px solid #ddd;
border-radius: 4px 4px 0 0; }
.nav-tabs-justified > .active > a, .nav-tabs.nav-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus, .nav-tabs.nav-justified > .active > a:focus {
border-bottom-color: #fff; } }
.tab-content > .tab-pane {
display: none;
visibility: hidden; }
.tab-content > .active {
display: block;
visibility: visible; }
.nav-tabs .dropdown-menu {
margin-top: -1px;
border-top-right-radius: 0;
border-top-left-radius: 0; }
.navbar {
position: relative;
min-height: 50px;
margin-bottom: 20px;
border: 1px solid transparent; }
.navbar:before, .navbar:after {
content: " ";
display: table; }
.navbar:after {
clear: both; }
@media (min-width: 768px) {
.navbar {
border-radius: 4px; } }
.navbar-header:before, .navbar-header:after {
content: " ";
display: table; }
.navbar-header:after {
clear: both; }
@media (min-width: 768px) {
.navbar-header {
float: left; } }
.navbar-collapse {
overflow-x: visible;
padding-right: 15px;
padding-left: 15px;
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
-webkit-overflow-scrolling: touch; }
.navbar-collapse:before, .navbar-collapse:after {
content: " ";
display: table; }
.navbar-collapse:after {
clear: both; }
.navbar-collapse.in {
overflow-y: auto; }
@media (min-width: 768px) {
.navbar-collapse {
width: auto;
border-top: 0;
box-shadow: none; }
.navbar-collapse.collapse {
display: block !important;
visibility: visible !important;
height: auto !important;
padding-bottom: 0;
overflow: visible !important; }
.navbar-collapse.in {
overflow-y: visible; }
.navbar-fixed-top .navbar-collapse, .navbar-static-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse {
padding-left: 0;
padding-right: 0; } }
.navbar-fixed-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse {
max-height: 340px; }
@media (max-device-width: 480px) and (orientation: landscape) {
.navbar-fixed-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse {
max-height: 200px; } }
.container > .navbar-header, .container > .navbar-collapse, .container-fluid > .navbar-header, .container-fluid > .navbar-collapse {
margin-right: -15px;
margin-left: -15px; }
@media (min-width: 768px) {
.container > .navbar-header, .container > .navbar-collapse, .container-fluid > .navbar-header, .container-fluid > .navbar-collapse {
margin-right: 0;
margin-left: 0; } }
.navbar-static-top {
z-index: 1000;
border-width: 0 0 1px; }
@media (min-width: 768px) {
.navbar-static-top {
border-radius: 0; } }
.navbar-fixed-top, .navbar-fixed-bottom {
position: fixed;
right: 0;
left: 0;
z-index: 1030; }
@media (min-width: 768px) {
.navbar-fixed-top, .navbar-fixed-bottom {
border-radius: 0; } }
.navbar-fixed-top {
top: 0;
border-width: 0 0 1px; }
.navbar-fixed-bottom {
bottom: 0;
margin-bottom: 0;
border-width: 1px 0 0; }
.navbar-brand {
float: left;
padding: 15px 15px;
font-size: 18px;
line-height: 20px;
height: 50px; }
.navbar-brand:hover, .navbar-brand:focus {
text-decoration: none; }
.navbar-brand > img {
display: block; }
@media (min-width: 768px) {
.navbar > .container .navbar-brand, .navbar > .container-fluid .navbar-brand {
margin-left: -15px; } }
.navbar-toggle {
position: relative;
float: right;
margin-right: 15px;
padding: 9px 10px;
margin-top: 8px;
margin-bottom: 8px;
background-color: transparent;
background-image: none;
border: 1px solid transparent;
border-radius: 4px; }
.navbar-toggle:focus {
outline: 0; }
.navbar-toggle .icon-bar {
display: block;
width: 22px;
height: 2px;
border-radius: 1px; }
.navbar-toggle .icon-bar + .icon-bar {
margin-top: 4px; }
@media (min-width: 768px) {
.navbar-toggle {
display: none; } }
.navbar-nav {
margin: 7.5px -15px; }
.navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
line-height: 20px; }
@media (max-width: 767px) {
.navbar-nav .open .dropdown-menu {
position: static;
float: none;
width: auto;
margin-top: 0;
background-color: transparent;
border: 0;
box-shadow: none; }
.navbar-nav .open .dropdown-menu > li > a, .navbar-nav .open .dropdown-menu .dropdown-header {
padding: 5px 15px 5px 25px; }
.navbar-nav .open .dropdown-menu > li > a {
line-height: 20px; }
.navbar-nav .open .dropdown-menu > li > a:hover, .navbar-nav .open .dropdown-menu > li > a:focus {
background-image: none; } }
@media (min-width: 768px) {
.navbar-nav {
float: left;
margin: 0; }
.navbar-nav > li {
float: left; }
.navbar-nav > li > a {
padding-top: 15px;
padding-bottom: 15px; } }
.navbar-form {
margin-left: -15px;
margin-right: -15px;
padding: 10px 15px;
border-top: 1px solid transparent;
border-bottom: 1px solid transparent;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
margin-top: 8px;
margin-bottom: 8px; }
@media (min-width: 768px) {
.navbar-form .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle; }
.navbar-form .form-control {
display: inline-block;
width: auto;
vertical-align: middle; }
.navbar-form .form-control-static {
display: inline-block; }
.navbar-form .input-group {
display: inline-table;
vertical-align: middle; }
.navbar-form .input-group .input-group-addon, .navbar-form .input-group .input-group-btn, .navbar-form .input-group .form-control {
width: auto; }
.navbar-form .input-group > .form-control {
width: 100%; }
.navbar-form .control-label {
margin-bottom: 0;
vertical-align: middle; }
.navbar-form .radio, .navbar-form .checkbox {
display: inline-block;
margin-top: 0;
margin-bottom: 0;
vertical-align: middle; }
.navbar-form .radio label, .navbar-form .checkbox label {
padding-left: 0; }
.navbar-form .radio input[type="radio"], .navbar-form .checkbox input[type="checkbox"] {
position: relative;
margin-left: 0; }
.navbar-form .has-feedback .form-control-feedback {
top: 0; } }
@media (max-width: 767px) {
.navbar-form .form-group {
margin-bottom: 5px; }
.navbar-form .form-group:last-child {
margin-bottom: 0; } }
@media (min-width: 768px) {
.navbar-form {
width: auto;
border: 0;
margin-left: 0;
margin-right: 0;
padding-top: 0;
padding-bottom: 0;
-webkit-box-shadow: none;
box-shadow: none; } }
.navbar-nav > li > .dropdown-menu {
margin-top: 0;
border-top-right-radius: 0;
border-top-left-radius: 0; }
.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
margin-bottom: 0;
border-top-right-radius: 4px;
border-top-left-radius: 4px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0; }
.navbar-btn {
margin-top: 8px;
margin-bottom: 8px; }
.navbar-btn.btn-sm, .btn-group-sm > .navbar-btn.btn {
margin-top: 10px;
margin-bottom: 10px; }
.navbar-btn.btn-xs, .btn-group-xs > .navbar-btn.btn {
margin-top: 14px;
margin-bottom: 14px; }
.navbar-text {
margin-top: 15px;
margin-bottom: 15px; }
@media (min-width: 768px) {
.navbar-text {
float: left;
margin-left: 15px;
margin-right: 15px; } }
@media (min-width: 768px) {
.navbar-left {
float: left !important; }
.navbar-right {
float: right !important;
margin-right: -15px; }
.navbar-right ~ .navbar-right {
margin-right: 0; } }
.navbar-default {
background-color: #f8f8f8;
border-color: #e7e7e7; }
.navbar-default .navbar-brand {
color: #777; }
.navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus {
color: #5e5e5e;
background-color: transparent; }
.navbar-default .navbar-text {
color: #777; }
.navbar-default .navbar-nav > li > a {
color: #777; }
.navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus {
color: #333;
background-color: transparent; }
.navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus {
color: #555;
background-color: #e7e7e7; }
.navbar-default .navbar-nav > .disabled > a, .navbar-default .navbar-nav > .disabled > a:hover, .navbar-default .navbar-nav > .disabled > a:focus {
color: #ccc;
background-color: transparent; }
.navbar-default .navbar-toggle {
border-color: #ddd; }
.navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus {
background-color: #ddd; }
.navbar-default .navbar-toggle .icon-bar {
background-color: #888; }
.navbar-default .navbar-collapse, .navbar-default .navbar-form {
border-color: #e7e7e7; }
.navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus {
background-color: #e7e7e7;
color: #555; }
@media (max-width: 767px) {
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #777; }
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
color: #333;
background-color: transparent; }
.navbar-default .navbar-nav .open .dropdown-menu > .active > a, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #555;
background-color: #e7e7e7; }
.navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: #ccc;
background-color: transparent; } }
.navbar-default .navbar-link {
color: #777; }
.navbar-default .navbar-link:hover {
color: #333; }
.navbar-default .btn-link {
color: #777; }
.navbar-default .btn-link:hover, .navbar-default .btn-link:focus {
color: #333; }
.navbar-default .btn-link[disabled]:hover, .navbar-default .btn-link[disabled]:focus, fieldset[disabled] .navbar-default .btn-link:hover, fieldset[disabled] .navbar-default .btn-link:focus {
color: #ccc; }
.navbar-inverse {
background-color: #222;
border-color: #090909; }
.navbar-inverse .navbar-brand {
color: #9d9d9d; }
.navbar-inverse .navbar-brand:hover, .navbar-inverse .navbar-brand:focus {
color: #fff;
background-color: transparent; }
.navbar-inverse .navbar-text {
color: #9d9d9d; }
.navbar-inverse .navbar-nav > li > a {
color: #9d9d9d; }
.navbar-inverse .navbar-nav > li > a:hover, .navbar-inverse .navbar-nav > li > a:focus {
color: #fff;
background-color: transparent; }
.navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus {
color: #fff;
background-color: #090909; }
.navbar-inverse .navbar-nav > .disabled > a, .navbar-inverse .navbar-nav > .disabled > a:hover, .navbar-inverse .navbar-nav > .disabled > a:focus {
color: #444;
background-color: transparent; }
.navbar-inverse .navbar-toggle {
border-color: #333; }
.navbar-inverse .navbar-toggle:hover, .navbar-inverse .navbar-toggle:focus {
background-color: #333; }
.navbar-inverse .navbar-toggle .icon-bar {
background-color: #fff; }
.navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form {
border-color: #101010; }
.navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:hover, .navbar-inverse .navbar-nav > .open > a:focus {
background-color: #090909;
color: #fff; }
@media (max-width: 767px) {
.navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
border-color: #090909; }
.navbar-inverse .navbar-nav .open .dropdown-menu .divider {
background-color: #090909; }
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
color: #9d9d9d; }
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
color: #fff;
background-color: transparent; }
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #fff;
background-color: #090909; }
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: #444;
background-color: transparent; } }
.navbar-inverse .navbar-link {
color: #9d9d9d; }
.navbar-inverse .navbar-link:hover {
color: #fff; }
.navbar-inverse .btn-link {
color: #9d9d9d; }
.navbar-inverse .btn-link:hover, .navbar-inverse .btn-link:focus {
color: #fff; }
.navbar-inverse .btn-link[disabled]:hover, .navbar-inverse .btn-link[disabled]:focus, fieldset[disabled] .navbar-inverse .btn-link:hover, fieldset[disabled] .navbar-inverse .btn-link:focus {
color: #444; }
.breadcrumb {
padding: 8px 15px;
margin-bottom: 20px;
list-style: none;
background-color: #f5f5f5;
border-radius: 4px; }
.breadcrumb > li {
display: inline-block; }
.breadcrumb > li + li:before {
content: "/\00a0";
padding: 0 5px;
color: #ccc; }
.breadcrumb > .active {
color: #777777; }
.pagination {
display: inline-block;
padding-left: 0;
margin: 20px 0;
border-radius: 4px; }
.pagination > li {
display: inline; }
.pagination > li > a, .pagination > li > span {
position: relative;
float: left;
padding: 6px 12px;
line-height: 1.428571429;
text-decoration: none;
color: #337ab7;
background-color: #fff;
border: 1px solid #ddd;
margin-left: -1px; }
.pagination > li:first-child > a, .pagination > li:first-child > span {
margin-left: 0;
border-bottom-left-radius: 4px;
border-top-left-radius: 4px; }
.pagination > li:last-child > a, .pagination > li:last-child > span {
border-bottom-right-radius: 4px;
border-top-right-radius: 4px; }
.pagination > li > a:hover, .pagination > li > a:focus, .pagination > li > span:hover, .pagination > li > span:focus {
color: #23527c;
background-color: #eeeeee;
border-color: #ddd; }
.pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus, .pagination > .active > span, .pagination > .active > span:hover, .pagination > .active > span:focus {
z-index: 2;
color: #fff;
background-color: #337ab7;
border-color: #337ab7;
cursor: default; }
.pagination > .disabled > span, .pagination > .disabled > span:hover, .pagination > .disabled > span:focus, .pagination > .disabled > a, .pagination > .disabled > a:hover, .pagination > .disabled > a:focus {
color: #777777;
background-color: #fff;
border-color: #ddd;
cursor: false; }
.pagination-lg > li > a, .pagination-lg > li > span {
padding: 10px 16px;
font-size: 18px; }
.pagination-lg > li:first-child > a, .pagination-lg > li:first-child > span {
border-bottom-left-radius: 6px;
border-top-left-radius: 6px; }
.pagination-lg > li:last-child > a, .pagination-lg > li:last-child > span {
border-bottom-right-radius: 6px;
border-top-right-radius: 6px; }
.pagination-sm > li > a, .pagination-sm > li > span {
padding: 5px 10px;
font-size: 12px; }
.pagination-sm > li:first-child > a, .pagination-sm > li:first-child > span {
border-bottom-left-radius: 3px;
border-top-left-radius: 3px; }
.pagination-sm > li:last-child > a, .pagination-sm > li:last-child > span {
border-bottom-right-radius: 3px;
border-top-right-radius: 3px; }
.pager {
padding-left: 0;
margin: 20px 0;
list-style: none;
text-align: center; }
.pager:before, .pager:after {
content: " ";
display: table; }
.pager:after {
clear: both; }
.pager li {
display: inline; }
.pager li > a, .pager li > span {
display: inline-block;
padding: 5px 14px;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 15px; }
.pager li > a:hover, .pager li > a:focus {
text-decoration: none;
background-color: #eeeeee; }
.pager .next > a, .pager .next > span {
float: right; }
.pager .previous > a, .pager .previous > span {
float: left; }
.pager .disabled > a, .pager .disabled > a:hover, .pager .disabled > a:focus, .pager .disabled > span {
color: #777777;
background-color: #fff;
cursor: false; }
.label {
display: inline;
padding: .2em .6em .3em;
font-size: 75%;
font-weight: bold;
line-height: 1;
color: #fff;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25em; }
.label:empty {
display: none; }
.btn .label {
position: relative;
top: -1px; }
a.label:hover, a.label:focus {
color: #fff;
text-decoration: none;
cursor: pointer; }
.label-default {
background-color: #777777; }
.label-default[href]:hover, .label-default[href]:focus {
background-color: #5e5e5e; }
.label-primary {
background-color: #337ab7; }
.label-primary[href]:hover, .label-primary[href]:focus {
background-color: #286090; }
.label-success {
background-color: #5cb85c; }
.label-success[href]:hover, .label-success[href]:focus {
background-color: #449d44; }
.label-info {
background-color: #5bc0de; }
.label-info[href]:hover, .label-info[href]:focus {
background-color: #31b0d5; }
.label-warning {
background-color: #f0ad4e; }
.label-warning[href]:hover, .label-warning[href]:focus {
background-color: #ec971f; }
.label-danger {
background-color: #d9534f; }
.label-danger[href]:hover, .label-danger[href]:focus {
background-color: #c9302c; }
.badge {
display: inline-block;
min-width: 10px;
padding: 3px 7px;
font-size: 12px;
font-weight: bold;
color: #fff;
line-height: 1;
vertical-align: baseline;
white-space: nowrap;
text-align: center;
background-color: #777777;
border-radius: 10px; }
.badge:empty {
display: none; }
.btn .badge {
position: relative;
top: -1px; }
.btn-xs .badge, .btn-group-xs > .btn .badge {
top: 0;
padding: 1px 5px; }
.list-group-item.active > .badge, .nav-pills > .active > a > .badge {
color: #337ab7;
background-color: #fff; }
.list-group-item > .badge {
float: right; }
.list-group-item > .badge + .badge {
margin-right: 5px; }
.nav-pills > li > a > .badge {
margin-left: 3px; }
a.badge:hover, a.badge:focus {
color: #fff;
text-decoration: none;
cursor: pointer; }
.jumbotron {
padding: 30px 15px;
margin-bottom: 30px;
color: inherit;
background-color: #eeeeee; }
.jumbotron h1, .jumbotron .h1 {
color: inherit; }
.jumbotron p {
margin-bottom: 15px;
font-size: 21px;
font-weight: 200; }
.jumbotron > hr {
border-top-color: #d5d5d5; }
.container .jumbotron, .container-fluid .jumbotron {
border-radius: 6px; }
.jumbotron .container {
max-width: 100%; }
@media screen and (min-width: 768px) {
.jumbotron {
padding: 48px 0; }
.container .jumbotron, .container-fluid .jumbotron {
padding-left: 60px;
padding-right: 60px; }
.jumbotron h1, .jumbotron .h1 {
font-size: 63px; } }
.thumbnail {
display: block;
padding: 4px;
margin-bottom: 20px;
line-height: 1.428571429;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 4px;
-webkit-transition: border .2s ease-in-out;
-o-transition: border .2s ease-in-out;
transition: border .2s ease-in-out; }
.thumbnail > img, .thumbnail a > img {
display: block;
max-width: 100%;
height: auto;
margin-left: auto;
margin-right: auto; }
.thumbnail .caption {
padding: 9px;
color: #333333; }
a.thumbnail:hover, a.thumbnail:focus, a.thumbnail.active {
border-color: #337ab7; }
.alert {
padding: 15px;
margin-bottom: 20px;
border: 1px solid transparent;
border-radius: 4px; }
.alert h4 {
margin-top: 0;
color: inherit; }
.alert .alert-link {
font-weight: bold; }
.alert > p, .alert > ul {
margin-bottom: 0; }
.alert > p + p {
margin-top: 5px; }
.alert-dismissable, .alert-dismissible {
padding-right: 35px; }
.alert-dismissable .close, .alert-dismissible .close {
position: relative;
top: -2px;
right: -21px;
color: inherit; }
.alert-success {
background-color: #dff0d8;
border-color: #d6e9c6;
color: #3c763d; }
.alert-success hr {
border-top-color: #c9e2b3; }
.alert-success .alert-link {
color: #2b542c; }
.alert-info {
background-color: #d9edf7;
border-color: #bce8f1;
color: #31708f; }
.alert-info hr {
border-top-color: #a6e1ec; }
.alert-info .alert-link {
color: #245269; }
.alert-warning {
background-color: #fcf8e3;
border-color: #faebcc;
color: #8a6d3b; }
.alert-warning hr {
border-top-color: #f7e1b5; }
.alert-warning .alert-link {
color: #66512c; }
.alert-danger {
background-color: #f2dede;
border-color: #ebccd1;
color: #a94442; }
.alert-danger hr {
border-top-color: #e4b9c0; }
.alert-danger .alert-link {
color: #843534; }
@-webkit-keyframes progress-bar-stripes {
from {
background-position: 40px 0; }
to {
background-position: 0 0; } }
@keyframes progress-bar-stripes {
from {
background-position: 40px 0; }
to {
background-position: 0 0; } }
.progress {
overflow: hidden;
height: 20px;
margin-bottom: 20px;
background-color: #f5f5f5;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); }
.progress-bar {
float: left;
width: 0%;
height: 100%;
font-size: 12px;
line-height: 20px;
color: #fff;
text-align: center;
background-color: #337ab7;
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
-webkit-transition: width .6s ease;
-o-transition: width .6s ease;
transition: width .6s ease; }
.progress-striped .progress-bar, .progress-bar-striped {
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-size: 40px 40px; }
.progress.active .progress-bar, .progress-bar.active {
-webkit-animation: progress-bar-stripes 2s linear infinite;
-o-animation: progress-bar-stripes 2s linear infinite;
animation: progress-bar-stripes 2s linear infinite; }
.progress-bar-success {
background-color: #5cb85c; }
.progress-striped .progress-bar-success {
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); }
.progress-bar-info {
background-color: #5bc0de; }
.progress-striped .progress-bar-info {
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); }
.progress-bar-warning {
background-color: #f0ad4e; }
.progress-striped .progress-bar-warning {
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); }
.progress-bar-danger {
background-color: #d9534f; }
.progress-striped .progress-bar-danger {
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); }
.media {
margin-top: 15px; }
.media:first-child {
margin-top: 0; }
.media, .media-body {
zoom: 1;
overflow: hidden; }
.media-body {
width: 10000px; }
.media-object {
display: block; }
.media-right, .media > .pull-right {
padding-left: 10px; }
.media-left, .media > .pull-left {
padding-right: 10px; }
.media-left, .media-right, .media-body {
display: table-cell;
vertical-align: top; }
.media-middle {
vertical-align: middle; }
.media-bottom {
vertical-align: bottom; }
.media-heading {
margin-top: 0;
margin-bottom: 5px; }
.media-list {
padding-left: 0;
list-style: none; }
.list-group {
margin-bottom: 20px;
padding-left: 0; }
.list-group-item {
position: relative;
display: block;
padding: 10px 15px;
margin-bottom: -1px;
background-color: #fff;
border: 1px solid #ddd; }
.list-group-item:first-child {
border-top-right-radius: 4px;
border-top-left-radius: 4px; }
.list-group-item:last-child {
margin-bottom: 0;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px; }
a.list-group-item {
color: #555; }
a.list-group-item .list-group-item-heading {
color: #333; }
a.list-group-item:hover, a.list-group-item:focus {
text-decoration: none;
color: #555;
background-color: #f5f5f5; }
.list-group-item.disabled, .list-group-item.disabled:hover, .list-group-item.disabled:focus {
background-color: #eeeeee;
color: #777777;
cursor: false; }
.list-group-item.disabled .list-group-item-heading, .list-group-item.disabled:hover .list-group-item-heading, .list-group-item.disabled:focus .list-group-item-heading {
color: inherit; }
.list-group-item.disabled .list-group-item-text, .list-group-item.disabled:hover .list-group-item-text, .list-group-item.disabled:focus .list-group-item-text {
color: #777777; }
.list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus {
z-index: 2;
color: #fff;
background-color: #337ab7;
border-color: #337ab7; }
.list-group-item.active .list-group-item-heading, .list-group-item.active .list-group-item-heading > small, .list-group-item.active .list-group-item-heading > .small, .list-group-item.active:hover .list-group-item-heading, .list-group-item.active:hover .list-group-item-heading > small, .list-group-item.active:hover .list-group-item-heading > .small, .list-group-item.active:focus .list-group-item-heading, .list-group-item.active:focus .list-group-item-heading > small, .list-group-item.active:focus .list-group-item-heading > .small {
color: inherit; }
.list-group-item.active .list-group-item-text, .list-group-item.active:hover .list-group-item-text, .list-group-item.active:focus .list-group-item-text {
color: #c7ddef; }
.list-group-item-success {
color: #3c763d;
background-color: #dff0d8; }
a.list-group-item-success {
color: #3c763d; }
a.list-group-item-success .list-group-item-heading {
color: inherit; }
a.list-group-item-success:hover, a.list-group-item-success:focus {
color: #3c763d;
background-color: #d0e9c6; }
a.list-group-item-success.active, a.list-group-item-success.active:hover, a.list-group-item-success.active:focus {
color: #fff;
background-color: #3c763d;
border-color: #3c763d; }
.list-group-item-info {
color: #31708f;
background-color: #d9edf7; }
a.list-group-item-info {
color: #31708f; }
a.list-group-item-info .list-group-item-heading {
color: inherit; }
a.list-group-item-info:hover, a.list-group-item-info:focus {
color: #31708f;
background-color: #c4e3f3; }
a.list-group-item-info.active, a.list-group-item-info.active:hover, a.list-group-item-info.active:focus {
color: #fff;
background-color: #31708f;
border-color: #31708f; }
.list-group-item-warning {
color: #8a6d3b;
background-color: #fcf8e3; }
a.list-group-item-warning {
color: #8a6d3b; }
a.list-group-item-warning .list-group-item-heading {
color: inherit; }
a.list-group-item-warning:hover, a.list-group-item-warning:focus {
color: #8a6d3b;
background-color: #faf2cc; }
a.list-group-item-warning.active, a.list-group-item-warning.active:hover, a.list-group-item-warning.active:focus {
color: #fff;
background-color: #8a6d3b;
border-color: #8a6d3b; }
.list-group-item-danger {
color: #a94442;
background-color: #f2dede; }
a.list-group-item-danger {
color: #a94442; }
a.list-group-item-danger .list-group-item-heading {
color: inherit; }
a.list-group-item-danger:hover, a.list-group-item-danger:focus {
color: #a94442;
background-color: #ebcccc; }
a.list-group-item-danger.active, a.list-group-item-danger.active:hover, a.list-group-item-danger.active:focus {
color: #fff;
background-color: #a94442;
border-color: #a94442; }
.list-group-item-heading {
margin-top: 0;
margin-bottom: 5px; }
.list-group-item-text {
margin-bottom: 0;
line-height: 1.3; }
.panel {
margin-bottom: 20px;
background-color: #fff;
border: 1px solid transparent;
border-radius: 4px;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); }
.panel-body {
padding: 15px; }
.panel-body:before, .panel-body:after {
content: " ";
display: table; }
.panel-body:after {
clear: both; }
.panel-heading {
padding: 10px 15px;
border-bottom: 1px solid transparent;
border-top-right-radius: 3px;
border-top-left-radius: 3px; }
.panel-heading > .dropdown .dropdown-toggle {
color: inherit; }
.panel-title {
margin-top: 0;
margin-bottom: 0;
font-size: 16px;
color: inherit; }
.panel-title > a, .panel-title > small, .panel-title > .small, .panel-title > small > a, .panel-title > .small > a {
color: inherit; }
.panel-footer {
padding: 10px 15px;
background-color: #f5f5f5;
border-top: 1px solid #ddd;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px; }
.panel > .list-group, .panel > .panel-collapse > .list-group {
margin-bottom: 0; }
.panel > .list-group .list-group-item, .panel > .panel-collapse > .list-group .list-group-item {
border-width: 1px 0;
border-radius: 0; }
.panel > .list-group:first-child .list-group-item:first-child, .panel > .panel-collapse > .list-group:first-child .list-group-item:first-child {
border-top: 0;
border-top-right-radius: 3px;
border-top-left-radius: 3px; }
.panel > .list-group:last-child .list-group-item:last-child, .panel > .panel-collapse > .list-group:last-child .list-group-item:last-child {
border-bottom: 0;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px; }
.panel-heading + .list-group .list-group-item:first-child {
border-top-width: 0; }
.list-group + .panel-footer {
border-top-width: 0; }
.panel > .table, .panel > .table-responsive > .table, .panel > .panel-collapse > .table {
margin-bottom: 0; }
.panel > .table caption, .panel > .table-responsive > .table caption, .panel > .panel-collapse > .table caption {
padding-left: 15px;
padding-right: 15px; }
.panel > .table:first-child, .panel > .table-responsive:first-child > .table:first-child {
border-top-right-radius: 3px;
border-top-left-radius: 3px; }
.panel > .table:first-child > thead:first-child > tr:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child {
border-top-left-radius: 3px;
border-top-right-radius: 3px; }
.panel > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table:first-child > thead:first-child > tr:first-child th:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child {
border-top-left-radius: 3px; }
.panel > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table:first-child > thead:first-child > tr:first-child th:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child {
border-top-right-radius: 3px; }
.panel > .table:last-child, .panel > .table-responsive:last-child > .table:last-child {
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px; }
.panel > .table:last-child > tbody:last-child > tr:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child {
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px; }
.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child {
border-bottom-left-radius: 3px; }
.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child {
border-bottom-right-radius: 3px; }
.panel > .panel-body + .table, .panel > .panel-body + .table-responsive, .panel > .table + .panel-body, .panel > .table-responsive + .panel-body {
border-top: 1px solid #ddd; }
.panel > .table > tbody:first-child > tr:first-child th, .panel > .table > tbody:first-child > tr:first-child td {
border-top: 0; }
.panel > .table-bordered, .panel > .table-responsive > .table-bordered {
border: 0; }
.panel > .table-bordered > thead > tr > th:first-child, .panel > .table-bordered > thead > tr > td:first-child, .panel > .table-bordered > tbody > tr > th:first-child, .panel > .table-bordered > tbody > tr > td:first-child, .panel > .table-bordered > tfoot > tr > th:first-child, .panel > .table-bordered > tfoot > tr > td:first-child, .panel > .table-responsive > .table-bordered > thead > tr > th:first-child, .panel > .table-responsive > .table-bordered > thead > tr > td:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {
border-left: 0; }
.panel > .table-bordered > thead > tr > th:last-child, .panel > .table-bordered > thead > tr > td:last-child, .panel > .table-bordered > tbody > tr > th:last-child, .panel > .table-bordered > tbody > tr > td:last-child, .panel > .table-bordered > tfoot > tr > th:last-child, .panel > .table-bordered > tfoot > tr > td:last-child, .panel > .table-responsive > .table-bordered > thead > tr > th:last-child, .panel > .table-responsive > .table-bordered > thead > tr > td:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {
border-right: 0; }
.panel > .table-bordered > thead > tr:first-child > td, .panel > .table-bordered > thead > tr:first-child > th, .panel > .table-bordered > tbody > tr:first-child > td, .panel > .table-bordered > tbody > tr:first-child > th, .panel > .table-responsive > .table-bordered > thead > tr:first-child > td, .panel > .table-responsive > .table-bordered > thead > tr:first-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > th {
border-bottom: 0; }
.panel > .table-bordered > tbody > tr:last-child > td, .panel > .table-bordered > tbody > tr:last-child > th, .panel > .table-bordered > tfoot > tr:last-child > td, .panel > .table-bordered > tfoot > tr:last-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th {
border-bottom: 0; }
.panel > .table-responsive {
border: 0;
margin-bottom: 0; }
.panel-group {
margin-bottom: 20px; }
.panel-group .panel {
margin-bottom: 0;
border-radius: 4px; }
.panel-group .panel + .panel {
margin-top: 5px; }
.panel-group .panel-heading {
border-bottom: 0; }
.panel-group .panel-heading + .panel-collapse > .panel-body, .panel-group .panel-heading + .panel-collapse > .list-group {
border-top: 1px solid #ddd; }
.panel-group .panel-footer {
border-top: 0; }
.panel-group .panel-footer + .panel-collapse .panel-body {
border-bottom: 1px solid #ddd; }
.panel-default {
border-color: #ddd; }
.panel-default > .panel-heading {
color: #333333;
background-color: #f5f5f5;
border-color: #ddd; }
.panel-default > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #ddd; }
.panel-default > .panel-heading .badge {
color: #f5f5f5;
background-color: #333333; }
.panel-default > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #ddd; }
.panel-primary {
border-color: #337ab7; }
.panel-primary > .panel-heading {
color: #fff;
background-color: #337ab7;
border-color: #337ab7; }
.panel-primary > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #337ab7; }
.panel-primary > .panel-heading .badge {
color: #337ab7;
background-color: #fff; }
.panel-primary > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #337ab7; }
.panel-success {
border-color: #d6e9c6; }
.panel-success > .panel-heading {
color: #3c763d;
background-color: #dff0d8;
border-color: #d6e9c6; }
.panel-success > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #d6e9c6; }
.panel-success > .panel-heading .badge {
color: #dff0d8;
background-color: #3c763d; }
.panel-success > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #d6e9c6; }
.panel-info {
border-color: #bce8f1; }
.panel-info > .panel-heading {
color: #31708f;
background-color: #d9edf7;
border-color: #bce8f1; }
.panel-info > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #bce8f1; }
.panel-info > .panel-heading .badge {
color: #d9edf7;
background-color: #31708f; }
.panel-info > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #bce8f1; }
.panel-warning {
border-color: #faebcc; }
.panel-warning > .panel-heading {
color: #8a6d3b;
background-color: #fcf8e3;
border-color: #faebcc; }
.panel-warning > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #faebcc; }
.panel-warning > .panel-heading .badge {
color: #fcf8e3;
background-color: #8a6d3b; }
.panel-warning > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #faebcc; }
.panel-danger {
border-color: #ebccd1; }
.panel-danger > .panel-heading {
color: #a94442;
background-color: #f2dede;
border-color: #ebccd1; }
.panel-danger > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #ebccd1; }
.panel-danger > .panel-heading .badge {
color: #f2dede;
background-color: #a94442; }
.panel-danger > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #ebccd1; }
.embed-responsive {
position: relative;
display: block;
height: 0;
padding: 0;
overflow: hidden; }
.embed-responsive .embed-responsive-item, .embed-responsive iframe, .embed-responsive embed, .embed-responsive object, .embed-responsive video {
position: absolute;
top: 0;
left: 0;
bottom: 0;
height: 100%;
width: 100%;
border: 0; }
.embed-responsive.embed-responsive-16by9 {
padding-bottom: 56.25%; }
.embed-responsive.embed-responsive-4by3 {
padding-bottom: 75%; }
.well {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); }
.well blockquote {
border-color: #ddd;
border-color: rgba(0, 0, 0, 0.15); }
.well-lg {
padding: 24px;
border-radius: 6px; }
.well-sm {
padding: 9px;
border-radius: 3px; }
.close {
float: right;
font-size: 21px;
font-weight: bold;
line-height: 1;
color: #000;
text-shadow: 0 1px 0 #fff;
opacity: 0.2;
filter: alpha(opacity=20); }
.close:hover, .close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
opacity: 0.5;
filter: alpha(opacity=50); }
button.close {
padding: 0;
cursor: pointer;
background: transparent;
border: 0;
-webkit-appearance: none; }
.modal-open {
overflow: hidden; }
.modal {
display: none;
overflow: hidden;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1040;
-webkit-overflow-scrolling: touch;
outline: 0; }
.modal.fade .modal-dialog {
-webkit-transform: translate(0, -25%);
-ms-transform: translate(0, -25%);
-o-transform: translate(0, -25%);
transform: translate(0, -25%);
-webkit-transition: -webkit-transform 0.3s ease-out;
-moz-transition: -moz-transform 0.3s ease-out;
-o-transition: -o-transform 0.3s ease-out;
transition: transform 0.3s ease-out; }
.modal.in .modal-dialog {
-webkit-transform: translate(0, 0);
-ms-transform: translate(0, 0);
-o-transform: translate(0, 0);
transform: translate(0, 0); }
.modal-open .modal {
overflow-x: hidden;
overflow-y: auto; }
.modal-dialog {
position: relative;
width: auto;
margin: 10px; }
.modal-content {
position: relative;
background-color: #fff;
border: 1px solid #999;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
-webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
background-clip: padding-box;
outline: 0; }
.modal-backdrop {
position: absolute;
top: 0;
right: 0;
left: 0;
background-color: #000; }
.modal-backdrop.fade {
opacity: 0;
filter: alpha(opacity=0); }
.modal-backdrop.in {
opacity: 0.5;
filter: alpha(opacity=50); }
.modal-header {
padding: 15px;
border-bottom: 1px solid #e5e5e5;
min-height: 16.428571429px; }
.modal-header .close {
margin-top: -2px; }
.modal-title {
margin: 0;
line-height: 1.428571429; }
.modal-body {
position: relative;
padding: 15px; }
.modal-footer {
padding: 15px;
text-align: right;
border-top: 1px solid #e5e5e5; }
.modal-footer:before, .modal-footer:after {
content: " ";
display: table; }
.modal-footer:after {
clear: both; }
.modal-footer .btn + .btn {
margin-left: 5px;
margin-bottom: 0; }
.modal-footer .btn-group .btn + .btn {
margin-left: -1px; }
.modal-footer .btn-block + .btn-block {
margin-left: 0; }
.modal-scrollbar-measure {
position: absolute;
top: -9999px;
width: 50px;
height: 50px;
overflow: scroll; }
@media (min-width: 768px) {
.modal-dialog {
width: 600px;
margin: 30px auto; }
.modal-content {
-webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); }
.modal-sm {
width: 300px; } }
@media (min-width: 992px) {
.modal-lg {
width: 900px; } }
.tooltip {
position: absolute;
z-index: 1070;
display: block;
visibility: visible;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 12px;
font-weight: normal;
line-height: 1.4;
opacity: 0;
filter: alpha(opacity=0); }
.tooltip.in {
opacity: 0.9;
filter: alpha(opacity=90); }
.tooltip.top {
margin-top: -3px;
padding: 5px 0; }
.tooltip.right {
margin-left: 3px;
padding: 0 5px; }
.tooltip.bottom {
margin-top: 3px;
padding: 5px 0; }
.tooltip.left {
margin-left: -3px;
padding: 0 5px; }
.tooltip-inner {
max-width: 200px;
padding: 3px 8px;
color: #fff;
text-align: center;
text-decoration: none;
background-color: #000;
border-radius: 4px; }
.tooltip-arrow {
position: absolute;
width: 0;
height: 0;
border-color: transparent;
border-style: solid; }
.tooltip.top .tooltip-arrow {
bottom: 0;
left: 50%;
margin-left: -5px;
border-width: 5px 5px 0;
border-top-color: #000; }
.tooltip.top-left .tooltip-arrow {
bottom: 0;
right: 5px;
margin-bottom: -5px;
border-width: 5px 5px 0;
border-top-color: #000; }
.tooltip.top-right .tooltip-arrow {
bottom: 0;
left: 5px;
margin-bottom: -5px;
border-width: 5px 5px 0;
border-top-color: #000; }
.tooltip.right .tooltip-arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-width: 5px 5px 5px 0;
border-right-color: #000; }
.tooltip.left .tooltip-arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-width: 5px 0 5px 5px;
border-left-color: #000; }
.tooltip.bottom .tooltip-arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000; }
.tooltip.bottom-left .tooltip-arrow {
top: 0;
right: 5px;
margin-top: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000; }
.tooltip.bottom-right .tooltip-arrow {
top: 0;
left: 5px;
margin-top: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000; }
.popover {
position: absolute;
top: 0;
left: 0;
z-index: 1060;
display: none;
max-width: 276px;
padding: 1px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
font-weight: normal;
line-height: 1.428571429;
text-align: left;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
white-space: normal; }
.popover.top {
margin-top: -10px; }
.popover.right {
margin-left: 10px; }
.popover.bottom {
margin-top: 10px; }
.popover.left {
margin-left: -10px; }
.popover-title {
margin: 0;
padding: 8px 14px;
font-size: 14px;
background-color: #f7f7f7;
border-bottom: 1px solid #ebebeb;
border-radius: 5px 5px 0 0; }
.popover-content {
padding: 9px 14px; }
.popover > .arrow, .popover > .arrow:after {
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid; }
.popover > .arrow {
border-width: 11px; }
.popover > .arrow:after {
border-width: 10px;
content: ""; }
.popover.top > .arrow {
left: 50%;
margin-left: -11px;
border-bottom-width: 0;
border-top-color: #999999;
border-top-color: rgba(0, 0, 0, 0.25);
bottom: -11px; }
.popover.top > .arrow:after {
content: " ";
bottom: 1px;
margin-left: -10px;
border-bottom-width: 0;
border-top-color: #fff; }
.popover.right > .arrow {
top: 50%;
left: -11px;
margin-top: -11px;
border-left-width: 0;
border-right-color: #999999;
border-right-color: rgba(0, 0, 0, 0.25); }
.popover.right > .arrow:after {
content: " ";
left: 1px;
bottom: -10px;
border-left-width: 0;
border-right-color: #fff; }
.popover.bottom > .arrow {
left: 50%;
margin-left: -11px;
border-top-width: 0;
border-bottom-color: #999999;
border-bottom-color: rgba(0, 0, 0, 0.25);
top: -11px; }
.popover.bottom > .arrow:after {
content: " ";
top: 1px;
margin-left: -10px;
border-top-width: 0;
border-bottom-color: #fff; }
.popover.left > .arrow {
top: 50%;
right: -11px;
margin-top: -11px;
border-right-width: 0;
border-left-color: #999999;
border-left-color: rgba(0, 0, 0, 0.25); }
.popover.left > .arrow:after {
content: " ";
right: 1px;
border-right-width: 0;
border-left-color: #fff;
bottom: -10px; }
.carousel {
position: relative; }
.carousel-inner {
position: relative;
overflow: hidden;
width: 100%; }
.carousel-inner > .item {
display: none;
position: relative;
-webkit-transition: .6s ease-in-out left;
-o-transition: .6s ease-in-out left;
transition: .6s ease-in-out left; }
.carousel-inner > .item > img, .carousel-inner > .item > a > img {
display: block;
max-width: 100%;
height: auto;
line-height: 1; }
@media all and (transform-3d), (-webkit-transform-3d) {
.carousel-inner > .item {
-webkit-transition: -webkit-transform 0.6s ease-in-out;
-moz-transition: -moz-transform 0.6s ease-in-out;
-o-transition: -o-transform 0.6s ease-in-out;
transition: transform 0.6s ease-in-out;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-perspective: 1000;
-moz-perspective: 1000;
perspective: 1000; }
.carousel-inner > .item.next, .carousel-inner > .item.active.right {
-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
left: 0; }
.carousel-inner > .item.prev, .carousel-inner > .item.active.left {
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
left: 0; }
.carousel-inner > .item.next.left, .carousel-inner > .item.prev.right, .carousel-inner > .item.active {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
left: 0; } }
.carousel-inner > .active, .carousel-inner > .next, .carousel-inner > .prev {
display: block; }
.carousel-inner > .active {
left: 0; }
.carousel-inner > .next, .carousel-inner > .prev {
position: absolute;
top: 0;
width: 100%; }
.carousel-inner > .next {
left: 100%; }
.carousel-inner > .prev {
left: -100%; }
.carousel-inner > .next.left, .carousel-inner > .prev.right {
left: 0; }
.carousel-inner > .active.left {
left: -100%; }
.carousel-inner > .active.right {
left: 100%; }
.carousel-control {
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 15%;
opacity: 0.5;
filter: alpha(opacity=50);
font-size: 20px;
color: #fff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.carousel-control.left {
background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); }
.carousel-control.right {
left: auto;
right: 0;
background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); }
.carousel-control:hover, .carousel-control:focus {
outline: 0;
color: #fff;
text-decoration: none;
opacity: 0.9;
filter: alpha(opacity=90); }
.carousel-control .icon-prev, .carousel-control .icon-next, .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right {
position: absolute;
top: 50%;
z-index: 5;
display: inline-block; }
.carousel-control .icon-prev, .carousel-control .glyphicon-chevron-left {
left: 50%;
margin-left: -10px; }
.carousel-control .icon-next, .carousel-control .glyphicon-chevron-right {
right: 50%;
margin-right: -10px; }
.carousel-control .icon-prev, .carousel-control .icon-next {
width: 20px;
height: 20px;
margin-top: -10px;
line-height: 1;
font-family: serif; }
.carousel-control .icon-prev:before {
content: '\2039'; }
.carousel-control .icon-next:before {
content: '\203a'; }
.carousel-indicators {
position: absolute;
bottom: 10px;
left: 50%;
z-index: 15;
width: 60%;
margin-left: -30%;
padding-left: 0;
list-style: none;
text-align: center; }
.carousel-indicators li {
display: inline-block;
width: 10px;
height: 10px;
margin: 1px;
text-indent: -999px;
border: 1px solid #fff;
border-radius: 10px;
cursor: pointer;
background-color: #000 \9;
background-color: transparent; }
.carousel-indicators .active {
margin: 0;
width: 12px;
height: 12px;
background-color: #fff; }
.carousel-caption {
position: absolute;
left: 15%;
right: 15%;
bottom: 20px;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #fff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.carousel-caption .btn {
text-shadow: none; }
@media screen and (min-width: 768px) {
.carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right, .carousel-control .icon-prev, .carousel-control .icon-next {
width: 30px;
height: 30px;
margin-top: -15px;
font-size: 30px; }
.carousel-control .glyphicon-chevron-left, .carousel-control .icon-prev {
margin-left: -15px; }
.carousel-control .glyphicon-chevron-right, .carousel-control .icon-next {
margin-right: -15px; }
.carousel-caption {
left: 20%;
right: 20%;
padding-bottom: 30px; }
.carousel-indicators {
bottom: 20px; } }
.clearfix:before, .clearfix:after {
content: " ";
display: table; }
.clearfix:after {
clear: both; }
.center-block {
display: block;
margin-left: auto;
margin-right: auto; }
.pull-right {
float: right !important; }
.pull-left {
float: left !important; }
.hide {
display: none !important; }
.show {
display: block !important; }
.invisible {
visibility: hidden; }
.text-hide {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0; }
.hidden {
display: none !important;
visibility: hidden !important; }
.affix {
position: fixed; }
@-ms-viewport {
width: device-width; }
.visible-xs {
display: none !important; }
.visible-sm {
display: none !important; }
.visible-md {
display: none !important; }
.visible-lg {
display: none !important; }
.visible-xs-block, .visible-xs-inline, .visible-xs-inline-block, .visible-sm-block, .visible-sm-inline, .visible-sm-inline-block, .visible-md-block, .visible-md-inline, .visible-md-inline-block, .visible-lg-block, .visible-lg-inline, .visible-lg-inline-block {
display: none !important; }
@media (max-width: 767px) {
.visible-xs {
display: block !important; }
table.visible-xs {
display: table; }
tr.visible-xs {
display: table-row !important; }
th.visible-xs, td.visible-xs {
display: table-cell !important; } }
@media (max-width: 767px) {
.visible-xs-block {
display: block !important; } }
@media (max-width: 767px) {
.visible-xs-inline {
display: inline !important; } }
@media (max-width: 767px) {
.visible-xs-inline-block {
display: inline-block !important; } }
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm {
display: block !important; }
table.visible-sm {
display: table; }
tr.visible-sm {
display: table-row !important; }
th.visible-sm, td.visible-sm {
display: table-cell !important; } }
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm-block {
display: block !important; } }
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm-inline {
display: inline !important; } }
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm-inline-block {
display: inline-block !important; } }
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md {
display: block !important; }
table.visible-md {
display: table; }
tr.visible-md {
display: table-row !important; }
th.visible-md, td.visible-md {
display: table-cell !important; } }
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md-block {
display: block !important; } }
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md-inline {
display: inline !important; } }
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md-inline-block {
display: inline-block !important; } }
@media (min-width: 1200px) {
.visible-lg {
display: block !important; }
table.visible-lg {
display: table; }
tr.visible-lg {
display: table-row !important; }
th.visible-lg, td.visible-lg {
display: table-cell !important; } }
@media (min-width: 1200px) {
.visible-lg-block {
display: block !important; } }
@media (min-width: 1200px) {
.visible-lg-inline {
display: inline !important; } }
@media (min-width: 1200px) {
.visible-lg-inline-block {
display: inline-block !important; } }
@media (max-width: 767px) {
.hidden-xs {
display: none !important; } }
@media (min-width: 768px) and (max-width: 991px) {
.hidden-sm {
display: none !important; } }
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-md {
display: none !important; } }
@media (min-width: 1200px) {
.hidden-lg {
display: none !important; } }
.visible-print {
display: none !important; }
@media print {
.visible-print {
display: block !important; }
table.visible-print {
display: table; }
tr.visible-print {
display: table-row !important; }
th.visible-print, td.visible-print {
display: table-cell !important; } }
.visible-print-block {
display: none !important; }
@media print {
.visible-print-block {
display: block !important; } }
.visible-print-inline {
display: none !important; }
@media print {
.visible-print-inline {
display: inline !important; } }
.visible-print-inline-block {
display: none !important; }
@media print {
.visible-print-inline-block {
display: inline-block !important; } }
@media print {
.hidden-print {
display: none !important; } }
@font-face {
font-family: 'Futura';
src: url('../fonts/Futura-Medium.eot');
src: url('../fonts/Futura-Medium.eot') format('embedded-opentype'), url('../fonts/Futura-Medium.woff') format('woff'), url('../fonts/Futura-Medium.ttf') format('truetype'), url('../fonts/Futura-Medium.svg') format('svg');
font-style: normal;
font-weight: 400; }
h1, h2, h3, h4, h5, h6 {
font-family: Raleway, sans-serif;
font-weight: normal;
color: #444; }
.btn-lg, .btn-group-lg > .btn {
border-radius: 6px;
font-size: 18px;
line-height: 1.33;
padding: 15px 30px; }
.footer-note p, .footer-note a {
color: #8cddcd;
font-weight: 300;
font-size: 13px; }
body {
font-family: Roboto, sans-serif; }
.img-center {
margin: 0 auto; }
.spacer-25px {
background: none !important;
height: 25px; }
.spacer-50px {
background: none !important;
height: 50px; }
.spacer-100px {
background: none !important;
height: 100px; }
.btn-primary {
background-color: #2ecc71;
border-bottom: 3px solid #24a35a;
border-color: #24a35a;
color: #fff; }
.btn-primary:hover {
background-color: #29b765;
border-bottom: 3px solid #208e4f;
border-color: #208e4f;
color: #fff; }
.btn-primary-alt {
background-color: #2c3e50;
border-bottom: 3px solid #233140;
border-color: #233140;
color: #fff; }
.btn-primary-alt:hover {
background-color: #273748;
border-bottom: 3px solid #1e2b38;
border-color: #1e2b38;
color: #fff; }
.btn-secondary {
background-color: #94a3a8;
border-bottom: 3px solid #768286;
border-color: #768286;
color: #fff; }
.btn-secondary:hover {
background-color: #859297;
border-bottom: 3px solid #677275;
border-color: #677275;
color: #fff; }
#header {
background: url("../images/hero-bg.jpg") 100% 0 no-repeat;
background-size: cover;
min-height: 600px; }
.navbar-default {
background-color: transparent;
border-color: transparent;
margin-bottom: 0; }
.navbar-default .navbar-brand {
color: #444;
font-size: 32px; }
.navbar-default .navbar-brand:hover {
color: #444;
font-size: 32px; }
.navbar-default .navbar-brand i {
font-size: 40px; }
.navbar-default .navbar-toggle {
border: none;
color: #444; }
.navbar-default .navbar-toggle:hover {
background-color: transparent;
color: #111; }
.navbar-default .navbar-toggle:focus {
background-color: transparent;
color: #111; }
.navbar-default .navbar-nav > li > a {
color: #444;
text-transform: uppercase; }
.navbar-default .navbar-nav > li > a:hover {
color: #111; }
.navbar-default .navbar-nav > li > a:focus {
color: #111; }
.navbar-default .navbar-nav > li > a:active {
color: #111; }
.navbar-default .navbar-nav > li > a.active {
color: #111; }
.navbar-nav {
padding-top: 20px; }
.navbar-nav > li > a {
padding-bottom: 10px;
padding-top: 10px; }
.navbar-right {
padding-top: 20px; }
.sign-in {
background-color: rgba(255, 255, 255, 0.5);
border-radius: 4px;
color: #444; }
.hero {
padding-top: 100px; }
.hero h2 {
font-size: 50px; }
.hero p {
color: #777;
font-size: 24px; }
#hero-4 h2, #hero-4 p {
font-family: 'Futura';
font-size: 3em;
line-height: 1.15;
color: #fff; }
#hero-4 p {
font-family: 'Futura';
font-size: 2em;
line-height: 1;
color: #fff; }
.hero-intro .success-message {
color: #777;
font-size: 16px; }
.hero-intro .error-message {
color: #777;
font-size: 16px; }
.hero-intro .form-control {
background: rgba(255, 255, 255, 0.5); }
.hero-buttons {
margin-top: 50px; }
#features {
background: #fff;
padding: 25px 0; }
#features p {
color: #999;
font-size: 16px;
font-weight: 300;
line-height: 23px; }
.features-item-text {
padding-top: 25px; }
.features-item-link {
margin-top: 25px; }
.features-item-link > a {
color: #444;
font-size: 16px;
line-height: 1.8em; }
.features-item-link > a:hover {
color: #2ecc71;
text-decoration: none; }
.features-item-link > i {
color: #c9d1d3;
padding-left: 10px; }
#pricing {
background: #fafafa;
padding: 125px 0; }
#pricing h2 {
color: #444;
font-size: 50px;
margin-bottom: 25px; }
#pricing p {
color: #999;
font-size: 18px;
font-weight: 300;
line-height: 1.8em; }
.pricing-item {
background: #fff;
border-bottom: 5px solid #ccc;
border-radius: 10px;
padding: 25px; }
.pricing-item h3 {
font-size: 32px;
margin-bottom: 25px; }
.pricing-item li {
color: #999;
font-size: 16px;
font-weight: 300;
line-height: 1.8em;
padding: 15px 0; }
.pricing-item i {
color: #2ecc71;
font-size: 18px;
padding-right: 10px; }
.pricing-item-buttons {
margin-top: 25px; }
.pricing-item-price-basic {
font-size: 32px; }
.pricing-item-price-pro {
font-size: 32px; }
.pricing-free-trial-link {
background: #fafafa;
border-radius: 25px;
cursor: default;
margin-left: 25px;
text-transform: uppercase;
padding: 5px 10px; }
.pricing-free-trial-link:hover {
text-decoration: none; }
.small-text {
font-size: 14px;
color: #ccc; }
.small-text a {
font-size: 14px;
color: #ccc;
text-decoration: underline; }
.small-text-2 {
font-size: 12px;
color: #1abc9c; }
#clients {
background: #fff;
padding: 125px 0; }
#clients h2 {
font-size: 50px;
margin-bottom: 25px; }
#clients p {
color: #999;
font-size: 18px;
font-weight: 300;
line-height: 1.8em; }
#clients blockquote {
border-left: none !important;
border-bottom: 3px solid #ddd; }
.clients-icon {
margin-top: 50px;
margin-bottom: 75px; }
.testimonials-author {
margin: 25px 0 0 28px; }
.testimonials-author a {
font-size: 15px;
font-weight: 700;
padding-left: 10px; }
.author-link {
font-size: 13px;
font-weight: 300; }
#footer {
background: #fff;
border-top: 1px solid #eee;
padding: 25px 0; }
.footer-social {
text-align: right; }
.footer-social li {
padding: 0; }
.footer-social li > a {
background: #8cddcd;
border-radius: 50%;
color: #fff;
display: block;
width: 25px;
height: 25px;
padding: 3px;
text-align: center; }
.back-to-top {
cursor: pointer;
position: fixed;
bottom: 7px;
right: 10px;
display: none; }
.modal-content {
background: #fff;
font-family: Varela Round, sans-serif;
margin: 0 auto;
width: 100%; }
.modal-header {
border-bottom: none; }
.form-control, .ginput_container input, .ginput_container select {
background-color: #eee;
background-image: none !important;
border: 0 solid transparent;
border-radius: 6px;
color: #1abc9c;
display: block;
font-size: 14px;
height: 55px;
line-height: 1.42857;
padding: 6px 12px;
width: 50%;
margin-bottom: 5px; }
.form-control:focus, .ginput_container input:focus, .ginput_container select:focus {
background-color: #fff;
border: 3px solid #eee;
box-shadow: none !important;
color: #1abc9c; }
.hero-4-form .gfield_label .gfield_required {
display: none;
margin-right: 5px;
color: #f7f06e; }
.hero-4-form h4 {
color: white; }
.forgot-password {
padding-left: 25px; }
#preloader {
position: fixed;
left: 0;
top: 0;
z-index: 999;
width: 100%;
height: 100%;
overflow: visible;
background: #333 url("../images/loader.gif") no-repeat center center; }
@media (min-width: 1200px) {
.container {
width: 980px; } }
@media (min-width: 320px) and (max-width: 768px) {
.hero-4-form {
width: 100% !important; } }
@media (min-width: 320px) and (max-width: 680px) {
#header {
background: url("../images/hero-bg.jpg") 25% 30% no-repeat;
background-size: cover;
min-height: 400px; }
#hero-4 .widget-area {
padding: 25px 25px 50px 25px; }
#header-4 {
padding: 15px 5px 0 !important; }
.hero {
padding-top: 0;
padding-bottom: 50px; }
.hero-4-form {
width: 100% !important; }
#features {
padding: 25px 0 70px; }
#pricing {
padding: 50px 0; }
.pricing-item {
margin: 10px 0; }
#clients {
padding: 50px 0; }
.clients-testimonials {
margin: 20px 0; }
.footer-note {
text-align: center; }
.footer-social {
text-align: center; }
.hero-buttons a {
padding: 15px; }
.form-control, .ginput_container input, .ginput_container select {
width: 100%; }
.features-item-text {
padding: 10px; } }
@media (min-width: 600px) and (max-width: 640px) {
.hero-intro {
width: 50%; }
.hero-intro h2 {
font-size: 26px; }
.hero-intro p {
font-size: 16px; } }
p.testimonials {
background: #fafafa;
border-bottom: 3px solid #ccc;
border-radius: 6px;
color: #999;
font-style: italic;
margin: 0;
padding: 25px;
position: relative; }
p.testimonials:before {
content: "";
position: absolute;
bottom: -20px;
left: 25px;
border-width: 20px 20px 0 20px;
border-style: solid;
border-color: #ccc transparent;
display: block; }
p.testimonials:after {
content: "";
position: absolute;
bottom: -15px;
left: 30px;
border-width: 15px 15px 0 15px;
border-style: solid;
border-color: #fafafa transparent;
display: block; }
h1 {
margin-top: 0; }
h2 {
margin-top: 0; }
h3 {
margin-top: 0; }
h4 {
margin-top: 0; }
h5 {
margin-top: 0; }
h6 {
margin-top: 0; }
.btn-4-lg, .gform_next_button {
padding: 48px 20px; }
.color {
color: #2980b9; }
.section-heading {
margin-bottom: 50px; }
.section-heading h2 {
text-transform: uppercase; }
#header-4 {
background: #fff;
padding: 15px 0; }
#hero-4 {
background: url(/wp-content/uploads/sites/4/2015/03/Girl-Bubbles2.jpg) no-repeat center center;
background-size: cover;
height: 100%;
width: 100%;
-webkit-transition: all 600ms linear !important;
-moz-transition: all 600ms linear !important;
-o-transition: all 600ms linear !important;
-ms-transition: all 600ms linear !important;
transition: all 600ms linear !important; }
.page-id-315 #hero-4 {
background: url(/wp-content/uploads/sites/4/2015/03/shutterstock_110629535.jpg) no-repeat center 70%;
background-size: cover;
height: 100%;
width: 100%;
min-height: 800px;
-webkit-transition: all 600ms linear !important;
-moz-transition: all 600ms linear !important;
-o-transition: all 600ms linear !important;
-ms-transition: all 600ms linear !important;
transition: all 600ms linear !important; }
.gform_next_button, .page-4 #gform_submit_button_4, .page-4 #gform_submit_button_5, .page-4 #gform_submit_button_6 {
background-color: #2ecc71;
border-bottom: 3px solid #24a35a;
border-color: #24a35a;
color: #fff;
display: inline-block;
margin-bottom: 0;
font-weight: 400;
text-align: center;
vertical-align: middle;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
white-space: nowrap;
padding: 48px 20px;
font-size: 14px;
line-height: 1.42857143;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
.gform_previous_button {
display: inline-block;
margin-bottom: 0;
font-weight: normal;
text-align: center;
vertical-align: middle;
touch-action: manipulation;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
white-space: nowrap;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
.page-4 #gform_submit_button_4, .page-4 #gform_submit_button_5 {
float: right;
margin-top: -84px; }
#lean_overlay {
position: fixed;
z-index: 100;
top: 0px;
left: 0px;
height: 100%;
width: 100%;
background: #000;
display: none; }
#companies-list {
width: 600px;
height: 500px;
overflow-y: scroll;
background: white;
padding: 30px;
display: none;
background: #FFF;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.7);
-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
-moz-box-shadow: 0 0px 4px rgba(0, 0, 0, 0.7);
color: #666; }
.application-header {
border-bottom: 1px solid white;
margin-bottom: 15px; }
#hero-4 .wrapper {
padding: 75px 10px;
height: 100%;
max-height: 2000px;
min-height: 800px;
background-image: linear-gradient(0deg, rgba(215, 98, 35, 0.75) 0%, rgba(81, 160, 131, 0.75) 0%, rgba(32, 99, 156, 0.75) 100%);
background-image: -moz-linear-gradient(0deg, rgba(215, 98, 35, 0.75) 0%, rgba(81, 160, 131, 0.75) 0%, rgba(32, 99, 156, 0.75) 100%);
background-image: -webkit-linear-gradient(0deg, rgba(215, 98, 35, 0.75) 0%, rgba(81, 160, 131, 0.75) 0%, rgba(32, 99, 156, 0.75) 100%);
background-image: -ms-linear-gradient(0deg, rgba(215, 98, 35, 0.75) 0%, rgba(81, 160, 131, 0.75) 0%, rgba(32, 99, 156, 0.75) 100%); }
.hero-4-form {
background: #2980b9;
border-radius: 6px;
color: #fff;
padding: 25px 25px 50px;
width: 50%; }
.hero-4-form ul {
list-style-type: none;
padding-left: 0px; }
.hero-4-form h3 {
border-bottom: 1px solid #fff;
display: inline-block;
font-size: 23px;
margin-top: 0;
margin-bottom: 25px;
padding-bottom: 15px;
text-transform: uppercase; }
.hero-4-form .form-group {
margin-right: 110px; }
.hero-4-form-btn, .gform_next_button {
font-size: 18px;
float: right;
margin-top: -65px; }
.hero-4-form .page-4 .gform_next_button {
margin-top: -5px; }
.hero-4-form a, .hero-4-form a:link, .hero-4-form a:visited {
color: white;
text-decoration: underline; }
.hero-4-form a:hover {
color: yellow; }
.hero-4-form iframe {
border: none; }
.page-id-242 #iframe-wrapper {
height: 865px;
width: 100%; }
@media (min-width: 1200px) {
.container {
width: 980px; } }
@media (min-width: 320px) and (max-width: 680px) {
#hero-4 {
min-height: 600px; }
#hero-4 h2 {
font-size: 2em;
line-height: 1; }
.page-id-315 #hero-4 {
background-image: none; }
#hero-4 p {
font-size: 1em; }
.header-4-logo h1 {
font-size: 30px; }
.hero-4-intro h2 {
font-size: 24px; }
#hero-4 .widget-area {
padding: 3px; }
.hero-4-form {
padding: 5px;
float: left; }
.page-id-242 .hero-4-form {
padding: 0px;
min-height: 800px; }
.page-id-242 #iframe-wrapper {
position: static;
right: 0;
bottom: 0;
left: 0;
top: 0;
overflow-x: hidden !important;
overflow-y: scroll !important;
height: 1200px;
-webkit-overflow-scrolling: touch !important; }
.page-id-242 iframe {
width: 100%;
height: 100%; }
.page-id-242 iframe #ctl00_ctl00_divPageFrame {
padding-right: 20px; }
.hero-4-form .gform_next_button {
margin-top: -5px; }
#hero-4 .wrapper {
padding: 15px 5px; }
#hero-4 .wrapper .container {
padding-left: 0px;
padding-right: 0px; }
#text-5 .text-right, #text-4 .text-right, #text-6 .text-right {
text-align: right; }
.page-4 #gform_submit_button_4, .page-4 #gform_submit_button_5 {
float: right;
margin-top: 0px;
padding: 6px 12px; }
#header-4 .glyphicon {
padding-right: 0px !important; }
#hero-4 .wrapper {
min-height: 600px; } }
.header-4-logo h1 {
color: #fff;
font-weight: 300; }
.header-4-logo img {
width: 100%;
max-width: 300px;
margin-left: -7px; }
.header-4-social > ul > li > a {
background: #222;
border-radius: 50%;
color: #fff;
display: inline-block;
font-size: 18px;
height: 45px;
padding-top: 10px;
width: 45px;
text-align: center; }
.header-4-social > ul > li > a:hover {
background: #111; }
.header-4-social > ul > li > a:focus {
background: #111; }
.hero-4-intro h2 {
font-size: 50px;
text-transform: uppercase; }
.skip-link {
display: none; }
.page, #page {
height: 100% !important;
overflow-x: hidden; }
.permission {
line-height: 14px;
margin-top: 15px;
font-size: 13px;
text-align: justify; }
.page-4 label, .page-3 label {
display: none; }
.validation_error, .validation_message {
line-height: 14px;
margin-bottom: 10px;
color: yellow; }
.gfield_error .ginput_container {
border: 2px solid yellow;
padding: 5px; }
.post-meta {
display: none; }
#header-4 .glyphicon {
font-size: 28px;
color: #fff;
border-radius: 50%;
width: 50px;
height: 50px;
background-color: #2ecc71;
padding-top: 11px;
padding-right: 9px;
margin-right: 10px; }
#header-4 .phone-number a, #header-4 .phone-number a:link, #header-4 .phone-number a:visited {
color: #0B4499;
font-size: 24px; }
#continue_app {
float: none;
margin-top: 0px;
display: none; }
#working {
width: 25px;
margin: 0px auto; }
.page-id-242 .hero-4-form {
width: 100% !important; }
.viva-txt {
color: white; }
| snappermorgan/snapgen2 | wp-content/themes/snapgen/css/snapgen.css | CSS | gpl-2.0 | 162,866 |
<?php /* Template Name: Template - About */ ?>
<?php include("header.php"); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php include("inc/top-banner.php") ?>
<div class="page-content">
<section class="row">
<h1 class="page-title"><?php the_title(); ?></h1>
<div class="column small-12 medium-10 medium-centered">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam pellentesque lacinia quam vel laoreet. Praesent eget arcu venenatis, suscipit tellus quis, consectetur urna. Phasellus facilisis justo magna, in mattis urna gravida a. Duis fermentum tristique odio, non semper nisl semper id. Nullam ac luctus nisi.
</p>
<p>
Duis venenatis orci hendrerit, feugiat arcu a, mollis libero. Proin at tincidunt nibh, nec semper lorem. Sed eget cursus lectus. Duis semper, urna ut vulputate mollis, purus justo egestas ipsum, et pretium tortor magna ut massa.
</p>
</div>
<?php the_content(); ?>
</section>
<section class="category-container">
<div class="row">
<a href="#" data-program="program--film-acting" class="box-bg program--film-acting"
style="background: url(<?php echo get_template_directory_uri(); ?>/images/examples/programs/film-acting.jpg) no-repeat center center; background-size: cover">
<span class="program__cat">Film Acting</span>
</a>
<a href="#" data-program="program--prosthetic-makeup" class="box-bg program--prosthetic-makeup"
style="background: url(<?php echo get_template_directory_uri(); ?>/images/examples/programs/film-prosthetic-makeup.jpg) no-repeat center center; background-size: cover">
<span class="program__cat">Film<br> + <br>Prosthetic Makeup</span>
</a>
<a href="#" data-program="program--beauty-makeup" class="box-bg program--beauty-makeup"
style="background: url(<?php echo get_template_directory_uri(); ?>/images/examples/programs/high-fashion-beauty-makeup.jpg) no-repeat center center; background-size: cover">
<span class="program__cat">High Fashion<br> + <br>Beauty Makeup</span>
</a>
<a href="#" data-program="program--cosmethology" class="box-bg program--cosmethology"
style="background: url(<?php echo get_template_directory_uri(); ?>/images/examples/programs/esthetics-cosmethology.png) no-repeat center center; background-size: cover">
<span class="program__cat">Esthetics<br> + <br>Cosmethology</span>
</a>
<a href="#" data-program="program--medical-esthetics" class="box-bg program--medical-esthetics"
style="background: url(<?php echo get_template_directory_uri(); ?>/images/examples/programs/medical-esthetics.jpg) no-repeat center center; background-size: cover">
<span class="program__cat">Medical Esthetics</span>
</a>
<a href="#" data-program="program--nail-design" class="box-bg program--nail-design"
style="background: url(<?php echo get_template_directory_uri(); ?>/images/examples/programs/nail-art-design.jpg) no-repeat center center; background-size: cover">
<span class="program__cat">Nail Art<br> + <br>Design</span>
</a>
<a href="#" data-program="program--hair-design" class="box-bg program--hair-design"
style="background: url(<?php echo get_template_directory_uri(); ?>/images/examples/programs/hair-styling-design.jpg) no-repeat center center; background-size: cover">
<span class="program__cat">Hair Styling<br> + <br>Design</span>
</a>
<a href="#" data-program="program--teen-career" class="box-bg program--teen-career"
style="background: url(<?php echo get_template_directory_uri(); ?>/images/examples/programs/teen-career.jpg) no-repeat center center; background-size: cover">
<span class="program__cat">Teen Career Jumpstart</span>
</a>
</div>
</section>
<span class="categories-separator arrow-separator"></span>
<section class="section-programs section-programs--programs">
<div class="programs-container">
<div class="programs-row">
<a href="/nic/programs/film-acting/acting-101/" class="box-bg hex program--film-acting">
<span class="program__cat">Acting 101</span>
</a>
<a href="/nic/programs/film-prosthetic-makeup/fashion-and-film-makeup-design/" class="box-bg hex program--prosthetic-makeup">
<span class="program__cat">Fashion and Film Makeup Design</span>
</a>
<a href="/nic/programs/high-fashion-beauty-makeup/beauty-design/" class="box-bg hex program--beauty-makeup">
<span class="program__cat">Beauty Design</span>
</a>
</div>
<div class="programs-row programs-row--even">
<a href="/nic/programs/hair-styling-design/hair-styling-and-design/" class="box-bg hex program--hair-design">
<span class="program__cat">Hair Styling and Design</span>
</a>
<a href="/nic/programs/high-fashion-beauty-makeup/avant-garde-makeup-design/" class="box-bg hex program--beauty-makeup">
<span class="program__cat">Avant Garde Makeup Design</span>
</a>
<a href="/nic/programs/medical-esthetics/advanced-spa-technician/" class="box-bg hex program--medical-esthetics">
<span class="program__cat">Advanced Spa Technician</span>
</a>
<a href="/nic/programs/film-acting/film-acting-intermediate/" class="box-bg hex program--film-acting">
<span class="program__cat">Film Acting Intermediate</span>
</a>
</div>
<div class="programs-row">
<a href="/nic/programs/nail-art-design/nail-technician/" class="box-bg hex program--nail-design">
<span class="program__cat">Nail Technician</span>
</a>
<a href="#" class="box-bg hex program--nic">
<span class="program__cat"><img src="<?php echo get_template_directory_uri(); ?>/images/nic_white.svg" alt=""></span>
</a>
<a href="/nic/programs/teen-career-jumpstart/teen-acting/" class="box-bg hex program--teen-career">
<span class="program__cat">Teen Acting</span>
</a>
</div>
<div class="programs-row programs-row--even">
<a href="/nic/programs/teen-career-jumpstart/teen-makeup/" class="box-bg hex program--teen-career">
<span class="program__cat">Teen Makeup</span>
</a>
<a href="/nic/programs/film-acting/film-acting-advanced/" class="box-bg hex program--film-acting">
<span class="program__cat">Film Acting Advanced</span>
</a>
<a href="/nic/programs/film-prosthetic-makeup/cutting-edge-advanced-prosthetics/" class="box-bg hex program--prosthetic-makeup">
<span class="program__cat">Cutting Edge Advanced Prosthetics</span>
</a>
<a href="/nic/programs/high-fashion-beauty-makeup/fashion-film-makeup-design/" class="box-bg hex program--beauty-makeup">
<span class="program__cat">Fashion and Film Makeup Design</span>
</a>
</div>
<div class="programs-row">
<a href="/nic/programs/high-fashion-beauty-makeup/beauty-makeup-artist/" class="box-bg hex program--beauty-makeup">
<span class="program__cat">Beauty Makeup Artist</span>
</a>
<a href="/nic/programs/esthetics-cosmethology/spa-technician/" class="box-bg hex program--cosmethology">
<span class="program__cat">Spa Technician</span>
</a>
<a href="/nic/programs/teen-career-jumpstart/teen-spa/" class="box-bg hex program--teen-career">
<span class="program__cat">Teen Spa</span>
</a>
</div>
</div>
</section>
</div>
<?php endwhile; ?>
<?php include("footer.php"); ?>
| alldrops/nic | wp-content/themes/nic/template-about.php | PHP | gpl-2.0 | 7,366 |
package src;
import scala.collection.mutable.MutableList
object Knight
{
final val possibleMovesDirection = Array(-19, -21, -12, -8, 19, 21, 8, 12)
final val pieceValue = 320
// position value tables and piece values taken from
// http://chessprogramming.wikispaces.com/Simplified+evaluation+function
final val positionValue = Array(
Array(
-50,-40,-30,-30,-30,-30,-40,-50,
-40,-20, 0, 0, 0, 0,-20,-40,
-30, 0, 10, 15, 15, 10, 0,-30,
-30, 5, 15, 20, 20, 15, 5,-30,
-30, 0, 15, 20, 20, 15, 0,-30,
0, 5, 10, 15, 15, 10, 5,-30,
-40,-20, 0, 5, 5, 0,-20,-40,
-50,-40,-20,-30,-30,-20,-40,-50),
Array(
-50,-40,-20,-30,-30,-20,-40,-50,
-40,-20, 0, 5, 5, 0,-20,-40,
0, 5, 10, 15, 15, 10, 5,-30,
-30, 0, 15, 20, 20, 15, 0,-30,
-30, 5, 15, 20, 20, 15, 5,-30,
-30, 0, 10, 15, 15, 10, 0,-30,
-40,-20, 0, 0, 0, 0,-20,-40,
-50,-40,-30,-30,-30,-30,-40,-50)
)
}
class Knight(pos : Int, col : Int, identifire : Int)
extends Piece(pos, col, identifire, Piece.KNIGHT)
{
def this(position : String, color : Int, id : Int)=
this(Cord.fromString(position), color, id)
def generateMoves(b : Board, moveList : Array[Move], index : Int) =
{
var ind = index
var i = 0
var tmpPos = 0
val len = Knight.possibleMovesDirection.size
while (i < len)
{
tmpPos = position + Knight.possibleMovesDirection(i)
if (b.isEmpty(tmpPos))
{
moveList(ind) = new QuietMove(position, tmpPos, 0, b.castlingRights, false)
ind += 1
}
else if (b.isOccupiedByOpponent(tmpPos, color))
{
moveList(ind) = new CaptureMove(position, tmpPos, b.castlingRights)
ind += 1
}
i += 1
}
ind
}
def generateAttacks(b : Board, moveList : Array[Move], index : Int) =
{
var ind = index
var i = 0
var tmpPos = 0
val len = Knight.possibleMovesDirection.size
while (i < len)
{
tmpPos = position + Knight.possibleMovesDirection(i)
if (b.isOccupiedByOpponent(tmpPos, color))
{
moveList(ind) = new CaptureMove(position, tmpPos, b.castlingRights)
ind += 1
}
i += 1
}
ind
}
def rank(b : Board) = Knight.pieceValue +
Knight.positionValue(color)(Cord.from120to64(position))
}
| mszacun/Scala-Chess | src/Knight.scala | Scala | gpl-2.0 | 2,214 |
/*
* Craft - Crafting game for Android, PC and Browser.
* Copyright (C) 2014 Miguel Gonzalez
*
* 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, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package de.bitbrain.craft.models;
import de.bitbrain.jpersis.annotations.PrimaryKey;
/**
* Object representation of a learned recipe
*
* @author Miguel Gonzalez <miguel-gonzalez@gmx.de>
* @since 1.0
* @version 1.0
*/
public class LearnedRecipe {
@PrimaryKey(true)
private int id;
private int recipeId;
private int playerId;
public LearnedRecipe() {
}
public LearnedRecipe(int i, int playerId) {
this.recipeId = i;
this.playerId = playerId;
}
/**
* @param id
* the id to set
*/
public void setId(int id) {
this.id = id;
}
/**
* @param itemId
* the itemId to set
*/
public void setRecipeId(int recipeId) {
this.recipeId = recipeId;
}
/**
* @param playerId
* the playerId to set
*/
public void setPlayerId(int playerId) {
this.playerId = playerId;
}
/**
* @return the id
*/
public int getId() {
return id;
}
/**
* @return the itemId
*/
public int getRecipeId() {
return recipeId;
}
/**
* @return the playerId
*/
public int getPlayerId() {
return playerId;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + playerId;
result = prime * result + recipeId;
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
LearnedRecipe other = (LearnedRecipe) obj;
if (playerId != other.playerId)
return false;
if (recipeId != other.recipeId)
return false;
return true;
}
}
| bitbrain-gaming/craft | core/src/de/bitbrain/craft/models/LearnedRecipe.java | Java | gpl-2.0 | 2,512 |
<?php
namespace Razor\Core\Order;
use \Razor\Core\Shipping\Method\Method as ShippingMethod;
use Loader;
class Shipping {
protected $shipping_method; // shipping method object
protected $order; // order object
protected $cost; // order shipping cost
public function __construct( $shippingMethodHandle, $order ) {
$this->shipping_method = ShippingMethod::getByHandle( $shippingMethodHandle );
$this->order = $order;
}
public function getMethodHandle() {
return $this->shipping_method->getHandle();
}
public function calculateCost() {
$this->cost = $this->shipping_method->calculateCost( $this->order );
}
public function getCost() {
return $this->cost;
}
public function setCost( $cost ) {
$this->cost = $cost;
}
}
| RazorCommerce/razor-commerce | razor/src/Order/Shipping.php | PHP | gpl-2.0 | 772 |
<?php
$initpath = "../init";
$loginpath = "../httpdocs/login";
$state = 0;
$host = $_SERVER["HTTP_HOST"];
$splitter = explode(":", $host);
$domain = $splitter[0];
$port = ($splitter[1]) ? $splitter[1] : '80';
$requesturi = $_SERVER["REQUEST_URI"];
$scheme = $_SERVER["HTTP_SCHEME"];
// if (file_exists("{$loginpath}/redirect-to-hostname")) {
$domain_pure = preg_replace('/(cp\.|webmail\.|www\.|mail\.)(.*)/i', "$2", $domain);
if ($domain_pure !== $domain) {
$state += 1;
$domain = $domain_pure;
}
// }
if (file_exists("{$loginpath}/redirect-to-ssl")) {
if ($_SERVER["HTTPS"] !== "on") {
$state += 2;
$port = str_replace("\n", "", file_get_contents("{$initpath}/port-ssl"));
$scheme = 'https';
}
}
if (file_exists("{$loginpath}/redirect-to-domain")) {
// MR -- this domain always without ':port'
$domain = str_replace("\n", "", file_get_contents("{$loginpath}/redirect-to-domain"));
if ($domain.':'.$port !== $host) {
$state += 4;
}
}
if ($state !== 0) {
// header("HTTP/1.1 301 Moved Permanently");
// header("Location: {$scheme}://{$domain}:{$port}{$requesturi}");
// exit();
echo "<script> location.replace('{$scheme}://{$domain}:{$port}{$requesturi}'); </script>";
} | zuoziqi/KloxoST | httpdocs/lib/redirect.php | PHP | gpl-2.0 | 1,234 |
<?php
/**
* Rule checking the value's length
*
* PHP version 5
*
* LICENSE:
*
* Copyright (c) 2006-2011, Alexey Borzov <avb@php.net>,
* Bertrand Mansion <golgote@mamasam.com>
* 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.
* * The names of the authors may not 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.
*
* @category HTML
* @package HTML_QuickForm2
* @author Alexey Borzov <avb@php.net>
* @author Bertrand Mansion <golgote@mamasam.com>
* @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version SVN: $Id: Length.php 311435 2011-05-26 10:30:06Z avb $
* @link http://pear.php.net/package/HTML_QuickForm2
*/
/**
* Base class for HTML_QuickForm2 rules
*/
require_once 'HTML/QuickForm2/Rule.php';
/**
* Rule checking the value's length
*
* The rule needs an "allowed length" parameter for its work, it can be either
* - a scalar: the value will be valid if it is exactly this long
* - an array: the value will be valid if its length is between the given values
* (inclusive). If one of these evaluates to 0, then length will be compared
* only with the remaining one.
* See {@link mergeConfig()} for description of possible ways to pass
* configuration parameters.
*
* The Rule considers empty fields as valid and doesn't try to compare their
* lengths with provided limits.
*
* For convenience this Rule is also registered with the names 'minlength' and
* 'maxlength' (having, respectively, 'max' and 'min' parameters set to 0):
* <code>
* $password->addRule('minlength', 'The password should be at least 6 characters long', 6);
* $message->addRule('maxlength', 'Your message is too verbose', 1000);
* </code>
*
* @category HTML
* @package HTML_QuickForm2
* @author Alexey Borzov <avb@php.net>
* @author Bertrand Mansion <golgote@mamasam.com>
* @version Release: @package_version@
*/
class HTML_QuickForm2_Rule_Length extends HTML_QuickForm2_Rule
{
/**
* Validates the owner element
*
* @return bool whether length of the element's value is within allowed range
*/
protected function validateOwner()
{
if (0 == ($valueLength = strlen($this->owner->getValue()))) {
return true;
}
$allowedLength = $this->getConfig();
if (is_scalar($allowedLength)) {
return $valueLength == $allowedLength;
} else {
return (empty($allowedLength['min']) || $valueLength >= $allowedLength['min']) &&
(empty($allowedLength['max']) || $valueLength <= $allowedLength['max']);
}
}
protected function getJavascriptCallback()
{
$allowedLength = $this->getConfig();
if (is_scalar($allowedLength)) {
$check = "length == {$allowedLength}";
} else {
$checks = array();
if (!empty($allowedLength['min'])) {
$checks[] = "length >= {$allowedLength['min']}";
}
if (!empty($allowedLength['max'])) {
$checks[] = "length <= {$allowedLength['max']}";
}
$check = implode(' && ', $checks);
}
return "function() { var length = " . $this->owner->getJavascriptValue() .
".length; return qf.rules.empty(length) || ({$check}); }";
}
/**
* Adds the 'min' and 'max' fields from one array to the other
*
* @param array Rule configuration, array with 'min' and 'max' keys
* @param array Additional configuration, fields will be added to
* $length if it doesn't contain such a key already
* @return array
*/
protected static function mergeMinMaxLength($length, $config)
{
if (array_key_exists('min', $config) || array_key_exists('max', $config)) {
if (!array_key_exists('min', $length) && array_key_exists('min', $config)) {
$length['min'] = $config['min'];
}
if (!array_key_exists('max', $length) && array_key_exists('max', $config)) {
$length['max'] = $config['max'];
}
} else {
if (!array_key_exists('min', $length)) {
$length['min'] = reset($config);
}
if (!array_key_exists('max', $length)) {
$length['max'] = end($config);
}
}
return $length;
}
/**
* Merges length limits given on rule creation with those given to registerRule()
*
* "Global" length limits may be passed to
* {@link HTML_QuickForm2_Factory::registerRule()} in either of the
* following formats
* - scalar (exact length)
* - array(minlength, maxlength)
* - array(['min' => minlength, ]['max' => maxlength])
*
* "Local" length limits may be passed to the constructor in either of
* the following formats
* - scalar (if global config is unset then it is treated as an exact
* length, if 'min' or 'max' is in global config then it is treated
* as 'max' or 'min', respectively)
* - array(minlength, maxlength)
* - array(['min' => minlength, ]['max' => maxlength])
*
* As usual, global configuration overrides local one.
*
* @param int|array Local length limits
* @param int|array Global length limits, usually provided to {@link HTML_QuickForm2_Factory::registerRule()}
* @return int|array Merged length limits
*/
public static function mergeConfig($localConfig, $globalConfig)
{
if (!isset($globalConfig)) {
$length = $localConfig;
} elseif (!is_array($globalConfig)) {
$length = $globalConfig;
} else {
$length = self::mergeMinMaxLength(array(), $globalConfig);
if (isset($localConfig)) {
$length = self::mergeMinMaxLength(
$length, is_array($localConfig)? $localConfig: array($localConfig)
);
}
}
return $length;
}
/**
* Sets the allowed length limits
*
* $config can be either of the following
* - integer (rule checks for exact length)
* - array(minlength, maxlength)
* - array(['min' => minlength, ]['max' => maxlength])
*
* @param int|array Length limits
* @return HTML_QuickForm2_Rule
* @throws HTML_QuickForm2_InvalidArgumentException if bogus length limits
* were provided
*/
public function setConfig($config)
{
if (is_array($config)) {
$config = self::mergeMinMaxLength(array(), $config)
+ array('min' => 0, 'max' => 0);
}
if (is_array($config) && ($config['min'] < 0 || $config['max'] < 0) ||
!is_array($config) && $config < 0)
{
throw new HTML_QuickForm2_InvalidArgumentException(
'Length Rule requires limits to be nonnegative, ' .
preg_replace('/\s+/', ' ', var_export($config, true)) . ' given'
);
} elseif (is_array($config) && $config['min'] == 0 && $config['max'] == 0 ||
!is_array($config) && 0 == $config)
{
throw new HTML_QuickForm2_InvalidArgumentException(
'Length Rule requires at least one non-zero limit, ' .
preg_replace('/\s+/', ' ', var_export($config, true)) . ' given'
);
}
if (!empty($config['min']) && !empty($config['max'])) {
if ($config['min'] > $config['max']) {
list($config['min'], $config['max']) = array($config['max'], $config['min']);
} elseif ($config['min'] == $config['max']) {
$config = $config['min'];
}
}
return parent::setConfig($config);
}
}
?>
| grlf/eyedock | amember/library/pear/HTML/QuickForm2/Rule/Length.php | PHP | gpl-2.0 | 9,219 |
public class String : IComparable, ICloneable, IConvertible, IComparable<string>, IEnumerable<char>, System.Collections.IEnumerable, IEquatable<string>
{
// Constructors
public String(Char* value) {}
public String(Char* value, int startIndex, int length) {}
public String(SByte* value) {}
public String(SByte* value, int startIndex, int length) {}
public String(SByte* value, int startIndex, int length, System.Text.Encoding enc) {}
public String(char[] value, int startIndex, int length) {}
public String(char[] value) {}
public String(char c, int count) {}
// Methods
public int IndexOf(char value, int startIndex, int count) {}
public int IndexOfAny(char[] anyOf, int startIndex, int count) {}
public int LastIndexOf(char value, int startIndex, int count) {}
public int LastIndexOfAny(char[] anyOf, int startIndex, int count) {}
public string Insert(int startIndex, string value) {}
public string Replace(char oldChar, char newChar) {}
public string Replace(string oldValue, string newValue) {}
public string Remove(int startIndex, int count) {}
public static string Join(string separator, string[] value) {}
public static string Join(string separator, string[] value, int startIndex, int count) {}
public virtual bool Equals(object obj) {}
public virtual bool Equals(string value) {}
public bool Equals(string value, StringComparison comparisonType) {}
public static bool Equals(string a, string b) {}
public static bool Equals(string a, string b, StringComparison comparisonType) {}
public static bool op_Equality(string a, string b) {}
public static bool op_Inequality(string a, string b) {}
public void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count) {}
public char[] ToCharArray() {}
public char[] ToCharArray(int startIndex, int length) {}
public static bool IsNullOrEmpty(string value) {}
public virtual int GetHashCode() {}
public string[] Split(char[] separator) {}
public string[] Split(char[] separator, int count) {}
public string[] Split(char[] separator, StringSplitOptions options) {}
public string[] Split(char[] separator, int count, StringSplitOptions options) {}
public string[] Split(string[] separator, StringSplitOptions options) {}
public string[] Split(string[] separator, int count, StringSplitOptions options) {}
public string Substring(int startIndex) {}
public string Substring(int startIndex, int length) {}
public string Trim(char[] trimChars) {}
public string TrimStart(char[] trimChars) {}
public string TrimEnd(char[] trimChars) {}
public bool IsNormalized() {}
public bool IsNormalized(System.Text.NormalizationForm normalizationForm) {}
public string Normalize() {}
public string Normalize(System.Text.NormalizationForm normalizationForm) {}
public static int Compare(string strA, string strB) {}
public static int Compare(string strA, string strB, bool ignoreCase) {}
public static int Compare(string strA, string strB, StringComparison comparisonType) {}
public static int Compare(string strA, string strB, bool ignoreCase, System.Globalization.CultureInfo culture) {}
public static int Compare(string strA, int indexA, string strB, int indexB, int length) {}
public static int Compare(string strA, int indexA, string strB, int indexB, int length, bool ignoreCase) {}
public static int Compare(string strA, int indexA, string strB, int indexB, int length, bool ignoreCase, System.Globalization.CultureInfo culture) {}
public static int Compare(string strA, int indexA, string strB, int indexB, int length, StringComparison comparisonType) {}
public virtual int CompareTo(object value) {}
public virtual int CompareTo(string strB) {}
public static int CompareOrdinal(string strA, string strB) {}
public static int CompareOrdinal(string strA, int indexA, string strB, int indexB, int length) {}
public bool Contains(string value) {}
public bool EndsWith(string value) {}
public bool EndsWith(string value, StringComparison comparisonType) {}
public bool EndsWith(string value, bool ignoreCase, System.Globalization.CultureInfo culture) {}
public int IndexOf(char value) {}
public int IndexOf(char value, int startIndex) {}
public int IndexOfAny(char[] anyOf) {}
public int IndexOfAny(char[] anyOf, int startIndex) {}
public int IndexOf(string value) {}
public int IndexOf(string value, int startIndex) {}
public int IndexOf(string value, int startIndex, int count) {}
public int IndexOf(string value, StringComparison comparisonType) {}
public int IndexOf(string value, int startIndex, StringComparison comparisonType) {}
public int IndexOf(string value, int startIndex, int count, StringComparison comparisonType) {}
public int LastIndexOf(char value) {}
public int LastIndexOf(char value, int startIndex) {}
public int LastIndexOfAny(char[] anyOf) {}
public int LastIndexOfAny(char[] anyOf, int startIndex) {}
public int LastIndexOf(string value) {}
public int LastIndexOf(string value, int startIndex) {}
public int LastIndexOf(string value, int startIndex, int count) {}
public int LastIndexOf(string value, StringComparison comparisonType) {}
public int LastIndexOf(string value, int startIndex, StringComparison comparisonType) {}
public int LastIndexOf(string value, int startIndex, int count, StringComparison comparisonType) {}
public string PadLeft(int totalWidth) {}
public string PadLeft(int totalWidth, char paddingChar) {}
public string PadRight(int totalWidth) {}
public string PadRight(int totalWidth, char paddingChar) {}
public bool StartsWith(string value) {}
public bool StartsWith(string value, StringComparison comparisonType) {}
public bool StartsWith(string value, bool ignoreCase, System.Globalization.CultureInfo culture) {}
public string ToLower() {}
public string ToLower(System.Globalization.CultureInfo culture) {}
public string ToLowerInvariant() {}
public string ToUpper() {}
public string ToUpper(System.Globalization.CultureInfo culture) {}
public string ToUpperInvariant() {}
public virtual string ToString() {}
public virtual string ToString(IFormatProvider provider) {}
public virtual object Clone() {}
public string Trim() {}
public string Remove(int startIndex) {}
public static string Format(string format, object arg0) {}
public static string Format(string format, object arg0, object arg1) {}
public static string Format(string format, object arg0, object arg1, object arg2) {}
public static string Format(string format, object[] args) {}
public static string Format(IFormatProvider provider, string format, object[] args) {}
public static string Copy(string str) {}
public static string Concat(object arg0) {}
public static string Concat(object arg0, object arg1) {}
public static string Concat(object arg0, object arg1, object arg2) {}
public static string Concat(object arg0, object arg1, object arg2, object arg3) {}
public static string Concat(object[] args) {}
public static string Concat(string str0, string str1) {}
public static string Concat(string str0, string str1, string str2) {}
public static string Concat(string str0, string str1, string str2, string str3) {}
public static string Concat(string[] values) {}
public static string Intern(string str) {}
public static string IsInterned(string str) {}
public virtual TypeCode GetTypeCode() {}
public CharEnumerator GetEnumerator() {}
public Type GetType() {}
// Fields
public string Empty;
// Properties
public char Chars { get{} }
public int Length { get{} }
}
| Pengfei-Gao/source-Insight-3-for-centos7 | SourceInsight3/NetFramework/String.cs | C# | gpl-2.0 | 7,465 |
/**
*
*/
Ext.define('hwork.view.HWGrid', {
extend: 'Ext.grid.Panel',
alias: 'widget.hwGrid',
frame: true,
autoWidth: true,
autoHeight: true,
//title: 'FileList',
store: 'HWStore',
//selType: 'checkboxmodel',
columns: [
{header: '序号', xtype: 'rownumberer', width: 40, sortable: false, locked: true },
{header: 'ID', dataIndex: 'baseId', flex: 1, align: 'center', hidden: true},
{header: '学年', dataIndex: 'academicYear', flex: 1, align: 'center'},
{header: '学期', dataIndex: 'semester', flex: 1, align: 'center'},
{header: '课程名称', dataIndex: 'courseName', flex: 2, align: 'center'},
{header: '班级名称', dataIndex: 'className', flex: 1, align: 'center'},
{header: '作业名称', dataIndex: 'name', flex: 2, align: 'center'},
{header: '学生名称', dataIndex: 'studentName', flex: 1, align: 'center'},
{header: '学生编号', dataIndex: 'studentId', flex: 1, align: 'center', hidden: true},
{
header: '作业状态',
dataIndex: 'status',
flex: 1,
align: 'center',
renderer: function(val) {
switch(val) {
case 0:
return '<span style="color:red;">未提交</span>';
break;
case 1:
return '<span style="color:green;">待审核 </span>';
break;
case 2:
return '<span style="color:blue;">已审核</span>';
break;
case 3:
return '<span style="color:red;">未通过</span>';
break;
}
}
},{
xtype: 'actioncolumn',
id: 'ctrlCell',
flex: 1,
header: '作业状态',
align: 'center',
sortable: false,
menuDisabled: true,
items: [{
xtype: 'button',
id: 'startCtrl',
iconCls: 'icon-upload',
tooltip: '上传作业附件',
action: 'start',
hidden: true,
scope: this
},'-',{
xtype: 'button',
id: 'startCtrl',
iconCls: 'icon-download',
tooltip: '预览作业附件',
action: 'start',
scope: this
}]
},
/*{
header: '作业状态',
dataIndex: 'status',
flex: 1,
align: 'center',
renderer : function(val) {
if (val > 0) {
return '<span style="color:green;">' + val + '</span>';
} else if (val < 0) {
return '<span style="color:red;">' + val + '</span>';
}
return val;
}
},*/
{header: '专业名称', dataIndex: 'majorName', flex: 1, align: 'center', hidden: true},
{header: '专业编号', dataIndex: 'majorCode', flex: 1, align: 'center', hidden: true},
{header: '教师姓名', dataIndex: 'teacherName', flex: 1, align: 'center', hidden: true},
{header: '教师编号', dataIndex: 'teacherCode', flex: 1, align: 'center', hidden: true},
{header: '课程编号', dataIndex: 'courseCode', flex: 1, align: 'center', hidden: true},
{header: '操作时间', dataIndex: 'operationTime', flex: 1, align: 'center', hidden: true},
{header: '创建时间', dataIndex: 'createTime', flex: 1, align: 'center', hidden: true},
{header: '最近修改时间', dataIndex: 'modifyTime', flex: 1, align: 'center', hidden: true}
],
initComponent: function() {
this.dockedItems = [{
xtype: 'pagingtoolbar',
dock:'bottom',
store: 'HWStore',
displayInfo: true,
displayMsg: 'Displaying contacts {0} - {1} of {2}',
emptyMsg: "No contacts to display"
}];
this.callParent(arguments);
}
}); | lhfei/forestry-university-app | src/main/webapp/resources/modules/admin/hwork/app/view/HWGrid.js | JavaScript | gpl-2.0 | 4,019 |
from crispy_forms.helper import FormHelper
from crispy_forms.layout import *
from crispy_forms.bootstrap import *
from crispy_forms.layout import Layout, Submit, Reset, Div
from django import forms
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
from silo.models import TolaUser
from django.contrib.auth.models import User
class RegistrationForm(UserChangeForm):
"""
Form for registering a new account.
"""
def __init__(self, *args, **kwargs):
user = kwargs.pop('initial')
super(RegistrationForm, self).__init__(*args, **kwargs)
del self.fields['password']
print user['username'].is_superuser
# allow country access change for now until we know how we will use this GWL 012617
# if they aren't a super user or User Admin don't let them change countries form field
# if 'User Admin' not in user['username'].groups.values_list('name', flat=True) and not user['username'].is_superuser:
# self.fields['country'].widget.attrs['disabled'] = "disabled"
self.fields['created'].widget.attrs['disabled'] = "disabled"
class Meta:
model = TolaUser
fields = '__all__'
helper = FormHelper()
helper.form_method = 'post'
helper.form_class = 'form-horizontal'
helper.label_class = 'col-sm-2'
helper.field_class = 'col-sm-6'
helper.form_error_title = 'Form Errors'
helper.error_text_inline = True
helper.help_text_inline = True
helper.html5_required = True
helper.layout = Layout(Fieldset('','title', 'name',
'country'),
Submit('submit', 'Submit', css_class='btn-default'),
Reset('reset', 'Reset', css_class='btn-warning'))
class NewUserRegistrationForm(UserCreationForm):
"""
Form for registering a new account.
"""
class Meta:
model = User
fields = ['first_name', 'last_name','email','username']
def __init__(self, *args, **kwargs):
super(NewUserRegistrationForm, self).__init__(*args, **kwargs)
helper = FormHelper()
helper.form_method = 'post'
helper.form_class = 'form-horizontal'
helper.label_class = 'col-sm-2'
helper.field_class = 'col-sm-6'
helper.form_error_title = 'Form Errors'
helper.error_text_inline = True
helper.help_text_inline = True
helper.html5_required = True
helper.form_tag = False
class NewTolaUserRegistrationForm(forms.ModelForm):
"""
Form for registering a new account.
"""
class Meta:
model = TolaUser
fields = ['title', 'country', 'privacy_disclaimer_accepted']
def __init__(self, *args, **kwargs):
super(NewTolaUserRegistrationForm, self).__init__(*args, **kwargs)
helper = FormHelper()
helper.form_method = 'post'
helper.form_class = 'form-horizontal'
helper.label_class = 'col-sm-2'
helper.field_class = 'col-sm-6'
helper.form_error_title = 'Form Errors'
helper.error_text_inline = True
helper.help_text_inline = True
helper.html5_required = True
helper.form_tag = False
helper.layout = Layout(
Fieldset('Information','title', 'country'),
Fieldset('Privacy Statement','privacy_disclaimer_accepted',),
)
| mercycorps/TolaTables | tola/forms.py | Python | gpl-2.0 | 3,291 |
<?
$items = new items();
if($_POST[edit_item]){
//print_r($_POST);
$error = $items->edit($_POST[id]);
if(is_array($error)){
echo '<h2>Errors Encountered</h2>';
while(list($key, $val) = each($error)){
echo $val;
echo "<br>\n";
}
} else {
echo '<h3>Your Item has been updated!</h3>';
echo '<h3>Return to your <a href="?p=desktop">desktop</a> or wait 3 seconds</h3>';
echo '<meta http-equiv="refresh" content="3;url=http://www.okinawaswap.com/?p=desktop" />';
}
} else {
$id = $_GET[id];
$item = $items->get_details($id);
//print_r($item);
?>
<form id="edit_item" name="edit_item" enctype="multipart/form-data" method="POST" action="?p=edit_item">
<h2>Edit your Item</h2>
<table>
<input type="hidden" name="id" value="<?= $item[id] ?>" />
<tr><th>Item Name</th><td><input type="text" name="name" value="<?= $item[name]?>" /> (50 Character Limit)</td></tr>
<tr><th>Category</th><td><?= $listings->category_dropdown($item[category]) ?></td></tr>
<tr><th>Item Description</th><td><input type="text" maxlength="90" name="description" value="<?= $item[description]?>"/> (90 Character Limit)</td></tr>
<tr><th>Condition</th><td><select name="condition" id="condition">
<option value="new" <? if($item[condition] == 'new') echo 'selected' ?>>New</option>
<option value="almost new" <? if($item[condition] == 'almost new') echo 'selected' ?>>Almost New</option>
<option value="used" <? if($item[condition] == 'used') echo 'selected' ?>>Used</option>
<option value="worn" <? if($item[condition] == 'worn') echo 'selected' ?>>Worn</option>
<option value="well worn" <? if($item[condition] == 'well worn') echo 'selected' ?>>Well Worn</option>
<option value="falling apart" <? if($item[condition] == 'falling apart') echo 'selected' ?>>Falling Apart</option>
<option value="broken" <? if($item[condition] == 'broken') echo 'selected' ?>>Broken</option>
</select></td></tr>
<tr><th>Post Type</th><td><select name="post_type" id="post_type">
<option value="swap" <? if($item[post_type] == 'swap') echo 'selected' ?>>Swap</option>
<option value="sell" <? if($item[post_type] == 'sell') echo 'selected' ?>>Sale</option>
<option value="swap or sell" <? if($item[post_type] == 'swap or sell') echo 'selected' ?>>Swap or Sell</option>
<option value="free" <? if($item[post_type] == 'free') echo 'selected' ?>>Free</option>
</select></td></tr>
<tr><th>Price</th><td>$<input type="text" name="value" id="value" value="<?= $item[value] ?>" /> (Value in Dollars. No $ sign)</td></tr>
</table>
<table>
<tr><th>Additional Notes</th><td width="600px">
<?php
$oFCKeditor = new FCKeditor('notes') ;
$oFCKeditor->BasePath = 'fckeditor/' ;
$oFCKeditor->Value = $item[notes] ;
$oFCKeditor->ToolbarSet = 'Basic';
$oFCKeditor->Create() ;
?>
</td></tr>
</table>
<input type="submit" value="Update Item" name="edit_item" />
</form>
<? } ?> | pikoro/phpswapmeet | templates/default/edit_item.php | PHP | gpl-2.0 | 2,950 |
import Markdown from 'markdown-it'
import { wikiLinkInit } from './index'
describe('wikiLink', () => {
let md: Markdown = undefined
beforeEach(() => (md = new Markdown({}).use(wikiLinkInit())))
afterEach(() => (md = undefined))
it('should gerenare wiki link tag', () => {
const actual = md?.render('~[link-name](12345abcdef)').trim()
const expected =
'<p><a href="#12345abcdef" class="wiki-link" title="link-name">link-name</a></p>'
expect(actual).toEqual(expected)
})
})
| zsebtanar/zsebtanar-proto | src/shared/markdown/wiki-link/wikiLink.spec.ts | TypeScript | gpl-2.0 | 504 |
<?php
/** Extension:NewUserMessage
*
* @package MediaWiki
* @subpackage Extensions
*
* @author [http://www.organicdesign.co.nz/nad User:Nad]
* @license GNU General Public Licence 2.0 or later
* @copyright 2007-10-15 [http://www.organicdesign.co.nz/nad User:Nad]
* @copyright 2009 Siebrand Mazeland
*/
if ( !defined( 'MEDIAWIKI' ) )
die( 'Not an entry point.' );
class NewUserMessage {
/*
* Add the template message if the users talk page does not already exist
*/
static function createNewUserMessage( $user ) {
//op-patch:create user page instead of user-talk page
$talk = $user->getUserPage();
if ( !$talk->exists() ) {
global $wgUser, $wgLqtTalkPages;
$name = $user->getName();
$realName = $user->getRealName();
wfLoadExtensionMessages( 'NewUserMessage' );
$article = new Article( $talk );
$editSummary = wfMsgForContent( 'newuseredit-summary' );
// Create a user object for the editing user and add it to the
// database if it is not there already
$editor = User::newFromName( wfMsgForContent( 'newusermessage-editor' ) );
if ( !$editor->isLoggedIn() ) {
$editor->addToDatabase();
}
$signatures = wfMsgForContent( 'newusermessage-signatures' );
$signature = null;
if ( !wfEmptyMsg( 'newusermessage-signatures', $signatures ) ) {
$pattern = '/^\* ?(.*?)$/m';
preg_match_all( $pattern, $signatures, $signatureList, PREG_SET_ORDER );
if ( count( $signatureList ) > 0 ) {
$rand = rand( 0, count( $signatureList ) - 1 );
$signature = $signatureList[$rand][1];
}
}
// Add (any) content to [[MediaWiki:Newusermessage-substitute]] to substitute the welcome template.
$substitute = wfMsgForContent( 'newusermessage-substitute' );
if ( $wgLqtTalkPages && LqtDispatch::isLqtPage( $talk ) ) { // Create a thread on the talk page if LiquidThreads is installed
// Get subject text
$threadSubject = self::getTextForPageInKey( 'newusermessage-template-subject' );
// Do not continue if there is no valid subject title
if ( !$threadSubject ) {
wfDebug( __METHOD__ . ": no text found for the subject\n" );
return true;
}
/** Create the final subject text.
* Always substituted and processed by parser to avoid awkward subjects
* Use real name if new user provided it
*/
$parser = new Parser;
$parser->setOutputType( 'wiki' );
$parserOptions = new ParserOptions;
if ( $realName ) {
$threadSubject = $parser->preSaveTransform(
"{{subst:{$threadSubject}|$realName}}",
$talk /* as dummy */,
$editor, $parserOptions
);
} else {
$threadSubject = $parser->preSaveTransform(
"{{subst:{$threadSubject}|$name}}",
$talk /* as dummy */,
$editor,
$parserOptions
);
}
// Get the body text
$threadBody = self::getTextForPageInKey( 'newusermessage-template-body' );
// Do not continue if there is no body text
if ( !$threadBody ) {
wfDebug( __METHOD__ . ": no text found for the body\n" );
return true;
}
// Create the final body text after checking if the template is to be substituted.
if ( $substitute ) {
$threadBody = "{{subst:{$threadBody}|$name|$realName}}";
} else {
$threadBody = "{{{$threadBody}|$name|$realName}}";
}
$threadTitle = Threads::newThreadTitle( $threadSubject, $article );
if ( !$threadTitle ) {
wfDebug( __METHOD__ . ": invalid title $threadTitle\n" );
return true;
}
$threadArticle = new Article( $threadTitle );
self::writeWelcomeMessage( $user, $threadArticle, $threadBody, $editSummary, $editor );
// Need to edit as another user. Lqt does not provide an interface to alternative users,
// so replacing $wgUser here.
$parkedUser = $wgUser;
$wgUser = $editor;
LqtView::newPostMetadataUpdates(
array(
'talkpage' => $article,
'text' => $threadBody,
'summary' => $editSummary,
'root' => $threadArticle,
'subject' => $threadSubject,
'signature' => $signature,
)
);
// Set $wgUser back to the newly created user
$wgUser = $parkedUser;
} else { // Processing without LiquidThreads
$templateTitleText = wfMsg( 'newusermessage-template' );
$templateTitle = Title::newFromText( $templateTitleText );
if ( !$templateTitle ) {
wfDebug( __METHOD__ . ": invalid title in newusermessage-template\n" );
return true;
}
if ( $templateTitle->getNamespace() == NS_TEMPLATE ) {
$templateTitleText = $templateTitle->getText();
}
if ( $substitute ) {
$text = "{{subst:{$templateTitleText}|$name|$realName}}";
} else {
$text = "{{{$templateTitleText}|$name|$realName}}";
}
if ( $signature ) {
$text .= "\n-- {$signature} ~~~~~";
}
self::writeWelcomeMessage( $user, $article, $text, $editSummary, $editor );
}
}
return true;
}
static function createNewUserMessageAutoCreated( $user ) {
global $wgNewUserMessageOnAutoCreate;
if ( $wgNewUserMessageOnAutoCreate ) {
NewUserMessage::createNewUserMessage( $user );
}
return true;
}
static function onUserGetReservedNames( &$names ) {
wfLoadExtensionMessages( 'NewUserMessage' );
$names[] = 'msg:newusermessage-editor';
return true;
}
/**
* Create a page with text
* @param $user User object: user that was just created
* @param $article Article object: the article where $text is to be put
* @param $text String: text to put in $article
* @param $summary String: edit summary text
* @param $editor User object: user that will make the edit
*/
private static function writeWelcomeMessage( $user, $article, $text, $summary, $editor ) {
global $wgNewUserMinorEdit, $wgNewUserSuppressRC;
wfLoadExtensionMessages( 'NewUserMessage' );
$flags = EDIT_NEW;
if ( $wgNewUserMinorEdit ) $flags = $flags | EDIT_MINOR;
if ( $wgNewUserSuppressRC ) $flags = $flags | EDIT_SUPPRESS_RC;
$dbw = wfGetDB( DB_MASTER );
$dbw->begin();
$good = true;
try {
$article->doEdit( $text, $summary, $flags, false, $editor );
} catch ( DBQueryError $e ) {
$good = false;
}
if ( $good ) {
// Set newtalk with the right user ID
//op-patch:create user page instead of user-talk page
//$user->setNewtalk( true );
$dbw->commit();
} else {
// The article was concurrently created
wfDebug( __METHOD__ . ": the article has already been created despite !\$talk->exists()\n" );
$dbw->rollback();
}
}
/**
* Returns the text contents of a template page set in given key contents
* Returns empty string if no text could be retrieved.
* @param $key String: message key that should contain a template page name
*/
private static function getTextForPageInKey( $key ) {
$templateTitleText = wfMsgForContent( $key );
$templateTitle = Title::newFromText( $templateTitleText );
// Do not continue if there is no valid subject title
if ( !$templateTitle ) {
wfDebug( __METHOD__ . ": invalid title in " . $key . "\n" );
return '';
}
// Get the subject text from the page
if ( $templateTitle->getNamespace() == NS_TEMPLATE ) {
return $templateTitle->getText();
} else {
// There is no subject text
wfDebug( __METHOD__ . ": " . $templateTitleText . " must be in NS_TEMPLATE\n" );
return '';
}
}
}
| ontoprise/HaloSMWExtension | extensions/NewUserMessage/NewUserMessage.class.php | PHP | gpl-2.0 | 7,348 |
#ifndef __SUBJECT_H__
#define __SUBJECT_H__
#include "Observer.h"
namespace weather
{
class Subject
{
public:
virtual void registerObserver(Observer *ob) = 0;
virtual void removeObserver(Observer *ob) = 0;
virtual void notifyObservers() = 0;
};
}
#endif
| clpsz/Book-HFDP-Code | cp02/WeatherData/Subject.h | C | gpl-2.0 | 279 |
<html><head><title>Unused Objects [X]</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body bgcolor="#ffffff" TEXT="#000000"><h2>Unused Objects</h2><hr><pre>
</pre><table BORDER CELLPADDING=4><tr><td>Non-Alpha</td><td>A</td><td><a href="unusedobj_B.html">B</a></td><td><a href="unusedobj_C.html">C</a></td><td><a href="unusedobj_D.html">D</a></td><td>E</td><td>F</td><td>G</td><td>H</td><td><a href="unusedobj_I.html">I</a></td><td>J</td><td>K</td><td>L</td><td><a href="unusedobj_M.html">M</a></td><td>N</td><td>O</td><td><a href="unusedobj_P.html">P</a></td><td>Q</td><td>R</td><td><a href="unusedobj_S.html">S</a></td><td>T</td><td><a href="unusedobj_U.html">U</a></td><td>V</td><td>W</td><td><a href="unusedobj_X.html">X</a></td><td>Y</td><td>Z</td></tr></table><pre>
<a href="5023.html"><b>xbl.f</b></a>
<a href="dictionary_I.html#5100">ITBL</a> <b>597</b>
<a href="1778.html"><b>XBL.INC</b></a>
<a href="dictionary_V.html#1957">V_VAR.DWTE</a> <b>57</b>
<a href="dictionary_V.html#1968">V_VAR.GAMBL</a> <b>63</b>
<a href="dictionary_V.html#1798">V_VAR1.R1</a> <b>20</b>
<a href="dictionary_V.html#1800">V_VAR1.R1_MS</a> <b>20</b>
<a href="dictionary_V.html#1799">V_VAR1.R1_U1</a> <b>20</b>
<a href="dictionary_V.html#1844">V_VAR1.US1_RE</a> <b>28</b>
<a href="dictionary_V.html#1801">V_VAR1.V1</a> <b>21</b>
<a href="dictionary_V.html#1803">V_VAR1.V1_MS</a> <b>21</b>
<a href="dictionary_V.html#1804">V_VAR1.V1_RE</a> <b>21</b>
<a href="dictionary_V.html#1802">V_VAR1.V1_U1</a> <b>21</b>
<a href="4090.html"><b>xblsys.f</b></a>
<a href="dictionary_I.html#4619">ITAM</a> <b>277</b>
<a href="dictionary_S.html#4210">SCC_US1</a> <b>1759</b>
<a href="dictionary_S.html#4211">SCC_US2</a> <b>1760</b>
<a href="dictionary_Z.html#4677">Z_XF</a> <b>561</b>
<a href="1318.html"><b>XDES.INC</b></a>
<a href="dictionary_Y.html#1481">YMODP</a> <b>7</b>
<a href="2667.html"><b>xfoil.f</b></a>
<a href="dictionary_A.html#2757">ALDEL</a> <b>891</b>
<a href="dictionary_A.html#2758">ALMAX</a> <b>890</b>
<a href="dictionary_A.html#2759">ALMIN</a> <b>889</b>
<a href="dictionary_C.html#2761">CDDEL</a> <b>887</b>
<a href="dictionary_C.html#2762">CDMAX</a> <b>886</b>
<a href="dictionary_C.html#2763">CDMIN</a> <b>885</b>
<a href="dictionary_C.html#2764">CLDEL</a> <b>883</b>
<a href="dictionary_C.html#2765">CLMAX</a> <b>882</b>
<a href="dictionary_C.html#2766">CLMIN</a> <b>881</b>
<a href="dictionary_C.html#2767">CMDEL</a> <b>895</b>
<a href="dictionary_C.html#2768">CMMAX</a> <b>894</b>
<a href="dictionary_C.html#2769">CMMIN</a> <b>893</b>
<a href="dictionary_I.html#2910">ITER</a> <b>1864</b>
<a href="dictionary_P.html#2982">PROMPT</a> <b>27</b>
<a href="196.html"><b>XFOIL.INC</b></a>
<a href="dictionary_C.html#364">CI03.NLREF</a> <b>92</b>
<a href="dictionary_C.html#414">CI04.KIMAGE</a> <b>114</b>
<a href="dictionary_C.html#468">CL01.LQINU</a> <b>35</b>
<a href="dictionary_C.html#285">CR06.GAMTE_A</a> <b>73</b>
<a href="dictionary_C.html#287">CR06.SIGTE_A</a> <b>74</b>
<a href="dictionary_C.html#341">CR09.CIRC</a> <b>88</b>
<a href="dictionary_C.html#583">CR15.GUXD</a> <b>153</b>
<a href="dictionary_C.html#582">CR15.GUXQ</a> <b>153</b>
<a href="dictionary_C.html#581">CR15.USLP</a> <b>153</b>
<a href="dictionary_C.html#628">CR18.XCMAX</a> <b>167</b>
<a href="dictionary_C.html#627">CR18.XCMIN</a> <b>167</b>
<a href="921.html"><b>xgdes.f</b></a>
<a href="dictionary_L.html#1255">LMASK1</a> <b>1877</b>
<a href="dictionary_L.html#1289">LMASK1</a> <b>1962</b>
<a href="dictionary_L.html#1257">LMASK3</a> <b>1877</b>
<a href="dictionary_L.html#1291">LMASK3</a> <b>1962</b>
<a href="dictionary_L.html#1094">LRECALC</a> <b>24</b>
<a href="dictionary_X.html#1180">XSPACE</a> <b>2052</b>
<a href="1990.html"><b>xgeom.f</b></a>
<a href="dictionary_C.html#2433">CWT</a> <b>983</b>
<a href="dictionary_I.html#2047">IM</a> <b>1617</b>
<a href="dictionary_I.html#2495">IM1</a> <b>1714</b>
<a href="dictionary_I.html#2048">IP</a> <b>1618</b>
<a href="dictionary_I.html#2496">IP1</a> <b>1715</b>
<a href="dictionary_I.html#2497">IP2</a> <b>1716</b>
<a href="dictionary_I.html#2334">ITER</a> <b>60</b>
<a href="dictionary_I.html#2511">ITER</a> <b>269</b>
<a href="dictionary_I.html#2546">ITER</a> <b>782</b>
<a href="dictionary_I.html#2623">ITER</a> <b>123</b>
<a href="dictionary_L.html#2439">LMASK0</a> <b>933</b>
<a href="dictionary_L.html#2440">LMASK1</a> <b>933</b>
<a href="dictionary_L.html#2442">LMASK3</a> <b>933</b>
<a href="dictionary_S.html#2654">SREF</a> <b>592</b>
<a href="dictionary_X.html#2599">XBAR</a> <b>556</b>
<a href="dictionary_X.html#2185">XCAM</a> <b>332</b>
<a href="dictionary_X.html#2238">XINT</a> <b>1531</b>
<a href="dictionary_X.html#2193">XTHK</a> <b>333</b>
<a href="dictionary_X.html#2473">XWT</a> <b>991</b>
<a href="dictionary_Y.html#2195">YCAM</a> <b>332</b>
<a href="dictionary_Y.html#2196">YCAMP</a> <b>332</b>
<a href="dictionary_Y.html#2251">YINT</a> <b>1532</b>
<a href="dictionary_Y.html#2478">YLE</a> <b>943</b>
<a href="dictionary_Y.html#2484">YTE</a> <b>941</b>
<a href="dictionary_Y.html#2202">YTHK</a> <b>333</b>
<a href="dictionary_Y.html#2203">YTHKP</a> <b>333</b>
<a href="6011.html"><b>xmdes.f</b></a>
<a href="dictionary_D.html#6356">DZDW1</a> <b>1383</b>
<a href="dictionary_D.html#6357">DZDW2</a> <b>1383</b>
<a href="dictionary_I.html#6274">IPASS</a> <b>1447</b>
<a href="dictionary_I.html#6174">IQMOD1</a> <b>383</b>
<a href="dictionary_I.html#6175">IQMOD2</a> <b>384</b>
<a href="dictionary_I.html#6383">ITCLE</a> <b>1966</b>
<a href="dictionary_I.html#6327">ITGAP</a> <b>1073</b>
<a href="dictionary_L.html#6185">LRECALC</a> <b>27</b>
<a href="4812.html"><b>xoper.f</b></a>
<a href="dictionary_I.html#5002">IRLX</a> <b>2473</b>
<a href="dictionary_I.html#5009">ITAL</a> <b>2543</b>
<a href="dictionary_I.html#5003">ITCL</a> <b>2464</b>
<a href="dictionary_L.html#4952">LCPX</a> <b>25</b>
<a href="1486.html"><b>xpanel.f</b></a>
<a href="dictionary_P.html#1515">PSIINF</a> <b>1004</b>
<a href="5259.html"><b>xplots.f</b></a>
<a href="dictionary_L.html#5325">LMASK1</a> <b>540</b>
<a href="dictionary_L.html#5481">LMASK1</a> <b>1207</b>
<a href="dictionary_L.html#5544">LMASK1</a> <b>615</b>
<a href="dictionary_L.html#5327">LMASK3</a> <b>540</b>
<a href="dictionary_L.html#5483">LMASK3</a> <b>1207</b>
<a href="dictionary_L.html#5546">LMASK3</a> <b>615</b>
<a href="dictionary_S.html#5304">SCH</a> <b>949</b>
<a href="dictionary_X.html#5419">XL0</a> <b>1063</b>
<a href="3121.html"><b>xpol.f</b></a>
<a href="dictionary_D.html#3129">DUMMY</a> <b>926</b>
<a href="dictionary_D.html#3131">DUMMY</a> <b>937</b>
<a href="dictionary_D.html#3208">DUMMY</a> <b>431</b>
<a href="dictionary_I.html#3210">IIBX</a> <b>426</b>
<a href="dictionary_I.html#3211">IIX</a> <b>426</b>
<a href="dictionary_I.html#3212">ILEX</a> <b>426</b>
<a href="dictionary_I.html#3214">ITEX</a> <b>426</b>
<a href="dictionary_L.html#3155">LINE</a> <b>186</b>
<a href="dictionary_L.html#3156">LINEL</a> <b>186</b>
<a href="dictionary_R.html#3164">RINP</a> <b>192</b>
<a href="6697.html"><b>xqdes.f</b></a>
<a href="dictionary_I.html#6742">ITER</a> <b>1285</b>
<a href="dictionary_L.html#6809">LAIR</a> <b>563</b>
<a href="dictionary_L.html#6811">LMASK1</a> <b>568</b>
<a href="dictionary_L.html#6813">LMASK3</a> <b>568</b>
<a href="dictionary_L.html#6780">LRECALC</a> <b>28</b>
<a href="dictionary_S.html#6723">SH</a> <b>944</b>
<a href="3532.html"><b>xtcam.f</b></a>
<a href="dictionary_C.html#3695">CHS</a> <b>762</b>
<a href="dictionary_I.html#3662">ITER</a> <b>1287</b>
<a href="dictionary_L.html#3570">LMASK0</a> <b>39</b>
<a href="dictionary_L.html#3698">LMASK0</a> <b>757</b>
<a href="dictionary_L.html#3571">LMASK1</a> <b>39</b>
<a href="dictionary_L.html#3699">LMASK1</a> <b>757</b>
<a href="dictionary_L.html#3573">LMASK3</a> <b>39</b>
<a href="dictionary_L.html#3701">LMASK3</a> <b>757</b>
<a href="dictionary_L.html#3574">LRECALC</a> <b>35</b>
<a href="dictionary_S.html#3683">SFN</a> <b>1056</b>
<a href="dictionary_X.html#3687">XBL</a> <b>1076</b>
<a href="dictionary_Y.html#3605">YBL</a> <b>88</b>
<a href="dictionary_Y.html#3608">YBR</a> <b>90</b>
<a href="6668.html"><b>xutils.f</b></a>
<a href="dictionary_I.html#6685">ITER</a> <b>41</b>
</pre><hr>
<table BORDER CELLPADDING=4><tr><td>Non-Alpha</td><td>A</td><td><a href="unusedobj_B.html">B</a></td><td><a href="unusedobj_C.html">C</a></td><td><a href="unusedobj_D.html">D</a></td><td>E</td><td>F</td><td>G</td><td>H</td><td><a href="unusedobj_I.html">I</a></td><td>J</td><td>K</td><td>L</td><td><a href="unusedobj_M.html">M</a></td><td>N</td><td>O</td><td><a href="unusedobj_P.html">P</a></td><td>Q</td><td>R</td><td><a href="unusedobj_S.html">S</a></td><td>T</td><td><a href="unusedobj_U.html">U</a></td><td>V</td><td>W</td><td><a href="unusedobj_X.html">X</a></td><td>Y</td><td>Z</td></tr></table></body></html> | GregVernon/MATFOIL | Understand/unusedobj_X.html | HTML | gpl-2.0 | 10,620 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.