小编Vik*_*Vik的帖子

启动模拟器失败并显示错误:没有模板

我正在运行以下命令通过Xcode启动iOS模拟器

 xcrun instruments -w 2E755803-3DFD-4722-B6B7-25498BCFF551
Run Code Online (Sandbox Code Playgroud)

它失败了

Instruments Usage Error : No template (-t) specified
instruments, version 7.2 (59503)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]
Run Code Online (Sandbox Code Playgroud)

那么这里需要的模板是什么?

xcode xcrun

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

棱角材料:将内容物垂直排列在垫格砖中

我使用的是角形材质,并且有一个包含两个图块的网格列表组件。问题是内容从左到右而不是从上到下排列。

<mat-grid-list cols="3" style="padding:10px">
  <mat-grid-tile colspan="1" class="mi-tile-contents-top">
    <h2 class="mi-text-header">Title</h2>
    <div>some sort of text in between</div>
    <button mat-raised-button class="mi-button">Learn More</button>
  </mat-grid-tile>
  <mat-grid-tile colspan="2"><img src="../assets/images/cg_app.png" width="100%"/></mat-grid-tile>
</mat-grid-list>
Run Code Online (Sandbox Code Playgroud)

我认为div应该强制内容垂直排列,但事实并非如此。

同样,默认情况下,内容在垂直方向上居中对齐。尝试align-start也没有帮助。

似乎基本的东西正在工作,所以不确定我做错了什么。

material-design angular

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

离子3导航菜单不显示

我对在不同情况下没有出现的侧面菜单有点超级烦恼和困惑.

我的应用流程和要求是:最初有一个包含3个选项卡且没有侧边菜单的登录页面.在第一个选项卡上有产品,您可以将它们添加到购物车.一旦你将它们添加到购物车,你可以点击购物车结帐.此时,如果用户尚未登录,则会显示模型弹出窗口,并显示登录facebook选项.在成功登录时,订单摘要页面会显示添加到购物车的商品.用户现在已登录,因此应显示侧边菜单.

然而,正在发生的是菜单图标显示但点击没有任何反应.控制台等没有错误

我已经验证,如果我没有检查用户登录状态,那么在登录页面上菜单显示就好了.

相关代码: app.html

<ion-menu [content]="content" type="overlay" style="opacity:0.95">
        <ion-header>
          <ion-toolbar>
            <ion-title>
            Menu
            </ion-title>
          </ion-toolbar>
        </ion-header>
        <ion-content style="background-color: #F5F5F6">
          <ion-grid no-padding>
              <ion-row style="padding-top:20px">
                  <ion-col text-center>
                      <button ion-button round (click)="doLogout()">Sign Out</button>
                  </ion-col>
              </ion-row>
          </ion-grid>
        </ion-content>
      </ion-menu>

<ion-nav [root]="rootPage" #content></ion-nav>
Run Code Online (Sandbox Code Playgroud)

app.component.ts

@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  @ViewChild(Nav) nav: Nav;

  rootPage:any = TabsPage;
}
Run Code Online (Sandbox Code Playgroud)

home.html(第一个标签)

ion-header>
  <ion-navbar>
      <button *ngIf="core.user.loggedIn == true" ion-button menuToggle icon-only style="display: block !important;">
          <ion-icon name='menu'></ion-icon>
        </button>
    <ion-title>Cakes</ion-title>
    <ion-buttons end>
        <button *ngIf="getCartCount() > 0" ion-button (click)="openCart()"><ion-icon …
Run Code Online (Sandbox Code Playgroud)

navigation-drawer ionic-framework ionic3 angular ion-navbar

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

如何在现场坚持搜索词

我在rails上使用ruby并有一个搜索表单,如:

 <%= form_tag '/findBlood' do %>
        Blood Group   <%= text_field_tag "bloodGroup" %>
        <%= submit_tag "Search", class: "btn btn-large btn-primary"%>
    <% end %>
Run Code Online (Sandbox Code Playgroud)

这按预期工作,然而,在提交bloodGroup字段清除,结果可能分页中断.如何保留这个领域?

ruby-on-rails

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

egit pull and get from upstream

我创建了一个新的分支A来从master做一些工作并做了一些工作并做了本地提交.

然后我创建了一个分支B来从master做一些工作并做了一些工作并提交了它.然后我把它合并到主人并且确实推到了上游主人.

现在我切换回分支A.所以为了获得最新的变化合并我应该在egit使用哪个选项?从上游取或拉?

有什么区别?

我不想随意选择,因为我不想覆盖这些变化......

eclipse egit

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

com.google.gdata.util.ResourceNotFoundException

我有工作代码直到昨天和今天我看到异常,com.google.gdata.util.ResourceNotFoundException 同时从我的gae代码阅读谷歌文档如下.请注意,最后一行是抛出此异常.

