是否可以在Lua Redis中使用SHA1?(Is it possible to use SHA1 in Lua Redis?)
我在Redis中有一个使用
cjson
库的Lua脚本,但是我需要从中创建一个SHA1。这是可能的还是有任何关于通过Lua Redis绑定本地提供哪些库的完整文档?
I have a Lua script in Redis that uses the
cjson
library, but then I need to create a SHA1 from it.Is this possible or is there any complete documentation about what libraries are provided natively through the Lua Redis binding?
原文:https://stackoverflow.com/questions/36530942
更新时间:2022-07-02 14:07
最满意答案
使用递归 。
编写一个调用自身的方法(但也要检查终止,以便在不需要深入时不调用自身)。
这是一些代码:
static string GetText2(ToolStripMenuItem c) { string s = c.OwnerItem.Text + @"==>" + c.Text + Environment.NewLine; foreach (ToolStripMenuItem c2 in c.DropDownItems) { s += GetText2(c2); } return s; }
Use recursion .
Write a method that calls itself (but checks for termination as well so it does not call itself when not needed to go deeper).
Here is some code:
static string GetText2(ToolStripMenuItem c) { string s = c.OwnerItem.Text + @"==>" + c.Text + Environment.NewLine; foreach (ToolStripMenuItem c2 in c.DropDownItems) { s += GetText2(c2); } return s; }
相关问答
更多-
C# WinForm入门实战-天轰穿.NET4视频教程全部视频[2022-03-07]
我记得上次买的C#教程是天轰穿老师《VS2010轻松学习C#-从零到深入-天轰穿.NET4趣味编程视频教程》,现在看了6集了,感觉还行。 -
就在这里。 addSubMenu方法返回一个SubMenu对象。 一个SubMenu Menu也是一个Menu ,所以你可以调用add来添加子菜单,而不是父菜单。 上面的代码是为Form 1和Form 2创建两个不同的子菜单,而不是单个New Form子菜单中的两个项目。 例: SubMenu submenu = menu.addSubMenu(0, Menu.NONE, 1, "New Form").setIcon(R.drawable.ic_new_form); submenu.add("Form 1" ...
-
Windows窗体控件“ListView”可以做到这一点。 The Windows Forms Control "ListView" can do that.
-
您可以尝试在表单2上放置一个面板,然后将其颜色设置为“粉红色” - 这样,它将通过表单2到后面的网页透明。 唯一的缺点是,如果你对它有任何控制,它看起来确实很奇怪。 所有这些都可以通过WinForm设计器实现。 You could try putting a panel on your form 2 and then setting it's colour to "Pink" - that way, it will be transparent through the form 2 to the web p ...
-
在c#winform应用程序GLOBALLY中处理未使用的资源(Dispose unused resources in c# winform application GLOBALLY)[2022-03-13]
您可以通过执行以下操作强制执行垃 GC.Collect(); GC.WaitForPendingFinalizers() 这假设您遵循IDisposable模式。 Codeproject有一篇关于IDisposable模式的详细文章 You can force garbage collection by doing: GC.Collect(); GC.WaitForPendingFinalizers() This is assuming you follow the IDisposable patter ... -
因为当你这样做 using (Form1 form1 = new Form1()) 您实际上是在创建Form1的新实例。 这就是为什么它不起作用。 您需要获取Form1的当前实例。 foreach (var item in Application.OpenForms) { Form1 form1 = item as Form1; if (form1 != null) { form1.checkedListBox1.Items.Clear(); } } 或者 ...
-
我找到了解决方案。 你需要声明一个init函数。 必须对上面的例子进行一些变量名称更改 import nautilus class ExampleMenuProvider(nautilus.MenuProvider): def __init__(self): pass def get_file_items(self, window, files): submenu = nautilus.Menu() item = nautilus.Men ...
-
您需要切换panel.style.overflow属性。 function toggleSubmenu(e) { e.classList.toggle("active"); var panel = e.nextElementSibling; if (panel.style.maxHeight) { panel.style.maxHeight = null; panel.style.overflow = "hidden"; } else { panel.s ...
-
FlyoutAnchor子菜单项中的图像 - CRM 2011功能区(Images in FlyoutAnchor submenu items – CRM 2011 ribbon)[2022-06-24]
是的,这是可能的。 您需要将MenuSection的DisplayMode设置为您想要的值。 MenuSection(RibbonDiffXml)Yeah, it's possible. You need to set the Disp ... -
使用递归 。 编写一个调用自身的方法(但也要检查终止,以便在不需要深入时不调用自身)。 这是一些代码: static string GetText2(ToolStripMenuItem c) { string s = c.OwnerItem.Text + @"==>" + c.Text + Environment.NewLine; foreach (ToolStripMenuItem c2 in c.DropDownItems) { s += GetText2(c2) ...