如何组织像Java包一样的Angular 2 app文件夹结构?
考虑以下项目布局:
app
|_model
|_component
|_service
Run Code Online (Sandbox Code Playgroud)
我想进口foo.service.ts从服务到bar.component.ts的组件.但据我所知,Angular 2导入仅支持相对路径/../service/,这似乎是非常笨重的解决方案.
有没有办法从根文件夹中引用带绝对浴的文件夹,就像使用Java包一样?
HS256和HS512加密算法之间是否存在实际差异,或者与已经牢不可破的密钥相比,是否存在更长的密钥冗余的附加安全性?我应该使用哪一个来加密JWT令牌?
甚至可以在auth0的java JWT中使用HS512加密吗?
我有以下 Dockerfile
#Copyright (c) 2014-2017 Oracle and/or its affiliates. All rights reserved.
#
#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
# ORACLE DOCKERFILES PROJECT
# --------------------------
# This Dockerfile extends the Oracle WebLogic image by creating a sample domain.
#
# Util scripts are copied into the image enabling users to plug NodeManager
# automatically into the AdminServer running on another container.
#
# HOW TO BUILD THIS IMAGE
# -----------------------
# Put all …Run Code Online (Sandbox Code Playgroud) 如果我在多个bean上下文中有多个基于Java的配置文件(例如Security Context和Persistence Context在Spring中),我会导入Root Context使用@Import,那么导入的顺序和在哪个配置中扫描自动Components 连线到这些配置文件是否重要?
我敢肯定,Spring将实例化并初始化所有内容,然后自动将任何内容自动链接到基础结构组件,但是自动链接到配置使我感到担忧,因为自动链接发生在整个上下文创建完成之前。这种自动装配可能会引发依赖性问题,还是Spring会处理所有问题?
我在以下配置中未实例化UserService的奇怪异常
@Configuration
@ComponentScan(basePackageClasses = {
UserDao.class,
UserManager.class,
StatefulUserServiceImpl.class,
UserService.class
})
@Import({
PersistenceContext.class,
SecurityConfig.class,
})
public class RootConfig {
}
Run Code Online (Sandbox Code Playgroud)
@Configuration
@EnableWebSecurity
@ComponentScan(basePackageClasses = {
UserService.class,
UserManager.class
})
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private UserManager users;
@Autowired
private UserService userAuthenticationService;
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userAuthenticationService);
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.formLogin().and()
.authorizeRequests()
.antMatchers("/init").permitAll() …Run Code Online (Sandbox Code Playgroud) spring dependency-injection spring-security autowired applicationcontext
在React/Redux应用程序中有哪些方法可以提醒用户有关过期的会话?
服务器使用JWT令牌对用户进行身份验证,并且React确实不知道此类令牌的存在,浏览器会自动处理它.在获取和发布Redux的情况下,设置数据或状态错误.
是尝试访问API端点时被动检查响应的典型方法,使用expires字段设置客户端超时,主动确保会话的有效性或其他一些技术?我特别关注用户所做的未保存更改,并希望尽快通知用户有关已结束的会话.
我正在学习Clojure的函数式编程,并希望加深对函数范式的理论理解(不仅仅是Clojure的语法).
我正在寻找公理或公式,每个函数技术如递归,映射,减少,缺点,第一和休息是如何相互关联的,它们是可衍生的/可组合的,并且它是一切背后的终极公理.
例如,我意识到map只能使用来实现recur,first,rest和cons功能,当然映射函数本身传递给map.
在那之后,我也意识到map可以利用也实现reduce,并再次减少可利用来实现recur,first和rest.也filter可以实现reduce.
我觉得我开始围绕函数式编程,但仍然很难看出哪些是最终的构建块,即构成任意函数的最小抽象或关键字集合.使用map示例,第二种方法使用少一个抽象来定位同一目标.那么,功能范式的一些终极公理能够帮我看清大局吗?
reduce functional-programming function clojure higher-order-functions
我必须执行涉及多个深度连接和复杂谓词的相对复杂的查询,其中结果(和条件)取决于满足条件的合适条目。涉及主要和次要标准,始终应用主要标准,如果结果不令人满意,则进行次要打击。简而言之
但如果没有足够的不同文档类型或不同客户的文档,请尝试仍然满足 N 个文档的数量
我选择声明式(查询)方法而不是命令式(游标和计数器)。这就是该WITH子句的用武之地。粗略地说,通过使用多个WITH块(CTE),我声明查询(我喜欢将它们视为临时视图)来为两种文档类型声明两个不同的目标集。最后,我将UNION不同 CTE 的子集作为最终结果,并执行一些COUNT检查来限制数量。
COUNT例如,多个 CTE 相互引用,并从上下文中的多个位置引用NOT EXISTS。我是SQL新手,WITH机缘巧合之下就选择了使用它。这是 的正确用例WITH还是反模式?与以命令式方式使用游标和计数器实现相同功能相比,该解决方案的性能如何?我是否选择了错误的方法?我们正在讨论具有数百万个条目的表。
这是整个查询。请原谅,由于保密原因,我不得不隐藏这些字段。
WITH target_documents AS (
SELECT
<Necessary fields>
FROM documents l
WHERE
<Suitable document criteria>
),
target_documents_type_1 AS (
SELECT * FROM target_documents WHERE type = 1
),
target_documents_type_2 AS (
SELECT * FROM target_documents WHERE type = 2
),
target_customers AS (
SELECT
<Necessary fields>
FROM customers …Run Code Online (Sandbox Code Playgroud) 我们正在将 Java EE 应用程序从Java 6迁移到Java 8。这意味着编译级别以及从JRE6 上的 Weblogic 11g到JRE8 上的 Weblogic 12c 的迁移。
当我尝试部署项目时,出现以下错误
<20.7.2017, 12:48:46,17 ip. EEST> <Error> <J2EE> <BEA-160228> <AppMerge failed to merge your application. If you are running AppMerge on the command-line, merge again with the -verbose option for more details. See the error message(s) below.>
weblogic.utils.compiler.ToolFailureException: org.apache.commons.pool2.BasePooledObjectFactory
at weblogic.application.compiler.FlowDriver.handleStateChangeException(FlowDriver.java:55)
at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:38)
at weblogic.application.compiler.AppMerge.runBody(AppMerge.java:146)
at weblogic.utils.compiler.Tool.run(Tool.java:159)
at weblogic.utils.compiler.Tool.run(Tool.java:116)
at weblogic.application.compiler.AppMerge.merge(AppMerge.java:158)
at weblogic.deploy.api.internal.utils.AppMerger.merge(AppMerger.java:94)
at weblogic.deploy.api.internal.utils.AppMerger.getMergedApp(AppMerger.java:58)
at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createDeployableObject(WebLogicDeployableObjectFactoryImpl.java:186)
at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createLazyDeployableObject(WebLogicDeployableObjectFactoryImpl.java:160)
at …Run Code Online (Sandbox Code Playgroud) 我的 Spring 应用程序在 Weblogic 11g 上部署得很好。然而,当我尝试在 Weblogic 12c 上部署时,我不断收到ClassNotFoundException一个又一个的 。
首先,我得到了java.lang.ClassNotFoundException: com.querydsl.core.types.Expression,我通过添加缺少的依赖项解决了这个问题。然后我得到熟悉的异常,但这次缺少的类来自 package com.mysema.querydsl。引入此依赖项后,我得到以下异常:java.lang.ClassNotFoundException: org.apache.abdera.writer.Writer。
为什么应用程序在迁移到 Weblogic 12c 后完全崩溃了(因为 Spring 不应该与容器耦合)?
以下是迁移前项目的所有依赖:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring.version>4.3.2.RELEASE</spring.version>
<spring-data-jpa.version>1.10.2.RELEASE</spring-data-jpa.version>
<spring-security.version>4.1.3.RELEASE</spring-security.version>
<cxf.version>3.1.7</cxf.version>
<jackson.version>1.9.13</jackson.version>
<esapi.version>2.1.0.1</esapi.version>
<hibernate-entitymanager.version>5.1.1.Final</hibernate-entitymanager.version>
<hibernate-commons-annotations.version>5.0.1.Final</hibernate-commons-annotations.version>
<spring-boot-starter-jdbc.version>1.5.2.RELEASE</spring-boot-starter-jdbc.version>
<slf4j.version>1.7.21</slf4j.version>
<log4j.version>1.2.17</log4j.version>
<log.directory>logs</log.directory>
</properties>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>3.0-alpha-1</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Security -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${spring-security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${spring-security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${spring-security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-acl</artifactId>
<version>${spring-security.version}</version>
</dependency>
<dependency> …Run Code Online (Sandbox Code Playgroud) 我正在使用 ansible 设置 kubernetes 集群。尝试启用内核 IP 路由时出现以下错误:
Failed to reload sysctl: sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-iptables: No such file or directory
Run Code Online (Sandbox Code Playgroud)
这是 ansible 中的错误还是我的剧本有问题?
---
# file: site.yml
# description: Asentaa ja kaynnistaa kubernetes-klusterin riippuvuuksineen
#
# resources:
# - https://kubernetes.io/docs/setup/independent/install-kubeadm/
# - http://michele.sciabarra.com/2018/02/12/devops/Kubernetes-with-KubeAdm-Ansible-Vagrant/
# - https://docs.ansible.com/ansible/latest/modules/
# - https://github.com/geerlingguy/ansible-role-kubernetes/blob/master/tasks/setup-RedHat.yml
# - https://docs.docker.com/install/linux/docker-ce/centos/
#
# author: Tuomas Toivonen
# date: 30.12.2018
- name: Asenna docker ja kubernetes
hosts: k8s-machines
become: true
become_method: sudo
roles:
- common
vars:
ip_modules:
- ip_vs
- …Run Code Online (Sandbox Code Playgroud) java ×2
javascript ×2
spring ×2
weblogic ×2
angular ×1
ansible ×1
autowired ×1
clojure ×1
deployment ×1
docker ×1
encryption ×1
function ×1
http ×1
iptables ×1
jakarta-ee ×1
jar ×1
jwt ×1
kernel ×1
kubernetes ×1
maven ×1
module ×1
oracle ×1
performance ×1
reactjs ×1
reduce ×1
redux ×1
session ×1
sql ×1
sysctl ×1
systemjs ×1
typescript ×1
web.xml ×1