Posts

Showing posts from February, 2011

data.table in R: Why can't data.table::`:=`() be called? -

use dt = data.table(type=rep(c("b","a"),each=2), value=1:4) create following data.table: type value 1: b 1 2: b 2 3: 3 4: 4 the code dt[, `:=`(text=max(value)), by=type] works well: type value test 1: b 1 2 2: b 2 2 3: 3 4 4: 4 4 same code (except data.table:: calling part) dt[, data.table::`:=`(text=max(value)), by=type] doesn't work , returns following error: error in data.table::`:=`(text = max(value)) : check is.data.table(dt) == true. otherwise, := , `:=`(...) defined use in j, once , in particular ways. see help(":="). can tell me why can't call := function data.table::`:=`() can call other functions data.table data.table::data.table ? please me, want use data.table::`:=`() in package. many ahead!

vb.net - How to increase year range in Hijri DateTimePicker -

in windows application, have datetimepicker insert hijri date database. but, datetimepicker doesn't allow dates of more '29-12-1450'. how can expand year range of datetimepicker hijri calendar?

node.js - Promise.promisify get parameters from position 2..n in then resolution -

the first time posted confused actual issue was. in bluebird documentation promisify , says the node function should conform node.js convention of accepting callback last argument , calling callback error first argument , success value on second argument. this means parameter in 1st position (error) passed .catch . parameter in 2nd position passed .then . if there more 1 "success" value, how capture parameters 3rd position , on? child_process.exec callback function called function (error, stdout, stderr) . there anyway capture stderr in promisify 'd function? this var promise = require('bluebird'); var child_process = promise.promisifyall(require('child_process')); var execasync = child_process.execasync; var exec = child_process.exec; // normal callback, can access stderr exec('node-gyp rebuild', function(error, stdout, stderr) { console.log(stderr); }); execasync('node-gyp rebuild') .then(function(stdout, stderr) {

Testing component in Android App SDLC? -

"automated testing integral part of development lifecycle." in android app proejcts we've implemented mvp, rx retrofit , content provider/sqlite, dagger. every android apps have server communication, storing data in local database, complex ui naviagtion drawer , recycler view etc, , difficult navigation flow of application. what want achieve? few test cases should tested every time before deliver apk client or release on play store?(20-30% automate testing) list of test cases of business logic, can not auto tested because whatever reason complex ui, navigation flow etc (40-60% manual testing) continuous integration based on above, there few questions, what test in auto , manual, how decide that? in automate testing, test in mvp - model-view-presenter layers? what kind of general business logic should auto test mobile apps - registration, login, forgot password, update profile etc? what type of testing should perform android apps - unit testing, func

ajax - React-rails gem TypeError: Cannot convert a symbol to a string -

