小编gdr*_*drt的帖子

为什么权重向量与神经网络中的决策平面正交

我是神经网络的初学者.我正在学习感知器.我的问题是为什么权重向量垂直于决策边界(超平面)?我提到了很多书,但都提到重量向量与决策边界垂直,但没有人说为什么?

任何人都可以给我一本书的解释或参考吗?

artificial-intelligence machine-learning perceptron biological-neural-network neural-network

31
推荐指数
3
解决办法
1万
查看次数

通过注释而不是XML配置Spring LdapTemplate的最佳实践?

对于Spring Boot应用程序,我LdapTemplate使用注释成功配置了Spring ,包括LdapContextSource@Valueapplication.properties中的s 的依赖关系.(哇!我找不到一个例子,所以也许这会帮助别人.)

片段(下面)设置上下文源,将其注入LdapTemplate到我的DirectoryService中,然后自动装入到我的DirectoryService中.

是否有更好/更清晰的方法来设置ContextSourceSpring Boot应用程序?

application.properties(在类路径上):

ldap.url=ldap://server.domain.com:389
ldap.base:OU=Employees,OU=Users,DC=domain,DC=com
ldap.username:CN=myuserid,OU=employees,OU=Users,DC=domain,DC=com
ldap.password:secretthingy
Run Code Online (Sandbox Code Playgroud)

MyLdapContextSource.java:

@Component
public class MyLdapContextSource extends LdapContextSource implements ContextSource {

    @Value("${ldap.url}")
    @Override
    public void setUrl(String url) { super.setUrl(url);  }

    @Value("${ldap.base}")
    @Override
    public void setBase(String base) {super.setBase(base); }

    @Value("${ldap.username}")
    @Override
    public void setUserDn(String userDn) {super.setUserDn(userDn); }

    @Value("${ldap.password}")
    @Override
    public void setPassword(String password) { super.setPassword(password); }
}
Run Code Online (Sandbox Code Playgroud)

MyLdapTemplate.java:

@Component
public class MyLdapTemplate extends LdapTemplate {

    @Autowired
    public MyLdapTemplate(ContextSource …
Run Code Online (Sandbox Code Playgroud)

java annotations spring-ldap spring-boot

29
推荐指数
2
解决办法
3万
查看次数

矩阵变换; 概念和理论,是否有实际学习的免费资源?

我最近很乐意从坐标渲染图表和图表,我很着迷使用矩阵来转换坐标空间.

我已经能够成功地缩放和反转二维坐标空间,但现在我的胃口被激发了.:)

我在哪里可以获得关于矩阵,矩阵数学的清晰,信息丰富,(免费)的教育材料,特别是适用于二维和三维空间?

math matrix hyperlink coordinates

23
推荐指数
3
解决办法
3038
查看次数

超出画布时,chartjs 工具提示被切断

我目前正在使用 chartjs ( chartjs )。

工具提示被剪切,因为它超出了画布。我该如何解决这种行为?

图表与图例截止

javascript chart.js

13
推荐指数
2
解决办法
1万
查看次数

动态设置hibernate方言

我实现了Hibernate的多租户数据库架构,根据租户选择特定的数据库连接.我正在使用Spring 4.3和Hibernate 5.2.

当租户使用相同的RDBMS时,一切都很好,但是当他们不同时,我必须动态更改hibernate属性中的方言设置,我不知道如何.

我的hibernate属性在dispatcher-servlet.xml中:

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
         http://www.springframework.org/schema/tx  http://www.springframework.org/schema/tx/spring-tx.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

    <context:component-scan base-package="com.example"/>
    <mvc:annotation-driven/>
    <context:property-placeholder location="classpath:application.properties"/>
    <tx:annotation-driven transaction-manager="transactionManager"/>

    <bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean" >
        <property name="packagesToScan">
            <list>
                <value>com.example.model</value>
            </list>
        </property>
        <property name="hibernateProperties">
            <props>
                <!--<prop key="hibernate.dialect">${hibernate.dialect}</prop>-->
                <prop key="hibernate.show_sql">${hibernate.show_sql:false}</prop>
                <prop key="hibernate.format_sql">${hibernate.format_sql:false}</prop>
                <prop key="hibernate.multiTenancy">DATABASE</prop>
                <prop key="hibernate.tenant_identifier_resolver">com.example.multitenancy.CurrentTenantIdentifierResolverImpl</prop>
                <prop key="hibernate.multi_tenant_connection_provider">com.example.multitenancy.MultiTenantConnectionProviderImpl</prop>
            </props>
        </property>
    </bean>
    <bean id="transactionManager"  class="org.springframework.orm.hibernate5.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory" />
    </bean>
</beans>
Run Code Online (Sandbox Code Playgroud)

下面是Hibernate的CurrentTenantIdentifierResolver的实现:

public class CurrentTenantIdentifierResolverImpl implements CurrentTenantIdentifierResolver {
    @Override
    public String resolveCurrentTenantIdentifier() …
Run Code Online (Sandbox Code Playgroud)

java spring hibernate multi-tenant

10
推荐指数
1
解决办法
3160
查看次数

如何解析从Datatables ajax调用收到的JSON?

我可以使用ajax调用成功填充我的数据表,但后来我不知道如何解析数据表通过此ajax调用接收的JSON.

这是我的JavaScript代码,它对服务器进行ajax调用并正确填充我的数据表:

$('#transactions').DataTable({
        "processing": true,
        "ajax": {
            "url": "/transactions
        },
        "columns": [
            { "data": "car"},
            { "data": "card_number"},
            { "data": "invoice"},
            { "data": "status"}
        ]
    });
Run Code Online (Sandbox Code Playgroud)

这是从服务器返回的JSON对象:

{
  "data": [
    {
      "car": 190,
      "card_number": "6395637",
      "invoice": 200,
      "status": "success"
    },
    {
      "car": 191,
      "card_number": "9473650",
      "invoice": 180,
      "status": "success"
    }
  ],
  "balance": 7300
}
Run Code Online (Sandbox Code Playgroud)

如您所见,datadatatables函数使用返回的JSON对象的参数来填充数据表,现在我想解析balance参数,但我不能.我怎样才能实现这一目标?

javascript ajax jquery json datatables

9
推荐指数
2
解决办法
3万
查看次数

Spring安全自定义ldap身份验证提供程序

我目前的ldap身份验证上下文设置如下:

