首页 \ 问答 \ 我如何将Android模拟器连接到本地主机服务器?(How do I connect an Android Emulator to localhost server?)

我如何将Android模拟器连接到本地主机服务器?(How do I connect an Android Emulator to localhost server?)

我有一个运行在http://localhost:4617上的ASP.NET / Azure应用程序。 我想调试从Android模拟器进行的REST调用。 相关SO线程似乎表明你应该使用10.0.2.2 。 我已经尝试了几个类似http://10.0.2.2:4617变体,但似乎没有任何工作。 还有其他建议吗?

如果我在我的计算机上ping localhost ,它会返回Reply from ::1: time<1ms的响应Reply from ::1: time<1ms ,这似乎与ipv6地址有关,但我不确定这是如何相关的。


I have an ASP.NET/Azure application running on http://localhost:4617. I would like to debug a REST call made from an Android emulator. Related SO threads seem to indicate that you should use 10.0.2.2. I've tried several variations like http://10.0.2.2:4617, but none seem to work. Any other suggestions?

If I do ping localhost on my machine, it returns Reply from ::1: time<1ms which seems to have something to do with an ipV6 address, but I'm not sure how this is related.


原文:https://stackoverflow.com/questions/37016401
更新时间:2023-09-15 07:09

最满意答案

我目前正在研究这样的问题 - 分类,最近邻搜索 - 音乐信息检索。

您可能对近似近邻ANN )算法感兴趣。 这个想法是允许算法在邻近位置附近返回(可能不是最近的邻居); 在这样做时,您可以降低复杂性。 你提到了kd-tree ; 这就是一个例子。 但正如你所说, kd-tree在高维度方面表现不佳。 事实上,目前所有的索引技术(基于空间划分)都会降到线性搜索足够高的维度[1] [2] [3]。

在最近提出的ANN算法中,也许最受欢迎的是局部敏感哈希LSH ),它将高维空间中的一组点映射成一组分组,即哈希表[1] [3]。 但是,与传统散列不同, 地理位置敏感的散列将附近的点放在同一个bin中。

LSH有一些巨大的优势。 首先,很简单 您只需计算数据库中所有点的哈希值,然后从中创建哈希表。 要查询,只需计算查询点的哈希值,然后从哈希表中检索同一个bin中的所有点。

第二,有一个严格的理论来支持它的表现。 可以看出,查询时间在数据库的大小上是线性的,即比线性搜索更快。 更快的速度取决于我们可以忍受多少近似值。

最后, LSH0 < p <= 2任何Lp范数兼容。 因此,为了回答您的第一个问题,您可以使用LSH与欧氏距离度量,或者您可以使用曼哈顿(L1)距离度量。 还有汉明距离和余弦相似度的变体。

2008年,Malcolm Slaney和Michael Casey为IEEE信号处理杂志撰写了一个体面的概述[4]。

LSH已被应用到任何地方。 你可能想试试看。


[1] Datar,Indyk,Immorlica,Mirrokni,“Locality-Sensitive Hashing Scheme Based on p-Stable Distributions”,2004年。

[2] Weber,Schek,Blott,“A quantitative analysis and performance studies for similarity-search methods in high-dimensional spaces”,1998年。

[3] Gionis,Indyk,Motwani,“通过散列的高维度相似性搜索”,1999年。

[4] Slaney,Casey,“找到最近邻居的地点敏感哈希”,2008年。


I currently study such problems -- classification, nearest neighbor searching -- for music information retrieval.

You may be interested in Approximate Nearest Neighbor (ANN) algorithms. The idea is that you allow the algorithm to return sufficiently near neighbors (perhaps not the nearest neighbor); in doing so, you reduce complexity. You mentioned the kd-tree; that is one example. But as you said, kd-tree works poorly in high dimensions. In fact, all current indexing techniques (based on space partitioning) degrade to linear search for sufficiently high dimensions [1][2][3].

Among ANN algorithms proposed recently, perhaps the most popular is Locality-Sensitive Hashing (LSH), which maps a set of points in a high-dimensional space into a set of bins, i.e., a hash table [1][3]. But unlike traditional hashes, a locality-sensitive hash places nearby points into the same bin.

LSH has some huge advantages. First, it is simple. You just compute the hash for all points in your database, then make a hash table from them. To query, just compute the hash of the query point, then retrieve all points in the same bin from the hash table.

Second, there is a rigorous theory that supports its performance. It can be shown that the query time is sublinear in the size of the database, i.e., faster than linear search. How much faster depends upon how much approximation we can tolerate.

Finally, LSH is compatible with any Lp norm for 0 < p <= 2. Therefore, to answer your first question, you can use LSH with the Euclidean distance metric, or you can use it with the Manhattan (L1) distance metric. There are also variants for Hamming distance and cosine similarity.

A decent overview was written by Malcolm Slaney and Michael Casey for IEEE Signal Processing Magazine in 2008 [4].

LSH has been applied seemingly everywhere. You may want to give it a try.


[1] Datar, Indyk, Immorlica, Mirrokni, "Locality-Sensitive Hashing Scheme Based on p-Stable Distributions," 2004.

[2] Weber, Schek, Blott, "A quantitative analysis and performance study for similarity-search methods in high-dimensional spaces," 1998.

[3] Gionis, Indyk, Motwani, "Similarity search in high dimensions via hashing," 1999.

