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
|
|---|---|---|---|---|---|
using FluentCassandra.Apache.Cassandra;
using System;
using System.Collections.Generic;
namespace FluentCassandra.Connections
{
public interface IConnectionBuilder
{
string Keyspace { get; }
IList<Server> Servers { get; }
bool Pooling { get; }
int MinPoolSize { get; }
int MaxPoolSize { get; }
int MaxRetries { get; }
TimeSpan ServerPollingInterval { get; }
TimeSpan ConnectionTimeout { get; }
ConnectionType ConnectionType { get; }
TimeSpan ConnectionLifetime { get; }
int BufferSize { get; }
ConsistencyLevel ReadConsistency { get; }
ConsistencyLevel WriteConsistency { get; }
string CqlVersion { get; }
bool CompressCqlQueries { get; }
string Username { get; }
string Password { get; }
string Uuid { get; }
}
}
|
fluentcassandra/fluentcassandra
|
src/Connections/IConnectionBuilder.cs
|
C#
|
apache-2.0
| 762
|
rem @ECHO OFF
set COPYRIGHT="Copyright 2012 GWTAO"
set LICENSE="APACHE"
set ROOT=%~dp0..
set GEN="%~dp0\genheader.pl"
FOR /f %%a in ('dir /B /A:D %ROOT%\gwtao-*') do %GEN% -M %ROOT%\%%a\src -R -C %COPYRIGHT% -L %LICENSE%
set ROOT=
set GEN=
set COPYRIGHT=
set LICENSE=
pause
|
mhueb/gwtao
|
etc/genheader.cmd
|
Batchfile
|
apache-2.0
| 292
|
package com.topie.security.perm;
public class PermissionMatcher {
private boolean readOnly;
public boolean match(String want, String have) {
Permission wantPermission = new Permission(want);
Permission havePermission = new Permission(have);
// if this.resource is *, it will match all of required resource
// else this.resource must equal to required resource
if (!checkPart(wantPermission.getResource(),
havePermission.getResource())) {
return false;
}
// if this.operation is *, it will match all of required operation
// else this.operation must equal to required operation
String haveOperation = readOnly ? "read" : havePermission
.getOperation();
if (checkPart(wantPermission.getOperation(), haveOperation)) {
return true;
}
return false;
}
private boolean checkPart(String want, String have) {
if ("*".equals(want) || "*".equals(have)) {
return true;
}
return want.equals(have);
}
public void setReadOnly(boolean readOnly) {
this.readOnly = readOnly;
}
public boolean isReadOnly() {
return readOnly;
}
}
|
topie/topie-oa
|
src/main/java/com/topie/security/perm/PermissionMatcher.java
|
Java
|
apache-2.0
| 1,260
|
/*
* ********************************************************************
* Copyright (C) 2017 e-Spirit AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ********************************************************************
*/
package com.espirit.moddev.fstesttools.rules.firstspirit.utils.context;
import de.espirit.firstspirit.access.BaseContext;
import de.espirit.firstspirit.agency.SpecialistType;
import de.espirit.firstspirit.agency.SpecialistsBroker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Objects;
/**
* The type TestContext simulates a BaseContext for test environments.
*
* @author e-Spirit AG
*/
public class TestContext implements BaseContext {
private static final Logger LOGGER = LoggerFactory.getLogger(TestContext.class);
protected final SpecialistsBroker broker;
/**
* Instantiates a new Test context.
*
* @param broker the broker
*/
public TestContext(SpecialistsBroker broker) {
this.broker = Objects.requireNonNull(broker, "SpecialistsBroker can not be null!");
}
@Override
public void logDebug(String s) {
LOGGER.debug(s);
}
@Override
public void logInfo(String s) {
LOGGER.info(s);
}
@Override
public void logWarning(String s) {
LOGGER.warn(s);
}
@Override
public void logError(String s) {
LOGGER.error(s);
}
@Override
public void logError(String s, Throwable throwable) {
LOGGER.error(s, throwable);
}
@Override
public boolean is(Env env) {
switch (env) {
case PREVIEW:
case HEADLESS:
return true;
case WEBEDIT:
case DROP:
case FS_BUTTON:
default:
return false;
}
}
@Override
public <S> S requestSpecialist(SpecialistType<S> type) {
return broker.requestSpecialist(type);
}
@Override
public <S> S requireSpecialist(SpecialistType<S> type) {
return broker.requireSpecialist(type);
}
}
|
e-Spirit/FSTestTools
|
rules/src/main/java/com/espirit/moddev/fstesttools/rules/firstspirit/utils/context/TestContext.java
|
Java
|
apache-2.0
| 2,600
|
//= template/head.html
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
//= template/head-end.html
<body class="with-side-menu theme-picton-blue">
//= template/header-logo-inverse.html
//= template/side-menu.html
//= template/dashboard.html
//= template/footer.html
//= template/foot.html
|
samarti/ConstruyamosClase
|
app/views/layouts/theme-picton-blue.html
|
HTML
|
apache-2.0
| 341
|
//新人有礼页
// 初始化
var common = require('../common/common.js');
$(document).on('pageInit','.gift_for_new', function(e, id, page) {
if (page.selector == '.page') {
return false;
}
document.title = '新人有礼';
var init = new common(page);
var lazyload = init.lazyLoad;
var ApiBaseUrl = init.getApiBaseUrl();
var PHPSESSID = init.getCookie('PHPSESSID');
var ajaxHeaders = {
'phpsessionid': PHPSESSID
};
// 调用微信分享sdk
var share_data = {
title: '公路商店 — 新人礼遇',
desc: '为你不着边际的企图心',
link: window.location.href,
img: 'https://jscache.ontheroadstore.com/tpl/simplebootx_mobile/Public/i/logo.png'
};
init.wx_share(share_data);
//判断是否是app,如果是app,领取中心url 卖家中心url 商品标签url都需要做处理,ajax headers携带身份不一样
var isApp = false;
var $isApp = $('.is_app');
var Authorization = $isApp.attr('authorization');
var uid = $isApp.attr('uid');
// var version = $isApp.attr('version');
var loginStatus = true;
if(Authorization && Authorization.length>0){
isApp = true;
ajaxHeaders = {
'Authorization' : Authorization,
// 'version' : version,//跨域不能加version
};
$('.get_coupon').attr('href','get-coupon://0');
}else{
//如果不是app,通过uid判断是否登录,如果未登录,点击领取和关注按钮需要跳转到登录页3
loginStatus = init.ifLogin();
}
//返回卖家中心url
function sellerUrl(uid){
if(isApp){
return 'user-info://'+uid;
}else{
return '/User/index/index/id/'+ uid +'.html';
}
}
//返回商品标签url
function tagUrl(id){
if(isApp){
return 'product-tag://'+id;
}else{
return '/HsCategories/tag_index/tag/'+ id +'.html';
}
}
getCoupon();
//获取所有信息
function getCoupon(){
var url = ApiBaseUrl + '/appv6/coupon/newUserCouponList';
$.ajax({
type: "GET",
url: url,
dataType: 'json',
data: {},
headers: ajaxHeaders,
success: function(data){
if(data.status==1){
initNewrCoupon(data.data.coupon);
initRecommendGoods(data.data.recommendpost);
initSeller(data.data.seller);
initTopCate(data.data.cate,data.data.postlist);
lazyload();
}
},
error: function(e){
console.log('getCoupon err: ',e);
}
});
}
//新人优惠券展示及领取
function initNewrCoupon(coupon){
var $getNewrCouponBtn = $('.gift_card_btn');
$getNewrCouponBtn.attr('status',coupon.userStatus);
$('.gift_card_price span').html(coupon.couponprice);
$getNewrCouponBtn.on('click',function(){
if(!loginStatus){
init.toLogin();
return false;
}
if($(this).attr('status')=='1'){
return;
}
getNewrCoupon($getNewrCouponBtn);
});
}
//领取新人优惠券
function getNewrCoupon($btn){
var url = ApiBaseUrl + '/appv6/coupon/receiveNewUserCoupon';
$.ajax({
type: "GET",
url: url,
dataType: 'json',
data: {},
headers: ajaxHeaders,
success: function(data){
if(data.status==1){
$.toast('领取成功,请在App下单使用');
$btn.attr('status','1');
}else{
$.toast(data.info || '领取失败');
}
},
error: function(e){
console.log('getNewrCoupon err: ',e);
}
});
}
//推荐狠人
function initSeller(seller){
var html = '';
for(var i=0;i<seller.length;i++){
var sell = seller[i];
html += '<div class="item">'
html += '<a href="'+ sellerUrl(sell.uid) +'" external>'
html += '<div class="image user_bg" data-layzr="'+ sell.ad_img +'@640w_1l" ></div>'
html += '<img class="cover_img" src="'+ sell.avatar +'">'
html += '<div class="user_nicename">'+ sell.user_nicename +'</div>'
html += '<div class="user_desc">'+ sell.desc +'</div>'
html += '</a>'
html += '<div class="user_keyword">'
var tagLength = 0;
for (var j=0;j<sell.tag.length;j++){
var tag = sell.tag[j];
tagLength+= tag.length;
if(tagLength>10){
if(j===0){
tag = tag.slice(0,8) + '...';//18010417313
}else{
break;
}
}
html += '<a>'+ tag +'</a>'
}
html += '</div>'
html += '<div class="attention">'
html += '<span class="attentionUser" data-uid="'+ sell.uid +'" data-isatten="'+ sell.is_favorited +'" isatten="'+ sell.is_favorited +'"></span>'
html += '</div>'
html += '</div>'
}
$('.user_list').html(html);
addAttionEv();
}
//关注按钮事件
function addAttionEv() {
$('.attentionUser').click(function(){
if(!loginStatus){
init.toLogin();
return false;
}
var that = this;
if($(this).attr('loading')==='1'){
return;
}else{
$(this).attr('loading','1');
}
var isAtten = $(this).data('isatten');
if(isAtten == 0){
$.ajax({
type: 'POST',
url: ApiBaseUrl + '/appv1/follow',
data: {
to_user_id:$(that).data('uid')
},
headers: ajaxHeaders,
success: function(data){
// if(data.status==1){
$(that).attr('data-isatten', 1).attr('isatten', 1);
$.toast('关注成功');
// }else{
// $.toast('操作失败');
// }
setTimeout(function(){
$(that).attr('loading','0');
},200);
},
error: function(xhr, type){
console.log(xhr);
$(that).attr('loading','0');
}
});
} else {
$.ajax({
type: 'POST',
url: ApiBaseUrl + '/appv1/unfollow',
data: {
to_user_id:$(that).data('uid')
},
headers: ajaxHeaders,
success: function(data){
// if(data.status==1) {
$(that).attr('data-isatten', 0).attr('isatten', 0);
$.toast('取消关注成功');
// }else{
// $.toast('操作失败');
// }
setTimeout(function(){
$(that).attr('loading','0');
},200);
},
error: function(xhr, type){
console.log(xhr);
$(that).attr('loading','0');
}
});
}
})
}
//推荐商品
function initRecommendGoods(goods){
var html = '';
var good = {};
for(var i=0;i<goods.length;i++){
good = goods[i];
html+= '<li class="goods_li hs-cf">'
html+= '<a href="/Portal/HsArticle/index/id/'+ good.id +'.html" class="filepath" external>'
html+= '<div class="image" data-layzr="'+ good.cover +'@640w_1l" ></div>'
html+= '</a>'
html+= '<a href="/Portal/HsArticle/index/id/'+ good.id +'.html" class="post_title" external>'+ good.title +'</a>'
if(good.tag && good.tag[0]){
html+= '<a href="'+ tagUrl(good.tag[0]) +'" class="external keywords">'+ good.tag[0] +'</a>'
}else{
html+= '<a class="keywords keywords_none">none</a>'
}
html+= '<div class="user_info">'
html+= '<a href="'+ sellerUrl(good.uid) +'" class="external">'
html+= '<img src="'+ good.avatar +'">'
html+= '<span>'+ good.username +'</span>'
html+= '</a>'
html+= '</div>'
html+= '</li>'
}
$('.gift_for_new .goods_ul').html(html);
}
//商品top10分类标签
function initTopCate(cate,postlist){
var tabHtml = '';
var pageHtml = '';
tabHtml+= '<div class="classify_tab classify_tab_act" sortid="'+ cate[0].id +'" loaddata="1">'+ cate[0].name +'</div>'
pageHtml+= '<div class="classify_page classify_page_act hs-cf" scroll="1" sortid="'+ cate[0].id +'"></div>'
for(var i=1;i<cate.length;i++){
tabHtml+= '<div class="classify_tab " sortid="'+ cate[i].id +'" loaddata="0">'+ cate[i].name +'</div>'
pageHtml+= '<div class="classify_page hs-cf" scroll="1" sortid="'+ cate[i].id +'"></div>'
}
$('.classify_tab_wrap').html(tabHtml);
$('.classify_page_wrap').html(pageHtml);
$('.classify_page_act').html(createClassifyGoods(postlist));
changeTab('classify_tab','classify_page','classify_tab_act','classify_page_act',function($o){
var loadData = $o.attr('loaddata');
var sortid = $o.attr('sortid');
if(loadData!=='0'){
return false;
}
$o.attr('loaddata',1);
getClassifyGoods(sortid);
},function($o){});
}
//生成分类商品列表
function createClassifyGoods(goods){
var html = '';
var good = {};
for(var i=0;i<goods.length;i++){
good = goods[i];
html+= '<li>'
html+= '<a href="/Portal/HsArticle/index/id/'+ good.id +'.html" external>'
html+= '<div class="image" data-layzr="'+ good.cover +'@640w_1l"></div>'
html+= '<div class="post_title">'+ good.post_title +'</div>'
html+= '<div class="price font_din">'+ good.price +'</div>'
html+= '</a>'
html+= '</li>'
}
return html;
}
//获取分类商品
function getClassifyGoods(sortid){
var url = ApiBaseUrl + '/appv6/cate/'+sortid+'/getCategoryPostTop10';
$.ajax({
type: "GET",
url: url,
dataType: 'json',
data: {},
headers: ajaxHeaders,
success: function(data){
if(data.status==1){
$('.classify_page[sortid="'+sortid+'"]').html(createClassifyGoods(data.data));
lazyload();
}
},
error: function(e){
console.log('getClassifyGoods err: ',e);
}
});
}
/*点击tab切换对应标签*/
function changeTab(tabClass,pageClass,tabActClass,pageActClass,endback,preback){
var $tabs = $('.' + tabClass);
var $pages = $('.' + pageClass);
$tabs.off('click').on('click',function(ev){
var index = $(this).index();
if($(this).hasClass(tabActClass)){
return;
}
if(typeof preback === "function"){
preback($(this),ev);
}
$tabs.removeClass(tabActClass);
$tabs.eq(index).addClass(tabActClass);
$pages.removeClass(pageActClass);
$pages.eq(index).addClass(pageActClass);
if(typeof endback === "function"){
endback($(this),ev);
}
})
}
});
|
psychokiller666/heishi
|
app/modules/components/gift_for_new/gift_for_new.js
|
JavaScript
|
apache-2.0
| 12,382
|
/*
* Copyright (C) 2016 Andriy Druk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.github.druk.rx2dnssd;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* A class representing bonjour service
*/
//I don't wanna split this class and its builder
@SuppressWarnings("PMD.GodClass")
public class BonjourService implements Parcelable {
/**
* Flag that indicate that Bonjour service was lost
*/
public static final int LOST = 1 << 8;
public static final Creator<BonjourService> CREATOR = new Creator<BonjourService>() {
@NonNull
public BonjourService createFromParcel(@NonNull Parcel source) {
return new BonjourService(source);
}
@NonNull
public BonjourService[] newArray(int size) {
return new BonjourService[size];
}
};
private final int flags;
private final String serviceName;
private final String regType;
private final String domain;
private final List<InetAddress> inetAddresses;
private final Map<String, String> dnsRecords;
private final int ifIndex;
private final String hostname;
private final int port;
protected BonjourService(@NonNull Builder builder) {
this.flags = builder.flags;
this.serviceName = builder.serviceName;
this.regType = builder.regType;
this.domain = builder.domain;
this.ifIndex = builder.ifIndex;
this.inetAddresses = Collections.unmodifiableList(builder.inetAddresses);
this.dnsRecords = Collections.unmodifiableMap(builder.dnsRecords);
this.hostname = builder.hostname;
this.port = builder.port;
}
protected BonjourService(@NonNull Parcel in) {
this.flags = in.readInt();
this.serviceName = in.readString();
this.regType = in.readString();
this.domain = in.readString();
this.dnsRecords = readMap(in);
this.inetAddresses = readAddresses(in);
this.ifIndex = in.readInt();
this.hostname = in.readString();
this.port = in.readInt();
}
private static void writeAddresses(Parcel dest, List<InetAddress> val) {
if (val == null) {
dest.writeInt(-1);
return;
}
int n = val.size();
dest.writeInt(n);
for (InetAddress address : val) {
dest.writeSerializable(address);
}
}
private static List<InetAddress> readAddresses(Parcel in) {
int n = in.readInt();
if (n < 0) {
return null;
}
List<InetAddress> result = new ArrayList<>();
for (int i = 0; i < n; i++) {
result.add((InetAddress) in.readSerializable());
}
return Collections.unmodifiableList(result);
}
private static void writeMap(Parcel dest, Map<String, String> val) {
if (val == null) {
dest.writeInt(-1);
return;
}
int n = val.size();
dest.writeInt(n);
for (Map.Entry<String, String> entry : val.entrySet()) {
dest.writeString(entry.getKey());
dest.writeString(entry.getValue());
}
}
private static Map<String, String> readMap(Parcel in) {
int n = in.readInt();
if (n < 0) {
return null;
}
Map<String, String> result = new HashMap<>();
for (int i = 0; i < n; i++) {
String key = in.readString();
String value = in.readString();
if (key != null && value != null) {
result.put(key, value);
}
}
return Collections.unmodifiableMap(result);
}
/** Get flags */
public int getFlags() {
return flags;
}
/** Get the service name */
@NonNull
public String getServiceName() {
return serviceName;
}
/** Get reg type */
@NonNull
public String getRegType() {
return regType;
}
/** Get domain */
@Nullable
public String getDomain() {
return domain;
}
/** Get if index */
public int getIfIndex() {
return ifIndex;
}
/** Get hostname */
@Nullable
public String getHostname() {
return hostname;
}
/** Get port */
public int getPort() {
return port;
}
/** Get TXT records */
@NonNull
public Map<String, String> getTxtRecords() {
return dnsRecords;
}
/** Get ipv4 address */
@Nullable
public Inet4Address getInet4Address() {
for (InetAddress inetAddress : inetAddresses) {
if (inetAddress instanceof Inet4Address) {
return (Inet4Address) inetAddress;
}
}
return null;
}
/** Get ipv6 address */
@Nullable
public Inet6Address getInet6Address() {
for (InetAddress inetAddress : inetAddresses) {
if (inetAddress instanceof Inet6Address) {
return (Inet6Address) inetAddress;
}
}
return null;
}
public List<InetAddress> getInetAddresses() {
return inetAddresses;
}
/**
* Get status of bonjour service
*
* @return true if service was lost
*/
public boolean isLost() {
return (flags & LOST) == LOST;
}
@Override
//This code was generated by IDEA, and I don't wanna make it less readable
@SuppressWarnings({"PMD.IfStmtsMustUseBraces", "PMD.SimplifyBooleanReturns"})
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof BonjourService)) return false;
BonjourService that = (BonjourService) o;
if (ifIndex != that.ifIndex) return false;
if (serviceName != null ? !serviceName.equals(that.serviceName) : that.serviceName != null) return false;
if (regType != null ? !regType.equals(that.regType) : that.regType != null) return false;
return !(domain != null ? !domain.equals(that.domain) : that.domain != null);
}
@Override
public int hashCode() {
int result = serviceName != null ? serviceName.hashCode() : 0;
result = 31 * result + (regType != null ? regType.hashCode() : 0);
result = 31 * result + (domain != null ? domain.hashCode() : 0);
result = 31 * result + ifIndex;
return result;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
dest.writeInt(this.flags);
dest.writeString(this.serviceName);
dest.writeString(this.regType);
dest.writeString(this.domain);
writeMap(dest, this.dnsRecords);
writeAddresses(dest, this.inetAddresses);
dest.writeInt(this.ifIndex);
dest.writeString(this.hostname);
dest.writeInt(this.port);
}
@NonNull
@Override
public String toString() {
return "BonjourService{"
+ "flags=" + flags
+ ", domain='" + domain + '\''
+ ", regType='" + regType + '\''
+ ", serviceName='" + serviceName + '\''
+ ", dnsRecords=" + dnsRecords
+ ", ifIndex=" + ifIndex
+ ", hostname='" + hostname + '\''
+ ", port=" + port
+ '}';
}
public static class Builder {
private final int flags;
private final String serviceName;
private final String regType;
private final String domain;
private final int ifIndex;
private List<InetAddress> inetAddresses = new ArrayList<>();
//mutable version
private Map<String, String> dnsRecords = new HashMap<>();
private String hostname;
private int port;
/**
* Constructs a builder initialized to input parameters
*
* @param flags flags of BonjourService.
* @param ifIndex ifIndex of BonjourService.
* @param serviceName serviceName of BonjourService.
* @param regType regType of BonjourService.
* @param domain domain of BonjourService.
*/
public Builder(int flags, int ifIndex, @NonNull String serviceName, @NonNull String regType, String domain) {
this.flags = flags;
this.serviceName = serviceName;
this.regType = regType;
this.domain = domain;
this.ifIndex = ifIndex;
}
/**
* Constructs a builder initialized to the contents of existed BonjourService object
*
* @param service the initial contents of the object.
*/
public Builder(@NonNull BonjourService service) {
this.flags = service.flags;
this.serviceName = service.serviceName;
this.regType = service.regType;
this.domain = service.domain;
this.ifIndex = service.ifIndex;
this.dnsRecords = new HashMap<>(service.dnsRecords);
this.inetAddresses = new ArrayList<>(service.inetAddresses);
this.hostname = service.hostname;
this.port = service.port;
}
/**
* Appends hostname of service
*
* @param hostname the hostname of service.
* @return this builder.
*/
@NonNull
public Builder hostname(String hostname) {
this.hostname = hostname;
return this;
}
/**
* Appends port
*
* @param port the port of service.
* @return this builder.
*/
@NonNull
public Builder port(int port) {
this.port = port;
return this;
}
/**
* Appends TXT records of service
*
* @param dnsRecords map of TXT records.
* @return this builder.
*/
@NonNull
public Builder dnsRecords(Map<String, String> dnsRecords) {
this.dnsRecords = dnsRecords;
return this;
}
/**
* Appends ipv4 address
*
* @param inet4Address ipv4 address of service.
* @return this builder.
*/
@NonNull
public Builder inet4Address(Inet4Address inet4Address) {
this.inetAddresses.add(inet4Address);
return this;
}
/**
* Appends ipv6 address
*
* @param inet6Address ipv6 address of service.
* @return this builder.
*/
@NonNull
public Builder inet6Address(Inet6Address inet6Address) {
this.inetAddresses.add(inet6Address);
return this;
}
/**
* Constructs a BonjourService object
*
* @return new BonjourService object.
*/
@NonNull
public BonjourService build() {
return new BonjourService(this);
}
public void inetAddress(InetAddress inetAddress) {
this.inetAddresses.add(inetAddress);
}
}
}
|
andriydruk/RxDNSSD
|
rx2dnssd/src/main/java/com/github/druk/rx2dnssd/BonjourService.java
|
Java
|
apache-2.0
| 11,911
|
<!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 -->
<title>nl.esciencecenter.xenon.adaptors.shared.ssh (xenon-2.3.0 2.6.2 API for Xenon developers)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="nl.esciencecenter.xenon.adaptors.shared.ssh (xenon-2.3.0 2.6.2 API for Xenon developers)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>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="../../../../../../nl/esciencecenter/xenon/adaptors/schedulers/torque/package-summary.html">Prev Package</a></li>
<li><a href="../../../../../../nl/esciencecenter/xenon/credentials/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?nl/esciencecenter/xenon/adaptors/shared/ssh/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package nl.esciencecenter.xenon.adaptors.shared.ssh</h1>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../nl/esciencecenter/xenon/adaptors/shared/ssh/SSHConnection.html" title="class in nl.esciencecenter.xenon.adaptors.shared.ssh">SSHConnection</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../nl/esciencecenter/xenon/adaptors/shared/ssh/SSHUtil.html" title="class in nl.esciencecenter.xenon.adaptors.shared.ssh">SSHUtil</a></td>
<td class="colLast"> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../nl/esciencecenter/xenon/adaptors/shared/ssh/SSHUtil.PasswordProvider.html" title="class in nl.esciencecenter.xenon.adaptors.shared.ssh">SSHUtil.PasswordProvider</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../nl/esciencecenter/xenon/adaptors/shared/ssh/SSHUtil.Tunnel.html" title="class in nl.esciencecenter.xenon.adaptors.shared.ssh">SSHUtil.Tunnel</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Exception Summary table, listing exceptions, and an explanation">
<caption><span>Exception Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Exception</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../nl/esciencecenter/xenon/adaptors/shared/ssh/CertificateNotFoundException.html" title="class in nl.esciencecenter.xenon.adaptors.shared.ssh">CertificateNotFoundException</a></td>
<td class="colLast">
<div class="block">Signals that a certificate file could not be found.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../nl/esciencecenter/xenon/adaptors/shared/ssh/CredentialNotFoundException.html" title="class in nl.esciencecenter.xenon.adaptors.shared.ssh">CredentialNotFoundException</a></td>
<td class="colLast">
<div class="block">Signals that a credential could not be found.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>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="../../../../../../nl/esciencecenter/xenon/adaptors/schedulers/torque/package-summary.html">Prev Package</a></li>
<li><a href="../../../../../../nl/esciencecenter/xenon/credentials/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?nl/esciencecenter/xenon/adaptors/shared/ssh/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.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>
|
NLeSC/Xenon
|
docs/versions/2.6.2/javadoc-devel/nl/esciencecenter/xenon/adaptors/shared/ssh/package-summary.html
|
HTML
|
apache-2.0
| 6,983
|
# chclibs
Constrained Horn clause libraries
|
bishoksan/chclibs
|
README.md
|
Markdown
|
apache-2.0
| 44
|
# SeizeRecyclerView
### Use multiple adapters for a single RecyclerView.
<img src='screenshot/basic.gif' height='500px'/> <img src='screenshot/multi_type.gif' height='500px'/>
## How to use
```java
feedRv = (RecyclerView) findViewById(R.id.activity_main_rv);
// The whole origin adapter of RecyclerView
adapter = new FeedAdapter();
// set header and footer for the whole origin adapter of RecyclerView
adapter.setHeader(headerView = inflaterHeaderOrFooterAndBindClick(R.layout.header_film));
adapter.setFooter(footerView = inflaterHeaderOrFooterAndBindClick(R.layout.footer_film));
// attach seize adapters to origin adapter of RecyclerView
adapter.setSeizeAdapters(
filmActorSeizeAdapter = new FilmActorSeizeAdapter(),
filmCommentSeizeAdapter = new FilmCommentSeizeAdapter()
);
// set header and footer for the film actor seize adapter
filmActorSeizeAdapter.setOnFilmActorSeizeAdapterListener(this);
filmActorSeizeAdapter.setHeader(actorHeaderView = inflaterHeaderOrFooterAndBindClick(R.layout.header_film_actor));
filmActorSeizeAdapter.setFooter(actorFooterView = inflaterHeaderOrFooterAndBindClick(R.layout.footer_film_actor));
// set header and footer for the film comment seize adapter
filmCommentSeizeAdapter.setOnFilmCommentSeizeAdapterListener(this);
filmCommentSeizeAdapter.setHeader(commentHeaderView = inflaterHeaderOrFooterAndBindClick(R.layout.header_film_comment));
filmCommentSeizeAdapter.setFooter(commentFooterView = inflaterHeaderOrFooterAndBindClick(R.layout.footer_film_comment));
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
feedRv.setLayoutManager(layoutManager);
// set origin adapter to RecyclerView
feedRv.setAdapter(adapter);
```
```java
public void onRequestActors(List<ActorVM> list) {
filmActorSeizeAdapter.addList(list);
filmActorSeizeAdapter.notifyDataSetChanged();
}
public void onRequestComment(List<CommentVM> list) {
filmCommentSeizeAdapter.addList(list);
filmCommentSeizeAdapter.notifyDataSetChanged();
}
```
License
=======
Copyright 2017 Wang Jie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing blacklist and
limitations under the License.
|
wangjiegulu/SeizeRecyclerView
|
README.md
|
Markdown
|
apache-2.0
| 2,676
|
namespace netDumbster.smtp.Logging
{
using System;
public interface ILog
{
void Debug(object message);
void Debug(object message, Exception exception);
void DebugFormat(string format, params object[] args);
void DebugFormat(IFormatProvider provider, string format, params object[] args);
void Error(object message);
void Error(object message, Exception exception);
void ErrorFormat(string format, params object[] args);
void ErrorFormat(IFormatProvider provider, string format, params object[] args);
void Fatal(object message);
void Fatal(object message, Exception exception);
void FatalFormat(string format, params object[] args);
void FatalFormat(IFormatProvider provider, string format, params object[] args);
void Info(object message);
void Info(object message, Exception exception);
void InfoFormat(string format, params object[] args);
void InfoFormat(IFormatProvider provider, string format, params object[] args);
void Warn(object message);
void Warn(object message, Exception exception);
void WarnFormat(string format, params object[] args);
void WarnFormat(IFormatProvider provider, string format, params object[] args);
}
}
|
YAFNET/YAFNET-UnitTests
|
YAF.UnitTests/Externals/netDumbster/Logging/ILog.cs
|
C#
|
apache-2.0
| 1,334
|
/*
* BottomBar library for Xamarin Android
* Copyright (c) 2017 Alírio Mendes (http://github.com/aliriomendes).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
namespace BottomNavigationBar
{
public interface OnTabReselectListener
{
}
}
|
aliriomendes/BottomBar
|
BottomBar/BottomNavigationBar/OnTabReselectListener.cs
|
C#
|
apache-2.0
| 779
|
<!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 : Function Reference: replace()</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 Thu Oct 23 19:15:14 2014 -->
<!-- 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='_functions';
filename='index.html';
cookiekey='phpxref';
handleNavFrame(relbase, subdir, filename);
logFunction('replace');
// -->
</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>Function and Method Cross Reference</h3>
<h2><a href="index.html#replace">replace()</a></h2>
<b>Defined at:</b><ul>
<li><a href="../bonfire/codeigniter/database/DB_active_rec.php.html#replace">/bonfire/codeigniter/database/DB_active_rec.php</a> -> <a onClick="logFunction('replace', '/bonfire/codeigniter/database/DB_active_rec.php.source.html#l1201')" href="../bonfire/codeigniter/database/DB_active_rec.php.source.html#l1201"> line 1201</a></li>
</ul>
<b>Referenced 378 times:</b><ul>
<li><a href="../public/assets/js/modernizr-2.5.3.js.html">/public/assets/js/modernizr-2.5.3.js</a> -> <a href="../public/assets/js/modernizr-2.5.3.js.source.html#l719"> line 719</a></li>
<li><a href="../public/assets/js/modernizr-2.5.3.js.html">/public/assets/js/modernizr-2.5.3.js</a> -> <a href="../public/assets/js/modernizr-2.5.3.js.source.html#l721"> line 721</a></li>
<li><a href="../public/assets/js/modernizr-2.5.3.js.html">/public/assets/js/modernizr-2.5.3.js</a> -> <a href="../public/assets/js/modernizr-2.5.3.js.source.html#l723"> line 723</a></li>
<li><a href="../public/assets/js/modernizr-2.5.3.js.html">/public/assets/js/modernizr-2.5.3.js</a> -> <a href="../public/assets/js/modernizr-2.5.3.js.source.html#l738"> line 738</a></li>
<li><a href="../public/assets/js/modernizr-2.5.3.js.html">/public/assets/js/modernizr-2.5.3.js</a> -> <a href="../public/assets/js/modernizr-2.5.3.js.source.html#l739"> line 739</a></li>
<li><a href="../public/assets/js/modernizr-2.5.3.js.html">/public/assets/js/modernizr-2.5.3.js</a> -> <a href="../public/assets/js/modernizr-2.5.3.js.source.html#l744"> line 744</a></li>
<li><a href="../public/assets/js/modernizr-2.5.3.js.html">/public/assets/js/modernizr-2.5.3.js</a> -> <a href="../public/assets/js/modernizr-2.5.3.js.source.html#l746"> line 746</a></li>
<li><a href="../public/assets/js/modernizr-2.5.3.js.html">/public/assets/js/modernizr-2.5.3.js</a> -> <a href="../public/assets/js/modernizr-2.5.3.js.source.html#l1082"> line 1082</a></li>
<li><a href="../public/assets/js/modernizr-2.5.3.js.html">/public/assets/js/modernizr-2.5.3.js</a> -> <a href="../public/assets/js/modernizr-2.5.3.js.source.html#l1258"> line 1258</a></li>
<li><a href="../public/themes/admin/js/jwerty.js.html">/public/themes/admin/js/jwerty.js</a> -> <a href="../public/themes/admin/js/jwerty.js.source.html#l202"> line 202</a></li>
<li><a href="../public/assets/js/bootstrap.js.html">/public/assets/js/bootstrap.js</a> -> <a href="../public/assets/js/bootstrap.js.source.html#l100"> line 100</a></li>
<li><a href="../public/assets/js/bootstrap.js.html">/public/assets/js/bootstrap.js</a> -> <a href="../public/assets/js/bootstrap.js.source.html#l455"> line 455</a></li>
<li><a href="../public/assets/js/bootstrap.js.html">/public/assets/js/bootstrap.js</a> -> <a href="../public/assets/js/bootstrap.js.source.html#l628"> line 628</a></li>
<li><a href="../public/assets/js/bootstrap.js.html">/public/assets/js/bootstrap.js</a> -> <a href="../public/assets/js/bootstrap.js.source.html#l756"> line 756</a></li>
<li><a href="../public/assets/js/bootstrap.js.html">/public/assets/js/bootstrap.js</a> -> <a href="../public/assets/js/bootstrap.js.source.html#l1037"> line 1037</a></li>
<li><a href="../public/assets/js/bootstrap.js.html">/public/assets/js/bootstrap.js</a> -> <a href="../public/assets/js/bootstrap.js.source.html#l1560"> line 1560</a></li>
<li><a href="../public/assets/js/bootstrap.js.html">/public/assets/js/bootstrap.js</a> -> <a href="../public/assets/js/bootstrap.js.source.html#l1732"> line 1732</a></li>
<li><a href="../public/assets/js/bootstrap.js.html">/public/assets/js/bootstrap.js</a> -> <a href="../public/assets/js/bootstrap.js.source.html#l1959"> line 1959</a></li>
<li><a href="../public/assets/js/bootstrap.js.html">/public/assets/js/bootstrap.js</a> -> <a href="../public/assets/js/bootstrap.js.source.html#l1960"> line 1960</a></li>
<li><a href="../bonfire/modules/roles/assets/js/settings.js.html">/bonfire/modules/roles/assets/js/settings.js</a> -> <a href="../bonfire/modules/roles/assets/js/settings.js.source.html#l21"> line 21</a></li>
<li><a href="../bonfire/modules/roles/assets/js/settings.js.html">/bonfire/modules/roles/assets/js/settings.js</a> -> <a href="../bonfire/modules/roles/assets/js/settings.js.source.html#l22"> line 22</a></li>
<li><a href="../bonfire/modules/roles/assets/js/settings.js.html">/bonfire/modules/roles/assets/js/settings.js</a> -> <a href="../bonfire/modules/roles/assets/js/settings.js.source.html#l65"> line 65</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l569"> line 569</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l570"> line 570</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l571"> line 571</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l622"> line 622</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l622"> line 622</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l1677"> line 1677</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l1990"> line 1990</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l2305"> line 2305</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l2307"> line 2307</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l2363"> line 2363</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l2387"> line 2387</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l2898"> line 2898</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l3949"> line 3949</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l4154"> line 4154</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l4158"> line 4158</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l4239"> line 4239</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l4286"> line 4286</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l4461"> line 4461</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l4469"> line 4469</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l4484"> line 4484</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l4488"> line 4488</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l4497"> line 4497</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l4519"> line 4519</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l4526"> line 4526</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l4847"> line 4847</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l5155"> line 5155</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l5208"> line 5208</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l5368"> line 5368</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l5935"> line 5935</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l5944"> line 5944</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l6078"> line 6078</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l6391"> line 6391</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l6725"> line 6725</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l6889"> line 6889</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l6904"> line 6904</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l7184"> line 7184</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l7222"> line 7222</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l7224"> line 7224</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l7589"> line 7589</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l7589"> line 7589</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l7649"> line 7649</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l7765"> line 7765</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l7956"> line 7956</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l8000"> line 8000</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.js.html">/public/themes/admin/js/jquery-1.7.2.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.js.source.html#l8003"> line 8003</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l38"> line 38</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l49"> line 49</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l50"> line 50</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l54"> line 54</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l54"> line 54</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l55"> line 55</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l55"> line 55</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l55"> line 55</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l55"> line 55</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l56"> line 56</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l57"> line 57</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l57"> line 57</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l57"> line 57</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l57"> line 57</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l57"> line 57</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l57"> line 57</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l57"> line 57</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l79"> line 79</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l81"> line 81</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l89"> line 89</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l90"> line 90</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l90"> line 90</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.min.js.html">/public/themes/admin/js/jquery.dataTables.min.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.min.js.source.html#l93"> line 93</a></li>
<li><a href="../public/themes/admin/js/modernizr-2.5.3.js.html">/public/themes/admin/js/modernizr-2.5.3.js</a> -> <a href="../public/themes/admin/js/modernizr-2.5.3.js.source.html#l719"> line 719</a></li>
<li><a href="../public/themes/admin/js/modernizr-2.5.3.js.html">/public/themes/admin/js/modernizr-2.5.3.js</a> -> <a href="../public/themes/admin/js/modernizr-2.5.3.js.source.html#l721"> line 721</a></li>
<li><a href="../public/themes/admin/js/modernizr-2.5.3.js.html">/public/themes/admin/js/modernizr-2.5.3.js</a> -> <a href="../public/themes/admin/js/modernizr-2.5.3.js.source.html#l723"> line 723</a></li>
<li><a href="../public/themes/admin/js/modernizr-2.5.3.js.html">/public/themes/admin/js/modernizr-2.5.3.js</a> -> <a href="../public/themes/admin/js/modernizr-2.5.3.js.source.html#l738"> line 738</a></li>
<li><a href="../public/themes/admin/js/modernizr-2.5.3.js.html">/public/themes/admin/js/modernizr-2.5.3.js</a> -> <a href="../public/themes/admin/js/modernizr-2.5.3.js.source.html#l739"> line 739</a></li>
<li><a href="../public/themes/admin/js/modernizr-2.5.3.js.html">/public/themes/admin/js/modernizr-2.5.3.js</a> -> <a href="../public/themes/admin/js/modernizr-2.5.3.js.source.html#l744"> line 744</a></li>
<li><a href="../public/themes/admin/js/modernizr-2.5.3.js.html">/public/themes/admin/js/modernizr-2.5.3.js</a> -> <a href="../public/themes/admin/js/modernizr-2.5.3.js.source.html#l746"> line 746</a></li>
<li><a href="../public/themes/admin/js/modernizr-2.5.3.js.html">/public/themes/admin/js/modernizr-2.5.3.js</a> -> <a href="../public/themes/admin/js/modernizr-2.5.3.js.source.html#l1082"> line 1082</a></li>
<li><a href="../public/themes/admin/js/modernizr-2.5.3.js.html">/public/themes/admin/js/modernizr-2.5.3.js</a> -> <a href="../public/themes/admin/js/modernizr-2.5.3.js.source.html#l1258"> line 1258</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l8"> line 8</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l9"> line 9</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l9"> line 9</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l9"> line 9</a></li>
<li><a href="../public/themes/ribbit/js/less.js.html">/public/themes/ribbit/js/less.js</a> -> <a href="../public/themes/ribbit/js/less.js.source.html#l9"> line 9</a></li>
<li><a href="../public/themes/admin/js/bootstrap-dropdown.js.html">/public/themes/admin/js/bootstrap-dropdown.js</a> -> <a href="../public/themes/admin/js/bootstrap-dropdown.js.source.html#l48"> line 48</a></li>
<li><a href="../bonfire/modules/builder/assets/js/modulebuilder.js.html">/bonfire/modules/builder/assets/js/modulebuilder.js</a> -> <a href="../bonfire/modules/builder/assets/js/modulebuilder.js.source.html#l74"> line 74</a></li>
<li><a href="../bonfire/modules/activities/views/reports/activities_js.php.html">/bonfire/modules/activities/views/reports/activities_js.php</a> -> <a href="../bonfire/modules/activities/views/reports/activities_js.php.source.html#l2"> line 2</a></li>
<li><a href="../bonfire/modules/activities/views/reports/activities_js.php.html">/bonfire/modules/activities/views/reports/activities_js.php</a> -> <a href="../bonfire/modules/activities/views/reports/activities_js.php.source.html#l24"> line 24</a></li>
<li><a href="../bonfire/modules/builder/views/files/view_js.php.html">/bonfire/modules/builder/views/files/view_js.php</a> -> <a href="../bonfire/modules/builder/views/files/view_js.php.source.html#l43"> line 43</a></li>
<li><a href="../public/themes/default/js/bootstrap.min.js.html">/public/themes/default/js/bootstrap.min.js</a> -> <a href="../public/themes/default/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/themes/default/js/bootstrap.min.js.html">/public/themes/default/js/bootstrap.min.js</a> -> <a href="../public/themes/default/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/themes/default/js/bootstrap.min.js.html">/public/themes/default/js/bootstrap.min.js</a> -> <a href="../public/themes/default/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/themes/default/js/bootstrap.min.js.html">/public/themes/default/js/bootstrap.min.js</a> -> <a href="../public/themes/default/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/themes/default/js/bootstrap.min.js.html">/public/themes/default/js/bootstrap.min.js</a> -> <a href="../public/themes/default/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/themes/default/js/bootstrap.min.js.html">/public/themes/default/js/bootstrap.min.js</a> -> <a href="../public/themes/default/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/themes/default/js/bootstrap.min.js.html">/public/themes/default/js/bootstrap.min.js</a> -> <a href="../public/themes/default/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/themes/default/js/bootstrap.min.js.html">/public/themes/default/js/bootstrap.min.js</a> -> <a href="../public/themes/default/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/themes/default/js/bootstrap.min.js.html">/public/themes/default/js/bootstrap.min.js</a> -> <a href="../public/themes/default/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l1375"> line 1375</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l1946"> line 1946</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l1958"> line 1958</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l2252"> line 2252</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l2252"> line 2252</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l2303"> line 2303</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l2303"> line 2303</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l2307"> line 2307</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l2327"> line 2327</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l2399"> line 2399</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l2406"> line 2406</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l2407"> line 2407</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l2408"> line 2408</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l2415"> line 2415</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l2416"> line 2416</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l2417"> line 2417</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l2418"> line 2418</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l2629"> line 2629</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l3572"> line 3572</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l3674"> line 3674</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l4172"> line 4172</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l4180"> line 4180</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l4188"> line 4188</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l4329"> line 4329</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l4393"> line 4393</a></li>
<li><a href="../public/themes/admin/js/jquery.dataTables.js.html">/public/themes/admin/js/jquery.dataTables.js</a> -> <a href="../public/themes/admin/js/jquery.dataTables.js.source.html#l11359"> line 11359</a></li>
<li><a href="../public/assets/js/bootstrap.min.js.html">/public/assets/js/bootstrap.min.js</a> -> <a href="../public/assets/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/assets/js/bootstrap.min.js.html">/public/assets/js/bootstrap.min.js</a> -> <a href="../public/assets/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/assets/js/bootstrap.min.js.html">/public/assets/js/bootstrap.min.js</a> -> <a href="../public/assets/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/assets/js/bootstrap.min.js.html">/public/assets/js/bootstrap.min.js</a> -> <a href="../public/assets/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/assets/js/bootstrap.min.js.html">/public/assets/js/bootstrap.min.js</a> -> <a href="../public/assets/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/assets/js/bootstrap.min.js.html">/public/assets/js/bootstrap.min.js</a> -> <a href="../public/assets/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/assets/js/bootstrap.min.js.html">/public/assets/js/bootstrap.min.js</a> -> <a href="../public/assets/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/assets/js/bootstrap.min.js.html">/public/assets/js/bootstrap.min.js</a> -> <a href="../public/assets/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/assets/js/bootstrap.min.js.html">/public/assets/js/bootstrap.min.js</a> -> <a href="../public/assets/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l196"> line 196</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l197"> line 197</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l198"> line 198</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l199"> line 199</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l200"> line 200</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l201"> line 201</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l213"> line 213</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l270"> line 270</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l656"> line 656</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l657"> line 657</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l658"> line 658</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l659"> line 659</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l660"> line 660</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l661"> line 661</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l662"> line 662</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l663"> line 663</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l664"> line 664</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l665"> line 665</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l666"> line 666</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l667"> line 667</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l668"> line 668</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l671"> line 671</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l672"> line 672</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l673"> line 673</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l674"> line 674</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l675"> line 675</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l676"> line 676</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l677"> line 677</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l678"> line 678</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l813"> line 813</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l814"> line 814</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l815"> line 815</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l816"> line 816</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l817"> line 817</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l818"> line 818</a></li>
<li><a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.html">/public/themes/admin/js/jquery-ui-timepicker-addon.js</a> -> <a href="../public/themes/admin/js/jquery-ui-timepicker-addon.js.source.html#l819"> line 819</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/themes/admin/js/jquery-1.7.2.min.js.html">/public/themes/admin/js/jquery-1.7.2.min.js</a> -> <a href="../public/themes/admin/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../application/views/profiler_template.php.html">/application/views/profiler_template.php</a> -> <a href="../application/views/profiler_template.php.source.html#l120"> line 120</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l569"> line 569</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l570"> line 570</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l571"> line 571</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l622"> line 622</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l622"> line 622</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l1677"> line 1677</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l1990"> line 1990</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l2305"> line 2305</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l2307"> line 2307</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l2363"> line 2363</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l2387"> line 2387</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l2898"> line 2898</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l3949"> line 3949</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l4154"> line 4154</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l4158"> line 4158</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l4239"> line 4239</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l4286"> line 4286</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l4461"> line 4461</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l4469"> line 4469</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l4484"> line 4484</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l4488"> line 4488</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l4497"> line 4497</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l4519"> line 4519</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l4526"> line 4526</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l4847"> line 4847</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l5155"> line 5155</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l5208"> line 5208</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l5368"> line 5368</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l5935"> line 5935</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l5944"> line 5944</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l6078"> line 6078</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l6391"> line 6391</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l6725"> line 6725</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l6889"> line 6889</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l6904"> line 6904</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l7184"> line 7184</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l7222"> line 7222</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l7224"> line 7224</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l7589"> line 7589</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l7589"> line 7589</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l7649"> line 7649</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l7765"> line 7765</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l7956"> line 7956</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l8000"> line 8000</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.js.html">/public/assets/js/jquery-1.7.2.js</a> -> <a href="../public/assets/js/jquery-1.7.2.js.source.html#l8003"> line 8003</a></li>
<li><a href="../bonfire/modules/roles/assets/js/jquery.tablehover.pack.js.html">/bonfire/modules/roles/assets/js/jquery.tablehover.pack.js</a> -> <a href="../bonfire/modules/roles/assets/js/jquery.tablehover.pack.js.source.html#l1"> line 1</a></li>
<li><a href="../bonfire/modules/roles/assets/js/jquery.tablehover.pack.js.html">/bonfire/modules/roles/assets/js/jquery.tablehover.pack.js</a> -> <a href="../bonfire/modules/roles/assets/js/jquery.tablehover.pack.js.source.html#l1"> line 1</a></li>
<li><a href="../public/themes/docs/js/highlight.min.js.html">/public/themes/docs/js/highlight.min.js</a> -> <a href="../public/themes/docs/js/highlight.min.js.source.html#l1"> line 1</a></li>
<li><a href="../public/themes/docs/js/highlight.min.js.html">/public/themes/docs/js/highlight.min.js</a> -> <a href="../public/themes/docs/js/highlight.min.js.source.html#l1"> line 1</a></li>
<li><a href="../public/themes/docs/js/highlight.min.js.html">/public/themes/docs/js/highlight.min.js</a> -> <a href="../public/themes/docs/js/highlight.min.js.source.html#l1"> line 1</a></li>
<li><a href="../public/themes/docs/js/highlight.min.js.html">/public/themes/docs/js/highlight.min.js</a> -> <a href="../public/themes/docs/js/highlight.min.js.source.html#l1"> line 1</a></li>
<li><a href="../public/themes/docs/js/highlight.min.js.html">/public/themes/docs/js/highlight.min.js</a> -> <a href="../public/themes/docs/js/highlight.min.js.source.html#l1"> line 1</a></li>
<li><a href="../public/themes/docs/js/highlight.min.js.html">/public/themes/docs/js/highlight.min.js</a> -> <a href="../public/themes/docs/js/highlight.min.js.source.html#l1"> line 1</a></li>
<li><a href="../public/themes/docs/js/highlight.min.js.html">/public/themes/docs/js/highlight.min.js</a> -> <a href="../public/themes/docs/js/highlight.min.js.source.html#l1"> line 1</a></li>
<li><a href="../public/themes/docs/js/highlight.min.js.html">/public/themes/docs/js/highlight.min.js</a> -> <a href="../public/themes/docs/js/highlight.min.js.source.html#l1"> line 1</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l2"> line 2</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l3"> line 3</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/assets/js/jquery-1.7.2.min.js.html">/public/assets/js/jquery-1.7.2.min.js</a> -> <a href="../public/assets/js/jquery-1.7.2.min.js.source.html#l4"> line 4</a></li>
<li><a href="../public/themes/admin/js/bootstrap.min.js.html">/public/themes/admin/js/bootstrap.min.js</a> -> <a href="../public/themes/admin/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/themes/admin/js/bootstrap.min.js.html">/public/themes/admin/js/bootstrap.min.js</a> -> <a href="../public/themes/admin/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/themes/admin/js/bootstrap.min.js.html">/public/themes/admin/js/bootstrap.min.js</a> -> <a href="../public/themes/admin/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/themes/admin/js/bootstrap.min.js.html">/public/themes/admin/js/bootstrap.min.js</a> -> <a href="../public/themes/admin/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/themes/admin/js/bootstrap.min.js.html">/public/themes/admin/js/bootstrap.min.js</a> -> <a href="../public/themes/admin/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/themes/admin/js/bootstrap.min.js.html">/public/themes/admin/js/bootstrap.min.js</a> -> <a href="../public/themes/admin/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/themes/admin/js/bootstrap.min.js.html">/public/themes/admin/js/bootstrap.min.js</a> -> <a href="../public/themes/admin/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/themes/admin/js/bootstrap.min.js.html">/public/themes/admin/js/bootstrap.min.js</a> -> <a href="../public/themes/admin/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/themes/admin/js/bootstrap.min.js.html">/public/themes/admin/js/bootstrap.min.js</a> -> <a href="../public/themes/admin/js/bootstrap.min.js.source.html#l6"> line 6</a></li>
<li><a href="../public/themes/admin/js/bootstrap.js.html">/public/themes/admin/js/bootstrap.js</a> -> <a href="../public/themes/admin/js/bootstrap.js.source.html#l100"> line 100</a></li>
<li><a href="../public/themes/admin/js/bootstrap.js.html">/public/themes/admin/js/bootstrap.js</a> -> <a href="../public/themes/admin/js/bootstrap.js.source.html#l455"> line 455</a></li>
<li><a href="../public/themes/admin/js/bootstrap.js.html">/public/themes/admin/js/bootstrap.js</a> -> <a href="../public/themes/admin/js/bootstrap.js.source.html#l628"> line 628</a></li>
<li><a href="../public/themes/admin/js/bootstrap.js.html">/public/themes/admin/js/bootstrap.js</a> -> <a href="../public/themes/admin/js/bootstrap.js.source.html#l756"> line 756</a></li>
<li><a href="../public/themes/admin/js/bootstrap.js.html">/public/themes/admin/js/bootstrap.js</a> -> <a href="../public/themes/admin/js/bootstrap.js.source.html#l1037"> line 1037</a></li>
<li><a href="../public/themes/admin/js/bootstrap.js.html">/public/themes/admin/js/bootstrap.js</a> -> <a href="../public/themes/admin/js/bootstrap.js.source.html#l1560"> line 1560</a></li>
<li><a href="../public/themes/admin/js/bootstrap.js.html">/public/themes/admin/js/bootstrap.js</a> -> <a href="../public/themes/admin/js/bootstrap.js.source.html#l1732"> line 1732</a></li>
<li><a href="../public/themes/admin/js/bootstrap.js.html">/public/themes/admin/js/bootstrap.js</a> -> <a href="../public/themes/admin/js/bootstrap.js.source.html#l1959"> line 1959</a></li>
<li><a href="../public/themes/admin/js/bootstrap.js.html">/public/themes/admin/js/bootstrap.js</a> -> <a href="../public/themes/admin/js/bootstrap.js.source.html#l1960"> line 1960</a></li>
</ul>
<!-- A link to the phpxref site in your customized footer file is appreciated ;-) -->
<br><hr>
<table width="100%">
<tr><td>Generated: Thu Oct 23 19:15:14 2014</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>
|
inputx/code-ref-doc
|
rebbit/_functions/replace.html
|
HTML
|
apache-2.0
| 80,188
|
/*******************************************************************************
* Copyright (c) 2017-11-09 @author <a href="mailto:iffiff1@gmail.com">Tyler Chen</a>.
* All rights reserved.
*
* Contributors:
* <a href="mailto:iffiff1@gmail.com">Tyler Chen</a> - initial API and implementation.
* Auto Generate By foreveross.com Quick Deliver Platform.
******************************************************************************/
package com.foreveross.qdp.application.system.log;
import java.util.Date;
import org.iff.infra.domain.InstanceFactory;
import org.iff.infra.test.AbstractIntegratedTestCase;
import org.iff.infra.util.mybatis.plugin.Page;
import org.junit.Test;
import com.foreveross.qdp.application.system.log.LogAccessApplication;
import com.foreveross.qdp.infra.vo.system.log.LogAccessVO;
/**
* Test for LogAccess.
* @author <a href="mailto:iffiff1@gmail.com">Tyler Chen</a>
* @since 2017-11-09
* @version 1.0.0
* auto generate by qdp v3.0.
*/
public class LogAccessApplicationTest extends AbstractIntegratedTestCase {
protected String[] getDataSetFilePaths() {
return new String[] { "dataset/LogAccess.xml" };
}
@Test
public void test_getLogAccess() {
LogAccessApplication application = InstanceFactory.getInstance(LogAccessApplication.class);
}
@Test
public void test_getLogAccessById(){
LogAccessApplication application = InstanceFactory.getInstance(LogAccessApplication.class);
}
@Test
public void test_pageFindLogAccess() {
LogAccessApplication application = InstanceFactory.getInstance(LogAccessApplication.class);
Page page = Page.pageable(10, 1, 0, null);
LogAccessVO vo = new LogAccessVO();
System.out.println(application.pageFindLogAccess(vo, page));
}
@Test
public void test_addLogAccess() {
LogAccessApplication application = InstanceFactory.getInstance(LogAccessApplication.class);
LogAccessVO vo = new LogAccessVO();
//application.addLogAccess(vo);
}
@Test
public void test_updateLogAccess() {
LogAccessApplication application = InstanceFactory.getInstance(LogAccessApplication.class);
LogAccessVO vo = new LogAccessVO();
//application.updateLogAccess(vo);
}
@Test
public void test_removeLogAccess() {
LogAccessApplication application = InstanceFactory.getInstance(LogAccessApplication.class);
}
@Test
public void test_removeLogAccessById(){
LogAccessApplication application = InstanceFactory.getInstance(LogAccessApplication.class);
}
@Test
public void test_removeLogAccessByIds(){
LogAccessApplication application = InstanceFactory.getInstance(LogAccessApplication.class);
}
}
|
tylerchen/foss-qdp-project-v4
|
src/test/java/com/foreveross/qdp/application/system/log/LogAccessApplicationTest.java
|
Java
|
apache-2.0
| 2,685
|
/**
* Integration test for REST controller using Jetty
*/
package com.sawert.sandbox.spring.mvc.controller;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import java.util.List;
import javax.annotation.Resource;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;
import javax.xml.transform.stream.StreamSource;
import org.codehaus.jackson.JsonFactory;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.type.TypeReference;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.WebResponse;
import com.sawert.sandbox.spring.mvc.model.TestModel;
import com.sawert.sandbox.spring.mvc.model.TestModels;
/**
* Integration test for REST controller
*
* @author bsawert
*
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:context/test-applicationContext.xml" })
public class TestRestControllerIT {
private final String WEBAPP_CONTEXT = "/mvc-webapp";
private final String ID = "id01";
private String testAllModelsPath = WEBAPP_CONTEXT + "/action/models";
private String testModelPath = WEBAPP_CONTEXT + "/action/model/" + ID;
@Autowired
@Qualifier("jettyBaseUrl")
private String jettyBaseUrl;
// list of TestModel objects
@Resource(name="testModelList")
private List<TestModel> testModelList;
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
}
/**
* @throws java.lang.Exception
*/
@After
public void tearDown() throws Exception {
}
/**
* Test method for {@link com.sawert.sandbox.spring.mvc.controller.TestRestController#getAllModels()}.
*/
@Test
public void testGetAllModelsAsJson() {
String testUrl = jettyBaseUrl + testAllModelsPath + ".json";
String acceptContent = "application/json";
try {
// call web application
WebClient client = new WebClient(BrowserVersion.CHROME);
client.addRequestHeader("Accept", acceptContent);
Page page = client.getPage(testUrl);
WebResponse response = page.getWebResponse();
// make sure we have a JSON response
assertEquals(acceptContent, response.getContentType());
// deserialize and check content
String json = response.getContentAsString();
ObjectMapper mapper = new ObjectMapper();
JsonFactory factory = new JsonFactory();
JsonParser parser = factory.createJsonParser(json);
TestModels models = mapper.readValue(parser, new TypeReference<TestModels>() {});
assertNotNull(models);
assertFalse(models.getModelList().isEmpty());
assertEquals(testModelList.size(), models.getModelList().size());
// make sure we have matching content
int matches = 0;
for (TestModel testModel : testModelList) {
String id = testModel.getId();
for (TestModel model : models.getModelList()) {
if (id.equals(model.getId())) {
matches++;
}
}
}
assertEquals(testModelList.size(), matches);
}
catch (Exception e) {
// FailingHttpStatusCodeException, MalformedURLException, IOException, JsonSyntaxException
fail(e.getMessage());
}
}
/**
* Test method for {@link com.sawert.sandbox.spring.mvc.controller.TestRestController#getAllModels()}.
*/
@Test
public void testGetAllModelsAsXml() {
String testUrl = jettyBaseUrl + testAllModelsPath + ".xml";
String acceptContent = "application/xml";
try {
// call web application
WebClient client = new WebClient(BrowserVersion.CHROME);
client.addRequestHeader("Accept", acceptContent);
Page page = client.getPage(testUrl);
WebResponse response = page.getWebResponse();
// make sure we have an XML response
assertEquals(acceptContent, response.getContentType());
// deserialize and check content
JAXBContext jc = JAXBContext.newInstance(TestModels.class);
Unmarshaller u = jc.createUnmarshaller();
StreamSource source = new StreamSource(response.getContentAsStream());
TestModels models = (TestModels) u.unmarshal(source);
assertNotNull(models);
assertFalse(models.getModelList().isEmpty());
assertEquals(testModelList.size(), models.getModelList().size());
// make sure we have matching content
int matches = 0;
for (TestModel testModel : testModelList) {
String id = testModel.getId();
for (TestModel model : models.getModelList()) {
if (id.equals(model.getId())) {
matches++;
}
}
}
assertEquals(testModelList.size(), matches);
}
catch (Exception e) {
// FailingHttpStatusCodeException, MalformedURLException, IOException, JsonSyntaxException
fail(e.getMessage());
}
}
/**
* Test method for {@link com.sawert.sandbox.spring.mvc.controller.TestRestController#getModelById(java.lang.String)}.
*/
@Test
public void testGetModelByIdAsJson() {
String testUrl = jettyBaseUrl + testModelPath + ".json";
String acceptContent = "application/json";
try {
// call web application
WebClient client = new WebClient(BrowserVersion.CHROME);
client.addRequestHeader("Accept", acceptContent);
Page page = client.getPage(testUrl);
WebResponse response = page.getWebResponse();
// make sure we have a JSON response
assertEquals(acceptContent, response.getContentType());
// deserialize and check content
String json = response.getContentAsString();
ObjectMapper mapper = new ObjectMapper();
JsonFactory factory = new JsonFactory();
JsonParser parser = factory.createJsonParser(json);
TestModel model = mapper.readValue(parser, TestModel.class);
assertNotNull(model);
assertEquals(ID, model.getId());
} catch (Exception e) {
// FailingHttpStatusCodeException, MalformedURLException, IOException, JsonSyntaxException
fail(e.getMessage());
}
}
/**
* Test method for {@link com.sawert.sandbox.spring.mvc.controller.TestRestController#getModelById(java.lang.String)}.
*/
@Test
public void testGetModelByIdAsXml() {
String testUrl = jettyBaseUrl + testModelPath + ".xml";
String acceptContent = "application/xml";
try {
// call web application
WebClient client = new WebClient(BrowserVersion.CHROME);
client.addRequestHeader("Accept", acceptContent);
Page page = client.getPage(testUrl);
WebResponse response = page.getWebResponse();
// make sure we have an XML response
assertEquals(acceptContent, response.getContentType());
// deserialize and check content
JAXBContext jc = JAXBContext.newInstance(TestModel.class);
Unmarshaller u = jc.createUnmarshaller();
StreamSource source = new StreamSource(response.getContentAsStream());
TestModel model = (TestModel) u.unmarshal(source);
assertNotNull(model);
assertEquals(ID, model.getId());
}
catch (Exception e) {
// FailingHttpStatusCodeException, MalformedURLException, IOException, JAXBException
fail(e.getMessage());
}
}
}
|
bsawert/spring-sandbox
|
spring-mvc/mvc-webapp/src/test/java/com/sawert/sandbox/spring/mvc/controller/TestRestControllerIT.java
|
Java
|
apache-2.0
| 8,537
|
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
function getDecimals(n) {
n = n + '';
var i = n.indexOf('.');
return (i == -1) ? 0 : n.length - i - 1;
}
function getVF(n, opt_precision) {
var v = opt_precision;
if (undefined === v) {
v = Math.min(getDecimals(n), 3);
}
var base = Math.pow(10, v);
var f = ((n * base) | 0) % base;
return {v: v, f: f};
}
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"AM",
"PM"
],
"DAY": [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
],
"ERANAMES": [
"Before Christ",
"Anno Domini"
],
"ERAS": [
"BC",
"AD"
],
"FIRSTDAYOFWEEK": 0,
"MONTH": [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
"SHORTDAY": [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
],
"WEEKENDRANGE": [
5,
6
],
"fullDate": "EEEE, d MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y h:mm:ss a",
"mediumDate": "d MMM y",
"mediumTime": "h:mm:ss a",
"short": "dd/MM/y h:mm a",
"shortDate": "dd/MM/y",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "$",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-\u00a4",
"negSuf": "",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "en-lc",
"pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
|
LADOSSIFPB/nutrif
|
nutrif-web/lib/angular/i18n/angular-locale_en-lc.js
|
JavaScript
|
apache-2.0
| 2,590
|
/*
* Copyright 2015 AVAST Software s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package eu.inmite.apps.smsjizdenka.util;
import java.util.ArrayList;
import java.util.List;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.support.v4.app.NotificationCompat;
import android.text.TextUtils;
import eu.inmite.apps.smsjizdenka.R;
import eu.inmite.apps.smsjizdenka.activity.MainActivity;
import eu.inmite.apps.smsjizdenka.adapter.TicketsAdapter;
import eu.inmite.apps.smsjizdenka.data.Preferences;
import eu.inmite.apps.smsjizdenka.data.TicketProvider;
import eu.inmite.apps.smsjizdenka.data.model.City;
import eu.inmite.apps.smsjizdenka.data.model.Ticket;
import eu.inmite.apps.smsjizdenka.framework.DebugLog;
import eu.inmite.apps.smsjizdenka.service.WearableService;
/**
* Notification Utils
*
* @author David Vávra (david@inmite.eu)
*/
public class NotificationUtil {
public static final int NOTIFICATION_VERIFY = 42;
public static final int NOTIFICATION_MESSAGE = 43;
/**
* Posts notification about new sms ticket.
*
* @param c context to post notification
* @param t new ticket
*/
public static void notifyTicket(Context c, Ticket t, boolean keepNotification) {
String text;
String ticker;
int smallIcon;
int largeIcon;
int status;
switch (TicketsAdapter.getValidityStatus(t.getStatus(), t.getValidTo())) {
case TicketProvider.Tickets.STATUS_VALID:
case TicketProvider.Tickets.STATUS_VALID_EXPIRING:
text = c.getString(R.string.notif_valid_text, FormatUtil.formatDateTimeDifference(t.getValidTo()));
ticker = c.getString(R.string.notif_valid_ticker);
smallIcon = R.drawable.notification_small_ready;
largeIcon = R.drawable.notification_big_ready;
status = TicketProvider.Tickets.STATUS_VALID_EXPIRING;
break;
case TicketProvider.Tickets.STATUS_EXPIRING:
case TicketProvider.Tickets.STATUS_EXPIRING_EXPIRED:
text = c.getString(R.string.notif_expiring_text, FormatUtil.formatTime(t.getValidTo()));
ticker = c.getString(R.string.notif_expiring_ticker);
smallIcon = R.drawable.notification_small_warning;
largeIcon = R.drawable.notification_big_warning;
status = TicketProvider.Tickets.STATUS_EXPIRING_EXPIRED;
break;
case TicketProvider.Tickets.STATUS_EXPIRED:
text = c.getString(R.string.notif_expired_text, FormatUtil.formatTime(t.getValidTo()));
ticker = c.getString(R.string.notif_expired_ticker);
smallIcon = R.drawable.notification_small_expired;
largeIcon = R.drawable.notification_big_expired;
status = TicketProvider.Tickets.STATUS_EXPIRED;
break;
default:
return;
}
Intent intent = new Intent(c, WearableService.class);
intent.setAction("sent_notification_to_wear");
intent.putExtra("ticket", t);
intent.putExtra("status", status);
c.startService(intent);
Intent i = new Intent(c, MainActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.putExtra(MainActivity.EXTRA_TICKET_ID, t.getId());
PendingIntent openIntent = PendingIntent.getActivity(c, t.getNotificationId(), i, PendingIntent.FLAG_CANCEL_CURRENT);
Intent i2 = new Intent(c, MainActivity.class);
i2.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
i2.putExtra(MainActivity.EXTRA_TICKET_ID, t.getId());
i2.putExtra(MainActivity.EXTRA_SHOW_SMS, true);
PendingIntent showSmsIntent = PendingIntent.getActivity(c, t.getNotificationId() + 1000, i2,
PendingIntent.FLAG_CANCEL_CURRENT);
List<Action> actions = new ArrayList<Action>();
actions.add(new Action(R.drawable.notification_show_sms, R.string.notif_show_sms, showSmsIntent));
List<String> rows = new ArrayList<String>();
rows.add(text);
rows.add(c.getString(R.string.tickets_valid_from) + ": " + FormatUtil.formatDateTime(t.getValidFrom()));
rows.add(c.getString(R.string.tickets_code) + ": " + t.getHash());
fireNotification(c, t.getNotificationId(), openIntent, c.getString(R.string
.application_name), text, rows, t.getCity(), ticker, smallIcon, largeIcon, actions, keepNotification);
}
/**
* Verification if tickets is bought 1 minute after another.
*/
public static void notifyVerification(Context c, City city) {
Intent i = new Intent(c, MainActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.putExtra(MainActivity.EXTRA_REALLY_BUY_CITY_ID, city.id);
PendingIntent contentIntent = PendingIntent.getActivity(c, NOTIFICATION_VERIFY, i, PendingIntent.FLAG_CANCEL_CURRENT);
String title = c.getString(R.string.cities_ticket_bought_again_verification);
String text = c.getString(R.string.cities_ticket_bought_again_action);
fireNotification(c, NOTIFICATION_VERIFY, contentIntent, title, text, null, null, title,
R.drawable.notification_small_warning,
R.drawable.notification_big_warning, null, false);
}
public static void notifyMessage(Context c, String message) {
Intent i = new Intent(c, MainActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.putExtra(MainActivity.EXTRA_MESSAGE, message);
PendingIntent contentIntent = PendingIntent.getActivity(c, NOTIFICATION_MESSAGE, i,
PendingIntent.FLAG_CANCEL_CURRENT);
String title = c.getString(R.string.application_name);
String text = message;
fireNotification(c, NOTIFICATION_VERIFY, contentIntent, title, text, null, null, title,
R.drawable.notification_small_ready,
R.drawable.notification_big_ready, null, false);
Preferences.set(c, Preferences.MESSAGE_READ, false);
}
private static void fireNotification(Context c, int notificationId, PendingIntent contentIntent,
String title, String text,
List<String> rows, String summary, String ticker, int smallIcon,
int largeIcon,
List<Action> actions, boolean keepNotification) {
int defaults = Notification.DEFAULT_LIGHTS;
if (Preferences.getBoolean(c, Preferences.NOTIFICATION_VIBRATE, true)) {
defaults |= Notification.DEFAULT_VIBRATE;
}
NotificationCompat.Builder builder = new NotificationCompat.Builder(c).setContentTitle(title).setSmallIcon
(smallIcon).setLargeIcon(BitmapFactory.decodeResource(c.getResources(), largeIcon))
.setTicker(ticker).setContentText(text)
.setLocalOnly(true)
.setContentIntent(contentIntent).setWhen(System.currentTimeMillis()).setAutoCancel(!keepNotification)
.setDefaults
(defaults);
String soundUri = Preferences.getString(c, Preferences.NOTIFICATION_RINGTONE, null);
if (!TextUtils.isEmpty(soundUri)) {
builder.setSound(Uri.parse(soundUri));
}
if (actions != null) {
for (Action action : actions) {
builder.addAction(action.drawable, c.getString(action.text), action.intent);
}
}
Notification notification;
if (rows == null) {
notification = builder.build();
} else {
NotificationCompat.InboxStyle styled = new NotificationCompat.InboxStyle(builder);
for (String row : rows) {
styled.addLine(row);
}
styled.setSummaryText(summary);
notification = styled.build();
}
NotificationManager nm = (NotificationManager)c.getSystemService(Context.NOTIFICATION_SERVICE);
if (nm == null) {
DebugLog.e("Cannot obtain notification manager");
return;
}
nm.notify(notificationId, notification);
}
static class Action {
public int drawable;
public int text;
public PendingIntent intent;
Action(int drawable, int text, PendingIntent intent) {
this.drawable = drawable;
this.text = text;
this.intent = intent;
}
}
}
|
juanpabloprado/sms-ticket
|
mobile/src/main/java/eu/inmite/apps/smsjizdenka/util/NotificationUtil.java
|
Java
|
apache-2.0
| 9,378
|
# Crotalaria jamesii Oliv. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Crotalaria/Crotalaria jamesii/README.md
|
Markdown
|
apache-2.0
| 174
|
#ifndef MUTEX_H_
#define MUTEX_H_
#include <pthread.h>
namespace PThread {
/**
* @brief Clase para manejar los mutex de POSIX threads. Tiene una interfaz muy
* simple, con los métodos básicos y solo se manejan mutex creados con los
* atributos por defecto
*/
class Mutex {
public:
/**
* @brief Instancia un mutex con los atributos por defecto
*/
Mutex();
/**
* @brief Método para bloquear el mutex e impedir a otros threads acceder a
* código salvaguardado por el mismo mutex hasta que sea liberado
* @pre El hilo actual no está en posesión del mutex (no lo bloqueó)
* @post Si el mutex se encuentra liberado, el hilo actual se apropia del
* mismo y lo bloquea. Si ya se encontraba bloqueado, el hilo queda a la
* espera de que se le pueda asignar el mutex
* @return <tt>true</tt> si no hay errores al intentar tomar el mutex
* @return <tt>false</tt> si el hilo ya está en posesión del mutex antes
* del llamado al método
*/
bool bloquear();
/**
* @brief Método para intentar bloquear el mutex e impedir a otros threads
* acceder a código salvaguardado por el mismo mutex hasta que sea liberado
* @post Si el mutex se encuentra liberado, el hilo actual se apropia del
* mismo y lo bloquea. Si ya se encontraba bloqueado, se retorna false y
* el hilo actual sigue su ejecución
* @return <tt>true</tt> si se logra bloquear el mutex
* @return <tt>false</tt> si el mutex se encontraba ya bloqueado
*/
bool intentarBloquear();
/**
* @brief Método para liberar el mutex por parte del hilo en ejecución
* @pre El hilo actual debe estar en posesión del mutex
* @post Si el mutex se encuentra bloqueado por el hilo en ejecución, se
* libera
* @return <tt>true</tt> si se libera mutex
* @return <tt>false</tt> si el hilo no estaba en posesión del mutex o el
* mutex ya estaba liberado
*/
bool desbloquear();
/**
* @brief Hace esperar al thread en ejecución hasta que reciba la señal
* enviada por Mutex::signal
* @post El thread en ejecución se bloquea hasta recibir la señal de
* desbloqueo
*/
void wait();
/**
* @brief Método que envía una señal al los threads que están bloqueados
* por el método Mutex::wait, avisándoles que se desbloqueen
* @post Los threads que se encuentran en espera por el método Mutex::wait
* se desbloquean y continuan su ejecución
*/
void signal();
/**
* @brief Libera los recursos
* @pre Mutex no se encuentra bloqueado
*/
~Mutex();
private:
pthread_mutex_t mutex;
pthread_cond_t condVar;
public:
/**
* @brief Clase que implementa el patrón RAII para la clase Mutex
*/
class Lock {
public:
/**
* @brief Construye un Lock bloqueando el mutex
* @param mutex Mutex a bloquear
*/
explicit Lock(Mutex &mutex);
/**
* @brief Destruye el Lock desbloqueando el mutex
*/
~Lock();
private:
Mutex &_mutex;
};
};
}
#endif
|
mlucero88/Fwk_Cliente_Servidor
|
Pthread/src/Mutex.h
|
C
|
apache-2.0
| 2,917
|
/*******************************************************************************
* Copyright 2006 - 2012 Vienna University of Technology,
* Department of Software Technology and Interactive Systems, IFS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, softwareBecker
* 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 eu.scape_project.planning.xml;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.io.Writer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import org.apache.commons.codec.binary.Base64InputStream;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.output.WriterOutputStream;
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.XPath;
import org.dom4j.io.DocumentSource;
import org.slf4j.Logger;
import eu.scape_project.planning.exception.PlanningException;
import eu.scape_project.planning.manager.DigitalObjectManager;
import eu.scape_project.planning.manager.StorageException;
import eu.scape_project.planning.model.DigitalObject;
import eu.scape_project.planning.model.Plan;
import eu.scape_project.planning.model.PlanProperties;
import eu.scape_project.planning.utils.FileUtils;
import eu.scape_project.planning.utils.OS;
/**
* This class provides methods to export plans from the database to their XML representation.
*
* @author Christoph Becker
*/
public class ProjectExportAction implements Serializable {
private static final long serialVersionUID = 2155152208617526555L;
/**
* Boundary of data to load before calling the garbage collector.
*/
private static final int LOADED_DATA_SIZE_BOUNDARY = 200 * 1024 * 1024;
@Inject
private Logger log;
@Inject
private EntityManager em;
@Inject
protected DigitalObjectManager digitalObjectManager;
private String lastProjectExportPath;
public ProjectExportAction() {
lastProjectExportPath = null;
}
/**
* Exports all projects into separate xml files and adds them to a zip
* archive.
*
* @return True if export was successful, false otherwise.
*/
public boolean exportAllProjectsToZip() {
@SuppressWarnings("unchecked")
List<PlanProperties> ppList = em.createQuery("select p from PlanProperties p order by p.id").getResultList();
return exportPPListToZip(ppList);
}
/**
* Exports all plans where the {@link PlanProperties#getId()} is in the given range [fromID, toID] (inclusive)
* and adds them to a zip archive
*
* @param fromID
* from-ID in table PlanProperties, which is used to filter
* PlanProperties
* @param toID
* to-ID in table PlanProperties, which is used to filter
* PlanProperties
* @return True if export was successful, false otherwise.
*/
public boolean exportSomeProjectsToZip(int fromID, int toID) {
@SuppressWarnings("unchecked")
List<PlanProperties> ppList = em.createQuery(
"select p.planProperties from Plan p where " + " p.planProperties.id >= :fromID "
+ " and p.planProperties.id <= :toID order by p.planProperties.id")
.setParameter("fromID", fromID)
.setParameter("toID", toID)
.getResultList();
return exportPPListToZip(ppList);
}
/**
* Exports the project identified by PlanProperties.Id ppid and writes the
* document to the given OutputStream - including all binary data.
* (currently required by {@link #exportAllProjectsToZip()} ) - Does NOT
* clean up temp files written to baseTempPath
*
* @param ppid
* @param out
* @param baseTempPath
* used to write temp files for binary data, must not be used by
* other exports at the same time
* @return True if export was successful, false otherwise.
*/
public boolean exportComplete(int ppid, OutputStream out, String baseTempPath) {
ProjectExporter exporter = new ProjectExporter();
Document doc = exporter.createProjectDoc();
Plan plan = null;
try {
plan = em.createQuery("select p from Plan p where p.planProperties.id = :ppid ", Plan.class)
.setParameter("ppid", ppid)
.getSingleResult();
} catch (Exception e) {
log.error("Could not load planProperties: ", e);
log.debug("Skipping the export of the plan with properties " + ppid + ": Couldnt load.");
return false;
}
try {
String tempPath = baseTempPath;
File tempDir = new File(tempPath);
tempDir.mkdirs();
try {
exporter.addProject(plan, doc, false);
// Perform XSLT transformation to get the DATA into the PLANS
// Prepare base 64 encoded binary data
List<Integer> binaryObjectIds = getBinaryObjectIds(doc);
writeBinaryObjects(binaryObjectIds, tempPath);
// Prepare preservation action plan
List<Integer> preservationActionPlanIDs = getPreservationActionPlanIds(doc);
writeDigitalObjects(preservationActionPlanIDs, tempPath);
// Call XSLT
addBinaryData(doc, out, tempPath);
} catch (IOException e) {
log.error("Could not open outputstream.", e);
return false;
} catch (TransformerException e) {
log.error("failed to generate export file.", e);
return false;
} catch (StorageException e) {
log.error("Could not load object from stoarge.", e);
return false;
} catch (PlanningException e) {
log.error("Could not export plan.", e);
return false;
}
} finally {
// Clean up
plan = null;
em.clear();
System.gc();
}
return true;
}
/**
* Returns a list of object IDs that are stored in the document without
* binary data.
*
* @param doc
* the document to search
* @return a list of IDs
*/
private List<Integer> getBinaryObjectIds(Document doc) {
// Get data elements that have data and a number as content
XPath xpath = doc.createXPath("//plato:data[@hasData='true' and number(.) = number(.)]");
Map<String, String> namespaceMap = new HashMap<String, String>();
namespaceMap.put("plato", PlanXMLConstants.PLATO_NS);
xpath.setNamespaceURIs(namespaceMap);
@SuppressWarnings("unchecked")
List<Element> elements = xpath.selectNodes(doc);
List<Integer> objectIds = new ArrayList<Integer>(elements.size());
for (Element element : elements) {
objectIds.add(Integer.parseInt(element.getStringValue()));
}
return objectIds;
}
/**
* Returns the collection profile IDs that are in the document without data.
*
* @param doc
* the docuemnt to seasrch
* @return a list of IDs
*/
private List<Integer> getPreservationActionPlanIds(Document doc) {
// Get data elements that have data and a number as content
XPath xpath = doc.createXPath("//plato:preservationActionPlan[number(.) = number(.)]");
Map<String, String> namespaceMap = new HashMap<String, String>();
namespaceMap.put("plato", PlanXMLConstants.PLATO_NS);
xpath.setNamespaceURIs(namespaceMap);
@SuppressWarnings("unchecked")
List<Element> elements = xpath.selectNodes(doc);
List<Integer> objectIds = new ArrayList<Integer>(elements.size());
for (Element element : elements) {
objectIds.add(Integer.parseInt(element.getStringValue()));
}
return objectIds;
}
/**
* Writes the digital objects of the provided objectIds to the tempDir as
* files.
*
* @param objectIds
* the IDs of the objects to write
* @param tempDir
* a temporary directory where the files will be written
* @throws IOException
* if an error occurred during write
* @throws StorageException
* if the objects could not be loaded
*/
private void writeDigitalObjects(List<Integer> objectIds, String tempDir) throws IOException, StorageException {
int counter = 0;
int skip = 0;
log.info("Writing bytestreams of digital objects. Size = " + objectIds.size());
for (Integer id : objectIds) {
if (counter > LOADED_DATA_SIZE_BOUNDARY) { // Call GC if unused data
// exceeds boundary
System.gc();
counter = 0;
}
DigitalObject object = em.find(DigitalObject.class, id);
if (object.isDataExistent()) {
counter += object.getData().getSize();
File f = new File(tempDir + object.getId() + ".xml");
DigitalObject dataFilledObject = digitalObjectManager.getCopyOfDataFilledDigitalObject(object);
FileOutputStream out = new FileOutputStream(f);
try {
out.write(dataFilledObject.getData().getData());
} finally {
out.close();
}
dataFilledObject = null;
} else {
skip++;
}
object = null;
}
em.clear();
System.gc();
log.info("Finished writing bytestreams of digital objects. Skipped empty objects: " + skip);
}
/**
* new helper method that was refactored from
* {@link #exportAllProjectsToZip()} It takes a list of
* {@link PlanProperties} and exports it to a zip file.
*
* @param ppList
* {@link PlanProperties} for plans to export
*
* @return True if export was successful, false otherwise.
*/
private boolean exportPPListToZip(List<PlanProperties> ppList) {
if (!ppList.isEmpty()) {
log.debug("number of plans to export: " + ppList.size());
String filename = "allprojects.zip";
lastProjectExportPath = OS.getTmpPath() + "export" + System.currentTimeMillis() + "/";
new File(lastProjectExportPath).mkdirs();
String binarydataTempPath = lastProjectExportPath + "binarydata/";
File binarydataTempDir = new File(binarydataTempPath);
binarydataTempDir.mkdirs();
try {
OutputStream out = new BufferedOutputStream(new FileOutputStream(lastProjectExportPath + filename));
ZipOutputStream zipOut = new ZipOutputStream(out);
for (PlanProperties pp : ppList) {
log.debug("EXPORTING: " + pp.getName());
ZipEntry zipAdd = new ZipEntry(String.format("%1$03d", pp.getId()) + "-"
+ FileUtils.makeFilename(pp.getName()) + ".xml");
zipOut.putNextEntry(zipAdd);
// export the complete project, including binary data
exportComplete(pp.getId(), zipOut, binarydataTempPath);
zipOut.closeEntry();
}
zipOut.close();
out.close();
new File(lastProjectExportPath + "finished.info").createNewFile();
// FacesMessages.instance().add(FacesMessage.SEVERITY_INFO,
// "Export was written to: " + exportPath);
log.info("Export was written to: " + lastProjectExportPath);
} catch (IOException e) {
// FacesMessages.instance().add(FacesMessage.SEVERITY_ERROR,
// "An error occured while generating the export file.");
log.error("An error occured while generating the export file.", e);
File errorInfo = new File(lastProjectExportPath + "error.info");
try {
Writer w = new FileWriter(errorInfo);
w.write("An error occured while generating the export file:");
w.write(e.getMessage());
w.close();
} catch (IOException e1) {
log.error("Could not write error file.");
}
return false;
} finally {
// remove all binary temp files
OS.deleteDirectory(binarydataTempDir);
}
}
return true;
}
/**
* Performs XSLT transformation to get the data into the plans.
*
* @param doc
* the plan document
* @param out
* output stream to write the transformed plan XML
* @param tempDir
* temporary directory where the data files are located
* @throws TransformerException
* if an error occured during transformation
*/
private void addBinaryData(Document doc, OutputStream out, String tempDir) throws TransformerException {
InputStream xsl = Thread.currentThread().getContextClassLoader()
.getResourceAsStream("data/xslt/bytestreams.xsl");
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer(new StreamSource(xsl));
transformer.setParameter("tempDir", tempDir);
Source xmlSource = new DocumentSource(doc);
Result outputTarget = new StreamResult(out); // new
// FileWriter(outFile));
log.debug("starting bytestream transformation ...");
transformer.transform(xmlSource, outputTarget);
log.debug("FINISHED bytestream transformation!");
}
/**
* Loads all binary data for the given digital objects and dumps it to XML
* files, located in tempDir.
*
* @param objectIds
* @param tempDir
* @param encoder
* @throws IOException
* @throws StorageException
*/
private void writeBinaryObjects(List<Integer> objectIds, String aTempDir)
throws IOException, StorageException {
int counter = 0;
int skip = 0;
log.info("writing XMLs for bytestreams of digital objects. count = " + objectIds.size());
for (Integer id : objectIds) {
if (counter > LOADED_DATA_SIZE_BOUNDARY) { // Call GC if unused data
// exceeds boundary
System.gc();
counter = 0;
}
DigitalObject object = em.find(DigitalObject.class, id);
if (object.isDataExistent()) {
counter += object.getData().getSize();
File f = new File(aTempDir + object.getId() + ".xml");
DigitalObject dataFilledObject = null;
dataFilledObject = digitalObjectManager.getCopyOfDataFilledDigitalObject(object);
writeBinaryData(id, new ByteArrayInputStream(dataFilledObject.getData().getData()), f);
dataFilledObject = null;
} else {
skip++;
}
object = null;
}
em.clear();
System.gc();
log.info("Finished writing bytestreams of digital objects. Skipped empty objects: " + skip);
}
/**
* Dumps binary data to provided file. It results in an XML file with a
* single element: data.
*
* @param id
* @param data
* @param f
* @param encoder
* @throws IOException
*/
private static void writeBinaryData(int id, InputStream data, File f) throws IOException {
XMLOutputFactory factory = XMLOutputFactory.newInstance();
try {
XMLStreamWriter writer = factory.createXMLStreamWriter(new FileWriter(f));
writer.writeStartDocument(PlanXMLConstants.ENCODING,"1.0");
writer.writeStartElement("data");
writer.writeAttribute("id", "" + id);
Base64InputStream base64EncodingIn = new Base64InputStream( data, true, PlanXMLConstants.BASE64_LINE_LENGTH, PlanXMLConstants.BASE64_LINE_BREAK);
OutputStream out = new WriterOutputStream(new XMLStreamContentWriter(writer) , PlanXMLConstants.ENCODING);
// read the binary data and encode it on the fly
IOUtils.copy(base64EncodingIn, out);
out.flush();
// all data is written - end
writer.writeEndElement();
writer.writeEndDocument();
writer.flush();
writer.close();
} catch (XMLStreamException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
// -------- getter/setter --------
public String getLastProjectExportPath() {
return lastProjectExportPath;
}
public void setLastProjectExportPath(String lastProjectExportPath) {
this.lastProjectExportPath = lastProjectExportPath;
}
// /**
// * Adds all enlisted plans to an XML document, but does NOT write binary
// data.
// * Instead the Id's of all referenced uploads and sample records are added
// to the provided lists,
// * this way they can be added later.
// *
// * @param ppids
// * @param uploadIDs
// * @param recordIDs
// * @return
// */
// public Document exportToXml(List<Integer> ppids, List<Integer> uploadIDs,
// List<Integer> recordIDs) {
// ProjectExporter exporter = new ProjectExporter();
// Document doc = exporter.createProjectDoc();
//
// int i = 0;
// for (Integer id: ppids) {
// // load one plan after the other:
// List<Plan> list = em.createQuery(
// "select p from Plan p where p.planProperties.id = "
// + id).getResultList();
// if (list.size() != 1) {
// FacesMessages.instance().add(FacesMessage.SEVERITY_ERROR,
// "Skipping the export of the plan with properties"+id+": Couldnt load.");
// } else {
// //log.debug("adding project "+p.getplanProperties().getName()+" to XML...");
// exporter.addProject(list.get(0), doc, uploadIDs, recordIDs);
// }
// list.clear();
// list = null;
//
// log.info("XMLExport: addString destinationed project ppid="+id);
// i++;
// if ((i%10==0)) {
// em.clear();
// System.gc();
// }
// }
// return doc;
// }
}
|
openpreserve/plato
|
planning-core/src/main/java/eu/scape_project/planning/xml/ProjectExportAction.java
|
Java
|
apache-2.0
| 20,075
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package fr.penet.dao;
import java.io.Serializable;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import lombok.Cleanup;
import lombok.Data;
import lombok.experimental.Builder;
import lombok.extern.java.Log;
/**
*
* @author lpenet
*/
@Builder
@Data
@Log
public class CrawlWordPage implements Serializable {
int id;
String word;
int page;
public int insert(Connection conn) throws SQLException {
@Cleanup
PreparedStatement insertLink = conn.prepareStatement(
"INSERT INTO crawl.word_pages (word,page) "
+ "VALUES (?, ?)", Statement.RETURN_GENERATED_KEYS);
insertLink.setString(1, word);
insertLink.setInt(2, page);
insertLink.executeUpdate();
@Cleanup
ResultSet generatedKeys = insertLink.getGeneratedKeys();
generatedKeys.next();
id = generatedKeys.getInt(1);
return id;
}
public void update(Connection conn) throws SQLException {
@Cleanup
PreparedStatement updateLink = conn.prepareStatement(
"UPDATE crawl.word_pages set word=?, page = ? "
+ " WHERE id = ?");
updateLink.setString(1, word);
updateLink.setInt(2, page);
updateLink.setInt(3, id);
updateLink.executeUpdate();
}
public void delete(Connection conn) throws SQLException {
@Cleanup
PreparedStatement deleteLink = conn.prepareStatement(
"DELETE FROM crawl.word_pages WHERE id = ?");
deleteLink.setInt(1, id);
deleteLink.execute();
}
public static CrawlWordPage getById(Connection conn, int id) throws SQLException {
@Cleanup
PreparedStatement stmtGet = conn.prepareStatement("SELECT word,page FROM crawl.page_words WHERE id=?");
stmtGet.setInt(1, id);
ResultSet rsFetched = stmtGet.executeQuery();
if(!rsFetched.next()) {
return null;
}
return CrawlWordPage.builder()
.id(id)
.word(rsFetched.getString(1))
.page(rsFetched.getInt(2))
.build();
}
}
|
lpenet/appengine-crawl-mapreduce-test
|
crawldb/src/main/java/fr/penet/dao/CrawlWordPage.java
|
Java
|
apache-2.0
| 2,448
|
package org.openestate.is24.restapi.xml.common;
import javax.annotation.Generated;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for MarketingType.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* <simpleType name="MarketingType">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="PURCHASE"/>
* <enumeration value="PURCHASE_PER_SQM"/>
* <enumeration value="RENT"/>
* <enumeration value="RENT_PER_SQM"/>
* <enumeration value="LEASE"/>
* <enumeration value="LEASEHOLD"/>
* <enumeration value="BUDGET_RENT"/>
* <enumeration value="RENT_AND_BUY"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "MarketingType")
@XmlEnum
@Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T09:44:49+02:00", comments = "JAXB RI v2.3.0")
public enum MarketingType {
/**
* Kauf
*
*/
PURCHASE,
/**
* Kauf pro Quadratmeter
*
*/
PURCHASE_PER_SQM,
/**
* Miete
*
*/
RENT,
/**
* Miete pro Quadratmeter
*
*/
RENT_PER_SQM,
/**
* Pacht
*
*/
LEASE,
/**
* Erbpacht
*
*/
LEASEHOLD,
/**
* Gesamtmiete aus allen verf\u00fcgbaren Miet-Informationen zum
* Vergleich zu einem gegebenen Monatsbudget
*
*
*/
BUDGET_RENT,
/**
* Miete und Kauf
*
*/
RENT_AND_BUY;
public String value() {
return name();
}
public static MarketingType fromValue(String v) {
return valueOf(v);
}
}
|
OpenEstate/OpenEstate-IS24-REST
|
Core/src/main/jaxb/org/openestate/is24/restapi/xml/common/MarketingType.java
|
Java
|
apache-2.0
| 1,845
|
package apple.phase;
import apple.NSObject;
import apple.avfaudio.AVAudioChannelLayout;
import apple.avfaudio.AVAudioFormat;
import apple.foundation.NSArray;
import apple.foundation.NSData;
import apple.foundation.NSDictionary;
import apple.foundation.NSError;
import apple.foundation.NSMethodSignature;
import apple.foundation.NSSet;
import apple.foundation.NSURL;
import org.moe.natj.c.ann.FunctionPtr;
import org.moe.natj.general.NatJ;
import org.moe.natj.general.Pointer;
import org.moe.natj.general.ann.Generated;
import org.moe.natj.general.ann.Library;
import org.moe.natj.general.ann.Mapped;
import org.moe.natj.general.ann.NInt;
import org.moe.natj.general.ann.NUInt;
import org.moe.natj.general.ann.Owned;
import org.moe.natj.general.ann.ReferenceInfo;
import org.moe.natj.general.ann.Runtime;
import org.moe.natj.general.ptr.Ptr;
import org.moe.natj.general.ptr.VoidPtr;
import org.moe.natj.objc.Class;
import org.moe.natj.objc.ObjCRuntime;
import org.moe.natj.objc.SEL;
import org.moe.natj.objc.ann.ObjCBlock;
import org.moe.natj.objc.ann.ObjCClassBinding;
import org.moe.natj.objc.ann.Selector;
import org.moe.natj.objc.map.ObjCObjectMapper;
/**
* [@interface] PHASEAssetRegistry
* <p>
* Asset registry
*/
@Generated
@Library("PHASE")
@Runtime(ObjCRuntime.class)
@ObjCClassBinding
public class PHASEAssetRegistry extends NSObject {
static {
NatJ.register();
}
@Generated
protected PHASEAssetRegistry(Pointer peer) {
super(peer);
}
@Generated
@Selector("accessInstanceVariablesDirectly")
public static native boolean accessInstanceVariablesDirectly();
@Generated
@Owned
@Selector("alloc")
public static native PHASEAssetRegistry alloc();
@Owned
@Generated
@Selector("allocWithZone:")
public static native PHASEAssetRegistry allocWithZone(VoidPtr zone);
/**
* assetForIdentifier
* <p>
* Finds an asset in the asset registry, given an identifier.
*
* @param identifier The identifier of this asset
* @return A PHASEAsset object, or nil if one could not be found.
*/
@Generated
@Selector("assetForIdentifier:")
public native PHASEAsset assetForIdentifier(String identifier);
@Generated
@Selector("automaticallyNotifiesObserversForKey:")
public static native boolean automaticallyNotifiesObserversForKey(String key);
@Generated
@Selector("cancelPreviousPerformRequestsWithTarget:")
public static native void cancelPreviousPerformRequestsWithTarget(@Mapped(ObjCObjectMapper.class) Object aTarget);
@Generated
@Selector("cancelPreviousPerformRequestsWithTarget:selector:object:")
public static native void cancelPreviousPerformRequestsWithTargetSelectorObject(
@Mapped(ObjCObjectMapper.class) Object aTarget, SEL aSelector,
@Mapped(ObjCObjectMapper.class) Object anArgument);
@Generated
@Selector("classFallbacksForKeyedArchiver")
public static native NSArray<String> classFallbacksForKeyedArchiver();
@Generated
@Selector("classForKeyedUnarchiver")
public static native Class classForKeyedUnarchiver();
@Generated
@Selector("debugDescription")
public static native String debugDescription_static();
@Generated
@Selector("description")
public static native String description_static();
/**
* [@property] globalMetaParameters
* <p>
* A dictionary of global metaparameters
*/
@Generated
@Selector("globalMetaParameters")
public native NSDictionary<String, ? extends PHASEMetaParameter> globalMetaParameters();
@Generated
@Selector("hash")
@NUInt
public static native long hash_static();
@Generated
@Selector("init")
public native PHASEAssetRegistry init();
@Generated
@Selector("instanceMethodForSelector:")
@FunctionPtr(name = "call_instanceMethodForSelector_ret")
public static native NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(SEL aSelector);
@Generated
@Selector("instanceMethodSignatureForSelector:")
public static native NSMethodSignature instanceMethodSignatureForSelector(SEL aSelector);
@Generated
@Selector("instancesRespondToSelector:")
public static native boolean instancesRespondToSelector(SEL aSelector);
@Generated
@Selector("isSubclassOfClass:")
public static native boolean isSubclassOfClass(Class aClass);
@Generated
@Selector("keyPathsForValuesAffectingValueForKey:")
public static native NSSet<String> keyPathsForValuesAffectingValueForKey(String key);
@Generated
@Owned
@Selector("new")
public static native PHASEAssetRegistry new_objc();
/**
* registerGlobalMetaParameter:error
* <p>
* Register a global metaparameter with the asset registry.
* [@note]
* This function is synchronous and thread-safe.
* Clients can safely run this function to register multiple global metaparameters from multiple threads, if required.
*
* @param metaParameterDefinition The metaparameter object to register.
* @param error The error object in case of an error.
* @return A PHASEGlobalMetaParameterAsset object.
*/
@Generated
@Selector("registerGlobalMetaParameter:error:")
public native PHASEGlobalMetaParameterAsset registerGlobalMetaParameterError(
PHASEMetaParameterDefinition metaParameterDefinition,
@ReferenceInfo(type = NSError.class) Ptr<NSError> error);
/**
* registerSoundAssetAtURL:identifier:assetType:channelLayout:normalizationMode:error
* <p>
* Register an audio file as a sound asset in the system.
* [@note]
* This function is synchronous and thread-safe.
* Clients can safely run this function to register multiple sound assets from multiple threads, if required.
*
* @param url The URL of the audio file.
* @param identifier An identifier that uniquely represents this sound event asset. Nil generates an automatic identifier.
* @param assetType The asset type for this sound asset.
* @param channelLayout The audio channel layout for this sound asset.
* If a valid channel layout definition is read from the file being registered, this will override it.
* If nil is passed as a value for this property, the file must either be mono or stereo, or already contain a vaild channel layout definition.
* This channel layout must have the same channel count as the audio file being loaded.
* @param normalizationMode The normalization mode.
* @param error The error object in case of an error
* @return A PHASESoundAsset object
*/
@Generated
@Selector("registerSoundAssetAtURL:identifier:assetType:channelLayout:normalizationMode:error:")
public native PHASESoundAsset registerSoundAssetAtURLIdentifierAssetTypeChannelLayoutNormalizationModeError(
NSURL url, String identifier, @NInt long assetType, AVAudioChannelLayout channelLayout,
@NInt long normalizationMode, @ReferenceInfo(type = NSError.class) Ptr<NSError> error);
/**
* registerSoundAssetWithData:identifier:format:normalizationMode:error
* <p>
* Register audio data as a sound asset in the system.
* [@note]
* This function is synchronous and thread-safe.
* Clients can safely run this function to register multiple sound assets from multiple threads, if required.
*
* @param data A buffer containing the audio data to register as a sound asset.
* Audio data must either be a single PCM buffer of interleaved channels or multiple deinterleaved PCM buffers per channel packed back to back.
* @param identifier The identifier to assign to this sound asset. Nil generates an automatic identifier.
* @param format The AVAudioFormat object that describes the audio data in the buffer.
* @param normalizationMode The normalization mode.
* @param error The error object in case of an error.
* @return A PHASESoundAsset object.
*/
@Generated
@Selector("registerSoundAssetWithData:identifier:format:normalizationMode:error:")
public native PHASESoundAsset registerSoundAssetWithDataIdentifierFormatNormalizationModeError(NSData data,
String identifier, AVAudioFormat format, @NInt long normalizationMode,
@ReferenceInfo(type = NSError.class) Ptr<NSError> error);
/**
* registerSoundEventAssetWithRootNode:identifier:error
* <p>
* Register a sound event asset with the asset registry.
* [@note]
* This function is synchronous and thread-safe.
* Clients can safely run this function to register multiple sound event assets from multiple threads, if required.
*
* @param rootNode The root node of the sound event asset to register.
* @param identifier An identifier that uniquely represents this sound event asset. Nil generates an automatic identifier.
* @param error The error object in case of an error
* @return A PHASESoundEventNodeAsset object
*/
@Generated
@Selector("registerSoundEventAssetWithRootNode:identifier:error:")
public native PHASESoundEventNodeAsset registerSoundEventAssetWithRootNodeIdentifierError(
PHASESoundEventNodeDefinition rootNode, String identifier,
@ReferenceInfo(type = NSError.class) Ptr<NSError> error);
@Generated
@Selector("resolveClassMethod:")
public static native boolean resolveClassMethod(SEL sel);
@Generated
@Selector("resolveInstanceMethod:")
public static native boolean resolveInstanceMethod(SEL sel);
@Generated
@Selector("setVersion:")
public static native void setVersion_static(@NInt long aVersion);
@Generated
@Selector("superclass")
public static native Class superclass_static();
/**
* unregisterAssetWithIdentifier:completion:
* <p>
* Unregister and unload an asset.
*
* @param identifier The identifier of the PHASEAsset object to unregister
* @param handler An optional completion block that will be called when the asset has been unregistered.
* Once you receive this callback, it's safe to deallocate external resources, if applicable.
*/
@Generated
@Selector("unregisterAssetWithIdentifier:completion:")
public native void unregisterAssetWithIdentifierCompletion(String identifier,
@ObjCBlock(name = "call_unregisterAssetWithIdentifierCompletion") Block_unregisterAssetWithIdentifierCompletion handler);
@Runtime(ObjCRuntime.class)
@Generated
public interface Block_unregisterAssetWithIdentifierCompletion {
@Generated
void call_unregisterAssetWithIdentifierCompletion(boolean success);
}
@Generated
@Selector("version")
@NInt
public static native long version_static();
}
|
multi-os-engine/moe-core
|
moe.apple/moe.platform.ios/src/main/java/apple/phase/PHASEAssetRegistry.java
|
Java
|
apache-2.0
| 11,097
|
package info.spielproject.spiel
import collection.JavaConversions._
import android.os.Build.VERSION
import android.util.Log
import android.view.accessibility.AccessibilityEvent
class RichEvent(e:AccessibilityEvent) {
lazy val records =
(for(r <- 0 to e.getRecordCount-1)
yield(e.getRecord(r))
).toList
lazy val text =
Option(e.getText).map(_.toList).getOrElse(Nil)
.filterNot(_ == null).map(_.toString)
lazy val contentDescription =
Option(e.getContentDescription).map(_.toString)
lazy val source = Option(e.getSource)
def utterances(addBlank:Boolean = true, stripBlanks:Boolean = false, guessLabelIfTextMissing:Boolean = false, guessLabelIfContentDescriptionMissing:Boolean = false, guessLabelIfTextShorterThan:Option[Int] = None, providedText:Option[String] = None):List[String] = {
var rv = List[String]()
val t = text.filterNot(_ == null).mkString("\n") match {
case "" => List()
case v => v.split("\n").toList
}
val txt:List[String] = if(stripBlanks)
t.filterNot(_.trim.length == 0)
else t
var blankAdded = false
providedText.map(rv ::= _).getOrElse {
if(txt.size == 0 && e.getContentDescription == null && addBlank) {
blankAdded = true
rv ::= ""
}
}
rv :::= txt
contentDescription.foreach { c =>
if(c != "" && rv.distinct != List(c))
rv ::= c
}
def removeBlank() = if(blankAdded) rv = rv.tail
if(guessLabelIfTextMissing && e.getText.length == 0)
rv :::= source.flatMap(_.label).map(_.getText.toString).map { v =>
removeBlank()
List(v)
}.getOrElse(Nil)
else if(guessLabelIfContentDescriptionMissing && e.getContentDescription == null)
rv :::= source.flatMap(_.label).map(_.getText.toString).map { v =>
removeBlank()
List(v)
}.getOrElse(Nil)
else guessLabelIfTextShorterThan.foreach { v =>
if(VERSION.SDK_INT >= 16 || text.length < v)
rv :::= source.flatMap(_.label).map(_.getText.toString).map { v =>
removeBlank()
List(v)
}.getOrElse(Nil)
}
rv
}
def utterances:List[String] = utterances()
}
|
bramd/spiel
|
src/main/scala/RichEvent.scala
|
Scala
|
apache-2.0
| 2,174
|
package scalan.collections
import java.lang.reflect.Method
import scala.annotation.unchecked.uncheckedVariance
import scalan._
import scalan.arrays.ArrayOps
import scalan.common.OverloadHack.Overloaded1
import scala.collection.mutable
import scala.annotation.tailrec
import scala.reflect.runtime.universe._
trait Collections { self: CollectionsDsl =>
type Coll[+Item] = Rep[Collection[Item]]
trait Collection[@uncheckedVariance +Item] extends Def[Collection[Item @uncheckedVariance]] {
implicit def eItem: Elem[Item @uncheckedVariance]
def length: Rep[Int]
def arr: Rep[Array[Item @uncheckedVariance]]
def lst: Rep[List[Item @uncheckedVariance]]
def seq: Rep[SSeq[Item] @uncheckedVariance] = SSeq(arr)
def apply(i: Rep[Int]): Rep[Item]
@OverloadId("many")
def apply(indices: Coll[Int])(implicit o: Overloaded1): Coll[Item]
def mapBy[B: Elem](f: Rep[Item => B @uncheckedVariance]): Coll[B] //= Collection(arr.mapBy(f))
def zip[B: Elem](ys: Coll[B]): PairColl[Item @uncheckedVariance, B] // = PairCollectionSOA(self, ys)
def slice(offset: Rep[Int], length: Rep[Int]): Coll[Item]
def reduce(implicit m: RepMonoid[Item @uncheckedVariance]): Rep[Item] //= arr.reduce(m)
def update (idx: Rep[Int], value: Rep[Item @uncheckedVariance]): Coll[Item]
def updateMany (idxs: Coll[Int], vals: Coll[Item @uncheckedVariance]): Coll[Item]
def indexes: Coll[Int] = Collection.indexRange(length)
def filterBy(f: Rep[Item @uncheckedVariance => Boolean]): Coll[Item]
def flatMapBy[B: Elem](f: Rep[Item @uncheckedVariance => Collection[B]]): Coll[B] // = Collection(arr.flatMap {in => f(in).arr} )
def append(value: Rep[Item @uncheckedVariance]): Coll[Item] // = Collection(arr.append(value))
def foldLeft[S: Elem](init: Rep[S], f: Rep[((S, Item)) => S]): Rep[S] = arr.fold(init, f)
def sortBy[O: Elem](by: Rep[Item => O])(implicit o: Ordering[O]): Coll[Item]
/*def scan(implicit m: RepMonoid[A @uncheckedVariance]): Rep[(Collection[A], A)] = {
val arrScan = arr.scan(m)
(Collection(arrScan._1), arrScan._2)
} */
}
def emptyColl[A: Elem]: Coll[A] = element[Collection[A]].defaultRepValue
type Segments1 = PairCollection[Int, Int]
trait CollectionCompanion extends TypeFamily1[Collection] with CollectionManager {
def manager: CollectionManager = this
def apply[T: Elem](arr: Rep[Array[T]]): Coll[T] = fromArray(arr)
def fromArray[T: Elem](arr: Rep[Array[T]]): Coll[T] = {
element[T] match {
case pairE: PairElem[a, b] =>
implicit val ea = pairE.eFst
implicit val eb = pairE.eSnd
val ps = arr.asRep[Array[(a, b)]]
val as = fromArray(ps.map { _._1 })
val bs = fromArray(ps.map { _._2 })
as zip bs //PairCollectionSOA[a,b](as, bs)
// TODO add cases for NestedCollectionFlat and View
// case viewE: ViewElem[a, b] =>
// CollectionOverArray[b](arr.asRep[Array[b]])
case e => CollectionOverArray(arr)
}
}
def fromList[T: Elem](arr: Rep[List[T]]): Coll[T] = {
element[T] match {
case baseE: BaseElem[a] =>
CollectionOverList[a](arr.asRep[List[a]])
case pairE: PairElem[a, b] =>
implicit val ea = pairE.eFst
implicit val eb = pairE.eSnd
val ps = arr.asRep[List[(a, b)]]
val as = fromList(ps.map { _._1 })
val bs = fromList(ps.map { _._2 })
as zip bs //PairCollectionSOA[a,b](as, bs)
case viewE: ViewElem[a, b] =>
// TODO
CollectionOverList[b](arr.asRep[List[b]])
case e => ???(s"Element is $e")
}
}
def replicate[T: Elem](len: Rep[Int], v: Rep[T]): Coll[T] = {
element[T] match {
case baseE: BaseElem[a] =>
CollectionOverArray[a](array_replicate(len, v.asRep[a]))
case pairElem: PairElem[a ,b] => {
implicit val ea = pairElem.eFst
implicit val eb = pairElem.eSnd
val ps = v.asRep[(a, b)]
val as = replicate(len, ps._1)
val bs = replicate(len, ps._2)
as zip bs
}
case viewElem: ViewElem[a, b] =>
CollectionOverArray(SArray.replicate(len, v))
case e => ???(s"Element is $e")
}
}
def empty[T: Elem]: Coll[T] = {
element[T] match {
case baseE: BaseElem[a] =>
CollectionOverArray[a](SArray.empty[T])
case pairElem: PairElem[a ,b] => {
implicit val ea = pairElem.eFst
implicit val eb = pairElem.eSnd
val as = empty[a]
val bs = empty[b]
as zip bs
}
case viewElem: ViewElem[a, b] =>
CollectionOverArray(SArray.empty[T])
case e => ???(s"Element is $e")
}
}
def singleton[T: Elem](v: Rep[T]): Coll[T] = {
element[T] match {
case paE: CollectionElem[_, _] => ???
case _ => replicate(toRep(1), v)
}
}
def indexRange(l: Rep[Int]): Coll[Int] = CollectionOverArray(array_rangeFrom0(l))
}
abstract class UnitCollection(val length: Rep[Int]) extends Collection[Unit] {
def eItem = UnitElement
def arr = SArray.replicate(length, ())
def lst = SList.replicate(length, ())
def apply(i: Rep[Int]) = ()
def mapBy[B: Elem](f: Rep[Unit => B @uncheckedVariance]): Coll[B] = Collection(arr.mapBy(f))
@OverloadId("many")
def apply(indices: Coll[Int])(implicit o: Overloaded1): Coll[Unit] = UnitCollection(indices.length)
def slice(offset: Rep[Int], length: Rep[Int]) = UnitCollection(length)
def reduce(implicit m: RepMonoid[Unit @uncheckedVariance]): Rep[Unit] = ()
def zip[B: Elem](ys: Coll[B]): PairColl[Unit, B] = PairCollectionSOA(self, ys)
def update (idx: Rep[Int], value: Rep[Unit]): Coll[Unit] = self
def updateMany (idxs: Coll[Int], vals: Coll[Unit]): Coll[Unit] = self
def filterBy(f: Rep[Unit => Boolean]): Coll[Unit] = Collection(arr.filterBy(f))
def flatMapBy[B: Elem](f: Rep[Unit => Collection[B]]): Coll[B] = Collection(arr.flatMap {in => f(in).arr} )
def append(value: Rep[Unit]): Coll[Unit] = Collection(arr.append(value))
def sortBy[O: Elem](by: Rep[Unit => O])(implicit o: Ordering[O]): Coll[Unit] = ???
}
trait UnitCollectionCompanion extends ConcreteClass0[UnitCollection]
abstract class CollectionOverArray[Item](val arr: Rep[Array[Item]])(implicit val eItem: Elem[Item]) extends Collection[Item] {
def lst = arr.toList
def length = arr.length
def apply(i: Rep[Int]) = arr(i)
def mapBy[B: Elem](f: Rep[Item => B @uncheckedVariance]): Coll[B] = Collection(arr.mapBy(f))
def slice(offset: Rep[Int], length: Rep[Int]) = {
val sl = arr.slice(offset, length)
CollectionOverArray(sl)
}
@OverloadId("many")
def apply(indices: Coll[Int])(implicit o: Overloaded1): Coll[Item] = CollectionOverArray(arr(indices.arr))
def reduce(implicit m: RepMonoid[Item @uncheckedVariance]): Rep[Item] = arr.reduce(m)
def zip[B: Elem](ys: Coll[B]): PairColl[Item, B] = PairCollectionSOA(self, ys)
def update (idx: Rep[Int], value: Rep[Item]): Coll[Item] = CollectionOverArray(arr.update(idx, value))
def updateMany (idxs: Coll[Int], vals: Coll[Item]): Coll[Item] = CollectionOverArray(arr.updateMany(idxs.arr, vals.arr))
def filterBy(f: Rep[Item @uncheckedVariance => Boolean]): Coll[Item] = CollectionOverArray(arr.filterBy(f))
def flatMapBy[B: Elem](f: Rep[Item @uncheckedVariance => Collection[B]]): Coll[B] = Collection(arr.flatMap {in => f(in).arr})
def append(value: Rep[Item @uncheckedVariance]): Coll[Item] = CollectionOverArray(arr.append(value))
def sortBy[O: Elem](means: Rep[Item => O])(implicit o: Ordering[O]): Coll[Item] = CollectionOverArray(arr.sortBy(means))
}
trait CollectionOverArrayCompanion extends ConcreteClass1[CollectionOverArray]
abstract class CollectionOverList[Item](val lst: Rep[List[Item]])(implicit val eItem: Elem[Item]) extends Collection[Item] {
def length = lst.length
def apply(i: Rep[Int]) = lst(i)
def arr = lst.toArray
def mapBy[B: Elem](f: Rep[Item => B @uncheckedVariance]): Coll[B] = CollectionOverList(lst.mapBy(f))
def slice(offset: Rep[Int], length: Rep[Int]) = CollectionOverList(lst.slice(offset, length))
@OverloadId("many")
def apply(indices: Coll[Int])(implicit o: Overloaded1): Coll[Item] = CollectionOverList(lst(indices.arr))
def reduce(implicit m: RepMonoid[Item @uncheckedVariance]): Rep[Item] = lst.reduce(m)
def zip[B: Elem](ys: Coll[B]): PairColl[Item, B] = PairCollectionSOA(self, ys)
def update (idx: Rep[Int], value: Rep[Item]): Coll[Item] = ???
def updateMany (idxs: Coll[Int], vals: Coll[Item]): Coll[Item] = ???
def filterBy(f: Rep[Item @uncheckedVariance => Boolean]): Coll[Item] = CollectionOverList(lst.filterBy(f))
def flatMapBy[B: Elem](f: Rep[Item @uncheckedVariance => Collection[B]]): Coll[B] =
CollectionOverList(lst.flatMap { in => f(in).lst } )
def append(value: Rep[Item @uncheckedVariance]): Coll[Item] = CollectionOverList(value :: lst)
def sortBy[O: Elem](by: Rep[Item => O])(implicit o: Ordering[O]): Coll[Item] = ???
}
trait CollectionOverListCompanion extends ConcreteClass1[CollectionOverList]
abstract class CollectionOverSeq[Item](override val seq: Rep[SSeq[Item]])(implicit val eItem: Elem[Item]) extends Collection[Item] {
def arr = seq.toArray
def lst = seq.toList
def length = seq.size
def apply(i: Rep[Int]) = seq(i)
def slice(offset: Rep[Int], length: Rep[Int]) = CollectionOverSeq(seq.slice(offset, offset + length))
@OverloadId("many")
def apply(indices: Coll[Int])(implicit o: Overloaded1): Coll[Item] = {
CollectionOverSeq(SSeq(indices.arr.map(i => seq(i))))
}
def mapBy[B: Elem](f: Rep[Item => B @uncheckedVariance]): Coll[B] = CollectionOverSeq(seq.map(f))
def reduce(implicit m: RepMonoid[Item @uncheckedVariance]): Rep[Item] = {
val r = fun { p: Rep[(Item,Item)] => val Pair(x,y) = p; m.append(x,y) }
seq.reduce(r)
}
def zip[B: Elem](ys: Coll[B]): PairColl[Item, B] = PairCollectionSOA(CollectionOverSeq(seq), ys)
def update (idx: Rep[Int], value: Rep[Item]): Coll[Item] = ???
def updateMany (idxs: Coll[Int], vals: Coll[Item]): Coll[Item] = ???
def filterBy(f: Rep[Item @uncheckedVariance => Boolean]): Coll[Item] = ???
def flatMapBy[B: Elem](f: Rep[Item @uncheckedVariance => Collection[B]]): Coll[B] = ???
def append(value: Rep[Item @uncheckedVariance]): Coll[Item] = ???
def sortBy[O: Elem](by: Rep[Item => O])(implicit o: Ordering[O]): Coll[Item] = ???
}
trait CollectionOverSeqCompanion extends ConcreteClass1[CollectionOverSeq]
trait PairCollection[A,B] extends Collection[(A,B)] {
implicit def eA: Elem[A]
implicit def eB: Elem[B]
def as: Rep[Collection[A]]
def bs: Rep[Collection[B]]
@OverloadId("many")
override def apply(indices: Coll[Int])(implicit o: Overloaded1): Rep[PairCollection[A, B]]
def coll: Coll[(A, B)]
def innerJoin[C, R](other: PairColl[A, C], f: Rep[((B, C)) => R])(implicit ordK: Ordering[A], eR: Elem[R], eB: Elem[B], eC: Elem[C]): PairColl[A, R]
def outerJoin[C, R](other: PairColl[A, C], f: Rep[((B, C)) => R], f1: Rep[B => R], f2: Rep[C => R])(implicit ordK: Ordering[A], eR: Elem[R], eB: Elem[B], eC: Elem[C]): PairColl[A, R]
def innerMult(other: PairColl[A, B])(implicit ordK: Ordering[A], nA: Numeric[A], nB: Numeric[B]) = {
innerJoin[B, B](other, (b1: Rep[(B, B)]) => b1._1 * b1._2)
}
def outerSum(other: PairColl[A, B])(implicit ordK: Ordering[A], nA: Numeric[A], nB: Numeric[B]) = {
outerJoin[B, B](other, (b1: Rep[(B, B)]) => b1._1 + b1._2, (b: Rep[B]) => b, (b: Rep[B]) => b)
}
def outerSubtr(other: PairColl[A, B])(implicit ordK: Ordering[A], nA: Numeric[A], nB: Numeric[B]) = {
outerJoin[B, B](other, (b1: Rep[(B, B)]) => b1._1 - b1._2, (b: Rep[B]) => b, (b: Rep[B]) => b)
}
}
type PairColl[A, B] = Rep[PairCollection[A, B]]
abstract class PairCollectionSOA[A, B](val as: Rep[Collection[A]], val bs: Rep[Collection[B]])(implicit val eA: Elem[A], val eB: Elem[B])
extends PairCollection[A, B] {
lazy val eItem = element[(A, B)]
def arr = (as.arr zip bs.arr)
def lst = (as.lst zip bs.lst)
def coll: Coll[(A, B)] = self
def apply(i: Rep[Int]) = (as(i), bs(i))
def length = as.length
def slice(offset: Rep[Int], length: Rep[Int]) =
PairCollectionSOA(as.slice(offset, length), bs.slice(offset, length))
@OverloadId("many")
def apply(indices: Coll[Int])(implicit o: Overloaded1): PairColl[A, B] = as(indices) zip bs(indices)
def mapBy[C: Elem](f: Rep[(A,B) @uncheckedVariance => C]): Coll[C] = Collection(arr.mapBy(f)) // TODO: this should be done in another way
def reduce(implicit m: RepMonoid[(A,B) @uncheckedVariance]): Rep[(A,B)] = arr.reduce(m) // TODO: this should be done in another way
def zip[C: Elem](ys: Coll[C]): PairColl[(A, B),C] = PairCollectionSOA(self, ys)
def update (idx: Rep[Int], value: Rep[(A, B)]): PairColl[A, B] =
PairCollectionSOA(as.update(idx, value._1), bs.update(idx, value._2))
def updateMany (idxs: Coll[Int], vals: Coll[(A, B)]): PairColl[A, B] =
PairCollectionSOA(as.updateMany(idxs, vals.as), bs.updateMany(idxs, vals.bs))
def filterBy(f: Rep[(A,B) @uncheckedVariance => Boolean]) =
CollectionOverArray(arr.filterBy(f))
def flatMapBy[C: Elem](f: Rep[(A,B) @uncheckedVariance => Collection[C]]): Coll[C] =
Collection(arr.flatMap {in => f(in).arr})
def append(value: Rep[(A,B) @uncheckedVariance]): Coll[(A,B)] = PairCollectionSOA(as.append(value._1), bs.append(value._2))
def innerJoin[C, R](other: PairColl[A, C], f: Rep[((B, C)) => R])
(implicit ordK: Ordering[A], eR: Elem[R], eB: Elem[B], eC: Elem[C]): PairColl[A, R] = {
val innerJoined = Collection(pairColl_innerJoin[A, B, C, R](this, other, f))
PairCollectionSOA(innerJoined.as, innerJoined.bs)
}
def outerJoin[C, R](other: PairColl[A, C], f: Rep[((B, C)) => R], f1: Rep[B => R], f2: Rep[C => R])
(implicit ordK: Ordering[A], eR: Elem[R], eB: Elem[B], eC: Elem[C]) = {
val outerJoined = Collection(pairColl_outerJoin[A, B, C, R](this, other, f, f1, f2))
PairCollectionSOA(outerJoined.as, outerJoined.bs)
}
def sortBy[O: Elem](means: Rep[((A, B)) => O])(implicit o: Ordering[O]): PairColl[A, B] = {
val sorted = Collection(arr.sortBy(means))
PairCollectionSOA(sorted.as, sorted.bs)
}
}
trait PairCollectionSOACompanion extends ConcreteClass2[PairCollectionSOA]
abstract class PairCollectionAOS[A, B](val coll: Rep[Collection[(A,B)]])(implicit val eA: Elem[A], val eB: Elem[B])
extends PairCollection[A,B] {
lazy val eItem = element[(A, B)]
def arr = coll.arr
def lst = coll.lst
override def seq = coll.seq
def as = coll.map(_._1)
def bs = coll.map(_._2)
def apply(i: Rep[Int]) = coll(i)
def length = coll.length
def slice(offset: Rep[Int], length: Rep[Int]) =
PairCollectionAOS(coll.slice(offset, length))
@OverloadId("many")
def apply(indices: Coll[Int])(implicit o: Overloaded1): PairColl[A, B] =
PairCollectionAOS(coll(indices))
def mapBy[C: Elem](f: Rep[(A,B) @uncheckedVariance => C]): Coll[C] = coll.mapBy(f)
def reduce(implicit m: RepMonoid[(A,B) @uncheckedVariance]): Rep[(A,B)] = coll.reduce(m)
def zip[C: Elem](ys: Coll[C]): PairColl[(A, B),C] = PairCollectionSOA(self, ys)
def update (idx: Rep[Int], value: Rep[(A,B)]): Coll[(A,B)] = PairCollectionAOS(coll.update(idx, value))
def updateMany (idxs: Coll[Int], vals: Coll[(A,B)]): Coll[(A,B)] = PairCollectionAOS(coll.updateMany(idxs, vals))
def filterBy(f: Rep[(A,B) @uncheckedVariance => Boolean]) = coll.filterBy(f)
def flatMapBy[C: Elem](f: Rep[(A,B) @uncheckedVariance => Collection[C]]): Coll[C] = coll.flatMapBy(f)
def append(value: Rep[(A,B) @uncheckedVariance]): Coll[(A,B)] = PairCollectionAOS(coll.append(value))
def innerJoin[C, R](other: PairColl[A, C], f: Rep[((B, C)) => R])
(implicit ordK: Ordering[A], eR: Elem[R], eB: Elem[B], eC: Elem[C]) = {
PairCollectionAOS.fromArray(pairColl_innerJoin[A, B, C, R](this, other, f))
}
def outerJoin[C, R](other: PairColl[A, C], f: Rep[((B, C)) => R], f1: Rep[B => R], f2: Rep[C => R])
(implicit ordK: Ordering[A], eR: Elem[R], eB: Elem[B], eC: Elem[C]) = {
PairCollectionAOS.fromArray(pairColl_outerJoin[A, B, C, R](this, other, f, f1, f2))
}
def sortBy[O: Elem](means: Rep[((A, B)) => O])(implicit o: Ordering[O]): PairColl[A, B] = PairCollectionAOS(Collection(arr.sortBy(means)))
}
trait PairCollectionAOSCompanion extends ConcreteClass2[PairCollectionAOS] {
def fromArray[A: Elem, B: Elem](arr: Arr[(A, B)]) = PairCollectionAOS(CollectionOverArray(arr))
}
trait NestedCollection[A] extends Collection[Collection[A]] {
implicit def eA: Elem[A]
def values: Rep[Collection[A]]
def nestedValues: Rep[Collection[Collection[A]]]
def segments: Rep[PairCollection[Int, Int]]
def segOffsets = segments.as
def segLens = segments.bs
@OverloadId("many")
override def apply(indices: Coll[Int])(implicit o: Overloaded1): Rep[NestedCollection[A]]
}
//type NColl[A] = Rep[NestedCollectionFlat[A]]
type NColl[A] = Rep[NestedCollection[A]]
abstract class NestedCollectionFlat[A](val values: Coll[A], val segments: PairColl[Int, Int])(implicit val eA: Elem[A])
extends NestedCollection[A] {
lazy val eItem = collectionElement(eA)
def length = segments.length
def nestedValues = segments.map { case Pair(o, l) => values.slice(o,l) }
//def segOffsets = segments.asInstanceOf[Rep[PairCollectionSOA[Int,Int]]].as
//def segLens = segments.asInstanceOf[Rep[PairCollectionSOA[Int,Int]]].bs
def apply(i: Rep[Int]) = {
val Pair(offset, length) = segments(i)
values.slice(offset, length)
}
def arr = segments.arr.map { seg =>
val Pair(offset,length) = seg
values.slice(offset, length)
}
def lst = arr.toList
def slice(offset: Rep[Int], length: Rep[Int]): NColl[A] = ???
@OverloadId("many")
def apply(indices: Coll[Int])(implicit o: Overloaded1): NColl[A] = {
val newValues = segments(indices).flatMap { in =>
values.slice(in._1, in._2)
}
val newSegments = {
val newLens = segments(indices).bs
val newOffsArr = newLens.arr.scan._1
Collection(newOffsArr) zip newLens
}
NestedCollectionFlat(newValues, newSegments)
}
def mapBy[B: Elem](f: Rep[Collection[A] => B @uncheckedVariance]): Coll[B] = Collection(arr.mapBy(f))
def reduce(implicit m: RepMonoid[Collection[A @uncheckedVariance]]): Coll[A] = arr.reduce(m)
def zip[B: Elem](ys: Coll[B]): PairColl[Collection[A], B] = PairCollectionSOA(self, ys)
def update (idx: Rep[Int], value: Rep[Collection[A]]): NColl[A] = ???
def updateMany (idxs: Coll[Int], vals: Coll[Collection[A]]): NColl[A] = ???
def filterBy(f: Rep[Collection[A @uncheckedVariance] => Boolean]): NColl[A] = ???
def flatMapBy[B: Elem](f: Rep[Collection[A @uncheckedVariance] => Collection[B]]): Coll[B] = Collection(arr.flatMap {in => f(in).arr} )
def append(value: Rep[Collection[A @uncheckedVariance]]): NColl[A] = ??? //Collection(arr.append(value))
def sortBy[O: Elem](by: Rep[Collection[A] => O])(implicit o: Ordering[O]): NColl[A] = ???
}
trait NestedCollectionFlatCompanion extends ConcreteClass1[NestedCollectionFlat] {
def fromJuggedArray[T: Elem](arr: Rep[Array[Array[T]]]): Rep[NestedCollectionFlat[T]] = {
val lens: Arr[Int] = arr.map(i => i.length)
val positions = lens.scan._1
val segments = Collection.fromArray(positions).zip(Collection.fromArray(lens))
val flat_arr = arr.flatMap {i => i}
NestedCollectionFlat(Collection.fromArray(flat_arr), segments)
}
}
abstract class CompoundCollection[A](val nestedValues: Coll[Collection[A]])(implicit val eA: Elem[A])
extends NestedCollection[A] {
lazy val eItem = collectionElement(eA)
def segments = {
val offsets = Collection(nestedValues.map(_.length).arr.scan._1)
val lengths = nestedValues.map(_.length)
offsets zip lengths
}
def values = {
nestedValues.flatMap(row => row)
}
def length = nestedValues.length
def apply(i: Rep[Int]) = nestedValues(i)
def arr = nestedValues.arr
def lst = arr.toList
def slice(offset: Rep[Int], length: Rep[Int]): NColl[A] = CompoundCollection(nestedValues.slice(offset, length))
@OverloadId("many")
def apply(indices: Coll[Int])(implicit o: Overloaded1): NColl[A] = {
CompoundCollection(nestedValues(indices))
}
def mapBy[B: Elem](f: Rep[Collection[A] => B @uncheckedVariance]): Coll[B] = Collection(arr.mapBy(f))
def reduce(implicit m: RepMonoid[Collection[A @uncheckedVariance]]): Coll[A] = arr.reduce(m)
def zip[B: Elem](ys: Coll[B]): PairColl[Collection[A], B] = PairCollectionSOA(self, ys)
def update (idx: Rep[Int], value: Rep[Collection[A]]): NColl[A] = CompoundCollection(nestedValues.update(idx, value))
def updateMany (idxs: Coll[Int], vals: Coll[Collection[A]]): NColl[A] = ???
def filterBy(f: Rep[Collection[A @uncheckedVariance] => Boolean]): NColl[A] = ???
def flatMapBy[B: Elem](f: Rep[Collection[A @uncheckedVariance] => Collection[B]]): Coll[B] =
nestedValues.flatMap { in => f(in) }
def append(value: Rep[Collection[A @uncheckedVariance]]): NColl[A] = ??? //Collection(arr.append(value))
def sortBy[O: Elem](by: Rep[Collection[A] => O])(implicit o: Ordering[O]): NColl[A] = ???
}
trait CompoundCollectionCompanion extends ConcreteClass1[CompoundCollection] {
def fromJuggedArray[T: Elem](xss: Rep[Array[Array[T]]]): Rep[CompoundCollection[T]] = {
val nestedValues = Collection(xss.map(xs => Collection(xs)))
CompoundCollection(nestedValues)
}
}
abstract class FuncCollection[A,B,Env]
(val env1: Coll[Env], val indexedFunc: Rep[((Int, A)) => B])
(implicit val eA: Elem[A], val eB: Elem[B], val eEnv: Elem[Env])
extends Collection[A => B] {
lazy val eItem = element[A => B]
def arr = ???
def lst = ???
def length = env1.length
def apply(i: Rep[Int]) = fun { x: Rep[A] => indexedFunc(Pair(i, x)) }
def mapBy[R: Elem](f: Rep[((A => B)) => R @uncheckedVariance]): Coll[R] = {
val range = SArray.rangeFrom0(env1.length)
Collection(range.mapBy(fun { i: Rep[Int] =>
val itemFunc = apply(i)
f(itemFunc)
}))
}
@OverloadId("many")
def apply(indices: Coll[Int])(implicit o: Overloaded1): Coll[A=>B] = {
indices.mapBy(fun { i: Rep[Int] => apply(i) })
}
def slice(offset: Rep[Int], length: Rep[Int]) = ???
def reduce(implicit m: RepMonoid[A=>B @uncheckedVariance]): Rep[A=>B] = ???
def zip[C: Elem](ys: Coll[C]): PairColl[A=>B, C] = PairCollectionSOA(self, ys)
def update (idx: Rep[Int], value: Rep[A=>B]): Coll[A=>B] = ???
def updateMany (idxs: Coll[Int], vals: Coll[A=>B]): Coll[A=>B] = ???
def filterBy(f: Rep[(A=>B) => Boolean]): Coll[A=>B] = ???
def flatMapBy[R: Elem](f: Rep[((A=>B)) => Collection[R]]): Coll[R] = ???
def append(value: Rep[A=>B]): Coll[A=>B] = ???
def sortBy[O: Elem](by: Rep[(A=>B) => O])(implicit o: Ordering[O]): Coll[A=>B] = ???
}
implicit def convertCollectionElem[A](e: Elem[Collection[A]]): CollectionElem[A, _] =
e.asInstanceOf[CollectionElem[A, _]]
implicit class CollectionOfPairsExtensions[A, B](coll: Coll[(A, B)]) {
val collElem = convertCollectionElem(coll.selfType1)
def asPairColl: PairColl[A, B] =
PairCollectionAOS(coll)(collElem.eItem.eFst, collElem.eItem.eSnd)
def as: Coll[A] = collElem match {
case _: PairCollectionElem[_, _, _] => coll.asRep[PairCollection[A, B]].as
case _ => coll.map(_._1)(collElem.eItem.eFst)
}
def bs: Coll[B] = coll.selfType1 match {
case _: PairCollectionElem[_, _, _] => coll.asRep[PairCollection[A, B]].bs
case _ => coll.map(_._2)(collElem.eItem.eSnd)
}
}
abstract class StructItemCollection[Val, Schema <: Struct]
(val struct: Rep[Schema])
(implicit val eVal: Elem[Val], val eSchema: Elem[Schema])
extends Collection[StructItem[Val,Schema]] {
def eItem = element[StructItem[Val,Schema]]
private def itemSymbols: Seq[Rep[StructItem[Val,Schema]]] = {
val len = eSchema.fields.length
val syms = Seq.tabulate(len) { i =>
val item = struct.getItem(i).asRep[StructItem[Val, Schema]]
item
}
syms
}
def length = eSchema.fields.length
def arr: Arr[StructItem[Val,Schema]] = SArray.fromSyms(itemSymbols)
def lst = arr.toList
def apply(i: Rep[Int]) = struct.getItem(i).asRep[StructItem[Val,Schema]]
@OverloadId("many")
def apply(indices: Coll[Int])(implicit o: Overloaded1) = ???
def mapBy[B: Elem](f: Rep[(StructItem[Val, Schema]) => B]) = {
val syms = itemSymbols.map { item =>
f(item)
}
Collection(SArray.fromSyms(syms))
}
def zip[B: Elem](ys: Coll[B]): PairColl[StructItem[Val,Schema], B] = {
def error = !!!(s"Argument is not StructItemCollection: $ys", self)
ys.selfType1 match {
case ce: CollectionElem[b,_] => ce.eItem match {
case eSI: StructItemElem[v, s, _] =>
if (eSchema != eSI.eSchema)
!!!(s"Can zip StructItemCollections only with the same Schema but found $eSchema and ${eSI.eSchema}")
PairCollectionSOA(self, ys)(eItem, ce.eItem.asElem[B])
case _ => error
}
case _ => error
}
}
def slice(offset: Rep[Int], length: Rep[Int]) = ???
def reduce(implicit m: RepMonoid[StructItem[Val, Schema]]) = ???
def update(idx: Rep[Int], value: Rep[StructItem[Val, Schema]]) = ???
def updateMany(idxs: Coll[Int], vals: Coll[StructItem[Val, Schema]]) = ???
def filterBy(f: Rep[(StructItem[Val, Schema]) => Boolean]) = ???
def flatMapBy[B: Elem](f: Rep[(StructItem[Val, Schema]) => Collection[B]]) = ???
def append(value: Rep[StructItem[Val, Schema]]) = ???
def sortBy[O: Elem](by: Rep[(StructItem[Val, Schema]) => O])(implicit o: Ordering[O]) = ???
}
}
trait CollectionsDsl extends impl.CollectionsAbs with SeqsDsl {
trait CollectionFunctor extends Functor[Collection] {
def tag[A](implicit evA: WeakTypeTag[A]) = weakTypeTag[Collection[A]]
def lift[A](implicit evA: Elem[A]) = element[Collection[A]]
def unlift[T](implicit eFT: Elem[Collection[T]]) = eFT.asInstanceOf[CollectionElem[T,_]].eItem
def getElem[T](fa: Rep[Collection[T]]) = fa.selfType1
def unapply[A](e: Elem[_]) = e match {
case te: CollectionElem[_, _] => Some(te.asElem[Collection[A]])
case _ => None
}
def map[A:Elem,B:Elem](xs: Rep[Collection[A]])(f: Rep[A] => Rep[B]) = xs.map(f)
}
implicit val collectionContainer: Functor[Collection] = new CollectionFunctor {}
implicit class CollectionExtensions[A](coll: Coll[A]) {
implicit def eItem: Elem[A] = coll.selfType1.eItem
def map[B: Elem](f: Rep[A] => Rep[B]): Coll[B] = coll.mapBy(fun(f))
def filter(f: Rep[A] => Rep[Boolean]): Coll[A] = coll.filterBy(fun(f))
def flatMap[B: Elem](f: Rep[A] => Coll[B]): Coll[B] = coll.flatMapBy(fun(f))
def :+(x: Rep[A]) = coll.append(x)
}
trait CollectionManager {
def apply[T: Elem](arr: Rep[Array[T]]): Coll[T]
def fromArray[T: Elem](arr: Rep[Array[T]]): Coll[T]
def fromList[T: Elem](arr: Rep[List[T]]): Coll[T]
def replicate[T: Elem](len: Rep[Int], v: Rep[T]): Coll[T]
def empty[T: Elem]: Coll[T]
def singleton[T: Elem](v: Rep[T]): Coll[T]
def indexRange(l: Rep[Int]): Coll[Int]
}
def pairColl_innerJoin[K, B, C, R](xs: PairColl[K, B], ys: PairColl[K, C], f: Rep[((B, C)) => R])
(implicit ordK: Ordering[K], selfType: Elem[Array[(K, R)]],
eK: Elem[K], eR: Elem[R], eB: Elem[B], eC: Elem[C]): Rep[Array[(K, R)]]
def pairColl_outerJoin[K, B, C, R](xs: PairColl[K, B], ys: PairColl[K, C], f: Rep[((B, C)) => R], f1: Rep[B => R], f2: Rep[C => R])
(implicit ordK: Ordering[K], selfType: Elem[Array[(K, R)]],
eK: Elem[K], eR: Elem[R], eB: Elem[B], eC: Elem[C]): Rep[Array[(K, R)]]
}
trait CollectionsDslStd extends impl.CollectionsStd with SeqsDslStd {
def pairColl_innerJoin[K, B, C, R](xs: PairColl[K, B], ys: PairColl[K, C], f: Rep[((B, C)) => R])
(implicit ordK: Ordering[K], selfType: Elem[Array[(K, R)]],
eK: Elem[K], eR: Elem[R], eB: Elem[B], eC: Elem[C]): Rep[Array[(K, R)]] = {
val xIter = xs.arr.iterator
val yIter = ys.arr.iterator
val buffer = mutable.ArrayBuffer[(K, R)]()
@tailrec
def go(keyX: K, keyY: K, valueX: B, valueY: C) {
val cmp = ordK.compare(keyX, keyY)
if (cmp == 0) {
// keyX == keyY
val value = f((valueX, valueY))
buffer.append((keyX, value))
if (xIter.hasNext && yIter.hasNext) {
val (keyX1, valueX1) = xIter.next()
val (keyY1, valueY1) = yIter.next()
go(keyX1, keyY1, valueX1, valueY1)
}
} else if (cmp < 0) {
// keyX < keyY
if (xIter.hasNext) {
val (keyX1, valueX1) = xIter.next()
go(keyX1, keyY, valueX1, valueY)
}
} else {
// keyY < keyX
if (yIter.hasNext) {
val (keyY1, valueY1) = yIter.next()
go(keyX, keyY1, valueX, valueY1)
}
}
}
if (xIter.hasNext && yIter.hasNext) {
val (keyX1, valueX1) = xIter.next()
val (keyY1, valueY1) = yIter.next()
go(keyX1, keyY1, valueX1, valueY1)
}
buffer.toArray
}
def pairColl_outerJoin[K, B, C, R](xs: PairColl[K, B], ys: PairColl[K, C], f: Rep[((B, C)) => R], f1: Rep[B => R], f2: Rep[C => R])
(implicit ordK: Ordering[K], selfType: Elem[Array[(K, R)]],
eK: Elem[K], eR: Elem[R], eB: Elem[B], eC: Elem[C]): Rep[Array[(K, R)]] = {
val xIter = xs.arr.iterator
val yIter = ys.arr.iterator
val buffer = mutable.ArrayBuffer[(K, R)]()
// called only when yIter is empty
def finishX() {
xIter.foreach { kv => buffer.append((kv._1, f1(kv._2))) }
}
// called only when xIter is empty
def finishY() {
yIter.foreach { kv => buffer.append((kv._1, f2(kv._2))) }
}
@tailrec
def go(keyX: K, keyY: K, valueX: B, valueY: C) {
val cmp = ordK.compare(keyX, keyY)
if (cmp == 0) {
// keyX == keyY
val value = f((valueX, valueY))
buffer.append((keyX, value))
(xIter.hasNext, yIter.hasNext) match {
case (true, true) =>
val (keyX1, valueX1) = xIter.next()
val (keyY1, valueY1) = yIter.next()
go(keyX1, keyY1, valueX1, valueY1)
case (true, false) =>
finishX()
case (false, true) =>
finishY()
case _ => {}
}
} else if (cmp < 0) {
// keyX < keyY
val value = f1(valueX)
buffer.append((keyX, value))
if (xIter.hasNext) {
val (keyX1, valueX1) = xIter.next()
go(keyX1, keyY, valueX1, valueY)
} else {
buffer.append((keyY, f2(valueY)))
finishY()
}
} else {
// keyY < keyX
val value = f2(valueY)
buffer.append((keyY, value))
if (yIter.hasNext) {
val (keyY1, valueY1) = yIter.next()
go(keyX, keyY1, valueX, valueY1)
} else {
buffer.append((keyX, f1(valueX)))
finishX()
}
}
}
(xIter.hasNext, yIter.hasNext) match {
case (true, true) =>
val (keyX1, valueX1) = xIter.next()
val (keyY1, valueY1) = yIter.next()
go(keyX1, keyY1, valueX1, valueY1)
case (true, false) =>
finishX()
case (false, true) =>
finishY()
case _ => {}
}
buffer.toArray
}
}
trait CollectionsDslExp extends impl.CollectionsExp with SeqsDslExp {
override def rewriteDef[T](d: Def[T]) = d match {
// case ExpPairCollectionAOS(pairColl @ Def(_: PairCollection[_, _])) => pairColl
case _ => super.rewriteDef(d)
}
override protected def getResultElem(receiver: Exp[_], m: Method, args: List[AnyRef]): Elem[_] = receiver.elem match {
case e: StructItemCollectionElem[v,s] => m.getName match {
case "apply" => structItemElement(e.eVal, e.eSchema.asElem[Struct])
case "zip" =>
val eA = structItemElement(e.eVal, e.eSchema.asElem[Struct])
val eB = args(0).asInstanceOf[Coll[Any]].elem.eItem
pairCollectionElement(eA, eB)
case _ => super.getResultElem(receiver, m, args)
}
case e: PairCollectionElem[a,b,_] => m.getName match {
case "apply" => e.eItem
case _ => super.getResultElem(receiver, m, args)
}
case e: CollectionElem[t, _] => e.eItem match {
case pe: PairElem[a,b] => m.getName match {
case "as" => collectionElement(pe.eFst)
case "bs" => collectionElement(pe.eSnd)
case _ => super.getResultElem(receiver, m, args)
}
case _ => super.getResultElem(receiver, m, args)
}
case e: StructItemElem[v,s,_] => m.getName match {
case "value" => e.eVal
case _ => super.getResultElem(receiver, m, args)
}
case _ => super.getResultElem(receiver, m, args)
}
def pairColl_innerJoin[K, B, C, R](xs: PairColl[K, B], ys: PairColl[K, C], f: Rep[((B, C)) => R])
(implicit ordK: Ordering[K], selfType: Elem[Array[(K, R)]],
eK: Elem[K], eR: Elem[R], eB: Elem[B], eC: Elem[C]): Rep[Array[(K, R)]] = {
ArrayInnerJoin(xs.arr, ys.arr, f)
}
def pairColl_outerJoin[K, B, C, R](xs: PairColl[K, B], ys: PairColl[K, C], f: Rep[((B, C)) => R], f1: Rep[B => R], f2: Rep[C => R])
(implicit ordK: Ordering[K], selfType: Elem[Array[(K, R)]], eK: Elem[K], eR: Elem[R], eB: Elem[B], eC: Elem[C]): Rep[Array[(K, R)]] = {
ArrayOuterJoin(xs.arr, ys.arr, f, f1, f2)
}
case class ArrayInnerJoin[K, B, C, R](xs: Exp[Array[(K, B)]], ys: Exp[Array[(K, C)]], f: Exp[((B, C)) => R])
(implicit val ordK: Ordering[K], val selfType: Elem[Array[(K, R)]],
val eK: Elem[K], val eR: Elem[R], val eB: Elem[B], val eC: Elem[C])
extends Def[Array[(K, R)]] {
}
case class ArrayOuterJoin[K, B, C, R](xs: Exp[Array[(K, B)]], ys: Exp[Array[(K, C)]], f: Rep[((B, C)) => R],
f1: Rep[B => R], f2: Rep[C => R])
(implicit val ordK: Ordering[K], val selfType: Elem[Array[(K, R)]],
val eK: Elem[K], val eR: Elem[R], val eB: Elem[B], val eC: Elem[C])
extends Def[Array[(K, R)]] {
}
}
|
PCMNN/scalan-ce
|
collections/src/main/scala/scalan/collections/Collections.scala
|
Scala
|
apache-2.0
| 35,327
|
# Bigelowia cooperi A.Gray SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Ericameria/Ericameria cooperi/ Syn. Bigelowia cooperi/README.md
|
Markdown
|
apache-2.0
| 181
|
# Copyright 2017, OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import six
from opencensus.common import utils
def _format_attribute_value(value):
if isinstance(value, bool):
value_type = 'bool_value'
elif isinstance(value, int):
value_type = 'int_value'
elif isinstance(value, six.string_types):
value_type = 'string_value'
value = utils.get_truncatable_str(value)
elif isinstance(value, float):
value_type = 'double_value'
else:
return None
return {value_type: value}
class Attributes(object):
"""A set of attributes, each in the format [KEY]:[VALUE].
:type attributes: dict
:param attributes: The set of attributes. Each attribute's key can be up
to 128 bytes long. The value can be a string up to 256
bytes, an integer, a floating-point number, or the
Boolean values true and false.
"""
def __init__(self, attributes=None):
self.attributes = attributes or {}
def set_attribute(self, key, value):
"""Set a key value pair."""
self.attributes[key] = value
def delete_attribute(self, key):
"""Delete an attribute given a key if existed."""
self.attributes.pop(key, None)
def get_attribute(self, key):
"""Get a attribute value."""
return self.attributes.get(key, None)
def format_attributes_json(self):
"""Convert the Attributes object to json format."""
attributes_json = {}
for key, value in self.attributes.items():
key = utils.check_str_length(key)[0]
value = _format_attribute_value(value)
if value is not None:
attributes_json[key] = value
result = {
'attributeMap': attributes_json
}
return result
|
census-instrumentation/opencensus-python
|
opencensus/trace/attributes.py
|
Python
|
apache-2.0
| 2,383
|
package name.falgout.jeffrey.stream.future.adapter;
import java.util.Optional;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.Future;
import java.util.function.Function;
import java.util.function.IntFunction;
import name.falgout.jeffrey.stream.future.FutureDoubleStream;
import name.falgout.jeffrey.stream.future.FutureIntStream;
import name.falgout.jeffrey.stream.future.FutureLongStream;
import name.falgout.jeffrey.stream.future.FutureStream;
import throwing.ThrowingComparator;
import throwing.function.ThrowingBiConsumer;
import throwing.function.ThrowingBiFunction;
import throwing.function.ThrowingBinaryOperator;
import throwing.function.ThrowingConsumer;
import throwing.function.ThrowingFunction;
import throwing.function.ThrowingPredicate;
import throwing.function.ThrowingSupplier;
import throwing.stream.ThrowingCollector;
import throwing.stream.ThrowingStream;
import throwing.stream.intermediate.adapter.ThrowingStreamIntermediateAdapter;
import throwing.stream.union.UnionDoubleStream;
import throwing.stream.union.UnionIntStream;
import throwing.stream.union.UnionLongStream;
import throwing.stream.union.UnionStream;
class FutureStreamAdapter<T> extends
FutureBaseStreamAdapter<T, UnionStream<T, FutureThrowable>, FutureStream<T>> implements
FutureStream<T>,
ThrowingStreamIntermediateAdapter<T, Throwable, ExecutionException, UnionStream<T, FutureThrowable>, UnionIntStream<FutureThrowable>, UnionLongStream<FutureThrowable>, UnionDoubleStream<FutureThrowable>, FutureStream<T>, FutureIntStream, FutureLongStream, FutureDoubleStream> {
FutureStreamAdapter(UnionStream<T, FutureThrowable> delegate, Executor executor) {
super(delegate, executor);
}
FutureStreamAdapter(UnionStream<T, FutureThrowable> delegate,
FutureBaseStreamAdapter<?, ?, ?> parent) {
super(delegate, parent);
}
FutureStreamAdapter(UnionStream<T, FutureThrowable> delegate) {
super(delegate);
}
@Override
public FutureStream<T> getSelf() {
return this;
}
@Override
public FutureStream<T> createNewAdapter(UnionStream<T, FutureThrowable> delegate) {
return newStream(delegate);
}
private <R> FutureStreamAdapter<R> newStream(UnionStream<R, FutureThrowable> delegate) {
return new FutureStreamAdapter<>(delegate);
}
@Override
public FutureIntStream newIntStream(UnionIntStream<FutureThrowable> delegate) {
return new FutureIntStreamAdapter(delegate, this);
}
@Override
public FutureLongStream newLongStream(UnionLongStream<FutureThrowable> delegate) {
return new FutureLongStreamAdapter(delegate, this);
}
@Override
public FutureDoubleStream newDoubleStream(UnionDoubleStream<FutureThrowable> delegate) {
return new FutureDoubleStreamAdapter(delegate, this);
}
@Override
public throwing.stream.terminal.ThrowingBaseStreamTerminal.Iterator<T, Throwable, Throwable> iterator() {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("TODO");
}
@Override
public throwing.stream.terminal.ThrowingBaseStreamTerminal.BaseSpliterator<T, Throwable, Throwable, ?> spliterator() {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("TODO");
}
@Override
public <R> FutureStream<R> map(
ThrowingFunction<? super T, ? extends R, ? extends Throwable> mapper) {
return newStream(getDelegate().map(getFunctionAdapter().convert(mapper)));
}
@Override
public <R> FutureStream<R> flatMap(
ThrowingFunction<? super T, ? extends ThrowingStream<? extends R, ? extends Throwable>, ? extends Throwable> mapper) {
Function<ThrowingStream<? extends R, ? extends Throwable>, ThrowingStream<? extends R, ExecutionException>> streamMapper = getFunctionAdapter()::convert;
return newStream(getDelegate().flatMap(
getFunctionAdapter().convert(mapper.andThen(streamMapper))));
}
@Override
public Future<Void> forEach(ThrowingConsumer<? super T, ?> action) {
return completeVoid(UnionStream::forEach, getFunctionAdapter().convert(action));
}
@Override
public Future<Void> forEachOrdered(ThrowingConsumer<? super T, ?> action) {
return completeVoid(UnionStream::forEachOrdered, getFunctionAdapter().convert(action));
}
@Override
public Future<Object[]> toArray() {
return complete(UnionStream::toArray);
}
@Override
public <A> Future<A[]> toArray(IntFunction<A[]> generator) {
return complete(UnionStream::toArray, generator);
}
@Override
public Future<T> reduce(T identity, ThrowingBinaryOperator<T, ?> accumulator) {
return complete(s -> s.reduce(identity, getFunctionAdapter().convert(accumulator)));
}
@Override
public Future<Optional<T>> reduce(ThrowingBinaryOperator<T, ?> accumulator) {
return complete(UnionStream<T, FutureThrowable>::reduce,
getFunctionAdapter().convert(accumulator));
}
@Override
public <U> Future<U> reduce(U identity, ThrowingBiFunction<U, ? super T, U, ?> accumulator,
ThrowingBinaryOperator<U, ?> combiner) {
return complete(s -> s.reduce(identity, getFunctionAdapter().convert(accumulator),
getFunctionAdapter().convert(combiner)));
}
@Override
public <R> Future<R> collect(ThrowingSupplier<R, ?> supplier,
ThrowingBiConsumer<R, ? super T, ?> accumulator, ThrowingBiConsumer<R, R, ?> combiner) {
return complete(s -> s.collect(getFunctionAdapter().convert(supplier),
getFunctionAdapter().convert(accumulator), getFunctionAdapter().convert(combiner)));
}
@Override
public <R, A> Future<R> collect(ThrowingCollector<? super T, A, R, ?> collector) {
return complete(UnionStream::collect, getFunctionAdapter().convert(collector));
}
@Override
public Future<Optional<T>> min(ThrowingComparator<? super T, ?> comparator) {
return complete(UnionStream<T, FutureThrowable>::min, getFunctionAdapter().convert(comparator));
}
@Override
public Future<Optional<T>> max(ThrowingComparator<? super T, ?> comparator) {
return complete(UnionStream<T, FutureThrowable>::max, getFunctionAdapter().convert(comparator));
}
@Override
public Future<Long> count() {
return complete(UnionStream::count);
}
@Override
public Future<Boolean> anyMatch(ThrowingPredicate<? super T, ?> predicate) {
return complete(UnionStream<T, FutureThrowable>::anyMatch,
getFunctionAdapter().convert(predicate));
}
@Override
public Future<Boolean> allMatch(ThrowingPredicate<? super T, ?> predicate) {
return complete(UnionStream<T, FutureThrowable>::allMatch,
getFunctionAdapter().convert(predicate));
}
@Override
public Future<Boolean> noneMatch(ThrowingPredicate<? super T, ?> predicate) {
return complete(UnionStream<T, FutureThrowable>::noneMatch,
getFunctionAdapter().convert(predicate));
}
@Override
public Future<Optional<T>> findFirst() {
return complete(UnionStream::findFirst);
}
@Override
public Future<Optional<T>> findAny() {
return complete(UnionStream::findAny);
}
}
|
JeffreyFalgout/completable-futures
|
src/main/java/name/falgout/jeffrey/stream/future/adapter/FutureStreamAdapter.java
|
Java
|
apache-2.0
| 7,069
|
#!/usr/bin/python
# 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.
import argparse
import pydot
import os
__author__ = 'Shamal Faily'
def dotToObstacleModel(graph,contextName,originatorName):
goals = []
goalNames = set([])
obstacles = []
acs = {}
for node in graph.get_nodes():
nodeShape = node.get_shape()
nodeStyle = str(node.get_style())
if nodeShape == 'box' and nodeStyle == 'rounded':
obstacles.append(node.get_name())
elif nodeShape == 'box' and nodeStyle == 'None':
nodeName = node.get_name()
if (nodeName != 'node' and nodeName != 'edge'):
goals.append(node.get_name())
goalNames.add(node.get_name())
elif nodeShape == 'triangle':
acs[node.get_name()] = node.get_label()
xmlBuf = '<?xml version="1.0"?>\n<!DOCTYPE cairis_model PUBLIC "-//CAIRIS//DTD MODEL 1.0//EN" "http://cairis.org/dtd/cairis_model.dtd">\n\n<cairis_model>\n\n'
xmlBuf += '<cairis>\n <project_settings name="' + contextName + '">\n <contributors>\n <contributor first_name="None" surname="None" affiliation="' + originatorName + '" role="Scribe" />\n </contributors>\n </project_settings>\n <environment name="' + contextName + '" short_code="' + contextName + '">\n <definition>' + contextName + '</definition>\n <asset_values>\n <none>TBC</none>\n <low>TBC</low>\n <medium>TBC</medium>\n <high>TBC</high>\n </asset_values>\n </environment>\n</cairis>\n\n<goals>\n'
for g in goals:
xmlBuf += ' <goal name=' + g + ' originator="' + originatorName + '">\n <goal_environment name="' + contextName + '" category="Maintain" priority="Medium">\n <definition>' + g + '</definition>\n <fit_criterion>TBC</fit_criterion>\n <issue>None</issue>\n </goal_environment>\n </goal>\n'
for o in obstacles:
xmlBuf += ' <obstacle name=' + o + ' originator="' + originatorName + '">\n <obstacle_environment name="' + contextName + '" category="Threat">\n <definition>' + o + '</definition>\n </obstacle_environment>\n </obstacle>\n'
xmlBuf += '</goals>\n\n'
fromAssocs = []
toAssocs = {}
assocs = []
for e in graph.get_edge_list():
fromName = e.get_source()
toName = e.get_destination()
if fromName in acs:
if fromName not in toAssocs:
toAssocs[fromName] = [toName]
else:
toAssocs[fromName].append(toName)
elif toName in acs:
fromAssocs.append((fromName,toName))
else:
if fromName in goalNames:
assocs.append(' <goal_association environment="' + contextName + '" goal_name=' + fromName + ' goal_dim="goal" ref_type="obstruct" subgoal_name=' + toName + ' subgoal_dim="obstacle" alternative_id="0">\n <rationale>None</rationale>\n </goal_association>\n')
else:
assocs.append(' <goal_association environment="' + contextName + '" goal_name=' + fromName + ' goal_dim="obstacle" ref_type="resolve" subgoal_name=' + toName + ' subgoal_dim="goal" alternative_id="0">\n <rationale>None</rationale>\n </goal_association>\n')
for fromName,toName in fromAssocs:
for subGoalName in toAssocs[toName]:
assocs.append(' <goal_association environment="' + contextName + '" goal_name=' + fromName + ' goal_dim="obstacle" ref_type=' + acs[toName] + ' subgoal_name=' + subGoalName + ' subgoal_dim="obstacle" alternative_id="0">\n <rationale>None</rationale>\n </goal_association>\n')
xmlBuf += '<associations>\n'
for assoc in assocs:
xmlBuf += assoc
xmlBuf += '</associations>\n\n</cairis_model>'
return xmlBuf
def main(args=None):
parser = argparse.ArgumentParser(description='Attack Tree to CAIRIS Model converter')
parser.add_argument('dotFile',help='attack tree model to import (Dot format)')
parser.add_argument('--context',dest='contextName',help='attack context')
parser.add_argument('--author',dest='originatorName',help='author/s')
parser.add_argument('--out',dest='outFile',help='output file (CAIRIS format)')
args = parser.parse_args()
dotInstance = pydot.graph_from_dot_file(args.dotFile)
xmlBuf = dotToObstacleModel(dotInstance[0],args.contextName,args.originatorName)
f = open(args.outFile,'w')
f.write(xmlBuf)
f.close()
if __name__ == '__main__':
main()
|
nathanbjenx/cairis
|
cairis/bin/at2om.py
|
Python
|
apache-2.0
| 5,006
|
package app.logic.controller;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.QLConstant;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
import org.json.simple.JSONObject;
import org.ql.utils.QLJsonUtil;
import org.ql.utils.network.QLHttpGet;
import org.ql.utils.network.QLHttpPost;
import org.ql.utils.network.QLHttpReply;
import org.ql.utils.network.QLHttpResult;
import org.ql.utils.network.QLHttpUtil;
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.google.gson.reflect.TypeToken;
import android.R.integer;
import android.content.Context;
import android.util.Log;
import app.config.http.HttpConfig;
import app.config.http.YYResponseData;
import app.logic.pojo.CardInfo;
import app.logic.pojo.Chatroom;
import app.logic.pojo.FriendInfo;
import app.logic.pojo.OrgRecommendMemberInfo;
import app.logic.pojo.SearchInfo;
import app.logic.pojo.TradeInfo;
import app.logic.pojo.UserInfo;
import app.logic.pojo.YYChatSessionInfo;
import app.utils.common.EncryptUtils;
import app.utils.common.Listener;
import app.utils.file.YYFileManager;
import app.utils.helpers.PropertySaveHelper;
import app.utils.helpers.SharepreferencesUtils;
import cn.jpush.android.api.JPushInterface;
import internal.org.apache.http.entity.mime.MultipartEntity;
import internal.org.apache.http.entity.mime.content.FileBody;
import internal.org.apache.http.entity.mime.content.StringBody;
/**
* SiuJiYung create at 2016-6-2 上午10:45:28
*/
public class UserManagerController {
private static UserInfo _usinfo;
public static final String kUSER_INFO_KEY = "kUSER_INFO_KEY";
public static UserInfo getCurrUserInfo() {
// if (_usinfo == null) {
String info_json = PropertySaveHelper.getHelper().stringForKey(kUSER_INFO_KEY);
if (info_json != null) {
try {
Gson gson = new Gson();
_usinfo = gson.fromJson(info_json, UserInfo.class);
} catch (JsonSyntaxException e) {
e.printStackTrace();
}
}
// }
return _usinfo;
}
public static void updateUserInfo(UserInfo info) {
PropertySaveHelper.getHelper().save(info, "kUSER_INFO_KEY");
_usinfo = info;
}
/**
* @param context
* @param filePath
* @param callback
*/
public static void uploadUserHeadImage(Context context, final String filePath, final Listener<Integer, String> callback) {
Runnable runnable = new Runnable() {
@Override
public void run() {
String url = HttpConfig.getUrl(HttpConfig.OPERATING_MEMBER_PICTURE_URL);
HttpClient httpClient = new DefaultHttpClient();
try {
HttpPost httpPost = new HttpPost(url);
httpPost.setHeader("User-Agent", "SOHUWapRebot");
httpPost.setHeader("Accept-Language", "zh-cn,zh;q=0.5");
httpPost.setHeader("Accept-Charset", "GBK,utf-8;q=0.7,*;q=0.7");
httpPost.setHeader("Connection", "keep-alive");
MultipartEntity mutiEntity = new MultipartEntity();
File file = new File(filePath);
mutiEntity.addPart("img", new FileBody(file));
mutiEntity.addPart("uid", new StringBody("HelpAuction"));
// mutiEntity.addPart("primarykey", new
// StringBody(primarykey,Charset.forName("utf-8")));
mutiEntity.addPart("token", new StringBody(QLConstant.token, Charset.forName("utf-8")));
mutiEntity.addPart("wp_member_info_id", new StringBody(QLConstant.client_id, Charset.forName("utf-8")));
httpPost.setEntity(mutiEntity);
HttpResponse httpResponse = httpClient.execute(httpPost);
if (httpResponse.getStatusLine().getStatusCode() == 200) {
Log.v("hhhh", "连接成功");
HttpEntity httpEntity = httpResponse.getEntity();
String content = EntityUtils.toString(httpEntity);
Log.v("hhhh", content);
JSONObject json = QLJsonUtil.doJSONObject(content);
Boolean flag = QLJsonUtil.doBoolean(json.get("success"));
String message = QLJsonUtil.doString(json.get("msg"));
if (flag && callback != null) {
callback.onCallBack(1, null);
return;
}
}
} catch (Exception e) {
e.printStackTrace();
}
if (callback != null) {
callback.onCallBack(-1, null);
}
}
};
new Thread(runnable).start();
}
/**
* 获取会话列表
*
* @param context // * @param memberId
* @param callback
*/
public static void getChatList(Context context, final Listener<Integer, List<YYChatSessionInfo>> callback) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.GET_CHAT_LIST));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
httpUtil.setEntity(entity);
httpUtil.setUseCache(true);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if (callback == null || callback.isCancel()) {
return;
}
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if (responseData != null && responseData.getCode() == 0) {
List<YYChatSessionInfo> chatList = responseData.parseData("root", new TypeToken<List<YYChatSessionInfo>>() {
});
List<Chatroom> groupList = responseData.parseData("chatroom", new TypeToken<List<Chatroom>>() {
});
List<YYChatSessionInfo> tempList = new ArrayList<YYChatSessionInfo>();
for (Chatroom chatroom : groupList) {
YYChatSessionInfo info = new YYChatSessionInfo();
info.setChatroom(chatroom);
tempList.add(info);
}
if (tempList.size() > 0) {
chatList.addAll(tempList);
}
callback.onCallBack(1, chatList);
return;
}
callback.onCallBack(-1, null);
}
});
}
/**
* 移除一个会话
*
* @param context
* @param memberId
* @param callback
*/
public static void removeChatWith(Context context, String memberId, final Listener<Integer, String> callback) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.REMOVE_CHAT));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.put("wp_dialogue_info_id", memberId);
httpUtil.setEntity(entity);
httpUtil.setUseCache(true);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if (callback == null || callback.isCancel()) {
return;
}
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if (responseData != null && responseData.getCode() == 0) {
callback.onCallBack(1, null);
return;
}
callback.onCallBack(-1, null);
}
});
}
/**
* 添加一个会话
*
* @param context
* @param memberId
* @param tag
* @param callback
*/
public static void addChatWith(Context context, String memberId, String tag, final Listener<Integer, String> callback) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.ADD_CHAT));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.put("wp_other_info_id", memberId);
entity.put("remark", tag);
httpUtil.setEntity(entity);
httpUtil.setUseCache(true);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if (callback == null || callback.isCancel()) {
return;
}
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if (responseData != null && responseData.getCode() == 0) {
callback.onCallBack(1, null);
return;
}
callback.onCallBack(-1, null);
}
});
}
/**
* 用户登录
*
* @param context
* @param phone
* @param password
* @param callBack
*/
public static void Login(final Context context, String phone, String password, final Listener<Integer, UserInfo> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.LOGIN_URL));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("phone", phone);
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
String date = sdf.format(new Date());
entity.put("password", EncryptUtils.getMD5(date+EncryptUtils.getMD5(password)));
// entity.put("password",password);
entity.put("sec", date);
// entity.put("pushId", JPushInterface.getRegistrationID(context));
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
String msg = null;
try {
if (callBack == null || callBack.isCancel())
return;
JSONObject json = QLJsonUtil.doJSONObject(reply.getReplyMsgAsString());
if (json == null) {
callBack.onCallBack(-2, null);
} else {
QLConstant.token = QLJsonUtil.doString(json.get("token"));
SharepreferencesUtils utils = new SharepreferencesUtils(context);
utils.setToken(QLConstant.token);
msg = QLJsonUtil.doString("wp_error_msg");
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
List<UserInfo> list = null;
if (responseData != null) {
list = responseData.parseData("root", new TypeToken<List<UserInfo>>() {
});
UserInfo info = null;
if (list != null && list.size() > 0) {
info = list.get(0);
JPushInterface.setAlias(context, info.getWp_member_info_id(), null); //极光托送设置别名
_usinfo = info;
PropertySaveHelper.getHelper().save(info, kUSER_INFO_KEY);
callBack.onCallBack(1, info);
return;
}
}
}
} catch (Exception e) {
e.printStackTrace();
if (msg == null) {
msg = e.getMessage();
}
}
UserInfo info = new UserInfo();
info.setWp_error_msg(msg);
callBack.onCallBack(-1, info);
}
});
}
// 忘记密码
public static void FotgetPsw(Context context, String phone, String password, String registerCode, final Listener<Integer, String> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.FORGET_MEMBER_PASSWORD_URL));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("phone", phone);
entity.put("password", EncryptUtils.getMD5(password));
entity.put("registerCode", registerCode);
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
try {
if (callBack == null || callBack.isCancel())
return;
JSONObject json = QLJsonUtil.doJSONObject(reply.getReplyMsgAsString());
if (json == null) {
callBack.onCallBack(-2, null);
} else {
Boolean flag = QLJsonUtil.doBoolean(json.get("success"));
String msg = QLJsonUtil.doString(json.get("msg"));
if (flag) {
callBack.onCallBack(1, msg);
} else {
callBack.onCallBack(-1, msg);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* 注册用户
*
* @param context
* @param phone
* @param password
* @param callBack
*/
public static void Register(final Context context, String phone, String password,String code , final Listener<Boolean, List<UserInfo>> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.REGISTER_BY_ID));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("phone", phone);
entity.put("password", EncryptUtils.getMD5(password));
entity.put("code", code);
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
try {
if (callBack == null || callBack.isCancel())
return;
JSONObject json = QLJsonUtil.doJSONObject(reply.getReplyMsgAsString());
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if(json !=null && responseData != null && responseData.isSuccess() ){
String data = QLJsonUtil.doString(json.get("root"));
int code = QLJsonUtil.doInt(json.get("wp_error_code"));
QLConstant.token = QLJsonUtil.doString(json.get("token"));
SharepreferencesUtils utils = new SharepreferencesUtils(context);
utils.setToken(QLConstant.token);
List<UserInfo> list = responseData.parseData("root", new TypeToken<List<UserInfo>>() {});
String msg = QLJsonUtil.doString(json.get("wp_error_msg"));
UserInfo info = list.get(0);
PropertySaveHelper.getHelper().save(info, kUSER_INFO_KEY);
callBack.onCallBack(true, list);
return;
}else if(responseData != null && !responseData.isSuccess()){
String msg = QLJsonUtil.doString(json.get("msg"));
List<UserInfo> list2 = new ArrayList<UserInfo>();
UserInfo info = new UserInfo();
info.setWp_error_msg(responseData.getMsg());
list2.add(info);
callBack.onCallBack(false , list2);
return;
}else{
List<UserInfo> list3 = new ArrayList<UserInfo>();
UserInfo info = new UserInfo();
info.setWp_error_msg("未知错误");
list3.add(info);
callBack.onCallBack(false , list3);
}
// if (json != null && responseData != null) {
// String data = QLJsonUtil.doString(json.get("root"));
// int code = QLJsonUtil.doInt(json.get("wp_error_code"));
// QLConstant.token = QLJsonUtil.doString(json.get("token"));
// List<UserInfo> list = responseData.parseData("root", new TypeToken<List<UserInfo>>() {});
// String msg = QLJsonUtil.doString(json.get("wp_error_msg"));
// Log.v("hhhh", "msg" + msg);
// if (code == 0) { //
// UserInfo info = list.get(0);
// PropertySaveHelper.getHelper().save(info, kUSER_INFO_KEY);
// callBack.onCallBack(1, list);
// return;
// } else{
// List<UserInfo> list2 = new ArrayList<UserInfo>();
// UserInfo info = new UserInfo();
// info.setWp_error_msg(responseData.getErrorMsg());
// list2.add(info);
// callBack.onCallBack(-1, list2);
// return;
// }
// }
} catch (Exception e) {
e.printStackTrace();
}
// callBack.onCallBack(-2, null);
}
});
}
/**
* 修改用户属性
*
* @param context
* @param propertys
* @param callback
*/
public static void updateUserInfo(Context context, Map<String, String> propertys, final Listener<Integer, String> callback) {
if (propertys == null) {
return;
}
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.UPDATE_MEMBER_LIST_INFO_URL));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.putAll(propertys);
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
String msgString = null;
try {
if (callback == null || callback.isCancel())
return;
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if (responseData != null && responseData.isSuccess()) {
callback.onCallBack(1, null);
return;
} else if (responseData != null) {
msgString = responseData.getErrorMsg();
}
} catch (Exception e) {
e.printStackTrace();
}
callback.onCallBack(-1, msgString);
}
});
}
// 修改昵称
public static void updateName(Context context, String nickName, final Listener<Integer, String> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.UPDATE_MEMBER_NAME));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("primarykey", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.put("nickName", nickName);
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
String msg = null;
try {
if (callBack == null || callBack.isCancel())
return;
JSONObject json = QLJsonUtil.doJSONObject(reply.getReplyMsgAsString());
Boolean flag = QLJsonUtil.doBoolean(json.get("success"));
msg = QLJsonUtil.doString(json.get("msg"));
if (json != null && flag) {
callBack.onCallBack(1, msg);
return;
}
} catch (Exception e) {
e.printStackTrace();
}
callBack.onCallBack(-1, msg);
}
});
}
// 显示客户本人的的详细信息
public static void showMemberList(Context context, String id, final Listener<Integer, List<UserInfo>> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.SHOW_MEMBER_LIST_INFO_URL));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("token", QLConstant.token);
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("o_wp_member_info_id", QLConstant.client_id);
entity.put("primarykey", id);
httpUtil.setEntity(entity);
httpUtil.setUseCache(true);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
try {
if (callBack == null || callBack.isCancel())
return;
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if (responseData != null && responseData.getWp_error_code() == 0) {
List<UserInfo> list = responseData.parseData("root", new TypeToken<List<UserInfo>>() {
});
callBack.onCallBack(1, list);
return;
}
} catch (Exception e) {
e.printStackTrace();
}
callBack.onCallBack(-1, null);
}
});
}
/**
* 获取聊天方的信息
*
* @param context
* @param memberID
* @param callBack
*/
public static void getChatUserInfo(Context context, String memberID, final Listener<Integer, List<UserInfo>> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.GET_CHATUSER_INFO));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("token", QLConstant.token);
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("memberID", memberID);
httpUtil.setEntity(entity);
httpUtil.setUseCache(true);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
try {
if (callBack == null || callBack.isCancel())
return;
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if (responseData != null && responseData.getWp_error_code() == 0) {
List<UserInfo> list = responseData.parseData("root", new TypeToken<List<UserInfo>>() {
});
callBack.onCallBack(1, list);
return;
}
} catch (Exception e) {
e.printStackTrace();
}
callBack.onCallBack(-1, null);
}
});
}
/**
* 请求验证码
*
* @param context
* @param phone
* @param callBack
*/
public static void sendVerification(Context context, String phone, String sid , String imageCode , String type, final Listener<Integer, String> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.SEND_VERIFICATION));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("token", QLConstant.token);
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("phone", phone);
entity.put("type", type);
entity.put("sid", sid);
entity.put("imgCode", imageCode);
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
String msg = null;
try {
if (callBack == null || callBack.isCancel())
return;
JSONObject json = QLJsonUtil.doJSONObject(reply.getReplyMsgAsString());
Boolean flag = QLJsonUtil.doBoolean(json.get("success"));
msg = QLJsonUtil.doString(json.get("msg"));
if (json != null && flag) {
callBack.onCallBack(1, msg);
return;
}
} catch (Exception e) {
e.printStackTrace();
if (msg == null) {
msg = e.getMessage();
}
}
callBack.onCallBack(-1, msg);
}
});
}
/**
* 检查验证码
*
* @param context
* @param phone
* @param registerCode
* @param callBack
*/
public static void checkVerification(Context context, String phone, String registerCode, final Listener<Integer, String> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.REGISTER_ISEFFECTIVE));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("token", QLConstant.token);
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("phone", phone);
entity.put("code", registerCode);
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
try {
if (callBack == null || callBack.isCancel())
return;
JSONObject json = QLJsonUtil.doJSONObject(reply.getReplyMsgAsString());
if (json != null) {
Boolean flag = QLJsonUtil.doBoolean(json.get("success"));
String msg = QLJsonUtil.doString(json.get("msg"));
if (flag) {
callBack.onCallBack(1, msg);
return;
} else {
callBack.onCallBack(-1, msg);
return;
}
}
} catch (Exception e) {
e.printStackTrace();
}
callBack.onCallBack(-2, null);
}
});
}
/**
* 修改用户密码
*
* @param context
* @param primarykey
* @param oldPassword
* @param newPassword
* @param callBack
*/
public static void changePsw(Context context, String primarykey, String oldPassword, String newPassword, final Listener<Integer, String> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.CHANGE_PSW_URL));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("token", QLConstant.token);
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("primarykey", primarykey);
entity.put("oldPassword", oldPassword);
entity.put("newPassword", newPassword);
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
try {
if (callBack == null || callBack.isCancel())
return;
JSONObject json = QLJsonUtil.doJSONObject(reply.getReplyMsgAsString());
Boolean flag = QLJsonUtil.doBoolean(json.get("success"));
String msg = QLJsonUtil.doString(json.get("msg"));
if (json != null && flag) {
callBack.onCallBack(1, msg);
return;
} else {
callBack.onCallBack(-1, msg);
return;
}
} catch (Exception e) {
e.printStackTrace();
}
callBack.onCallBack(-1, null);
}
});
}
// 根据电话号码获取用户信息
// SHOW_PHONEMEMBER_INFO_URL
public static void getPhoneMemerInfo(Context context, String phone, final Listener<Integer, List<UserInfo>> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.SHOW_PHONEMEMBER_INFO_URL));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("token", QLConstant.token);
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("wp_friends_info_id", phone);
httpUtil.setEntity(entity);
httpUtil.setUseCache(true);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
try {
if (callBack == null || callBack.isCancel())
return;
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if (responseData != null && responseData.getWp_error_code() == 0) {
List<UserInfo> list = responseData.parseData("root", new TypeToken<List<UserInfo>>() {
});
callBack.onCallBack(1, list);
return;
}
} catch (Exception e) {
e.printStackTrace();
}
callBack.onCallBack(-1, null);
}
});
}
/**
* 获取用户信息
*
* @param context
* @param memberId
* @param callback
*/
public static void getUserInfo(Context context, String memberId, final Listener<Integer, UserInfo> callback) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.GET_USER_INFO));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.put("o_wp_member_info_id", memberId);
httpUtil.setEntity(entity);
httpUtil.setUseCache(true);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if (callback == null || callback.isCancel()) {
return;
}
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if (responseData != null && responseData.getCode() == 0) {
List<UserInfo> tmp_userInfos = responseData.parseData("root", new TypeToken<List<UserInfo>>() {
});
if (tmp_userInfos != null && tmp_userInfos.size() > 0) {
callback.onCallBack(1, tmp_userInfos.get(0));
return;
}
}
callback.onCallBack(-1, null);
}
});
}
/**
* 修改用户昵称
*
* @param context
* @param wp_child_manager_id
* @param child_name
* @param callBack
*/
public static void modifyNick(Context context, String wp_child_manager_id, String child_name, final Listener<Integer, String> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.MODIFY_NICK_SUB));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.put("wp_child_user_info_id", wp_child_manager_id);
entity.put("device_child_name", child_name);
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
try {
if (callBack == null || callBack.isCancel())
return;
JSONObject json = QLJsonUtil.doJSONObject(reply.getReplyMsgAsString());
Boolean flag = QLJsonUtil.doBoolean(json.get("success"));
String msg = QLJsonUtil.doString(json.get("msg"));
if (json != null && flag) {
callBack.onCallBack(1, msg);
return;
} else {
callBack.onCallBack(-1, msg);
return;
}
} catch (Exception e) {
e.printStackTrace();
}
callBack.onCallBack(-1, "修改失败");
}
});
}
/**
* 获取好友列表
*
* @param context
* @param callBack
*/
public static void getFriendsList(Context context, final Listener<List<FriendInfo>, List<FriendInfo>> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.SHOW_FRIEND_LIST_INFO_URL));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
httpUtil.setEntity(entity);
// httpUtil.setUseCache(true);
httpUtil.setUseCache(false);
httpUtil.setConnectionTimeOut(1000 * 60);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
try {
if (callBack == null || callBack.isCancel())
return;
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if (responseData != null && responseData.getWp_error_code() == 0) {
List<FriendInfo> requestInfos = responseData.parseData("request", new TypeToken<List<FriendInfo>>() {});
List<FriendInfo> list = responseData.parseData("root", new TypeToken<List<FriendInfo>>() {});
callBack.onCallBack(requestInfos, list);
return;
}
} catch (Exception e) {
Log.v("hhhh", "error" + e.toString());
e.printStackTrace();
}
callBack.onCallBack(null, null);
}
});
}
/**
* 添加好友请求
*
* @param context
* @param phone
* @param validation
* @param callBack
*/
public static void addFriends(Context context, String phone, String validation, final Listener<Integer, String> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.ADD_FRIEND_LIST_INFO_URL));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.put("phone", phone);
entity.put("validation", validation);
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
String msg = null;
try {
if (callBack == null || callBack.isCancel())
return;
JSONObject json = QLJsonUtil.doJSONObject(reply.getReplyMsgAsString());
Boolean flag = QLJsonUtil.doBoolean(json.get("success"));
msg = QLJsonUtil.doString(json.get("wp_error_msg"));
if (json != null && flag) {
callBack.onCallBack(1, msg);
return;
}
} catch (Exception e) {
Log.v("hhhh", "error" + e.toString());
e.printStackTrace();
}
callBack.onCallBack(-1, msg);
}
});
}
/**
* 删除好友
*
* @param context
* @param wp_friends_info_id
* @param callBack
*/
public static void deleteFriends(Context context, String wp_friends_info_id, final Listener<Integer, String> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.DELETE_FRIEND_LIST_INFO_URL));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.put("wp_friends_info_id", wp_friends_info_id);
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
String msg = null;
try {
if (callBack == null || callBack.isCancel())
return;
JSONObject json = QLJsonUtil.doJSONObject(reply.getReplyMsgAsString());
Boolean flag = QLJsonUtil.doBoolean(json.get("success"));
msg = QLJsonUtil.doString(json.get("wp_error_msg"));
if (json != null && flag) {
callBack.onCallBack(1, msg);
return;
}
} catch (Exception e) {
Log.v("hhhh", "error" + e.toString());
e.printStackTrace();
}
callBack.onCallBack(-1, msg);
}
});
}
/**
* 确认添加好友
*
* @param context
* @param add_friend_id
* @param request_accept
* @param message_id
* @param callBack
*/
public static void ensureFriends(Context context, String add_friend_id, int request_accept, String message_id, final Listener<Integer, String> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.CONFIRM_FRIEND_LIST_INFO_URL));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.put("add_friend_id", add_friend_id);
entity.put("request_accept", request_accept);
entity.put("message_id", message_id);
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
String msg = null;
try {
if (callBack == null || callBack.isCancel())
return;
JSONObject json = QLJsonUtil.doJSONObject(reply.getReplyMsgAsString());
Boolean flag = QLJsonUtil.doBoolean(json.get("success"));
msg = QLJsonUtil.doString(json.get("error"));
if (json != null && flag) {
callBack.onCallBack(1, msg);
return;
}
} catch (Exception e) {
Log.v("hhhh", "error" + e.toString());
e.printStackTrace();
}
callBack.onCallBack(-1, msg);
}
});
}
// ---------------------接口转向member_id by 2017-04-21------------------------start
/**
* 添加好友请求
*
* @param context
* @param friend_id
* @param validation
* @param callBack
*/
public static void addFriendsById(Context context, String friend_id, String validation, final Listener<Integer, String> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.ADD_FRIEND_BY_ID_INFO_URL));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.put("wp_friends_info_id", friend_id);
entity.put("validation", validation);
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
String msg = null;
try {
if (callBack == null || callBack.isCancel())
return;
JSONObject json = QLJsonUtil.doJSONObject(reply.getReplyMsgAsString());
Boolean flag = QLJsonUtil.doBoolean(json.get("success"));
msg = QLJsonUtil.doString(json.get("wp_error_msg"));
if (json != null && flag) {
callBack.onCallBack(1, msg);
return;
}
} catch (Exception e) {
Log.v("hhhh", "error" + e.toString());
e.printStackTrace();
}
callBack.onCallBack(-1, msg);
}
});
}
/**
* 删除好友
*
* @param context
* @param wp_friends_info_id
* @param callBack
*/
public static void deleteFriendsById(Context context, String wp_friends_info_id, final Listener<Integer, String> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.DELETE_FRIEND_BY_ID_INFO_URL));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.put("wp_friends_info_id", wp_friends_info_id);
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
String msg = null;
try {
if (callBack == null || callBack.isCancel())
return;
JSONObject json = QLJsonUtil.doJSONObject(reply.getReplyMsgAsString());
Boolean flag = QLJsonUtil.doBoolean(json.get("success"));
msg = QLJsonUtil.doString(json.get("wp_error_msg"));
if (json != null && flag) {
callBack.onCallBack(1, msg);
return;
}
} catch (Exception e) {
Log.v("hhhh", "error" + e.toString());
e.printStackTrace();
}
callBack.onCallBack(-1, msg);
}
});
}
// ---------------------接口转向member_id by 2017-04-21------------------------end
/**
* 加载名片列表
*
* @param context
* @param callback
*/
public static void getMyCardList(Context context, final Listener<Void, List<CardInfo>> callback) {
QLHttpUtil httpUtil = new QLHttpGet(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.GET_MY_CAR_LIST));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
httpUtil.setEntity(entity);
httpUtil.setUseCache(true);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if (callback == null || callback.isCancel()) {
return;
}
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if (responseData != null && responseData.isSuccess()) {
List<CardInfo> tmp_info = responseData.parseData("root", new TypeToken<List<CardInfo>>() {
});
if (tmp_info != null) {
callback.onCallBack(null, tmp_info);
return;
}
}
callback.onCallBack(null, null);
}
});
}
/**
* 创建名片
*
* @param context
* @param info
* @param img
* @param callback
* @throws IOException
*/
public static void createCard(Context context, CardInfo info, String img, final Listener<Integer, String> callback) throws IOException {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.ADD_CARD_INFO));
Gson gson = new Gson();
String cardInfoString = gson.toJson(info);
String base64_str = YYFileManager.imgToBase64(img);
// byte[] imgBase64Byte = null;
// byte[] srcByte = YYFileManager.readFile(context, img);
// if (srcByte != null) {
// imgBase64Byte = Base64.decode(srcByte);
// srcByte = null;
// base64_str = new String(imgBase64Byte);
// imgBase64Byte = null;
// }
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.put("info", cardInfoString);
if (base64_str != null) {
entity.put("img_file", base64_str);
}
httpUtil.setEntity(entity);
httpUtil.setUseCache(true);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if (callback == null || callback.isCancel()) {
return;
}
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if (responseData != null && responseData.isSuccess()) {
callback.onCallBack(1, null);
return;
}
callback.onCallBack(-1, null);
}
});
base64_str = null;
}
/**
* @param context
* @param info
* @param img
* @param callback
* @throws IOException
*/
public static void modifyCard(Context context, CardInfo info, String img, final Listener<Integer, String> callback) throws IOException {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.MODIFY_CARD_INFO));
Gson gson = new Gson();
String cardInfoString = gson.toJson(info);
String base64_str = YYFileManager.imgToBase64(img);
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.put("info", cardInfoString);
if (base64_str != null) {
entity.put("img_file", base64_str);
}
httpUtil.setEntity(entity);
httpUtil.setUseCache(true);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if (callback == null || callback.isCancel()) {
return;
}
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
String msg = null;
if (responseData != null && responseData.isSuccess()) {
callback.onCallBack(1, null);
return;
} else if (responseData != null) {
msg = responseData.getErrorMsg();
}
callback.onCallBack(-1, msg);
}
});
base64_str = null;
}
/**
* 删除名片
*
* @param context
* @param cardId
* @param callback
*/
public static void removeCard(Context context, String cardId, final Listener<Integer, String> callback) {
QLHttpUtil httpUtil = new QLHttpGet(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.REMOVE_CARD_INFO));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.put("bc_id", cardId);
httpUtil.setEntity(entity);
httpUtil.setUseCache(true);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if (callback == null || callback.isCancel()) {
return;
}
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
String msg = null;
if (responseData != null && responseData.isSuccess()) {
callback.onCallBack(1, null);
return;
} else if (responseData != null) {
msg = responseData.getErrorMsg();
}
callback.onCallBack(-1, msg);
}
});
}
/**
* 获取名片信息
*
* @param context
* @param cardId
* @param callback
*/
public static void getCardInfo(Context context, String cardId, final Listener<Integer, CardInfo> callback) {
QLHttpUtil httpUtil = new QLHttpGet(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.GET_CARD_INFO));
HashMap<String, Object> entity = new HashMap<>();
entity.put("member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.put("bc_id", cardId);
httpUtil.setEntity(entity);
httpUtil.setUseCache(true);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if (callback == null || callback.isCancel()) {
return;
}
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if (responseData != null && responseData.isSuccess()) {
List<CardInfo> tempList = responseData.parseData("root", new TypeToken<List<CardInfo>>() {
});
callback.onCallBack(1, tempList.get(0));
return;
}
callback.onCallBack(-1, null);
}
});
}
/*
* 更改好友备注
*/
public static void updataFriendName(Context context, String friend_name, String friend_id, final Listener<Boolean, String> listener) {
QLHttpUtil httpUtil = new QLHttpGet(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.UPDATA_FRIEND_NAME));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.put("friend_name", friend_name);
entity.put("add_friend_id", friend_id);
httpUtil.setEntity(entity);
httpUtil.setUseCache(true);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if (listener == null || listener.isCancel()) {
return;
}
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
String msg = null;
if (responseData != null && responseData.isSuccess()) {
listener.onCallBack(true, null);
return;
}else if(responseData!=null){
listener.onCallBack(false, responseData.getErrorMsg());
}else{
listener.onCallBack(false, "未知错误");
}
}
});
}
// 提交用户对app的问题
public static void postHelpAndFeedback(Context context, String content, final Listener<Integer, String> listener) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.POST_CONTENT));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.put("helpInfo", content);
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if (listener == null || listener.isCancel()) {
return;
}
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
String msg = null;
if (responseData != null) {
listener.onCallBack(1, null);
return;
}
listener.onCallBack(-1, null);
}
});
}
public static void getSearchAllMessage(Context context, String keyword, final Listener<Integer, SearchInfo> listener) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.SEARCH_DATAS));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("member_info_id", QLConstant.client_id);
entity.put("keyword", keyword);
httpUtil.setEntity(entity);
httpUtil.setUseCache(true);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if (listener == null || listener.isCancel()) {
return;
}
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if (responseData != null && responseData.isSuccess()) {
Gson gson = new Gson();
SearchInfo info = gson.fromJson(responseData.getSouceJsonString(), SearchInfo.class);
listener.onCallBack(1, info);
return;
}
listener.onCallBack(-1, null);
}
});
}
/**
* 添加好友的列表
*
* @param context
* @param callBack
*/
public static void getListFriendMessage(Context context, final Listener<List<FriendInfo>, List<FriendInfo>> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.GET_LIST_FRIEND_MESSAGE));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
httpUtil.setEntity(entity);
httpUtil.setUseCache(true);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
try {
if (callBack == null || callBack.isCancel())
return;
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if (responseData != null && responseData.getWp_error_code() == 0) {
List<FriendInfo> requestInfos = responseData.parseData("request", new TypeToken<List<FriendInfo>>() {
});
List<FriendInfo> list = responseData.parseData("root", new TypeToken<List<FriendInfo>>() {
});
callBack.onCallBack(requestInfos, list);
return;
}
} catch (Exception e) {
Log.v("hhhh", "error" + e.toString());
e.printStackTrace();
}
callBack.onCallBack(null, null);
}
});
}
/**
* 搜索
*
* @param context
* @param callBack
*/
public static void searchFriend(Context context,String keyword,int start,int limit, final Listener<List<FriendInfo>, String> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.SEARCH_RESULT));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.put("keyword", keyword);
entity.put("start", start);
entity.put("limit", limit);
httpUtil.setEntity(entity);
httpUtil.setUseCache(true);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
try {
if (callBack == null || callBack.isCancel())
return;
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if (responseData != null && responseData.getWp_error_code() == 0) {
List<FriendInfo> list = responseData.parseData("root", new TypeToken<List<FriendInfo>>() {
});
callBack.onCallBack(list, null);
return;
}
} catch (Exception e) {
Log.v("hhhh", "error" + e.toString());
e.printStackTrace();
}
callBack.onCallBack(null, null);
}
});
}
public static void getRandomRecommendMember(Context context,String org_id, final Listener<List<OrgRecommendMemberInfo>, String> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.GET_RECOMMEND_MEM));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.put("org_id", org_id);
httpUtil.setEntity(entity);
httpUtil.setUseCache(true);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
try {
if (callBack == null || callBack.isCancel())
return;
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if (responseData != null && responseData.getWp_error_code() == 0) {
List<OrgRecommendMemberInfo> list = responseData.parseData("root", new TypeToken<List<OrgRecommendMemberInfo>>() {
});
callBack.onCallBack(list, null);
return;
}
} catch (Exception e) {
Log.v("hhhh", "error" + e.toString());
e.printStackTrace();
}
callBack.onCallBack(null, null);
}
});
}
/**
* 删除好友请求
*
* @param context
* @param listener deleteFriendRequestMessageUserManagerController
*/
public static void deleteFriendRequestMessage(Context context, final Listener<Integer, String> listener) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.DELE_REQUEST_FRIEND_MESSAGE));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if (listener == null && listener.isCancel()) {
return;
}
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if (responseData != null && responseData.isSuccess()) {
listener.onCallBack(1, null);
return;
}
if (responseData != null) {
listener.onCallBack(-1, responseData.getErrorMsg());
}
}
});
}
/**
* 微信登录
* @param context
* @param listener
*/
public static void weiXinLogin(final Context context , String code , final Listener<Boolean , ArrayList<UserInfo>> listener ){
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.WEIXING_SIGN_IN));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("code", code );
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if(null == listener || listener.isCancel()){
return;
}
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if( null != responseData && responseData.isSuccess()){
JSONObject json = QLJsonUtil.doJSONObject(reply.getReplyMsgAsString());
QLConstant.token = QLJsonUtil.doString(json.get("token"));
SharepreferencesUtils utils = new SharepreferencesUtils(context);
utils.setToken(QLConstant.token);
ArrayList<UserInfo> list = responseData.parseData("root", new TypeToken<ArrayList<UserInfo>>() {});
UserInfo info = null;
if (list != null && list.size() > 0) {
info = list.get(0);
_usinfo = info;
PropertySaveHelper.getHelper().save(info, kUSER_INFO_KEY);
}
listener.onCallBack(true , list);
}else{
if (null != responseData && responseData.getWp_error_code()== 222){
ArrayList<UserInfo> list = new ArrayList<UserInfo>();
UserInfo info = new UserInfo();
JSONObject json = QLJsonUtil.doJSONObject(reply.getReplyMsgAsString());
info.setNickName(QLJsonUtil.doString(json.get("nickname")));
info.setPicture_url(QLJsonUtil.doString(json.get("headimgurl")));
list.add(info);
listener.onCallBack(false , list);
}else
listener.onCallBack(false , null);
}
}
});
}
/**
* 微信注册
* @param context
* @param listener
*/
public static void weiXinRegister(final Context context , String code , final Listener<Boolean , ArrayList<UserInfo>> listener ){
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.WEIXING_REGISTER));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("code", code );
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if(null == listener || listener.isCancel()){
return;
}
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if( null != responseData && responseData.isSuccess()){
JSONObject json = QLJsonUtil.doJSONObject(reply.getReplyMsgAsString());
QLConstant.token = QLJsonUtil.doString(json.get("token"));
SharepreferencesUtils utils = new SharepreferencesUtils(context);
utils.setToken(QLConstant.token);
ArrayList<UserInfo> list = responseData.parseData("root", new TypeToken<ArrayList<UserInfo>>() {});
UserInfo info = null;
if (list != null && list.size() > 0) {
info = list.get(0);
_usinfo = info;
PropertySaveHelper.getHelper().save(info, kUSER_INFO_KEY);
}
listener.onCallBack(true , list);
}else{
if (null != responseData && responseData.getCode() == 222){
listener.onCallBack(false , new ArrayList<UserInfo>());
}else
listener.onCallBack(false , null);
}
}
});
}
/**
* 微信绑定已有账号
* @param context
* @param listener
*/
public static void weiXinBindAccount(final Context context , String code ,String phone,String psd, final Listener<Boolean , UserInfo> listener ){
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.WEIXING_BINBING_BINBING));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("code", code );
entity.put("phone", phone );
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
String date = sdf.format(new Date());
entity.put("password", EncryptUtils.getMD5(date+EncryptUtils.getMD5(psd)));
entity.put("sec", date);
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if(null == listener || listener.isCancel()){
return;
}
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if( null != responseData && responseData.isSuccess()){
JSONObject json = QLJsonUtil.doJSONObject(reply.getReplyMsgAsString());
QLConstant.token = QLJsonUtil.doString(json.get("token"));
SharepreferencesUtils utils = new SharepreferencesUtils(context);
utils.setToken(QLConstant.token);
ArrayList<UserInfo> list = responseData.parseData("root", new TypeToken<ArrayList<UserInfo>>() {});
UserInfo info = null;
if (list != null && list.size() > 0) {
info = list.get(0);
_usinfo = info;
PropertySaveHelper.getHelper().save(info, kUSER_INFO_KEY);
}
listener.onCallBack(true , info);
}else{
listener.onCallBack(false , null);
}
}
});
}
/**
* 绑定用户
*
* @param context
* @param phone
* @param
* @param callBack
*/
public static void buiding(final Context context, String phone ,String code,String password, final Listener<Boolean, String> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.WEIXING_BUIBING_PHONE));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.put("phone", phone );
entity.put("code", code );
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
String date = sdf.format(new Date());
entity.put("password", EncryptUtils.getMD5(date+EncryptUtils.getMD5(password)));
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if (callBack == null || callBack.isCancel()){
return;
}
String msg = "";
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if( null != responseData && responseData.isSuccess() ){
msg = "绑定成功";
callBack.onCallBack(true , msg );
return;
}else if(null != responseData){
msg = responseData.getError() ;
}else{
msg = "未知错误" ;
}
callBack.onCallBack(false , msg );
}
});
}
/**
* 绑定用户
* @param context
* @param
* @param
* @param code
* @param
* @param callBack
*/
public static void buidingUser(final Context context, String wp_member_info_id , String code , final Listener<Boolean, String> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.WEIXING_BINBING_USER));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", wp_member_info_id );
entity.put("code", code );
entity.put("token", QLConstant.token );
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if (callBack == null || callBack.isCancel()){
return;
}
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if ( null != responseData && responseData.isSuccess()) {
callBack.onCallBack(true, null);
return;
}
if (responseData != null) {
callBack.onCallBack(false, responseData.getError());
}
}
});
}
/**
* 解绑微信
* @param context
* @param
* @param
* @param code
* @param
* @param callBack
*/
public static void unbuidWx(final Context context, final Listener<Boolean, String> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.WEIXING_RELIEVE_BINBING));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id );
entity.put("token", QLConstant.token );
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if (callBack == null || callBack.isCancel()){
return;
}
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if ( null != responseData && responseData.isSuccess()) {
callBack.onCallBack(true, null);
return;
}
if (responseData != null) {
callBack.onCallBack(false, responseData.getError());
}
}
});
}
public static void checkToken(final Context context,String member_id,String token, final Listener<Boolean, String> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.CHECK_TOKEN));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", member_id);
entity.put("token", token );
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if (callBack == null || callBack.isCancel()){
return;
}
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if ( null != responseData && responseData.isSuccess()) {
callBack.onCallBack(true, null);
return;
}
if (responseData != null) {
callBack.onCallBack(false, responseData.getError());
}
}
});
}
public static void getCompanyTrade(final Context context , int searchType ,final Listener<Boolean , List<TradeInfo>> listener ){
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.GET_INDUSTRY_OR_SCOPE));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("searchType", searchType);
httpUtil.setEntity(entity);
httpUtil.setUseCache(false);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
if(null == listener || listener.isCancel()){
return;
}
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if( null != responseData && responseData.isSuccess()){
ArrayList<TradeInfo> list = responseData.parseData("root", new TypeToken<ArrayList<TradeInfo>>() {});
listener.onCallBack(true , list);
}else{
listener.onCallBack(false , null);
}
}
});
}
/**
* 获取好友列表
*
* @param context
* @param callBack
*/
/**
*
* 通讯录查询好友关系
*
* @param context
* @param callBack
*/
public static void contactCheck(Context context,String phones, final Listener<List<UserInfo>, String> callBack) {
QLHttpUtil httpUtil = new QLHttpPost(context);
httpUtil.setUrl(HttpConfig.getUrl(HttpConfig.CHECK_CONTACT_URL));
HashMap<String, Object> entity = new HashMap<String, Object>();
entity.put("wp_member_info_id", QLConstant.client_id);
entity.put("token", QLConstant.token);
entity.put("phones", phones);
httpUtil.setEntity(entity);
httpUtil.setUseCache(true);
httpUtil.setConnectionTimeOut(1000 * 60);
httpUtil.startConnection(new QLHttpResult() {
@Override
public void reply(QLHttpReply reply) {
try {
if (callBack == null || callBack.isCancel())
return;
YYResponseData responseData = YYResponseData.parseJsonString(reply.getReplyMsgAsString());
if (responseData != null && responseData.getWp_error_code() == 0) {
List<UserInfo> requestInfos = responseData.parseData("root", new TypeToken<List<UserInfo>>() {});
callBack.onCallBack(requestInfos, null);
return;
}
} catch (Exception e) {
Log.v("hhhh", "error" + e.toString());
e.printStackTrace();
}
callBack.onCallBack(null, null);
}
});
}
}
|
Zhangsongsong/GraduationPro
|
毕业设计/code/android/YYFramework/src/app/logic/controller/UserManagerController.java
|
Java
|
apache-2.0
| 78,338
|
<!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/html; charset=utf-8" />
<title>Scaling Across Multiple Machines — ownCloud Server Administration Manual 8.1 documentation</title>
<link rel="stylesheet" href="../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../_static/bootstrap-sphinx.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '8.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/bootstrap.js"></script>
<link rel="top" title="ownCloud Server Administration Manual 8.1 documentation" href="../index.html" />
<link rel="up" title="Operations" href="index.html" />
<link rel="next" title="Theming ownCloud" href="theming.html" />
<link rel="prev" title="Considerations on Monitoring" href="considerations_on_monitoring.html" />
<script type="text/javascript">
(function () {
/**
* Patch TOC list.
*
* Will mutate the underlying span to have a correct ul for nav.
*
* @param $span: Span containing nested UL's to mutate.
* @param minLevel: Starting level for nested lists. (1: global, 2: local).
*/
var patchToc = function ($ul, minLevel) {
var findA;
// Find all a "internal" tags, traversing recursively.
findA = function ($elem, level) {
var level = level || 0,
$items = $elem.find("> li > a.internal, > ul, > li > ul");
// Iterate everything in order.
$items.each(function (index, item) {
var $item = $(item),
tag = item.tagName.toLowerCase(),
pad = 15 + ((level - minLevel) * 10);
if (tag === 'a' && level >= minLevel) {
// Add to existing padding.
$item.css('padding-left', pad + "px");
console.log(level, $item, 'padding-left', pad + "px");
} else if (tag === 'ul') {
// Recurse.
findA($item, level + 1);
}
});
};
console.log("HERE");
findA($ul);
};
$(document).ready(function () {
// Add styling, structure to TOC's.
$(".dropdown-menu").each(function () {
$(this).find("ul").each(function (index, item){
var $item = $(item);
$item.addClass('unstyled');
});
$(this).find("li").each(function () {
$(this).parent().append(this);
});
});
// Patch in level.
patchToc($("ul.globaltoc"), 2);
patchToc($("ul.localtoc"), 2);
// Enable dropdown.
$('.dropdown-toggle').dropdown();
});
}());
</script>
</head>
<body>
<div class="container">
<div class="content">
<div class="page-header">
<h1><a href="../contents.html">ownCloud Server Administration Manual</a></h1>
</div>
<div class="row">
<div class="span3">
<div class="sidebar">
<div class="well">
<div class="menu-support-container">
<ul id="menu-support" class="menu">
<ul>
<li><a href="../contents.html">Table of Contents</a></li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../index.html">ownCloud 8.1 Server Administration Manual Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../release_notes.html">ownCloud 8.1 Release Notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../whats_new_admin.html">What’s New for Admins in ownCloud 8</a></li>
<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../configuration_user/index.html">User Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../configuration_files/index.html">File Sharing and Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../configuration_server/index.html">ownCloud Server Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../configuration_database/index.html">Database Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../maintenance/index.html">Maintenance</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Operations</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="considerations_on_monitoring.html">Considerations on Monitoring</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="">Scaling Across Multiple Machines</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#application-layer">Application Layer</a></li>
<li class="toctree-l3"><a class="reference internal" href="#database-layer">Database Layer</a></li>
<li class="toctree-l3"><a class="reference internal" href="#storage-layer">Storage Layer</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="theming.html">Theming ownCloud</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../issues/index.html">Issues and Troubleshooting</a></li>
<li class="toctree-l1"><a class="reference internal" href="../videos/index.html">ownCloud Videos</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../enterprise_installation/index.html">Enterprise Subscription Installation (ES Only)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enterprise_clients/index.html">Creating Branded ownCloud Clients (ES only)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enterprise_external_storage/index.html">External Storage (ES only)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enterprise_user_management/index.html">User Management (ES only)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enterprise_files_drop/index.html">Enabling Anonymous Uploads with Files Drop (ES Only)</a></li>
</ul>
</ul>
</div>
</div>
</div>
</div>
<div class="span9">
<div class="page-content">
<div class="section" id="scaling-across-multiple-machines">
<h1>Scaling Across Multiple Machines<a class="headerlink" href="#scaling-across-multiple-machines" title="Permalink to this headline">¶</a></h1>
<div class="toctree-wrapper compound">
</div>
<p>This document will cover the reference architecture for the ownCloud Scale out
model for a single datacenter implementation. The document will focus on the
three main elements of an ownCloud deployment:</p>
<ul class="simple">
<li>Application layer</li>
<li>Database Layer</li>
<li>Storage Layer</li>
</ul>
<p>At each layer the goal is to provide the ability to scale, while providing high
availability whole maintaining the needed level of performance.</p>
<div class="section" id="application-layer">
<h2>Application Layer<a class="headerlink" href="#application-layer" title="Permalink to this headline">¶</a></h2>
<p>For the application layer of this reference architecture we used Oracle
Enterprise Linux as the front end servers to host the ownCloud code. In this
instance we made httpd a permissive domain allowing it to operate within the
SELinux environment. In this example we also used the standard directory
structure placing the ownCloud code in the apache root directory. The
following components where installed on each application server:</p>
<ul class="simple">
<li>Apache</li>
<li>PHP 5.4.x</li>
<li>PHP-GD</li>
<li>PHP-XML</li>
<li>PHP-MYSQL</li>
<li>PHP-CURL</li>
<li>SMBCLIENT</li>
</ul>
<p>It is also worth mentioning that the appropriate exceptions where made in the
firewall to allow the ownCloud traffic (for the purposes for of testing we
enable both encrypted SSL via port 443 and unencrypted via port 80).</p>
<p>The next step was to generate and import the needed SSL certificates following
the standard process in the OEL documentation.</p>
<p>The next step is to create a scalable environment at the application layer,
which introduces the load balancer. Because the application servers here are
stateless, simply taking the configuration above and replicating (once
configured with storage and database connections) and placing behind a load
balancer will provide a scalable and highly available environment.
For this purpose we chose HAProxy and configured it for HTTPS traffic following
the documentation found here <a class="reference external" href="http://haproxy.1wt.eu/#doc1.5">http://haproxy.1wt.eu/#doc1.5</a></p>
<p>It is worth noting that this particular load balancer is not required, use of
any commercial load balancer (i.e. F5) will work here. It is also worth noting
that the HAProxy servers where setup with a heartbeat and IP Shift to failover
the IP address should one fail.</p>
<img alt="../_images/scaling-1.png" src="../_images/scaling-1.png" style="width: 3.4937in; height: 4.5134in;" />
</div>
<div class="section" id="database-layer">
<h2>Database Layer<a class="headerlink" href="#database-layer" title="Permalink to this headline">¶</a></h2>
<p>For the purposes of this example, we have chosen a MySQL cluster using the NDB
Storage engine. The cluster was configured based on the documentation found
here <a class="reference external" href="http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster.html">http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster.html</a> with a sample
looking like this:</p>
<img alt="../_images/scaling-2.png" src="../_images/scaling-2.png" style="width: 6in; height: 3.0673in;" />
<p>Taking a closer look at the database architecture, we have created redundant
MySQL NDB Management nodes for redundancy and we have configured 3 NDB
SQL/Storage nodes across which we are able to spread the database traffic. All
of the clients (ownCloud Application Servers) will connect to the database vi
the My SQL Proxy. It is worth noting that MySQL proxy is still in beta, using
another load balancing method like HAProxy or F5 is supported, in that you will
be distributing traffic among the various SQL/Storage nodes. Here, we simply
swap out the MySQL Proxy for a properly configured HAProxy giving us the
following:</p>
<img alt="../_images/scaling-3.png" src="../_images/scaling-3.png" style="width: 6in; height: 0.7311in;" />
<p>In this example we have also added a second HAProxy server with Heartbeat to prevent any single point of failure.
We have also implemented NIC bonding to load balance the traffic across multiple physical NICs.</p>
</div>
<div class="section" id="storage-layer">
<h2>Storage Layer<a class="headerlink" href="#storage-layer" title="Permalink to this headline">¶</a></h2>
<p>Storage was deployed using the Red Hat Storage server with the GlusterFS
(pre-configured as part of the Red Hat Storage Server offering).</p>
<p>The Red Hat Storage Servers where configured based on documentation found here
<a class="reference external" href="https://access.redhat.com/site/documentation/en-US/Red_Hat_Storage/2.0/html/Administration_Guide/Admin_Guide_Part_1.html">https://access.redhat.com/site/documentation/en-US/Red_Hat_Storage/2.0/html/Administration_Guide/Admin_Guide_Part_1.html</a></p>
<p>For the purposes of scale and high availability we configured a distributed
replicated volume with IP Fail Over. Configuring the storage on a separate
subnet with bonded NICs at the application server level. We have chosen to
address the storage using NFS and for high availability we have chosen to
implement IP Failover of the storage as documented here
<a class="reference external" href="https://access.redhat.com/site/documentation/en-US/Red_Hat_Storage/2.0/html/Administration_Guide/ch09s04.html">https://access.redhat.com/site/documentation/en-US/Red_Hat_Storage/2.0/html/Administration_Guide/ch09s04.html</a></p>
<img alt="../_images/scaling-4.png" src="../_images/scaling-4.png" style="width: 3.8693in; height: 3.6272in;" />
<p>We chose to deploy the storage in this fashion to address both HA and
extensibility of the storage, along with managing performance by simply adding
additional bricks to the storage volume, back-ended by additional physical
disk.</p>
<p>It is worth noting that several options are available for storage configuration
(Such as striped replicated volumes). A discussion around the type of IO
performance required and the needed HA configuration needs to take place to
understand the best possible option here.</p>
<p>Adding up the parts:</p>
<p>If we add up the parts, we have the following:</p>
<ul class="simple">
<li>An application layer that supports dynamic expansion through the addition of additional servers and provides HA behind a load balancer</li>
<li>A database layer that can also be scaled through the addition of additional SQL/Storage nodes and will provide HA behind a load balancer</li>
<li>A storage layer that dynamically expand to meet storage needs, will scale based on backend hardware, and provides HA via IP Failover</li>
</ul>
<img alt="../_images/scaling-5.png" src="../_images/scaling-5.png" style="width: 4.4937in; height: 5.2134in;" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
|
kebenxiaoming/owncloudRedis
|
core/doc/admin/operations/scaling_multiple_machines.html
|
HTML
|
apache-2.0
| 13,814
|
import stainless.lang._
import stainless.collection._
import stainless.annotation._
object Counter {
import Actors._
case class PrimBehav(backup: ActorRef, counter: Counter) extends Behavior {
require(backup.name == "backup")
override
def processMsg(msg: Msg)(implicit ctx: ActorContext): Behavior = msg match {
case Inc() =>
backup ! Inc()
PrimBehav(backup, counter.increment)
case _ => this
}
}
case class BackBehav(counter: Counter) extends Behavior {
override
def processMsg(msg: Msg)(implicit ctx: ActorContext): Behavior = msg match {
case Inc() =>
BackBehav(counter.increment)
case _ => this
}
}
@extern @pure
def noSender = akka.actor.ActorRef.noSender
val Primary = ActorRef("primary", noSender)
val Backup = ActorRef("backup", noSender)
case class Inc() extends Msg
case class Counter(value: BigInt) {
require(value >= 0)
def increment: Counter = Counter(value + 1)
def <=(that: Counter): Boolean = this.value <= that.value
}
@ghost
def invariant(s: ActorSystem): Boolean = {
s.inboxes(Primary -> Primary).isEmpty &&
s.inboxes(Backup -> Primary).isEmpty &&
s.inboxes(Backup -> Backup).isEmpty &&
s.inboxes(Primary -> Backup).forall(_ == Inc()) && {
(s.behaviors(Primary), s.behaviors(Backup)) match {
case (PrimBehav(_, p), BackBehav(b)) =>
p.value == b.value + s.inboxes(Primary -> Backup).length
case _ => false
}
}
}
def validRef(ref: ActorRef): Boolean = ref == Primary || ref == Backup
@ghost
def theorem(s: ActorSystem, from: ActorRef, to: ActorRef): Boolean = {
require(invariant(s) && validRef(from) && validRef(to))
val newSystem = s.step(from, to)
invariant(newSystem)
}.holds
@ignore
def main(args: Array[String]): Unit = {
val initCounter = Counter(0)
val system = akka.actor.ActorSystem("Counter")
val backupRef = ActorRef(
"backup",
system.actorOf(
akka.actor.Props(new ActorWrapper(BackBehav(initCounter))),
name = "backup"
)
)
val primaryRef = ActorRef(
"primary",
system.actorOf(
akka.actor.Props(new ActorWrapper(PrimBehav(backupRef, initCounter))),
name = "primary"
)
)
implicit val ctx: ActorContext = ActorContext(primaryRef, Nil())
import system.dispatcher
import scala.concurrent.duration._
system.scheduler.schedule(500.millis, 1000.millis) {
primaryRef ! Inc()
}
}
}
|
epfl-lara/stainless
|
sbt-plugin/src/sbt-test/sbt-plugin/ghost/actor-tests/src/main/scala/Counter.scala
|
Scala
|
apache-2.0
| 2,547
|
/*
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package io.kubernetes.client.openapi.models;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/** EndpointHints provides hints describing how an endpoint should be consumed. */
@ApiModel(
description = "EndpointHints provides hints describing how an endpoint should be consumed.")
@javax.annotation.Generated(
value = "org.openapitools.codegen.languages.JavaClientCodegen",
date = "2021-12-10T19:11:23.904Z[Etc/UTC]")
public class V1EndpointHints {
public static final String SERIALIZED_NAME_FOR_ZONES = "forZones";
@SerializedName(SERIALIZED_NAME_FOR_ZONES)
private List<V1ForZone> forZones = null;
public V1EndpointHints forZones(List<V1ForZone> forZones) {
this.forZones = forZones;
return this;
}
public V1EndpointHints addForZonesItem(V1ForZone forZonesItem) {
if (this.forZones == null) {
this.forZones = new ArrayList<>();
}
this.forZones.add(forZonesItem);
return this;
}
/**
* forZones indicates the zone(s) this endpoint should be consumed by to enable topology aware
* routing.
*
* @return forZones
*/
@javax.annotation.Nullable
@ApiModelProperty(
value =
"forZones indicates the zone(s) this endpoint should be consumed by to enable topology aware routing.")
public List<V1ForZone> getForZones() {
return forZones;
}
public void setForZones(List<V1ForZone> forZones) {
this.forZones = forZones;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
V1EndpointHints v1EndpointHints = (V1EndpointHints) o;
return Objects.equals(this.forZones, v1EndpointHints.forZones);
}
@Override
public int hashCode() {
return Objects.hash(forZones);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class V1EndpointHints {\n");
sb.append(" forZones: ").append(toIndentedString(forZones)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
kubernetes-client/java
|
kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1EndpointHints.java
|
Java
|
apache-2.0
| 3,081
|
package com.alipay.api.response;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.open.public.topic.delete response.
*
* @author auto create
* @since 1.0, 2018-01-05 15:03:11
*/
public class AlipayOpenPublicTopicDeleteResponse extends AlipayResponse {
private static final long serialVersionUID = 7181399683249688542L;
}
|
wendal/alipay-sdk
|
src/main/java/com/alipay/api/response/AlipayOpenPublicTopicDeleteResponse.java
|
Java
|
apache-2.0
| 353
|
/*
* Copyright 2017 enocean4j development teams
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.co._4ng.enocean.protocol.serial.v3.network.packet.commoncommand;
import uk.co._4ng.enocean.protocol.serial.v3.network.packet.ESP3Packet;
/**
* Read ID range base number
*
* @author Andrea Biasi <biasiandrea04@gmail.com>
*/
public class CoRdIdbase extends ESP3Packet {
public CoRdIdbase() {
packetType = COMMON_COMMAND;
// Event code
data[0] = 0x08;
buildPacket();
}
}
|
steveohara/enocean4j
|
src/main/java/uk/co/_4ng/enocean/protocol/serial/v3/network/packet/commoncommand/CoRdIdbase.java
|
Java
|
apache-2.0
| 1,032
|
package com.saasovation.agilepm.domain.model.product.backlogitem;
public class CommittedBacklogItem {
}
|
yangcy2016/saasovation-all
|
agilepm-core/src/main/java/com/saasovation/agilepm/domain/model/product/backlogitem/CommittedBacklogItem.java
|
Java
|
apache-2.0
| 106
|
/*
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.cloud.hadoop.io.bigquery;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.api.services.bigquery.model.Table;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Joiner;
import java.util.List;
import javax.annotation.Nullable;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.InputFormat;
/**
* This class represents the logical "export" of BigQuery federated data source stored in Google
* Cloud Storage.
*
* <p>It extends {@link UnshardedExportToCloudStorage} to share the {@link
* org.apache.hadoop.mapreduce.lib.input.FileInputFormat} delegating logic.
*/
public class NoopFederatedExportToCloudStorage extends UnshardedExportToCloudStorage {
protected final List<String> gcsPaths;
public NoopFederatedExportToCloudStorage(
Configuration configuration,
ExportFileFormat fileFormat,
BigQueryHelper bigQueryHelper,
String projectId,
Table table,
@Nullable InputFormat<LongWritable, Text> delegateInputFormat) {
super(
configuration,
getCommaSeparatedGcsPathList(table),
fileFormat,
bigQueryHelper,
projectId,
table,
delegateInputFormat);
checkNotNull(table.getExternalDataConfiguration());
String inputType = fileFormat.getFormatIdentifier();
String tableType = table.getExternalDataConfiguration().getSourceFormat();
checkArgument(
inputType.equals(tableType),
"MapReduce fileFormat '%s' does not match BigQuery sourceFormat '%s'. Use the "
+ "appropriate InputFormat.",
inputType,
tableType);
gcsPaths = table.getExternalDataConfiguration().getSourceUris();
}
@VisibleForTesting
static String getCommaSeparatedGcsPathList(Table table) {
checkNotNull(table.getExternalDataConfiguration());
for (String uri : table.getExternalDataConfiguration().getSourceUris()) {
checkArgument(uri.startsWith("gs://"), "Invalid GCS resource: '%s'", uri);
}
// FileInputFormat accepts a comma separated list of potentially globbed paths.
return Joiner.on(",").join(table.getExternalDataConfiguration().getSourceUris());
}
@Override
public void prepare() {
// No-op
}
@Override
public void beginExport() {
// No-op
}
@Override
public void waitForUsableMapReduceInput() {
// No-op
}
@Override
public List<String> getExportPaths() {
return gcsPaths;
}
@Override
public void cleanupExport() {
// No-op
}
}
|
GoogleCloudDataproc/hadoop-connectors
|
bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/NoopFederatedExportToCloudStorage.java
|
Java
|
apache-2.0
| 3,304
|
/*
* Copyright 2013 Thomas Hoffmann
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.j4velin.pedometer;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import de.j4velin.pedometer.util.Logger;
import de.j4velin.pedometer.util.Util;
public class ShutdownRecevier extends BroadcastReceiver {
@Override
public void onReceive(final Context context, final Intent intent) {
if (BuildConfig.DEBUG) Logger.log("shutting down");
context.startService(new Intent(context, SensorListener.class));
// if the user used a root script for shutdown, the DEVICE_SHUTDOWN
// broadcast might not be send. Therefore, the app will check this
// setting on the next boot and displays an error message if it's not
// set to true
context.getSharedPreferences("pedometer", Context.MODE_PRIVATE).edit()
.putBoolean("correctShutdown", true).commit();
Database db = Database.getInstance(context);
// if it's already a new day, add the temp. steps to the last one
if (db.getSteps(Util.getToday()) == Integer.MIN_VALUE) {
int steps = db.getCurrentSteps();
db.insertNewDay(Util.getToday(), steps);
} else {
db.addToLastEntry(db.getCurrentSteps());
}
// current steps will be reset on boot @see BootReceiver
db.close();
}
}
|
j4velin/Pedometer
|
src/main/java/de/j4velin/pedometer/ShutdownRecevier.java
|
Java
|
apache-2.0
| 1,958
|
/**
* DynamicSearchAd.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
*/
package com.google.api.ads.adwords.axis.v201402.cm;
/**
* Represents a dynamic search ad. This ad will have its headline
* and
* destination URL auto-generated at serving time according
* to domain name
* specific information provided by {@link DomainInfoExtension}
* linked at the
* campaign level.
*
* <p>Auto-generated fields: headline and destination URL
* (may contain an optional
* tracking URL).</p>
*
* <p><b>Required fields:</b> {@code description1}, {@code
* description2},
* {@code displayUrl}.</p>
*
* <p>The URL field must contain at least one of the following
* placeholder tags
* (URL parameters):</p>
* <ul>
* <li>{unescapedlpurl}</li>
* <li>{escapedlpurl}</li>
* <li>{lpurlpath}</li>
* <li>{lpurl}</li>
* </ul>
*
* <p>If no URL is specified, {unescapedlpurl} will be used
* as default.</p>
*
* <ul>
* <li>{unescapedlpurl} can only be used at the beginning
* of the URL field. It
* will be replaced with the full landing page URL of the
* displayed ad. Extra query
* parameters can be added to the end, e.g.: "{unescapedlpurl}?lang=en".</li>
*
* <li>{escapedlpurl} will be replaced with the URL-encoded
* version of the full
* landing page URL. This makes it suitable for use as a
* query parameter
* value (e.g.: "http://www.3rdpartytracker.com/?lp={escapedlpurl}")
* but
* not at the beginning of the URL field.</li>
*
* <li>{lpurlpath} will be replaced with the path and query
* part of the landing
* page URL and can be added to a different URL, e.g.:
* "http://www.mygoodbusiness.com/tracking/{lpurlpath}".</li>
*
* <li>{lpurl} encodes the "?" and "=" of the landing page
* URL making it suitable
* for use as a query parameter. If found at the beginning
* of the URL field, it is
* replaced by the {unescapedlpurl} value.
* E.g.: "http://tracking.com/redir.php?tracking=xyz&url={lpurl}".</li>
* </ul>
*
* <p>There are also special rules that come into play depending
* on whether the
* destination URL uses local click tracking or third-party
* click tracking.</p>
*
* <p class="note">Note that {@code finalUrls} and {@code
* finalMobileUrls}
* cannot be set for dynamic search ads.</p>
*
* <p>For more information, see the article
* <a href="//support.google.com/adwords/answer/2549100">Using
* dynamic tracking URLs</a>.
* </p>
* <span class="constraint AdxEnabled">This is disabled for
* AdX when it is contained within Operators: ADD, SET.</span>
*/
public class DynamicSearchAd extends com.google.api.ads.adwords.axis.v201402.cm.Ad implements java.io.Serializable {
/* The first description line.
* <span class="constraint Selectable">This field
* can be selected using the value "Description1".</span><span class="constraint
* Filterable">This field can be filtered on.</span> */
private java.lang.String description1;
/* The second description line.
* <span class="constraint Selectable">This field
* can be selected using the value "Description2".</span><span class="constraint
* Filterable">This field can be filtered on.</span> */
private java.lang.String description2;
public DynamicSearchAd() {
}
public DynamicSearchAd(
java.lang.Long id,
java.lang.String url,
java.lang.String displayUrl,
java.lang.Long devicePreference,
java.lang.String adType,
java.lang.String description1,
java.lang.String description2) {
super(
id,
url,
displayUrl,
devicePreference,
adType);
this.description1 = description1;
this.description2 = description2;
}
/**
* Gets the description1 value for this DynamicSearchAd.
*
* @return description1 * The first description line.
* <span class="constraint Selectable">This field
* can be selected using the value "Description1".</span><span class="constraint
* Filterable">This field can be filtered on.</span>
*/
public java.lang.String getDescription1() {
return description1;
}
/**
* Sets the description1 value for this DynamicSearchAd.
*
* @param description1 * The first description line.
* <span class="constraint Selectable">This field
* can be selected using the value "Description1".</span><span class="constraint
* Filterable">This field can be filtered on.</span>
*/
public void setDescription1(java.lang.String description1) {
this.description1 = description1;
}
/**
* Gets the description2 value for this DynamicSearchAd.
*
* @return description2 * The second description line.
* <span class="constraint Selectable">This field
* can be selected using the value "Description2".</span><span class="constraint
* Filterable">This field can be filtered on.</span>
*/
public java.lang.String getDescription2() {
return description2;
}
/**
* Sets the description2 value for this DynamicSearchAd.
*
* @param description2 * The second description line.
* <span class="constraint Selectable">This field
* can be selected using the value "Description2".</span><span class="constraint
* Filterable">This field can be filtered on.</span>
*/
public void setDescription2(java.lang.String description2) {
this.description2 = description2;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof DynamicSearchAd)) return false;
DynamicSearchAd other = (DynamicSearchAd) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = super.equals(obj) &&
((this.description1==null && other.getDescription1()==null) ||
(this.description1!=null &&
this.description1.equals(other.getDescription1()))) &&
((this.description2==null && other.getDescription2()==null) ||
(this.description2!=null &&
this.description2.equals(other.getDescription2())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = super.hashCode();
if (getDescription1() != null) {
_hashCode += getDescription1().hashCode();
}
if (getDescription2() != null) {
_hashCode += getDescription2().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(DynamicSearchAd.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201402", "DynamicSearchAd"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("description1");
elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201402", "description1"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("description2");
elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201402", "description2"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
|
nafae/developer
|
modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201402/cm/DynamicSearchAd.java
|
Java
|
apache-2.0
| 9,908
|
package com.examw.collector.service;
import java.util.List;
import com.examw.collector.model.SubjectInfo;
import com.examw.model.DataGrid;
/**
* 科目数据更新服务接口
* @author fengwei.
* @since 2014年7月9日 下午4:46:19.
*/
public interface ISubjectUpdateService {
/**
* 数据更新
* @param subjects
*/
List<SubjectInfo> update(List<SubjectInfo> subjects,String account);
/**
* 获取新增或更新的集合
* @return
*/
DataGrid<SubjectInfo> dataGridUpdate(String account);
/**
* 整体数据更新
* @param account
* @return
*/
List<SubjectInfo> update(String account);
}
|
jeasonyoung/examw-collector
|
src/main/java/com/examw/collector/service/ISubjectUpdateService.java
|
Java
|
apache-2.0
| 626
|
/*
* Copyright 2014-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.facebook.buck.python;
import com.facebook.buck.cxx.toolchain.CxxPlatform;
import com.facebook.buck.cxx.toolchain.nativelink.NativeLinkTarget;
import com.facebook.buck.io.ProjectFilesystem;
import com.facebook.buck.model.BuildTarget;
import com.facebook.buck.rules.BuildRule;
import com.facebook.buck.rules.BuildRuleParams;
import com.facebook.buck.rules.HasRuntimeDeps;
import com.facebook.buck.rules.NoopBuildRuleWithDeclaredAndExtraDeps;
import com.google.common.annotations.VisibleForTesting;
import java.nio.file.Path;
public abstract class CxxPythonExtension extends NoopBuildRuleWithDeclaredAndExtraDeps
implements PythonPackagable, HasRuntimeDeps {
public CxxPythonExtension(
BuildTarget buildTarget, ProjectFilesystem projectFilesystem, BuildRuleParams params) {
super(buildTarget, projectFilesystem, params);
}
@VisibleForTesting
protected abstract BuildRule getExtension(PythonPlatform pythonPlatform, CxxPlatform cxxPlatform);
public abstract Path getModule();
@Override
public abstract PythonPackageComponents getPythonPackageComponents(
PythonPlatform pythonPlatform, CxxPlatform cxxPlatform);
public abstract NativeLinkTarget getNativeLinkTarget(PythonPlatform pythonPlatform);
}
|
k21/buck
|
src/com/facebook/buck/python/CxxPythonExtension.java
|
Java
|
apache-2.0
| 1,856
|
/*
* Copyright DataStax, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.datastax.oss.driver.mapper;
import static org.assertj.core.api.Assertions.assertThat;
import com.datastax.oss.driver.api.core.CqlIdentifier;
import com.datastax.oss.driver.api.core.CqlSession;
import com.datastax.oss.driver.api.core.cql.AsyncResultSet;
import com.datastax.oss.driver.api.core.cql.BoundStatement;
import com.datastax.oss.driver.api.core.cql.ResultSet;
import com.datastax.oss.driver.api.core.cql.Row;
import com.datastax.oss.driver.api.core.cql.SimpleStatement;
import com.datastax.oss.driver.api.mapper.annotations.CqlName;
import com.datastax.oss.driver.api.mapper.annotations.Dao;
import com.datastax.oss.driver.api.mapper.annotations.DaoFactory;
import com.datastax.oss.driver.api.mapper.annotations.DaoKeyspace;
import com.datastax.oss.driver.api.mapper.annotations.DefaultNullSavingStrategy;
import com.datastax.oss.driver.api.mapper.annotations.Insert;
import com.datastax.oss.driver.api.mapper.annotations.Mapper;
import com.datastax.oss.driver.api.mapper.annotations.Select;
import com.datastax.oss.driver.api.mapper.entity.saving.NullSavingStrategy;
import com.datastax.oss.driver.api.testinfra.ccm.CcmRule;
import com.datastax.oss.driver.api.testinfra.session.SessionRule;
import com.datastax.oss.driver.categories.ParallelizableTests;
import com.datastax.oss.driver.internal.core.util.concurrent.CompletableFutures;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.rules.RuleChain;
import org.junit.rules.TestRule;
@Category(ParallelizableTests.class)
public class InsertIT extends InventoryITBase {
private static final CcmRule CCM_RULE = CcmRule.getInstance();
private static final SessionRule<CqlSession> SESSION_RULE = SessionRule.builder(CCM_RULE).build();
@ClassRule
public static final TestRule CHAIN = RuleChain.outerRule(CCM_RULE).around(SESSION_RULE);
private static ProductDao dao;
@BeforeClass
public static void setup() {
CqlSession session = SESSION_RULE.session();
for (String query : createStatements(CCM_RULE)) {
session.execute(
SimpleStatement.builder(query).setExecutionProfile(SESSION_RULE.slowProfile()).build());
}
InventoryMapper inventoryMapper = new InsertIT_InventoryMapperBuilder(session).build();
dao = inventoryMapper.productDao(SESSION_RULE.keyspace());
}
@Before
public void clearProductData() {
CqlSession session = SESSION_RULE.session();
session.execute(
SimpleStatement.builder("TRUNCATE product")
.setExecutionProfile(SESSION_RULE.slowProfile())
.build());
}
@Test
public void should_insert_entity() {
assertThat(dao.findById(FLAMETHROWER.getId())).isNull();
dao.save(FLAMETHROWER);
assertThat(dao.findById(FLAMETHROWER.getId())).isEqualTo(FLAMETHROWER);
}
@Test
public void should_insert_entity_returning_result_set() {
assertThat(dao.findById(FLAMETHROWER.getId())).isNull();
ResultSet rs = dao.saveReturningResultSet(FLAMETHROWER);
assertThat(rs.getAvailableWithoutFetching()).isZero();
assertThat(dao.findById(FLAMETHROWER.getId())).isEqualTo(FLAMETHROWER);
}
@Test
public void should_return_bound_statement_to_execute() {
assertThat(dao.findById(FLAMETHROWER.getId())).isNull();
BoundStatement bs = dao.saveReturningBoundStatement(FLAMETHROWER);
ResultSet rs = SESSION_RULE.session().execute(bs);
assertThat(rs.getAvailableWithoutFetching()).isZero();
assertThat(dao.findById(FLAMETHROWER.getId())).isEqualTo(FLAMETHROWER);
}
@Test
public void should_insert_entity_asynchronously() {
assertThat(dao.findById(FLAMETHROWER.getId())).isNull();
CompletableFutures.getUninterruptibly(dao.saveAsync(FLAMETHROWER));
assertThat(dao.findById(FLAMETHROWER.getId())).isEqualTo(FLAMETHROWER);
}
@Test
public void should_insert_entity_asynchronously_returning_result_set() {
assertThat(dao.findById(FLAMETHROWER.getId())).isNull();
AsyncResultSet rs =
CompletableFutures.getUninterruptibly(dao.saveAsyncReturningAsyncResultSet(FLAMETHROWER));
assertThat(rs.currentPage().iterator()).isExhausted();
assertThat(dao.findById(FLAMETHROWER.getId())).isEqualTo(FLAMETHROWER);
}
@Test
public void should_insert_entity_with_bound_timestamp() {
assertThat(dao.findById(FLAMETHROWER.getId())).isNull();
long timestamp = 1234;
dao.saveWithBoundTimestamp(FLAMETHROWER, timestamp);
CqlSession session = SESSION_RULE.session();
Row row =
session
.execute(
SimpleStatement.newInstance(
"SELECT WRITETIME(description) FROM product WHERE id = ?",
FLAMETHROWER.getId()))
.one();
long writeTime = row.getLong(0);
assertThat(writeTime).isEqualTo(timestamp);
}
@Test
public void should_insert_entity_with_literal_timestamp() {
assertThat(dao.findById(FLAMETHROWER.getId())).isNull();
dao.saveWithLiteralTimestamp(FLAMETHROWER);
CqlSession session = SESSION_RULE.session();
Row row =
session
.execute(
SimpleStatement.newInstance(
"SELECT WRITETIME(description) FROM product WHERE id = ?",
FLAMETHROWER.getId()))
.one();
long writeTime = row.getLong(0);
assertThat(writeTime).isEqualTo(1234);
}
@Test
public void should_insert_entity_with_bound_ttl() {
assertThat(dao.findById(FLAMETHROWER.getId())).isNull();
int insertedTtl = 86400;
dao.saveWithBoundTtl(FLAMETHROWER, insertedTtl);
CqlSession session = SESSION_RULE.session();
Row row =
session
.execute(
SimpleStatement.newInstance(
"SELECT TTL(description) FROM product WHERE id = ?", FLAMETHROWER.getId()))
.one();
Integer retrievedTtl = row.get(0, Integer.class);
assertThat(retrievedTtl).isNotNull().isLessThanOrEqualTo(insertedTtl);
}
@Test
public void should_insert_entity_with_literal_ttl() {
assertThat(dao.findById(FLAMETHROWER.getId())).isNull();
dao.saveWithLiteralTtl(FLAMETHROWER);
CqlSession session = SESSION_RULE.session();
Row row =
session
.execute(
SimpleStatement.newInstance(
"SELECT TTL(description) FROM product WHERE id = ?", FLAMETHROWER.getId()))
.one();
Integer retrievedTtl = row.get(0, Integer.class);
assertThat(retrievedTtl).isNotNull().isLessThanOrEqualTo(86400);
}
@Test
public void should_insert_entity_with_bound_timestamp_asynchronously() {
assertThat(dao.findById(FLAMETHROWER.getId())).isNull();
long timestamp = 1234;
CompletableFutures.getUninterruptibly(dao.saveAsyncWithBoundTimestamp(FLAMETHROWER, timestamp));
CqlSession session = SESSION_RULE.session();
Row row =
session
.execute(
SimpleStatement.newInstance(
"SELECT WRITETIME(description) FROM product WHERE id = ?",
FLAMETHROWER.getId()))
.one();
long writeTime = row.getLong(0);
assertThat(writeTime).isEqualTo(timestamp);
}
@Test
public void should_insert_entity_if_not_exists() {
assertThat(dao.saveIfNotExists(FLAMETHROWER)).isNull();
Product otherProduct =
new Product(FLAMETHROWER.getId(), "Other description", new Dimensions(1, 1, 1));
assertThat(dao.saveIfNotExists(otherProduct)).isEqualTo(FLAMETHROWER);
}
@Test
public void should_insert_entity_if_not_exists_returning_boolean() {
assertThat(dao.saveIfNotExistsReturningBoolean(FLAMETHROWER)).isTrue();
Product otherProduct =
new Product(FLAMETHROWER.getId(), "Other description", new Dimensions(1, 1, 1));
assertThat(dao.saveIfNotExistsReturningBoolean(otherProduct)).isFalse();
}
@Test
public void should_insert_entity_if_not_exists_asynchronously() {
assertThat(CompletableFutures.getUninterruptibly(dao.saveAsyncIfNotExists(FLAMETHROWER)))
.isNull();
Product otherProduct =
new Product(FLAMETHROWER.getId(), "Other description", new Dimensions(1, 1, 1));
assertThat(CompletableFutures.getUninterruptibly(dao.saveAsyncIfNotExists(otherProduct)))
.isEqualTo(FLAMETHROWER);
}
@Test
public void should_insert_entity_if_not_exists_asynchronously_returning_boolean() {
assertThat(
CompletableFutures.getUninterruptibly(
dao.saveAsyncIfNotExistsReturningBoolean(FLAMETHROWER)))
.isTrue();
Product otherProduct =
new Product(FLAMETHROWER.getId(), "Other description", new Dimensions(1, 1, 1));
assertThat(
CompletableFutures.getUninterruptibly(
dao.saveAsyncIfNotExistsReturningBoolean(otherProduct)))
.isFalse();
}
@Test
public void should_insert_entity_if_not_exists_returning_optional() {
assertThat(dao.saveIfNotExistsOptional(FLAMETHROWER)).isEmpty();
Product otherProduct =
new Product(FLAMETHROWER.getId(), "Other description", new Dimensions(1, 1, 1));
assertThat(dao.saveIfNotExistsOptional(otherProduct)).contains(FLAMETHROWER);
}
@Test
public void should_insert_entity_if_not_exists_returning_optional_asynchronously() {
assertThat(
CompletableFutures.getUninterruptibly(dao.saveAsyncIfNotExistsOptional(FLAMETHROWER)))
.isEmpty();
Product otherProduct =
new Product(FLAMETHROWER.getId(), "Other description", new Dimensions(1, 1, 1));
assertThat(
CompletableFutures.getUninterruptibly(dao.saveAsyncIfNotExistsOptional(otherProduct)))
.contains(FLAMETHROWER);
}
@Mapper
public interface InventoryMapper {
@DaoFactory
ProductDao productDao(@DaoKeyspace CqlIdentifier keyspace);
}
@Dao
@DefaultNullSavingStrategy(NullSavingStrategy.SET_TO_NULL)
public interface ProductDao {
@Insert
void save(Product product);
@Insert
ResultSet saveReturningResultSet(Product product);
@Insert
BoundStatement saveReturningBoundStatement(Product product);
@Insert(timestamp = ":timestamp")
void saveWithBoundTimestamp(Product product, long timestamp);
@Insert(timestamp = "1234")
void saveWithLiteralTimestamp(Product product);
@Insert(ttl = ":ttl")
void saveWithBoundTtl(Product product, int ttl);
@Insert(ttl = "86400")
void saveWithLiteralTtl(Product product);
@Insert(ifNotExists = true)
Product saveIfNotExists(Product product);
@Insert(ifNotExists = true)
boolean saveIfNotExistsReturningBoolean(Product product);
@Insert(ifNotExists = true)
Optional<Product> saveIfNotExistsOptional(Product product);
@Insert
CompletableFuture<Void> saveAsync(Product product);
@Insert
CompletableFuture<AsyncResultSet> saveAsyncReturningAsyncResultSet(Product product);
@Insert(timestamp = ":\"TIMESTAMP\"")
CompletableFuture<Void> saveAsyncWithBoundTimestamp(
Product product, @CqlName("\"TIMESTAMP\"") long timestamp);
@Insert(ifNotExists = true)
CompletableFuture<Product> saveAsyncIfNotExists(Product product);
@Insert(ifNotExists = true)
CompletableFuture<Boolean> saveAsyncIfNotExistsReturningBoolean(Product product);
@Insert(ifNotExists = true)
CompletableFuture<Optional<Product>> saveAsyncIfNotExistsOptional(Product product);
@Select
Product findById(UUID productId);
}
}
|
datastax/java-driver
|
integration-tests/src/test/java/com/datastax/oss/driver/mapper/InsertIT.java
|
Java
|
apache-2.0
| 12,222
|
console.warn( "THREE.Reflector: As part of the transition to ES6 Modules, the files in 'examples/js' were deprecated in May 2020 (r117) and will be deleted in December 2020 (r124). You can find more information about developing using ES6 Modules in https://threejs.org/docs/index.html#manual/en/introduction/Import-via-modules." );
/**
* @author Slayvin / http://slayvin.net
*/
THREE.Reflector = function ( geometry, options ) {
THREE.Mesh.call( this, geometry );
this.type = 'Reflector';
var scope = this;
options = options || {};
var color = ( options.color !== undefined ) ? new THREE.Color( options.color ) : new THREE.Color( 0x7F7F7F );
var textureWidth = options.textureWidth || 512;
var textureHeight = options.textureHeight || 512;
var clipBias = options.clipBias || 0;
var shader = options.shader || THREE.Reflector.ReflectorShader;
//
var reflectorPlane = new THREE.Plane();
var normal = new THREE.Vector3();
var reflectorWorldPosition = new THREE.Vector3();
var cameraWorldPosition = new THREE.Vector3();
var rotationMatrix = new THREE.Matrix4();
var lookAtPosition = new THREE.Vector3( 0, 0, - 1 );
var clipPlane = new THREE.Vector4();
var view = new THREE.Vector3();
var target = new THREE.Vector3();
var q = new THREE.Vector4();
var textureMatrix = new THREE.Matrix4();
var virtualCamera = new THREE.PerspectiveCamera();
var parameters = {
minFilter: THREE.LinearFilter,
magFilter: THREE.LinearFilter,
format: THREE.RGBFormat,
stencilBuffer: false
};
var renderTarget = new THREE.WebGLRenderTarget( textureWidth, textureHeight, parameters );
if ( ! THREE.MathUtils.isPowerOfTwo( textureWidth ) || ! THREE.MathUtils.isPowerOfTwo( textureHeight ) ) {
renderTarget.texture.generateMipmaps = false;
}
var material = new THREE.ShaderMaterial( {
uniforms: THREE.UniformsUtils.clone( shader.uniforms ),
fragmentShader: shader.fragmentShader,
vertexShader: shader.vertexShader
} );
material.uniforms[ "tDiffuse" ].value = renderTarget.texture;
material.uniforms[ "color" ].value = color;
material.uniforms[ "textureMatrix" ].value = textureMatrix;
this.material = material;
this.onBeforeRender = function ( renderer, scene, camera ) {
reflectorWorldPosition.setFromMatrixPosition( scope.matrixWorld );
cameraWorldPosition.setFromMatrixPosition( camera.matrixWorld );
rotationMatrix.extractRotation( scope.matrixWorld );
normal.set( 0, 0, 1 );
normal.applyMatrix4( rotationMatrix );
view.subVectors( reflectorWorldPosition, cameraWorldPosition );
// Avoid rendering when reflector is facing away
if ( view.dot( normal ) > 0 ) return;
view.reflect( normal ).negate();
view.add( reflectorWorldPosition );
rotationMatrix.extractRotation( camera.matrixWorld );
lookAtPosition.set( 0, 0, - 1 );
lookAtPosition.applyMatrix4( rotationMatrix );
lookAtPosition.add( cameraWorldPosition );
target.subVectors( reflectorWorldPosition, lookAtPosition );
target.reflect( normal ).negate();
target.add( reflectorWorldPosition );
virtualCamera.position.copy( view );
virtualCamera.up.set( 0, 1, 0 );
virtualCamera.up.applyMatrix4( rotationMatrix );
virtualCamera.up.reflect( normal );
virtualCamera.lookAt( target );
virtualCamera.far = camera.far; // Used in WebGLBackground
virtualCamera.updateMatrixWorld();
virtualCamera.projectionMatrix.copy( camera.projectionMatrix );
// Update the texture matrix
textureMatrix.set(
0.5, 0.0, 0.0, 0.5,
0.0, 0.5, 0.0, 0.5,
0.0, 0.0, 0.5, 0.5,
0.0, 0.0, 0.0, 1.0
);
textureMatrix.multiply( virtualCamera.projectionMatrix );
textureMatrix.multiply( virtualCamera.matrixWorldInverse );
textureMatrix.multiply( scope.matrixWorld );
// Now update projection matrix with new clip plane, implementing code from: http://www.terathon.com/code/oblique.html
// Paper explaining this technique: http://www.terathon.com/lengyel/Lengyel-Oblique.pdf
reflectorPlane.setFromNormalAndCoplanarPoint( normal, reflectorWorldPosition );
reflectorPlane.applyMatrix4( virtualCamera.matrixWorldInverse );
clipPlane.set( reflectorPlane.normal.x, reflectorPlane.normal.y, reflectorPlane.normal.z, reflectorPlane.constant );
var projectionMatrix = virtualCamera.projectionMatrix;
q.x = ( Math.sign( clipPlane.x ) + projectionMatrix.elements[ 8 ] ) / projectionMatrix.elements[ 0 ];
q.y = ( Math.sign( clipPlane.y ) + projectionMatrix.elements[ 9 ] ) / projectionMatrix.elements[ 5 ];
q.z = - 1.0;
q.w = ( 1.0 + projectionMatrix.elements[ 10 ] ) / projectionMatrix.elements[ 14 ];
// Calculate the scaled plane vector
clipPlane.multiplyScalar( 2.0 / clipPlane.dot( q ) );
// Replacing the third row of the projection matrix
projectionMatrix.elements[ 2 ] = clipPlane.x;
projectionMatrix.elements[ 6 ] = clipPlane.y;
projectionMatrix.elements[ 10 ] = clipPlane.z + 1.0 - clipBias;
projectionMatrix.elements[ 14 ] = clipPlane.w;
// Render
renderTarget.texture.encoding = renderer.outputEncoding;
scope.visible = false;
var currentRenderTarget = renderer.getRenderTarget();
var currentXrEnabled = renderer.xr.enabled;
var currentShadowAutoUpdate = renderer.shadowMap.autoUpdate;
renderer.xr.enabled = false; // Avoid camera modification
renderer.shadowMap.autoUpdate = false; // Avoid re-computing shadows
renderer.setRenderTarget( renderTarget );
renderer.state.buffers.depth.setMask( true ); // make sure the depth buffer is writable so it can be properly cleared, see #18897
if ( renderer.autoClear === false ) renderer.clear();
renderer.render( scene, virtualCamera );
renderer.xr.enabled = currentXrEnabled;
renderer.shadowMap.autoUpdate = currentShadowAutoUpdate;
renderer.setRenderTarget( currentRenderTarget );
// Restore viewport
var viewport = camera.viewport;
if ( viewport !== undefined ) {
renderer.state.viewport( viewport );
}
scope.visible = true;
};
this.getRenderTarget = function () {
return renderTarget;
};
};
THREE.Reflector.prototype = Object.create( THREE.Mesh.prototype );
THREE.Reflector.prototype.constructor = THREE.Reflector;
THREE.Reflector.ReflectorShader = {
uniforms: {
'color': {
value: null
},
'tDiffuse': {
value: null
},
'textureMatrix': {
value: null
}
},
vertexShader: [
'uniform mat4 textureMatrix;',
'varying vec4 vUv;',
'void main() {',
' vUv = textureMatrix * vec4( position, 1.0 );',
' gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
'}'
].join( '\n' ),
fragmentShader: [
'uniform vec3 color;',
'uniform sampler2D tDiffuse;',
'varying vec4 vUv;',
'float blendOverlay( float base, float blend ) {',
' return( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );',
'}',
'vec3 blendOverlay( vec3 base, vec3 blend ) {',
' return vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );',
'}',
'void main() {',
' vec4 base = texture2DProj( tDiffuse, vUv );',
' gl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );',
'}'
].join( '\n' )
};
|
webmaster444/webmaster444.github.io
|
other/mypointcloud/three/examples/js/objects/Reflector.js
|
JavaScript
|
apache-2.0
| 7,153
|
////////////////////////////////////////////////////////////////////////////
// Module : alife_space.h
// Created : 08.01.2002
// Modified : 08.01.2003
// Author : Dmitriy Iassenev
// Description : ALife space
////////////////////////////////////////////////////////////////////////////
#ifndef XRAY_ALIFE_SPACE
#define XRAY_ALIFE_SPACE
//#include "../xrcore/_std_extensions.h"
// ALife objects, events and tasks
#define ALIFE_VERSION 0x0006
#define ALIFE_CHUNK_DATA 0x0000
#define SPAWN_CHUNK_DATA 0x0001
#define OBJECT_CHUNK_DATA 0x0002
#define GAME_TIME_CHUNK_DATA 0x0005
#define REGISTRY_CHUNK_DATA 0x0009
#define SECTION_HEADER "location_"
#define SAVE_EXTENSION ".scop"
#define SPAWN_NAME "game.spawn"
// inventory rukzak size
#define MAX_ITEM_VOLUME 100
#define INVALID_STORY_ID ALife::_STORY_ID(-1)
#define INVALID_SPAWN_STORY_ID ALife::_SPAWN_STORY_ID(-1)
class CSE_ALifeDynamicObject;
class CSE_ALifeMonsterAbstract;
class CSE_ALifeTrader;
class CSE_ALifeInventoryItem;
class CSE_ALifeItemWeapon;
class CSE_ALifeSchedulable;
class CGameGraph;
namespace ALife {
typedef u64 _CLASS_ID; // Class ID
typedef u16 _OBJECT_ID; // Object ID
typedef u64 _TIME_ID; // Time ID
typedef u32 _EVENT_ID; // Event ID
typedef u32 _TASK_ID; // Event ID
typedef u16 _SPAWN_ID; // Spawn ID
typedef u16 _TERRAIN_ID; // Terrain ID
typedef u32 _STORY_ID; // Story ID
typedef u32 _SPAWN_STORY_ID; // Spawn Story ID
struct SSumStackCell {
int i1;
int i2;
int iCurrentSum;
};
enum ECombatResult {
eCombatResultRetreat1 = u32(0),
eCombatResultRetreat2,
eCombatResultRetreat12,
eCombatResult1Kill2,
eCombatResult2Kill1,
eCombatResultBothKilled,
eCombatDummy = u32(-1),
};
enum ECombatAction {
eCombatActionAttack = u32(0),
eCombatActionRetreat,
eCombatActionDummy = u32(-1),
};
enum EMeetActionType {
eMeetActionTypeAttack = u32(0),
eMeetActionTypeInteract,
eMeetActionTypeIgnore,
eMeetActionSmartTerrain,
eMeetActionTypeDummy = u32(-1),
};
enum ERelationType {
eRelationTypeFriend = u32(0),
eRelationTypeNeutral,
eRelationTypeEnemy,
eRelationTypeWorstEnemy,
eRelationTypeLast,
eRelationTypeDummy = u32(-1),
};
enum EHitType {
eHitTypeBurn = u32(0),
eHitTypeShock,
eHitTypeChemicalBurn,
eHitTypeRadiation,
eHitTypeTelepatic,
eHitTypeWound,
eHitTypeFireWound,
eHitTypeStrike,
eHitTypeExplosion,
eHitTypeWound_2, // knife's alternative fire
// eHitTypePhysicStrike,
eHitTypeLightBurn,
eHitTypeMax,
};
enum EInfluenceType {
infl_rad = u32(0),
infl_fire,
infl_acid,
infl_psi,
infl_electra,
infl_max_count
};
enum EConditionRestoreType {
eHealthRestoreSpeed = u32(0),
eSatietyRestoreSpeed,
ePowerRestoreSpeed,
eBleedingRestoreSpeed,
eRadiationRestoreSpeed,
eRestoreTypeMax,
};
enum ETakeType {
eTakeTypeAll,
eTakeTypeMin,
eTakeTypeRest,
};
enum EWeaponPriorityType {
eWeaponPriorityTypeKnife = u32(0),
eWeaponPriorityTypeSecondary,
eWeaponPriorityTypePrimary,
eWeaponPriorityTypeGrenade,
eWeaponPriorityTypeDummy = u32(-1),
};
enum ECombatType {
eCombatTypeMonsterMonster = u32(0),
eCombatTypeMonsterAnomaly,
eCombatTypeAnomalyMonster,
eCombatTypeSmartTerrain,
eCombatTypeDummy = u32(-1),
};
//âîçìîæíîñòü ïîäêëþ÷åíèÿ àääîíîâ
enum EWeaponAddonStatus {
eAddonDisabled = 0, //íåëüçÿ ïðèñîåäåíèòü
eAddonPermanent = 1, //ïîñòîÿííî ïîäêëþ÷åíî ïî óìîë÷àíèþ
eAddonAttachable = 2 //ìîæíî ïðèñîåäèíÿòü
};
IC EHitType g_tfString2HitType(LPCSTR caHitType) {
if (!_stricmp(caHitType, "burn"))
return (eHitTypeBurn);
else if (!_stricmp(caHitType, "light_burn"))
return (eHitTypeLightBurn);
else if (!_stricmp(caHitType, "shock"))
return (eHitTypeShock);
else if (!_stricmp(caHitType, "strike"))
return (eHitTypeStrike);
else if (!_stricmp(caHitType, "wound"))
return (eHitTypeWound);
else if (!_stricmp(caHitType, "radiation"))
return (eHitTypeRadiation);
else if (!_stricmp(caHitType, "telepatic"))
return (eHitTypeTelepatic);
else if (!_stricmp(caHitType, "fire_wound"))
return (eHitTypeFireWound);
else if (!_stricmp(caHitType, "chemical_burn"))
return (eHitTypeChemicalBurn);
else if (!_stricmp(caHitType, "explosion"))
return (eHitTypeExplosion);
else if (!_stricmp(caHitType, "wound_2"))
return (eHitTypeWound_2);
else
FATAL("Unsupported hit type!");
NODEFAULT;
#ifdef DEBUG
return (eHitTypeMax);
#endif
}
#ifndef _EDITOR
xr_token hit_types_token[];
IC LPCSTR g_cafHitType2String(EHitType tHitType) {
return get_token_name(hit_types_token, tHitType);
}
#endif
using INT_VECTOR = xr_vector<int>;
using OBJECT_VECTOR = xr_vector<_OBJECT_ID>;
using OBJECT_IT = OBJECT_VECTOR::iterator;
using ITEM_P_VECTOR = xr_vector<CSE_ALifeInventoryItem*>;
using WEAPON_P_VECTOR = xr_vector<CSE_ALifeItemWeapon*>;
using SCHEDULE_P_VECTOR = xr_vector<CSE_ALifeSchedulable*>;
using D_OBJECT_P_MAP = xr_map<_OBJECT_ID, CSE_ALifeDynamicObject*>;
using STORY_P_MAP = xr_map<_STORY_ID, CSE_ALifeDynamicObject*>;
}; // namespace ALife
#endif // XRAY_ALIFE_SPACE
|
Im-dex/xray-162
|
code/engine/xrServerEntities/alife_space.h
|
C
|
apache-2.0
| 5,300
|
// Package gotocol provides protocol support to send a variety of commands
// listener channels and types over a single channel type
package gotocol
import (
"fmt"
"github.com/adrianco/spigo/names"
"log"
"time"
)
// Impositions is the promise theory term for requests made to a service
type Impositions int
// Constant definitions for message types to be imposed on the receiver
const (
// Hello ChanToParent Name Initial noodly touch to set identity
Hello Impositions = iota
// NameDrop ChanToBuddy NameOfBuddy Here's someone to talk to
NameDrop
// Chat - ThisOften Chat to buddies time interval
Chat
// GoldCoin FromChan HowMuch
GoldCoin
// Inform loggerChan text message
Inform
// GetRequest FromChan key Simulate http inbound request
GetRequest
// GetResponse FromChan value Simulate http outbound response
GetResponse
// Put - "key value" Save the key and value
Put
// Replicate - "key value" Save a replicated copy
Replicate
// Forget - FromBuddy ToBuddy Forget link between two buddies
Forget
// Delete - key Remove key and value
Delete
// Goodbye - name // tell FSM and exit
Goodbye // test assumes this is the last and exits
numOfImpositions
)
// String handler to make imposition types printable
func (imps Impositions) String() string {
switch imps {
case Hello:
return "Hello"
case NameDrop:
return "NameDrop"
case Chat:
return "Chat"
case GoldCoin:
return "GoldCoin"
case Inform:
return "Inform"
case GetRequest:
return "GetRequest"
case GetResponse:
return "GetResponse"
case Put:
return "Put"
case Replicate:
return "Replicate"
case Forget:
return "Forget"
case Delete:
return "Delete"
case Goodbye:
return "Goodbye"
}
return "Unknown"
}
// Message structure used for all messages, includes a channel of itself
type Message struct {
Imposition Impositions // request type
ResponseChan chan Message // place to send response messages
Sent time.Time // time at which message was sent
Intention string // payload
}
func (msg Message) String() string {
return fmt.Sprintf("gotocol: %v %v %v", time.Since(msg.Sent), msg.Imposition, msg.Intention)
}
// Send a synchronous message
func Send(to chan<- Message, msg Message) {
if to != nil {
to <- msg
}
}
// GoSend asynchronous message send, parks it on a new goroutine until it completes
func (msg Message) GoSend(to chan Message) {
go func(c chan Message, m Message) {
if c != nil {
c <- m
}
}(to, msg)
}
// InformHandler default handler for Inform message
func InformHandler(msg Message, name string, listener chan Message) chan Message {
if name == "" {
log.Fatal(name + "Inform message received before Hello message")
}
// service registry channel is buffered so don't use GoSend to tell Eureka we exist
msg.ResponseChan <- Message{Put, listener, time.Now(), name}
return msg.ResponseChan
}
func NameDropHandler(dependencies *map[string]time.Time, microservices *map[string]chan Message, msg Message, name string, listener chan Message, eureka map[string]chan Message, crosszone ...bool) {
if msg.ResponseChan == nil { // dependency by service name, needs to be looked up in eureka
(*dependencies)[msg.Intention] = msg.Sent // remember it for later
for _, ch := range eureka {
//log.Println(name + " looking up " + msg.Intention)
Send(ch, Message{GetRequest, listener, time.Now(), msg.Intention})
}
} else { // update dependency with full name and listener channel
microservice := msg.Intention // message body is buddy name
if len(crosszone) > 0 || names.Zone(name) == names.Zone(microservice) {
if microservice != name && (*microservices)[microservice] == nil { // don't talk to myself or record duplicates
// remember how to talk to this buddy
(*microservices)[microservice] = msg.ResponseChan // message channel is buddy's listener
(*dependencies)[names.Service(microservice)] = msg.Sent
for _, ch := range eureka {
// tell one of the service registries I have a new buddy to talk to so it doesn't get logged more than once
Send(ch, Message{Inform, listener, time.Now(), name + " " + microservice})
return
}
}
}
}
}
// ForgetHandler removes a buddy from the buddy list
func ForgetHandler(dependencies *map[string]time.Time, microservices *map[string]chan Message, msg Message) {
microservice := msg.Intention // message body is buddy name to forget
if (*microservices)[microservice] != nil { // an existing buddy to forget
// forget how to talk to this buddy
(*dependencies)[names.Service(microservice)] = msg.Sent // remember when we were told to forget this service
delete(*microservices, microservice)
}
}
|
dwbconsulting/spigo
|
gotocol/gotocol.go
|
GO
|
apache-2.0
| 4,686
|
/*
* Copyright (C) 2015 Red Hat, Inc.
*
* 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 graph
import (
"encoding/json"
"errors"
"fmt"
"reflect"
"strings"
"sync"
"time"
"github.com/nu7hatch/gouuid"
"github.com/skydive-project/skydive/common"
"github.com/skydive-project/skydive/config"
"github.com/skydive-project/skydive/filters"
)
const (
maxEvents = 50
)
type graphEventType int
const (
nodeUpdated graphEventType = iota + 1
nodeAdded
nodeDeleted
edgeUpdated
edgeAdded
edgeDeleted
)
type Identifier string
type GraphEventListener interface {
OnNodeUpdated(n *Node)
OnNodeAdded(n *Node)
OnNodeDeleted(n *Node)
OnEdgeUpdated(e *Edge)
OnEdgeAdded(e *Edge)
OnEdgeDeleted(e *Edge)
}
type graphEvent struct {
kind graphEventType
element interface{}
listener GraphEventListener
}
type Metadata map[string]interface{}
type MetadataTransaction struct {
graph *Graph
graphElement interface{}
metadata Metadata
}
type graphElement struct {
ID Identifier
metadata Metadata
host string
createdAt time.Time
deletedAt time.Time
}
type Node struct {
graphElement
}
type Edge struct {
graphElement
parent Identifier
child Identifier
}
type GraphBackend interface {
AddNode(n *Node) bool
DelNode(n *Node) bool
GetNode(i Identifier, at *common.TimeSlice) []*Node
GetNodeEdges(n *Node, at *common.TimeSlice, m Metadata) []*Edge
AddEdge(e *Edge) bool
DelEdge(e *Edge) bool
GetEdge(i Identifier, at *common.TimeSlice) []*Edge
GetEdgeNodes(e *Edge, at *common.TimeSlice, parentMetadata, childMetadata Metadata) ([]*Node, []*Node)
AddMetadata(e interface{}, k string, v interface{}) bool
SetMetadata(e interface{}, m Metadata) bool
GetNodes(t *common.TimeSlice, m Metadata) []*Node
GetEdges(t *common.TimeSlice, m Metadata) []*Edge
WithContext(graph *Graph, context GraphContext) (*Graph, error)
}
type GraphContext struct {
TimeSlice *common.TimeSlice
}
type Graph struct {
sync.RWMutex
backend GraphBackend
context GraphContext
host string
eventListeners []GraphEventListener
eventChan chan graphEvent
eventConsumed bool
currentEventListener GraphEventListener
}
type HostNodeTIDMap map[string][]string
func BuildHostNodeTIDMap(nodes []*Node) HostNodeTIDMap {
hnmap := make(HostNodeTIDMap)
for _, node := range nodes {
if host := node.Host(); host != "" {
hnmap[host] = append(hnmap[host], string(node.ID))
}
}
return hnmap
}
// default implementation of a graph listener, can be used when not implementing
// the whole set of callbacks
type DefaultGraphListener struct {
}
func (d *DefaultGraphListener) OnNodeUpdated(n *Node) {
}
func (c *DefaultGraphListener) OnNodeAdded(n *Node) {
}
func (c *DefaultGraphListener) OnNodeDeleted(n *Node) {
}
func (c *DefaultGraphListener) OnEdgeUpdated(e *Edge) {
}
func (c *DefaultGraphListener) OnEdgeAdded(e *Edge) {
}
func (c *DefaultGraphListener) OnEdgeDeleted(e *Edge) {
}
func GenID() Identifier {
u, _ := uuid.NewV4()
return Identifier(u.String())
}
func (m *Metadata) String() string {
j, _ := json.Marshal(m)
return string(j)
}
func (e *graphElement) Host() string {
return e.host
}
func (e *graphElement) GetFieldInt64(field string) (_ int64, err error) {
f, found := e.GetField(field)
if !found {
return 0, common.ErrFieldNotFound
}
return common.ToInt64(f)
}
func (e *graphElement) GetFieldString(field string) (_ string, err error) {
f, found := e.GetField(field)
if !found {
return "", common.ErrFieldNotFound
}
s, ok := f.(string)
if !ok {
return "", common.ErrFieldNotFound
}
return s, nil
}
func (e *graphElement) GetField(name string) (interface{}, bool) {
switch name {
case "ID":
return string(e.ID), true
case "Host":
return e.host, true
case "CreatedAt":
return e.createdAt.Unix(), true
case "DeletedAt":
return e.deletedAt.Unix(), true
default:
if strings.HasPrefix(name, "Metadata/") {
name = name[9:]
}
v, ok := e.Metadata()[name]
return v, ok
}
}
func (e *graphElement) Metadata() Metadata {
return e.metadata
}
func (e *graphElement) MatchMetadata(f Metadata) bool {
for k, v := range f {
switch v := v.(type) {
case *filters.Filter:
if !v.Eval(e) {
return false
}
default:
nv, ok := e.metadata[k]
if !ok || !common.CrossTypeEqual(nv, v) {
return false
}
}
}
return true
}
func (e *graphElement) String() string {
deletedAt := ""
if !e.deletedAt.IsZero() {
deletedAt = e.deletedAt.String()
}
j, _ := json.Marshal(&struct {
ID Identifier
Metadata Metadata `json:",omitempty"`
Host string
CreatedAt string
DeletedAt string `json:",omitempty"`
}{
ID: e.ID,
Metadata: e.metadata,
Host: e.host,
CreatedAt: e.createdAt.String(),
DeletedAt: deletedAt,
})
return string(j)
}
func parseTime(i interface{}) (t time.Time, err error) {
var epoch int64
switch i := i.(type) {
case int64:
epoch = i
case json.Number:
epoch, err = i.Int64()
if err != nil {
return t, err
}
default:
return t, fmt.Errorf("Invalid time: %+v", i)
}
return time.Unix(epoch, 0), err
}
func (e *graphElement) Decode(i interface{}) (err error) {
objMap, ok := i.(map[string]interface{})
if !ok {
return fmt.Errorf("Unable to decode graph element: %v, %+v", i, reflect.TypeOf(i))
}
e.ID = Identifier(objMap["ID"].(string))
e.host = objMap["Host"].(string)
if createdAt, ok := objMap["CreatedAt"]; ok {
if e.createdAt, err = parseTime(createdAt); err != nil {
return err
}
}
if deletedAt, ok := objMap["DeletedAt"]; ok {
if e.deletedAt, err = parseTime(deletedAt); err != nil {
return err
}
}
if m, ok := objMap["Metadata"]; ok {
e.metadata = make(Metadata)
for field, value := range m.(map[string]interface{}) {
if n, ok := value.(json.Number); ok {
if value, err = n.Int64(); err == nil {
value = value.(int64)
} else {
value, _ = n.Float64()
}
}
e.metadata[field] = value
}
}
return nil
}
func (n *Node) MarshalJSON() ([]byte, error) {
deletedAt := int64(0)
if !n.deletedAt.IsZero() {
deletedAt = n.deletedAt.Unix()
}
return json.Marshal(&struct {
ID Identifier
Metadata Metadata `json:",omitempty"`
Host string
CreatedAt int64
DeletedAt int64 `json:",omitempty"`
}{
ID: n.ID,
Metadata: n.metadata,
Host: n.host,
CreatedAt: n.createdAt.Unix(),
DeletedAt: deletedAt,
})
}
func (n *Node) JsonRawMessage() *json.RawMessage {
r, _ := n.MarshalJSON()
raw := json.RawMessage(r)
return &raw
}
func (n *Node) Decode(i interface{}) error {
return n.graphElement.Decode(i)
}
func (e *Edge) GetFieldString(name string) (string, error) {
switch name {
case "Parent":
return string(e.parent), nil
case "Child":
return string(e.child), nil
default:
return e.graphElement.GetFieldString(name)
}
}
func (e *Edge) MarshalJSON() ([]byte, error) {
deletedAt := int64(0)
if !e.deletedAt.IsZero() {
deletedAt = e.deletedAt.Unix()
}
return json.Marshal(&struct {
ID Identifier
Metadata Metadata `json:",omitempty"`
Parent Identifier
Child Identifier
Host string
CreatedAt int64
DeletedAt int64 `json:",omitempty"`
}{
ID: e.ID,
Metadata: e.metadata,
Parent: e.parent,
Child: e.child,
Host: e.host,
CreatedAt: e.createdAt.Unix(),
DeletedAt: deletedAt,
})
}
func (e *Edge) JsonRawMessage() *json.RawMessage {
r, _ := e.MarshalJSON()
raw := json.RawMessage(r)
return &raw
}
func (e *Edge) Decode(i interface{}) error {
if err := e.graphElement.Decode(i); err != nil {
return err
}
objMap := i.(map[string]interface{})
e.parent = Identifier(objMap["Parent"].(string))
e.child = Identifier(objMap["Child"].(string))
return nil
}
func (e *Edge) GetParent() Identifier {
return e.parent
}
func (e *Edge) GetChild() Identifier {
return e.child
}
func (c *GraphContext) GetTimeSlice() *common.TimeSlice {
return c.TimeSlice
}
func (g *Graph) SetMetadata(i interface{}, m Metadata) bool {
var e *graphElement
ge := graphEvent{element: i}
switch i := i.(type) {
case *Node:
e = &i.graphElement
ge.kind = nodeUpdated
case *Edge:
e = &i.graphElement
ge.kind = edgeUpdated
}
if len(m) == len(e.metadata) {
unchanged := true
for k, v := range m {
if e.metadata[k] != v {
unchanged = false
break
}
}
if unchanged {
return false
}
}
if !g.backend.SetMetadata(i, m) {
return false
}
e.metadata = m
g.notifyEvent(ge)
return true
}
func (g *Graph) AddMetadata(i interface{}, k string, v interface{}) bool {
var e *graphElement
ge := graphEvent{element: i}
switch i.(type) {
case *Node:
e = &i.(*Node).graphElement
ge.kind = nodeUpdated
case *Edge:
e = &i.(*Edge).graphElement
ge.kind = edgeUpdated
}
if o, ok := e.metadata[k]; ok && o == v {
return false
}
if !g.backend.AddMetadata(i, k, v) {
return false
}
e.metadata[k] = v
g.notifyEvent(ge)
return true
}
func (g *Graph) DelMetadata(i interface{}, k string) bool {
var m Metadata
ge := graphEvent{element: i}
switch i.(type) {
case *Node:
m = i.(*Node).graphElement.metadata
ge.kind = nodeUpdated
case *Edge:
m = i.(*Edge).graphElement.metadata
ge.kind = edgeUpdated
}
if _, ok := m[k]; !ok {
return false
}
if !g.backend.SetMetadata(i, m) {
return false
}
delete(m, k)
g.notifyEvent(ge)
return true
}
func (t *MetadataTransaction) AddMetadata(k string, v interface{}) {
t.metadata[k] = v
}
func (t *MetadataTransaction) DelMetadata(k string, v interface{}) {
delete(t.metadata, k)
}
func (t *MetadataTransaction) Metadata() Metadata {
return t.metadata
}
func (t *MetadataTransaction) Commit() {
var e graphElement
ge := graphEvent{element: t.graphElement}
switch t.graphElement.(type) {
case *Node:
e = t.graphElement.(*Node).graphElement
ge.kind = nodeUpdated
case *Edge:
e = t.graphElement.(*Edge).graphElement
ge.kind = edgeUpdated
}
updated := false
for k, v := range t.metadata {
if e.metadata[k] != v {
e.metadata[k] = v
if !t.graph.backend.AddMetadata(t.graphElement, k, v) {
return
}
updated = true
}
}
if updated {
t.graph.notifyEvent(ge)
}
}
func (g *Graph) StartMetadataTransaction(i interface{}) *MetadataTransaction {
var e graphElement
switch i.(type) {
case *Node:
e = i.(*Node).graphElement
case *Edge:
e = i.(*Edge).graphElement
}
t := MetadataTransaction{
graph: g,
graphElement: i,
metadata: make(Metadata),
}
for k, v := range e.metadata {
t.metadata[k] = v
}
return &t
}
func (g *Graph) lookupShortestPath(n *Node, m Metadata, path []*Node, v map[Identifier]bool, em Metadata) []*Node {
v[n.ID] = true
newPath := make([]*Node, len(path)+1)
copy(newPath, path)
newPath[len(path)] = n
if n.MatchMetadata(m) {
return newPath
}
t := g.context.GetTimeSlice()
shortest := []*Node{}
for _, e := range g.backend.GetNodeEdges(n, t, em) {
parents, children := g.backend.GetEdgeNodes(e, t, nil, nil)
if len(parents) == 0 || len(children) == 0 {
continue
}
parent, child := parents[0], children[0]
var neighbor *Node
if parent.ID != n.ID && !v[parent.ID] {
neighbor = parent
}
if child.ID != n.ID && !v[child.ID] {
neighbor = child
}
if neighbor != nil {
nv := make(map[Identifier]bool)
for k, v := range v {
nv[k] = v
}
sub := g.lookupShortestPath(neighbor, m, newPath, nv, em)
if len(sub) > 0 && (len(shortest) == 0 || len(sub) < len(shortest)) {
shortest = sub
}
}
}
// check that the last element if the one we looked for
if len(shortest) > 0 && !shortest[len(shortest)-1].MatchMetadata(m) {
return []*Node{}
}
return shortest
}
func (g *Graph) LookupShortestPath(n *Node, m Metadata, em Metadata) []*Node {
return g.lookupShortestPath(n, m, []*Node{}, make(map[Identifier]bool), em)
}
func (g *Graph) LookupParents(n *Node, f Metadata, em Metadata) (nodes []*Node) {
t := g.context.GetTimeSlice()
for _, e := range g.backend.GetNodeEdges(n, t, em) {
if e.GetChild() == n.ID {
parents, _ := g.backend.GetEdgeNodes(e, t, f, Metadata{})
for _, parent := range parents {
nodes = append(nodes, parent)
}
}
}
return
}
func (g *Graph) LookupFirstChild(n *Node, f Metadata) *Node {
nodes := g.LookupChildren(n, f, Metadata{})
if len(nodes) > 0 {
return nodes[0]
}
return nil
}
func (g *Graph) LookupChildren(n *Node, f Metadata, em Metadata) (nodes []*Node) {
t := g.context.GetTimeSlice()
for _, e := range g.backend.GetNodeEdges(n, t, em) {
if e.GetParent() == n.ID {
_, children := g.backend.GetEdgeNodes(e, t, Metadata{}, f)
for _, child := range children {
nodes = append(nodes, child)
}
}
}
return nodes
}
func (g *Graph) AreLinked(n1 *Node, n2 *Node, m Metadata) bool {
t := g.context.GetTimeSlice()
for _, e := range g.backend.GetNodeEdges(n1, t, m) {
parents, children := g.backend.GetEdgeNodes(e, t, Metadata{}, Metadata{})
if len(parents) == 0 || len(children) == 0 {
continue
}
for i, parent := range parents {
if children[i].ID == n2.ID || parent.ID == n2.ID {
return true
}
}
}
return false
}
func (g *Graph) Link(n1 *Node, n2 *Node, m Metadata) *Edge {
u, _ := uuid.NewV5(uuid.NamespaceOID, []byte(string(n1.ID)+string(n2.ID)))
if len(m) > 0 {
return g.NewEdge(Identifier(u.String()), n1, n2, m)
}
return g.NewEdge(Identifier(u.String()), n1, n2, nil)
}
func (g *Graph) Unlink(n1 *Node, n2 *Node) {
for _, e := range g.backend.GetNodeEdges(n1, nil, Metadata{}) {
parents, children := g.backend.GetEdgeNodes(e, nil, Metadata{}, Metadata{})
if len(parents) == 0 || len(children) == 0 {
continue
}
parent, child := parents[0], children[0]
if child.ID == n2.ID || parent.ID == n2.ID {
g.DelEdge(e)
}
}
}
func (g *Graph) Replace(o *Node, n *Node) *Node {
for _, e := range g.backend.GetNodeEdges(o, nil, Metadata{}) {
parents, children := g.backend.GetEdgeNodes(e, nil, Metadata{}, Metadata{})
if len(parents) == 0 || len(children) == 0 {
continue
}
parent, child := parents[0], children[0]
g.DelEdge(e)
if parent.ID == n.ID {
g.Link(n, child, e.metadata)
} else {
g.Link(parent, n, e.metadata)
}
}
n.metadata = o.metadata
g.notifyEvent(graphEvent{element: n, kind: nodeUpdated})
g.DelNode(o)
return n
}
func (g *Graph) LookupFirstNode(m Metadata) *Node {
nodes := g.GetNodes(m)
if len(nodes) > 0 {
return nodes[0]
}
return nil
}
func (g *Graph) AddEdge(e *Edge) bool {
if !g.backend.AddEdge(e) {
return false
}
g.notifyEvent(graphEvent{element: e, kind: edgeAdded})
return true
}
func (g *Graph) GetEdge(i Identifier) *Edge {
if edges := g.backend.GetEdge(i, g.context.GetTimeSlice()); len(edges) != 0 {
return edges[0]
}
return nil
}
func (g *Graph) AddNode(n *Node) bool {
if !g.backend.AddNode(n) {
return false
}
g.notifyEvent(graphEvent{element: n, kind: nodeAdded})
return true
}
func (g *Graph) GetNode(i Identifier) *Node {
if nodes := g.backend.GetNode(i, g.context.GetTimeSlice()); len(nodes) != 0 {
return nodes[0]
}
return nil
}
func (g *Graph) NewNode(i Identifier, m Metadata, h ...string) *Node {
hostname := g.host
if len(h) > 0 {
hostname = h[0]
}
n := &Node{
graphElement: graphElement{
ID: i,
host: hostname,
createdAt: time.Now().UTC(),
},
}
if m != nil {
n.metadata = m
} else {
n.metadata = make(Metadata)
}
if !g.AddNode(n) {
return nil
}
return n
}
func (g *Graph) NewEdge(i Identifier, p *Node, c *Node, m Metadata) *Edge {
e := &Edge{
parent: p.ID,
child: c.ID,
graphElement: graphElement{
ID: i,
host: g.host,
createdAt: time.Now().UTC(),
},
}
if m != nil {
e.metadata = m
} else {
e.metadata = make(Metadata)
}
if !g.AddEdge(e) {
return nil
}
return e
}
func (g *Graph) DelEdge(e *Edge) {
if g.backend.DelEdge(e) {
e.deletedAt = time.Now().UTC()
g.notifyEvent(graphEvent{element: e, kind: edgeDeleted})
}
}
func (g *Graph) DelNode(n *Node) {
for _, e := range g.backend.GetNodeEdges(n, nil, Metadata{}) {
g.DelEdge(e)
}
if g.backend.DelNode(n) {
n.deletedAt = time.Now().UTC()
g.notifyEvent(graphEvent{element: n, kind: nodeDeleted})
}
}
func (g *Graph) DelHostGraph(host string) {
for _, node := range g.GetNodes(Metadata{}) {
if node.host == host {
g.DelNode(node)
}
}
}
func (g *Graph) GetNodes(m Metadata) []*Node {
return g.backend.GetNodes(g.context.GetTimeSlice(), m)
}
func (g *Graph) GetEdges(m Metadata) []*Edge {
return g.backend.GetEdges(g.context.GetTimeSlice(), m)
}
func (g *Graph) GetEdgeNodes(e *Edge, parentMetadata, childMetadata Metadata) ([]*Node, []*Node) {
return g.backend.GetEdgeNodes(e, g.context.GetTimeSlice(), parentMetadata, childMetadata)
}
func (g *Graph) GetNodeEdges(n *Node, m Metadata) []*Edge {
return g.backend.GetNodeEdges(n, g.context.GetTimeSlice(), m)
}
func (g *Graph) String() string {
j, _ := json.Marshal(g)
return string(j)
}
func (g *Graph) MarshalJSON() ([]byte, error) {
return json.Marshal(&struct {
Nodes []*Node
Edges []*Edge
}{
Nodes: g.GetNodes(Metadata{}),
Edges: g.GetEdges(Metadata{}),
})
}
func (g *Graph) notifyEvent(ge graphEvent) {
// push event to chan so that nested notification will be sent in the
// right order. Assiociate the event with the current event listener so
// we can avoid loop by not triggering event for the current listener.
ge.listener = g.currentEventListener
g.eventChan <- ge
// already a consumer no need to run another consumer
if g.eventConsumed {
return
}
g.eventConsumed = true
for len(g.eventChan) > 0 {
ge = <-g.eventChan
// notify only once per listener as if more than once we are in a recursion
// and we wont to notify a listener which generated a graph element
for _, g.currentEventListener = range g.eventListeners {
// do not notify the listener which generated the event
if g.currentEventListener == ge.listener {
continue
}
switch ge.kind {
case nodeAdded:
g.currentEventListener.OnNodeAdded(ge.element.(*Node))
case nodeUpdated:
g.currentEventListener.OnNodeUpdated(ge.element.(*Node))
case nodeDeleted:
g.currentEventListener.OnNodeDeleted(ge.element.(*Node))
case edgeAdded:
g.currentEventListener.OnEdgeAdded(ge.element.(*Edge))
case edgeUpdated:
g.currentEventListener.OnEdgeUpdated(ge.element.(*Edge))
case edgeDeleted:
g.currentEventListener.OnEdgeDeleted(ge.element.(*Edge))
}
}
}
g.currentEventListener = nil
g.eventConsumed = false
}
func (g *Graph) AddEventListener(l GraphEventListener) {
g.Lock()
defer g.Unlock()
g.eventListeners = append(g.eventListeners, l)
}
func (g *Graph) RemoveEventListener(l GraphEventListener) {
g.Lock()
defer g.Unlock()
for i, el := range g.eventListeners {
if l == el {
g.eventListeners = append(g.eventListeners[:i], g.eventListeners[i+1:]...)
break
}
}
}
func (g *Graph) WithContext(c GraphContext) (*Graph, error) {
return g.backend.WithContext(g, c)
}
func (g *Graph) GetContext() GraphContext {
return g.context
}
func (g *Graph) GetHost() string {
return g.host
}
func NewGraph(host string, backend GraphBackend) *Graph {
return &Graph{
backend: backend,
host: host,
context: GraphContext{},
eventChan: make(chan graphEvent, maxEvents),
}
}
func NewGraphFromConfig(backend GraphBackend) *Graph {
host := config.GetConfig().GetString("host_id")
return NewGraph(host, backend)
}
func NewGraphWithContext(hostID string, backend GraphBackend, context GraphContext) (*Graph, error) {
graph := NewGraph(hostID, backend)
return graph.WithContext(context)
}
func BackendFromConfig() (backend GraphBackend, err error) {
name := config.GetConfig().GetString("graph.backend")
if len(name) == 0 {
name = "memory"
}
switch name {
case "memory":
backend, err = NewMemoryBackend()
case "orientdb":
backend, err = NewOrientDBBackendFromConfig()
case "elasticsearch":
backend, err = NewElasticSearchBackendFromConfig()
default:
return nil, errors.New("Config file is misconfigured, graph backend unknown: " + name)
}
if err != nil {
return nil, err
}
return backend, nil
}
|
redhat-cip/skydive
|
topology/graph/graph.go
|
GO
|
apache-2.0
| 21,052
|
/*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.connectwisdom.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.connectwisdom.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* CreateContentResult JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateContentResultJsonUnmarshaller implements Unmarshaller<CreateContentResult, JsonUnmarshallerContext> {
public CreateContentResult unmarshall(JsonUnmarshallerContext context) throws Exception {
CreateContentResult createContentResult = new CreateContentResult();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return createContentResult;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("content", targetDepth)) {
context.nextToken();
createContentResult.setContent(ContentDataJsonUnmarshaller.getInstance().unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return createContentResult;
}
private static CreateContentResultJsonUnmarshaller instance;
public static CreateContentResultJsonUnmarshaller getInstance() {
if (instance == null)
instance = new CreateContentResultJsonUnmarshaller();
return instance;
}
}
|
aws/aws-sdk-java
|
aws-java-sdk-connectwisdom/src/main/java/com/amazonaws/services/connectwisdom/model/transform/CreateContentResultJsonUnmarshaller.java
|
Java
|
apache-2.0
| 2,813
|
package com.itracker.android.ui.gles.programs;
import android.content.Context;
import com.itracker.android.R;
import static android.opengl.GLES20.GL_TEXTURE0;
import static android.opengl.GLES20.GL_TEXTURE_2D;
import static android.opengl.GLES20.glActiveTexture;
import static android.opengl.GLES20.glBindTexture;
import static android.opengl.GLES20.glGetAttribLocation;
import static android.opengl.GLES20.glGetUniformLocation;
import static android.opengl.GLES20.glUniform1i;
import static android.opengl.GLES20.glUniformMatrix4fv;
public class TextureShaderProgram extends ShaderProgram {
// Uniform locations
private final int uMatrixLocation;
private final int uTextureUnitLocation;
// Attribute locations
private final int aPositionLocation;
private final int aTextureCoordinatesLocation;
public TextureShaderProgram(Context context) {
super(context, R.raw.texture_vertex_shader, R.raw.texture_fragment_shader);
// Retrieve uniform locations for the shader program.
uMatrixLocation = glGetUniformLocation(mProgram, U_MATRIX);
uTextureUnitLocation = glGetUniformLocation(mProgram, U_TEXTURE_UNIT);
// Retrieve attribute locations for the shader program.
aPositionLocation = glGetAttribLocation(mProgram, A_POSITION);
aTextureCoordinatesLocation = glGetAttribLocation(mProgram, A_TEXTURE_COORDINATES);
}
public void setUniforms(float[] matrix, int textureId) {
// Pass the matrix into the shader program.
glUniformMatrix4fv(uMatrixLocation, 1, false, matrix, 0);
// Set the active texture unit to texture unit 0.
glActiveTexture(GL_TEXTURE0);
// Bind the texture to this unit.
glBindTexture(GL_TEXTURE_2D, textureId);
// Tell the texture uniform sampler to use this texture in the shader by
// telling it to read from texture unit 0.
glUniform1i(uTextureUnitLocation, 0);
}
public int getPositionAttributeLocation() {
return aPositionLocation;
}
public int getTextureCoordinatesAttributeLocation() {
return aTextureCoordinatesLocation;
}
}
|
bigbugbb/iTracker
|
app/src/main/java/com/itracker/android/ui/gles/programs/TextureShaderProgram.java
|
Java
|
apache-2.0
| 2,157
|
# Puccinia caricis urticae-inflatae Hasler, 1925 INFRASPECIFIC_NAME
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Basidiomycota/Pucciniomycetes/Pucciniales/Pucciniaceae/Puccinia/Puccinia urticata/ Syn. Puccinia caricis urticae-inflatae/README.md
|
Markdown
|
apache-2.0
| 214
|
# Gentiana yakumontana Masam. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Gentianaceae/Gentiana/Gentiana yakumontana/README.md
|
Markdown
|
apache-2.0
| 177
|
# Diplochytridium cejpii (Fott) Karling SPECIES
#### Status
ACCEPTED
#### According to
Index Fungorum
#### Published in
Arch. Mikrobiol. 76(2): 129 (1971)
#### Original name
Chytridium cejpii Fott
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Chytridiomycota/Chytridiomycetes/Chytridiales/Chytridiaceae/Diplochytridium/Diplochytridium cejpii/README.md
|
Markdown
|
apache-2.0
| 218
|
ubuntu-apache
=============
Ubuntu Box with Apache HTTP Server vagrant file
###Requirements
* VirtualBox or VMware
* Vagrant
###Installation
In command line:
git clone https://github.com/buonzz/ubuntu-apache.git
cd ubuntu-apache
vagrant up
Wait until the installation is finish. Then login to the box by
vagrant ssh
You will be brought to the document root, you can just create any file in there like hello.txt
To open that file in the browser, go to :
http://localhost:4567/hello.txt
That's it
|
buonzz-systems/ubuntu-apache
|
README.md
|
Markdown
|
apache-2.0
| 547
|
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: https://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* https://plantuml.com/patreon (only 1$ per month!)
* https://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* Original Author: Arnaud Roques
*/
package net.sourceforge.plantuml.statediagram.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexOptional;
import net.sourceforge.plantuml.command.regex.RegexOr;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Code;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.Ident;
import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.statediagram.StateDiagram;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.NoSuchColorException;
public class CommandCreateState extends SingleLineCommand2<StateDiagram> {
public CommandCreateState() {
super(getRegexConcat());
}
private static IRegex getRegexConcat() {
return RegexConcat.build(CommandCreateState.class.getName(), RegexLeaf.start(), //
new RegexLeaf("state"), //
RegexLeaf.spaceOneOrMore(), //
new RegexOr(//
new RegexConcat(//
new RegexLeaf("CODE1", "([%pLN_.]+)"), //
RegexLeaf.spaceOneOrMore(), new RegexLeaf("as"), RegexLeaf.spaceOneOrMore(), //
new RegexLeaf("DISPLAY1", "[%g]([^%g]+)[%g]")), //
new RegexConcat(//
new RegexLeaf("DISPLAY2", "[%g]([^%g]+)[%g]"), //
RegexLeaf.spaceOneOrMore(), new RegexLeaf("as"), RegexLeaf.spaceOneOrMore(), //
new RegexLeaf("CODE2", "([%pLN_.]+)")), //
new RegexLeaf("CODE3", "([%pLN_.]+)"), //
new RegexLeaf("CODE4", "[%g]([^%g]+)[%g]")), //
RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STEREOTYPE", "(\\<\\<.*\\>\\>)?"), //
RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
RegexLeaf.spaceZeroOrMore(), //
color().getRegex(), //
RegexLeaf.spaceZeroOrMore(), //
new RegexOptional(new RegexLeaf("LINECOLOR", "##(?:\\[(dotted|dashed|bold)\\])?(\\w+)?")), //
RegexLeaf.spaceZeroOrMore(), //
new RegexOptional( //
new RegexConcat( //
new RegexLeaf(":"), //
RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("ADDFIELD", "(.*)") //
)), RegexLeaf.end());
}
private static ColorParser color() {
return ColorParser.simpleColor(ColorType.BACK);
}
@Override
protected CommandExecutionResult executeArg(StateDiagram diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final String idShort = arg.getLazzy("CODE", 0);
final Ident ident = diagram.buildLeafIdent(idShort);
final Code code = diagram.V1972() ? ident : diagram.buildCode(idShort);
String display = arg.getLazzy("DISPLAY", 0);
if (display == null) {
display = code.getName();
}
final String stereotype = arg.get("STEREOTYPE", 0);
final LeafType type = getTypeFromStereotype(stereotype);
if (diagram.checkConcurrentStateOk(ident, code) == false) {
return CommandExecutionResult.error("The state " + code.getName()
+ " has been created in a concurrent state : it cannot be used here.");
}
final IEntity ent = diagram.getOrCreateLeaf(diagram.buildLeafIdent(idShort), code, type, null);
ent.setDisplay(Display.getWithNewlines(display));
if (stereotype != null) {
ent.setStereotype(Stereotype.build(stereotype));
}
final String urlString = arg.get("URL", 0);
if (urlString != null) {
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
final Url url = urlBuilder.getUrl(urlString);
ent.addUrl(url);
}
Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), arg,
diagram.getSkinParam().getIHtmlColorSet());
final String s = arg.get("LINECOLOR", 1);
final HColor lineColor = s == null ? null
: diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s);
if (lineColor != null) {
colors = colors.add(ColorType.LINE, lineColor);
}
if (arg.get("LINECOLOR", 0) != null) {
colors = colors.addLegacyStroke(arg.get("LINECOLOR", 0));
}
ent.setColors(colors);
// ent.setSpecificColorTOBEREMOVED(ColorType.BACK,
// diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR",
// 0)));
// ent.setSpecificColorTOBEREMOVED(ColorType.LINE,
// diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINECOLOR",
// 1)));
// ent.applyStroke(arg.get("LINECOLOR", 0));
final String addFields = arg.get("ADDFIELD", 0);
if (addFields != null) {
ent.getBodier().addFieldOrMethod(addFields);
}
return CommandExecutionResult.ok();
}
private LeafType getTypeFromStereotype(String stereotype) {
if ("<<choice>>".equalsIgnoreCase(stereotype)) {
return LeafType.STATE_CHOICE;
}
if ("<<fork>>".equalsIgnoreCase(stereotype)) {
return LeafType.STATE_FORK_JOIN;
}
if ("<<join>>".equalsIgnoreCase(stereotype)) {
return LeafType.STATE_FORK_JOIN;
}
if ("<<start>>".equalsIgnoreCase(stereotype)) {
return LeafType.CIRCLE_START;
}
if ("<<end>>".equalsIgnoreCase(stereotype)) {
return LeafType.CIRCLE_END;
}
return null;
}
}
|
talsma-ict/umldoclet
|
src/plantuml-asl/src/net/sourceforge/plantuml/statediagram/command/CommandCreateState.java
|
Java
|
apache-2.0
| 6,894
|
# coding=utf-8
#
# Copyright 2016 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
"""BIG-IP® Network tunnels module.
REST URI
``http://localhost/mgmt/tm/net/tunnels``
GUI Path
``Network --> tunnels``
REST Kind
``tm:net:tunnels:*``
"""
from f5.bigip.resource import Collection
from f5.bigip.resource import OrganizingCollection
from f5.bigip.resource import Resource
class TunnelS(OrganizingCollection):
"""BIG-IP® network tunnels collection"""
def __init__(self, net):
super(TunnelS, self).__init__(net)
self._meta_data['allowed_lazy_attributes'] = [
Gres,
Tunnels,
Vxlans,
]
class Tunnels(Collection):
"""BIG-IP® network tunnels resource (collection for GRE, Tunnel, VXLANs"""
def __init__(self, tunnelS):
super(Tunnels, self).__init__(tunnelS)
self._meta_data['allowed_lazy_attributes'] = [Gres, Tunnel, Vxlans]
self._meta_data['attribute_registry'] =\
{'tm:net:tunnels:tunnel:tunnelstate': Tunnel}
class Tunnel(Resource):
"""BIG-IP® tunnels tunnel resource"""
def __init__(self, tunnels):
super(Tunnel, self).__init__(tunnels)
self._meta_data['required_creation_parameters'].update(('partition',))
self._meta_data['required_json_kind'] =\
'tm:net:tunnels:tunnel:tunnelstate'
class Gres(Collection):
"""BIG-IP® tunnels GRE sub-collection"""
def __init__(self, tunnels):
super(Gres, self).__init__(tunnels)
self._meta_data['allowed_lazy_attributes'] = [Gre]
self._meta_data['attribute_registry'] =\
{'tm:net:tunnels:gre:grestate': Gre}
class Gre(Resource):
"""BIG-IP® tunnels GRE sub-collection resource"""
def __init__(self, gres):
super(Gre, self).__init__(gres)
self._meta_data['required_creation_parameters'].update(('partition',))
self._meta_data['required_json_kind'] =\
'tm:net:tunnels:gre:grestate'
class Vxlans(Collection):
"""BIG-IP® tunnels VXLAN sub-collection"""
def __init__(self, tunnels):
super(Vxlans, self).__init__(tunnels)
self._meta_data['allowed_lazy_attributes'] = [Vxlan]
self._meta_data['attribute_registry'] =\
{'tm:net:tunnels:vxlan:vxlanstate': Vxlan}
class Vxlan(Resource):
"""BIG-IP® tunnels VXLAN sub-collection resource"""
def __init__(self, vxlans):
super(Vxlan, self).__init__(vxlans)
self._meta_data['required_creation_parameters'].update(('partition',))
self._meta_data['required_json_kind'] =\
'tm:net:tunnels:vxlan:vxlanstate'
|
F5Networks/f5-common-python
|
f5/bigip/tm/net/tunnels.py
|
Python
|
apache-2.0
| 3,153
|
/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.elasticloadbalancing.model;
import java.io.Serializable;
/**
* <p>
* The attributes for a load balancer.
* </p>
*/
public class LoadBalancerAttributes implements Serializable, Cloneable {
/**
* If enabled, the load balancer routes the request traffic evenly across
* all back-end instances regardless of the Availability Zones. <p>For
* more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-disable-crosszone-lb.html">Enable
* Cross-Zone Load Balancing</a> in the <i>Elastic Load Balancing
* Developer Guide</i>.
*/
private CrossZoneLoadBalancing crossZoneLoadBalancing;
/**
* If enabled, the load balancer captures detailed information of all
* requests and delivers the information to the Amazon S3 bucket that you
* specify. <p>For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-access-logs.html">Enable
* Access Logs</a> in the <i>Elastic Load Balancing Developer Guide</i>.
*/
private AccessLog accessLog;
/**
* If enabled, the load balancer allows existing requests to complete
* before the load balancer shifts traffic away from a deregistered or
* unhealthy back-end instance. <p>For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/config-conn-drain.html">Enable
* Connection Draining</a> in the <i>Elastic Load Balancing Developer
* Guide</i>.
*/
private ConnectionDraining connectionDraining;
/**
* If enabled, the load balancer allows the connections to remain idle
* (no data is sent over the connection) for the specified duration.
* <p>By default, Elastic Load Balancing maintains a 60-second idle
* connection timeout for both front-end and back-end connections of your
* load balancer. For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/config-idle-timeout.html">Configure
* Idle Connection Timeout</a> in the <i>Elastic Load Balancing Developer
* Guide</i>.
*/
private ConnectionSettings connectionSettings;
/**
* This parameter is reserved.
*/
private com.amazonaws.internal.ListWithAutoConstructFlag<AdditionalAttribute> additionalAttributes;
/**
* If enabled, the load balancer routes the request traffic evenly across
* all back-end instances regardless of the Availability Zones. <p>For
* more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-disable-crosszone-lb.html">Enable
* Cross-Zone Load Balancing</a> in the <i>Elastic Load Balancing
* Developer Guide</i>.
*
* @return If enabled, the load balancer routes the request traffic evenly across
* all back-end instances regardless of the Availability Zones. <p>For
* more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-disable-crosszone-lb.html">Enable
* Cross-Zone Load Balancing</a> in the <i>Elastic Load Balancing
* Developer Guide</i>.
*/
public CrossZoneLoadBalancing getCrossZoneLoadBalancing() {
return crossZoneLoadBalancing;
}
/**
* If enabled, the load balancer routes the request traffic evenly across
* all back-end instances regardless of the Availability Zones. <p>For
* more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-disable-crosszone-lb.html">Enable
* Cross-Zone Load Balancing</a> in the <i>Elastic Load Balancing
* Developer Guide</i>.
*
* @param crossZoneLoadBalancing If enabled, the load balancer routes the request traffic evenly across
* all back-end instances regardless of the Availability Zones. <p>For
* more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-disable-crosszone-lb.html">Enable
* Cross-Zone Load Balancing</a> in the <i>Elastic Load Balancing
* Developer Guide</i>.
*/
public void setCrossZoneLoadBalancing(CrossZoneLoadBalancing crossZoneLoadBalancing) {
this.crossZoneLoadBalancing = crossZoneLoadBalancing;
}
/**
* If enabled, the load balancer routes the request traffic evenly across
* all back-end instances regardless of the Availability Zones. <p>For
* more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-disable-crosszone-lb.html">Enable
* Cross-Zone Load Balancing</a> in the <i>Elastic Load Balancing
* Developer Guide</i>.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param crossZoneLoadBalancing If enabled, the load balancer routes the request traffic evenly across
* all back-end instances regardless of the Availability Zones. <p>For
* more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-disable-crosszone-lb.html">Enable
* Cross-Zone Load Balancing</a> in the <i>Elastic Load Balancing
* Developer Guide</i>.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public LoadBalancerAttributes withCrossZoneLoadBalancing(CrossZoneLoadBalancing crossZoneLoadBalancing) {
this.crossZoneLoadBalancing = crossZoneLoadBalancing;
return this;
}
/**
* If enabled, the load balancer captures detailed information of all
* requests and delivers the information to the Amazon S3 bucket that you
* specify. <p>For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-access-logs.html">Enable
* Access Logs</a> in the <i>Elastic Load Balancing Developer Guide</i>.
*
* @return If enabled, the load balancer captures detailed information of all
* requests and delivers the information to the Amazon S3 bucket that you
* specify. <p>For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-access-logs.html">Enable
* Access Logs</a> in the <i>Elastic Load Balancing Developer Guide</i>.
*/
public AccessLog getAccessLog() {
return accessLog;
}
/**
* If enabled, the load balancer captures detailed information of all
* requests and delivers the information to the Amazon S3 bucket that you
* specify. <p>For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-access-logs.html">Enable
* Access Logs</a> in the <i>Elastic Load Balancing Developer Guide</i>.
*
* @param accessLog If enabled, the load balancer captures detailed information of all
* requests and delivers the information to the Amazon S3 bucket that you
* specify. <p>For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-access-logs.html">Enable
* Access Logs</a> in the <i>Elastic Load Balancing Developer Guide</i>.
*/
public void setAccessLog(AccessLog accessLog) {
this.accessLog = accessLog;
}
/**
* If enabled, the load balancer captures detailed information of all
* requests and delivers the information to the Amazon S3 bucket that you
* specify. <p>For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-access-logs.html">Enable
* Access Logs</a> in the <i>Elastic Load Balancing Developer Guide</i>.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param accessLog If enabled, the load balancer captures detailed information of all
* requests and delivers the information to the Amazon S3 bucket that you
* specify. <p>For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-access-logs.html">Enable
* Access Logs</a> in the <i>Elastic Load Balancing Developer Guide</i>.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public LoadBalancerAttributes withAccessLog(AccessLog accessLog) {
this.accessLog = accessLog;
return this;
}
/**
* If enabled, the load balancer allows existing requests to complete
* before the load balancer shifts traffic away from a deregistered or
* unhealthy back-end instance. <p>For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/config-conn-drain.html">Enable
* Connection Draining</a> in the <i>Elastic Load Balancing Developer
* Guide</i>.
*
* @return If enabled, the load balancer allows existing requests to complete
* before the load balancer shifts traffic away from a deregistered or
* unhealthy back-end instance. <p>For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/config-conn-drain.html">Enable
* Connection Draining</a> in the <i>Elastic Load Balancing Developer
* Guide</i>.
*/
public ConnectionDraining getConnectionDraining() {
return connectionDraining;
}
/**
* If enabled, the load balancer allows existing requests to complete
* before the load balancer shifts traffic away from a deregistered or
* unhealthy back-end instance. <p>For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/config-conn-drain.html">Enable
* Connection Draining</a> in the <i>Elastic Load Balancing Developer
* Guide</i>.
*
* @param connectionDraining If enabled, the load balancer allows existing requests to complete
* before the load balancer shifts traffic away from a deregistered or
* unhealthy back-end instance. <p>For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/config-conn-drain.html">Enable
* Connection Draining</a> in the <i>Elastic Load Balancing Developer
* Guide</i>.
*/
public void setConnectionDraining(ConnectionDraining connectionDraining) {
this.connectionDraining = connectionDraining;
}
/**
* If enabled, the load balancer allows existing requests to complete
* before the load balancer shifts traffic away from a deregistered or
* unhealthy back-end instance. <p>For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/config-conn-drain.html">Enable
* Connection Draining</a> in the <i>Elastic Load Balancing Developer
* Guide</i>.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param connectionDraining If enabled, the load balancer allows existing requests to complete
* before the load balancer shifts traffic away from a deregistered or
* unhealthy back-end instance. <p>For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/config-conn-drain.html">Enable
* Connection Draining</a> in the <i>Elastic Load Balancing Developer
* Guide</i>.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public LoadBalancerAttributes withConnectionDraining(ConnectionDraining connectionDraining) {
this.connectionDraining = connectionDraining;
return this;
}
/**
* If enabled, the load balancer allows the connections to remain idle
* (no data is sent over the connection) for the specified duration.
* <p>By default, Elastic Load Balancing maintains a 60-second idle
* connection timeout for both front-end and back-end connections of your
* load balancer. For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/config-idle-timeout.html">Configure
* Idle Connection Timeout</a> in the <i>Elastic Load Balancing Developer
* Guide</i>.
*
* @return If enabled, the load balancer allows the connections to remain idle
* (no data is sent over the connection) for the specified duration.
* <p>By default, Elastic Load Balancing maintains a 60-second idle
* connection timeout for both front-end and back-end connections of your
* load balancer. For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/config-idle-timeout.html">Configure
* Idle Connection Timeout</a> in the <i>Elastic Load Balancing Developer
* Guide</i>.
*/
public ConnectionSettings getConnectionSettings() {
return connectionSettings;
}
/**
* If enabled, the load balancer allows the connections to remain idle
* (no data is sent over the connection) for the specified duration.
* <p>By default, Elastic Load Balancing maintains a 60-second idle
* connection timeout for both front-end and back-end connections of your
* load balancer. For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/config-idle-timeout.html">Configure
* Idle Connection Timeout</a> in the <i>Elastic Load Balancing Developer
* Guide</i>.
*
* @param connectionSettings If enabled, the load balancer allows the connections to remain idle
* (no data is sent over the connection) for the specified duration.
* <p>By default, Elastic Load Balancing maintains a 60-second idle
* connection timeout for both front-end and back-end connections of your
* load balancer. For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/config-idle-timeout.html">Configure
* Idle Connection Timeout</a> in the <i>Elastic Load Balancing Developer
* Guide</i>.
*/
public void setConnectionSettings(ConnectionSettings connectionSettings) {
this.connectionSettings = connectionSettings;
}
/**
* If enabled, the load balancer allows the connections to remain idle
* (no data is sent over the connection) for the specified duration.
* <p>By default, Elastic Load Balancing maintains a 60-second idle
* connection timeout for both front-end and back-end connections of your
* load balancer. For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/config-idle-timeout.html">Configure
* Idle Connection Timeout</a> in the <i>Elastic Load Balancing Developer
* Guide</i>.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param connectionSettings If enabled, the load balancer allows the connections to remain idle
* (no data is sent over the connection) for the specified duration.
* <p>By default, Elastic Load Balancing maintains a 60-second idle
* connection timeout for both front-end and back-end connections of your
* load balancer. For more information, see <a
* href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/config-idle-timeout.html">Configure
* Idle Connection Timeout</a> in the <i>Elastic Load Balancing Developer
* Guide</i>.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public LoadBalancerAttributes withConnectionSettings(ConnectionSettings connectionSettings) {
this.connectionSettings = connectionSettings;
return this;
}
/**
* This parameter is reserved.
*
* @return This parameter is reserved.
*/
public java.util.List<AdditionalAttribute> getAdditionalAttributes() {
if (additionalAttributes == null) {
additionalAttributes = new com.amazonaws.internal.ListWithAutoConstructFlag<AdditionalAttribute>();
additionalAttributes.setAutoConstruct(true);
}
return additionalAttributes;
}
/**
* This parameter is reserved.
*
* @param additionalAttributes This parameter is reserved.
*/
public void setAdditionalAttributes(java.util.Collection<AdditionalAttribute> additionalAttributes) {
if (additionalAttributes == null) {
this.additionalAttributes = null;
return;
}
com.amazonaws.internal.ListWithAutoConstructFlag<AdditionalAttribute> additionalAttributesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<AdditionalAttribute>(additionalAttributes.size());
additionalAttributesCopy.addAll(additionalAttributes);
this.additionalAttributes = additionalAttributesCopy;
}
/**
* This parameter is reserved.
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if
* any). Use {@link #setAdditionalAttributes(java.util.Collection)} or
* {@link #withAdditionalAttributes(java.util.Collection)} if you want to
* override the existing values.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param additionalAttributes This parameter is reserved.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public LoadBalancerAttributes withAdditionalAttributes(AdditionalAttribute... additionalAttributes) {
if (getAdditionalAttributes() == null) setAdditionalAttributes(new java.util.ArrayList<AdditionalAttribute>(additionalAttributes.length));
for (AdditionalAttribute value : additionalAttributes) {
getAdditionalAttributes().add(value);
}
return this;
}
/**
* This parameter is reserved.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param additionalAttributes This parameter is reserved.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public LoadBalancerAttributes withAdditionalAttributes(java.util.Collection<AdditionalAttribute> additionalAttributes) {
if (additionalAttributes == null) {
this.additionalAttributes = null;
} else {
com.amazonaws.internal.ListWithAutoConstructFlag<AdditionalAttribute> additionalAttributesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<AdditionalAttribute>(additionalAttributes.size());
additionalAttributesCopy.addAll(additionalAttributes);
this.additionalAttributes = additionalAttributesCopy;
}
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getCrossZoneLoadBalancing() != null) sb.append("CrossZoneLoadBalancing: " + getCrossZoneLoadBalancing() + ",");
if (getAccessLog() != null) sb.append("AccessLog: " + getAccessLog() + ",");
if (getConnectionDraining() != null) sb.append("ConnectionDraining: " + getConnectionDraining() + ",");
if (getConnectionSettings() != null) sb.append("ConnectionSettings: " + getConnectionSettings() + ",");
if (getAdditionalAttributes() != null) sb.append("AdditionalAttributes: " + getAdditionalAttributes() );
sb.append("}");
return sb.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getCrossZoneLoadBalancing() == null) ? 0 : getCrossZoneLoadBalancing().hashCode());
hashCode = prime * hashCode + ((getAccessLog() == null) ? 0 : getAccessLog().hashCode());
hashCode = prime * hashCode + ((getConnectionDraining() == null) ? 0 : getConnectionDraining().hashCode());
hashCode = prime * hashCode + ((getConnectionSettings() == null) ? 0 : getConnectionSettings().hashCode());
hashCode = prime * hashCode + ((getAdditionalAttributes() == null) ? 0 : getAdditionalAttributes().hashCode());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (obj instanceof LoadBalancerAttributes == false) return false;
LoadBalancerAttributes other = (LoadBalancerAttributes)obj;
if (other.getCrossZoneLoadBalancing() == null ^ this.getCrossZoneLoadBalancing() == null) return false;
if (other.getCrossZoneLoadBalancing() != null && other.getCrossZoneLoadBalancing().equals(this.getCrossZoneLoadBalancing()) == false) return false;
if (other.getAccessLog() == null ^ this.getAccessLog() == null) return false;
if (other.getAccessLog() != null && other.getAccessLog().equals(this.getAccessLog()) == false) return false;
if (other.getConnectionDraining() == null ^ this.getConnectionDraining() == null) return false;
if (other.getConnectionDraining() != null && other.getConnectionDraining().equals(this.getConnectionDraining()) == false) return false;
if (other.getConnectionSettings() == null ^ this.getConnectionSettings() == null) return false;
if (other.getConnectionSettings() != null && other.getConnectionSettings().equals(this.getConnectionSettings()) == false) return false;
if (other.getAdditionalAttributes() == null ^ this.getAdditionalAttributes() == null) return false;
if (other.getAdditionalAttributes() != null && other.getAdditionalAttributes().equals(this.getAdditionalAttributes()) == false) return false;
return true;
}
@Override
public LoadBalancerAttributes clone() {
try {
return (LoadBalancerAttributes) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException(
"Got a CloneNotSupportedException from Object.clone() "
+ "even though we're Cloneable!",
e);
}
}
}
|
trasa/aws-sdk-java
|
aws-java-sdk-elasticloadbalancing/src/main/java/com/amazonaws/services/elasticloadbalancing/model/LoadBalancerAttributes.java
|
Java
|
apache-2.0
| 24,010
|
/*
* 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.phoenix.end2end.join;
import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES;
import static org.junit.Assert.fail;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.Random;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.coprocessor.ObserverContext;
import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
import org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver;
import org.apache.phoenix.cache.GlobalCache;
import org.apache.phoenix.cache.TenantCache;
import org.apache.phoenix.coprocessor.HashJoinCacheNotFoundException;
import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest;
import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr;
import org.apache.phoenix.join.HashJoinInfo;
import org.apache.phoenix.query.QueryServices;
import org.apache.phoenix.util.ByteUtil;
import org.apache.phoenix.util.PropertiesUtil;
import org.apache.phoenix.util.SchemaUtil;
import org.apache.phoenix.util.TestUtil;
import org.junit.Test;
import org.junit.experimental.categories.Category;
@Category(NeedsOwnMiniClusterTest.class)
public class HashJoinCacheIT extends BaseJoinIT {
@Override
protected String getTableName(Connection conn, String virtualName) throws Exception {
String realName = super.getTableName(conn, virtualName);
TestUtil.addCoprocessor(conn, SchemaUtil.normalizeFullTableName(realName), InvalidateHashCache.class);
return realName;
}
@Test
public void testExpiredCache() throws Exception {
Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
props.setProperty(QueryServices.MAX_SERVER_CACHE_TIME_TO_LIVE_MS_ATTRIB, "1");
Connection conn = DriverManager.getConnection(getUrl(), props);
String tableName1 = getTableName(conn, JOIN_SUPPLIER_TABLE_FULL_NAME);
String tableName2 = getTableName(conn, JOIN_ITEM_TABLE_FULL_NAME);
String query = "SELECT item.\"item_id\", item.name, supp.\"supplier_id\", supp.name FROM " +
tableName1 + " supp RIGHT JOIN " + tableName2 +
" item ON item.\"supplier_id\" = supp.\"supplier_id\" ORDER BY \"item_id\"";
try {
PreparedStatement statement = conn.prepareStatement(query);
ResultSet rs = statement.executeQuery();
rs.next();
fail("HashJoinCacheNotFoundException was not thrown or incorrectly handled");
} catch (HashJoinCacheNotFoundException e) {
//Expected exception
}
}
public static class InvalidateHashCache extends SimpleRegionObserver {
public static Random rand= new Random();
public static List<ImmutableBytesPtr> lastRemovedJoinIds=new ArrayList<ImmutableBytesPtr>();
@Override
public void preScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> c, final Scan scan) throws IOException {
final HashJoinInfo joinInfo = HashJoinInfo.deserializeHashJoinFromScan(scan);
if (joinInfo != null) {
TenantCache cache = GlobalCache.getTenantCache(c.getEnvironment(), null);
int count = joinInfo.getJoinIds().length;
for (int i = 0; i < count; i++) {
ImmutableBytesPtr joinId = joinInfo.getJoinIds()[i];
if (!ByteUtil.contains(lastRemovedJoinIds,joinId)) {
lastRemovedJoinIds.add(joinId);
cache.removeServerCache(joinId);
}
}
}
}
}
}
|
growingio/phoenix
|
phoenix-core/src/it/java/org/apache/phoenix/end2end/join/HashJoinCacheIT.java
|
Java
|
apache-2.0
| 4,581
|
/*
* Copyright 2013-2017 Grzegorz Ligas <ligasgr@gmail.com> and other contributors
* (see the CONTRIBUTORS file).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// This is a generated file. Not intended for manual editing.
package org.intellij.xquery.psi;
import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.psi.PsiElement;
public interface XQueryCDataSectionContents extends XQueryPsiElement {
}
|
ligasgr/intellij-xquery
|
gen/org/intellij/xquery/psi/XQueryCDataSectionContents.java
|
Java
|
apache-2.0
| 941
|
import React, { Component } from 'react';
import {
Modal,
Row,
Col,
FormGroup,
FormControl,
Button
} from 'react-bootstrap';
import md5 from 'md5';
import api from './../api';
import Error from './../Error';
export default class Login extends Component {
constructor(props) {
super(props);
this.state = {
usuario: '',
senha: ''
}
this.handleChange = this.handleChange.bind(this);
this.handleCloseDialog = this.handleCloseDialog.bind(this);
this.handleLogin = this.handleLogin.bind(this);
}
handleChange(element) {
this.setState({[element.target.name]: element.target.value})
}
handleCloseDialog() {
this.setState({dialog: null});
}
handleLogin() {
api.usuario.login(this.state.usuario, md5(this.state.senha), this.handleAuthenticate.bind(this))
}
handleAuthenticate(user) {
if (user.nome) {
this.props.onLogin && this.props.onLogin(user);
} else {
let err = {mensagem: 'Usuário e senha não encontrado. Verifique se digitou a senha corretamente.'}
this.setState({dialog: <Error {...err} onClose={this.handleCloseDialog.bind(this)} />})
}
}
render() {
return(
<div className="static-modal">
<Modal.Dialog>
<Modal.Header>
<Modal.Title>Controle de Acesso</Modal.Title>
</Modal.Header>
<Modal.Body>
<Row>
<Col md={4}>Usuario</Col>
<Col md={8}>
<FormGroup validationState="success">
{/*<ControlLabel>Input with success and feedback icon</ControlLabel>*/}
<FormControl type="text" name="usuario" value={this.state.usuario} onChange={this.handleChange} />
<FormControl.Feedback />
</FormGroup>
</Col>
</Row>
<Row>
<Col md={4}>Senha</Col>
<Col md={8}>
<FormGroup validationState="success">
{/*<ControlLabel>Input with success and feedback icon</ControlLabel>*/}
<FormControl type="password" name="senha" value={this.state.senha} onChange={this.handleChange} />
<FormControl.Feedback />
</FormGroup>
</Col>
</Row>
</Modal.Body>
<Modal.Footer>
<Button bsStyle="primary" onClick={this.handleLogin} >Acessar</Button>
</Modal.Footer>
{this.state.dialog}
</Modal.Dialog>
</div>
);
}
}
|
MarceloProjetos/react-router-node-red
|
src/login/index.js
|
JavaScript
|
apache-2.0
| 2,549
|
/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/cloudfront/CloudFront_EXPORTS.h>
#include <aws/cloudfront/model/OriginProtocolPolicy.h>
#include <aws/cloudfront/model/OriginSslProtocols.h>
namespace Aws
{
namespace Utils
{
namespace Xml
{
class XmlNode;
} // namespace Xml
} // namespace Utils
namespace CloudFront
{
namespace Model
{
/**
* A customer origin.
*/
class AWS_CLOUDFRONT_API CustomOriginConfig
{
public:
CustomOriginConfig();
CustomOriginConfig(const Aws::Utils::Xml::XmlNode& xmlNode);
CustomOriginConfig& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const;
/**
* The HTTP port the custom origin listens on.
*/
inline int GetHTTPPort() const{ return m_hTTPPort; }
/**
* The HTTP port the custom origin listens on.
*/
inline void SetHTTPPort(int value) { m_hTTPPortHasBeenSet = true; m_hTTPPort = value; }
/**
* The HTTP port the custom origin listens on.
*/
inline CustomOriginConfig& WithHTTPPort(int value) { SetHTTPPort(value); return *this;}
/**
* The HTTPS port the custom origin listens on.
*/
inline int GetHTTPSPort() const{ return m_hTTPSPort; }
/**
* The HTTPS port the custom origin listens on.
*/
inline void SetHTTPSPort(int value) { m_hTTPSPortHasBeenSet = true; m_hTTPSPort = value; }
/**
* The HTTPS port the custom origin listens on.
*/
inline CustomOriginConfig& WithHTTPSPort(int value) { SetHTTPSPort(value); return *this;}
/**
* The origin protocol policy to apply to your origin.
*/
inline const OriginProtocolPolicy& GetOriginProtocolPolicy() const{ return m_originProtocolPolicy; }
/**
* The origin protocol policy to apply to your origin.
*/
inline void SetOriginProtocolPolicy(const OriginProtocolPolicy& value) { m_originProtocolPolicyHasBeenSet = true; m_originProtocolPolicy = value; }
/**
* The origin protocol policy to apply to your origin.
*/
inline void SetOriginProtocolPolicy(OriginProtocolPolicy&& value) { m_originProtocolPolicyHasBeenSet = true; m_originProtocolPolicy = value; }
/**
* The origin protocol policy to apply to your origin.
*/
inline CustomOriginConfig& WithOriginProtocolPolicy(const OriginProtocolPolicy& value) { SetOriginProtocolPolicy(value); return *this;}
/**
* The origin protocol policy to apply to your origin.
*/
inline CustomOriginConfig& WithOriginProtocolPolicy(OriginProtocolPolicy&& value) { SetOriginProtocolPolicy(value); return *this;}
/**
* The SSL/TLS protocols that you want CloudFront to use when communicating with
* your origin over HTTPS.
*/
inline const OriginSslProtocols& GetOriginSslProtocols() const{ return m_originSslProtocols; }
/**
* The SSL/TLS protocols that you want CloudFront to use when communicating with
* your origin over HTTPS.
*/
inline void SetOriginSslProtocols(const OriginSslProtocols& value) { m_originSslProtocolsHasBeenSet = true; m_originSslProtocols = value; }
/**
* The SSL/TLS protocols that you want CloudFront to use when communicating with
* your origin over HTTPS.
*/
inline void SetOriginSslProtocols(OriginSslProtocols&& value) { m_originSslProtocolsHasBeenSet = true; m_originSslProtocols = value; }
/**
* The SSL/TLS protocols that you want CloudFront to use when communicating with
* your origin over HTTPS.
*/
inline CustomOriginConfig& WithOriginSslProtocols(const OriginSslProtocols& value) { SetOriginSslProtocols(value); return *this;}
/**
* The SSL/TLS protocols that you want CloudFront to use when communicating with
* your origin over HTTPS.
*/
inline CustomOriginConfig& WithOriginSslProtocols(OriginSslProtocols&& value) { SetOriginSslProtocols(value); return *this;}
private:
int m_hTTPPort;
bool m_hTTPPortHasBeenSet;
int m_hTTPSPort;
bool m_hTTPSPortHasBeenSet;
OriginProtocolPolicy m_originProtocolPolicy;
bool m_originProtocolPolicyHasBeenSet;
OriginSslProtocols m_originSslProtocols;
bool m_originSslProtocolsHasBeenSet;
};
} // namespace Model
} // namespace CloudFront
} // namespace Aws
|
ambasta/aws-sdk-cpp
|
aws-cpp-sdk-cloudfront/include/aws/cloudfront/model/CustomOriginConfig.h
|
C
|
apache-2.0
| 4,856
|
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch 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.elasticsearch.test.action.index;
import org.elasticsearch.action.index.IndexAction;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.testframework.ESTestCase;
import org.elasticsearch.testframework.client.NoOpClient;
import org.junit.After;
import org.junit.Before;
import java.io.ByteArrayOutputStream;
import java.util.HashMap;
import java.util.Map;
public class IndexRequestBuilderTests extends ESTestCase {
private static final String EXPECTED_SOURCE = "{\"SomeKey\":\"SomeValue\"}";
private NoOpClient testClient;
@Override
@Before
public void setUp() throws Exception {
super.setUp();
this.testClient = new NoOpClient(getTestName());
}
@Override
@After
public void tearDown() throws Exception {
this.testClient.close();
super.tearDown();
}
/**
* test setting the source for the request with different available setters
*/
public void testSetSource() throws Exception {
IndexRequestBuilder indexRequestBuilder = new IndexRequestBuilder(this.testClient, IndexAction.INSTANCE);
Map<String, String> source = new HashMap<>();
source.put("SomeKey", "SomeValue");
indexRequestBuilder.setSource(source);
assertEquals(EXPECTED_SOURCE, XContentHelper.convertToJson(indexRequestBuilder.request().source(), true));
indexRequestBuilder.setSource(source, XContentType.JSON);
assertEquals(EXPECTED_SOURCE, XContentHelper.convertToJson(indexRequestBuilder.request().source(), true));
indexRequestBuilder.setSource("SomeKey", "SomeValue");
assertEquals(EXPECTED_SOURCE, XContentHelper.convertToJson(indexRequestBuilder.request().source(), true));
// force the Object... setter
indexRequestBuilder.setSource((Object) "SomeKey", "SomeValue");
assertEquals(EXPECTED_SOURCE, XContentHelper.convertToJson(indexRequestBuilder.request().source(), true));
ByteArrayOutputStream docOut = new ByteArrayOutputStream();
XContentBuilder doc = XContentFactory.jsonBuilder(docOut).startObject().field("SomeKey", "SomeValue").endObject();
doc.close();
indexRequestBuilder.setSource(docOut.toByteArray(), XContentType.JSON);
assertEquals(EXPECTED_SOURCE, XContentHelper.convertToJson(indexRequestBuilder.request().source(), true,
indexRequestBuilder.request().getContentType()));
doc = XContentFactory.jsonBuilder().startObject().field("SomeKey", "SomeValue").endObject();
doc.close();
indexRequestBuilder.setSource(doc);
assertEquals(EXPECTED_SOURCE, XContentHelper.convertToJson(indexRequestBuilder.request().source(), true));
}
}
|
jprante/elasticsearch-server
|
server/src/test/java/org/elasticsearch/test/action/index/IndexRequestBuilderTests.java
|
Java
|
apache-2.0
| 3,756
|
#region Apache License Notice
// Copyright © 2014, Silverlake Software LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
namespace ProxyFoo.Core.Foo
{
sealed class FooTypeFromTypeBuilder : IFooTypeBuilder
{
readonly TypeBuilder _typeBuilder;
readonly List<MemberInfo> _members = new List<MemberInfo>();
readonly Dictionary<MemberInfo, Type[]> _paramsByMember = new Dictionary<MemberInfo, Type[]>();
public FooTypeFromTypeBuilder(TypeBuilder typeBuilder)
{
_typeBuilder = typeBuilder;
}
public Type AsType()
{
#if FEATURE_LEGACYREFLECTION
return _typeBuilder;
#else
return _typeBuilder.AsType();
#endif
}
public ConstructorBuilder DefineConstructor(MethodAttributes attributes, CallingConventions callingConvention, Type[] parameterTypes)
{
var cb = _typeBuilder.DefineConstructor(attributes, callingConvention, parameterTypes);
_members.Add(cb);
_paramsByMember.Add(cb, parameterTypes);
return cb;
}
public FieldBuilder DefineField(string fieldName, Type type, FieldAttributes attributes)
{
var fb = _typeBuilder.DefineField(fieldName, type, attributes);
_members.Add(fb);
return fb;
}
public PropertyBuilder DefineProperty(string name, PropertyAttributes attributes, Type returnType, Type[] parameterTypes)
{
var pb = _typeBuilder.DefineProperty(name, attributes, returnType, parameterTypes);
_members.Add(pb);
_paramsByMember.Add(pb, parameterTypes);
return pb;
}
public MethodBuilder DefineMethod(string name, MethodAttributes attributes, Type returnType, Type[] parameterTypes)
{
var mb = _typeBuilder.DefineMethod(name, attributes, returnType, parameterTypes);
_members.Add(mb);
_paramsByMember.Add(mb, parameterTypes);
return mb;
}
public ConstructorInfo GetConstructor(Type[] types)
{
return _members.OfType<ConstructorBuilder>().SingleOrDefault(c => _paramsByMember[c].SequenceEqual(types));
}
public FieldInfo GetField(string name)
{
return _members.OfType<FieldInfo>().SingleOrDefault(a => a.IsPublic && a.Name==name);
}
public PropertyInfo GetProperty(string name, Type propertyType, Type[] types)
{
return _members.OfType<PropertyBuilder>().SingleOrDefault(p => p.Name==name && p.PropertyType==propertyType && _paramsByMember[p].SequenceEqual(types));
}
public MethodInfo GetMethod(string name, Type[] types)
{
return _members.OfType<MethodBuilder>().SingleOrDefault(m => m.Name==name && _paramsByMember[m].SequenceEqual(types));
}
}
}
|
ProxyFoo/ProxyFoo
|
source/ProxyFoo/Core/Foo/FooTypeFromTypeBuilder.cs
|
C#
|
apache-2.0
| 3,553
|
var searchData=
[
['call',['call',['../select2_8js.html#aed63747d658b9ef1878fda471c519855',1,'select2.js']]],
['cleardropdownalignmentpreference',['clearDropdownAlignmentPreference',['../select2_8js.html#a720684602e142b73d3f2c3bc8a9abfa6',1,'select2.js']]],
['clearsearch',['clearSearch',['../select2_8js.html#a0daa3a419e750a83f25eae438fd78e7f',1,'select2.js']]],
['click',['click',['../select2_8js.html#afc4f810ddf843d199e01f73c790c47d9',1,'select2.js']]],
['close',['close',['../select2_8js.html#afaff1af430762c8f59afd2326157c9e0',1,'select2.js']]],
['createaward',['createAward',['../awards_8php.html#a9907ea6ed2f9c3953ced2eb213555825',1,'awards.php']]],
['createcategory',['createCategory',['../categories_8php.html#a938139f39c4b1b632aa6d3ccfe41436c',1,'categories.php']]],
['createevent',['createEvent',['../event_8php.html#a859e985dd79c3d1f4df016906a2bdc19',1,'event.php']]],
['createform',['createForm',['../form_8php.html#aede244e7daf130e33ee27fe4ff788cb5',1,'form.php']]],
['createproject',['createProject',['../project_8php.html#affa057947b4f40ec28061d9c2e84aed1',1,'project.php']]],
['createuser',['createUser',['../user_8php.html#a121d44623c67932b3a0bd08bb766bfca',1,'user.php']]],
['css',['css',['../select2_8js.html#ab0e706c905ff737007bda5949ae94902',1,'select2.js']]]
];
|
zwmcfarland/MSEF
|
doxygen documentation/search/functions_3.js
|
JavaScript
|
apache-2.0
| 1,310
|
/*
* Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.polly.model.transform;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.polly.model.*;
import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;
/**
* ListLexiconsRequestMarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class ListLexiconsRequestMarshaller {
private static final MarshallingInfo<String> NEXTTOKEN_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.QUERY_PARAM).marshallLocationName("NextToken").build();
private static final ListLexiconsRequestMarshaller instance = new ListLexiconsRequestMarshaller();
public static ListLexiconsRequestMarshaller getInstance() {
return instance;
}
/**
* Marshall the given parameter object.
*/
public void marshall(ListLexiconsRequest listLexiconsRequest, ProtocolMarshaller protocolMarshaller) {
if (listLexiconsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listLexiconsRequest.getNextToken(), NEXTTOKEN_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}
|
dagnir/aws-sdk-java
|
aws-java-sdk-polly/src/main/java/com/amazonaws/services/polly/model/transform/ListLexiconsRequestMarshaller.java
|
Java
|
apache-2.0
| 1,992
|
#!/usr/bin/env python
'''
Extract reads which aren't mapped from a SAM or SAM.gz file.
Behavior for PE:
-Write out PE only if both do not map (if either of the pair maps, neither is retained)
Behavior for SE:
-Write out SE if they don't map
Iterate over a SAM or SAM.gz file. take everything where the 3rd and
4th flag bit are set to 1 and write reads out to files.
0x1 template having multiple segments in sequencing
0x2 each segment properly aligned according to the aligner
0x4 segment unmapped
0x8 next segment in the template unmapped
0x10 SEQ being reverse complemented
0x20 SEQ of the next segment in the template being reversed
0x40 the first segment in the template
0x80 the last segment in the template
0x100 secondary alignment
0x200 not passing quality controls
0x400 PCR or optical duplicate
TODO:
1) Add support for retaining both reads if one of a pair don't map but the other does
2) Add support for retaining the pair (or SE) if a read maps with low mapq
Note:
It is necessary to double check that both pairs of the PE read really exist in the SAM
file just in case it somehow gets disordered. This is taken care of by keeping the PE
reads in a set of dictionaries and then deleting them once the pair is written.
In the case where a read is somehow labeled as paired, but the pair doesn't exist, the
read is NOT written.
'''
import sys
import os
from optparse import OptionParser # http://docs.python.org/library/optparse.html
import gzip
usage = "usage: %prog [options] -o output_base inputfile.SAM"
parser = OptionParser(usage=usage, version="%prog 2.0.1")
parser.add_option('-u', '--uncompressed', help="leave output files uncompressed",
action="store_true", dest="uncompressed")
parser.add_option('-o', '--output_base', help="output file basename",
action="store", type="str", dest="output_base", default="screened")
parser.add_option('-t', '--tab-seperated', help="seperated out the output in tab",
action="store_true", dest="tabSeperated")
parser.add_option('-v', '--verbose', help="verbose output",
action="store_false", dest="verbose", default=True)
(options, args) = parser.parse_args() # uncomment this line for command line support
if len(args) == 1:
infile = args[0]
# Start opening input/output files:
if not os.path.exists(infile):
print >> sys.stderr, "Error, can't find input file %s" % infile
sys.exit()
if infile.split(".")[-1] == "gz":
insam = gzip.open(infile, 'rb')
else:
insam = open(infile, 'r')
else:
# reading from stdin
insam = sys.stdin
base = options.output_base
PE1 = {}
PE2 = {}
contig_map = {}
interleaved = False
def writeread(ID, r1, r2):
if interleaved:
if options.tabSeperated is True:
# read1
print ID + "\t" + r1[0] + "\t" + r1[1] + "\t" + r2[0] + "\t" + r2[1] + "\n"
else:
print "@" + ID + "#0/1"
print r1[0]
print '+\n' + r1[1]
# read2
print "@" + ID + "#0/2"
print r2[0]
print '+\n' + r2[1]
else:
# read1
outPE1.write("@" + ID + "#0/1" '\n')
outPE1.write(r1[0] + '\n')
outPE1.write('+\n' + r1[1] + '\n')
# read2
outPE2.write("@" + ID + "#0/2" '\n')
outPE2.write(r2[0] + '\n')
outPE2.write('+\n' + r2[1] + '\n')
i = 0
PE_written = 0
SE_written = 0
SE_open = False
PE_open = False
line2 = []
for line in insam:
# Comment/header lines start with @
if line[0] != "@" and len(line.strip().split()) > 2:
line2 = line.strip().split()
flag = int(line2[1])
if (flag & 0x100): # secondary alignment
continue
i += 1
# Handle SE:
# unapped SE reads have 0x1 set to 0, and 0x4 (third bit) set to 1
if (flag & 0x1 == 0) and (flag & 0x4):
ID = line2[0].split("#")[0]
if not SE_open:
if base == "stdout":
interleaved = True
elif options.uncompressed:
outSE = open(base + "_SE.fastq", 'w')
else:
outSE = gzip.open(base + "_SE.fastq.gz", 'wb')
SE_open = True
# interleaved just means to stdout in this case
if (interleaved):
if options.tabSeperated is True:
print ID + "\t" + line2[9] + "\t" + line2[10] + "\n"
else:
print "@" + ID
print line2[9]
print '+\n' + line2[10]
else:
outSE.write("@" + ID + '\n')
outSE.write(line2[9] + '\n')
outSE.write('+\n' + line2[10] + '\n')
SE_written += 1
continue
# Handle PE:
# logic: 0x1 = multiple segments in sequencing, 0x4 = segment unmapped, 0x8 = next segment unmapped, 0x80 the last segment in the template
if ((flag & 0x1) and (flag & 0x4) and (flag & 0x8)):
if not PE_open:
if base == "stdout":
interleaved = True
elif options.uncompressed:
outPE1 = open(base + "_PE1.fastq", 'w')
outPE2 = open(base + "_PE2.fastq", 'w')
else:
outPE1 = gzip.open(base + "_PE1.fastq.gz", 'wb')
outPE2 = gzip.open(base + "_PE2.fastq.gz", 'wb')
PE_open = True
if (flag & 0x40): # is this PE1 (first segment in template)
# PE1 read, check that PE2 is in dict and write out
ID = line2[0].split("#")[0]
r1 = [line2[9], line2[10]] # sequence + qual
if ID in PE2:
writeread(ID, r1, PE2[ID])
del PE2[ID]
PE_written += 1
else:
PE1[ID] = r1
continue
elif (flag & 0x80): # is this PE2 (last segment in template)
# PE2 read, check that PE1 is in dict and write out
ID = line2[0].split("#")[0]
r2 = [line2[9], line2[10]]
if ID in PE1:
writeread(ID, PE1[ID], r2)
del PE1[ID]
PE_written += 1
else:
PE2[ID] = r2
continue
# was mapped, count it up
# if line2 != []:
# contig = line2[2]
# if contig in contig_map.keys():
# if (flag & 0x1 == 0): # SE
# contig_map[contig]["SE"] += 1
# elif (flag & 0x40): # PE, Just count the first in the pair
# contig_map[contig]["PE"] += 1
# else:
# contig_map[contig] = {}
# if (flag & 0x1 == 0): # SE
# contig_map[contig]["SE"] = 1
# contig_map[contig]["PE"] = 0
# elif (flag & 0x40): # PE, Just count the first in the pair
# contig_map[contig]["SE"] = 0
# contig_map[contig]["PE"] = 1
# for k in contig_map.keys():
# print >> sys.stderr, "\tFound %s: percent: %.2f, PE mapped: %s, SE mapped: %s" % (k, (2*PE_written+SE_written)/i, contig_map[k]["PE"], contig_map[k]["SE"])
print >> sys.stderr, "Records processed: %s | PE_written: %s | SE_written: %s | Discarded: %s " % (i, PE_written, SE_written, i-(PE_written*2+SE_written))
if base != "stdout":
if PE_open:
outPE1.close()
outPE2.close()
if SE_open:
outSE.close()
|
msettles/expHTS
|
expHTS/extract_unmapped_reads.py
|
Python
|
apache-2.0
| 7,685
|
/**
* Copyright 2016 Lucio Benfante <lucio.benfante@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Style tweaks
* --------------------------------------------------
*/
html,
body {
overflow-x: hidden; /* Prevent scroll on narrow devices */
}
body {
padding-top: 70px;
}
footer {
padding: 30px 0;
}
/*
* Off Canvas
* --------------------------------------------------
*/
@media screen and (max-width: 767px) {
.row-offcanvas {
position: relative;
-webkit-transition: all .25s ease-out;
-o-transition: all .25s ease-out;
transition: all .25s ease-out;
}
.row-offcanvas-right {
right: 0;
}
.row-offcanvas-left {
left: 0;
}
.row-offcanvas-right
.sidebar-offcanvas {
right: -50%; /* 6 columns */
}
.row-offcanvas-left
.sidebar-offcanvas {
left: -50%; /* 6 columns */
}
.row-offcanvas-right.active {
right: 50%; /* 6 columns */
}
.row-offcanvas-left.active {
left: 50%; /* 6 columns */
}
.sidebar-offcanvas {
position: absolute;
top: 0;
width: 50%; /* 6 columns */
}
}
|
benfante/FrontendToolsExample
|
src/main/styles/offcanvas.css
|
CSS
|
apache-2.0
| 1,612
|
/**
* Copyright (C) 2015 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.fabric8.kubernetes.api.model.admissionregistration;
import io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfiguration;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class ValidatingWebhookConfigurationTest {
@Test
public void testBuilder() {
ValidatingWebhookConfiguration vwc = new io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfigurationBuilder()
.withNewMetadata().withName("pod-policy.example.com").endMetadata()
.addNewWebhook()
.withName("pod-policy.example.com")
.addNewRule()
.withApiGroups("")
.withApiVersions("v1")
.withOperations("CREATE")
.withResources("pods")
.withScope("Namespaced")
.endRule()
.withNewClientConfig()
.withNewService()
.withNamespace("example-namespace")
.withName("example-service")
.endService()
.endClientConfig()
.withAdmissionReviewVersions("v1", "v1beta1")
.withSideEffects("None")
.withTimeoutSeconds(5)
.endWebhook()
.build();
assertEquals("pod-policy.example.com", vwc.getMetadata().getName());
assertEquals(1, vwc.getWebhooks().size());
}
}
|
fabric8io/kubernetes-client
|
kubernetes-model-generator/kubernetes-model-admissionregistration/src/test/java/io/fabric8/kubernetes/api/model/admissionregistration/ValidatingWebhookConfigurationTest.java
|
Java
|
apache-2.0
| 1,867
|
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
FROM openjdk:11-jdk-slim
RUN groupadd -g 10001 pulsar
RUN adduser -u 10000 --gid 10001 --disabled-login --disabled-password --gecos '' pulsar
ARG PULSAR_TARBALL=target/pulsar-server-distribution-bin.tar.gz
ADD ${PULSAR_TARBALL} /
RUN mv /apache-pulsar-* /pulsar
RUN chown -R root:root /pulsar
COPY target/scripts /pulsar/bin
RUN chmod a+rx /pulsar/bin/*
RUN echo networkaddress.cache.ttl=1 >> $JAVA_HOME/conf/security/java.security
WORKDIR /pulsar
RUN apt-get update
# /pulsar/bin/watch-znode.py requires python3-kazoo
# /pulsar/bin/pulsar-managed-ledger-admin requires python3-protobuf
RUN apt-get install -y python3-kazoo python3-protobuf
# use python3 for watch-znode.py and pulsar-managed-ledger-admin
RUN sed -i '1 s/.*/#!\/usr\/bin\/python3/' /pulsar/bin/watch-znode.py /pulsar/bin/pulsar-managed-ledger-admin
# required by gen-yml-from-env.py
RUN apt-get install -y python-yaml
RUN apt-get install -y supervisor procps curl less netcat dnsutils iputils-ping
RUN mkdir -p /var/log/pulsar \
&& mkdir -p /var/run/supervisor/ \
&& mkdir -p /pulsar/ssl
COPY target/conf /etc/supervisord/conf.d/
RUN mv /etc/supervisord/conf.d/supervisord.conf /etc/supervisord.conf
COPY target/ssl /pulsar/ssl/
COPY target/java-test-functions.jar /pulsar/examples/
ENV PULSAR_ROOT_LOGGER=INFO,CONSOLE
RUN chown -R pulsar:0 /pulsar && chmod -R g=u /pulsar
# cleanup
RUN apt-get clean \
&& rm -rf /var/lib/apt/lists/*
|
yahoo/pulsar
|
tests/docker-images/java-test-image/Dockerfile
|
Dockerfile
|
apache-2.0
| 2,219
|
package restaurant.mcneal.roles;
import restaurant.mcneal.interfaces.McNealWaiter;
import interfaces.Building;
//import restaurant.mcneal.gui.RestaurantPanel;
public class McNealWaiterRole extends WaiterAgent {
public McNealWaiterRole() {
super();
}
public void taketoCook(myCustomer cust) {
Do ("Your order will be ready soon. Taking to cook");
// waiterGui.DoLeaveCustomer();
//waiterGui.DoGoToCook();
//try {
// atCook.acquire();
//} catch (InterruptedException e) {
// e.printStackTrace();
//revolver.add(cust.getMyWaiter(), cust.getStringChoice(), cust.getTable());
//} waiterGui.DoLeaveCook();
System.out.println(cust.getCustomer().getFoodChoice());
System.out.println("the choice was " + cust.getCustomer().getFoodChoice());
System.out.println(cust.getTable());
if( this.getCook()== null) {
print("c is null fool");
}
this.getCook().msgHereisAnOrder(this, cust.getCustomer().getFoodChoice(), cust.getTable());
}
@Override
public void msgAtBuilding(Building building) {
// TODO Auto-generated method stub
}
}
|
Yunying/SimCity
|
src/restaurant/mcneal/roles/McNealWaiterRole.java
|
Java
|
apache-2.0
| 1,336
|
docsearch({
apiKey: '6c42f30d9669d8e42f6fc92f44028596',
indexName: 'docs-ray',
appId: 'LBHF0PABBL',
inputSelector: '#search-input',
debug: false,
});
|
ray-project/ray
|
doc/source/_static/js/docsearch.js
|
JavaScript
|
apache-2.0
| 169
|
/**
* Copyright(C) 2009-2012
* @author Jing HUANG
* @file ComputeShader.cpp
* @brief
* @date 1/2/2011
*/
#include "ComputeShader.h"
#include <vector>
/**
* @brief For tracking memory leaks under windows using the crtdbg
*/
#if ( defined( _DEBUG ) || defined( DEBUG ) ) && defined( _MSC_VER )
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#define DEBUG_NEW new( _NORMAL_BLOCK, __FILE__, __LINE__ )
#define new DEBUG_NEW
#endif
namespace Etoile
{
ComputeShader::ComputeShader(): ShaderObject(SHADERTYPE_VERTEX)
{
_x_Compute = _y_Compute = _z_Compute = 0;
}
ComputeShader::ComputeShader(const std::string& shaderFilename):ShaderObject(SHADERTYPE_VERTEX,shaderFilename){}
void ComputeShader::setSize(unsigned int x, unsigned int y, unsigned int z)
{
_x_Compute = x;
_y_Compute = y;
_z_Compute = z;
}
void ComputeShader::checkShaderObject()
{
ShaderObject::checkShaderObject();
GLint maxGroupCount;
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT,0, &maxGroupCount);
std::cout<<"GL_MAX_COMPUTE_WORK_GROUP_COUNT: "<<maxGroupCount<<std::endl;
GLint x, y, z;
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 0, &x);
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 1, &y);
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 2, &z);
std::cout<<"GL_MAX_COMPUTE_WORK_GROUP_SIZE: x["<< x<<"] y["<<y <<"] z["<<z<<"]"<<std::endl;
GLint maximum_number_of_invocations;
glGetIntegerv(GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS, &maximum_number_of_invocations);
std::cout<<"GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS: "<<maximum_number_of_invocations<<std::endl;
}
}
|
billhj/Etoile2015
|
auxiliary/renderer/OpenGL/ComputeShader.cpp
|
C++
|
apache-2.0
| 1,602
|
FROM eu.gcr.io/peopledata-product-team/td.nodejs:latest
ENV APP_ENV docker
COPY package.json /app/
RUN npm install
COPY . /app/
|
techops-peopledata/td.core
|
Dockerfile
|
Dockerfile
|
apache-2.0
| 131
|
package com.zombie.controller;
import java.io.IOException;
import java.security.Principal;
import java.sql.Timestamp;
import java.text.DecimalFormat;
import java.util.List;
import java.util.Random;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.userdetails.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import com.zombie.dao.EdgeDao;
import com.zombie.dao.PlayerDao;
import com.zombie.entities.Edge;
import com.zombie.entities.Player;
/**
* @author Jian Luan
*/
@RestController
@RequestMapping("/players")
public class PlayerController {
@Autowired
private PlayerDao playerDao;
@Autowired
private EdgeDao edgeDao;
@RequestMapping(value="/home", method=RequestMethod.GET)
public ModelAndView playersHome() {
List<Player> players = playerDao.getAllPlayers();
ModelAndView model = new ModelAndView("home");
model.addObject("players", players);
return model;
}
/** Returns JSON String */
@ResponseBody
@RequestMapping("/get")
public List<Player> playersHomeRest() {
List<Player> players = playerDao.getAllPlayers();
return players;
}
@RequestMapping(value="/addPlayer", method=RequestMethod.GET)
public void addPlayer(String name, Principal principal, HttpServletResponse response) throws IOException {
// , String species, int points, double locationx, double locationy was
// in arguement before
DecimalFormat df2 = new DecimalFormat(".####");
User activeUser = (User) ((Authentication) principal).getPrincipal();
String user = activeUser.getUsername();
Player player = new Player();
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
Random random = new Random();
double locationx = Double.parseDouble(df2.format(random.nextDouble() * ((-76.98) - (-77.07)) + -77.07));
double locationy = Double.parseDouble(df2.format(random.nextDouble() * ((38.91) - (38.87)) + 38.87));
String[] species = { "hu", "zo" };
String specie = species[random.nextInt(species.length)];
player.setName(name);
player.setSpecies(specie);
player.setPoints(0);
player.setLocationx(locationx);
player.setLocationy(locationy);
player.setCreatets(timestamp);
player.setUserName(user);
playerDao.addPlayer(player);
response.sendRedirect("/Zombie/players/home");
// List<Player> players = playerDao.getAllPlayers();
// ModelAndView model = new ModelAndView("home");
// model.addObject("players", players);
// return model;
}
@RequestMapping("/map")
public String map() {
return "map";
}
@RequestMapping(value="/selectPlayer", method=RequestMethod.GET)
public ModelAndView selectPlayer(@RequestParam("username") String username, @RequestParam("step") String step,
@RequestParam("species") String species) {
List<Player> player;
if (step.equals("1")) {
player = playerDao.findByUserName(username);
} else {
if (species.equals("hu")) {
player = playerDao.findBySpecies("zo");
} else {
player = playerDao.findBySpecies("hu");
}
}
ModelAndView model = new ModelAndView("selectPlayer");
model.addObject("players", player);
return model;
}
@RequestMapping(value="/saveEdge", method=RequestMethod.GET)
public void saveEdge(@RequestParam("passId") String passId, @RequestParam("humanIds") String humanIds, HttpServletResponse response) throws IOException {
Integer sourceplayerid = Integer.parseInt(passId);
Edge[] edges = edgeDao.findBySourceplayerid(sourceplayerid);
if (edges != null) {
for (Edge e : edges) {
edgeDao.deleteEdge(e);
}
}
String[] humanIDs = humanIds.split(",");
for (String s : humanIDs) {
Integer destplayerid = Integer.parseInt(s);
Edge edge = new Edge();
edge.setSourcePlayerId(sourceplayerid.intValue());
edge.setDestPlayerId(destplayerid.intValue());
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
edge.setCreatets(timestamp);
edgeDao.addEdge(edge);
}
response.sendRedirect("/Zombie/players/map");
}
}
|
freshmanken/zombie-hunter
|
src/main/java/com/zombie/controller/PlayerController.java
|
Java
|
apache-2.0
| 4,444
|
/*
* Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.ec2.model.transform;
import java.util.ArrayList;
import javax.xml.stream.events.XMLEvent;
import javax.annotation.Generated;
import com.amazonaws.services.ec2.model.*;
import com.amazonaws.transform.Unmarshaller;
import com.amazonaws.transform.StaxUnmarshallerContext;
import com.amazonaws.transform.SimpleTypeStaxUnmarshallers.*;
/**
* ReservedInstancesModification StAX Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ReservedInstancesModificationStaxUnmarshaller implements Unmarshaller<ReservedInstancesModification, StaxUnmarshallerContext> {
public ReservedInstancesModification unmarshall(StaxUnmarshallerContext context) throws Exception {
ReservedInstancesModification reservedInstancesModification = new ReservedInstancesModification();
int originalDepth = context.getCurrentDepth();
int targetDepth = originalDepth + 1;
if (context.isStartOfDocument())
targetDepth += 1;
while (true) {
XMLEvent xmlEvent = context.nextEvent();
if (xmlEvent.isEndDocument())
return reservedInstancesModification;
if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {
if (context.testExpression("reservedInstancesModificationId", targetDepth)) {
reservedInstancesModification.setReservedInstancesModificationId(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("reservedInstancesSet", targetDepth)) {
reservedInstancesModification.withReservedInstancesIds(new ArrayList<ReservedInstancesId>());
continue;
}
if (context.testExpression("reservedInstancesSet/item", targetDepth)) {
reservedInstancesModification.withReservedInstancesIds(ReservedInstancesIdStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("modificationResultSet", targetDepth)) {
reservedInstancesModification.withModificationResults(new ArrayList<ReservedInstancesModificationResult>());
continue;
}
if (context.testExpression("modificationResultSet/item", targetDepth)) {
reservedInstancesModification
.withModificationResults(ReservedInstancesModificationResultStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("createDate", targetDepth)) {
reservedInstancesModification.setCreateDate(DateStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("updateDate", targetDepth)) {
reservedInstancesModification.setUpdateDate(DateStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("effectiveDate", targetDepth)) {
reservedInstancesModification.setEffectiveDate(DateStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("status", targetDepth)) {
reservedInstancesModification.setStatus(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("statusMessage", targetDepth)) {
reservedInstancesModification.setStatusMessage(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("clientToken", targetDepth)) {
reservedInstancesModification.setClientToken(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
} else if (xmlEvent.isEndElement()) {
if (context.getCurrentDepth() < originalDepth) {
return reservedInstancesModification;
}
}
}
}
private static ReservedInstancesModificationStaxUnmarshaller instance;
public static ReservedInstancesModificationStaxUnmarshaller getInstance() {
if (instance == null)
instance = new ReservedInstancesModificationStaxUnmarshaller();
return instance;
}
}
|
dagnir/aws-sdk-java
|
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/transform/ReservedInstancesModificationStaxUnmarshaller.java
|
Java
|
apache-2.0
| 5,229
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Flot Examples: Interacting with axes</title>
<link href="../examples.css" rel="stylesheet" type="text/css">
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../../excanvas.min.js"></script><![endif]-->
<script language="javascript" type="text/javascript" src="../../jquery.js"></script>
<script language="javascript" type="text/javascript" src="../../jquery.flot.js"></script>
<script type="text/javascript">
$(function() {
function generate(start, end, fn) {
var res = [];
for (var i = 0; i <= 100; ++i) {
var x = start + i / 100 * (end - start);
res.push([x, fn(x)]);
}
return res;
}
var data = [
{ data: generate(0, 10, function(x) { return Math.sqrt(x); }), xaxis: 1, yaxis: 1 },
{ data: generate(0, 10, function(x) { return Math.sin(x); }), xaxis: 1, yaxis: 2 },
{ data: generate(0, 10, function(x) { return Math.cos(x); }), xaxis: 1, yaxis: 3 },
{ data: generate(2, 10, function(x) { return Math.tan(x); }), xaxis: 2, yaxis: 4 }
];
var plot = $.plot("#placeholder", data, {
xaxes: [
{ position: 'bottom' },
{ position: 'top' }
],
yaxes: [
{ position: 'left' },
{ position: 'left' },
{ position: 'right' },
{ position: 'left' }
]
});
// Create a div for each axis
$.each(plot.getAxes(), function(i, axis) {
if (!axis.show) {
return;
}
var box = axis.box;
$("<div class='axisTarget' style='position:absolute; left:" + box.left + "px; top:" + box.top + "px; width:" + box.width + "px; height:" + box.height + "px'></div>")
.data("axis.direction", axis.direction)
.data("axis.n", axis.n)
.css({ backgroundColor: "#f00", opacity: 0, cursor: "pointer" })
.appendTo(plot.getPlaceholder())
.hover(
function() { $(this).css({ opacity: 0.10 }) },
function() { $(this).css({ opacity: 0 }) }
)
.click(function() {
$("#click").text("You clicked the " + axis.direction + axis.n + "axis!");
});
});
// Add the Flot version string to the footer
$("#footer").prepend("Flot " + $.plot.version + " – ");
});
</script>
</head>
<body>
<div id="header">
<h2>Interacting with axes</h2>
</div>
<div id="content">
<div class="demo-container">
<div id="placeholder" class="demo-placeholder"></div>
</div>
<p>With multiple axes, you sometimes need to interact with them. A simple way to do this is to draw the plot, deduce the axis placements and insert a couple of divs on top to catch events.</p>
<p>Try clicking an axis.</p>
<p id="click"></p>
</div>
<div id="footer">
Copyright © 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
</html>
|
amido/Amido.VersionDashboard
|
src/Amido.VersionDashboard.Web/bower_components/flot/examples/axes-interacting/index.html
|
HTML
|
apache-2.0
| 3,543
|
/*
Copyright (c) INRIA and Microsoft Corporation. All rights reserved.
Licensed under the Apache 2.0 License.
*/
#ifndef __FStar_Int_Cast_H
#define __FStar_Int_Cast_H
#include <inttypes.h>
#include "kremlib.h"
#include "kremlin/internal/compat.h"
#include "kremlin/internal/target.h"
extern uint64_t FStar_Int_Cast_uint8_to_uint64(uint8_t a);
extern uint32_t FStar_Int_Cast_uint8_to_uint32(uint8_t x);
extern uint16_t FStar_Int_Cast_uint8_to_uint16(uint8_t x);
extern uint64_t FStar_Int_Cast_uint16_to_uint64(uint16_t x);
extern uint32_t FStar_Int_Cast_uint16_to_uint32(uint16_t x);
extern uint8_t FStar_Int_Cast_uint16_to_uint8(uint16_t x);
extern uint64_t FStar_Int_Cast_uint32_to_uint64(uint32_t x);
extern uint16_t FStar_Int_Cast_uint32_to_uint16(uint32_t x);
extern uint8_t FStar_Int_Cast_uint32_to_uint8(uint32_t x);
extern uint32_t FStar_Int_Cast_uint64_to_uint32(uint64_t x);
extern uint16_t FStar_Int_Cast_uint64_to_uint16(uint64_t x);
extern uint8_t FStar_Int_Cast_uint64_to_uint8(uint64_t x);
extern int64_t FStar_Int_Cast_int8_to_int64(int8_t x);
extern int32_t FStar_Int_Cast_int8_to_int32(int8_t x);
extern int16_t FStar_Int_Cast_int8_to_int16(int8_t x);
extern int64_t FStar_Int_Cast_int16_to_int64(int16_t x);
extern int32_t FStar_Int_Cast_int16_to_int32(int16_t x);
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
extern int8_t FStar_Int_Cast_int16_to_int8(int16_t x);
extern int64_t FStar_Int_Cast_int32_to_int64(int32_t x);
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
extern int16_t FStar_Int_Cast_int32_to_int16(int32_t x);
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
extern int8_t FStar_Int_Cast_int32_to_int8(int32_t x);
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
extern int32_t FStar_Int_Cast_int64_to_int32(int64_t x);
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
extern int16_t FStar_Int_Cast_int64_to_int16(int64_t x);
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
extern int8_t FStar_Int_Cast_int64_to_int8(int64_t x);
extern int64_t FStar_Int_Cast_uint8_to_int64(uint8_t x);
extern int32_t FStar_Int_Cast_uint8_to_int32(uint8_t x);
extern int16_t FStar_Int_Cast_uint8_to_int16(uint8_t x);
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
extern int8_t FStar_Int_Cast_uint8_to_int8(uint8_t x);
extern int64_t FStar_Int_Cast_uint16_to_int64(uint16_t x);
extern int32_t FStar_Int_Cast_uint16_to_int32(uint16_t x);
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
extern int16_t FStar_Int_Cast_uint16_to_int16(uint16_t x);
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
extern int8_t FStar_Int_Cast_uint16_to_int8(uint16_t x);
extern int64_t FStar_Int_Cast_uint32_to_int64(uint32_t x);
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
extern int32_t FStar_Int_Cast_uint32_to_int32(uint32_t x);
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
extern int16_t FStar_Int_Cast_uint32_to_int16(uint32_t x);
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
extern int8_t FStar_Int_Cast_uint32_to_int8(uint32_t x);
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
extern int64_t FStar_Int_Cast_uint64_to_int64(uint64_t x);
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
extern int32_t FStar_Int_Cast_uint64_to_int32(uint64_t x);
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
extern int16_t FStar_Int_Cast_uint64_to_int16(uint64_t x);
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
KRML_DEPRECATED("with care; in C the result is implementation-defined when not representable")
extern int8_t FStar_Int_Cast_uint64_to_int8(uint64_t x);
extern uint64_t FStar_Int_Cast_int8_to_uint64(int8_t x);
extern uint32_t FStar_Int_Cast_int8_to_uint32(int8_t x);
extern uint16_t FStar_Int_Cast_int8_to_uint16(int8_t x);
extern uint8_t FStar_Int_Cast_int8_to_uint8(int8_t x);
extern uint64_t FStar_Int_Cast_int16_to_uint64(int16_t x);
extern uint32_t FStar_Int_Cast_int16_to_uint32(int16_t x);
extern uint16_t FStar_Int_Cast_int16_to_uint16(int16_t x);
extern uint8_t FStar_Int_Cast_int16_to_uint8(int16_t x);
extern uint64_t FStar_Int_Cast_int32_to_uint64(int32_t x);
extern uint32_t FStar_Int_Cast_int32_to_uint32(int32_t x);
extern uint16_t FStar_Int_Cast_int32_to_uint16(int32_t x);
extern uint8_t FStar_Int_Cast_int32_to_uint8(int32_t x);
extern uint64_t FStar_Int_Cast_int64_to_uint64(int64_t x);
extern uint32_t FStar_Int_Cast_int64_to_uint32(int64_t x);
extern uint16_t FStar_Int_Cast_int64_to_uint16(int64_t x);
extern uint8_t FStar_Int_Cast_int64_to_uint8(int64_t x);
#define __FStar_Int_Cast_H_DEFINED
#endif
|
FStarLang/kremlin
|
kremlib/dist/generic/FStar_Int_Cast.h
|
C
|
apache-2.0
| 6,713
|
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using AH.ModuleController.DMSSR;
using AH.DUtility;
namespace AH.ModuleController.UI.DMS.Forms
{
public partial class frmEmeregencyCollectionHead : AH.Shared.UI.frmSmartFormStandard
{
DMSSR.DMSWSClient dmsSc = new DMSSR.DMSWSClient();
private List<EmrCollHead> oCols;
public frmEmeregencyCollectionHead()
{
InitializeComponent();
}
private void frmEmeregencyCollectionHead_Load(object sender, EventArgs e)
{
FormatGrid();
cboDepartmentType.DisplayMember = "Value";
cboDepartmentType.ValueMember = "Key";
cboDepartmentType.DataSource = new BindingSource(Utility.GetDeptTypes(), null);
cboDepartmentType.Text = "Medical";
cboDepartmentType.Enabled = false;
cboDepartmentGroup.Text = "Clinical";
cboDepartmentGroup.Enabled = false;
cboDepartment.Text = "Emergency";
cboDepartment.Enabled = false;
cboUnit.Text = "--";
cboUnit.Enabled = false;
}
private void cboDepartmentType_SelectedIndexChanged(object sender, EventArgs e)
{
if (cboDepartmentType.SelectedValue != null)
{
cboDepartmentGroup.DisplayMember = "Value";
cboDepartmentGroup.ValueMember = "Key";
cboDepartmentGroup.DataSource = new BindingSource(dmsSc.GetDeptGroupDicByType(cboDepartmentType.SelectedValue.ToString()), null);
}
}
private void cboDepartmentGroup_SelectedIndexChanged(object sender, EventArgs e)
{
if (cboDepartmentGroup.SelectedValue != null)
{
cboDepartment.DisplayMember = "Value";
cboDepartment.ValueMember = "Key";
cboDepartment.DataSource = new BindingSource(dmsSc.GetDepartmentsetupDic(null, cboDepartmentGroup.SelectedValue.ToString()), null);
}
}
private void cboDepartment_SelectedIndexChanged(object sender, EventArgs e)
{
if (cboDepartment.SelectedValue != "")
{
cboUnit.DisplayMember = "Value";
cboUnit.ValueMember = "Key";
cboUnit.DataSource = new BindingSource(Utility.VerifyDic(dmsSc.GetDeptUnitDic(cboDepartmentGroup.SelectedValue.ToString(), cboDepartment.SelectedValue.ToString())), null);
this.btnShow_Click(sender, e);
}
}
private void FormatGrid()
{
lvEmerCollHead.CheckBoxes = false;
lvEmerCollHead.Columns.Add("DeptType", 0, HorizontalAlignment.Left);
lvEmerCollHead.Columns.Add("DeptGroupID", 0, HorizontalAlignment.Left);
lvEmerCollHead.Columns.Add("DeptGroupTitle", 0, HorizontalAlignment.Left);
lvEmerCollHead.Columns.Add("DepartmentID", 0, HorizontalAlignment.Left);
lvEmerCollHead.Columns.Add("DepartmentTitle", 0, HorizontalAlignment.Left);
lvEmerCollHead.Columns.Add("UnitID", 0, HorizontalAlignment.Left);
lvEmerCollHead.Columns.Add("UnitTitle", 0, HorizontalAlignment.Left);
lvEmerCollHead.Columns.Add("HeadGroup", 0, HorizontalAlignment.Left);
lvEmerCollHead.Columns.Add("HeadID", 150, HorizontalAlignment.Center);
lvEmerCollHead.Columns.Add("HeadTitle", 500, HorizontalAlignment.Left);
lvEmerCollHead.Columns.Add("HeadTitleBeng", 0, HorizontalAlignment.Left);
lvEmerCollHead.Columns.Add("Fee", 200, HorizontalAlignment.Center);
lvEmerCollHead.Columns.Add("SetAsDefault", 0, HorizontalAlignment.Center);
lvEmerCollHead.Columns.Add("IsSelectable", 0, HorizontalAlignment.Center);
lvEmerCollHead.Columns.Add("PosSerial", 150, HorizontalAlignment.Center);
}
private void LoadListView(string DeptGroup,string Department,string Unit)
{
lvEmerCollHead.Items.Clear();
oCols = dmsSc.GetEmrCollHead("A",cboDepartmentGroup.SelectedValue.ToString(),cboDepartment.SelectedValue.ToString(),cboUnit.SelectedValue.ToString()).ToList();
foreach (EmrCollHead oCol in oCols)
{
ListViewItem itm = new ListViewItem(oCol.DepartmentGroup.DepartmentTypeID);
itm.SubItems.Add(oCol.DepartmentGroup.DepartmentGroupID);
itm.SubItems.Add(oCol.DepartmentGroup.DepartmentGroupTitle);
itm.SubItems.Add(oCol.Department.DepartmentID);
itm.SubItems.Add(oCol.Department.DepartmentTitle);
itm.SubItems.Add(oCol.DepartmentUnit.UnitId);
itm.SubItems.Add(oCol.DepartmentUnit.UnitTitle);
itm.SubItems.Add(oCol.HeadGroupID);
itm.SubItems.Add(oCol.HeadID);
itm.SubItems.Add(oCol.HeadTitle);
itm.SubItems.Add(oCol.HeadTitleBeng);
itm.SubItems.Add(oCol.Fee.ToString());
itm.SubItems.Add(oCol.SetAsDefault);
itm.SubItems.Add(oCol.IsSelectable);
itm.SubItems.Add(oCol.PosSerial);
lvEmerCollHead.Items.Add(itm);
}
}
private void btnShow_Click(object sender, EventArgs e)
{
try
{
List<string> vf = new List<string>() { "cboDepartmentType", "cboDepartmentGroup", "cboDepartment", "cboUnit" };
Control control = Utility.ReqFieldValidator(this, vf);
if (control != null)
{
MessageBox.Show(Utility.getFMS(control.Name) + Utility.Req, Utility.MessageCaptionMsg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
control.Focus();
return;
}
LoadListView(cboDepartmentGroup.SelectedValue.ToString(), cboDepartment.SelectedValue.ToString(), cboUnit.SelectedValue.ToString());
}
catch (System.ServiceModel.CommunicationException commp)
{
MessageBox.Show(Utility.CommunicationErrorMsg, Utility.MessageCaptionMsg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), Utility.MessageCaptionMsg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
private void lvEmerCollHead_Click(object sender, EventArgs e)
{
btnSave.Enabled = false;
}
private void btnNew_Click(object sender, EventArgs e)
{
btnSave.Enabled = true;
lvEmerCollHead.Items.Clear();
}
private void lvEmerCollHead_SelectedIndexChanged(object sender, EventArgs e)
{
if (lvEmerCollHead.SelectedItems.Count > 0)
{
ListViewItem itm = lvEmerCollHead.SelectedItems[0];
cboDepartmentType.SelectedValue = itm.SubItems[0].Text;
cboDepartmentGroup.SelectedValue = itm.SubItems[1].Text;
cboDepartment.SelectedValue = itm.SubItems[3].Text;
cboUnit.SelectedValue = itm.SubItems[5].Text;
txtHeadGroup.Text = itm.SubItems[7].Text;
txtHeadID.Text = itm.SubItems[8].Text;
txtHeadTitle.Text = itm.SubItems[9].Text;
txtHeadTitleBeng.Text = itm.SubItems[10].Text;
txtFee.Text = itm.SubItems[11].Text;
if (itm.SubItems[12].Text == "1")
{
chkDefault.Checked = true;
}
if (itm.SubItems[12].Text == "0")
{
chkDefault.Checked = false;
}
if (itm.SubItems[13].Text == "1")
{
chkIsSelectable.Checked = true;
}
if (itm.SubItems[13].Text == "0")
{
chkIsSelectable.Checked = false;
}
txtPosSerial.Text = itm.SubItems[14].Text;
}
}
private EmrCollHead PopulateEmrCollHeadSetup()
{
EmrCollHead oCol = new EmrCollHead();
DepartmentGroup oDeptGrp = new DepartmentGroup();
Department oDept = new Department();
DepartmentUnit oDeptUnit = new DepartmentUnit();
oDeptGrp.DepartmentGroupID = cboDepartmentGroup.SelectedValue.ToString();
oDeptGrp.DepartmentTypeID = cboDepartmentType.SelectedValue.ToString();
oCol.DepartmentGroup = oDeptGrp;
oDept.DepartmentID = cboDepartment.SelectedValue.ToString();
oCol.Department = oDept;
oDeptUnit.UnitId = cboUnit.SelectedValue.ToString();
oCol.DepartmentUnit = oDeptUnit;
oCol.HeadGroupID = "0";
oCol.HeadID = txtHeadID.Text;
oCol.HeadTitle = txtHeadTitle.Text;
oCol.HeadTitleBeng = txtHeadTitleBeng.Text;
oCol.Fee =Convert.ToDouble(txtFee.Text.ToString());
if (chkDefault.Checked == true)
{
oCol.SetAsDefault = "1";
}
if (chkDefault.Checked == false)
{
oCol.SetAsDefault = "0";
}
if (chkIsSelectable.Checked == true)
{
oCol.IsSelectable = "1";
}
if (chkIsSelectable.Checked == false)
{
oCol.IsSelectable = "0";
}
oCol.PosSerial = txtPosSerial.Text.ToString();
EntryParameter ep = new EntryParameter();
ep.EntryBy = Utility.UserId;
ep.CompanyID = Utility.CompanyID;
ep.LocationID = Utility.LocationID;
ep.MachineID = Utility.MachineID;
oCol.EntryParameter = ep;
return oCol;
}
private void txtHeadTitle_TextChanged(object sender, EventArgs e)
{
txtHeadTitleBeng.Text = txtHeadTitle.Text;
}
private void btnSave_Click(object sender, EventArgs e)
{
List<string> vf = new List<string>() { "cboDepartmentType", "cboDepartmentGroup", "cboDepartment", "cboUnit", "txtHeadTitle", "txtHeadTitleBeng", "txtFee", "txtPosSerial" };
Control control = Utility.ReqFieldValidator(this, vf);
if (control != null)
{
MessageBox.Show(Utility.getFMS(control.Name) + Utility.Req, Utility.MessageCaptionMsg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
control.Focus();
return;
}
try
{
EmrCollHead oCol = this.PopulateEmrCollHeadSetup();
if (Utility.IsDuplicateFoundInList(lvEmerCollHead, 9, txtHeadTitle.Text))
{
MessageBox.Show("Cannot Insert Duplicate Name", "Information", MessageBoxButtons.OK, MessageBoxIcon.Warning);
txtHeadTitle.Focus();
return;
}
else
{
short i = dmsSc.SaveEmrCollHead(oCol);
if (i == 0)
{
MessageBox.Show(Utility.InsertMsg, Utility.MessageCaptionMsg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else if (i > 0)
{
MessageBox.Show(Utility.InsertMsg, Utility.MessageSuccessCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
txtHeadID.Text = "";
txtHeadTitle.Text = "";
txtHeadTitleBeng.Text = "";
txtFee.Text = "";
txtPosSerial.Text = "";
chkDefault.Checked = false;
chkIsSelectable.Checked = false;
this.btnShow_Click(sender, e);
}
}
}
catch (System.ServiceModel.CommunicationException commp)
{
MessageBox.Show(Utility.CommunicationErrorMsg, Utility.MessageCaptionMsg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), Utility.MessageCaptionMsg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
private void btnEdit_Click(object sender, EventArgs e)
{
List<string> vf = new List<string>() { "cboDepartmentType", "cboDepartmentGroup", "cboDepartment", "cboUnit", "txtHeadID", "txtHeadTitle", "txtHeadTitleBeng", "txtFee", "txtPosSerial" };
Control control = Utility.ReqFieldValidator(this, vf);
if (control != null)
{
MessageBox.Show(Utility.getFMS(control.Name) + Utility.Req, Utility.MessageCaptionMsg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
control.Focus();
return;
}
try
{
EmrCollHead oCol = this.PopulateEmrCollHeadSetup();
short i = dmsSc.UpdateEmrCollHead(oCol);
if (i == 0)
{
MessageBox.Show(Utility.InsertMsg, Utility.MessageCaptionMsg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else if (i > 0)
{
MessageBox.Show(Utility.UpdateMsg, Utility.MessageSuccessCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
txtHeadID.Text = "";
txtHeadTitle.Text = "";
txtHeadTitleBeng.Text = "";
txtFee.Text = "";
txtPosSerial.Text = "";
chkDefault.Checked = false;
chkIsSelectable.Checked = false;
this.btnShow_Click(sender, e);
}
}
catch (System.ServiceModel.CommunicationException commp)
{
MessageBox.Show(Utility.CommunicationErrorMsg, Utility.MessageCaptionMsg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), Utility.MessageCaptionMsg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
private void txtHeadTitle_KeyUp(object sender, KeyEventArgs e)
{
SearchListView(oCols, txtHeadTitle.Text);
}
private void SearchListView(IEnumerable<EmrCollHead> oResults, string searchString = "")
{
try
{
IEnumerable<EmrCollHead> query;
if (oResults != null)
{
if (!(searchString.Length > 0))
{
query = oResults;
}
else
{
query = (from oRes in oResults
where oRes.HeadTitle.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)
select oRes);
}
lvEmerCollHead.Items.Clear();
foreach (EmrCollHead oCol in query)
{
ListViewItem itm = new ListViewItem(oCol.DepartmentGroup.DepartmentTypeID);
itm.SubItems.Add(oCol.DepartmentGroup.DepartmentGroupID);
itm.SubItems.Add(oCol.DepartmentGroup.DepartmentGroupTitle);
itm.SubItems.Add(oCol.Department.DepartmentID);
itm.SubItems.Add(oCol.Department.DepartmentTitle);
itm.SubItems.Add(oCol.DepartmentUnit.UnitId);
itm.SubItems.Add(oCol.DepartmentUnit.UnitTitle);
itm.SubItems.Add(oCol.HeadGroupID);
itm.SubItems.Add(oCol.HeadID);
itm.SubItems.Add(oCol.HeadTitle);
itm.SubItems.Add(oCol.HeadTitleBeng);
itm.SubItems.Add(oCol.Fee.ToString());
itm.SubItems.Add(oCol.SetAsDefault);
itm.SubItems.Add(oCol.IsSelectable);
itm.SubItems.Add(oCol.PosSerial);
lvEmerCollHead.Items.Add(itm);
}
}
}
catch (System.ServiceModel.CommunicationException commp)
{
MessageBox.Show(Utility.CommunicationErrorMsg, Utility.MessageCaptionMsg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), Utility.MessageCaptionMsg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
}
}
|
atiq-shumon/DotNetProjects
|
Hospital_ERP_VS13-WCF_WF/AH.ModuleController/UI/DMS/Forms/frmEmeregencyCollectionHead.cs
|
C#
|
apache-2.0
| 17,234
|
/*
ChibiOS/RT - Copyright (C) 2006-2014 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "hal.h"
/**
* @brief PAL setup.
* @details Digital I/O ports static configuration as defined in @p board.h.
* This variable is used by the HAL when initializing the PAL driver.
*/
#if HAL_USE_PAL || defined(__DOXYGEN__)
const PALConfig pal_default_config =
{
{VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH},
{VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH},
{VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH},
{VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH},
{VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH},
{VAL_GPIOFODR, VAL_GPIOFCRL, VAL_GPIOFCRH},
{VAL_GPIOGODR, VAL_GPIOGCRL, VAL_GPIOGCRH},
};
#endif
/*
* Early initialization code.
* This initialization must be performed just after stack setup and before
* any other initialization.
*/
void __early_init(void) {
stm32_clock_init();
}
#if HAL_USE_SDC
/* Board-related functions related to the SDC driver.*/
bool sdc_lld_is_card_inserted(SDCDriver *sdcp) {
(void)sdcp;
return !palReadPad(GPIOF, GPIOF_SD_DETECT);
}
bool sdc_lld_is_write_protected(SDCDriver *sdcp) {
(void)sdcp;
return FALSE;
}
#endif
/*
* Board-specific initialization code.
*/
void boardInit(void) {
}
|
marcoveeneman/ChibiOS-Tiva
|
os/hal/boards/ST_STM3210E_EVAL/board.c
|
C
|
apache-2.0
| 1,786
|
/*
* Copyright (C) 2017-2019 Dremio Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.dremio.common.expression;
import com.dremio.common.types.TypeProtos;
/**
* Indicates that cast should error on overflow
*/
public class CastExpressionWithOverflow extends CastExpression {
public CastExpressionWithOverflow(LogicalExpression input, TypeProtos.MajorType type) {
super(input, type);
}
}
|
dremio/dremio-oss
|
sabot/logical/src/main/java/com/dremio/common/expression/CastExpressionWithOverflow.java
|
Java
|
apache-2.0
| 936
|
from ionotomo import *
import numpy as np
import pylab as plt
def test_turbulent_realisation(plot=True):
xvec = np.linspace(-100,100,100)
zvec = np.linspace(0,1000,1000)
M = np.zeros([100,100,1000])
TCI = TriCubic(xvec,xvec,zvec,M)
print("Matern 1/2 kernel")
cov_obj = Covariance(tci=TCI)
sigma = 1.
corr = 30.
nu = 1./2.
print("Testing spectral density")
B = cov_obj.realization()
print("Fluctuations measured {}".format((np.percentile(B.flatten(),95) + np.percentile(-B.flatten(),95))))
#xy slice
x = TCI.xvec
y = TCI.yvec
z = TCI.zvec
X,Y,Z = np.meshgrid(x,y,z,indexing='ij')
dx = x[1] - x[0]
dy = y[1] - y[0]
dz = z[1] - z[0]
if plot and True:
f = plt.figure(figsize=(8,4))
vmin = np.min(B)
vmax = np.max(B)
ax = f.add_subplot(1,3,1)
ax.imshow(B[49,:,:],extent=(z[0],z[-1],y[0],y[-1]),vmin=vmin,vmax=vmax)
ax = f.add_subplot(1,3,2)
plt.imshow(B[:,49,:],extent=(z[0],z[-1],x[0],x[-1]),vmin=vmin,vmax=vmax)
ax = f.add_subplot(1,3,3)
im = plt.imshow(B[:,:,499],extent=(y[0],y[-1],x[0],x[-1]),vmin=vmin,vmax=vmax)
plt.colorbar(im)
plt.show()
print("testing contraction C^{-1}.phi")
phi = np.zeros_like(TCI.M)
#phi = np.cos(R*4)*np.exp(-R)
phi = X**2 + Y**2 + Z**4
phihat = cov_obj.contract(phi)
assert not np.any(np.isnan(phihat))
#Analytic for exp covariance is 1/(8*np.pi*sigma**2) * (1/L**3 * phi - 2/L * Lap phi + L * Lap Lap phi)
# 1/(8*np.pi*sigma**2) * (1/L**3 * phi + 2/L * sin(2 pi Z / 20)*(2*pi/20)**2 + L * sin(2 pi Z / 20)*(2*pi/20)**4)
phih = 1./(8*np.pi*sigma**2) * ( 1./corr**3 * phi - 2./corr *(2 + 2 + 2*Z**2) + corr*4)
if plot:
f = plt.figure(figsize=(12,12))
ax = f.add_subplot(3,3,1)
ax.set_title("phi")
im = ax.imshow(phi[50,:,:],extent=(z[0],z[-1],y[0],y[-1]))
plt.colorbar(im)
ax = f.add_subplot(3,3,2)
ax.set_title("FFT based")
im = plt.imshow(phihat[50,:,:],extent=(z[0],z[-1],y[0],y[-1]))
plt.colorbar(im)
ax = f.add_subplot(3,3,3)
ax.set_title("Analytic")
im = plt.imshow(phih[50,:,:],extent=(z[0],z[-1],y[0],y[-1]))
plt.colorbar(im)
ax = f.add_subplot(3,3,4)
im = ax.imshow(phi[:,20,:],extent=(z[0],z[-1],x[0],x[-1]))
plt.colorbar(im)
ax = f.add_subplot(3,3,5)
im = plt.imshow(phihat[:,20,:],extent=(z[0],z[-1],x[0],x[-1]))
plt.colorbar(im)
ax = f.add_subplot(3,3,6)
im = plt.imshow(phih[:,20,:],extent=(z[0],z[-1],x[0],x[-1]))
plt.colorbar(im)
ax = f.add_subplot(3,3,7)
im = ax.imshow(phi[:,:,70],extent=(y[0],y[-1],x[0],x[-1]))
plt.colorbar(im)
ax = f.add_subplot(3,3,8)
im = plt.imshow(phihat[:,:,70],extent=(y[0],y[-1],x[0],x[-1]))
plt.colorbar(im)
ax = f.add_subplot(3,3,9)
im = plt.imshow(phih[:,:,70],extent=(y[0],y[-1],x[0],x[-1]))
plt.colorbar(im)
plt.tight_layout()
plt.show()
return
phih = phi.copy()/corr**3
from scipy import ndimage
stencil = np.zeros([3,3,3])
for i in range(-1,2):
for j in range(-1,2):
for k in range(-1,2):
s = 0
if i == 0:
s += 1
if j == 0:
s += 1
if k == 0:
s += 1
if s == 3:
stencil[i,j,k] = -2*3.
if s == 3 - 1:
stencil[i,j,k] = 1.
stencil /= (dx*dy*dz)**(2./3.)
lap = ndimage.convolve(phi,stencil,mode='wrap')
phih -= 2/corr*lap
laplap = ndimage.convolve(lap,stencil,mode='wrap')
phih += corr*laplap
phih /= 8*np.pi*sigma**2
if plot:
f = plt.figure(figsize=(12,12))
ax = f.add_subplot(3,3,1)
ax.set_title("phi")
im = ax.imshow(phi[50,:,:],extent=(z[0],z[-1],y[0],y[-1]))
plt.colorbar(im)
ax = f.add_subplot(3,3,2)
ax.set_title("FFT based")
im = plt.imshow(phihat[50,:,:],extent=(z[0],z[-1],x[0],x[-1]))
plt.colorbar(im)
ax = f.add_subplot(3,3,3)
ax.set_title("Analytic")
im = plt.imshow(phih[50,:,:],extent=(y[0],y[-1],x[0],x[-1]))
plt.colorbar(im)
ax = f.add_subplot(3,3,4)
im = ax.imshow(phi[:,20,:],extent=(z[0],z[-1],y[0],y[-1]))
plt.colorbar(im)
ax = f.add_subplot(3,3,5)
im = plt.imshow(phihat[:,20,:],extent=(z[0],z[-1],x[0],x[-1]))
plt.colorbar(im)
ax = f.add_subplot(3,3,6)
im = plt.imshow(phih[:,20,:],extent=(y[0],y[-1],x[0],x[-1]))
plt.colorbar(im)
ax = f.add_subplot(3,3,7)
im = ax.imshow(phi[:,:,70],extent=(z[0],z[-1],y[0],y[-1]))
plt.colorbar(im)
ax = f.add_subplot(3,3,8)
im = plt.imshow(phihat[:,:,70],extent=(z[0],z[-1],x[0],x[-1]))
plt.colorbar(im)
ax = f.add_subplot(3,3,9)
im = plt.imshow(phih[:,:,70],extent=(y[0],y[-1],x[0],x[-1]))
plt.colorbar(im)
plt.show()
|
Joshuaalbert/IonoTomo
|
src/ionotomo/tests/test_turbulent_realisation.py
|
Python
|
apache-2.0
| 5,260
|
// Copyright 2007-2017 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
namespace MassTransit.SendPipeSpecifications
{
using System;
using System.Collections.Generic;
using System.Linq;
using Context;
using GreenPipes;
using GreenPipes.Pipes;
using GreenPipes.Specifications;
using GreenPipes.Util;
using PipeBuilders;
using Util;
public class MessageSendPipeSpecification<TMessage> :
IMessageSendPipeSpecification<TMessage>,
IMessageSendPipeSpecification
where TMessage : class
{
readonly IList<ISpecificationPipeSpecification<SendContext<TMessage>>> _implementedMessageTypeSpecifications;
readonly IList<ISpecificationPipeSpecification<SendContext<TMessage>>> _parentMessageSpecifications;
readonly IList<IPipeSpecification<SendContext<TMessage>>> _specifications;
public MessageSendPipeSpecification()
{
_specifications = new List<IPipeSpecification<SendContext<TMessage>>>();
_implementedMessageTypeSpecifications = new List<ISpecificationPipeSpecification<SendContext<TMessage>>>();
_parentMessageSpecifications = new List<ISpecificationPipeSpecification<SendContext<TMessage>>>();
}
public void AddPipeSpecification(IPipeSpecification<SendContext> specification)
{
var splitSpecification = new SplitFilterPipeSpecification<SendContext<TMessage>, SendContext>(specification, MergeContext, FilterContext);
_specifications.Add(splitSpecification);
}
IMessageSendPipeSpecification<T> IMessageSendPipeSpecification.GetMessageSpecification<T>()
{
var result = this as IMessageSendPipeSpecification<T>;
if (result == null)
throw new ArgumentException($"The expected message type was invalid: {TypeMetadataCache<T>.ShortName}");
return result;
}
public ConnectHandle Connect(IPipeConnector connector)
{
IPipe<SendContext<TMessage>> messagePipe = BuildMessagePipe();
if (messagePipe is EmptyPipe<SendContext<TMessage>>)
return new EmptyConnectHandle();
return connector.ConnectPipe(messagePipe);
}
public void AddPipeSpecification(IPipeSpecification<SendContext<TMessage>> specification)
{
_specifications.Add(specification);
}
public IEnumerable<ValidationResult> Validate()
{
return _specifications.SelectMany(x => x.Validate());
}
public void Apply(ISpecificationPipeBuilder<SendContext<TMessage>> builder)
{
if (!builder.IsDelegated)
{
ISpecificationPipeBuilder<SendContext<TMessage>> implementedBuilder = builder.CreateImplementedBuilder();
foreach (ISpecificationPipeSpecification<SendContext<TMessage>> specification in _implementedMessageTypeSpecifications.Reverse())
{
specification.Apply(implementedBuilder);
}
}
ISpecificationPipeBuilder<SendContext<TMessage>> delegatedBuilder = builder.CreateDelegatedBuilder();
foreach (ISpecificationPipeSpecification<SendContext<TMessage>> specification in _parentMessageSpecifications)
{
specification.Apply(delegatedBuilder);
}
foreach (IPipeSpecification<SendContext<TMessage>> specification in _specifications)
{
specification.Apply(builder);
}
}
public IPipe<SendContext<TMessage>> BuildMessagePipe()
{
var pipeBuilder = new SpecificationPipeBuilder<SendContext<TMessage>>();
Apply(pipeBuilder);
return pipeBuilder.Build();
}
public void AddParentMessageSpecification(ISpecificationPipeSpecification<SendContext<TMessage>> parentSpecification)
{
_parentMessageSpecifications.Add(parentSpecification);
}
public void AddImplementedMessageSpecification<T>(ISpecificationPipeSpecification<SendContext<T>> implementedSpecification)
where T : class
{
var adapter = new ImplementedTypeAdapter<T>(implementedSpecification);
_implementedMessageTypeSpecifications.Add(adapter);
}
static SendContext FilterContext(SendContext<TMessage> context)
{
return context;
}
static SendContext<TMessage> MergeContext(SendContext<TMessage> input, SendContext context)
{
var result = context as SendContext<TMessage>;
return result ?? new SendContextProxy<TMessage>(context, input.Message);
}
class ImplementedTypeAdapter<T> :
ISpecificationPipeSpecification<SendContext<TMessage>>
where T : class
{
readonly ISpecificationPipeSpecification<SendContext<T>> _specification;
public ImplementedTypeAdapter(ISpecificationPipeSpecification<SendContext<T>> specification)
{
_specification = specification;
}
public void Apply(ISpecificationPipeBuilder<SendContext<TMessage>> builder)
{
var specification = new MessageSendPipeSplitFilterSpecification<TMessage, T>(_specification);
specification.Apply(builder);
}
public IEnumerable<ValidationResult> Validate()
{
yield break;
}
}
}
}
|
SanSYS/MassTransit
|
src/MassTransit/Configuration/SendPipeSpecifications/MessageSendPipeSpecification.cs
|
C#
|
apache-2.0
| 6,332
|
/*
* Copyright 2011 Intel Corporation.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full text of the Apache License is at
* http://www.apache.org/licenses/LICENSE-2.0
*/
#include "tasksdbengine.h"
#include <QSettings>
#include "tasksdatabase.h"
#include "taskslistitem.h"
#include <event.h>
#include <QDebug>
const QString TasksDBEngine::tasksNotebook = "TasksNotebook";
TasksDBEngine::TasksDBEngine(TasksDatabase *db)
: m_db(db)
{
m_settings = new QSettings("MeeGo", "meego-app-tasks");
m_calendar = new ExtendedCalendar(QLatin1String("UTC"));
m_calendarPtr = ExtendedCalendar::Ptr(m_calendar);
m_storage = m_calendar->defaultStorage(m_calendarPtr);
m_storage->open();
m_notebook = 0;
Notebook::List nbList = m_storage->notebooks();
for (int i = 0; i < nbList.count(); i++) {
Notebook::Ptr nbPtr = nbList.at(i);
Notebook *notebook = nbPtr.data();
if (notebook->name() == tasksNotebook) {
m_notebook = notebook;
break;
}
}
if (!m_notebook) {
m_notebook = new Notebook(tasksNotebook, "");
Notebook::Ptr notebookPtr = Notebook::Ptr(m_notebook);
m_storage->addNotebook(notebookPtr);
}
m_nuid = m_notebook->uid();
}
TasksDBEngine::~TasksDBEngine()
{
delete m_settings;
}
void TasksDBEngine::loadLists()
{
m_settings->beginGroup("Lists");
int count = m_settings->value("count", 0).toInt();
for (int idx = 1; idx < count; idx++) {
QString name = m_settings->value(QString("list%1").arg(QString::number(idx)), "").toString();
qDebug() << name;
m_db->createList(name);
}
m_settings->endGroup();
}
void TasksDBEngine::saveLists()
{
m_settings->beginGroup("Lists");
m_settings->remove("");
m_settings->setValue("count", m_db->m_lists.count());
int idx = 0;
foreach (TasksListItem *list, m_db->m_lists) {
m_settings->setValue(QString("list%1").arg(QString::number(idx)), list->name());
idx++;
}
m_settings->endGroup();
//m_settings->sync();
}
void TasksDBEngine::loadTasks()
{
m_storage->loadNotebookIncidences(m_nuid);
QHash<QString, TasksListItem *> listsHash;
foreach (TasksListItem *list, m_db->m_lists)
listsHash[list->name()] = list;
QList<TasksTaskItem *> tasks;
QList<TasksTaskItem *> taskswoo;
QList<int> orders;
KCalCore::Todo::List todos = m_calendar->rawTodos();
for (int i = 0; i < todos.count(); i++){
//KCalCore::Todo *todo = todos.at(i).data();
KCalCore::Todo::Ptr todo = todos.at(i);
QString order = todo->customProperty("Tasks", "Order");
bool ok;
int orderidx = order.toInt(&ok);
if (!ok)
orderidx = -1;
QString task = todo->description();
QString notes = todo->altDescription();
bool completed = todo->isCompleted();
bool hasDueDate = todo->hasDueDate();
QDate dueDate = todo->dtDue().date();
QDateTime created = todo->created().dateTime();
TasksListModel::ReminderType reminderType = TasksListModel::NoReminder;
QDate reminderDate;
//qDebug() << "parse alarms";
if (todo->hasEnabledAlarms()) {
KCalCore::Alarm::List alarms = todo->alarms();
//qDebug() << "count " << alarms.count();
if (alarms.count() > 0) {
KCalCore::Alarm::Ptr alarm = alarms.at(0);
if (alarm->hasStartOffset()) {
if (alarm->startOffset().asSeconds() == 0)
reminderType = TasksListModel::OnDueDate;
else if (alarm->startOffset().asDays() == -1)
reminderType = TasksListModel::OneDayBefore;
else if (alarm->startOffset().asDays() == -2)
reminderType = TasksListModel::TwoDaysBefore;
else if (alarm->startOffset().asDays() == -7)
reminderType = TasksListModel::OneWeekBefore;
}
else if (alarm->hasTime()) {
reminderType = TasksListModel::DateReminder;
KDateTime alarmTime = alarm->time();
reminderDate = alarmTime.date();
}
}
}
QStringList urls = todo->comments();
//qDebug() << "comments: " << urls;
QStringList attachments;
KCalCore::Attachment::List attlst = todo->attachments();
for (int j = 0; j < attlst.count(); j++) {
KCalCore::Attachment *attch = attlst.at(j).data();
if (attch->isUri())
attachments << attch->uri();
}
QStringList cats = todo->categories();
TasksListItem *list = 0;
foreach (const QString &cat, cats) {
if (listsHash.contains(cat)) {
list = listsHash[cat];
break;
}
}
if (!list)
continue;
TasksTaskItem *tsk = m_db->createTask(list, task, notes, completed, hasDueDate, dueDate,
reminderType, reminderDate, urls, attachments, created);
//m_tasks[tsk->id()] = todo;
m_uids[tsk->id()] = todo->uid();
if (orderidx == -1){
taskswoo << tsk;
} else {
QList<int>::iterator it = qLowerBound(orders.begin(), orders.end(), orderidx);
int idx = it - orders.begin();
//orders.insert(it, orderidx);
//int idx = 0;
//while (idx < tasks.count() && orders.at(idx) < orderidx)
// idx++;
tasks.insert(idx, tsk);
orders.insert(idx, orderidx);
//qDebug() << "idx " << idx << " " << idx1;
}
}
m_db->insertTasks(tasks);
m_db->insertTasks(taskswoo);
}
void TasksDBEngine::addTask(TasksTaskItem *task)
{
if (m_uids.contains(task->id()))
return;
KCalCore::Todo::Ptr todo = KCalCore::Todo::Ptr(new KCalCore::Todo());
setTaskValues(task, todo);
//m_tasks[task->id()] = todo;
m_calendar->addTodo(todo, m_nuid);
}
void TasksDBEngine::updateTask(TasksTaskItem *task)
{
//if (!m_tasks.contains(task->id()))
// return;
if (!m_uids.contains(task->id()))
return;
m_storage->loadNotebookIncidences(m_nuid);
KCalCore::Todo::Ptr todo = m_calendar->todo(m_uids[task->id()]);
setTaskValues(task, todo);
todo->setRevision(todo->revision() + 1);
m_storage->save();
}
void TasksDBEngine::removeTask(TasksTaskItem *task)
{
if (!m_uids.contains(task->id()))
return;
m_storage->loadNotebookIncidences(m_nuid);
KCalCore::Todo::Ptr todo = m_calendar->todo(m_uids[task->id()]);
m_uids.remove(task->id());
m_calendar->deleteTodo(todo);
m_storage->save();
}
void TasksDBEngine::removeTasks(QList<TasksTaskItem *> tasks)
{
m_storage->loadNotebookIncidences(m_nuid);
foreach (TasksTaskItem *task, tasks) {
if (!task)
continue;
if (!m_uids.contains(task->id()))
continue;
KCalCore::Todo::Ptr todo = m_calendar->todo(m_uids[task->id()]);
m_calendar->deleteTodo(todo);
}
m_storage->save();
}
void TasksDBEngine::updateTasksOrder(TasksListItem *list)
{
m_storage->loadNotebookIncidences(m_nuid);
for (int idx = 0; idx < list->tasks(); idx++) {
TasksTaskItem *task = list->task(idx);
if (!task)
continue;
if (!m_uids.contains(task->id()))
continue;
KCalCore::Todo::Ptr todo = m_calendar->todo(m_uids[task->id()]);
todo->setCustomProperty("Tasks", "Order", QString::number(idx));
}
m_storage->save();
}
void TasksDBEngine::updateTasksList(TasksListItem *list)
{
/*for (int idx = 0; idx < list->tasks(); idx++) {
TasksTaskItem *task = list->task(idx);
if (!task)
continue;
updateTask(task);
}*/
updateTasksList(list->m_tasks);
}
void TasksDBEngine::updateTasksList(QList<TasksTaskItem *> tasks)
{
m_storage->loadNotebookIncidences(m_nuid);
foreach (TasksTaskItem *task, tasks) {
if (!task)
continue;
if (!m_uids.contains(task->id()))
continue;
KCalCore::Todo::Ptr todo = m_calendar->todo(m_uids[task->id()]);
todo->setCategories(QStringList(task->list()->name()));
}
m_storage->save();
}
void TasksDBEngine::commitTasks()
{
m_storage->save();
}
void TasksDBEngine::setTaskValues(TasksTaskItem *task, const KCalCore::Todo::Ptr &todo)
{
todo->setDescription(task->task());
todo->setAltDescription(task->notes());
//todo->setSummary(task->notes());
todo->setCategories(QStringList(task->list()->name()));
todo->setCompleted(task->isComplete());
todo->setHasDueDate(task->hasDueDate());
if (task->hasDueDate()) {
KDateTime dueDate(task->dueDate());
todo->setDtDue(dueDate);
}
KDateTime createdDateTime(task->createdDateTime());
todo->setCreated(createdDateTime);
todo->clearComments();
// use attachments with mime?
foreach (const QString &url, task->urls()) {
qDebug() << "URL: " << url;
todo->addComment(url);
}
todo->clearAttachments();
foreach (const QString &auri, task->attachments()) {
qDebug() << "ATTACH URI: " << auri;
KCalCore::Attachment *attachment = new KCalCore::Attachment(auri);
KCalCore::Attachment::Ptr attachmentPtr = KCalCore::Attachment::Ptr(attachment);
todo->addAttachment(attachmentPtr);
}
int ordidx = task->list()->indexOfTask(task);
todo->setCustomProperty("Tasks", "Order", QString::number(ordidx));
// Save reminder
todo->clearAlarms();
if (task->reminderType() != TasksListModel::NoReminder) {
KCalCore::Alarm::Ptr alarm(todo->newAlarm());
alarm->setText("Reminder");
alarm->setDisplayAlarm("Reminder");
alarm->setEnabled(true);
if (task->reminderType() == TasksListModel::OnDueDate) {
alarm->setSnoozeTime(KCalCore::Duration(60 * 5));
alarm->setRepeatCount(1);
alarm->setStartOffset(KCalCore::Duration(0));
} else if (task->reminderType() == TasksListModel::OneDayBefore) {
alarm->setSnoozeTime(KCalCore::Duration(60 * 5));
alarm->setRepeatCount(1);
alarm->setStartOffset(KCalCore::Duration(-1, KCalCore::Duration::Days));
} else if (task->reminderType() == TasksListModel::TwoDaysBefore) {
alarm->setSnoozeTime(KCalCore::Duration(60 * 5));
alarm->setRepeatCount(1);
alarm->setStartOffset(KCalCore::Duration(-2, KCalCore::Duration::Days));
} else if (task->reminderType() == TasksListModel::OneWeekBefore) {
alarm->setSnoozeTime(KCalCore::Duration(60 * 5));
alarm->setRepeatCount(1);
alarm->setStartOffset(KCalCore::Duration(-7, KCalCore::Duration::Days));
} else if (task->reminderType() == TasksListModel::DateReminder) {
alarm->setSnoozeTime(KCalCore::Duration(60 * 5));
alarm->setRepeatCount(1);
KDateTime alarmTime(task->reminderDate());
alarm->setTime(alarmTime);
}
}
}
|
dudochkin-victor/gogoo-app-tasks
|
model/tasksdbengine.cpp
|
C++
|
apache-2.0
| 13,326
|
/*
* 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.camel.jta;
import org.apache.camel.NamedNode;
import org.apache.camel.Processor;
import org.apache.camel.Route;
import org.apache.camel.RuntimeCamelException;
import org.apache.camel.builder.ErrorHandlerBuilder;
import org.apache.camel.builder.ErrorHandlerBuilderRef;
import org.apache.camel.model.ModelCamelContext;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.RouteDefinition;
import org.apache.camel.model.errorhandler.ErrorHandlerHelper;
import org.apache.camel.spi.TransactedPolicy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Sets a proper error handler. This class is based on {@link org.apache.camel.spring.spi.SpringTransactionPolicy}.
* <p>
* This class requires the resource {@link TransactionManager} to be available through JNDI url
* "java:/TransactionManager"
*/
public abstract class JtaTransactionPolicy implements TransactedPolicy {
private static final Logger LOG = LoggerFactory.getLogger(JtaTransactionPolicy.class);
public interface Runnable {
void run() throws Throwable;
}
@Override
public void beforeWrap(Route route, NamedNode definition) {
// do not inherit since we create our own
// (otherwise the default error handler would be used two times
// because we inherit it on our own but only in case of a
// non-transactional error handler)
((ProcessorDefinition<?>) definition).setInheritErrorHandler(false);
}
public abstract void run(Runnable runnable) throws Throwable;
@Override
public Processor wrap(Route route, Processor processor) {
JtaTransactionErrorHandler answer;
// the goal is to configure the error handler builder on the route as a
// transacted error handler. If the configured builder is not transacted,
// we replace it with a transacted one that we configure here
// and wrap the processor in the transacted error handler as we can have
// transacted routes that change propagation behavior,
// eg: from A required -> B -> requiresNew C (advanced use-case)
// if we should not support this we do not need to wrap the processor as
// we only need one transacted error handler
// find the existing error handler builder
RouteDefinition routeDefinition = (RouteDefinition) route.getRoute();
ErrorHandlerBuilder builder = (ErrorHandlerBuilder) routeDefinition.getErrorHandlerFactory();
// check if its a ref if so then do a lookup
if (builder instanceof ErrorHandlerBuilderRef) {
// its a reference to a error handler so lookup the reference
ErrorHandlerBuilderRef builderRef = (ErrorHandlerBuilderRef) builder;
String ref = builderRef.getRef();
// only lookup if there was explicit an error handler builder configured
// otherwise its just the "default" that has not explicit been configured
// and if so then we can safely replace that with our transacted error handler
if (ErrorHandlerHelper.isErrorHandlerFactoryConfigured(ref)) {
LOG.debug("Looking up ErrorHandlerBuilder with ref: {}", ref);
builder = (ErrorHandlerBuilder) ErrorHandlerHelper.lookupErrorHandlerFactory(route, ref, true);
}
}
JtaTransactionErrorHandlerBuilder txBuilder;
if ((builder != null) && builder.supportTransacted()) {
if (!(builder instanceof JtaTransactionErrorHandlerBuilder)) {
throw new RuntimeCamelException(
"The given transactional error handler builder '" + builder
+ "' is not of type '" + JtaTransactionErrorHandlerBuilder.class.getName()
+ "' which is required in this environment!");
}
LOG.debug("The ErrorHandlerBuilder configured is a JtaTransactionErrorHandlerBuilder: {}", builder);
txBuilder = (JtaTransactionErrorHandlerBuilder) builder.cloneBuilder();
} else {
LOG.debug(
"No or no transactional ErrorHandlerBuilder configured, will use default JtaTransactionErrorHandlerBuilder settings");
txBuilder = new JtaTransactionErrorHandlerBuilder();
}
txBuilder.setTransactionPolicy(this);
// use error handlers from the configured builder
if (builder != null) {
route.addErrorHandlerFactoryReference(builder, txBuilder);
}
answer = createTransactionErrorHandler(route, processor, txBuilder);
// set the route to use our transacted error handler builder
route.setErrorHandlerFactory(txBuilder);
// return with wrapped transacted error handler
return answer;
}
protected JtaTransactionErrorHandler createTransactionErrorHandler(
Route route, Processor processor,
ErrorHandlerBuilder builder) {
JtaTransactionErrorHandler answer;
try {
ModelCamelContext mcc = route.getCamelContext().adapt(ModelCamelContext.class);
answer = (JtaTransactionErrorHandler) mcc.getModelReifierFactory().createErrorHandler(route, builder, processor);
} catch (Exception e) {
throw RuntimeCamelException.wrapRuntimeCamelException(e);
}
return answer;
}
@Override
public String toString() {
return getClass().getName();
}
}
|
mcollovati/camel
|
components/camel-jta/src/main/java/org/apache/camel/jta/JtaTransactionPolicy.java
|
Java
|
apache-2.0
| 6,353
|
/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.cloudtrail.model.transform;
import java.util.Map;
import java.util.Map.Entry;
import com.amazonaws.services.cloudtrail.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* LookupEventsResult JSON Unmarshaller
*/
public class LookupEventsResultJsonUnmarshaller implements
Unmarshaller<LookupEventsResult, JsonUnmarshallerContext> {
public LookupEventsResult unmarshall(JsonUnmarshallerContext context)
throws Exception {
LookupEventsResult lookupEventsResult = new LookupEventsResult();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL)
return null;
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("Events", targetDepth)) {
context.nextToken();
lookupEventsResult.setEvents(new ListUnmarshaller<Event>(
EventJsonUnmarshaller.getInstance())
.unmarshall(context));
}
if (context.testExpression("NextToken", targetDepth)) {
context.nextToken();
lookupEventsResult.setNextToken(StringJsonUnmarshaller
.getInstance().unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null
|| context.getLastParsedParentElement().equals(
currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return lookupEventsResult;
}
private static LookupEventsResultJsonUnmarshaller instance;
public static LookupEventsResultJsonUnmarshaller getInstance() {
if (instance == null)
instance = new LookupEventsResultJsonUnmarshaller();
return instance;
}
}
|
trasa/aws-sdk-java
|
aws-java-sdk-cloudtrail/src/main/java/com/amazonaws/services/cloudtrail/model/transform/LookupEventsResultJsonUnmarshaller.java
|
Java
|
apache-2.0
| 3,138
|
package org.ray.devnote.devnoteweb;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
public class ServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(DevnoteWebApplication.class);
}
}
|
rayrelay/devnote
|
devnote-web/src/main/java/org/ray/devnote/devnoteweb/ServletInitializer.java
|
Java
|
apache-2.0
| 435
|
#head-top h1 {
color: #333333;
font-size: 60px;
margin-left: 50px;
}
#head-top {
min-width: 740px;
max-width: 740px;
margin-left: auto;
margin-right: auto;
}
body {
background-color: #fdf6e6;
background-repeat: no-repeat;
background-position: top;
}
#frontpage {
min-width: 500px;
max-width: 910px;
margin-left: auto;
margin-right: auto;
margin-top: 100px;
}
#frontpage img {
margin-bottom: 20px;
}
.hero {
min-height: 100px;
max-height: 100px;
margin-left: 20px;
margin-bottom: 20px;
background-color: #333333;
border-style: solid;
border-width: 2px;
border-color: #333333;
}
.Back-layer {
background-color:rgba(51,51,51,0.9);
border: 3px;
border-color: #7d0808;
border-style: solid;
border-radius: 8px;
}
#heropage {
float: initial;
width: 970px;
margin-left: auto;
margin-right: auto;
margin-top: 100px;
}
.left {
width: 700px;
float: left;
}
.right {
width: 250px;
float: left;
margin-left: 20px;
}
#Search-terms {
padding-bottom: 200px;
}
#builds td {
float: left;
}
#build-collection {
margin-top: 15px;
padding: 10px;
}
#build-collection img {
border-radius: 8px;
}
#newbuild {
}
#addvertisement {
padding-bottom: 200px;
}
#listststs {
margin-top: 15px;
padding-bottom: 600px;
}
#listststs div {
background-color: crimson;
float: left;
}
h2 {
position: absolute;
}
|
thoddi/buildsite
|
BuildSite/BuildSite/Content/Site.css
|
CSS
|
apache-2.0
| 1,509
|
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2012.12.05 at 01:12:38 PM EST
//
package org.slc.sli.sample.entitiesR1;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for LeaveEventCategoryType.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* <simpleType name="LeaveEventCategoryType">
* <restriction base="{http://www.w3.org/2001/XMLSchema}token">
* <enumeration value="Vacation"/>
* <enumeration value="Jury"/>
* <enumeration value="Training"/>
* <enumeration value="Flex Time"/>
* <enumeration value="Work Compensation"/>
* <enumeration value="Administrative"/>
* <enumeration value="Annual leave"/>
* <enumeration value="Bereavement"/>
* <enumeration value="Compensatory leave time"/>
* <enumeration value="Family and medical leave"/>
* <enumeration value="Government-requested"/>
* <enumeration value="Military leave"/>
* <enumeration value="Personal"/>
* <enumeration value="Release time"/>
* <enumeration value="Sabbatical leave"/>
* <enumeration value="Sick leave"/>
* <enumeration value="Suspension"/>
* <enumeration value="Other"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "LeaveEventCategoryType")
@XmlEnum
public enum LeaveEventCategoryType {
@XmlEnumValue("Vacation")
VACATION("Vacation"),
@XmlEnumValue("Jury")
JURY("Jury"),
@XmlEnumValue("Training")
TRAINING("Training"),
@XmlEnumValue("Flex Time")
FLEX_TIME("Flex Time"),
@XmlEnumValue("Work Compensation")
WORK_COMPENSATION("Work Compensation"),
@XmlEnumValue("Administrative")
ADMINISTRATIVE("Administrative"),
@XmlEnumValue("Annual leave")
ANNUAL_LEAVE("Annual leave"),
@XmlEnumValue("Bereavement")
BEREAVEMENT("Bereavement"),
@XmlEnumValue("Compensatory leave time")
COMPENSATORY_LEAVE_TIME("Compensatory leave time"),
@XmlEnumValue("Family and medical leave")
FAMILY_AND_MEDICAL_LEAVE("Family and medical leave"),
@XmlEnumValue("Government-requested")
GOVERNMENT_REQUESTED("Government-requested"),
@XmlEnumValue("Military leave")
MILITARY_LEAVE("Military leave"),
@XmlEnumValue("Personal")
PERSONAL("Personal"),
@XmlEnumValue("Release time")
RELEASE_TIME("Release time"),
@XmlEnumValue("Sabbatical leave")
SABBATICAL_LEAVE("Sabbatical leave"),
@XmlEnumValue("Sick leave")
SICK_LEAVE("Sick leave"),
@XmlEnumValue("Suspension")
SUSPENSION("Suspension"),
@XmlEnumValue("Other")
OTHER("Other");
private final String value;
LeaveEventCategoryType(String v) {
value = v;
}
public String value() {
return value;
}
public static LeaveEventCategoryType fromValue(String v) {
for (LeaveEventCategoryType c: LeaveEventCategoryType.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}
|
inbloom/secure-data-service
|
tools/csv2xml/src/org/slc/sli/sample/entitiesR1/LeaveEventCategoryType.java
|
Java
|
apache-2.0
| 3,479
|
using System;
using System.Data;
#if MSDATA
using Microsoft.Data.SqlClient;
#else
using System.Data.SqlClient;
#endif
using ServiceStack.DataAnnotations;
using ServiceStack.OrmLite.Converters;
namespace ServiceStack.OrmLite.SqlServer.Converters
{
public class SqlServerStringConverter : StringConverter
{
public override string MaxColumnDefinition => UseUnicode ? "NVARCHAR(MAX)" : "VARCHAR(MAX)";
public override int MaxVarCharLength => UseUnicode ? 4000 : 8000;
public override string GetColumnDefinition(int? stringLength)
{
if (stringLength.GetValueOrDefault() == StringLengthAttribute.MaxText)
return MaxColumnDefinition;
var safeLength = Math.Min(
stringLength.GetValueOrDefault(StringLength),
UseUnicode ? 4000 : 8000);
return UseUnicode
? $"NVARCHAR({safeLength})"
: $"VARCHAR({safeLength})";
}
public override void InitDbParam(IDbDataParameter p, Type fieldType)
{
base.InitDbParam(p, fieldType);
if (!(p is SqlParameter sqlParam)) return;
if (!UseUnicode)
{
sqlParam.SqlDbType = SqlDbType.VarChar;
}
}
}
}
|
Pathfinder-Fr/YAFNET
|
yafsrc/ServiceStack/ServiceStack.OrmLite.SqlServer/Converters/SqlServerStringConverters.cs
|
C#
|
apache-2.0
| 1,303
|
/**
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.hbase.client;
import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.Enumeration;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.hbase.util.Addressing;
import org.apache.hadoop.hbase.util.Bytes;
/**
* The class that is able to determine some unique strings for the client,
* such as an IP address, PID, and composite deterministic ID.
*/
@InterfaceAudience.Private
class ClientIdGenerator {
static final Log LOG = LogFactory.getLog(ClientIdGenerator.class);
/**
* @return a unique ID incorporating IP address, PID, TID and timer. Might be an overkill...
* Note though that new UUID in java by default is just a random number.
*/
public static byte[] generateClientId() {
byte[] selfBytes = getIpAddressBytes();
Long pid = getPid();
long tid = Thread.currentThread().getId();
long ts = System.currentTimeMillis();
byte[] id = new byte[selfBytes.length + ((pid != null ? 1 : 0) + 2) * Bytes.SIZEOF_LONG];
int offset = Bytes.putBytes(id, 0, selfBytes, 0, selfBytes.length);
if (pid != null) {
offset = Bytes.putLong(id, offset, pid);
}
offset = Bytes.putLong(id, offset, tid);
offset = Bytes.putLong(id, offset, ts);
assert offset == id.length;
return id;
}
/**
* @return PID of the current process, if it can be extracted from JVM name, or null.
*/
public static Long getPid() {
String name = ManagementFactory.getRuntimeMXBean().getName();
String[] nameParts = name.split("@");
if (nameParts.length == 2) { // 12345@somewhere
try {
return Long.parseLong(nameParts[0]);
} catch (NumberFormatException ex) {
LOG.warn("Failed to get PID from [" + name + "]", ex);
}
} else {
LOG.warn("Don't know how to get PID from [" + name + "]");
}
return null;
}
/**
* @return Some IPv4/IPv6 address available on the current machine that is up, not virtual
* and not a loopback address. Empty array if none can be found or error occured.
*/
public static byte[] getIpAddressBytes() {
try {
return Addressing.getIpAddress().getAddress();
} catch (IOException ex) {
LOG.warn("Failed to get IP address bytes", ex);
}
return new byte[0];
}
}
|
intel-hadoop/hbase-rhino
|
hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientIdGenerator.java
|
Java
|
apache-2.0
| 3,348
|
module Kontena::Actors
class HaproxyProcess < Concurrent::Actor::Context
include Kontena::Logging
# @param [String] cmd
def initialize(cmd)
@cmd = cmd
end
def on_message(msg)
command, _ = msg
case command
when :run
run
when :pid
@pid
else
pass
end
end
def run
@pid = Process.spawn(@cmd.join(' '))
info "HAProxy process #{@cmd} started (pid #{@pid})"
@wait_pid = Concurrent::Future.execute { wait_pid(self.reference) }
@pid
end
def wait_pid(reference)
begin
_, status = Process.wait2(@pid)
info "process exited #{@pid}"
ensure
reference.tell([:terminate!, status])
end
end
end
end
|
kontena/kontena-loadbalancer
|
lib/kontena/actors/haproxy_process.rb
|
Ruby
|
apache-2.0
| 762
|
<?php
####
# Given a query like '?package=version/name.js' or '?package=version/name.css'
# will dynamically pull together all the files to make that package.
#
# Uses the packages.xml file to decide which files belong to which packages.
#
# To keep debugging code use ?package=version/name.debug.js
# Debugging code in content is delimited by /*!debug*/ and /*gubed!*/
#
# To add a delay (seconds) use ?package=version/name.js&delay=3
#
# To knit a file into the middle of another add the following to the content:
# /*!include:filename.js*/
####
/**** configure ****/
$conf = array(
'path_to_packagelist' => 'packages.xml',
'path_to_root' => '../'
);
/**** main ****/
function errorHandler($msg) {
$msg = str_replace("\\", "\\\\", $msg);
$msg = str_replace("'", "\\'", $msg);
$msg = preg_replace("/[\r\n]/", "\\n", $msg);
echo "window.console && console.log('Knit Error: $msg.');\n";
exit(1);
}
error_reporting(E_ALL);
ini_set('display_errors', 0);
set_exception_handler('errorHandler');
$args = getSafeArgs($_GET); // note: $_GET is already URL decoded
$packages = getPackages($conf['path_to_packagelist']);
if ( empty($args['package']) ) {
throw new Exception('Required GET parameter "package" is empty.');
}
list($version, $packageName, $debug, $type) = parsePackageName($args['package']);
if ($version == '@SRC@') { $version = 'src'; }
$files = getFiles($packages, $packageName, $type);
if ( !empty($args['delay']) ) {
sleep(min($args['delay'], 10)); // maximum sleepiness == 10
}
printHeader($type);
$content = knitFiles($files, $conf['path_to_root'] . $version . '/');
if (!$debug) {
$content = preg_replace(':/\*!debug\*/.*?/\*gubed!\*/:s', '', $content);
}
print($content);
/**** functions ****/
/**
*/
function getSafeArgs($unsafe_args) {
$safe_args = array();
if ( !empty($unsafe_args['package']) ) {
if (!preg_match('!([^/]+)/[a-z.]+\.(js|css)$!', $unsafe_args['package'])) {
throw new Exception('Argument "package" ' . $unsafe_args['package'] . ' has unsafe characters and cannot be used.');
}
else {
$safe_args['package'] = $unsafe_args['package'];
}
}
if ( !empty($unsafe_args['delay']) ) {
if (!preg_match('!^\d+$!', $unsafe_args['delay'])) {
throw new Exception('Argument "delay" ' . $unsafe_args['delay'] . ' must be an integer so cannot be used.');
}
else {
$safe_args['delay'] = $unsafe_args['delay'];
}
}
return $safe_args;
}
/**
*/
function parsePackageName($package) {
list($version, $package) = explode('/', $package);
$parts = explode('.', $package);
$type = array_pop($parts);
$debug = 0;
if ($parts[count($parts)-1] == 'debug') {
$debug = 1;
array_pop($parts);
}
$name = implode('.', $parts);
return array($version, $name, $debug, $type);
}
/**
*/
function getPackages($xmlPath) {
if ( !file_exists($xmlPath) || !is_readable($xmlPath) ) {
throw new Exception("Cannot read any file at '$xmlPath'.");
}
try {
$packages = simplexml_load_file($xmlPath);
}
catch(Exception $e) {
throw new Exception("The file at '$xmlPath' cannot be parsed as XML.");
}
return $packages;
}
/**
*/
function getFiles($packages, $package_name, $type) {
@$file_list = $packages->xpath("/packages/$package_name/$type");
if ( empty($file_list) ) {
throw new Exception("No data is defined for the package named '$package_name'.");
}
$files = array();
foreach ($file_list[0] as $file) {
$files[] = preg_replace('/^src\//', '', $file); // 'src' will be replaced by the root+version
}
return $files;
}
/**
*/
function printHeader($type) {
switch ($type) {
case 'js':
header('Content-Type: text/javascript');
break;
case 'css':
header('Content-Type: text/css');
break;
}
}
/**
*/
function knitFiles($files, $base='') {
$content = '';
foreach ($files as $file) {
$path = $base . $file;
if ( !file_exists($path) || !is_readable($path) ) {
throw new Exception("Cannot read any file at '$path'.");
}
$content .= file_get_contents($base . $file) . "\n";
}
$content = parseInclude($content, $base);
return $content;
}
/**
*/
function parseInclude($content, $base='') {
$replacer = create_function('$args', 'return file_get_contents("'.$base.'include/".$args[1]);');
$content = preg_replace_callback('/\/\*!include:(.+?)\*\//', $replacer, $content);
return $content;
}
|
glow/glow2
|
packages/knit.php
|
PHP
|
apache-2.0
| 4,397
|
# Hyoscyamus pojarkovae Schönb.-Tem. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Solanales/Solanaceae/Hyoscyamus/Hyoscyamus pojarkovae/README.md
|
Markdown
|
apache-2.0
| 185
|
/*
* Copyright (c) 2014 Ahomé Innovation Technologies. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ait.toolkit.sencha.ext.ux.calendar.client;
import com.ait.toolkit.core.client.CSSUtil;
import com.ait.toolkit.core.client.JsoHelper;
import com.ait.toolkit.sencha.ext.client.events.HandlerRegistration;
import com.ait.toolkit.sencha.ext.client.ui.Panel;
import com.ait.toolkit.sencha.ext.ux.calendar.client.events.BeforeDateChangeHandler;
import com.ait.toolkit.sencha.ext.ux.calendar.client.events.BeforeEventDeleteHandler;
import com.ait.toolkit.sencha.ext.ux.calendar.client.events.BeforeEventMoveHandler;
import com.ait.toolkit.sencha.ext.ux.calendar.client.events.BeforeEventResizeHandler;
import com.ait.toolkit.sencha.ext.ux.calendar.client.events.DateChangeHandler;
import com.ait.toolkit.sencha.ext.ux.calendar.client.events.DayClickHandler;
import com.ait.toolkit.sencha.ext.ux.calendar.client.events.DayOutHandler;
import com.ait.toolkit.sencha.ext.ux.calendar.client.events.DayOverHandler;
import com.ait.toolkit.sencha.ext.ux.calendar.client.events.EditDetailsHandler;
import com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventAddHandler;
import com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventCancelHandler;
import com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventClickHandler;
import com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventMoveHandler;
import com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventOutHandler;
import com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventOverHandler;
import com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventResizeHandler;
import com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventUpdateHandler;
import com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventsRenderedHandler;
import com.ait.toolkit.sencha.ext.ux.calendar.client.events.InitDragHandler;
import com.ait.toolkit.sencha.ext.ux.calendar.client.events.ViewChangeHandler;
import com.ait.toolkit.sencha.shared.client.data.Store;
import com.google.gwt.core.client.Callback;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.ScriptInjector;
import com.google.gwt.user.client.DOM;
public class CalendarPanel extends Panel {
private static JavaScriptObject calendarScriptElement;
private static final String CAL_PANEL_JS_ID = "ait-extensible-cal-js-id";
private static final String CAL_PANEL_CSS_ID = "ait-extensible-cal-csss-id";
static {
inject();
}
public CalendarPanel() {
}
protected CalendarPanel( JavaScriptObject obj ) {
super( obj );
}
public CalendarPanel( Store eventStore ) {
this();
this.setEventStore( eventStore );
}
public CalendarPanel( Store eventStore, Store calendarStore ) {
this( eventStore );
this.setCalendarStore( calendarStore );
}
protected native JavaScriptObject create( JavaScriptObject config ) /*-{
return new $wnd.Extensible.calendar.CalendarPanel(config);
}-*/;
/**
* The store which is bound to this calendar and contains EventModels.
* Note that this is an alias to the default store config (to differentiate that from the optional calendarStore config), and either can be used interchangeably.
*/
public void setEventStore( Store store ) {
this.setAttribute( "eventStore", store.getJsObj(), true );
}
/**
* The store which is bound to this calendar and contains CalendarModels.
* This is an optional store that provides multi-calendar (and multi-color) support.
* If available an additional field for selecting the calendar in which to save an event will be shown in the edit forms.
* If this store is not available then all events will simply use the default calendar (and color).
*/
public void setCalendarStore( Store store ) {
this.setAttribute( "calendarStore", store.getJsObj(), true );
}
/**
* The 0-based index within the available views to set as the default active view (defaults to undefined). If not specified the default view will be set as the last one added to the panel. You can retrieve a reference to the active view at any time using the activeView property.
* @param value
*/
public void setStartDay( int value ) {
this.setAttribute( "startDay", value, true );
}
/**
* True to show the default event editor window modally over the entire page, false to allow user interaction with the page while showing the window (the default).
* Note that if you replace the default editor window with some alternate component this config will no longer apply.
*/
public void setEditModal( boolean value ) {
this.setAttribute( "startDay", value, true );
}
/**
*True to show a link on the event edit window to allow switching to the detailed edit form (the default), false to remove the link and disable detailed event editing.
*/
public void setEnableEditDetails( boolean value ) {
this.setAttribute( "enableEditDetails", value, true );
}
/**
* The 0-based index within the available views to set as the default active view (defaults to undefined). If not specified the default view will be set as the last one added to the panel. You can retrieve a reference to the active view at any time using the activeView property.
* @param value
*/
public void setActiveItem( int value ) {
this.setAttribute( "activeItem", value, true );
}
/**
* Text to use for the 'Day' nav bar button.
*/
public void setDayText( int value ) {
this.setAttribute( "dayText", value, true );
}
/**
* Text to use for the 'Go' navigation button.
*/
public void setGoText( int value ) {
this.setAttribute( "goText", value, true );
}
/**
* Text to use for the 'Jump to:' navigation label.
*/
public void setJumpToText( int value ) {
this.setAttribute( "jumpToText", value, true );
}
/**
* Text to use for the 'Month' nav bar button.
*/
public void setMounthText( int value ) {
this.setAttribute( "mounthText", value, true );
}
/**
* Deprecated. Please override getMultiDayText instead.
Text to use for the 'X Days' nav bar button (defaults to "{0} Days" where {0} is automatically replaced by the value of the multDayViewCfg's dayCount value if available, otherwise it uses the view default of 3).
*/
public void setMultiDayText( int value ) {
this.setAttribute( "multiDayText", value, true );
}
public void setMultiWeekText( int value ) {
this.setAttribute( "multiWeekText", value, true );
}
public void setReadOnly( boolean value ) {
this.setAttribute( "readOnly", value, true );
}
public void setShowDayView( boolean value ) {
this.setAttribute( "showDayView", value, true );
}
public void setShowMounthView( boolean value ) {
this.setAttribute( "showMounthView", value, true );
}
public void setShowMultiDayView( boolean value ) {
this.setAttribute( "showMultiDayView", value, true );
}
public void setShowMultiWeekView( boolean value ) {
this.setAttribute( "showMultiWeekView", value, true );
}
public void setShowNavBar( boolean value ) {
this.setAttribute( "showNavBar", value, true );
}
/**
* True to display the "Jump to:" label in the calendar panel's navigation header, false to not show it (defaults to true).
*/
public void setShowNavJump( boolean value ) {
this.setAttribute( "showNavJump", value, true );
}
/**
* True to display the left/right arrow buttons in the calendar panel's navigation header, false to not show it (defaults to true).
*/
public void setShowNavNextPrev( boolean value ) {
this.setAttribute( "showNavNextPrev", value, true );
}
/**
* True to display the "Today" button in the calendar panel's navigation header, false to not show it (defaults to true).
*/
public void setShowNavToday( boolean value ) {
this.setAttribute( "showNavToday", value, true );
}
/**
* True to display the current time next to the date in the calendar's current day box, false to not show it (defaults to true).
*/
public void setShowTime( boolean value ) {
this.setAttribute( "showTime", value, true );
}
/**
* True to show the value of todayText instead of today's date in the calendar's current day box, false to display the day number(defaults to true).
*/
public void setShowTodayText( boolean value ) {
this.setAttribute( "showTodayText", value, true );
}
/**
* True to show the value of todayText instead of today's date in the calendar's current day box, false to display the day number(defaults to true).
*/
public void setShowWeekView( boolean value ) {
this.setAttribute( "showWeekView", value, true );
}
/**
* Text to use for the 'Today' nav bar button.
*/
public void setTodayText( boolean value ) {
this.setAttribute( "todayText", value, true );
}
/**
* Text to use for the 'Week' nav bar button.
*/
public void setWeekText( boolean value ) {
this.setAttribute( "weekText", value, true );
}
public String getXType() {
return "extensible.calendarpanel";
}
public native HandlerRegistration addBeforeDateChangeHandler( BeforeDateChangeHandler handler )/*-{
var component = this.@com.ait.toolkit.sencha.ext.client.core.Component::getOrCreateJsObj()();
var fn = function(c, sd, nd, vs, ve) {
var cp = @com.ait.toolkit.sencha.ext.ux.calendar.client.CalendarPanel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(c);
var event = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.BeforeDateChangeEvent::new(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel;Lcom/google/gwt/core/client/JsDate;Lcom/google/gwt/core/client/JsDate;Lcom/google/gwt/core/client/JsDate;Lcom/google/gwt/core/client/JsDate;Lcom/google/gwt/core/client/JavaScriptObject;)(cp,sd, nd, vs, ve, null);
return handler.@com.ait.toolkit.sencha.ext.ux.calendar.client.events.BeforeDateChangeHandler::onBeforeDateChange(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/events/BeforeDateChangeEvent;)(event);
};
var eventName = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.BeforeDateChangeEvent::EVENT_NAME;
component.addListener(eventName, fn);
var toReturn = @com.ait.toolkit.sencha.ext.client.events.HandlerRegistration::new(Lcom/ait/toolkit/sencha/ext/client/core/Component;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)(this,eventName,fn);
return toReturn;
}-*/;
public native HandlerRegistration addBeforeEventDeleteHandler( BeforeEventDeleteHandler handler )/*-{
var component = this.@com.ait.toolkit.sencha.ext.client.core.Component::getOrCreateJsObj()();
var fn = function(c, r, el) {
var cp = @com.ait.toolkit.sencha.ext.ux.calendar.client.CalendarPanel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(c);
var rec = @com.ait.toolkit.sencha.ext.ux.calendar.client.data.CalendarEvent::create(Lcom/google/gwt/core/client/JavaScriptObject;)(r);
var element = @com.ait.toolkit.sencha.shared.client.dom.ExtElement::new(Lcom/google/gwt/core/client/JavaScriptObject;)(el);
var event = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.BeforeEventDeleteEvent::new(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel;Lcom/ait/toolkit/sencha/ext/ux/calendar/client/data/CalendarEvent;Lcom/ait/toolkit/sencha/shared/client/dom/ExtElement;Lcom/google/gwt/core/client/JavaScriptObject;)(cp,rec,element, null);
return handler.@com.ait.toolkit.sencha.ext.ux.calendar.client.events.BeforeEventDeleteHandler::onBeforeEventDelete(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/events/BeforeEventDeleteEvent;)(event);
};
var eventName = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.BeforeEventDeleteEvent::EVENT_NAME;
component.addListener(eventName, fn);
var toReturn = @com.ait.toolkit.sencha.ext.client.events.HandlerRegistration::new(Lcom/ait/toolkit/sencha/ext/client/core/Component;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)(this,eventName,fn);
return toReturn;
}-*/;
public native HandlerRegistration addBeforeEventMoveHandler( BeforeEventMoveHandler handler )/*-{
var component = this.@com.ait.toolkit.sencha.ext.client.core.Component::getOrCreateJsObj()();
var fn = function(c, r) {
var cp = @com.ait.toolkit.sencha.ext.ux.calendar.client.CalendarPanel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(c);
var rec = @com.ait.toolkit.sencha.ext.ux.calendar.client.data.CalendarEvent::create(Lcom/google/gwt/core/client/JavaScriptObject;)(r);
var event = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.BeforeEventMoveEvent::new(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel;Lcom/ait/toolkit/sencha/ext/ux/calendar/client/data/CalendarEvent;Lcom/google/gwt/core/client/JavaScriptObject;)(cp,rec,null);
return handler.@com.ait.toolkit.sencha.ext.ux.calendar.client.events.BeforeEventMoveHandler::onBeforeEventMove(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/events/BeforeEventMoveEvent;)(event);
};
var eventName = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.BeforeEventMoveEvent::EVENT_NAME;
component.addListener(eventName, fn);
var toReturn = @com.ait.toolkit.sencha.ext.client.events.HandlerRegistration::new(Lcom/ait/toolkit/sencha/ext/client/core/Component;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)(this,eventName,fn);
return toReturn;
}-*/;
public native HandlerRegistration addBeforeEventResizeHandler( BeforeEventResizeHandler handler )/*-{
var component = this.@com.ait.toolkit.sencha.ext.client.core.Component::getOrCreateJsObj()();
var fn = function(c, r) {
var cp = @com.ait.toolkit.sencha.ext.ux.calendar.client.CalendarPanel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(c);
var rec = @com.ait.toolkit.sencha.ext.ux.calendar.client.data.CalendarEvent::create(Lcom/google/gwt/core/client/JavaScriptObject;)(r);
var event = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.BeforeEventResizeEvent::new(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel;Lcom/ait/toolkit/sencha/ext/ux/calendar/client/data/CalendarEvent;Lcom/google/gwt/core/client/JavaScriptObject;)(cp,rec,null);
return handler.@com.ait.toolkit.sencha.ext.ux.calendar.client.events.BeforeEventResizeHandler::onBeforeEventResize(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/events/BeforeEventResizeEvent;)(event);
};
var eventName = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.BeforeEventResizeEvent::EVENT_NAME;
component.addListener(eventName, fn);
var toReturn = @com.ait.toolkit.sencha.ext.client.events.HandlerRegistration::new(Lcom/ait/toolkit/sencha/ext/client/core/Component;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)(this,eventName,fn);
return toReturn;
}-*/;
public native HandlerRegistration addDateChangeHandler( DateChangeHandler handler )/*-{
var component = this.@com.ait.toolkit.sencha.ext.client.core.Component::getOrCreateJsObj()();
var fn = function(c, sd, vs, ve) {
var cp = @com.ait.toolkit.sencha.ext.ux.calendar.client.CalendarPanel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(c);
var event = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.DateChangeEvent::new(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel;Lcom/google/gwt/core/client/JsDate;Lcom/google/gwt/core/client/JsDate;Lcom/google/gwt/core/client/JsDate;Lcom/google/gwt/core/client/JavaScriptObject;)(cp,sd, vs, ve ,null);
handler.@com.ait.toolkit.sencha.ext.ux.calendar.client.events.DateChangeHandler::onDateChange(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/events/DateChangeEvent;)(event);
};
var eventName = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.DateChangeEvent::EVENT_NAME;
component.addListener(eventName, fn);
var toReturn = @com.ait.toolkit.sencha.ext.client.events.HandlerRegistration::new(Lcom/ait/toolkit/sencha/ext/client/core/Component;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)(this,eventName,fn);
return toReturn;
}-*/;
public native HandlerRegistration addDayClickHandler( DayClickHandler handler )/*-{
var component = this.@com.ait.toolkit.sencha.ext.client.core.Component::getOrCreateJsObj()();
var fn = function(c, dt, allDay, el) {
var cp = @com.ait.toolkit.sencha.ext.ux.calendar.client.CalendarPanel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(c);
var element = @com.ait.toolkit.sencha.shared.client.dom.ExtElement::new(Lcom/google/gwt/core/client/JavaScriptObject;)(el);
var event = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.DayClickEvent::new(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel;Lcom/google/gwt/core/client/JsDate;ZLcom/ait/toolkit/sencha/shared/client/dom/ExtElement;Lcom/google/gwt/core/client/JavaScriptObject;)(cp,dt, allDay,element, null);
handler.@com.ait.toolkit.sencha.ext.ux.calendar.client.events.DayClickHandler::onDayClick(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/events/DayClickEvent;)(event);
};
var eventName = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.DayClickEvent::EVENT_NAME;
component.addListener(eventName, fn);
var toReturn = @com.ait.toolkit.sencha.ext.client.events.HandlerRegistration::new(Lcom/ait/toolkit/sencha/ext/client/core/Component;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)(this,eventName,fn);
return toReturn;
}-*/;
public native HandlerRegistration addDayOutHandler( DayOutHandler handler )/*-{
var component = this.@com.ait.toolkit.sencha.ext.client.core.Component::getOrCreateJsObj()();
var fn = function(c, dt, el) {
var cp = @com.ait.toolkit.sencha.ext.ux.calendar.client.CalendarPanel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(c);
var element = @com.ait.toolkit.sencha.shared.client.dom.ExtElement::new(Lcom/google/gwt/core/client/JavaScriptObject;)(el);
var event = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.DayOutEvent::new(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel;Lcom/google/gwt/core/client/JsDate;Lcom/ait/toolkit/sencha/shared/client/dom/ExtElement;Lcom/google/gwt/core/client/JavaScriptObject;)(cp, element,null);
handler.@com.ait.toolkit.sencha.ext.ux.calendar.client.events.DayOutHandler::onDayOut(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/events/DayOutEvent;)(event);
};
var eventName = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.DayOutEvent::EVENT_NAME;
component.addListener(eventName, fn);
var toReturn = @com.ait.toolkit.sencha.ext.client.events.HandlerRegistration::new(Lcom/ait/toolkit/sencha/ext/client/core/Component;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)(this,eventName,fn);
return toReturn;
}-*/;
public native HandlerRegistration addDayOverHandler( DayOverHandler handler )/*-{
var component = this.@com.ait.toolkit.sencha.ext.client.core.Component::getOrCreateJsObj()();
var fn = function(c, dt, el) {
var cp = @com.ait.toolkit.sencha.ext.ux.calendar.client.CalendarPanel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(c);
var element = @com.ait.toolkit.sencha.shared.client.dom.ExtElement::new(Lcom/google/gwt/core/client/JavaScriptObject;)(el);
var event = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.DayOverEvent::new(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel;Lcom/google/gwt/core/client/JsDate;Lcom/ait/toolkit/sencha/shared/client/dom/ExtElement;Lcom/google/gwt/core/client/JavaScriptObject;)(cp, element,null);
handler.@com.ait.toolkit.sencha.ext.ux.calendar.client.events.DayOverHandler::onDayOver(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/events/DayOverEvent;)(event);
};
var eventName = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.DayOverEvent::EVENT_NAME;
component.addListener(eventName, fn);
var toReturn = @com.ait.toolkit.sencha.ext.client.events.HandlerRegistration::new(Lcom/ait/toolkit/sencha/ext/client/core/Component;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)(this,eventName,fn);
return toReturn;
}-*/;
public native HandlerRegistration addEditDetailsHandler( EditDetailsHandler handler )/*-{
var component = this.@com.ait.toolkit.sencha.ext.client.core.Component::getOrCreateJsObj()();
var fn = function(c, v, r, el) {
var cp = @com.ait.toolkit.sencha.ext.ux.calendar.client.CalendarPanel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(c);
var element = @com.ait.toolkit.sencha.shared.client.dom.ExtElement::new(Lcom/google/gwt/core/client/JavaScriptObject;)(el);
var view = @com.ait.toolkit.sencha.ext.ux.calendar.client.views.AbstractCalendarView::new(Lcom/google/gwt/core/client/JavaScriptObject;)(v);
var ev = @com.ait.toolkit.sencha.ext.ux.calendar.client.data.CalendarEvent::new(Lcom/google/gwt/core/client/JavaScriptObject;)(r);
var event = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.EditDetailsEvent::new(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel;Lcom/ait/toolkit/sencha/ext/ux/calendar/client/views/AbstractCalendarView;Lcom/ait/toolkit/sencha/ext/ux/calendar/client/data/CalendarEvent;Lcom/ait/toolkit/sencha/shared/client/dom/ExtElement;Lcom/google/gwt/core/client/JavaScriptObject;)(cp,view,ev,element,null);
handler.@com.ait.toolkit.sencha.ext.ux.calendar.client.events.EditDetailsHandler::onEditDetails(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/events/EditDetailsEvent;)(event);
};
var eventName = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.EditDetailsEvent::EVENT_NAME;
component.addListener(eventName, fn);
var toReturn = @com.ait.toolkit.sencha.ext.client.events.HandlerRegistration::new(Lcom/ait/toolkit/sencha/ext/client/core/Component;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)(this,eventName,fn);
return toReturn;
}-*/;
public native HandlerRegistration addEventAddHandler( EventAddHandler handler )/*-{
var component = this.@com.ait.toolkit.sencha.ext.client.core.Component::getOrCreateJsObj()();
var fn = function(c, r) {
var cp = @com.ait.toolkit.sencha.ext.ux.calendar.client.CalendarPanel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(c);
var rec = @com.ait.toolkit.sencha.ext.ux.calendar.client.data.CalendarEvent::create(Lcom/google/gwt/core/client/JavaScriptObject;)(r);
var event = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventAddEvent::new(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel;Lcom/ait/toolkit/sencha/ext/ux/calendar/client/data/CalendarEvent;Lcom/google/gwt/core/client/JavaScriptObject;)(cp,rec,null);
return handler.@com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventAddHandler::onEventAdd(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/events/EventAddEvent;)(event);
};
var eventName = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventAddEvent::EVENT_NAME;
component.addListener(eventName, fn);
var toReturn = @com.ait.toolkit.sencha.ext.client.events.HandlerRegistration::new(Lcom/ait/toolkit/sencha/ext/client/core/Component;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)(this,eventName,fn);
return toReturn;
}-*/;
public native HandlerRegistration addEventCancelHandler( EventCancelHandler handler )/*-{
var component = this.@com.ait.toolkit.sencha.ext.client.core.Component::getOrCreateJsObj()();
var fn = function(c, r) {
var cp = @com.ait.toolkit.sencha.ext.ux.calendar.client.CalendarPanel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(c);
var rec = @com.ait.toolkit.sencha.ext.ux.calendar.client.data.CalendarEvent::create(Lcom/google/gwt/core/client/JavaScriptObject;)(r);
var event = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventCancelEvent::new(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel;Lcom/ait/toolkit/sencha/ext/ux/calendar/client/data/CalendarEvent;Lcom/google/gwt/core/client/JavaScriptObject;)(cp,rec,null);
return handler.@com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventCancelHandler::onEventCancel(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/events/EventCancelEvent;)(event);
};
var eventName = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventCancelEvent::EVENT_NAME;
component.addListener(eventName, fn);
var toReturn = @com.ait.toolkit.sencha.ext.client.events.HandlerRegistration::new(Lcom/ait/toolkit/sencha/ext/client/core/Component;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)(this,eventName,fn);
return toReturn;
}-*/;
public native HandlerRegistration addEventClickHandler( EventClickHandler handler )/*-{
var component = this.@com.ait.toolkit.sencha.ext.client.core.Component::getOrCreateJsObj()();
var fn = function(c, r, el) {
var cp = @com.ait.toolkit.sencha.ext.ux.calendar.client.CalendarPanel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(c);
var rec = @com.ait.toolkit.sencha.ext.ux.calendar.client.data.CalendarEvent::create(Lcom/google/gwt/core/client/JavaScriptObject;)(r);
var event = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventClickEvent::new(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel;Lcom/ait/toolkit/sencha/ext/ux/calendar/client/data/CalendarEvent;Lcom/google/gwt/dom/client/Element;Lcom/google/gwt/core/client/JavaScriptObject;)(cp,rec,el,null);
return handler.@com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventClickHandler::onEventClick(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/events/EventClickEvent;)(event);
};
var eventName = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventClickEvent::EVENT_NAME;
component.addListener(eventName, fn);
var toReturn = @com.ait.toolkit.sencha.ext.client.events.HandlerRegistration::new(Lcom/ait/toolkit/sencha/ext/client/core/Component;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)(this,eventName,fn);
return toReturn;
}-*/;
public native HandlerRegistration addEventMoveHandler( EventMoveHandler handler )/*-{
var component = this.@com.ait.toolkit.sencha.ext.client.core.Component::getOrCreateJsObj()();
var fn = function(c, r) {
var cp = @com.ait.toolkit.sencha.ext.ux.calendar.client.CalendarPanel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(c);
var rec = @com.ait.toolkit.sencha.ext.ux.calendar.client.data.CalendarEvent::create(Lcom/google/gwt/core/client/JavaScriptObject;)(r);
var event = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventMoveEvent::new(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel;Lcom/ait/toolkit/sencha/ext/ux/calendar/client/data/CalendarEvent;Lcom/google/gwt/core/client/JavaScriptObject;)(cp,rec,null);
handler.@com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventMoveHandler::onEventMove(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/events/EventMoveEvent;)(event);
};
var eventName = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventMoveEvent::EVENT_NAME;
component.addListener(eventName, fn);
var toReturn = @com.ait.toolkit.sencha.ext.client.events.HandlerRegistration::new(Lcom/ait/toolkit/sencha/ext/client/core/Component;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)(this,eventName,fn);
return toReturn;
}-*/;
public native HandlerRegistration addEventOutHandler( EventOutHandler handler )/*-{
var component = this.@com.ait.toolkit.sencha.ext.client.core.Component::getOrCreateJsObj()();
var fn = function(c, r, el) {
var cp = @com.ait.toolkit.sencha.ext.ux.calendar.client.CalendarPanel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(c);
var rec = @com.ait.toolkit.sencha.ext.ux.calendar.client.data.CalendarEvent::create(Lcom/google/gwt/core/client/JavaScriptObject;)(r);
var event = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventOutEvent::new(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel;Lcom/ait/toolkit/sencha/ext/ux/calendar/client/data/CalendarEvent;Lcom/google/gwt/dom/client/Element;Lcom/google/gwt/core/client/JavaScriptObject;)(cp, rec, el, null);
handler.@com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventOutHandler::onEventOut(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/events/EventOutEvent;)(event);
};
var eventName = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventOutEvent::EVENT_NAME;
component.addListener(eventName, fn);
var toReturn = @com.ait.toolkit.sencha.ext.client.events.HandlerRegistration::new(Lcom/ait/toolkit/sencha/ext/client/core/Component;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)(this,eventName,fn);
return toReturn;
}-*/;
public native HandlerRegistration addEventOverHandler( EventOverHandler handler )/*-{
var component = this.@com.ait.toolkit.sencha.ext.client.core.Component::getOrCreateJsObj()();
var fn = function(c, r, el) {
var cp = @com.ait.toolkit.sencha.ext.ux.calendar.client.CalendarPanel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(c);
var rec = @com.ait.toolkit.sencha.ext.ux.calendar.client.data.CalendarEvent::create(Lcom/google/gwt/core/client/JavaScriptObject;)(r);
var event = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventOverEvent::new(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel;Lcom/ait/toolkit/sencha/ext/ux/calendar/client/data/CalendarEvent;Lcom/google/gwt/dom/client/Element;Lcom/google/gwt/core/client/JavaScriptObject;)(cp, rec, el, null);
handler.@com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventOverHandler::onEventOver(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/events/EventOverEvent;)(event);
};
var eventName = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventOverEvent::EVENT_NAME;
component.addListener(eventName, fn);
var toReturn = @com.ait.toolkit.sencha.ext.client.events.HandlerRegistration::new(Lcom/ait/toolkit/sencha/ext/client/core/Component;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)(this,eventName,fn);
return toReturn;
}-*/;
public native HandlerRegistration addEventResizeHandler( EventResizeHandler handler )/*-{
var component = this.@com.ait.toolkit.sencha.ext.client.core.Component::getOrCreateJsObj()();
var fn = function(c, r) {
var cp = @com.ait.toolkit.sencha.ext.ux.calendar.client.CalendarPanel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(c);
var rec = @com.ait.toolkit.sencha.ext.ux.calendar.client.data.CalendarEvent::create(Lcom/google/gwt/core/client/JavaScriptObject;)(r);
var event = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventResizeEvent::new(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel;Lcom/ait/toolkit/sencha/ext/ux/calendar/client/data/CalendarEvent;Lcom/google/gwt/core/client/JavaScriptObject;)(cp,rec,null);
handler.@com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventResizeHandler::onEventResize(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/events/EventResizeEvent;)(event);
};
var eventName = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventResizeEvent::EVENT_NAME;
component.addListener(eventName, fn);
var toReturn = @com.ait.toolkit.sencha.ext.client.events.HandlerRegistration::new(Lcom/ait/toolkit/sencha/ext/client/core/Component;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)(this,eventName,fn);
return toReturn;
}-*/;
public native HandlerRegistration addEventsRenderedHandler( EventsRenderedHandler handler )/*-{
var component = this.@com.ait.toolkit.sencha.ext.client.core.Component::getOrCreateJsObj()();
var fn = function(c) {
var cp = @com.ait.toolkit.sencha.ext.ux.calendar.client.CalendarPanel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(c);
var event = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventsRenderedEvent::new(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel;Lcom/google/gwt/core/client/JavaScriptObject;)(cp,null);
handler.@com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventsRenderedHandler::onEventsRendered(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/events/EventsRenderedEvent;)(event);
};
var eventName = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventsRenderedEvent::EVENT_NAME;
component.addListener(eventName, fn);
var toReturn = @com.ait.toolkit.sencha.ext.client.events.HandlerRegistration::new(Lcom/ait/toolkit/sencha/ext/client/core/Component;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)(this,eventName,fn);
return toReturn;
}-*/;
public native HandlerRegistration addInitDragHandler( InitDragHandler handler )/*-{
var component = this.@com.ait.toolkit.sencha.ext.client.core.Component::getOrCreateJsObj()();
var fn = function(c) {
var cp = @com.ait.toolkit.sencha.ext.ux.calendar.client.CalendarPanel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(c);
var event = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.InitDragEvent::new(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel;Lcom/google/gwt/core/client/JavaScriptObject;)(cp,null);
handler.@com.ait.toolkit.sencha.ext.ux.calendar.client.events.InitDragHandler::onInitDrag(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/events/EventsRenderedEvent;)(event);
};
var eventName = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.InitDragEvent::EVENT_NAME;
component.addListener(eventName, fn);
var toReturn = @com.ait.toolkit.sencha.ext.client.events.HandlerRegistration::new(Lcom/ait/toolkit/sencha/ext/client/core/Component;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)(this,eventName,fn);
return toReturn;
}-*/;
public native HandlerRegistration addViewChangeHandler( ViewChangeHandler handler )/*-{
var component = this.@com.ait.toolkit.sencha.ext.client.core.Component::getOrCreateJsObj()();
var fn = function(c, v, i) {
var cp = @com.ait.toolkit.sencha.ext.ux.calendar.client.CalendarPanel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(c);
var view = @com.ait.toolkit.sencha.ext.ux.calendar.client.views.AbstractCalendarView::new(Lcom/google/gwt/core/client/JavaScriptObject;)(v);
var info = @com.ait.toolkit.sencha.ext.ux.calendar.client.data.ViewInfo::new(Lcom/google/gwt/core/client/JavaScriptObject;)(v);
var event = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.ViewChangeEvent::new(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel;Lcom/ait/toolkit/sencha/ext/ux/calendar/client/views/AbstractCalendarView;Lcom/ait/toolkit/sencha/ext/ux/calendar/client/data/ViewInfo;Lcom/google/gwt/core/client/JavaScriptObject;)(cp,view, info, null);
handler.@com.ait.toolkit.sencha.ext.ux.calendar.client.events.ViewChangeHandler::onViewChange(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/events/ViewChangeEvent;)(event);
};
var eventName = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.ViewChangeEvent::EVENT_NAME;
component.addListener(eventName, fn);
var toReturn = @com.ait.toolkit.sencha.ext.client.events.HandlerRegistration::new(Lcom/ait/toolkit/sencha/ext/client/core/Component;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)(this,eventName,fn);
return toReturn;
}-*/;
public native HandlerRegistration addEventUpdateHandler( EventUpdateHandler handler )/*-{
var component = this.@com.ait.toolkit.sencha.ext.client.core.Component::getOrCreateJsObj()();
var fn = function(c, r) {
var cp = @com.ait.toolkit.sencha.ext.ux.calendar.client.CalendarPanel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(c);
var rec = @com.ait.toolkit.sencha.ext.ux.calendar.client.data.CalendarEvent::create(Lcom/google/gwt/core/client/JavaScriptObject;)(r);
var event = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventUpdateEvent::new(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel;Lcom/ait/toolkit/sencha/ext/ux/calendar/client/data/CalendarEvent;Lcom/google/gwt/core/client/JavaScriptObject;)(cp,rec,null);
handler.@com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventUpdateHandler::onEventUpdate(Lcom/ait/toolkit/sencha/ext/ux/calendar/client/events/EventUpdateEvent;)(event);
};
var eventName = @com.ait.toolkit.sencha.ext.ux.calendar.client.events.EventUpdateEvent::EVENT_NAME;
component.addListener(eventName, fn);
var toReturn = @com.ait.toolkit.sencha.ext.client.events.HandlerRegistration::new(Lcom/ait/toolkit/sencha/ext/client/core/Component;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)(this,eventName,fn);
return toReturn;
}-*/;
// TODO range select event
public static void inject() {
CSSUtil.injectStyleSheet( GWT.getModuleBaseURL()
+ "extensible/css/extensible-all.css", CAL_PANEL_CSS_ID );
calendarScriptElement = ScriptInjector
.fromUrl(
GWT.getModuleBaseURL() + "extensible/extensible-all.js" )
.setWindow( ScriptInjector.TOP_WINDOW )
.setCallback( new Callback<Void, Exception>() {
@Override
public void onSuccess( Void result ) {
JsoHelper.setAttribute( calendarScriptElement, "id",
CAL_PANEL_JS_ID );
}
@Override
public void onFailure( Exception reason ) {
}
} ).inject();
}
public static void removeRessources() {
DOM.getElementById( CAL_PANEL_JS_ID ).removeFromParent();
DOM.getElementById( CAL_PANEL_CSS_ID ).removeFromParent();
}
}
|
ahome-it/ahome-ext-ux
|
ahome-ext-ux/src/main/java/com/ait/toolkit/sencha/ext/ux/calendar/client/CalendarPanel.java
|
Java
|
apache-2.0
| 38,400
|
---
layout: default
title: "关于"
description: "Hi, Welcome!!!"
header-img: "img/about-bg.jpg"
---
<!-- Page Header -->
<header class="intro-header" style="background-image: url('{{ site.baseurl }}/{% if page.header-img %}{{ page.header-img }}{% else %}{{ site.header-img }}{% endif %}')">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="site-heading" id="tag-heading">
<!--
<h1>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</h1>
-->
<br></br>
<br></br>
<h1 style="font-size:45px">大道如青天</h1>
<span class="subheading">{{ page.description }}</span>
<br></br>
<br></br>
</div>
</div>
</div>
</div>
</header>
<!-- Language Selector -->
<!--
<select class="sel-lang" onchange= "onLanChange(this.options[this.options.selectedIndex].value)">
<option value="0" selected> 中文 Chinese </option>
<option value="1"> 英文 English </option>
</select>
<!-- Chinese Version -->
<div class="zh post-container">
<!--copied from markdown -->
<!--
<blockquote><p>It's there!</p></blockquote>
<!--
<p>Hey,我是<strong>黄玄</strong>,程序员 &<a href="http://www.wepiao.com/?r=movie">微票儿</a>前端基础工程团队负责人。</p>
-->
<p align="center"> 一只学生, 活的;</p>
<p align="center"> 七分熟程序员,会修电脑;</p>
<p align="center"> 有一块完整的腹肌,可以跑5Km;</p>
<p align="center"> 想做一个有文化的人,正在念书中;</p>
<!--
<p>一些作品和开源项目,👉 戳 <a href="https://zhuanlan.zhihu.com/p/21280918">演说.io</a>、<a href="/portfolio">Portfolio</a> 与 <a href="http://github.com/huxpro">Github</a>;除了在博客与 <a href="http://zhuanlan.zhihu.com/huxblog">知乎专栏 · 一生想做浪漫极客</a> 写点东西外,我也是 <a href="http://www.gfansub.com/">GDG 字幕组</a> 与 <a href="http://zhuanlan.zhihu.com/FrontendMagazine">前端外刊评论 · 知乎专栏</a> 的翻译维护成员。</p>
#
<p>音乐重度依赖患者,设计师强迫症患者,书买得比看得多患者,毒舌患者,科技产品发布会观看癖患者,间歇性感伤患者,习惯性熬夜患者。</p>
# <h5>Talks</h5>
# <ul>
# <li><a href="//huangxuan.me/2016/11/20/sw-101-gdgdf/">Service Worker 101 · GDG DevFest 2016 北京</a></li>
# <li><a href="//huangxuan.me/2016/10/20/pwa-qcon2016/">Progressive Web Apps,复兴序章 · QCon 上海 2016</a></li>
# </ul>
-->
</div>
<!-- English Version -->
<!--
<div class="en post-container">
<blockquote><p>It's there!</p></blockquote>
<p>A student, Alive</p>
<!--
<p>A Programmer, medium well! I can fix computer</p>
-->
<!--
<p>Hi, I am <strong>Huang Xuan(黄玄)</strong>,you can call me <strong>Hux</strong>. I'm an engineer & a designer who loves to build software such as <a href="http://yanshuo.io">Yanshuo.io</a> and more (<a href="/portfolio">Portfolio 👉</a> and <a href="http://github.com/huxpro">Github 👉</a>). I studied Digital Media Art and graduated from <a href="https://en.wikipedia.org/wiki/Communication_University_of_China">Communication University of China</a> in 2016.</p>
<p>As an engineer, I worked at Wepiao (<a href="https://www.crunchbase.com/organization/wepiao#/entity">see CrunchBase</a>) as the dev lead of Front-End Infrastructure Team, and used to intern at <a href="https://www.alitrip.com/">Alibaba Trip</a> for one year. As a designer, I was offered to be the UI/UX Designer Intern of Alibaba, Microsoft etc.</p>
<p>Moreover, I'm also a translator at <a href="http://www.gfansub.com/">GDG China Subtitle Team</a>, maintainer at <a href="http://zhuanlan.zhihu.com/FrontendMagazine">Frontend Magazine</a> and the owner of <a href="http://zhuanlan.zhihu.com/huxblog">Lifelong Romantic Geek</a>.</p>
<h5>Talks</h5>
<ul>
<li><a href="//huangxuan.me/2016/11/20/sw-101-gdgdf/">Service Worker 101, working offline and instant loading · GDG DevFest 2016 Beijing</a></li>
<li><a href="//huangxuan.me/2016/10/20/pwa-qcon2016/">Progressive Web Apps, make web great again · QCon Shanghai 2016</a></li>
<li><a href="//huangxuan.me/2016/06/05/pwa-in-my-pov/">Progressive Web App in my pov · 2016</a></li>
<li><a href="//huangxuan.me/2015/12/28/css-sucks-2015/">CSS Still Sucks 2015, and how we work around it · 2015</a></li>
<li><a href="//huangxuan.me/2015/07/09/js-module-7day/">JavaScript Modularization Journey · 2015</a></li>
</ul>
</div>
-->
<!-- Handle Language Change -->
<!--
<script type="text/javascript">
// get nodes
var $zh = document.querySelector(".zh");
var $en = document.querySelector(".en");
var $select = document.querySelector("select");
// bind hashchange event
window.addEventListener('hashchange', _render);
// handle render
function _render(){
var _hash = window.location.hash;
// en
if(_hash == "#en"){
$select.selectedIndex = 1;
$en.style.display = "block";
$zh.style.display = "none";
// zh by default
}else{
// not trigger onChange, otherwise cause a loop call.
$select.selectedIndex = 0;
$zh.style.display = "block";
$en.style.display = "none";
}
}
// handle select change
function onLanChange(index){
if(index == 0){
window.location.hash = "#zh"
}else{
window.location.hash = "#en"
}
}
// init
_render();
</script>
-->
{% if site.duoshuo_username %}
<!-- 多说评论框 start -->
<div class="comment">
<!-- This id is used for indexing my loss comments forcedly -->
<div class="ds-thread"
{% if site.duoshuo_username == "huxblog" %}
data-thread-id="1187623191091085319"
{% else %}
<!-- U can just use this key generated to index comments at page about -->
data-thread-key="{{site.duoshuo_username}}/about"
{% endif %}
data-title="{{page.title}}"
data-url="{{site.url}}/about/"></div>
</div>
<!-- 多说评论框 end -->
<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
// dynamic User hacking by Hux
var _user = '{{site.duoshuo_username}}';
// duoshuo comment query.
var duoshuoQuery = {short_name: _user };
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0]
|| document.getElementsByTagName('body')[0]).appendChild(ds);
})();
</script>
<!-- 多说公共JS代码 end -->
{% endif %}
{% if site.disqus_username %}
<!-- disqus 评论框 start -->
<div class="comment">
<div id="disqus_thread" class="disqus-thread">
</div>
</div>
<!-- disqus 评论框 end -->
<!-- disqus 公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES * * */
var disqus_shortname = "{{site.disqus_username}}";
var disqus_identifier = "{{site.disqus_username}}/{{page.url}}";
var disqus_url = "{{site.url}}{{page.url}}";
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<!-- disqus 公共JS代码 end -->
{% endif %}
|
sophon250/sophon250.github.io
|
关于.html
|
HTML
|
apache-2.0
| 7,997
|
---
type: post121
title: Notify Container
categories: XAP121
parent: event-processing.html
weight: 200
---
The notify event container uses the space inherited support for notifications (continuous query) using an XAP unified event session API.
A notify event operation is mainly used when simulating Topic semantics.
<br>
{{%fpanel%}}
[Overview](./notify-container.html){{<wbr>}}
The notify event container wraps the Space data event session API with event container abstraction.
[Transaction support](./polling-container-transactions.html){{<wbr>}}
The notify container can be configured with transaction support, so the event action can be performed under a transaction.
[Session Based Messaging API](./session-based-messaging-api.html){{<wbr>}}
The Notify Session API provides a unified and consistent mechanism for event registration.
{{%/fpanel%}}
<br>
#### Additional Resources
{{%youtube "GwLfDYgl6f8" "Event Processing"%}}
|
croffler/documentation
|
sites/xap-docs/content/xap121/notify-container-overview.markdown
|
Markdown
|
apache-2.0
| 944
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/application-autoscaling/ApplicationAutoScaling_EXPORTS.h>
#include <aws/core/AmazonSerializableWebServiceRequest.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <aws/core/http/HttpRequest.h>
namespace Aws
{
namespace ApplicationAutoScaling
{
class AWS_APPLICATIONAUTOSCALING_API ApplicationAutoScalingRequest : public Aws::AmazonSerializableWebServiceRequest
{
public:
virtual ~ApplicationAutoScalingRequest () {}
void AddParametersToRequest(Aws::Http::HttpRequest& httpRequest) const { AWS_UNREFERENCED_PARAM(httpRequest); }
inline Aws::Http::HeaderValueCollection GetHeaders() const override
{
auto headers = GetRequestSpecificHeaders();
if(headers.size() == 0 || (headers.size() > 0 && headers.count(Aws::Http::CONTENT_TYPE_HEADER) == 0))
{
headers.emplace(Aws::Http::HeaderValuePair(Aws::Http::CONTENT_TYPE_HEADER, Aws::AMZN_JSON_CONTENT_TYPE_1_1 ));
}
headers.emplace(Aws::Http::HeaderValuePair(Aws::Http::API_VERSION_HEADER, "2016-02-06"));
return headers;
}
protected:
virtual Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const { return Aws::Http::HeaderValueCollection(); }
};
} // namespace ApplicationAutoScaling
} // namespace Aws
|
cedral/aws-sdk-cpp
|
aws-cpp-sdk-application-autoscaling/include/aws/application-autoscaling/ApplicationAutoScalingRequest.h
|
C
|
apache-2.0
| 1,857
|
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" />
<link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/>
<link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/>
<!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]-->
<style type="text/css" media="all">
@import url('../../../../../style.css');
@import url('../../../../../tree.css');
</style>
<script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script>
<script src="../../../../../package-nodes-tree.js" type="text/javascript"></script>
<script src="../../../../../clover-tree.js" type="text/javascript"></script>
<script src="../../../../../clover.js" type="text/javascript"></script>
<script src="../../../../../clover-descriptions.js" type="text/javascript"></script>
<script src="../../../../../cloud.js" type="text/javascript"></script>
<title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title>
</head>
<body>
<div id="page">
<header id="header" role="banner">
<nav class="aui-header aui-dropdown2-trigger-group" role="navigation">
<div class="aui-header-inner">
<div class="aui-header-primary">
<h1 id="logo" class="aui-header-logo aui-header-logo-clover">
<a href="http://openclover.org" title="Visit OpenClover home page"><span class="aui-header-logo-device">OpenClover</span></a>
</h1>
</div>
<div class="aui-header-secondary">
<ul class="aui-nav">
<li id="system-help-menu">
<a class="aui-nav-link" title="Open online documentation" target="_blank"
href="http://openclover.org/documentation">
<span class="aui-icon aui-icon-small aui-iconfont-help"> Help</span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="aui-page-panel">
<div class="aui-page-panel-inner">
<div class="aui-page-panel-nav aui-page-panel-nav-clover">
<div class="aui-page-header-inner" style="margin-bottom: 20px;">
<div class="aui-page-header-image">
<a href="http://cardatechnologies.com" target="_top">
<div class="aui-avatar aui-avatar-large aui-avatar-project">
<div class="aui-avatar-inner">
<img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/>
</div>
</div>
</a>
</div>
<div class="aui-page-header-main" >
<h1>
<a href="http://cardatechnologies.com" target="_top">
ABA Route Transit Number Validator 1.0.1-SNAPSHOT
</a>
</h1>
</div>
</div>
<nav class="aui-navgroup aui-navgroup-vertical">
<div class="aui-navgroup-inner">
<ul class="aui-nav">
<li class="">
<a href="../../../../../dashboard.html">Project overview</a>
</li>
</ul>
<div class="aui-nav-heading packages-nav-heading">
<strong>Packages</strong>
</div>
<div class="aui-nav project-packages">
<form method="get" action="#" class="aui package-filter-container">
<input type="text" autocomplete="off" class="package-filter text"
placeholder="Type to filter packages..." name="package-filter" id="package-filter"
title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/>
</form>
<p class="package-filter-no-results-message hidden">
<small>No results found.</small>
</p>
<div class="packages-tree-wrapper" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator">
<div class="packages-tree-container"></div>
<div class="clover-packages-lozenges"></div>
</div>
</div>
</div>
</nav> </div>
<section class="aui-page-panel-content">
<div class="aui-page-panel-content-clover">
<div class="aui-page-header-main"><ol class="aui-nav aui-nav-breadcrumbs">
<li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li>
<li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li>
<li><a href="test-Test_AbaRouteValidator_12.html">Class Test_AbaRouteValidator_12</a></li>
</ol></div>
<h1 class="aui-h2-clover">
Test testAbaNumberCheck_25820_bad
</h1>
<table class="aui">
<thead>
<tr>
<th>Test</th>
<th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th>
<th><label title="When the test execution was started">Start time</label></th>
<th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th>
<th><label title="A failure or error message if the test is not successful.">Message</label></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_12.html?line=19744#src-19744" >testAbaNumberCheck_25820_bad</a>
</td>
<td>
<span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span>
</td>
<td>
7 Aug 12:41:34
</td>
<td>
0.0 </td>
<td>
<div></div>
<div class="errorMessage"></div>
</td>
</tr>
</tbody>
</table>
<div> </div>
<table class="aui aui-table-sortable">
<thead>
<tr>
<th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th>
<th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> testAbaNumberCheck_25820_bad</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.exceptions.AbaRouteValidationException</span>
  <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/exceptions/AbaRouteValidationException.html?id=31775#AbaRouteValidationException" title="AbaRouteValidationException" name="sl-43">com.cardatechnologies.utils.validators.abaroutevalidator.exceptions.AbaRouteValidationException</a>
</td>
<td>
<span class="sortValue">0.5714286</span>57.1%
</td>
<td class="align-middle" style="width: 100%" colspan="3">
<div>
<div title="57.1% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:57.1%"></div></div></div> </td>
</tr>
<tr>
<td>
<span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.ErrorCodes</span>
  <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/ErrorCodes.html?id=31775#ErrorCodes" title="ErrorCodes" name="sl-42">com.cardatechnologies.utils.validators.abaroutevalidator.ErrorCodes</a>
</td>
<td>
<span class="sortValue">0.5714286</span>57.1%
</td>
<td class="align-middle" style="width: 100%" colspan="3">
<div>
<div title="57.1% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:57.1%"></div></div></div> </td>
</tr>
<tr>
<td>
<span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span>
  <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=31775#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a>
</td>
<td>
<span class="sortValue">0.29411766</span>29.4%
</td>
<td class="align-middle" style="width: 100%" colspan="3">
<div>
<div title="29.4% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:29.4%"></div></div></div> </td>
</tr>
</tbody>
</table>
</div> <!-- class="aui-page-panel-content-clover" -->
<footer id="footer" role="contentinfo">
<section class="footer-body">
<ul>
<li>
Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1
on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT.
</li>
</ul>
<ul>
<li>OpenClover is free and open-source software. </li>
</ul>
</section>
</footer> </section> <!-- class="aui-page-panel-content" -->
</div> <!-- class="aui-page-panel-inner" -->
</div> <!-- class="aui-page-panel" -->
</div> <!-- id="page" -->
</body>
</html>
|
dcarda/aba.route.validator
|
target13/site/clover/com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_12_testAbaNumberCheck_25820_bad_oin.html
|
HTML
|
apache-2.0
| 10,987
|
# Suteria fluminensis (Vell.) Mart. SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Rubiaceae/Psychotria/Psychotria fluminensis/ Syn. Suteria fluminensis/README.md
|
Markdown
|
apache-2.0
| 190
|
# Vaadin Icons
> ⚠️ Starting from Vaadin 20, the source code and issues for this component are migrated to the [`vaadin/web-components`](https://github.com/vaadin/web-components/tree/master/packages/vaadin-icons) monorepository.
> This repository contains the source code and releases of `<vaadin-icons>` for the Vaadin versions 10 to 19.
[](https://www.npmjs.com/package/@vaadin/vaadin-icons)
[](https://github.com/vaadin/vaadin-icons/releases)
[](https://www.webcomponents.org/element/vaadin/vaadin-icons)
[](https://travis-ci.org/vaadin/vaadin-icons)
[](https://gitter.im/vaadin/web-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[](https://vaadin.com/directory/component/vaadinvaadin-icons)
[](https://vaadin.com/directory/component/vaadinvaadin-icons)
[<img src="https://raw.github.com/vaadin/vaadin-icons/master/screenshot.png" width="611" alt="Screenshot of some icons in the Vaadin Icons collection" />](https://vaadin.com/icons)
[Vaadin Icons](https://vaadin.com/icons) is a set of 600+ icons designed for web applications. Free to use, anywhere!
Visit **https://vaadin.com/icons** for more information and instructions how to get started using them.
## Installation
The Vaadin components are distributed as Bower and npm packages.
Please note that the version range is the same, as the API has not changed.
You should not mix Bower and npm versions in the same application, though.
Unlike the official Polymer Elements, the converted Polymer 3 compatible Vaadin components
are only published on npm, not pushed to GitHub repositories.
### Polymer 2 and HTML Imports compatible version
Install `vaadin-icons`:
```sh
bower i vaadin/vaadin-icons --save
```
Once installed, import it in your application:
```html
<link rel="import" href="bower_components/vaadin-icons/vaadin-icons.html">
```
### Polymer 3 and ES Modules compatible version
Install `vaadin-icons`:
```sh
npm i @vaadin/vaadin-icons --save
```
Once installed, import it in your application:
```js
import '@vaadin/vaadin-icons/vaadin-icons.js';
```
## Running demos in browser
1. Install [polymer-cli](https://www.npmjs.com/package/polymer-cli): `npm install -g polymer-cli`
1. When in the `vaadin-icons` directory, run `bower install` to install Bower dependencies
1. Run `npm start`, after that you will be able to access:
- http://127.0.0.1:3000/components/vaadin-icons/demo
## License
The icon files (SVG, PNG, fonts) are licensed under Creative Commons [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/) license.
The source code in this repository is licensed under Apache License 2.0.
All brand icons are trademarks of their respective owners.
The use of these trademarks does not indicate endorsement of the trademark holder by Vaadin Icons, nor vice versa.
|
vaadin/vaadin-icons
|
README.md
|
Markdown
|
apache-2.0
| 3,360
|
/**
* _____ _____ _____ _____ __ _____ _____ _____ _____
* | __| | | | | | | | | __| | |
* |__ | | | | | | | | | |__| | | | |- -| --|
* |_____|_____|_|_|_|_____| |_____|_____|_____|_____|_____|
*
* UNICORNS AT WARP SPEED SINCE 2010
*
* 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.
*/
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace SumoLogic.Logging.AspNetCore.Example
{
public class Program
{
public static void Main(string[] args)
{
var webHost = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.ConfigureAppConfiguration((hostingContext, config) =>
{
var env = hostingContext.HostingEnvironment;
config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true).AddEnvironmentVariables();
})
#if USE_BUILDER
.ConfigureLogging((hostingContext, logging) =>
{
logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
logging.AddConsole();
logging.AddDebug();
logging.AddSumoLogic("https://collectors.us2.sumologic.com/receiver/v1/http/your_endpoint_here==");
logging.AddEventSourceLogger();
})
#endif
.UseStartup<Startup>()
.Build();
webHost.Run();
}
}
}
|
SumoLogic/sumologic-net-appenders
|
SumoLogic.Logging.AspNetCore.Example/Program.cs
|
C#
|
apache-2.0
| 2,419
|
# Laserpitium aciphylla L.f. SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Apiales/Apiaceae/Laserpitium/Laserpitium aciphylla/README.md
|
Markdown
|
apache-2.0
| 184
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.