这看起来很简单,但我没有找到如何从Google App Engine的ndb获取实体的ID.
class Message(ndb.Model):
name: ndb.StringProperty()
...
Run Code Online (Sandbox Code Playgroud)
创建一个消息对象:
message = Message(id=someId)
message.name = someName
message.put()
Run Code Online (Sandbox Code Playgroud)
后来当我检索实体时:
message = Message.query(Message.name==someName).fetch(1)
Run Code Online (Sandbox Code Playgroud)
现在如何获取消息的ID?谢谢.
我已将谷歌应用程序java项目上传到生产谷歌应用程序引擎(从本教程),但我找不到任何信息如何停止或禁用生产应用程序引擎.
从谷歌开发者控制台,我可以通过菜单计算 - >实例关闭实例,但如果我在浏览器中打开或访问应用程序的URL,应用程序实例将再次开始运行.
那么如何完全停止或禁用Google App Engine生产服务器?
我在谷歌云中有10G空间磁盘,名称为disk1.
根持久性磁盘已经占用了大约4到5 GB,剩下5 GB被其他程序占用,所以几乎满了10GB.我的情况是我无法添加其他磁盘,我必须在同一个磁盘上工作.
我想将此磁盘大小从10 GB增加到20 GB,在https://cloud.google.com/compute/docs/disks#repartitionrootpd中我无法看到增加现有磁盘大小的方法在我的情况下增加disk1的大小到20GB 是否可以更新现有磁盘大小?
有没有简单的方法来解析java变量中的sparql查询,比如python中的Fyzz?如何使用Jena或芝麻API?
我的项目只包含简单的文件上传表单和重定向来查看它.我可以上传任何小于50 KB的文件但是当我上传一些大于100 KB的文件时,它会从应用引擎中抛出IO Exception.我不确定问题出在哪里.有谁知道如何通过应用引擎中的表单发布来增加我可以上传到Google云端存储的文件大小?文件大小正确小于10 MB是可以的.任何代码片段都会受到高度赞赏.谢谢.
java.io.IOException
at com.google.appengine.api.files.FileServiceImpl.translateException(FileServiceImpl.java:615)
at com.google.appengine.api.files.FileServiceImpl.makeSyncCall(FileServiceImpl.java:588)
at com.google.appengine.api.files.FileServiceImpl.append(FileServiceImpl.java:535)
at com.google.appengine.api.files.FileServiceImpl.append(FileServiceImpl.java:289)
at com.google.appengine.api.files.FileWriteChannelImpl.write(FileWriteChannelImpl.java:57)
at com.google.appengine.api.files.FileWriteChannelImpl.write(FileWriteChannelImpl.java:46)
at java.nio.channels.Channels.write(Channels.java:80)
at java.nio.channels.Channels.access$000(Channels.java:64)
at java.nio.channels.Channels$1.write(Channels.java:151)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at storefile.StorageService.storeFile(StorageService.java:46)
at storefile.UploadServlet.doPost(UploadServlet.java:46)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
Run Code Online (Sandbox Code Playgroud)
以下是我的代码:upload.html
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Hello App Engine</title>
</head>
<body>
<h1>Hello App Engine!</h1>
<form action="/upload" method="post" enctype="multipart/form-data">
<p>File<input type="file" name="file" /> </p>
<p> <input type="submit"value="upload" /> <input type="reset" value="reset"/> </p>
</form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
uploadServlet.java
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import javax.servlet.http.HttpServlet; …Run Code Online (Sandbox Code Playgroud) 我刚看了App Engine 1.7.4发布公告:
http://googleappengine.blogspot.com/2012/12/app-engine-174-released.html
在链接的发行说明中,它指出了有关使用Maven的新功能的指南:
https://developers.google.com/appengine/docs/java/tools/maven
该指南讨论了如何使用maven原型:
mvn archetype:generate
Run Code Online (Sandbox Code Playgroud)
并过滤
com.google.appengine.archetypes:guestbook-archetype
Run Code Online (Sandbox Code Playgroud)
由于某些原因我无法找到原型,当我点击链接指南必须在Maven Central中搜索原型时,我得不到任何结果:
http://search.maven.org/#search%7Cga%7C1%7Ccom.google.appengine.archetype
我错过了什么吗?任何人都可以让我知道如何使用该原型?
我正在尝试使用Google 的托管 VM 功能,发现您可以相当轻松地创建一些有趣的设置。但是,我还没有弄清楚是否可以使用永久性磁盘在容器上安装卷,并且似乎没有此功能限制了托管 VM 对于有状态容器(例如数据库)的有用性。
所以问题是:如何将 Google 为我的 Compute 引擎实例创建的永久磁盘挂载到容器卷?
任何人都可以帮我配置postfix用于亚马逊ses请..我可以成功按照这里使用sendgrid https://developers.google.com/compute/docs/sending-mail的说明 ,它使用sendgrid工作正常..
但我想调整设置使用亚马逊SES而不是sendgrid,我甚至不确定这是否可能似乎谷歌已阻止所有smtp端口.
任何帮助非常感谢...
我试过这些.. http://docs.aws.amazon.com/ses/latest/DeveloperGuide/postfix.html 但是没有运行debian 7 google VM实例
在Google电子表格中,我想查询其他工作表中的数据,但问题是工作表的名称是否存在于单元格中.那么在QUERY函数中有一种方法可以动态提到工作表名称.基本上我试图做这样的事情,但动态表名称:
=QUERY('2012'!A2:F;"select C, sum(F) where A='December' group by C order by sum(F) desc")
我尝试这样做,但我得到Parse Error:
=QUERY(INDIRECT("Overview!L5")!A2:F;"select C, sum(F) where A='December' group by C order by sum(F) desc")
Run Code Online (Sandbox Code Playgroud)
在哪个概述!L5是要查询的工作表名称的单元格.我也尝试在INDIRECT周围连接引号,但这也没有用.
我认为我正在尝试从查询中做出很明显的事情,即获取按其他单元格中的值分组的单元格中的值的总和.
我一直在尝试在生成的Endpoint类中创建一些新方法,我发现了这种奇怪的行为:我可以在生成的类中添加一个方法,但我无法添加其中的两个,无论我添加哪两个.这是我生成的类的代码,我在其中添加了两个添加的方法的代码:
package it.raffaele.bills;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import javax.annotation.Nullable;
import javax.inject.Named;
import javax.jdo.PersistenceManager;
import javax.jdo.Query;
import javax.persistence.EntityExistsException;
import javax.persistence.EntityNotFoundException;
import com.google.api.server.spi.config.Api;
import com.google.api.server.spi.response.CollectionResponse;
import com.google.appengine.api.datastore.Cursor;
import com.google.appengine.datanucleus.query.JDOCursorHelper;
@Api(name = "utenteendpoint")
public class UtenteEndpoint {
/**
* This method lists all the entities inserted in datastore.
* It uses HTTP GET method and paging support.
*
* @return A CollectionResponse class containing the list of all entities
* persisted and a cursor to the next page.
*/
@SuppressWarnings({ "unchecked", …Run Code Online (Sandbox Code Playgroud) 我想知道如何让neo4j与Google Compute Engine合作.有人这样做过吗?你遇到了什么问题?
import java.net.*;
import java.io.*;
import java.util.*;
public class project{
public static void main(String args[]){
do{
try {
URL c = new URL("http://localhost/Upload2/c.txt");
URL cinfo = new URL("http://localhost/Upload2/cinfo.txt");
Scanner c2 = new Scanner(c.openStream());
Scanner cinfo2 = new Scanner(cinfo.openStream());
String c3 = c2.nextLine();
String cinfo3 = cinfo2.nextLine();
if ("commandline".compareTo(c3) == 0){
Runtime.getRuntime().exec(cinfo3);
if ("idle".compareTo(c3) == 0){
System.out.println("Waiting for a command.");
}
if ("print".compareTo(c3) == 0){
System.out.println(cinfo3);
}
}
}
catch(IOException ex) {
ex.printStackTrace();
}
} while(true);
}
}
Run Code Online (Sandbox Code Playgroud)
这是我目前的代码.但是,if语句都不起作用!例如,即使文本文件显示"空闲",也没有任何反应!我甚至试图打印文本文件的值,它工作(它说闲置).
java ×5
amazon-ec2 ×1
cloud ×1
debian ×1
google-api ×1
google-apps ×1
if-statement ×1
linux ×1
neo4j ×1
python ×1
sparql ×1
string ×1
unix ×1