小编Kei*_*son的帖子

HTML PUT sails-filemaker

我刚刚开始使用sails-filemaker与文件制作服务器通信.我喜欢它:-)我正在寻找一种方法来处理HTML PUT请求来更新记录.

模型是

    /**
    * LocalityFilemaker.js
    *
    * @description :: Suburbs (locality) in the evolution database.
    * @docs        :: http://sailsjs.org/#!documentation/models
    */

    module.exports = {

        connection: 'filemaker', 
        tableName: 'locality-sails-layout',

      attributes: {
            id: {
                type: 'integer',
                primaryKey: true,
                autoIncrement: true
            }, 
            suburb: {
                type: 'string'
            },
            state: {
                type: 'string'
            },
            postcode: {
                type: 'string'
            }

      }

    };
Run Code Online (Sandbox Code Playgroud)

当我打电话给{{url}}/localityFilemaker/12600时,我得到了回复.

    {
      "id": 12600,
      "suburb": "LARGS BAY",
      "state": "SA",
      "postcode": "5016",
      "modid": "3",
      "recid": "29500",
      "createdAt": "1970-01-01T00:00:00.000Z",
      "updatedAt": "1970-01-01T00:00:00.000Z"
    }
Run Code Online (Sandbox Code Playgroud)

当我向{{url}}/localityFilemaker/12600或{{url}}/localityFilemaker调用put时

    {
      "id": 12600, …
Run Code Online (Sandbox Code Playgroud)

filemaker sails.js

2
推荐指数
1
解决办法
246
查看次数

如何在启动时显式启动一个版本的 postgres?

我管理一个旧的 ubuntu 服务器 12.04,上面有 postgresql 9.1。

我为我们想要使用的新应用程序成功安装了 postgresql 9.6。

我面临的问题是出于某种原因

service postgresql start
* Starting PostgreSQL 9.1 database server                                                                                                       
[ OK ] 
* Starting PostgreSQL 9.6 database server 
[ OK ]
Run Code Online (Sandbox Code Playgroud)

启动 9.1 服务器9.6 服务器。

我正在寻找一种仅在默认端口上启动 9.6 服务器的方法。

我查看了/etc/inid.d/postgresql。这段摘录看起来可能是关键。

# versions can be specified explicitly
if [ -n "$2" ]; then
    versions="$2 $3 $4 $5 $6 $7 $8 $9"
else
    get_versions
fi
Run Code Online (Sandbox Code Playgroud)

看起来我只需要在命令行上传递版本即可。

service postgresql start 9.6
Run Code Online (Sandbox Code Playgroud)

是的……它起作用了。

所以我的问题是......如何在重新启动时自动发生这种情况?

postgresql ubuntu-12.04

2
推荐指数
1
解决办法
4617
查看次数

我可以在选择列表中使用 Postgres 关键字作为别名吗?

今天早上我遇到了一个奇怪的问题。我正在创建一个视图来简化 Postgres 表中的应用程序列表。

这失败了。

CREATE OR REPLACE VIEW application_view AS 
SELECT COALESCE( nullif(full_name,''), nullif(additional_info,''), app_name) name
, id
FROM application
ORDER BY COALESCE( nullif(full_name,''), nullif(additional_info,''), app_name) 
Run Code Online (Sandbox Code Playgroud)

然而

CREATE OR REPLACE VIEW application_view AS 
SELECT COALESCE( nullif(full_name,''), nullif(additional_info,''), app_name) application
, id
FROM application
ORDER BY COALESCE( nullif(full_name,''), nullif(additional_info,''), app_name) 
Run Code Online (Sandbox Code Playgroud)

工作了。

我经常使用 name 作为表中的列名,所以关于为什么第一个 sql 语句失败有什么想法吗?

postgresql

2
推荐指数
1
解决办法
787
查看次数

R 对象如何成为 typeof 列表并且还返回 is.data.frame true ?

我有一个名为 xCategories 的 R 对象

> xCategories

    code frequency percentage
1      1        75 12.3762376
2      1        75 12.3762376
3      1        75 12.3762376
4      1        75 12.3762376
5      1        75 12.3762376
6      2         0  0.0000000
7      2         0  0.0000000
8      2         0  0.0000000
9      3         8  1.3201320
10     3         8  1.3201320
11     3         8  1.3201320
12     3         8  1.3201320
Run Code Online (Sandbox Code Playgroud)

当我检查它是什么类型的对象时,答案是列表

> typeof(xCategories)
[1] "list"
Run Code Online (Sandbox Code Playgroud)

当我检查对象是否是数据框时......答案是正确的

> is.data.frame(xCategories)
[1] TRUE
Run Code Online (Sandbox Code Playgroud)

R 对象如何成为 typeof 列表并且还返回 is.data.frame true ?

r

1
推荐指数
1
解决办法
553
查看次数

安全websocket的协议是什么?

我们安装了一个Mattermost服务器,效果很好.

我们只能通过http连接.Https给出了一个错误.

失败的代码行是

webSocketClient, err := model.NewWebSocketClient4("ws://mattermost.example.com", client.AuthToken)

make run
go run   *.go
Mattermost Bot Sample
Server detected and is running version 5.1.0
We failed to connect to the web socket
    Error Details:
        model.websocket_client.connect_fail.app_error
        model.websocket_client.connect_fail.app_error
        websocket: bad handshake
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0x13e1e55]
Run Code Online (Sandbox Code Playgroud)

我们打开了http端口8065,当我们连接到端口8065时,没有ssl,它可以工作.

webSocketClient, err := model.NewWebSocketClient4("ws://mattermost.example.com:8065", client.AuthToken)
Run Code Online (Sandbox Code Playgroud)

安全websocket的协议是什么?

nginx go mattermost

1
推荐指数
1
解决办法
267
查看次数

标签 统计

postgresql ×2

filemaker ×1

go ×1

mattermost ×1

nginx ×1

r ×1

sails.js ×1

ubuntu-12.04 ×1