dynamic

BASH dialog Dynamic menu

半城伤御伤魂 提交于 2020-01-04 05:25:11
问题 I need to create a dynamic menu with dialog using vars from an array. Heres my code: #!/bin/bash file="teste.cfg" count=0; while IFS=";" read nomeTarefa dirOrigem dirDest tipoBkp agendarBkp compactarBkp gerarLog || [[ -n "$gerarLog" ]]; do #RECEBE NAS VARS OS VALORES DELIMITADOS POR ; count=$((count + 1));#INICIA O COUNT PARA INCREMENTAR O OPTIONS options[$count]="$options$count) \"$nomeTarefa\"" #CONCATENA O OPTIONS done < $file options=$"$options" for ((i=1; i<=count; i++)) do echo $

BASH dialog Dynamic menu

社会主义新天地 提交于 2020-01-04 05:24:06
问题 I need to create a dynamic menu with dialog using vars from an array. Heres my code: #!/bin/bash file="teste.cfg" count=0; while IFS=";" read nomeTarefa dirOrigem dirDest tipoBkp agendarBkp compactarBkp gerarLog || [[ -n "$gerarLog" ]]; do #RECEBE NAS VARS OS VALORES DELIMITADOS POR ; count=$((count + 1));#INICIA O COUNT PARA INCREMENTAR O OPTIONS options[$count]="$options$count) \"$nomeTarefa\"" #CONCATENA O OPTIONS done < $file options=$"$options" for ((i=1; i<=count; i++)) do echo $

Setting the base tag of a dynamically created iframe

别等时光非礼了梦想. 提交于 2020-01-04 04:44:07
问题 I'm trying to dynamically create an iframe and set it's base tag before it is created. ifrm = document.createElement("IFRAME"); ifrm.setAttribute("src", "test.html"); ifrm.style.width = 400+"px"; ifrm.style.height = 100+"px"; //before creating it, can we set he base tag? //I.E. <base href="http://example.com/MyFolder/" /> var bt = ifrm.contentDocument.createElement("base"); bt.setAttribute("href", "http://www.example.com/Folder/"); ifrm.contentDocument.getElementsByTagName("head")[0]

Hyperledger private data dynamic access

自闭症网瘾萝莉.ら 提交于 2020-01-04 02:41:27
问题 Is it possible to dynamically set access to private data in Hyperledger fabric 1.4? Unlike the collections file where we have to add the organizations that can have access to a particular "collection", is it possible to add access through chaincode? 回答1: Had to do some research on this myself, but since Fabric v1.4 it is possible to dynamically add peers to private data collections. Private data reconciliation ensures that all private data state in that collection, which was created prior to

Dynamic Object Creation

こ雲淡風輕ζ 提交于 2020-01-04 02:41:07
问题 I have a function that takes a string object name and I need the function to create an new instance of a object that has the same name as the value of the string For example, function Foo(){} function create(name){ return new name(); } create('Foo'); //should be equivalent to new Foo(); While I know this would be possible via eval, it would be good to try and avoid using it. I am also interested if anyone has an alternative ideas to the problem (below) I have a database and a set of (using

dynamic.ToString() unexpected behaviour

家住魔仙堡 提交于 2020-01-03 21:04:23
问题 I'm wondering how does this code work: dynamic dynaString = 2; string b = dynaString.ToString(); When this one is not working: var list = new List<dynamic>(); var liststring = new List<string>(); liststring = list.Select(x => x.ToString()).ToList(); I know I can add Cast<string> after Select statement but that does not explain that behaviour. Why does ToString() on dynamic element work different when called on dynamic variable declared in code than on dynamic variable taken from list in LINQ.

How do you determine if a method returns a dynamic type when using reflection?

本小妞迷上赌 提交于 2020-01-03 19:33:10
问题 When using reflection, fields, properties, indexers, and parameters can be examined for the DynamicAttribute attribute in order to determine that they have a dynamic type. However, this doesn't work for Methods - even though they return 'dynamic', they have NO attributes and their return type is 'object' (and also has no attributes). Visual Studio does this for intellisense for methods in external assemblies... can it be done with reflection? For example, the code below produces this output:

IEnumreable dynamic and lambda

♀尐吖头ヾ 提交于 2020-01-03 19:08:15
问题 I would like to use a lambda expression on a IEnumerable<dynamic> type, howerver im getting the following error on attributes and coordinates where im using a new lambda expression: Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type . Here is my code public static object returnFullSelectWithCoordinates(IEnumerable<dynamic> q) { return q.Select(b => new { route_id = b.b.route_id, name = b.b.name,

Can I programmatically choose the Android layout folder?

强颜欢笑 提交于 2020-01-03 17:33:49
问题 I'm building an Android app that resizes based on the screen size using different layout folders (i.e. large, xlarge, etc.). The only problem is that I want to provide a way for users to switch between the small and large screen layouts, in case they have a pre-honeycomb tablet that doesn't recognize the xlarge tag, or the device is closer to phone size but still big enough that the user wants to use the tablet layouts. Is there a way that I can create a button to switch layout folders? I

Dynamically generate a list of available languages in Spring MVC

二次信任 提交于 2020-01-03 17:32:24
问题 I have set up i18n in Spring MVC 3, and it is working correctly. There are several files, each with its own language: messages_en.properties, messages_de.properties, etc. In one of my JSPs, I need to show the users a combo with all available languages, and I would like this list to be dynamic i.e. generated on the fly from the existing language files in the server. Is there any built-in method to generate this list? Or do I have to resort to check the folder where the language files reside