我正在尝试在我的Windows开发环境中设置nginx.我找不到如何在Linux上创建类似于"启用站点"的东西,其中nginx会查找(链接)活动虚拟主机配置.
有没有办法做一些类似的目录与实际配置文件的快捷方式和nginx扫描该目录?或者除了将主机配置复制到nginx.conf之外,还有其他方法来连接虚拟主机配置吗?
亲切的,马克
我们有一个运行Java 6,Tomcat 6,Spring Framework 3,Hibernate 4,EhCache的Web应用程序.我们遇到的问题是垃圾收集时间极长,可能需要30秒或更长时间,导致应用程序无响应.
我们目前正在进行测试,但除了显而易见之外:添加更多内存,我想知道是否有方面我们可以调整以减少垃圾收集时间.
内存使用的主要贡献者是EHCache,因为我们正在积极地缓存.但我总是发现很难确定EHCache存储的大小(新的EhCache字节大小存储,导致我们遇到各种各样的问题,因为缓存的对象图可能非常大).
这些是我对JVM的设置
JAVA_OPTS="$JAVA_OPTS -server -Xms256m -Xmx704m XX:OnOutOfMemoryError=/usr/share/scripts/on_server_crash.sh -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/tomcat6 -XX:MaxPermSize=192m -XX:+UseConcMarkSweepGC
Run Code Online (Sandbox Code Playgroud) 我看到函数$ f被用在许多jquery相关的脚本中,但是我无法找到它在任何地方的含义的描述.
例
var iframe = document.getElementById(iframe_id);
this.player = global.$f(iframe);
Run Code Online (Sandbox Code Playgroud)
有人能指出我的文件吗?
我正在尝试setenv.sh在Ubuntu 12/Tomcat 7上设置我的Tomcat已经安装了apt-get我试图创建一个多行JAVA_OPTS变量但是仍然遇到错误消息.
#!/bin/sh
export JAVA_OPTS="$JAVA_OPTS -server \
-Xms512m -Xmx512m"
: not foundtomcat7/bin/catalina.sh: 4: /usr/share/tomcat7/bin/setenv.sh:
Using CATALINA_BASE: /usr/share/tomcat7
Using CATALINA_HOME: /usr/share/tomcat7
Using CATALINA_TMPDIR: /usr/share/tomcat7/temp
Using JRE_HOME: /usr/lib/jvm/java-7-oracle/
Using CLASSPATH: /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar
Error: Could not find or load main class
Run Code Online (Sandbox Code Playgroud)
#!/bin/sh
export JAVA_OPTS="$JAVA_OPTS -server -Xms512m -Xmx512m"
: not foundtomcat7/bin/catalina.sh: 3: /usr/share/tomcat7/bin/setenv.sh:
Using CATALINA_BASE: /usr/share/tomcat7
Using CATALINA_HOME: /usr/share/tomcat7
Using CATALINA_TMPDIR: /usr/share/tomcat7/temp
Using JRE_HOME: /usr/lib/jvm/java-7-oracle/
Using CLASSPATH: /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar
Invalid maximum heap size: -Xmx512m
Error: Could not create the Java Virtual …Run Code Online (Sandbox Code Playgroud) 我在变得更漂亮时遇到了问题,eslint 和 Visual Studio 代码一起玩得很好。我一直在 VSCode 中看到这样的红色错误:
[eslint] Replace `?` with `··` (prettier/prettier)
Run Code Online (Sandbox Code Playgroud)
我安装了 VSCode 插件 eslint 和 prettier。
VSCode 配置
{
"javascript.validate.enable": false,
"javascript.format.enable": false,
"editor.formatOnSave": true,
"prettier.singleQuote": true,
"prettier.eslintIntegration": true,
"window.zoomLevel": -1,
"editor.fontSize": 13
}
.eslintrc
{
"parser": "babel-eslint",
"extends": [
"airbnb",
"plugin:react-native/all",
"prettier",
"prettier/react",
"prettier/standard"
],
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"env": {
"browser": true,
"node": true,
"mocha": true,
"jest": true,
"es6": true
},
"globals": {
"expect": true,
"sinon": true,
"Promise": true, …Run Code Online (Sandbox Code Playgroud) 我有一个如下表
FK_OrgId , FK_UserId
3 , 74
1 , 74
1 , 74
3 , 4
4 , 5
1 , 5
Run Code Online (Sandbox Code Playgroud)
我正在尝试计算FK_OrgId,但我必须消除重复.所以,我想要一个像这样的结果
FK_OrgId, count
3 , 2
1 , 2
4 , 1
Run Code Online (Sandbox Code Playgroud)
有什么建议?
我使用Chrome Debugging和Live Reload来调试React Native应用程序.每当您保存文件时,Chrome屏幕都会重新加载,并在此过程中获得焦点.这很烦人.反正有没有禁用这种聚焦行为?
这是一个非常基本的问题,但是如何调用扩展类型或接口?
所有文档都指向用于extend type Person添加基于 Person 的字段。
我希望它像这样工作
Employee extend type Person {
salary: Int!
}
Run Code Online (Sandbox Code Playgroud)
但文档表明它是这样的:
extend type Person{
salary: Int!
}
Run Code Online (Sandbox Code Playgroud)
那么,我如何查询员工工资?如果 Person 有多个扩展名,例如 Employee 和 Renter 呢?我想我可能会受到传统思维的阻碍,但我希望扩展能够产生命名和可查询的东西。
我有一个web /核心模块项目.我在Eclipse/STS环境中遇到此错误"上下文中只存在一个AsyncAnnotationBeanPostProcessor",即使应用程序在Tomcat中启动得很好.我觉得这不是一个真正的错误,但是因为它确定了它会导致构建我的项目的问题,我想摆脱它.
我很确定我不会导入包含任务的资源:annotation-driven executor ="myExecutor"scheduler ="myScheduler"多次,至少没有明确说明.
我使用Quartz但是我没有使用@Scheduled,我通过xml创建了预定的bean.我在整个应用程序中使用@Async.
我在我的网络项目中:
web.xml中
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:/root-context.xml
/WEB-INF/security.xml
</param-value>
</context-param>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>dirAllowed</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/dispatcher-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
Run Code Online (Sandbox Code Playgroud)
根的context.xml
<import resource="classpath*:/spring/applicationContext-schedule.xml" />
<import resource="classpath*:/spring/applicationContext-ology.xml" />
<import resource="classpath*:/spring/applicationContext-mercadosa.xml" />
<import resource="classpath*:/spring/applicationContext-webapp.xml" />
<import resource="classpath*:/spring/applicationContext-ws.xml" />
<import resource="classpath*:/spring/applicationContext-services.xml" />
<import resource="classpath*:/spring/applicationContext.xml" />
<import resource="classpath*:/spring/applicationContext-transaction.xml" />
<import resource="classpath*:/spring/applicationContext-dao.xml" />
<import resource="classpath*:/spring/applicationContext-facet.xml" />
<import resource="classpath*:/spring/applicationContext-social.xml" />
Run Code Online (Sandbox Code Playgroud)
的applicationContext-scheduled.xml
<task:annotation-driven executor="myExecutor" scheduler="myScheduler"/>
<task:executor
id="myExecutor"
pool-size="5-10"
queue-capacity="25"
rejection-policy="CALLER_RUNS"/>
<task:scheduler id="myScheduler" pool-size="3"/>
<bean
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list> …Run Code Online (Sandbox Code Playgroud) 我意识到css动画是一个很好的主题,但我只是想知道创建简单幻灯片转换的最佳方法?大多数情况下,当你读到像这样的幻灯片转换时,某种位置:绝对是假定的.这不是内容通常以HTML格式组织的方式,也不应该如此.
所以,如果我想创建一个div滑动到左边并且一个div从右边滑动的过渡,那么在不假设任何这些div具有绝对定位或任何其他特定过渡特定内容的情况下,这将是一个好策略.从...开始?
<div class="container">
<div class="this-should-slide-left">
<div>Some content</div>
<div>Some more</div>
</div>
<div class="this-should-from-left"><!--not visible initially-->
<div>Some more content</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我提出这个似乎有效的解决方案,即使我不确定它是否优雅:
我从create-react-app中退出,import type运行测试站点时(使用yarn start)出现了问题。
Module parse failed: /project/src/web/MarkdownField.js Unexpected token (6:12)
You may need an appropriate loader to handle this file type.
当我使用时yarn flow,过程完成而没有错误。
.babelrc
{
"presets": ["flow", "es2015", "react", "stage-2"]
}
Run Code Online (Sandbox Code Playgroud)
.flowconfig
[libs]
./flow-typed
[options]
esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
[include]
./src/**
Run Code Online (Sandbox Code Playgroud)
mdTypes.types.js
// @flow
import { propTypes } from 'redux-form';
export type FieldType = {
field: propTypes.fieldPropTypes
};
Run Code Online (Sandbox Code Playgroud)
MarkdownField.js
// @flow
import React from 'react';
import PropTypes from 'prop-types';
import MDE from 'medium-editor';
import MeMarkdown from …Run Code Online (Sandbox Code Playgroud) 我在使用node-mysql2测试项目时遇到问题,做出反应,排序和开玩笑。仅在测试过程中会出现此问题。
Encoding not recognized: 'cesu8' (searched as: 'cesu8')
at Object.getCodec (project/node_modules/mysql2/node_modules/iconv-lite/lib/index.js:106:23)
at Object.getDecoder (project/node_modules/mysql2/node_modules/iconv-lite/lib/index.js:122:23)
at Object.<anonymous>.exports.decode (project/node_modules/mysql2/lib/parsers/string.js:9:23)
at Packet.Object.<anonymous>.Packet.readNullTerminatedString (project/node_modules/mysql2/lib/packets/packet.js:373:23)
at Function.Object.<anonymous>.Handshake.fromPacket (project/node_modules/mysql2/lib/packets/handshake.js:18:31)
at ClientHandshake.Object.<anonymous>.ClientHandshake.handshakeInit (project/node_modules/mysql2/lib/commands/client_handshake.js:98:38)
at ClientHandshake.Object.<anonymous>.Command.execute (project/node_modules/mysql2/lib/commands/command.js:40:20)
at Connection.Object.<anonymous>.Connection.handlePacket (project/node_modules/mysql2/lib/connection.js:515:28)
at PacketParser.onPacket (project/node_modules/mysql2/lib/connection.js:94:16)
at PacketParser.executeStart (project/node_modules/mysql2/lib/packet_parser.js:77:14)
at Socket.<anonymous> (project/node_modules/mysql2/lib/connection.js:102:29)
Run Code Online (Sandbox Code Playgroud) 当我将Maps.uniqueIndex与包含重复值的List一起使用时,
java.lang.IllegalArgumentException: duplicate key: 836
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:115)
Run Code Online (Sandbox Code Playgroud)
被扔了.
我发现这很不方便.我认为它确实有意义,但如果函数需要一个唯一的集合才能正常工作,为什么它接受一个Iterable作为参数而不是一个Set?
List<GroupVO> groups = groupDao.getAll(groupIds);
Map<String,GroupVO> groupMap groupMap = Maps.uniqueIndex(groups, new Function<GroupVO,String>() {
public String apply(GroupVO vo) {
return vo.getId().toString();
}});
Run Code Online (Sandbox Code Playgroud)