[4] Slaney, Casey, "Locality-sensitive hashing for finding nearest neighbors", 2008.

相关问答

更多
  • 你有没有尝试过NEIGHBORS的includeData选项? FOR b IN books RETURN { book: b, authors: NEIGHBORS(authors, written, b._id, 'inbound', [], {includeData: true}) } 这在我的测试中起作用。 在大型数据集上,PATHS会更加高效(PATHS计算更多不相关的信息) 注意:空数组[]用于定义仅应遵循的边。 对于一个空数组,我们遵循所有边,但您也可以遵循特殊边缘fe {label: "w ...
  • 那么,它主要取决于你的特定实现和数据集。 一棵平衡不良的树意味着你必须搜索比你需要的更多的数据。 确保你的树木结构健全。 这也可能取决于你如何找到k个邻居。 如果你的算法搜索最近邻居的树并存储它,然后搜索第二个最近的邻居并存储它等,那么你不会非常有效地进行搜索。 相反,当您找到更近的遍历树的列表时,请将列表中的k个最近邻居列表和碰撞点列表从列表中移出。 这样你搜索一次,而不是k次。 无论哪种方式,这听起来像你正在做这个课程。 尝试与你的教授,助教或同学交谈,看看你的结果是否典型。 Well, it prim ...
  • 如果从内部查询中删除TOP (1) WITH TIES ,并将外部查询设置为返回前k行,会发生什么情况? 我也很想知道这个修正案是否有帮助。 它应该比使用TOP更高效: DECLARE @start FLOAT = 1000 ,@k INT = 20 ,@p FLOAT = 2; WITH NearestPoints AS ( SELECT * ,T.g.STDistance(@x) AS dist ,ROW_NUM ...
  • 我知道你使用toblers法作为空间相关性(区域化)的解释。 目前还不清楚最终的应用是什么,但是,在这种情况下我会做的一些验证步骤是:检查所有(150)变量是否都对应于相同的空间和时间尺度,受同类的影响自相关(平稳性)可以在少数情况下简化问题。 最后还必须了解要提取的特征或模式以及它们的特征。 看看这个: http : //www.geokernels.org/pages/modern_indexpag.html 希望它有所帮助! 干杯拉维 I understand that you use the tob ...
  • 我目前正在研究这样的问题 - 分类,最近邻搜索 - 音乐信息检索。 您可能对近似近邻 ( ANN )算法感兴趣。 这个想法是允许算法在邻近位置附近返回(可能不是最近的邻居); 在这样做时,您可以降低复杂性。 你提到了kd-tree ; 这就是一个例子。 但正如你所说, kd-tree在高维度方面表现不佳。 事实上,目前所有的索引技术(基于空间划分)都会降到线性搜索足够高的维度[1] [2] [3]。 在最近提出的ANN算法中,也许最受欢迎的是局部敏感哈希 ( LSH ),它将高维空间中的一组点映射成一组分组 ...
  • k是数据的维数 ,而n是数据集中的点数 。 因此,如果您的数据集包含1000万个点,并且每个点有3个维度,则k为3, n为1000万。 kd树不适合在高维度上找到最近邻居的原因与所谓的维度诅咒有关 。 kd树反复使用沿着单个维度的分割,但是当处理高维数据时,在一个维度上知道关于(欧几里得)距离的某些东西对于整个空间中的距离几乎没有说明。 想要超过2 k的数据集的原因非常直观:我们将数据集沿着每个维度分成两半大小相等的数据集。 如果我们的数据点少于2 k ,过了一段时间就没有更多的数据需要拆分了! 例如,如果 ...
  • 使用ego()函数查找距离aa节点一定距离的节点。 然后使用induced_subgraph对主图进行子集化。 例如,距离1步之遥的是 plot(induced_subgraph(graph, ego(graph, 1, "D")[[1]])) 那些距离两步之遥的是 plot(induced_subgraph(graph, ego(graph, 2, "D")[[1]])) Use the ego() function to find nodes that are a certain distance ...
  • MultiIndex对高维数据最为有用,正如文档和本文中所解释的那样,因为它允许您在DataFrame环境中处理任意数量的维度。 除了Panel ,还有Panel4D--目前正处于试验阶段。 鉴于MultiIndex的优点,我不推荐使用这个或三维版本。 我认为这些数据结构相比之下并没有获得太大的吸引力,而且确实将被淘汰。 MultiIndex is most useful for higher dimensional data as explained in the docs and this SO ans ...
  • 如果要迭代它们,请使用adjacency_iter如果希望将它们作为列表,则使用adjacency_iter 。 编辑 我应该补充说,这些都不会给你节点的属性。 但是你可以用g.node[n]轻松搞定它们。 Use the adjacency_iter if you want to iterate over them or adjacency_list if you want them as a list. Edit I should add that neither of those will give ...
  • 我敢打赌,你需要的只是在itertools包中,特别是产品方法。 您正在寻找的是您当前位置的笛卡尔乘积,每个坐标在每个方向上都被1扰动。 因此,您将获得从当前点派生的三元组列表: diag_coord = [(x-1, x, x+1) for x in point] 现在,您将获取所有这些三元组的产品,重新组合每一组,并且您拥有对角线。 那是你需要的吗? I'll bet that all you need is in the itertools package, especially the produ ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)