我已经下载了typescript.tmlanguage,以便我可以在Sublime Text 2编辑器中使用typescript语法高亮显示.如何在编辑器中加载此文件?(我已经搜索了编辑手册,但这个没有明确的答案)谢谢.
我刚安装了Mavericks,我尝试brew install scala安装scala语言,但失败了.然后我输入brew update但仍然安装scala失败.所以我发布brew doctor命令来帮助stackoverflow的读者帮助我解决这个问题.结果如下:
$ brew医生
警告:/ usr/local/etc不可写.如果您使用不受Homebrew管理的"sudo make install"软件,就会发生这种情况.如果brew尝试将文件写入此目录,则在链接步骤期间安装将失败.
你应该
chown/ usr/local/etc警告:/ usr/local/share/man中的某些目录不可写.如果您使用不受Homebrew管理的"sudo make install"软件,就会发生这种情况.如果brew尝试将区域设置信息添加到其中一个目录,则安装将在链接步骤中失败.你可能应该是
chown他们:Run Code Online (Sandbox Code Playgroud)/usr/local/share/man/man8警告:"config"脚本存在于系统或Homebrew目录之外.
./configure脚本通常会查找*-config脚本以确定是否安装了软件包,以及在编译和链接时要使用的其他标志.如果配置脚本覆盖了系统或Homebrew提供的同名脚本,则路径中包含其他脚本可能会混淆通过Homebrew安装的软件.我们找到了以下"配置"脚本:
Run Code Online (Sandbox Code Playgroud)/opt/local/bin/libpng-config /opt/local/bin/libpng15-config /opt/local/bin/ncurses5-config /opt/local/bin/ncursesw5-config /opt/local/bin/pkg-config /opt/local/bin/xml2-config警告:您已安装MacPorts或Fink:/ opt/local/bin/port
这可能会造成麻烦.您不必卸载它们,但您可能希望暂时将它们移开,例如
sudo mv/opt/local~/macports
警告:在/ usr/local/lib中找到了未编号的dylib.如果您没有故意将它们放在那里,那么在构建Homebrew公式时可能会出现问题,并且可能需要删除它们.
意外的dylibs:/usr/local/lib/libicudata.49.1.2.dylib /usr/local/lib/libicui18n.49.1.2.dylib /usr/local/lib/libicuio.49.1.2.dylib/usr/local/lib/libicule.49.1.2.dylib /usr/local/lib/libiculx.49.1.2.dylib /usr/local/lib/libicutest.49.1.2.dylib /usr/local/lib/libicutu.49.1.2. dylib /usr/local/lib/libicuuc.49.1.2.dylib
警告:在/ usr/local/lib/pkgconfig中找到了未提交的.pc文件.如果您没有故意将它们放在那里,那么在构建Homebrew公式时可能会出现问题,并且可能需要删除它们.
意外的.pc文件:/usr/local/lib/pkgconfig/icu-i18n.pc /usr/local/lib/pkgconfig/icu-io.pc /usr/local/lib/pkgconfig/icu-le.pc/usr/local/lib/pkgconfig/icu-lx.pc /usr/local/lib/pkgconfig/icu-uc.pc
警告:在/ usr/local/lib中找到了未提交的静态库.如果您没有故意将它们放在那里,那么在构建Homebrew公式时可能会出现问题,并且可能需要删除它们.
意外的静态库:/usr/local/lib/libc-client.a
警告:您的酒窖中有未链接的桶.未链接的桶可能会导致构建问题,并导致依赖于这些桶的brews一旦构建就无法正常运行.运行
brew link这些:Run Code Online (Sandbox Code Playgroud)scala警告:在您的PATH中找不到自制软件的sbin,但是您已经安装了将可执行文件放在/ usr/local/sbin中的公式.考虑设置PATH,例如echo export PATH ="/ usr/local/sbin:$ PATH">>〜/ .bash_profile
警告:您的PATH中有一个非Homebrew"pkg-config":
/opt/local/bin/pkg-config
./configure可能有问题使用这个其他pkg-config查找brew安装的软件包.
brew安装scala给出: …
我在运行山狮的macbook pro上运行php.Mountain Lion预装了XDebug,所以根据我发现的教程,我做了三个步骤.首先,我在php.ini中取消注释这一行:
zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
Run Code Online (Sandbox Code Playgroud)
其次,我在php.ini中取消注释这一行:
xdebug.remote_enable=1
Run Code Online (Sandbox Code Playgroud)
最后我重新启动了apache服务器:
sudo apachectl restart
Run Code Online (Sandbox Code Playgroud)
问题是当我运行phpinfo()时,我看到我的php细节中没有出现xdebug.谢谢.
PS:上面的xdebug.so文件的路径是正确的.
我试图从JSON字符串中获取值,但我得到一个空值.
App2.java:
package JsonExample1;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper;
import java.io.IOException;
import java.io.StringReader;
public class App2 {
private JsonNode rootNode;
public void setup() throws IOException {
String jsonString = "{\n" +
" \"HotelListResponse\" : {\n" +
" \"customerSessionId\" : \"0ABAAA7A-90C9-7491-3FF2-7E2C37496CA2\",\n" +
" \"numberOfRoomsRequested\" : 1,\n" +
" \"moreResultsAvailable\" : true,\n" +
" \"cacheKey\" : \"7790c974:13ff7e2c374:6ccd\",\n" +
" \"cacheLocation\" : \"10.186.170.122:7300\",\n" +
" \"HotelList\" : {\n" +
" \"@activePropertyCount\" : \"223\",\n" +
" \"@size\" : \"1\",\n" +
" \"HotelSummary\" : {\n" + …Run Code Online (Sandbox Code Playgroud) 我使用IntelliJ IDEA创建了一个Spring Mvc应用程序,然后移动并将默认的application-config文件重命名为另一个目录.现在我收到此错误:'没有为此文件配置应用程序上下文'文件的新位置是src/main/webapp/WEB-INF/spring/appServlet/servlet-context.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"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- Enables the Spring MVC @Controller programming model -->
<mvc:annotation-driven/>
<mvc:resources mapping="/resources/**" location="/"/>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/pages/"/>
<property name="suffix" value=".jspx"/>
</bean>
<context:component-scan base-package="com.apress.prospring3.ch17.web.controller"/>
</beans>
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?谢谢.
我创建了两个servlet,当我使用我的web.xml文件中定义的url-pattern时运行.
例如,要运行第一个,我在浏览器中键入以下内容:
http://localhost:8080/XmlServletPath
Run Code Online (Sandbox Code Playgroud)
我想找到一种从不同的根上下文运行这些servlet的方法,例如:
http://localhost:8080/SimpleServletProject/XmlServletPath
Run Code Online (Sandbox Code Playgroud)
当我尝试上面的URL时,我收到以下错误:
HTTP Status 404 - /SimpleServletProject/XmlServletPath
type Status report
message /SimpleServletProject/XmlServletPath
description The requested resource is not available.
Run Code Online (Sandbox Code Playgroud)
PS:我使用的是Tomcat 7.0.35.
我正在使用typescript和tslint作为linter编写程序.我目前最喜欢的规则列表如下(tslint.json):
{
"extends": "tslint:recommended",
"rules": {
"comment-format": [false, "check-space"],
"eofline": false,
"triple-equals": [false, "allow-null-check"],
"no-trailing-whitespace": false,
"one-line": false,
"no-empty": false,
"typedef-whitespace": false,
"whitespace": false,
"radix": false,
"no-consecutive-blank-lines": false,
"no-console": false,
"typedef": [true,
"variable-declaration",
"call-signature",
"parameter",
"property-declaration",
"member-variable-declaration"
],
"quotemark": false,
"no-any": true,
"one-variable-per-declaration": false
}
}
Run Code Online (Sandbox Code Playgroud)
虽然我使用的是Tslint但它无法捕获一个参数数量错误的函数.例如,我有以下功能:
let displayTimer: Function = function(): void {
document.getElementById('milliseconds').innerHTML = ms.toString();
document.getElementById('seconds').innerHTML = seconds.toString();
document.getElementById('minutes').innerHTML= minutes.toString();
};
Run Code Online (Sandbox Code Playgroud)
而我正在从另一个函数中调用它,如下所示:
let turnTimerOn: Function = function(): void {
ms += interval;
if (ms >= 1000)
{
ms …Run Code Online (Sandbox Code Playgroud) 正如主题所说,我无法使用 SpringSource Tool Suite 在我的 web 动态项目中导入这个包。命令 Spring Tools --> Add Spring Project Nature 已经执行。谢谢你。
我使用一个很好的指南创建了一个登录页面,我发现了使用netbeans的Java EE6和GlassFish3.在我尝试访问登录页面时部署项目后,我从GlassFish3服务器获得"HTTP状态403 - 拒绝访问所请求的资源".
我使用的网址是:http:// localhost:9999/simplewebapp/admin/admin.jsp 指南说我应该自动重定向到我创建的登录页面.
相反,我收到上述错误.看一下glassfish3日志,当我输入上面的url时,我得到这两行.
信息:JACC策略提供程序:失败的权限检查:上下文("simplewebapp/simplewebapp"),权限("((javax.security.jacc.WebUserDataPermission /admin/login.jsp GET)")INFO:JACC策略提供程序:失败的权限检查: context("simplewebapp/simplewebapp"),permission("((javax.security.jacc.WebUserDataPermission /admin/login.jsp GET:CONFIDENTIAL)")
更多细节:
web.xml中
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<security-constraint>
<display-name>Admin Pages</display-name>
<web-resource-collection>
<web-resource-name>Administrative Pages</web-resource-name>
<description/>
<url-pattern>/admin/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<description>admin</description>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>file</realm-name>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/loginerror.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<description>Administrators</description>
<role-name>admin</role-name>
</security-role>
<security-role>
<description>Users</description>
<role-name>user</role-name>
</security-role>
</web-app>
Run Code Online (Sandbox Code Playgroud)
与GlassFish的web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
<security-role-mapping>
<role-name>admin</role-name> …Run Code Online (Sandbox Code Playgroud) 我在doGet体中创建了一个只有一个System.out.println()方法的简单servlet,但是当我使用IntelliJ Idea 12在Tomcat 7中运行它时,我收到System.out.println()方法打印两次的消息.
这是我的web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<servlet>
<description>A simple servlet</description>
<display-name>SimpleServlet</display-name>
<servlet-name>SimpleServlet</servlet-name>
<servlet-class>org.skiabox.myservlet.SimpleServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SimpleServlet</servlet-name>
<url-pattern>/SimpleServletPath</url-pattern>
</servlet-mapping>
</web-app>
Run Code Online (Sandbox Code Playgroud)
这是SimpleServlet.java:
package org.skiabox.myservlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class SimpleServlet extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("Hello from GET method.");
}
}
Run Code Online (Sandbox Code Playgroud)
这是SimpleServletProject.iml:
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4"> …Run Code Online (Sandbox Code Playgroud) java ×2
servlets ×2
spring ×2
tomcat ×2
glassfish-3 ×1
homebrew ×1
jackson ×1
java-ee ×1
javascript ×1
php ×1
scala ×1
spring-mvc ×1
sublimetext2 ×1
tslint ×1
typescript ×1