小编use*_*745的帖子

根据属性的值检索单个Realm对象

如何在使用Realm检索数据时返回带有值的类?我正在尝试使用此代码,但不允许使用swift 3:

static func getInfoById(id: String) -> DataInfo {
    let scope = DataInfo ()
    let realm = try! Realm()
    scope = realm.objects(DataInfo.self).filter("IdInfo == %@", id)
    return scope
}
Run Code Online (Sandbox Code Playgroud)

realm swift3

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

从 Firebase 数据库加载数据并使用 JavaScript 放置在地图标记上

我正在尝试读取 Firebase 上的数据库,但没有任何反应。

我的数据库非常简单,只有一个节点gps,里面有两个节点:lat当前lng我正在使用 JavaScript。

firebase.js所有脚本都以、firebase-database.js和 的形式加载到标头上firebase-app.js。我的代码:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>    
    <script src="https://www.gstatic.com/firebasejs/4.8.0/firebase.js"></script>
    <script src="https://www.gstatic.com/firebasejs/4.8.0/firebase-database.js"></script>
    <script src="https://www.gstatic.com/firebasejs/4.8.0/firebase-app.js"></script>
    <style>
      #map {
        height: 100%;
      }
      html, body {
        height: 100%;
        margin: 0;
        padding: 0;
      }
    </style>
</head>
<body>
    <div id="map"></div>
    <script>       
        function initMap() {

        var firebase = require("firebase/app");
        require("firebase/auth");
        require("firebase/database");
        var config = {
            apiKey: "AIzaxxxxxxxxxxxxxxxxxxxxx",
            authDomain: "xxxxxxxxxxxxxx.firebaseapp.com",
            databaseURL: "https://xxxxxxxxxxxx.firebaseio.com",
            projectId: "xxxxxxxxxxxx",
            storageBucket: "xxxxxxxxxxxxxx.appspot.com",
            messagingSenderId: "xxxxxxxxxxxxxxxxx"
        };
        firebase.initializeApp(config); …
Run Code Online (Sandbox Code Playgroud)

javascript google-maps firebase

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

不同的列表<string>的字符

我有这个:

List<string> list = new List<string>();
list.Add("a-b-c>d");
list.Add("b>c");
list.Add("f>e");
list.Add("f>e-h");
list.Add("a-d>c-b");
Run Code Online (Sandbox Code Playgroud)

我想删除重复项.在这种情况下,重复是"abc> d"和"ad> cb".两者都有相同的字符,但是以不同的顺序排列.我尝试过:

list.Distinct().ToList();
Run Code Online (Sandbox Code Playgroud)

但没有奏效!

c# linq list distinct

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

标签 统计

c# ×1

distinct ×1

firebase ×1

google-maps ×1

javascript ×1

linq ×1

list ×1

realm ×1

swift3 ×1