我正在努力REST API,我正在努力了解如何处理分层资源.
让我们从一个简单的例子开始.在我的API中,我有用户,用户个人资料和评论.
用户的资源表示应该是:
User: {
"u1": "u1value", // User's attributes
"u2": "u2value",
...
"links": [{
"rel": "profile",
"href": "http://..." // URI of the profile resource
}, {
"rel": "review",
"href": "http://..." // URI of the review resource
}]
}
Run Code Online (Sandbox Code Playgroud)
用户配置文件资源表示应为:
UserProfile: {
"p1": "p1value", // Profile attributes
"p2": "p2value",
...
"links": [{
"rel": "owner",
"href": "http://..." // URI of the user resource …Run Code Online (Sandbox Code Playgroud) 我的公司希望将Android设备提供给我们选定的一组客户.
这样做,我们希望为用户提供我们的移动应用程序.该应用已在Google Play上播放,但我们希望避免用户自行下载和安装.我们更愿意为设备做好准备,已经安装了应用程序.
我们找到了几种在手机上手动安装APK而无需登录市场的方法.但似乎这样做,用户将无法通过应用程序更新应用程序Google Play,因为应用程序将无法识别为已安装.
任何的想法?
我是iOS应用程序开发的新手,但我正在努力学习如何以最佳方式处理Cocoa.
我试图理解如何正确地保持和引用模型对象.
你能给我一些提示(和代码示例)吗?我想以适当的方式学习这些东西,考虑到我将很快走向核心数据.
我正在使用Hadoop/Spark进行一些信号分析,我需要有关如何构建整个过程的帮助.
信号现在存储在数据库中,我们将使用Sqoop读取,并将在HDFS上的文件中进行转换,其架构类似于:
<Measure ID> <Source ID> <Measure timestamp> <Signal values>
Run Code Online (Sandbox Code Playgroud)
其中信号值只是由浮点逗号分隔的数字组成的字符串.
000123 S001 2015/04/22T10:00:00.000Z 0.0,1.0,200.0,30.0 ... 100.0
000124 S001 2015/04/22T10:05:23.245Z 0.0,4.0,250.0,35.0 ... 10.0
...
000126 S003 2015/04/22T16:00:00.034Z 0.0,0.0,200.0,00.0 ... 600.0
Run Code Online (Sandbox Code Playgroud)
我们想写交互/批量查询到:
在信号值上应用聚合函数
SELECT *
FROM SIGNALS
WHERE MAX(VALUES) > 1000.0
Run Code Online (Sandbox Code Playgroud)
选择峰值超过1000.0的信号.
将聚合应用于聚合
SELECT SOURCEID, MAX(VALUES)
FROM SIGNALS
GROUP BY SOURCEID
HAVING MAX(MAX(VALUES)) > 1500.0
Run Code Online (Sandbox Code Playgroud)
选择至少具有超过1500.0的单个信号的源.
在样本上应用用户定义的函数
SELECT *
FROM SIGNALS
WHERE MAX(LOW_BAND_FILTER("5.0 KHz", VALUES)) > 100.0)
Run Code Online (Sandbox Code Playgroud)
选择在5.0 KHz过滤后至少具有超过100.0的值的信号.
我们需要一些帮助才能:
非常感谢你!
我正在学习REST原则,我对使用复杂资源有疑问.
假设我们有两个资源,Foo和Bar,对于每个Foo,我必须有一个Bar.我想使用我的API将bar的依赖关系从foo清除到开发人员,因此:
1)我将使用从Foo实例到Bar实例的链接,反之亦然
GET /foos/1
Foo: {
'name': 'Foo instance',
'rel_bar': '/foos/1/bar'
}
GET /foos/1/bar
Bar: {
'name': 'Bar instance',
'rel_foo': '/foos/1',
}
Run Code Online (Sandbox Code Playgroud)
2)我将使用一个URI模板,显示从Foo到Bar的依赖关系(这仅适用于人类,因为REST应该对REST不透明).
/foos --> Foo resource collection
/foos/{foo_id} --> An instance of a Foo resource
/foos/{foo_id}/bar --> The bar instance associated to the foo instance foo_id
Run Code Online (Sandbox Code Playgroud)
所以再一次,没有相应的foo就没有吧.
现在我想创建一个Foo资源.
POST /foos
{
'name': 'Yet again another foo instance',
}
Run Code Online (Sandbox Code Playgroud)
并让服务器创建相应的Bar默认(或空)资源,因此下次读取时会给出:
GET /foos/2
{
'name': 'Yet again another foo instance',
'rel_bar': '/foos/2/bar'
}
Run Code Online (Sandbox Code Playgroud)
和...
GET /foos/2/bar
{
'name': null, --> …Run Code Online (Sandbox Code Playgroud) 我编写了一个应该由JMX客户端控制的批处理Java 7应用程序.JMX服务已启动并正在运行,我可以使用我机器上的jConsole连接到它.
我设置选项-Dcom.sun.management.jmxremote.local.only = true以避免除127.0.0.1之外的任何传入连接.
但是......当我尝试从另一台计算机连接时,我的连接没有被过滤掉,我能够远程访问JMX.
这是java调用:
java -Dcom.sun.management.jmxremote ^
-Dcom.sun.management.jmxremote.port=7000 ^
-Dcom.sun.management.jmxremote.local.only=true ^
-Dcom.sun.management.jmxremote.authenticate=false ^
-Dcom.sun.management.jmxremote.ssl=false ^
-cp lib/*;hns-consumer.jar it.andrearota.com.Main %1
Run Code Online (Sandbox Code Playgroud)
看起来没有考虑该选项.
有帮助吗?