我已经在运行Web服务器的Linux环境中设置了Virtualbox。主机正在运行Windows 7,我可以从主机的浏览器访问虚拟机中服务器所服务的网络。
但是,我希望能够从另一台计算机访问此Web服务器。例如,与主机所在网络位于同一网络上的一位同事。是否可以这样做?
Summary:
 Host (win7) interfaces:
  - 172.16.1.15 (internet facing)
  - 192.168.55.1 (VM facing)
Guest (linux with web server running) interface:
  - 192.168.55.2
Web server is reachable from Host (through 192.168.55.1 - 192.168.55.2 interface)
Web server is NOT reachable from other computer on 172.16.1.X network.
Run Code Online (Sandbox Code Playgroud)
你们可以帮我解决这个问题吗?
谢谢!
我试图找到一种更优雅的方法将字典字典转换为字典数组并保留原始字典的键信息。
如果是
let data= { boss: { name:"Peter", phone:"123"},
            minion: { name:"Bob", phone:"456"},
            slave: { name:"Pat", phone: "789"} 
          }
Run Code Online (Sandbox Code Playgroud)
我想想出一些可以给我的东西
output = [ { role:"boss", name:"Peter", phone:"123"},
           { role:"minion", name:"Bob", phone:"456"},
           { role:"slave", name:"Pat",  phone:"789"}
         ]
Run Code Online (Sandbox Code Playgroud)
我的解决方案是使用该Object.keys方法,但我认为效率不是很高。有些东西告诉我,我正在走复杂的全方位道路,并且必须有一条更简单的道路,但我无法理解:
 Object.keys(data)
                .map((elem, i) => {
                    return Object.assign({role: e}, Object.values(data)[i]);
                })
Run Code Online (Sandbox Code Playgroud)
这是做我想做的事情的最干净的方式吗?
谢谢
I have an array of maps with several values that I need to discard while keeping the map format.
I've played with the Arrays.map() function, but I only get to reach an array of values, without the map anymore.
The code would be:
x=[{"id":1, "name":"Bob"}, {"id":2, "name":"Sam"}, {"id":3, "name":"Lucy"}];
Run Code Online (Sandbox Code Playgroud)
And the expected result I need is:
result=[{"id":1}, {"id":2}, {"id":3}]
Run Code Online (Sandbox Code Playgroud)
What I tried:
>> result= x.map(x => x.id);
<< result = [1, 2, 3]
Run Code Online (Sandbox Code Playgroud)
I am sure this must be extremely …