code stringlengths 1 2.01M | repo_name stringlengths 3 62 | path stringlengths 1 267 | language stringclasses 231
values | license stringclasses 13
values | size int64 1 2.01M |
|---|---|---|---|---|---|
package com.zyeeda.framework.validation;
import javax.validation.ValidatorFactory;
import com.zyeeda.framework.service.Service;
public interface ValidationService extends Service {
public ValidatorFactory getPreInsertValidatorFactory();
public ValidatorFactory getPreUpdateValidatorFactory();
public Validato... | zyeeda-framework | core/src/main/java/com/zyeeda/framework/validation/ValidationService.java | Java | asf20 | 364 |
package com.zyeeda.framework.security.annotations;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy... | zyeeda-framework | core/src/main/java/com/zyeeda/framework/security/annotations/Virtual.java | Java | asf20 | 378 |
package com.zyeeda.framework.security.internal;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
import org.apache.tapestry5.ioc.annotations.Marker;
import org.apache.tapestry5.ioc.annotations.Primary;
import org.apache.tapestry5.ioc.annotations.ServiceId;
... | zyeeda-framework | core/src/main/java/com/zyeeda/framework/security/internal/OpenIdConsumerSecurityServiceProvider.java | Java | asf20 | 1,089 |
package com.zyeeda.framework.security.internal;
import org.apache.shiro.mgt.DefaultSecurityManager;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.tapestry5.ioc.annotations.Marker;
import org.apache.tapestry5.ioc.annotations.ServiceId;
import org.apache.tapestry5.ioc.services.RegistryShutdownHub;... | zyeeda-framework | core/src/main/java/com/zyeeda/framework/security/internal/VirtualConsumerSecurityServiceProvider.java | Java | asf20 | 1,087 |
package com.zyeeda.framework.security.internal;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
import org.apache.tapestry5.ioc.annotations.Marker;
import org.apache.tapestry5.ioc.annotations.Primary;
import org.apache.tapestry5.ioc.annotations.ServiceId;
... | zyeeda-framework | core/src/main/java/com/zyeeda/framework/security/internal/OpenIdProviderSecurityServiceProvider.java | Java | asf20 | 1,240 |
package com.zyeeda.framework.security.internal;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.tapestry5.ioc.services.RegistryShutdownHub;
import com.zyeeda.fr... | zyeeda-framework | core/src/main/java/com/zyeeda/framework/security/internal/AbstractSecurityServiceProvider.java | Java | asf20 | 998 |
package com.zyeeda.framework.security.realms;
import java.io.IOException;
import javax.naming.NamingException;
import javax.naming.ldap.LdapContext;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
im... | zyeeda-framework | core/src/main/java/com/zyeeda/framework/security/realms/LdapRealm.java | Java | asf20 | 2,121 |
package com.zyeeda.framework.security.realms;
import java.io.IOException;
import javax.naming.NamingException;
import javax.naming.ldap.LdapContext;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
im... | zyeeda-framework | core/src/main/java/com/zyeeda/framework/security/realms/ShiroCombinedRealm.java | Java | asf20 | 2,724 |
package com.zyeeda.framework.security;
import com.zyeeda.framework.service.Service;
public interface SecurityService<T> extends Service {
public T getSecurityManager();
public String getCurrentUser();
}
| zyeeda-framework | core/src/main/java/com/zyeeda/framework/security/SecurityService.java | Java | asf20 | 225 |
/**
*
*/
package com.zyeeda.framework.ftp;
import java.io.IOException;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPFile;
import com.zyeeda.framework.ftp.internal.FtpConnectionRefusedException;
import com.zyeeda.framework.ftp.internal.FtpServerLoginFailedException;
import com.... | zyeeda-framework | core/src/main/java/com/zyeeda/framework/ftp/FtpService.java | Java | asf20 | 815 |
package com.zyeeda.framework.ftp.internal;
public class FtpConnectionRefusedException extends Exception {
private static final long serialVersionUID = 3210431136164484133L;
public FtpConnectionRefusedException(String msg) {
super(msg);
}
}
| zyeeda-framework | core/src/main/java/com/zyeeda/framework/ftp/internal/FtpConnectionRefusedException.java | Java | asf20 | 248 |
/**
*
*/
package com.zyeeda.framework.ftp.internal;
import java.io.IOException;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPReply;
import org.apache.tapestry5.ioc.annotations.Mark... | zyeeda-framework | core/src/main/java/com/zyeeda/framework/ftp/internal/CommonsFtpServiceProvider.java | Java | asf20 | 3,745 |
package com.zyeeda.framework.ftp.internal;
public class FtpServerLoginFailedException extends Exception {
private static final long serialVersionUID = -2706394949864309918L;
public FtpServerLoginFailedException(String msg) {
super(msg);
}
}
| zyeeda-framework | core/src/main/java/com/zyeeda/framework/ftp/internal/FtpServerLoginFailedException.java | Java | asf20 | 249 |
/*
* Copyright 2010 Zyeeda Co. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | zyeeda-framework | core/src/main/java/com/zyeeda/framework/FrameworkConstants.java | Java | asf20 | 858 |
package com.zyeeda.framework.ldap;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.naming.Binding;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.OperationNotSupporte... | zyeeda-framework | core/src/main/java/com/zyeeda/framework/ldap/LdapTemplate.java | Java | asf20 | 11,699 |
package com.zyeeda.framework.ldap;
import java.io.IOException;
import javax.naming.NamingException;
import javax.naming.ldap.LdapContext;
import com.zyeeda.framework.service.Service;
public interface LdapService extends Service {
public LdapContext getLdapContext() throws NamingException;
public L... | zyeeda-framework | core/src/main/java/com/zyeeda/framework/ldap/LdapService.java | Java | asf20 | 424 |
package com.zyeeda.framework.ldap;
import java.util.ArrayList;
import java.util.List;
public class QueryResult<T> {
private Long totalRecords;
private List<T> resultList = new ArrayList<T>();
public Long getTotalRecords() {
return totalRecords;
}
public void setTotalRecords(Long totalRecords) {
... | zyeeda-framework | core/src/main/java/com/zyeeda/framework/ldap/QueryResult.java | Java | asf20 | 519 |
package com.zyeeda.framework.ldap;
public class LdapServiceException extends RuntimeException {
private static final long serialVersionUID = 3829097670222114184L;
public LdapServiceException(String message) {
super(message);
}
}
| zyeeda-framework | core/src/main/java/com/zyeeda/framework/ldap/LdapServiceException.java | Java | asf20 | 239 |
package com.zyeeda.framework.ldap.internal;
import java.io.IOException;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
import javax.naming.lda... | zyeeda-framework | core/src/main/java/com/zyeeda/framework/ldap/internal/SunLdapServiceProvider.java | Java | asf20 | 5,435 |
package com.zyeeda.framework.ldap;
import javax.naming.ldap.Control;
/*
* By default, LDAP compliant directories forbid the deletion of entries with children.
* It is only permitted to delete leaf entries. However the Tree Delete Control provided
* by IBM Tivoli Directory Server 5.2/6.0 extends the delete ... | zyeeda-framework | core/src/main/java/com/zyeeda/framework/ldap/TreeDeleteControl.java | Java | asf20 | 1,682 |
package com.zyeeda.framework.ldap;
import javax.naming.directory.SearchControls;
public class SearchControlsFactory {
public static SearchControls getSearchControls(int scope) {
SearchControls sc = SearchControlsFactory.getDefaultSearchControls();
sc.setSearchScope(scope);
return sc;
}
pub... | zyeeda-framework | core/src/main/java/com/zyeeda/framework/ldap/SearchControlsFactory.java | Java | asf20 | 442 |
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="org.apache.shiro.SecurityUtils" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
用户组织管理... | zyeeda-framework | drivebox/src/main/webapp/index.jsp | Java Server Pages | asf20 | 7,136 |
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="org.apache.shiro.SecurityUtils" %>
<%@ page import="org.openid4java.message.ParameterList"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www... | zyeeda-framework | drivebox/src/main/webapp/provider/signin.jsp | Java Server Pages | asf20 | 3,205 |
<%@ page contentType="application/xrds+xml"%>
<xrds:XRDS xmlns:xrds="xri://$xrds"
xmlns:openid="http://openid.net/xmlns/1.0" xmlns="xri://$xrd*($v*2.0)">
<XRD>
<Service priority="0">
<Type>http://specs.openid.net/auth/2.0/signon</Type>
<Type>http://specs.openid.net/extensio... | zyeeda-framework | drivebox/src/main/webapp/provider/user.jsp | Java Server Pages | asf20 | 1,419 |
@charset "utf-8";
.unlogin {
margin: 0px;
padding: 0px;
background-color:#348bd1;
background-image:url(../images/login_bg.jpg);
background-repeat:no-repeat;
background-position:0px 0px;
background-position:center top;
}
.logined {
margin: 0px;
padding: 0px;
background-color:#FFFFFF;
bac... | zyeeda-framework | drivebox/src/main/webapp/provider/style/login.css | CSS | asf20 | 3,534 |
<%@ page contentType="application/xrds+xml"%>
<xrds:XRDS xmlns:xrds="xri://$xrds"
xmlns:openid="http://openid.net/xmlns/1.0" xmlns="xri://$xrd*($v*2.0)">
<XRD>
<Service priority="0">
<Type>http://specs.openid.net/auth/2.0/server</Type>
<Type>http://specs.openid.net/extensio... | zyeeda-framework | drivebox/src/main/webapp/provider/xrds.jsp | Java Server Pages | asf20 | 1,187 |
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="org.apache.shiro.SecurityUtils"%>
<%
SecurityUtils.getSubject().logout();
/* out.println("已登出"); */
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>该用户已... | zyeeda-framework | drivebox/src/main/webapp/accounts/openid/signout.jsp | Java Server Pages | asf20 | 682 |
<%@ page import="java.util.Map"%>
<%@ page import="org.openid4java.message.AuthRequest"%>
<%@ page import="com.zyeeda.framework.FrameworkConstants" %>
<%@ page import="org.apache.tapestry5.ioc.Registry" %>
<%@ page import="com.zyeeda.framework.security.SecurityService" %>
<%@ page import="com.zyeeda.framework.secu... | zyeeda-framework | drivebox/src/main/webapp/accounts/openid/signin.jsp | Java Server Pages | asf20 | 2,378 |
<!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>
<script type="text/javascript">
function callback() {
var url = '<%= request.getParameter("_url")%>';
... | zyeeda-framework | drivebox/src/main/webapp/accounts/openid/callback.jsp | Java Server Pages | asf20 | 512 |
@charset "utf-8";
body {
margin: 0px;
padding: 0px;
background-color:#348bd1;
/* background-image:url(../img/login_bg.jpg); */
background-repeat:no-repeat;
background-position:0px 0px;
background-position:center top;
}
html{overflow-y:hidden; font-size:12px}
.body_middle{
width:432px;
height:5... | zyeeda-framework | drivebox/src/main/webapp/accounts/openid/style/login2.css | CSS | asf20 | 3,994 |
.unlogin {
margin: 0px;
padding: 0px;
background-color:#FFFFFF;
background-image:url(../img/unlogin_bg.jpg);
background-repeat:no-repeat;
background-position:0px 0px;
background-position:center top;
}
.logined {
margin: 0px;
padding: 0px;
background-color:#FFFFFF;
background-image:url(..... | zyeeda-framework | drivebox/src/main/webapp/accounts/openid/style/login.css | CSS | asf20 | 442 |
<%@ page import="org.apache.tapestry5.ioc.Registry" %>
<%@ page import="com.zyeeda.framework.FrameworkConstants" %>
<%@ page import="com.zyeeda.framework.nosql.MongoDbService" %>
<%@ page import="com.zyeeda.framework.managers.DocumentManager" %>
<%@ page import="com.zyeeda.framework.managers.internal.MongoDbDocumen... | zyeeda-framework | drivebox/src/main/webapp/attachments/commit.jsp | Java Server Pages | asf20 | 785 |
ZUI.call(function(Z) {
Z.cfg = {
uploader : {
totalCountUrl : '/drivebox/rs/docs/count',
uploadUrl : '/drivebox/rs/docs',
listUrl : '/drivebox/rs/docs'
}
};
ZYEEDA.com.zyeeda.zui.framework.demo.AttachmentDemo.main(Z);
});
| zyeeda-framework | drivebox/src/main/webapp/attachments/lib/zyeeda/main.js | JavaScript | asf20 | 298 |
ZYEEDA.namespace('com.zyeeda.zui.framework.demo').AttachmentDemo = function() {
return {
main : function(Z) {
var attach = new Z.AttachmentManager({
totalCountUrl : Z.cfg.uploader.totalCountUrl,
uploadUrl : Z.cfg.uploader.uploadUrl,
listUrl... | zyeeda-framework | drivebox/src/main/webapp/attachments/lib/zyeeda/attachment-demo.js | JavaScript | asf20 | 947 |
<%@ page contentType="text/plain;charset=UTF-8" isErrorPage="true"%>
<%@ page import="java.io.PrintWriter"%>
<%= exception.getMessage() %> | zyeeda-framework | drivebox/src/main/webapp/exception.jsp | Java Server Pages | asf20 | 142 |
<%@ page import="com.zyeeda.framework.utils.IocUtils" %>
<%@ page import="com.zyeeda.framework.scheduler.SchedulerService" %>
<%@ page import="org.apache.tapestry5.ioc.Registry" %>
<%@ page import="org.quartz.TriggerKey" %>
<%@ page import="org.quartz.Trigger" %>
<%@ page import="org.quartz.Scheduler" %>
<%@ page... | zyeeda-framework | drivebox/src/main/webapp/quartz/reschedule.jsp | Java Server Pages | asf20 | 1,247 |
<#import "/lib/zyeeda/html.ftl" as z>
<@z.html>
<@z.head />
<script type="text/javascript">
YUI().use('dd', 'yui2-calendar', function(Y) {});
</script>
</@z.html> | zyeeda-framework | drivebox/src/main/webapp/WEB-INF/templates/index.ftl | Fluent | asf20 | 180 |
<#macro html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh_CN" lang="zh_CN">
<#nested>
</html>
</#macro>
<#macro yui_include filter="min">
<script type="text/javascript" src="${CONTE... | zyeeda-framework | drivebox/src/main/webapp/WEB-INF/templates/lib/zyeeda/html.ftl | Fluent | asf20 | 1,750 |
package com.zyeeda.framework.vos;
import java.util.Collection;
import javax.xml.bind.annotation.XmlRootElement;
import com.zyeeda.framework.entities.Role;
@XmlRootElement(name = "roles")
public class Roles {
private Collection<Role> roles;
public void setRole(Collection<Role> roles) {
this.roles = roles;
}
... | zyeeda-framework | drivebox/src/main/java/com/zyeeda/framework/vos/Roles.java | Java | asf20 | 387 |
package com.zyeeda.framework.resources;
import java.util.List;
import javax.persistence.EntityManager;
import javax.servlet.ServletContext;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import org.apache.tapestry5.ioc.Registry;
import com.zyeeda.framewo... | zyeeda-framework | drivebox/src/main/java/com/zyeeda/framework/resources/RoleResource.java | Java | asf20 | 1,210 |
package com.zyeeda.framework.resources;
import javax.servlet.ServletContext;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import org.apache.tapestry5.ioc.Registry;
import org.drools.runtime.StatefulKnowledgeSession;
import com.zyeeda.framew... | zyeeda-framework | drivebox/src/main/java/com/zyeeda/framework/resources/SampleFlowResource.java | Java | asf20 | 1,713 |
package com.zyeeda.drivebox.ioc;
import org.apache.tapestry5.ioc.ServiceBinder;
import org.apache.tapestry5.ioc.annotations.Primary;
import org.apache.tapestry5.ioc.annotations.Startup;
import org.quartz.Job;
import com.zyeeda.drivebox.jobs.TestJob;
import com.zyeeda.framework.config.ConfigurationService;
im... | zyeeda-framework | drivebox/src/main/java/com/zyeeda/drivebox/ioc/Module.java | Java | asf20 | 4,674 |
package com.zyeeda.drivebox.jobs;
import java.util.Date;
import java.util.concurrent.Callable;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.subject.Subject;
import org.apache.tapestry5.ioc.ScopeConstants;
import org.apache.tapestry5.ioc.annotations.Scope;
import org.apache.tapestry5.i... | zyeeda-framework | drivebox/src/main/java/com/zyeeda/drivebox/jobs/TestJob.java | Java | asf20 | 1,600 |
function v = Lpnorm(X, p, d)
%Compute Lp-norm values of vectors
%
% v = Lpnorm(X, p);
% v = Lpnorm(X, p, d);
% compute the Lp-norm values of the vectors contained in X along
% dimension d. If d is omitted, by default, it is set to 1.
%
% v = Lpnorm(X, p, []);
% compute the Lp-norm of the entire ... | zzhangumd-smitoolbox | base/metrics/Lpnorm.m | MATLAB | mit | 831 |
function D = pwsqL2dist(X1, X2, w)
% Compute the pairwise squared L2-norm distances
%
% D = pwsqL2dist(X1, X2);
% computes the squared L2-norm distance between pairs of column
% vectors in X1 and X2.
%
% Suppose the vector dimension is d, then X1 and X2 should be
% matrices of size d x m and... | zzhangumd-smitoolbox | base/metrics/pwsqL2dist.m | MATLAB | mit | 2,606 |
function dists = raddiff(X1, X2)
%RADIANDIFF Computes the radian differences between corresponding vectors
%
% dists = radiandiff(X1, X2);
% computes the radian differences between corresponding vectors in X1
% and X2.
%
% The radian difference is the angle between two vectors in unit of
% rad... | zzhangumd-smitoolbox | base/metrics/raddiff.m | MATLAB | mit | 1,121 |
function D = Linfdist(X1, X2, d)
%Compute the L_infinity norm distances between corresponding vectors
%
% D = Linfdist(X1, X2);
% D = Linfdist(X1, X2, d);
% computes the L_infinity norm distances between corresponding
% vectors in X1 and X2 along dimension d.
%
% In the input X1 and X2 should be... | zzhangumd-smitoolbox | base/metrics/Linfdist.m | MATLAB | mit | 574 |
function D = Lpdist(X1, X2, p, d)
%Compute the Lp-norm distances between corresponding vectors
%
% D = Lpdist(X1, X2, p);
% D = Lpdist(X1, X2, p, d);
% computes the Lp-norm distances between corresponding vectors in
% X1 and X2 along dimension d.
%
% In the input X1 and X2 should be arrays of th... | zzhangumd-smitoolbox | base/metrics/Lpdist.m | MATLAB | mit | 547 |
function v = sqL2norm(X, d)
%Compute squared L2-norm values of vectors
%
% v = sqL2norm(X);
% v = sqL2norm(X, d);
% compute the squared L2-norm values of the vectors contained in X
% along dimension d. If d is omitted, by default, it is set to 1.
%
% v = sqL2norm(X, []);
% compute the squared L... | zzhangumd-smitoolbox | base/metrics/sqL2norm.m | MATLAB | mit | 519 |
function dists = hamdist(X1, X2, w)
%HAMDIST Computes the hamming distances between corresponding vectors.
%
% dists = hamdist(X1, X2)
% computes the hamming distances between corresponding vectors in X1
% and X2.
%
% Hamming distance between two sequence of 0-1 codes is defined as
%
% d(x... | zzhangumd-smitoolbox | base/metrics/hamdist.m | MATLAB | mit | 1,642 |
function v = L2norm(X, d)
%Compute squared L2-norm values of vectors
%
% v = L2norm(X);
% v = L2norm(X, d);
% compute the L2-norm values of the vectors contained in X along
% dimension d. If d is omitted, by default, it is set to 1.
%
% v = L2norm(X, []);
% compute the L2-norm of the entire arra... | zzhangumd-smitoolbox | base/metrics/L2norm.m | MATLAB | mit | 425 |
function D = wL2dist(X1, X2, w)
% Compute weighted L2-norm distances between corresponding vectors
%
% D = wL2dist(X1, X2, w);
% computes weighted L2-norm distances between the corresponding
% column vectors in X1 and X2, defined by
%
% d = sqrt(sum_i w(i) * |x1(i) - x2(i)|^2)
%
% X1 and ... | zzhangumd-smitoolbox | base/metrics/wL2dist.m | MATLAB | mit | 672 |
function r = L1diff(A, B)
% Compute L1-norm of the difference between two arrays
%
% r = L1diff(A, B);
% computes the L1-norm (sum of absolute value) of the difference
% between A and B.
%
% History
% -------
% - Created by Dahua Lin, on Sep 12, 2010
%
%% main
D = A - B;
D = ... | zzhangumd-smitoolbox | base/metrics/L1diff.m | MATLAB | mit | 349 |
function Y = Linfnormalize(X, d)
% Normalize vectors w.r.t. L_infinity norm
%
% Y = Linfnormalize(X);
% Y = Linfnormalize(X, d);
% normalize vectors in X along dimension d w.r.t. L_infinity norm.
% When d is omitted, by default, it is set to 1.
%
% Y = Linfnormalize(X, []);
% normalize X as a w... | zzhangumd-smitoolbox | base/metrics/Linfnormalize.m | MATLAB | mit | 467 |
function r = Linfdiff(A, B)
% Compute Linf-norm of the difference between two arrays
%
% r = Linfdiff(A, B);
% computes the L_infinity norm (maximum of absolute value) of the
% difference between A and B.
%
% History
% -------
% - Created by Dahua Lin, on Sep 12, 2010
%
%% main
... | zzhangumd-smitoolbox | base/metrics/Linfdiff.m | MATLAB | mit | 367 |
function D = wsqL2dist(X1, X2, w)
% Compute weighted squared L2-norm distances between corresponding vectors
%
% D = wL2dist(X1, X2, w);
% computes weighted squared L2-norm distances between corresponding
% column vectors in X1 and X2, defined by
%
% d = sqrt(sum_i w(i) * |x1(i) - x2(i)|^2)
%
%... | zzhangumd-smitoolbox | base/metrics/wsqL2dist.m | MATLAB | mit | 813 |
function V = pwnrmdot(X1, X2)
% Compute pairwise normalized dot products
%
% V = pwnrmdot(X1, X2);
% computes pairwise dot products between column vectors in X1 and X2.
%
% Normalized dot-product is defined as the dot-product between
% vectors after L2-normalization, as
%
% normaliz... | zzhangumd-smitoolbox | base/metrics/pwnrmdot.m | MATLAB | mit | 1,742 |
function v = Linfnorm(X, d)
%Compute L_infinity norm values of vectors
%
% v = Linfnorm(X);
% v = Linfnorm(X, d);
% compute the L_infinity norm values of the vectors contained in X
% along dimension d. If d is omitted, by default, it is set to 1.
%
% v = Linfnorm(X, []);
% compute the L_infinit... | zzhangumd-smitoolbox | base/metrics/Linfnorm.m | MATLAB | mit | 527 |
function Y = L1normalize(X, d)
% Normalize vectors w.r.t. L1-norm
%
% Y = L1normalize(X);
% Y = L1normalize(X, d);
% normalize vectors in X along dimension d w.r.t. L1-norm. When d is
% omitted, by default, it is set to 1.
%
% Y = L1normalize(X, []);
% normalize X as a whole w.r.t. L1-norm.
%
%... | zzhangumd-smitoolbox | base/metrics/L1normalize.m | MATLAB | mit | 432 |
function r = L2diff(A, B)
% Compute L2-norm of the difference between two arrays
%
% r = L2diff(A, B);
% computes the L2-norm (square root of sum of squared value) of the
% difference between A and B.
%
% History
% -------
% - Created by Dahua Lin, on Sep 12, 2010
%
%% main
D ... | zzhangumd-smitoolbox | base/metrics/L2diff.m | MATLAB | mit | 367 |
function dists = mahdist(X1, X2, A)
%MAHDIST Computes the Mahalanobis distances
%
% dists = mahdist(X1, X2, A);
% computes the Mahalanobis distances between the corresponding
% columns in X1 and X2.
%
% Mahalanobis distances are defined as follows
%
% d(x, y) = sqrt((x - y)' * A * (x - y))... | zzhangumd-smitoolbox | base/metrics/mahdist.m | MATLAB | mit | 1,074 |
function D = L1dist(X1, X2, d)
%Compute the L1-norm distances between corresponding vectors
%
% D = L1dist(X1, X2);
% D = L1dist(X1, X2, d);
% computes the L1-norm distances between corresponding vectors in
% X1 and X2 along dimension d.
%
% In the input X1 and X2 should be arrays of the same si... | zzhangumd-smitoolbox | base/metrics/L1dist.m | MATLAB | mit | 533 |
function D = pwhamdist(X1, X2)
% Compute pairwise Hamming distances
%
% D = pwhamdist(X1, X2);
% compute pairwise Hamming distances between the column vectors in
% X1 and X2. The hamming distance is defined to be the number of
% different entries in two vectors.
%
% Let X1 and X2 be d x m and ... | zzhangumd-smitoolbox | base/metrics/pwhamdist.m | MATLAB | mit | 1,334 |
function D = pwL1dist(X1, X2, w)
% Compute the pairwise L1-norm distances
%
% D = pwL1dist(X1, X2);
% computes the L1-norm distance between pairs of column vectors in
% X1 and X2.
%
% Suppose the vector dimension is d, then X1 and X2 should be
% matrices of size d x m and d x n. In this case... | zzhangumd-smitoolbox | base/metrics/pwL1dist.m | MATLAB | mit | 1,574 |
function D = sqL2dist(X1, X2, d)
%Compute the squared L2-norm distances between corresponding vectors
%
% D = L2dist(X1, X2);
% D = L2dist(X1, X2, d);
% computes the squared L2-norm distances between corresponding
% vectors in X1 and X2 along dimension d.
%
% In the input X1 and X2 should be arr... | zzhangumd-smitoolbox | base/metrics/sqL2dist.m | MATLAB | mit | 569 |
function s = sumsqdist(X, Y, W)
% Compute weighted sum of square distances
%
% s = sumsqdist(X, Y, W);
% computes the weighted sum of squared distance as follows:
%
% s = \sum_{i=1}^m \sum_{j=1}^n W(i,j) ||X(:,i) - Y(:,j)||^2.
%
% Here, X is a d x m matrix, Y is a d x n matrix, and
% W is an ... | zzhangumd-smitoolbox | base/metrics/sumsqdist.m | MATLAB | mit | 1,656 |
function D = L2dist(X1, X2, d)
%Compute the L2-norm distances between corresponding vectors
%
% D = L2dist(X1, X2);
% D = L2dist(X1, X2, d);
% computes the L2-norm distances between corresponding vectors in
% X1 and X2 along dimension d.
%
% In the input X1 and X2 should be arrays of the same si... | zzhangumd-smitoolbox | base/metrics/L2dist.m | MATLAB | mit | 532 |
function r = sqL2diff(A, B)
% Compute sqaured L2-norm of the difference between two arrays
%
% r = L2diff(A, B);
% computes the squared L2-norm (sum of squared value) of the
% difference between A and B.
%
% History
% -------
% - Created by Dahua Lin, on Sep 12, 2010
%
%% main
... | zzhangumd-smitoolbox | base/metrics/sqL2diff.m | MATLAB | mit | 364 |
function D = pwL2dist(X1, X2, w)
% Compute the pairwise L2-norm distances
%
% D = pwL2dist(X1, X2);
% computes the L2-norm distance between pairs of column vectors in
% X1 and X2.
%
% Suppose the vector dimension is d, then X1 and X2 should be
% matrices of size d x m and d x n. In this case... | zzhangumd-smitoolbox | base/metrics/pwL2dist.m | MATLAB | mit | 1,174 |
function dists = pwmetric(metricfun, X1, X2)
%PWMETRIC Computes the pairwise metric matrix based on a supplied metric
%function
%
% dists = pwmetric(metricfun, X1, X2);
% computes the pairwise metric matrix based on metricfun.
%
% The metricfun should be a function supporting the following syntax:
%
% ... | zzhangumd-smitoolbox | base/metrics/pwmetric.m | MATLAB | mit | 1,936 |
function D = pwLinfdist(X1, X2)
% Compute the pairwise L_infinity norm distances
%
% D = pwLinfdist(X1, X2);
% computes the L_infinity norm distance between pairs of column
% vectors in X1 and X2.
%
% Suppose the vector dimension is d, then X1 and X2 should be
% matrices of size d x m and d ... | zzhangumd-smitoolbox | base/metrics/pwLinfdist.m | MATLAB | mit | 673 |
function r = sum_xlogy(X, Y, dim)
% Compute the sum of the terms x * log(y) in a safe way
%
% r = sum_xlogy(X, Y);
%
% Here, X and Y should be matrices or vectors of the same type.
%
% If X and Y are both vectors, then r is a scalar.
% Otherwise, if they are m x n matrices, then the sum is taken ... | zzhangumd-smitoolbox | base/metrics/sum_xlogy.m | MATLAB | mit | 1,278 |
function v = L1norm(X, d)
%Compute L1-norm values of vectors
%
% v = L1norm(X);
% v = L1norm(X, d);
% compute the L1-norm values of the vectors contained in X along
% dimension d. If d is omitted, by default, it is set to 1.
%
% v = L1norm(X, []);
% compute the L1-norm of the entire array X.
%
... | zzhangumd-smitoolbox | base/metrics/L1norm.m | MATLAB | mit | 491 |
function D = pwsqmahdist(X1, X2, A)
% Computes pairwise squared Mahalanobis distances
%
% D = pwsqmahdist(X1, X2, A);
% computes pairwise squared Mahalanobis distances between the
% columns in X1 and X2.
%
% The squared Mahalanobis distances are defined as follows
%
% d(x, y) = (x - y)' *... | zzhangumd-smitoolbox | base/metrics/pwsqmahdist.m | MATLAB | mit | 1,444 |
function Y = Lpnormalize(X, p, d)
% Normalize vectors w.r.t. Lp-norm
%
% Y = Lpnormalize(X, p);
% Y = Lpnormalize(X, p, d);
% normalize vectors in X along dimension d w.r.t. Lp-norm. When d is
% omitted, by default, it is set to 1.
%
% Y = Lpnormalize(X, p, []);
% normalize X as a whole w.r.t. L... | zzhangumd-smitoolbox | base/metrics/Lpnormalize.m | MATLAB | mit | 447 |
function v = nrmdot(X1, X2)
%NRMDOT Computes the normalized dot-product between corresponding vectors
%
% v = nrmdot(X1, X2);
% computes the normalized dot-product between corresponding column
% vectors in X1 and X2.
%
% Normalized dot-product is defined as the dot-product between
% vectors a... | zzhangumd-smitoolbox | base/metrics/nrmdot.m | MATLAB | mit | 1,039 |
function D = pwmahdist(X1, X2, A)
%PWMAHDIST Computes the pairwise Mahalanobis distances
%
% D = pwmahdist(X1, X2, A);
% computes the pairwise Mahalanobis distances between the columns in
% X1 and X2.
%
% Mahalanobis distances are defined as follows
%
% d(x, y) = sqrt((x - y)' * A * (x - y... | zzhangumd-smitoolbox | base/metrics/pwmahdist.m | MATLAB | mit | 895 |
function Y = L2normalize(X, d)
% Normalize vectors w.r.t. L2-norm
%
% Y = L2normalize(X);
% Y = L2normalize(X, d);
% normalize vectors in X along dimension d w.r.t. L2-norm. When d is
% omitted, by default, it is set to 1.
%
% Y = L2normalize(X, []);
% normalize X as a whole w.r.t. L2-norm.
%
%... | zzhangumd-smitoolbox | base/metrics/L2normalize.m | MATLAB | mit | 432 |
function D = wL1dist(X1, X2, w)
% Compute weighted L1-norm distances between corresponding vectors
%
% D = wL1dist(X1, X2, w);
% computes weighted L1-norm distances between the corresponding
% column vectors in X1 and X2, defined by
%
% d = sum_i w(i) * |x1(i) - x2(i)|
%
% X1 and X2 shou... | zzhangumd-smitoolbox | base/metrics/wL1dist.m | MATLAB | mit | 789 |
function dists = sqmahdist(X1, X2, A)
%MAHDIST Computes the squared Mahalanobis distances
%
% dists = sqmahdist(X1, X2, A);
% computes the squared Mahalanobis distances between corresponding
% columns in X1 and X2.
%
% Squared Mahalanobis distances are defined as follows
%
% d(x, y) = (x -... | zzhangumd-smitoolbox | base/metrics/sqmahdist.m | MATLAB | mit | 1,124 |
function dists = pwraddiff(X1, X2)
%Compute the pairwise radian differences
%
% dists = pwraddiff(X);
% dists = pwraddiff(X1, X2);
% computes the pairwise radian differences between column vectors in
% X1 and X2.
%
% The radian difference is the angle between two vectors in unit of
% radian.... | zzhangumd-smitoolbox | base/metrics/pwraddiff.m | MATLAB | mit | 942 |
function D = pwLpdist(X1, X2, p)
% Compute the pairwise Lp-norm distances
%
% D = pwLpdist(X1, X2, p);
% computes the Lp-norm distance between pairs of column vectors in
% X1 and X2.
%
% Suppose the vector dimension is d, then X1 and X2 should be
% matrices of size d x m and d x n. In this c... | zzhangumd-smitoolbox | base/metrics/pwLpdist.m | MATLAB | mit | 1,398 |
function M = wmedian(X, w)
% Compute the weighted median
%
% M = wmedian(X, w);
% computes the weighted median of X (along the first non-singleton
% dimension of w).
%
% Let X be an m x n matrix, and w can be either an m x 1 or 1 x n
% vector. In the former case, it computes the weighted media... | zzhangumd-smitoolbox | base/data/wmedian.m | MATLAB | mit | 1,252 |
function [H, N0] = hist2d(x, y, xb, yb)
% Compute histogram of 2D data
%
% [H, N0] = hist2d(x, y, xb, yb);
% computes the histogram of the 2D data given by x and y, which
% are vectors of the same size.
%
% The histogram bins are divided according to the xb and yb.
% Suppose xb and yb respect... | zzhangumd-smitoolbox | base/data/hist2d.m | MATLAB | mit | 1,834 |
/********************************************************************
*
* merge_sorted.cpp
*
* The C++ mex implementation of merge_sorted
*
* Created by Dahua Lin, on Mar 28, 2011
*
********************************************************************/
#include <bcslib/matlab/bcs_mex.h>
using namespace bcs;... | zzhangumd-smitoolbox | base/data/merge_sorted.cpp | C++ | mit | 5,739 |
function y = pieces(x, edges, dir, alg)
% PIECES Locates the piece that the input values are in
%
% y = pieces(x, edges);
% y = pieces(x, edges, 'L');
% y = pieces(x, edges, 'R');
%
% determines which bins each value of x is in. Particularly,
% let edges be a vector of length m+1 as [e_0, ..., e_m].
... | zzhangumd-smitoolbox | base/data/pieces.m | MATLAB | mit | 3,212 |
function R = coaggreg(fun, X, siz, varargin)
% Perform aggregation with multiple indices
%
% R = coaggreg(fun, X, [K1, K2, ...], I1, I2, ...);
% performs the aggregation specified by fun on data X with multiple
% indices I1, I2, ...
%
% Here, fun can be either of the following strings:
% 'sum'... | zzhangumd-smitoolbox | base/data/coaggreg.m | MATLAB | mit | 1,399 |
function G = cogroup(siz, varargin)
% Groups the indices for different integer combinations
%
% G = cogroup(m, vs);
% returns a cell vector of size m x 1, where G{k} is a vector of
% indices, such that all(vs(G{k}) == k).
%
% C = cogroup([m, n], vs1, vs2);
% returns a matrix of size m x n, where a... | zzhangumd-smitoolbox | base/data/cogroup.m | MATLAB | mit | 1,053 |
function [u, varargout] = uniqvalues(x, tags)
% Get a list of sorted values with no repetition
%
% u = uniqvalues(x);
% returns a row vector v that contains all values in array x with
% no repetition.
%
% [u, I] = uniqvalues(x, 'I');
% additionally returns an integer map, such that x(i) == u(I(i))... | zzhangumd-smitoolbox | base/data/uniqvalues.m | MATLAB | mit | 2,721 |
function C = cocounts(siz, varargin)
% Counts the numbers of different integer combinations
%
% C = cocounts(m, vs);
% returns a vector of size m x 1, where C(k) being the number of
% occurrences of k in vs.
%
% C = cocounts([m, n], vs1, vs2);
% returns a matrix of size m x n, where
% C(i,... | zzhangumd-smitoolbox | base/data/cocounts.m | MATLAB | mit | 1,158 |
/********************************************************************
*
* valueseg_cimp.cpp
*
* The C++ mex implementation of valueseg
*
* Created by Dahua Lin, on May 26, 2010
*
********************************************************************/
#include <bcslib/matlab/bcs_mex.h>
#include <vector>
using... | zzhangumd-smitoolbox | base/data/valueseg.cpp | C++ | mit | 3,267 |
function r = fast_median(X, dim)
% Find the median value using O(n) algorithm
%
% r = fast_median(X);
% If X is a vector, it returns the median of X.
% If X is a matrix of size m x n where m > 1 and n > 1, then
% it returns a row vector r, such that r(j) is the median value
% for X(:, j).
%
%... | zzhangumd-smitoolbox | base/data/fast_median.m | MATLAB | mit | 1,960 |
/********************************************************************
*
* intgroup.cpp
*
* The C++ mex implementation of intgroup
*
* Created by Dahua Lin, on June 6, 2010
*
********************************************************************/
#include <bcslib/matlab/bcs_mex.h>
#include <vector>
#include <u... | zzhangumd-smitoolbox | base/data/intgroup.cpp | C++ | mit | 3,244 |
% Find the set of indices of the occurrences of integers in a given range
%
% G = intgroup([v0, v1], V);
% finds the set of indices of occurrences of integers in range
% [v0, v1] in the array V.
%
% In the input, V is a numeric array containing integers (whose
% value class can be either doubl... | zzhangumd-smitoolbox | base/data/intgroup.m | MATLAB | mit | 656 |
function c = intcount(rgn, V, dim)
%INTCOUNT Count the number of occurrence of integers
%
% c = INTCOUNT([v0, v1], V);
% counts the number of integers in [v0, v1] that occurs in V.
%
% In the input, V is an array containing integer values (whose
% type can be double or single nonetheless).
%... | zzhangumd-smitoolbox | base/data/intcount.m | MATLAB | mit | 2,359 |
function [R, I] = top_k(X, op, K, dim)
% Find the top k elements
%
% R = top_k(X, 'min', K);
% R = top_k(X, 'max', K);
%
% If X is a row/column vector, it returns a row/column vector of
% length K, which contains the K smallest elements sorted in
% ascending order, or the K largest elements sorte... | zzhangumd-smitoolbox | base/data/top_k.m | MATLAB | mit | 2,465 |
function R = aggreg_percol(X, K, I, fun)
%AGGREG_PERCOL Per-column index-based aggregation
%
% R = AGGREG_PERCOL(X, K, I, 'sum');
% R = AGGREG_PERCOL(X, K, I, 'mean');
% R = AGGREG_PERCOL(X, K, I, 'min');
% R = AGGREG_PERCOL(X, K, I, 'max');
% R = AGGREG_PERCOL(X, K, I, 'var');
% R = AGGREG_PERCOL(X, K, I, ... | zzhangumd-smitoolbox | base/data/aggreg_percol.m | MATLAB | mit | 2,747 |
function R = aggreg(X, K, I, fun)
%AGGREG Index-based aggregation
%
% R = AGGREG(X, K, I, 'sum');
% R = AGGREG(X, K, I, 'mean');
% R = AGGREG(X, K, I, 'min');
% R = AGGREG(X, K, I, 'max');
% R = AGGREG(X, K, I, 'var');
% R = AGGREG(X, K, I, 'std');
%
% performs aggregation of the rows or columns in X ... | zzhangumd-smitoolbox | base/data/aggreg.m | MATLAB | mit | 4,348 |
/********************************************************************
*
* pieces_cimp.cpp
*
* The C++ mex implementation for pieces
*
* Created by Dahua Lin, on Mar 22, 2010
*
********************************************************************/
#include <bcslib/matlab/bcs_mex.h>
using namespace bcs;
using... | zzhangumd-smitoolbox | base/data/private/pieces_cimp.cpp | C++ | mit | 3,372 |
/********************************************************************
*
* top_k_cimp.cpp
*
* The C++ mex implementation of top_k.m
*
* Created by Dahua Lin, on Nov 11, 2010
*
********************************************************************/
#include <bcslib/matlab/bcs_mex.h>
#include <functional>
#incl... | zzhangumd-smitoolbox | base/data/private/top_k_cimp.cpp | C++ | mit | 6,494 |