Redis如何在内部将String表示为位?(How Redis represents String as bits internally?)
我正在尝试理解字符串的位表示(最具体的是在Redis中)
我试过这个:
redis> SET mykey3 hello OK redis> SETBIT mykey3 7 0 (integer) 0 redis> SETBIT mykey3 7 1 (integer) 0 redis> GET mykey3 "iello" redis> SET mykey4 5 OK redis> SETBIT mykey4 7 0 (integer) 1 redis> GET mykey4 "4"
那么在这种情况下,“你好”和“5”的位代表是什么?
- 另外,其他Redis类型,List,Set,Sorted Set如何表示为二进制位? 位操作可以为它工作吗? 或者情况并非如此?
- 从什么似乎一切都存储为二进制安全字符串? 如果是这样,List,Set,Sorted Set如何表示为安全字符串?
I'm trying to understand the bit representation of a String (most specifically in Redis)
I tried this:
redis> SET mykey3 hello OK redis> SETBIT mykey3 7 0 (integer) 0 redis> SETBIT mykey3 7 1 (integer) 0 redis> GET mykey3 "iello" redis> SET mykey4 5 OK redis> SETBIT mykey4 7 0 (integer) 1 redis> GET mykey4 "4"
So what is the bit representation of "hello" and "5" in this case?
- Also how the other Redis types, List, Set, Sorted Set are represented as binary bit? Such that bit operations can work for it? Or this is not the case?
- From what is seems everything is stored as binary-safe String? If so, how does a List, Set, Sorted Set are represented as safe String?
原文:https://stackoverflow.com/questions/16133448
最满意答案
一种可能的解决方案是在面板上添加两个底部工具栏。 像这样:
dockedItems: [{ xtype: 'toolbar', dock: 'bottom', border: false, style: { background: 'white' }, items: [{ text: 'Add to BoM', cls: 'add-to-bom-button' }, { text: 'Cancel', cls: 'cancel-button' }] }, { xtype: 'toolbar', dock: 'bottom', border: false, style: { background: 'white' }, items: [costContainer] }]
其中costContainer是
var costContainer = Ext.create('Ext.container.Container', { border: false, layout: 'vbox', items: [{ xtype: 'label', html: 'Total Cost', cls: 'total-cost-label' }, { xtype: 'label', html: '$ 66,000', cls: 'price-label' }] });
我认为这个例子看起来像你在找什么,只需修复css。 http://jsfiddle.net/alexrom7/LHK39/3/
One possible solution would be adding two bottom toolbars to the panel. Just like this:
dockedItems: [{ xtype: 'toolbar', dock: 'bottom', border: false, style: { background: 'white' }, items: [{ text: 'Add to BoM', cls: 'add-to-bom-button' }, { text: 'Cancel', cls: 'cancel-button' }] }, { xtype: 'toolbar', dock: 'bottom', border: false, style: { background: 'white' }, items: [costContainer] }]
where costContainer is
var costContainer = Ext.create('Ext.container.Container', { border: false, layout: 'vbox', items: [{ xtype: 'label', html: 'Total Cost', cls: 'total-cost-label' }, { xtype: 'label', html: '$ 66,000', cls: 'price-label' }] });
I think this example looks like what you are looking for, just have to fix the css. http://jsfiddle.net/alexrom7/LHK39/3/
相关问答
更多-
只需添加 bbar: [ // YOUR ITEMS HERE EXAMPLE FOLLOWING { xtype: 'button', text: 'test Button', handler: function(btn){ alert('Button Click'); } } ] 到你的配置(其中xtype ===面板) 它看起来像这样: { region: "north", ...
-
ExtJS 4.1.1.a - TreePanel上的键盘导航问题(ExtJS 4.1.1.a - Keyboard navigation issue at TreePanel)[2022-08-25]
我找到了解决方案,我的情况的问题是将selType设置为rowmodel。 在我发表评论之后,键盘导航按预期工作。 I found the solution, the problem for my situation was setting selType as rowmodel. After I comment out it, keyboard navigation works as expected.. -
经过研究,我还没有找到实现我需要的方法。 我尝试使用ExtJs 3.4,但是当我们选择日期时,保持菜单会出现问题。 如果有人仍然会找到方法 - 请写在这里。 所以我做了一个技巧 - 我生成了一个包含所有必填字段的东面板,当我们点击工具栏中的按钮时会显示它。 它看起来像这样: After research I haven't found a way to realize what I need. I tried ExtJs 3.4, but there were issues with keep menu o ...
-
Extjs 4.1.1如何将工具栏项对齐其他项?(Extjs 4.1.1 How to align the toolbar items one below the others?)[2021-04-10]
一种可能的解决方案是在面板上添加两个底部工具栏。 像这样: dockedItems: [{ xtype: 'toolbar', dock: 'bottom', border: false, style: { background: 'white' }, items: [{ text: 'Add to BoM', cls: 'add-to-bom-button' }, { text: 'Ca ... -
尝试对要隐藏的点使用null或空''值。 例: var store1 = Ext.create('Ext.data.Store', { model: 'WeatherPoint', data: [ { temperature: 58, date: new Date(2011, 1, 1, 8), val: 10 }, { temperature: 63, date: new Date(2011, 1, 1, 9), val: 20 }, { t ...
-
有人已经写了一个扩展名 - http://www.sencha.com/forum/showthread.php?132048-Ext.ux.container.ButtonSegment Someone has already written an extension for this - http://www.sencha.com/forum/showthread.php?132048-Ext.ux.container.ButtonSegment
-
要将数据加载到内存代理,您必须将数据分配给代理,然后调用store.load(); 请参阅https://fiddle.sencha.com/#fiddle/8ia 我从http://www.sencha.com/forum/showthread.php?267955-Load-data-into-Memory-Proxy-Store获得灵感 var myStoreNoData = Ext.create('Ext.data.Store', { model: 'QueryResultModel', ...
-
你需要使用displayTpl配置combo 。 在这个FIDDLE中 ,我在ExtJS 4.x中创建了与ExtJS 4.x中相同的示例。 它工作正常。 希望这将指导您或帮助您实现所需的解决方案。 Ext.create('Ext.form.Panel', { renderTo: Ext.getBody(), title: 'Multiple Seletion Example in ExtJS 4.x for combo box', items: [{ xtype: ' ...
-
尝试这个: var tabPanel = Ext.getCmp("results-tabpanel"); tabPanel.tabBar.addTool([ {xtype: "tbfill"}, { xtype: "label", text: "Export to: " }, { xtype: "button", text: "Excel", iconCls: "icon-excel" ...
-
通过显式更改其布局,可以右键对齐工具栏中的项目: GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).grab(true, false).applyTo(toolBar); 资料来源: http : //codifyit.blogspot.com/2010/04/eclipse-tips-part-2.html It is possible to right align items in a toolbar by explicitly cha ...