在本地主机上运行时,从sitefinity项目中的url中删除解决方案/文件夹名称(Remove solution/folder name from url in sitefinity project while running on localhost)
我在其他机器上开发了一个Telerik sitefinity项目。 当我在我的系统上配置项目并在本地主机上运行时,它会在URL中使用文件夹/解决方案名称。 因此,当点击链接时,404没有找到错误。
现在创建的网址是: - http:// localhost:xxxx / ProjectName / home
我想要的是: - http:// localhost:xxxx / home
I have one Telerik sitefinity project developed on other machine. When I configure the project on my system and run on localhost it takes folder/solution name in url. Therefore while clicking on links it give 404 not found error.
Url created now is:- http://localhost:xxxx/ProjectName/home
What I want is:- http://localhost:xxxx/home
原文:https://stackoverflow.com/questions/34939315
最满意答案
在V8中,对象背后的数据结构变化很大:
- 对象命名属性,直接“存储在C结构上”
- 对象外的命名属性,存储在对象外部的数组中,附加间接
- 索引属性(属性名称可以转换为整数的属性),存储在对象外部的数组中,但数组索引充当关键字
- 有序哈希表
命名属性按插入顺序排列,因为隐藏的类演变/过渡最自然。
索引属性按其实际值顺序排列,因为存储插入顺序会浪费内存。
如果您受到哈希表的支持,则哈希表会故意伪造与自然优化相同的顺序。
在其他浏览器中也是如此,因为当数字很小时,在实际的“C数组”中存储索引属性是一个巨大的优化。 可以变化的是索引属性是首先列出还是命名属性。
该规范通过不定义迭代顺序使得这种优化成为可能,并且V8首先(至少根据该bug线程)来利用它。
在命名之前列出的索引键(反之亦然)当然是任意的,不会影响任何优化。
In V8 the data-structures behind an object vary a lot:
- In-object named properties, stored directly "on the C struct"
- Out-of-object named properties, stored in an array external to the object, additional indirection
- Indexed properties (properties whose property names can be turned into integers), stored in an array external to the object but the array index acts as the key
- Ordered hash table
Named properties are in insertion order because that's most natural with the hidden class evolution/transitions.
Indexed properties are in their actual value order because it would be a waste of memory to store the insertion order.
If you are backed by a hash table, the hash table deliberately fakes the same order that results from the natural optimizations.
It is the same in other browsers too because storing indexed properties, when the numbers are small, in an actual "C array" is a huge optimization. What can vary is whether indexed properties are listed first or named properties.
The spec made this optimization possible by not defining iteration order and V8 was first (at least according to that bug thread) to exploit it.
Indexed keys being listed before named and vice versa is of course arbitrary and doesn't affect any optimizations.
相关问答
更多-
正如评论中所提到的,这里的问题不仅仅是排序,还包括数据结构的设置方式。 我想你在这里想要的是一个对象数组,看起来像这样: var a = [{name: "P.M.L", val: 44}, {name: "P.CO.", val: 56}, {name: "M.É.D.", val: 10}]; 使用这种组织数据的新方法,您可以使用以下代码对val属性进行排序: a.sort(function(x, y) { return x.val - y.val; }); ...
-
重置数组的数字键(Reset the numeric keys of an array)[2022-03-31]
使用array_merge重新索引数组。 代码: 'one', 2 => 'two', 3 => 'three', 'row' => 'four', 'newRow' => 'five', ); $reindexed_array = array_merge($array); var_dump($reindexed_array); 结果: array(5) { [0]=> string(3) "one" ... -
使用非数字键以数字方式转换和排序javascript数组(Convert & sort javascript array numerically using non-numeric key)[2022-07-22]
您可以使用sort()函数内的一元加+运算符将两个参数从字符串转换为数字。 var data = [{"reference":"8926","name":"xyz1","id_product":"78"},{"reference":"11588","name":"xyz2","id_product":"21"},{"reference":"119","name":"xyz3","id_product":"135"}] data.sort((a, b) => +a.reference - +b.refe ... -
如何遍历子元素,并使用ksort()对其进行排序: array( 01 => array(), 02 => array() ), 2017 => array( 02 => array(), 01 => array() ) ); ksort($years); foreach ($years as &$year) { ksort($year); } ...
-
您可以使用split并检查字符串的第一项 var arr = ['honda accord', '1986 honda accord', '1990 honda accord', '2000 honda accord', '2011 honda accord', '2016 honda accord']; arr.sort((a, b) => b.split(' ')[0] - a.split(' ')[0]) document.write(JSON.stringify(arr)); You c ...
-
为什么javascript不按数字顺序排序数字数组?(Why do javascript sort a numeric array not in numeric order?)[2023-12-03]
从MDN文档 : 如果未提供compareFunction,则通过将元素转换为字符串并按字典(“词典”或“电话簿”,而不是数字)顺序比较字符串来对元素进行排序。 (或者参见EMCAScript规范的相关部分,向Felix Kling提示挖掘参考) 如果要进行数字排序,则传递比较函数: [1, 2, 10, 20, 100, 200].sort(function (a,b) { return a-b; }); From the MDN documentation: If compareFunction is ... -
但这是有角度的,所以正常Javascript它不起作用。 您只需使用JavaScript 排序功能即可。 它也适用于Angular(TypeScript)。 注意:排序数字时,您只需使用紧凑比较 : myArray.sort((n1,n2) => n1 - n2); var data = [ { title: 'Shirt', position: 3 }, { title: 'Ball', position: 1, } ]; data.sort(fu ...
-
您可以使用正则表达式在排序时删除所有字母: var Arr = [ 'h78em', 'w145px', 'w13px' ]; var sortArr = Arr.sort(function(a, b) { a = a.replace(/[a-z]/g, ""); // or use .replace(/\D/g, ""); b = b.replace(/[a-z]/g, ""); // to leave the digits only return a - b; }); 演 ...
-
不,因为(如你所说)的数字键(或使用规范的术语, 整数索引 *)。 Object.assign按照[[OwnPropertyKeys]]定义的顺序工作,普通对象是OrdinaryOwnPropertyKeys抽象操作,它按照定义的顺序列出属性(首先是整数索引,然后按创建的顺序列出其他字符串命名的属性,然后按创建顺序命名的属性)。 生成的对象的属性将以相同的方式枚举(通过遵循定义的顺序的操作),因此,整数索引,数字,然后是creationg顺序中的其他属性。 如果您的键不是整数索引,则可以通过按照所需顺序预先 ...
-
为什么javascript中的数字键总是排序到开头?(Why do numeric keys in javascript always sort to the beginning?)[2023-11-30]
在V8中,对象背后的数据结构变化很大: 对象命名属性,直接“存储在C结构上” 对象外的命名属性,存储在对象外部的数组中,附加间接 索引属性(属性名称可以转换为整数的属性),存储在对象外部的数组中,但数组索引充当关键字 有序哈希表 命名属性按插入顺序排列,因为隐藏的类演变/过渡最自然。 索引属性按其实际值顺序排列,因为存储插入顺序会浪费内存。 如果您受到哈希表的支持,则哈希表会故意伪造与自然优化相同的顺序。 在其他浏览器中也是如此,因为当数字很小时,在实际的“C数组”中存储索引属性是一个巨大的优化。 可以变化 ...