dynamic

Dynamic nested Material menu from json object in Angular 5

人走茶凉 提交于 2019-12-31 10:33:22
问题 How to create dynamic nested menu from json object? I started using Angular Material Design today for the first time and I'm trying to create nested menus using material design. The documentation is pretty straight forward for static stuff. But I need to create dynamic nested menu from json object and I can't find a simple solution to this anywhere. It just needs to be one level deep. json object(not set in stone): my_menu = { 'main1': ['sub1', 'sub2'], 'main2': ['sub1', 'sub2'], } which

Common Lisp scoping (dynamic vs lexical)

折月煮酒 提交于 2019-12-31 10:01:49
问题 EDIT: I changed the example code after the first answer because I came up with a simple version that begs the same questions. I am currently learning Common Lisp's scoping properties. After I thought I had a solid understanding I decided to code up some examples that I could predict the outcome of, but apparently I was wrong. I have three question, each one relating to an example below: Example 1: (defmethod fun1 (x) (print x) (fun2)) (defmethod fun2 () (print x)) (fun1 5) Output: 5 *** -

Common Lisp scoping (dynamic vs lexical)

折月煮酒 提交于 2019-12-31 10:01:48
问题 EDIT: I changed the example code after the first answer because I came up with a simple version that begs the same questions. I am currently learning Common Lisp's scoping properties. After I thought I had a solid understanding I decided to code up some examples that I could predict the outcome of, but apparently I was wrong. I have three question, each one relating to an example below: Example 1: (defmethod fun1 (x) (print x) (fun2)) (defmethod fun2 () (print x)) (fun1 5) Output: 5 *** -

adding values to variable array VBA

戏子无情 提交于 2019-12-31 08:31:33
问题 I am trying to loop through a table that has a column for "customers" and "dollar amount" . If my loop finds a customer called "greg" or "henry" I want to add his "dollar amount" to an array of an unknown size. Can someone please help me? 回答1: If by unknown size, you mean that number of elements is unknown, you could use a dynamic array. Dim aArray() As Single ' or whatever data type you wish to use ReDim aArray(1 To 1) As Single If strFirstName = "henry" Then aArray(UBound(aArray)) = 123.45

adding values to variable array VBA

邮差的信 提交于 2019-12-31 08:31:10
问题 I am trying to loop through a table that has a column for "customers" and "dollar amount" . If my loop finds a customer called "greg" or "henry" I want to add his "dollar amount" to an array of an unknown size. Can someone please help me? 回答1: If by unknown size, you mean that number of elements is unknown, you could use a dynamic array. Dim aArray() As Single ' or whatever data type you wish to use ReDim aArray(1 To 1) As Single If strFirstName = "henry" Then aArray(UBound(aArray)) = 123.45

realloc structure with function in C

与世无争的帅哥 提交于 2019-12-31 07:21:09
问题 My C program is crashing and I am too new to figure it out. It's very simple so far and I imagine the code is enough to figure out what is going wrong. I am simply trying to read a file line by line. I will double the memory of a structure once I am out of memory. If this is not enough information, I will give whatever else you need. Thank you very much for any help, as I have been stuck for hours now. /* John Maynard 1000916794 7/15/2013 HW-06 */ #include <stdio.h> #include <stdlib.h>

Loading/unloading Javascript dynamically

♀尐吖头ヾ 提交于 2019-12-31 06:14:06
问题 We are creating a dynamic web application where only some parts of the web page will get loaded/unloaded/reloaded through JQuery AJAX. But we are concerned what will happen if user runs our application for a long time (some hours) without completely refreshing the web page. For example, we have a game with modules Map, Shop, Fight. The page also has some modules which are loaded at the beginning (like header with stats and a chat). But all the navigation and changes occur mostly in the center

php POST form query update dinamic variable

心不动则不痛 提交于 2019-12-31 05:40:09
问题 i have this form <form method="post" action="process.php"> Name: <input type="text" name="name" value=""> <br /> English: <input type="text" name="english" value=""> <br /> French: <input type="text" name="french" value=""> <br /> <input type="submit" name="submit" value="Submit"> </form> and we make this query on process.php $query = " UPDATE `translations_structure` SET `updated_on` = '".time()."', `english` = '".utf8_encode($english)."', `french` = '".utf8_encode($french)."' WHERE `id` = '

Can a web server dynamically generate an executable on the fly?

淺唱寂寞╮ 提交于 2019-12-31 05:28:15
问题 Ninite.com seems to be doing it currently. I'm wondering how. While it's possible for them to have every combination of app pre-generated, it seems unlikely/hacky. [EDIT] Is compiling a Windows executable using this method resource-intensive? Can it be done ~100k times a day without exorbitant cost? I'm asking because Ninite announced that they're going paid-only... can it be costing them that much? [EDIT2] The downloads aren't huge, it's just a small hundred KB web-based downloader+installer

PHP XML to dynamic table

六眼飞鱼酱① 提交于 2019-12-31 05:07:06
问题 I'm trying to create a dynamic table based on an XML. The outputted XML is the following: <tickets xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <status>1</status> <message> <ticketpage> <ticket> <row1>0-10-27-30-45-0-0-0-80</row1> <row2>0-15-0-38-0-51-62-0-85</row2> <row3>5-0-0-37-0-57-60-77-0</row3> </ticket> <ticket> <row1>0-0-20-33-0-56-68-0-90</row1> <row2>8-0-0-0-49-0-64-71-84</row2> <row3>1-18-22-32-0-59-0-0-0</row3> </ticket