DocsService client = new DocsService("sakshum-YourAppName-v1");
            client.setOAuthCredentials(oauthParameters,
                    new OAuthHmacSha1Signer());
            URL feedUrl = new URL(
                    "https://docs.google.com/feeds/default/private/full/");
            DocumentQuery dquery = new DocumentQuery(feedUrl);
            dquery.setTitleQuery(title);
            dquery.setTitleExact(true);
            dquery.setMaxResults(10);
            DocumentListFeed resultFeed = client.getFeed(dquery,
                    DocumentListFeed.class);
            log.info("feed size:" + resultFeed.getEntries().size());
            if (resultFeed.getEntries().size() != 1) {
                log.info("More than one document is found with same title.");
                return null;
            }
            emailBody = new StringBuffer("");
            for (DocumentListEntry entry : resultFeed.getEntries()) {
                String docId = entry.getDocId();
                String docType = entry.getType();
                log.info("Getting doc from url with docId:" + docId
                        + " docType:" …
Run Code Online (Sandbox Code Playgroud)

google-app-engine gdata-api

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

阻止 JavaScript 执行,直到响应完成

我有 js 代码,它返回我的表的数据行。单击每一行时,它们会展开并计划通过调用另一个 ajax 请求来显示该行的子数据。

\n\n

我的子数据代码如下所示:

\n\n
function format ( d ) {\n    var results;\n    $.ajax({ url: 'http://127.0.0.1:7101/MUDRESTService/rest/v1/feedbacks/' + \n    d.FeedbackId + '/child/MudFeedbackDetailsVO?onlyData=true',\xe2\x80\xa8            \n             type: 'get',  \n             dataType: 'json',    \n             success: function(output) {\xe2\x80\xa8    console.log(output.items[0].CriticalPath) ; \n                        results =      output.items[0];        \n                }\xe2\x80\xa8       \n           });\n    return  results.CriticalPath;\n}\n
Run Code Online (Sandbox Code Playgroud)\n\n

问题可能是该方法没有在 results.CriticalPath 返回的时间值之前完成。我可以在 chrome js 控制台中看到值,因此数据部分没有问题。

\n\n

那么我应该如何让它在响应准备好后返回值

\n

javascript asynchronous callback synchronous

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

将postgres与nodejs一起用于连接池

我正在使用nodejs作为我的REST api主机。整体功能非常基础。也就是说,进行一个REST调用,该调用应该执行postgres db查询并返回数据。我遇到的问题是整个代码的组织。

我有具有基本初始化的server.js。现在,我应该在哪里放置postgres连接,并在需要时调用它来查询db。当前结构如下。所以我认为我应该将postgres连接代码移到server.js?什么是正确的结构

server.js

"use strict";

 var express = require('express'),
  app = express(),
  port = process.env.PORT || 4001,
  bodyParser = require('body-parser');

  app.use(bodyParser.urlencoded({ extended: true }));
  app.use(bodyParser.json());
  app.use(function (req, res, next) {

    // Website you wish to allow to connect
    res.setHeader('Access-Control-Allow-Origin', '*')
    // Request methods you wish to allow
    res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
    // Request headers you wish to allow
    res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
    // Set to true if you need the website to include cookies in the requests …
Run Code Online (Sandbox Code Playgroud)

node.js node-postgres

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

错误:无法解析提供的SSML.提供的文本无效SSML

我在使用TestAlexa Developer门户网站的部分时收到此错误

错误:无法解析提供的SSML.提供的文本无效SSML.

我收到成功的响应并按下listen按钮后发生错误.

响应输出是:

{
  "version": "1.0",
  "response": {
    "outputSpeech": {
      "type": "PlainText",
      "text": "Here are some recent stories about siemens:Citigroup Inc. Reaffirms Buy Rating for Siemens AG (SIE)Siemens AG (SIE) Rating Reiterated by Citigroup Inc.Global Hydrophone Market Report 2014-2021 - Analysis, Technologies & Forecasts - Vendors: Siemens, Sensor Technology, Cetacean Research Technology - Research and MarketsSiemens Bags The 2016 Frost & Sullivan Asia-Pacific Building Technologies Company Of The Year Award"
    },
    "reprompt": {
      "outputSpeech": {
        "type": …
Run Code Online (Sandbox Code Playgroud)

javascript ssml alexa-skills-kit amazon-echo

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

按键上的angular 2 ionic 2处理事件

我有一堆离子2卡,要按一下某个键即可翻转(任何键都无所谓)。代码看起来像

<ion-content padding>
    <ion-card (click)="setTime(7)" *ngIf="status == 'morning'" (keypress)="eventHandler($event)" style="width:80%">
        <img src="https://greatist.com/sites/default/files/Sleeping-Positions-feature.jpg"/>
    </ion-card>
</ion-content>
Run Code Online (Sandbox Code Playgroud)

.ts代码

eventHandler(keyCode){
        alert('hey vikj');
  }
Run Code Online (Sandbox Code Playgroud)

按下任何键时,不会触发我的事件处理程序。

keyboard ionic2 angular

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