i have problem react-rails gem have bit different syntax react.js i have created multiple form , collect data each form request api. problem cannot proceed more further because got error typeerror: cannot convert symbol string below code createassociations.jsx (body) handleclick(e) { e.preventdefault(); $.ajax({ url: 'http://localhost:3001/api/v1/associations/create?', type: 'post', data: { name: name,association_url:url}, beforesend: function (xhr){ xhr.setrequestheader('authorization', 'token token='+localstorage.authtoken); xhr.setrequestheader('accept', 'application/json'); }, success: (data) => { alert("success!") }, error: (xhr, ajaxoptions, thrownerror) => { alert(xhr.responsetext); }

svn - Git alias to create a new branch, switch repository and create the same branch there -

i have 2 repositories, our application exists of our basic product, , extended product each client have (i work 1 client, 2 repositories). when make new branch on basic product repository, want same branch created on extended product repository. to this, created git alias using: git config --global alias.newbranch '!git checkout -b $0 central/branchname && cd ../extendedproduct && git checkout -b $0 central/branchname' when run using: git newbranch test, exception saying ../extendedproduct outside repository. i'm not sure if want @ possible, appreciated. so basically: create branch on current repository -> switch repository -> create branch same name on repository. git alias has restrictions, can use these commands directly , such git checkout -b central/branchname && cd ../extendedproduct && git checkout -b central/branchname also, there way, can add extendedproduct submodule current repo git submodule add

shell - What kind of permission is required to access and rename a directory? -

among x, w, r, permission required access , rename directory. (i'll use cd , mv respectively) just note, mv need rights modify (w)the current directory too, because writes new content (the new name) it.. demo: testdir="./$0.$$" pwd="$(pwd)" err()(echo "$@">&2; return 1) echo "creating $testdir" mkdir "$testdir" || err "can't mkdir $testdir" || exit 1 ls -la "$testdir" trap 'cd "$pwd"; chmod 777 "$testdir"; rm -rf "$testdir"; exit' 0 1 2 15 #ensure 'w' demo chmod 755 "$testdir" echo "cd $testdir" cd "$testdir" || err "can't cd $testdir" || exit 1 echo "mkdir a" mkdir || err "can't mkdir a" || exit 1 ls -la echo renaming b mv b || err "can't rename b" || exit 1 ls -la echo "rewoke 'w' permission $testdir (now .)" chmod 555 . || err "

akka persistence - Is it possible to send messages of type ActorState=>ActorState to a Persistent Actor and later restore its state from an event journal? -

let's consider following scenario: a persistent actor state actorstate . messages of type m:actorstate=>actorstate m transforms actor's state a series of messages of type m:actorstate=>actorstate sent actor questions : can actorstate restored event journal using event sourcing (by replaying messages sent actor) ? what restriction posed on type of messages m allowed sent persistent actor such state of actor ( actorstate ) can restored (after system reboot) event journal replaying messages actor?

javascript - My IndexedDB add() in my service worker succeed but I cannot see the data it in the Chrome dev tools Application/Storage -

Image
i on chrome version 57.0.2987.110 (64-bit) on macos/osx 12.3 sierra, i managed service worker working, must new @ this. i try use indexeddb , store data in it. it fetches data local web server in http , retrieve without problem in json format. the data format : [{"id":"1", "...":"...", ...}, {"id":"2", "...":"...", ...}, {"id":"3", "...":"...", ...}, ... {"id":"n", "...":"...", ...}] it adds data indexeddb without problem apparently because onsuccess callback triggered ... entityobjectstore.add success : event {istrusted: true, type: "success", target: idbrequest, currenttarget: idbrequest, eventphase: 2…} but not appear in chrome dev tools! here service worker: self.addeventlistener('install',function(event) { event.waituntil( (new promise(function(resolve,reject)res

sql - Select records where the only exist 1 in a joined table -

i have following query: select a.postcard_id, a.stamp_id, b.end_dt pst_vs_stamp join stamp b on a.postcard_id = b.postcard_id b.account 'aa%' , b.end_dt = '9999-12-31' group a.postcard_id, a.stamp_id, b.end_dt having count(a.postcard_id) < 2 but wrong results. i want postcards id's there 1 record ( having < 2 ) in pst_vs_stamp table. how can query this? do aggregation in subquery, on table want 1 row. because there 1 row, can use aggregation function pull out value of column (for 1 row min(col) column's value): select s.postcard_id, vs.stamp_id, s.end_dt stamp s join (select vs.postcard_id, min(stamp_id) stamp_id pst_vs_stamp vs group vs.postcard_id having count(*) = 1 ) s on vs.postcard_id = s.postcard_id s.account 'aa%' , s.end_dt = '9999-12-31';

android - Add or remove image associated with id and tag -

Image
in above image i'm having array of images added linearlayout inside horizontal scrollview need add or remove image along id on top of pink heart background , every image having count showing flowers quantity in numbers e.g 4 or 5 maintain count if selected flower removed or added.i don't know how image id , remove image if tap 2 times on pink heart background drag , drop images on screen.any suggestions searched lot.. make_back.xml <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/white"> <include android:id="@+id/topbar" layout="@layout/top_bar" android:layout_width="match_parent" android:layout_height="wrap_content" /> <linear

c# - Where is NSVoiceLocaleIdentifier on Xamarin.Mac? -

i aware grouped other similar entities enum. searching google, searching assemblies returned no answers. so, nsvoicelocaleidentifier on xamarin.mac? note: there "no" defined constants compile time validation nsvoicelocaleidentifier strings dynamic based upon os install. if want complete list, have them @ application runtime. nsvoice​locale​identifier available within nsdictionary returned particular voice. no serbian ( sv_sv ) on system, there 64 others... i.e. com.apple.speech.synthesis.voice.zarvox usa english based ( en_us ) com.apple.speech.synthesis.voice.thomas french ( fr-fr ) example: foreach (var voice in nsspeechsynthesizer.availablevoices) { console.writeline(voice); var attributes = nsspeechsynthesizer.attributesforvoice(voice); foreach (var item in attributes) { if (item.key.tostring() == "voiceindividuallyspokencharacters" || item.key.tostring() == "voicesupportedcharacters")

php - How to save changes back to databse from jsTree? -

i want save changes make on jstree database. tried different methods cant work. working in codeigniter. please me if can. thank you. here code, view.php: <button id="target" type="submit">click here</button> <script type="text/javascript"> $(document).ready(function () { $('#tree-container').on('changed.jstree', function (e, data) { var i, j, r = []; // var state = false; (i = 0, j = data.selected.length; < j; i++) { r.push(data.instance.get_node(data.selected[i]).id); } $('#txttuser').val(r.join(',')); }).jstree({ 'plugins': ["checkbox", "dnd", "search", "contextmenu"], 'core': { "check_callback" : true, "multiple": true, 'data': {

html - i have created a button that is generating a voucher number but it is not refreshing to come with new voucher number -

when button clicking, genrating random number want when button click comes new voucher number every time this controller generating random number static random random = new random(); public list<string> randomvouchers() { int voucherstogenerate = 1; int lengthofvoucher = 10; list<string> generatedvouchers = new list<string>(); char[] keys = "abcdefghijklmnopqrstuvwxyz01234567890".tochararray(); while (generatedvouchers.count < voucherstogenerate) { string voucher = generatevoucher(keys, lengthofvoucher); if (!generatedvouchers.contains(voucher)) { generatedvouchers.add(voucher); return generatedvouchers; } } return generatedvouchers; } private static string generatevoucher(char[] keys, int lengthofvoucher) { return enumerable .range(1, lengthofvoucher) // for

Send an TLS Alert to an SSL socket in Python -

i wrote server in python3 makes use of ssl. if client connects , sends invalid request, want terminate ssl connection tls alert internal error. this minimal example of have in mind: #!/usr/bin/env python3 import socket,ssl s = socket.socket(socket.af_inet, socket.sock_stream) s.setsockopt(socket.sol_socket, socket.so_reuseaddr, 1) s.bind(('0.0.0.0',1234)) s.listen() s, addr = s.accept() s = ssl.wrap_socket( s, server_side=true, keyfile="server.key", certfile="server.crt" ) s.send_alert(ssl.alert_description_internal_error) # <--- need in example, expect every client receive tls alert internal error after handshake. how can achieve this?

I still do not see video using twitter:player -

i'am trying use twitter player card: https://dev.twitter.com/cards/types/player but problem is, when test main page using twitter validator: https://cards-dev.twitter.com/validator still have image instead video (it should youtube). my meta: <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:site" content="some content"> <meta name="twitter:title" content="some content"> <meta name="twitter:description" content="some content"> <meta name="twitter:image" content="landingpage.png"> <meta name="twitter:player" content="https://www.youtube.com/embed/bk3zlbrdb4q"/> <meta name="twitter:player:width" content="480" /> <meta name="twitter:player:height" content="480" /> <meta name="twitter:player:stream:content_type" content="

php - htaccess rewrite alphanumeric and symbols -

i want pass url parameters example.com/username or example.com/myemail@gmail.com want match 2 condition if true select table? here's .htaccess code # default index page directoryindex index.php # remove file extensions rewritecond %{request_filename} !-f rewriteengine on rewritecond %{request_filename} !-d rewritecond %{request_filename}\.php -f rewriterule ^(.*)$ $1.php # display custom error message #errordocument 404 http://localhost// #errordocument 500 http://localhost// #errordocument 404 404 #errordocument 500 500 #profile rewrite rewriterule ^([a-za-z0-9_-]+)$ index.php?ref=$1

data cleaning - Regex that search for sentences that exclude one word -

ciao guys, i'm creating corpus composed tweets contain keyword " catastrophic " in xml format. each tweet embedded this: <tweet>"catastrophic loss" @ tennessee's zoo knoxville 33 reptiles found dead </tweet> <tweet>overcoming catastrophic forgetting incremental moment matching, lee et al.</tweet after trimming tons of unnecessary data, there still 200+ tweets don't contain keyword @ all. i'd delete them, tried regex this, didn't work: <tweet>^.*(?!catastrophic).*$</tweet> does has idea? not sure programming language or other toolset using. but quite simple approach might re-write file (or whatever kind of input is) using filter writes entries contain catastrophic: assuming file 1 line per tweet (just illustrate idea): egrep '<tweet>.*catastrophic.*</tweet>' originalfile > newfile

if statement - Crystal Report converting value to number with symbol -

i have issue crystal report i'm creating. using fields database , pulling in result value analysis field equal values. in condition first check looks @ analysis field , checks if equal "conf". result "<10" second check looks @ analysis field , checks if equal "original". result "20". i want results display in order above following basic logic returns result of 20. if analysis = "conf" result else if analysis = "original" result i having issue multiple records solved converting both results numbers (tonumber(result)). record has less symbol contained within field value causes conf result "be skipped" , display original result instead. i've tried few things without success. here code condition of i'm @ below. fell way complex logic i've added i've had ideas , shows i've tried. if {units} = "cfu_g" if {analysis} = "conf" , {result}="" or {resul

postgresql - How to sum rows in groups then filter rows based on the sum -

i want find sum , count of positive values in table grouped type column. interested in cases sum >= 10 , count >= 2 for example, type | value ------+------- | 10 b | 5 c | 7 b | 5 c | 6 c | -1 d | 3 d | 4 i want result type | sum | count ------+------+------ b | 10 | 2 c | 13 | 2 there should not row a because count 1 . there should not row d because sum 7 . negative value should ignored. i think answer should like: select type, sum(value) sum, count(value) count my_table value > 0 group type having sum >= 10 , count >= 2 however not sure how correctly combine of relevant conditions. select type, sum(value) sum, count(type) count my_table value > 0 group type having sum(value) >= 10 , count(type) >= 2

python - PyInstaller UAC not working in onefile mode -

hello everybody. i have small python project , want make single executable file . using... windows 7 python 3.4 pyinstaller 3.2.1 my pyinstaller command is, pyinstaller -y -w -f -n output_file_name --uac-admin --clean source_file.py this command works properly. single output file not ask admin rights when executed. , there's no shield mark on executable file icon. when remove -f option (equivalent --onefile), output executable file has shield mark on icon , ask me admin rights. not want. want single executable file. i found manifest file (output_file_name.exe.manifest) in dist\output_file_name folder. did... pyinstaller -y -w -f -n output_file_name --manifest output_file_name.exe.manifest --uac-admin --clean source_file.py but command doesn't work. single executable file still not ask admin rights. i have removed pyinstaller , installed recent development version. pip install git+https://github.com/pyinstaller/pyinstaller.git@develop but result

asp.net - Storing 5000+ records in Redis cache -

hi new redis cache, looking way store 5000+ or more records redis cache, should kind of scalable easiest way handle application doesn't have performance impact. before more concrete answer need give more details data want store there , way database. in general can check answer storing large amount of data in redis: data preparation upload redis server

android - How to get list of InetAddress in Network Service Discovery? -

hi friends using netwrok service discovery in android app find service type "_dockset._tcp". getting device list unable list of inetaddres of devices. getting inetadress of first discovered device want inetadress of devices discovered. thankful help. using public void startresolvelistener(){ mresolvelistener= new nsdmanager.resolvelistener() { @override public void onresolvefailed(nsdserviceinfo serviceinfo, int errorcode) { log.d("resolve service failed"," error"+errorcode); } @override public void onserviceresolved(nsdserviceinfo serviceinfo) { ; int port=serviceinfo.getport(); inetaddress host=serviceinfo.gethost(); mhost=string.valueof(host);//here getting 1 host } }; } i confused how iterate inetaddess you need follow nsdmanager diagram , adapt listener to: mresolvelistener= new nsdmanager.resolvelistener(

email - Mailchimp API error in Magento1.9 -

i install mailchimp extension in magento1.9 , directly added api key in system->configuration->mailchimp , iam getting following error. api call: api call lists?fields=lists&count=100 failed: problem ssl ca cert (path? access rights?) - ssl version-3 mailchimp version - 1.5.1. operating system: centos can please help.. try this: download cacert.pem file here: http://curl.haxx.se/docs/caextract.html eg: save file in /etc/pki/tls. open php.ini file , add line: curl.cainfo="/etc/pki/tls/cacert.pem" restart/reload apache server ( service httpd reload )

php - WAMP/XAMPP is responding very slow over localhost -

Image
i don't know problem is. wamp slow, reformatted computer , installed wamp. still, accessing localhost very, slow, , doesn't load @ all. removed , replaced xampp, still got same result. might possibly problem? here's current hosts file: 127.0.0.1 localhost 127.0.0.1 localhost it working fine before, not know happened , why has started acting strange lately, since reformat didn't fix it. i had same problem running on windows 8 running on 64bit. apache slow when press f5 many times goes ok. in end after doing many things managed solve it. right works fast. try following tasks increase performance: change apache's listening port change listening port 80 8080 avoid conflicts programs skype. open httpd.conf file , find line starts listen (it's around line 62). change following: listen 127.0.0.1:8080 change powerplan change power plan balanced high performance. can in control panel\all control panel items\power options di

django - NoCredentialsError : Unable to locate credentials - python module boto3 -

i running django in python virtual environment( virtualenv ). django website served apache2 amazon ec2 instance(ubuntu 16.04). use boto3 module write amazon s3. i installed awscli , ran aws configure , set aws access keys correctly. ( know configured correctly, because $ aws s3 ls returns correct lists of s3 buckets.) however, when try write objects s3 django application, fails producing error described in title. i moved new instance , started using python virtual environments. before that, used work fine. have read questions on , docs aws. below stack trace. environment: request method: post request url: http://*******/product/4 django version: 1.10.6 python version: 3.5.2 installed applications: ('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'abc.apps.abcdirectconfig') installed mid

java - jsp converting #(or any special character) to &#x23;(hexcode) which resulting in wrong result -

there 1 column alias named "name#" in sql query, when jsp getting response name# getting converted "name&#x23;" , therefore getting wrong result while fetching values. how can avoid conversion special characters ? or there anyway can access jspconfig object , change attribute values in java code?

java - Tesseract 3.02.02 Crash JRE -

we using tess4j/tesseract perform ocr on webapp. on windows works fine when deployed on linux machine(centos 6.8) program crashes , automatically kill apache tomcat server. we read more 1 file(different file) simultaneously.if run ocr running approximately 1 minutes after through fatal error. can please suggest how resolve? a fatal error has been detected java runtime environment: sigsegv (0xb) @ pc=0x00007f7d5934ff90, pid=17649, tid=140176377489152 jre version: java(tm) se runtime environment (8.0_60-b27) (build 1.8.0_60-b27) java vm: java hotspot(tm) 64-bit server vm (25.60-b23 mixed mode linux-amd64 compressed oops) problematic frame: c [libtesseract.so.3.0.2+0x22cf90] tesseract::histogramrect(unsigned char const*, int, int, int, int, int, int, int*)+0x70 failed write core dump. core dumps have been disabled. enable core dumping, try ulimit -c unlimited before starting java again

java - How to tell protostuff to pack property to fixed32 and not int32 -

i'm trying serialize following java object protobuf using protostuff: public class headertest { private int version; private uuid messageid; public headertest() {} // required jackson public headertest(uuid messageid, int version) { this.messageid = messageid; this.version = version; } public int getversion() { return version; } public void setversion(int version) { this.version = version; } public uuid getmessageid() { return messageid; } public void setmessageid(uuid messageid) { this.messageid = messageid; } } with following code: schema<headertest> headertestschema = runtimeschema.getschema(headertest.class); byte[] headertestbuff = protostuffioutil.tobytearray(headertestinstance, headertestschema, linkedbuffer.allocate()); i fixed size buffer protostuff serialize version integer varint type ( amount of bytes use represent integer changes according integer size ) how can tell protostuff serialize s

angularjs - spring boot html redirect -

i using angularjs along spring boot. in restcontroller , passing in json object. end goal invoke new html. @requestmapping(value="loadpatientdetails", method=requestmethod.post) public string loadpatientdetails(model model, @requestbody info patientinfo){ system.out.println("inside loadpatientdetails "+patientinfo.getid()); model.addattribute("json", new gson().tojson(patientinfo)); return "html2"; } my angularjs calling code following: function (patientid){ return $http({ method : 'post', url : '/loadpatientdetails', data : patientid, headers: {'content-type': 'application/json; charset=utf-8'} }).then( function(status){ return status; });; }; problem : getting complete html i.e. html2 in response.. need html2 should automatically rendered. what missing?

c# - Many-to-many relation and unique constraint. How do I do that in EF Core? -

i have 2 entities country , business. public class country { public int id { get; set; } public string name { get; set; } public virtual icollection<business> businesses { get; set; } public country() { businesses = new list<business>(); } } public class business { public int id { get; set; } public string name { get; set; } public icollection<country> countries { get; set; } public business() { countries = new list<country>(); } } country can have many businesses inside , businesses can present in many countries. business should unique inside country. how can make business unique country in many-to-many relation? you can accomplish composite key. first need third entity represent association: public class countrybusiness { public int countryid {get; set;} public country country {get; set;} public int businessid {get; set;}

html - Append and remove child elements in javascript if radio button is clicked -

i writing code select database using can show type of query should run. adding queries in select tag using dynamic append() , if change radio button choice select options should changed , every time click radio button previous select tag should removed. have written code it's not appending select child node.please thank you. var container = document.getelementbyid("container"); if(db == "user") { if(bookq==null) { bookq = document.getelementbyid ("query2"); bookq.parentnode.removechild (bookq); } var array = ["show database","delete record"]; var selectlist = document.createelement("select"); selectlist.id = "query1"; container.appendchild(selectlist); (var = 0; < array.length; i++) {

Java stream - too many open files -

i have program goes few directories time time , and kind of processing files in directories. the problem time time (each 2 or 3 days) program reaching os open files limit. it spring-boot application running in rhel 7. the method files this: public file[] getfiles(string dir, int numberoffiles) throws exception { final path basedir = paths.get(dir); list<file> filesfrompath = new arraylist<file>(); file[] files = null; final bipredicate<path, basicfileattributes> predicate = (path, attrs) -> attrs.isregularfile() && string.valueof(path).endswith(".xml"); list<path> result; try (stream<path> filestream = files.find(basedir, 1, predicate).limit(numberoffiles).onclose(() -> log.debug("closing file stream."))){ result = filestream.collect(collectors.tolist()); result.foreach(path -> { path.tostring(); file file = path.tofile();

How to link docker images to their composing layers on the disk? -

since docker v1.10, introduction of content addressable storage, docker has changed way image data handled on disk. understand layers , images separated. layers merely become collections of files , directories have no notion of images , can freely shared across images. see update , blog better explanation. during docker push , docker pull , via stdout can seen layers transported, though resulting sha hashes regenerated on destination. with locally built image ubuntu:14.04 base, when use docker history command, can see chain of intermediary images used during build process, , disk space usage contributed. root@ruifeng-virtualbox:/var/lib/docker/aufs/diff# docker history image_size image created created size comment 9ae1f372d83c 11 weeks ago /bin/sh -c #(nop) cmd ["/bin/sh" "-c" "/bin/ 0 b aaf66e9fa85b 11 weeks ago /bin/sh -

android - Different layouts for portrait and landscape modes based on screen width, not orientation per se -

i have 2 versions of layout, smaller screens , larger screens. incidentally, have device different layouts required in different orientations. on other device may not so. want base on screen width, not orientation such. i've read this article , noticed "available screen width" ( w<n>dp modifier) can used specifying proper layouts. says: the system's corresponding value width changes when screen's orientation switches between landscape , portrait reflect current actual width that's available ui. sounds perfect. put smaller layout in base layout folder, , larger 1 layout-w750dp . , larger layout picked. problem doesn't switch base layout when rotate device portrait mode. i have used code this answer check screen width in dp. it's 960 in landscape , 600 in portrait. made sure android:configchanges="orientation" not specified activity. have put log activity's oncreate() - indeed called when rotate device, should

list - Freemarker: getting a Template with include (prefix) -

im trying following: maintemplate.ftl <root> <#list items item> <#include "custom_item.ftl"> [option 1] </#list> <#include "custom_item.ftl"> [option 2] </root> custom_item.ftl <root> <name>${name}</name> </root> in files include [option 1], in others [option 2]. access ${name} variable have use 2 different ways: - option 1: ${item.name} - option 2: ${name} totally understandable, issue. how can make sure works? supplying prefix include same. for example like: maintemplate.ftl <root> <#list items item> <#include "custom_item.ftl" prefix='item'> [option 1] </#list> <#include "custom_item.ftl"> [option 2] </root> custom_item.ftl <root> <# assign prefix = prefix?root> <name>${prefix.name}</name> </root> which work. approach doesnt work, has solution w