    <ldap-server url="ldap://host/dn"
        manager-dn="cn=someuser"
        manager-password="somepass" />
    <authentication-manager>
        <ldap-authentication-provider user-search-filter="(samaccountname={0})"/>
    </authentication-manager> 
Run Code Online (Sandbox Code Playgroud)

现在,我需要能够设置自定义权限映射器(它使用不同的ldap服务器) - 所以我假设我需要设置类似于(http://static.springsource.org/spring的 ldap-server)-security/site/docs/2.0.x/reference/ldap.html):

<bean id="ldapAuthProvider"
        class="org.springframework.security.providers.ldap.LdapAuthenticationProvider">
  <constructor-arg>
    <bean class="org.springframework.security.providers.ldap.authenticator.BindAuthenticator">
      <constructor-arg ref="contextSource"/>
      <property name="userDnPatterns">
        <list><value>uid={0},ou=people</value></list>
      </property>
    </bean>
  </constructor-arg>
  <constructor-arg>
    <bean class="org.springframework.security.ldap.populator.DefaultLdapAuthoritiesPopulator">
      <constructor-arg ref="contextSource"/>
      <constructor-arg value="ou=groups"/>
      <property name="groupRoleAttribute" value="ou"/>
    </bean>
  </constructor-arg>
</bean>
Run Code Online (Sandbox Code Playgroud)

但是,如何在安全上下文中将"ldapAuthProvider"引用到ldap-server?

我也使用spring-security 3,所以''不存在......

java authentication spring-security

5
推荐指数
2
解决办法
4万
查看次数

解决0/1背包的变化(项目的多个来源,每个项目可以从其中一个来源中选择)

因此,对于练习题,我们应该设计一个动态编程算法,它是0/1背包问题的变体......基本上每个项目来自4个不同的来源,并且该项目只能从其中一个来源获取. .

也就是说,

S1={(d_k, b_k) | 1 ? k ? n},
S2={(d_k, b_k) | n + 1 ? k ? 2n},
S3={(d_k, b_k) | 2n + 1 ? k ? 3n},
S4 = {(d_k, b_k) | 3n + 1 ? k ? 4n}
Run Code Online (Sandbox Code Playgroud)

因为n = 10,如果你选择i = 16放,这意味着你不会选择6, 26 or 36...

你能帮助我解决这个问题并设计复发方程吗?

algorithm knapsack-problem dynamic-programming

4
推荐指数
1
解决办法
2213
查看次数

Google商家信息自动填充功能不适用于动态生成的输入元素

自动完成功能在多个静态输入字段上完美运行.但是当我通过按钮添加输入字段时,自动完成功能对这些输入字段不起作用.也许问题是关闭,但我不确定,因为我的弱Javascript.谁能帮我?

这是代码:

<!DOCTYPE html>
<html>
<head>
<title>test</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places"></script>
<script>
var map = null;
var marker = [];
var autocomplete = [];
var inputs = [];
var types = [];
var autocompleteOptions = {
 componentRestrictions: {country: "az"}
};
Run Code Online (Sandbox Code Playgroud)

这个函数动态创建最多5个输入字段(我把这个函数放在初始化方法中,它也不起作用):

$(document).ready(function(){
var count = 2;
$("#addInputField").click(function(){
    count++;
    $("#inputlar").append("<input id='pac-input" + count + "' class='controlsInput' type='text' placeholder='Enter your destination' /> <br />");
    var newInput = [];
    var newEl = document.getElementById('pac-input' + count);
    newInput[count-1] = …
Run Code Online (Sandbox Code Playgroud)

javascript jquery google-maps autocomplete google-maps-api-3

3
推荐指数
1
解决办法
5683
查看次数

DateTime.ParseExact抛出System.FormatException

为什么这行代码有时会抛出System.FormatException

DateTime d = DateTime.ParseExact("01.07.2014", "dd/MM/yyyy", CultureInfo.InvariantCulture);
Run Code Online (Sandbox Code Playgroud)

c# datetime

3
推荐指数
1
解决办法
5933
查看次数

无法在ubuntu 1404上安装ember

我在我的ubuntu上安装了nodejs和npm.然后我在我的机器上安装了ember并输入ember -v以验证ember是否已成功安装.但我从终端收到以下消息:

/usr/bin/env: node: No such file or directory
Run Code Online (Sandbox Code Playgroud)

我意外地安装了节点(而不是nodejs),但后来我删除了...现在当我输入node终端时,它给了我:

The program 'node' can be found in the following packages:

 * node

 * nodejs-legacy
Try: apt-get install <selected package>
Run Code Online (Sandbox Code Playgroud)

我需要做什么来正确安装余烬?

ubuntu node.js ember.js

-1
推荐指数
1
解决办法
1286
查看次数