nested

Batch File Nested For /L Loops and Exiting them

青春壹個敷衍的年華 提交于 2019-12-10 10:34:08
问题 SETLOCAL ENABLEDELAYEDEXPANSION set list=A B C D E FOR %%a IN (%list%) DO ( start %%a.exe > ouput_%%a.txt echo 120, 30 second loops = 60 min FOR /L %%i IN (1,1,120) DO ( REM pause for 30 seconds ping 1.1.1.1 -n 1 -w 30000 > nul echo find the running executable tasklist | findstr %%a.exe > nul REM !ERRORLEVEL! REM exit the script if no executable is found (i.e it has run successfully) if !ERRORLEVEL! equ 1 goto success ) REM kill executable if we haven't exited yet taskkill /f /im %%a.exe

Get a list of all keys in nested dictionary

谁说我不能喝 提交于 2019-12-10 10:29:21
问题 I want to get a list of all keys in a nested dictionary that contains lists and dictionaries. I currently have this code, but it seems to be missing adding some keys to the list and also duplicate adds some keys. keys_list = [] def get_keys(d_or_l, keys_list): if isinstance(d_or_l, dict): for k, v in iter(sorted(d_or_l.iteritems())): if isinstance(v, list): get_keys(v, keys_list) elif isinstance(v, dict): get_keys(v, keys_list) else: keys_list.append(k) elif isinstance(d_or_l, list): for i in

PHP - Create a nested array from MySQL data

不羁岁月 提交于 2019-12-10 10:24:45
问题 I have some data stored in a table like so: id parent_id name 1 0 Entry 1 2 0 Entry 2 3 0 Entry 3 4 1 Child of entry 1 I want to turn it into a nested array like so: array( array( 'id' => 1, 'parent_id' => 0, 'name' => 'Entry 1', 'children' => array(...) ), ... ); Ideally, it would need to support an infinite amount of nesting (children with children). Is my table set up to support this, if so, how would I generate this kind of array using the data in the table? If not, how should I set up my

Convert list of lists to dataframe

六月ゝ 毕业季﹏ 提交于 2019-12-10 09:22:30
问题 I got a nested list, named mylist which has length 4. Each element of this list is an experiment: exp1.1 , exp1.2 , exp2.1 and exp2.2 . Each experiment contains observations of length (in days) of four plant growth stages: EM-V6 V6-R0 R0-R4 and R4-R9 . Each growth stage is organized as a data frame with year and mean . Here is the complete data: mylist=structure(list(exp1.1 = structure(list(`EM-V6` = structure(list( year = 2011:2100, mean = c(34, 34, 32, 28, 25, 32, 32, 28, 27, 30, 32, 31, 33

parsing nested JSON String objects with JQuery/PHP?

好久不见. 提交于 2019-12-10 09:22:29
问题 This is the page I'm working on.... http://fremontchurch.net/json_test/ This is the json http://fremontchurch.net/json_test/posts.php I'm trying to to have a list of tracks names listed and linked through simple html link <a href="URL_GOES_HERE">TRACK NAME GOES HERE</a> to its url i got everything else in order its just the nested part keeps coming up "[object Object],[object Object],[object Object]"... and so on... each nest has two items a track name and url... what would be the correct way

jQuery/JavaScript: selecting first “layer” of children only

北城余情 提交于 2019-12-10 09:08:06
问题 I'm trying to select only the first "layer" of children elements of a given type, but not elements nested inside another qualifying element. E.g. in: <div id='top'> <div id="s1" class="special"> <div id="s2" class="special"></div> </div> <div> <div id="s3" class="special"></div> </div> </div> I'd like to find #s1 and #s3, but not #s2, with something like $('#top').find('.special:not_nested'). Is it possible with jQuery? XPATH? I thought about jQuery custom filters like expr[':'].not_nested,

Triple nested quotations in shell script

孤街浪徒 提交于 2019-12-10 07:22:38
问题 I'm trying to write a shell script that calls another script that then executes a rsync command. The second script should run in its own terminal, so I use a gnome-terminal -e "..." command. One of the parameters of this script is a string containing the parameters that should be given to rsync. I put those into single quotes. Up until here, everything worked fine until one of the rsync parameters was a directory path that contained a space. I tried numerous combinations of ',",\",\' but the

python nesting dictionary: OrderedDict from collections

那年仲夏 提交于 2019-12-10 06:40:47
问题 how to nest a OrderedDict? i tried: table=collections.OrderedDict() table['E']['a']='abc' but this shows error. i tried also: table=collections.OrderedDict(OrderedDict()) table['E']['a']='abc' this also shows error. i tried: table=collections.OrderedDict() table['E']=collections.OrderedDict() table['E']['a']='abc' this works fine. in my coding i had to use like this: table=collections.OrderedDict() for lhs in left: table[lhs]=collections.OrderedDict() for val in terminal: table[lhs][val]=0

Is there any possibility to reach the index of an outer QML Repeater from the inner one (they are nested)?

╄→尐↘猪︶ㄣ 提交于 2019-12-10 05:10:41
问题 I am trying to dynamically build a matrix of the same type of items in my QML application and keep it dynamic, so that you can change the number of rows and columns in a c++ file anytime. This has been working well, but now, to access them individually, I want to give them dynamic names. Therefore I nested two repeaters and tried to set the objectName as in the following: Repeater{ id: rows model: Matrix1.row //number of rows in Matrix1-Object Repeater{ id: columns model: Matrix1.column /

Java - Jackson nested arrays

倾然丶 夕夏残阳落幕 提交于 2019-12-10 03:05:17
问题 Given the following data { "version" : 1, "data" : [ [1,2,3], [4.5,6]] } I tried the following definitions and used ObjectMapper.readValue(jsonstring, Outer.class) class Outer { public int version; public List<Inner> data } class Inner { public List<Integer> intlist; } I got: Can not deserialize instance of Inner out of START_ARRAY token" In the Outer class, if I say List<List<Integer> data; then deserialization works. But in my code, the Outer and Inner classes have some business logic