我正在使用AWS(和相关服务),希望我可以留在Free Tier中,就像我在浏览Google App Engine时一样.
几天前,我收到了亚马逊的一封信,他在我2天的探索中收取了33美元左右的费用.
这已经结束了,但我忘记了我启用了哪些服务.理想情况下,我只是完全禁用AWS账户,因为没有免费的沙盒,我将无法使用他们的服务.是否有一个全局关闭按钮,或者我是否需要偶然发现他们单独关闭所有服务?或者我是否必须删除我的CC信息并完全创建一个新的亚马逊帐户?
我刚刚安装了Centos 6.4,并使用Centos发行版附带的版本安装了MySQL.令我沮丧的是,MySQL 5.1.69与当前的5.6.12相比.如http://dev.mysql.com/doc/refman/5.5/en/linux-installation-native.html所述,"MySQL版本通常会落后于当前版本",但我没有期待那么久.
[root@centosBox ~]# rpm -qa | grep mysql
mysql-5.1.69-1.el6_4.x86_64
mysql-devel-5.1.69-1.el6_4.x86_64
mysql-server-5.1.69-1.el6_4.x86_64
mysql-libs-5.1.69-1.el6_4.x86_64
[root@centosBox ~]# whereis mysql
mysql: /usr/bin/mysql /usr/lib64/mysql /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
[root@centosBox ~]#
Run Code Online (Sandbox Code Playgroud)
另一种方法是根据http://dev.mysql.com/doc/refman/5.5/en/linux-installation-rpm.html安装RPM软件包,这是"推荐安装MySQL的方法" .我已经这样做了,并没有过于复杂,但是,我担心,因为我经常被告知我应该总是按照yum安装.在文档的最后,它确实描述了使用yum非常短暂地这样做,然而,它是如此简短,我怀疑它是否是要走的路.
那么......对于不是大师的Linux用户来说,在Centos机器上安装/升级MySQL的最佳方法是什么?
我试图在编译时将一些方面编织成一个成为WAR的项目.这些方面建议在同一个项目中的类(尽管在不同的包中).
我收到警告:
Advice not applied
Run Code Online (Sandbox Code Playgroud)
我的方面没有被执行.这是我的设置:
注释FooAnnotation.java:
package a;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface FooAnnotation {}
Run Code Online (Sandbox Code Playgroud)
方面FooAdvice.aj:
package a;
public aspect FooAdvice {
private static final Log log = LogFactory.getLog(FooAdvice.class);
Object around() : call( @FooAnnotation * *(..)) {
log.info(String.format("Testing around"));
return proceed();
}
}
Run Code Online (Sandbox Code Playgroud)
我也试过了注释:
@Around("call( @FooAnnotation * *(..))")
public Object checkFoo( ProceedingJoinPoint joinPoint) throws Throwable {
Run Code Online (Sandbox Code Playgroud)
据我所知,我的切入点规范是正确的,但由于某种原因,ajc编译器没有打球.
类FooClass.java:
package b;
@ApplicationPath("/service")
@Path("/{param}")
@Produces("application/json")
@Provider
public class FooClass {
@POST
@PUT
@Path("/{context}/{resource}")
@FooAnnotation
public String updateResource(...) {}
Run Code Online (Sandbox Code Playgroud)
pom.xml中:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" …
Run Code Online (Sandbox Code Playgroud) 这个图书馆非常非常酷。我有以下问题:
我有多个列表,并且我希望能够在列表内以及列表之间进行拖放以重新排序。在下面的列表中,用户可以选择将合作伙伴移至列表内,或从一个列表移动到另一个列表。
默认情况下,项目只能在同一组件内拖动。如何创建一组可以作为彼此项目目标的组件?
应用程序.js
import React from 'react';
import './App.css';
import SortablePartner from './SortablePartner';
const priorityPartners = [
"AwesomeTech",
"Bazinga Software"
];
const medPartners = [
"Zippy-Do",
"SillySoft",
"Samsonite"
];
const lowPartners = [
"Acme Engineering",
"Elbow Tech",
"Rockets & Ricers"
];
function App() {
return (
<div className="App">
<header className="App-header">
<h1>Prioritize Your Partners</h1>
</header>
<div className="SortableContainer">
<SortablePartner priority="High" state={priorityPartners} />
<SortablePartner priority="Medium" state={medPartners} />
<SortablePartner priority="Low" state={lowPartners} />
</div>
</div>
);
}
export default App;
Run Code Online (Sandbox Code Playgroud)
SortablePartner.js
import React, {Component} …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用springfox项目做一些工作,该项目已分解为两个独立的项目:springfox 运行时和一套演示。
为了调查某些配置的行为,我需要更改 中的模块springfox/springfox-petstore
,并将其编译为springfox-demos/springfox-java-swagger
.
在 中springfox
,我构建并发布了 的新版本springfox-petstore
,并验证它在~/.m2/repository/io/springfox/springfox-petstore/2.2.2-SNAPSHOT
.
接下来,在springfox-demos
我添加mavenLocal()
为存储库,并添加springfox-petstore-2.2.2-SNAPSHOT
为changing=true
依赖项。
当我尝试构建springfox-demos
运行时时,出现以下错误:
* What went wrong:
A problem occurred configuring project ':spring-java-swagger'.
> Could not resolve all dependencies for configuration ':spring-java-swagger:runtimeCopy'.
> Could not find io.springfox:springfox-petstore:2.2.2-SNAPSHOT.
Searched in the following locations:
https://jcenter.bintray.com/io/springfox/springfox-petstore/2.2.2-SNAPSHOT/maven-metadata.xml
https://jcenter.bintray.com/io/springfox/springfox-petstore/2.2.2-SNAPSHOT/springfox-petstore-2.2.2-SNAPSHOT.pom
https://jcenter.bintray.com/io/springfox/springfox-petstore/2.2.2-SNAPSHOT/springfox-petstore-2.2.2-SNAPSHOT.jar
http://oss.jfrog.org/artifactory/oss-snapshot-local/io/springfox/springfox-petstore/2.2.2-SNAPSHOT/maven-metadata.xml
http://oss.jfrog.org/artifactory/oss-snapshot-local/io/springfox/springfox-petstore/2.2.2-SNAPSHOT/springfox-petstore-2.2.2-SNAPSHOT.pom
http://oss.jfrog.org/artifactory/oss-snapshot-local/io/springfox/springfox-petstore/2.2.2-SNAPSHOT/springfox-petstore-2.2.2-SNAPSHOT.jar
Required by:
springfox-demos:spring-java-swagger:unspecified
Run Code Online (Sandbox Code Playgroud)
我已经尝试了各种构建任务的组合,但我似乎无法让 Gradle 满足我使用带有 -SNAPSHOT 工件的本地 maven 存储库的请求。
这是顶级 build.gradle:
buildscript { …
Run Code Online (Sandbox Code Playgroud) 我是第一次使用谷歌GO.我已经扩展了"hello world"应用程序,试图在init部分中定义路径.这是我到目前为止所做的:
package hello
import (
"fmt"
"net/http"
)
func init() {
http.HandleFunc("/service", serviceHandler)
http.HandleFunc("/site", siteHandler)
http.HandleFunc("/", handler)
}
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "Hello, there")
}
func serviceHandler( w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "this is Services")
}
func siteHandler( w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "this is Sites")
}
Run Code Online (Sandbox Code Playgroud)
只执行handler()
回调 - 其他被忽略.例如:http://myserver/service/foo
打印Hello, there
.我曾希望会这样this is Services
.
有没有更好的方法来进行服务路由?理想情况下,我希望这些都是单独的脚本,但看起来Go只有一个脚本,基于app.yaml _go_app
在脚本声明中需要特殊字符串的事实.
谢谢!
我正在尝试持久化实体,并允许数据库生成密钥.不幸的是,我似乎无法从API中取出合成ID ...这就是我正在做的事情:
case "POST":
d,_ := ioutil.ReadAll( r.Body)
participant := new(Participant)
err := json.Unmarshal( d, &participant)
if err != nil {
serveError( c, w, err)
return
}
var key *datastore.Key;
if participant.ID == 0 {
// no id yet .. create an incomplete key and allow the db to create one.
key = datastore.NewIncompleteKey( c, "participant", parentKey)
} else {
// we have an id. use that to update
key = datastore.NewKey( c, "participant", "", participant.ID, parentKey)
}
// PERSIST! …
Run Code Online (Sandbox Code Playgroud) 所以,我正在使用GO解析POST.我想要的是帖子的正文,所以我尝试以下(在此上下文中r
是类型*http.Request
):
var body io.Reader
var d []byte
body = r.Body.Reader
body.Read( d)
Run Code Online (Sandbox Code Playgroud)
但是,这会导致编译错误:
Compile error: <file>:44:
r.Body.Reader undefined (type io.ReadCloser has no field or method Reader)
Run Code Online (Sandbox Code Playgroud)
奇.我本可以发誓它是在文档中定义的......啊!在这里.
现在,我对Go来说相当新,但这有点奇怪 - 我搞砸了什么?