小编Col*_*lin的帖子

[react-native]无法连接到android上的开发服务器

当我运行"react-native run-android"时,它给了我错误:"无法连接到开发服务器......".

  • 包服务器正在运行,我可以直接从移动设备中的浏览器访问它.
  • 连接到计算机的我的android设备启用了调试,我使用adb devices命令检查了它.
  • 我的Android版本是4.4.4所以我不能使用adb reverse命令.
  • 我在Dev设置中设置了ip地址和端口.
  • Usb调试已打开.
  • 操作系统是windows7.

那么如何修复红色错误屏幕问题?任何建议表示赞赏!

在此输入图像描述

android react-native

50
推荐指数
10
解决办法
7万
查看次数

如何在原子中启用垂直线?

Atom.io网站上的屏幕截图显示,编辑器有垂直线,显示一行"选项卡".我想知道这是一个额外的包还是默认情况下可以在atom中启用. 样本图像

editor atom-editor

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

mac os有一个糟糕的shell

当我打开终端时,它显示如下错误消息.

dyld:未加载库:/usr/local/opt/readline/lib/libreadline.6.dylib引自:/ usr/local/bin/awk原因:未找到图像

我的电脑是mac os 10.11.6.

请帮帮忙?

macos shell libreadline

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

如何在javascript中从另一个数组中减去一个数组

如果我有一个数组A = [1, 4, 3, 2],B = [0, 2, 1, 2]我想返回一个带有值的新数组(A - B)[0, 2, 2, 0].在javascript中执行此操作的最有效方法是什么?

javascript

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

Bootstrap Modal - 如果单击 Yes 按钮,如何返回 True - 自定义确认

好的,我已经花了一整天的时间阅读问答,但仍然无法完成。我需要创建一个自定义的确认(),而不是默认对话框,如果用户单击是,我使用引导模式返回真,否则返回假。

例子:

<a href="remove.php?id=3" onclick="return custom_confirm('Are you sure you want to remove this?');" />

我的自定义确认功能是:

function custom_confirm(message) {
  //  put message into the body of modal
  $('#modal-custom-confirmation').on('show.bs.modal', function (event) {
  //  store current modal reference
    var modal = $(this);

    //  update modal body help text
    modal.find('.modal-body #modal-help-text').text(message);
  });

  //  show modal ringer custom confirmation
  $('#modal-custom-confirmation').modal('show');

  //  if Yes button is clicked, return true
  //  if No  button is clicked,  return false
  //  logic here...
}
Run Code Online (Sandbox Code Playgroud)

我的模态在这里:

<!--  modal: custom confirmation …
Run Code Online (Sandbox Code Playgroud)

javascript jquery bootstrap-modal

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

为什么我们需要将module.exports作为参数传递,因为我们已经将模块作为参数传递了?

我一直在浏览Node.js的一些在线教程.我理解的是,在使用require(./file-path)函数时,节点获取该文件的内容并包装在一个立即调用的函数中

(function(exports, require, module, __filename, __dirname) {
  // content 
}())
Run Code Online (Sandbox Code Playgroud)

我明白之间的差别exportsmodule.exports.这就是我在网上搜索上述问题所能看到的一切.但我的问题是,为什么我们需要通过module.exportsmodule包装IIFE?我们本可以单独通过模块,然后从中获取module.exports.这样做有什么好处吗?通常当我们将一个对象传递给一个函数时,我们不必object.property另外传递.

javascript module require node.js

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

重复switch语句,直到它有一个有效的答案

我是一个尝试用JavaScript制作文本冒险游戏的初学者,我需要重复一个switch语句,直到用户输入一个有效的答案:

opts = prompt("Do you want to TALK or LOOK?").toUpperCase();

switch(opts) {
  case "TALK":
    mes = "Is anyone in charge here?";
    speech = "Our leader is in the big building.";
    talkNot();
    break;
  case "LOOK":
    window.alert("The buildings are quite simple, and the doorways are much shorter than you. You notice, however, that there is a very tall, thin building at the end of the street.");
    break;
  default:
    window.alert("That's not an option.");
}
Run Code Online (Sandbox Code Playgroud)

任何答案都会非常有用 - 谢谢!

javascript for-loop switch-statement

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

Java类什么都不做

我想在控制台上打印一个二维双数组.

  public class arrayprinter {
   public static void main(String[] args) {
        double[][] multi = new double[][]{
              { 10, 20, 30, 40, 50},
              { 1.1, 2.2, 3.3, 4.4},
              { 1.2, 3.2},
              { 1, 2, 3, 4, 5, 6, 7, 8, 9}
            };
        print(multi);
    }
    private static void print(double[][] e){
        for(int i=0; i>e.length;i++) {
            print(e[i]);
        }
    }
    public static void print(double[] e) {
        for(int i=0; i>e.length;i++) {
            System.out.print(e[i]);     }
    }
  }
Run Code Online (Sandbox Code Playgroud)

当我在eclipse中单击播放按钮时,只有:<terminated>...并且控制台中没有打印的数组.有人能说我做错了吗?

java eclipse arrays system.out

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

如何遍历锯齿状数组中的每个元素?

我有一个二维数组,所以是一个数组数组。数组的数组不具有相同的长度。这里有一个例子:

double[][] multi = new double[][] { 
  { 10, 20, 30, 40, 50 }, 
  { 1.1, 2.2, 3.3, 4.4 }, 
  { 1.2, 3.2 },
  { 1, 2, 3, 4, 5, 6, 7, 8, 9 } 
};
Run Code Online (Sandbox Code Playgroud)

如何遍历列?(我爱:10 1.1 1.2 1

java arrays for-loop

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