Posts

Showing posts from April, 2015

C# how add icon into .exe -

how can import .ico .exe in c# ? (i want have 1 file) in resources file have: icon.ico when click on icon, in properties have: "embedded resource" what shoud do(change)? trayicon.icon = new icon("c:\\users\\wulp\\documents\\visual studio 2013\\projects\\wifiswitch\\wifiswitch\\resources\\icon.ico"); and, how have use relative path ? thanks you have add icon resource. see: https://msdn.microsoft.com/en-us/library/7k989cfy(v=vs.80).aspx when you've added resource can point it.

asp.net - Can I use System.Web.UI.Page in console application? -

i want test function in web page. have way use system.web.ui.page in console application , put in session , test way? i created test class , inherit page not put session in it. when type "mypage." show below, not see come out after "." <testclass()> public class unittest2 inherits system.web.ui.page dim mypage = new system.web.ui.page mypage. end class please help! update: below code seemed pass compiler <testclass()> public class unittest2 <testmethod()> public sub testcheckrules() dim mypage testwebpage = new testwebpage mypage.testsession() end sub end class public class testwebpage inherits system.web.ui.page public sub new() end sub public sub testsession() dim firstname string = "john" dim lastname string = "smith" dim city string = "seattle" session("firstname") = firstname session("la...

php - How to convert a string of numbers into an array? -

i have string e.g. 1398723242 . trying check string , odd numbers out in case 13973 . i facing problem on how put string array. after putting string array know have loop through array, this: foreach($array $value){ if($value % 2 !== 0){ echo $value; } } so can body please on first part on "how put above string array can evaluate each digit in above loop?" this should work you: just use str_split() split string array. can use array_filter() filter numbers out. e.g. <?php $str = "1398723242"; $filtered = array_filter(str_split($str), function($v){ return $v & 1; }); echo implode("", $filtered); ?> output: 13973

android - Wearable.DataApi.putDataItem(GoogleApiClient, PutDataRequest) leaks when used in working thread -

i using task repeatedly executed sync data between wearable , handheld. therefore service started starts postdelayed runnable. in run() method putdatarequest created , send via wearable.dataapi.putdataitem(googleapiclient, putdatarequest); after new run of task schedulead via postdelayed() method. that works fine, however, line: wearable.dataapi.putdataitem(googleapiclient, putdatarequest); somehow leaks , therefore after time app crashes. know why? or bug of api? my code of runnable follows: private static class weakrunnable implements runnable{ private weakreference<wearmanagerwearable> weakwearmanager; private weakreference<hashmap<integer,mysensoreventlisteners>> weaklistenerlist; private weakreference<handler> weakhandler; protected weakrunnable(wearmanagerwearable wearmanager, hashmap<integer,mysensoreventlisteners> listenerlist , handler handler ){ weakwearmanager = new weakreference<>(wearmanager)...

android - Change background colour of listview items based on cursor results -

i have following listview.. private void populatekpilistview(string storedstaffid, view view, string id){ //list 1 cursor cursor = db.getallrows("*", dbtables.table_kpis, "where projectid=" + id); int count = db.getrowcount("*", dbtables.table_kpis, "where projectid=" + id); textview empty = (textview)view.findviewbyid(android.r.id.empty); if(count > 0){ empty.setvisibility(view.gone); string[] fromfieldnames = new string[] {dbtables.key_kpiheader, dbtables.key_target, dbtables.key_actual}; int[] toviewids = new int[] { r.id.card_title, r.id.card_target, r.id.card_actual}; mycustomadaptor = new customlistadapter(getactivity(), r.layout.kpi_list_item_card, cursor, fromfieldnames, toviewids, 0); kpilist = (listview)view.findviewbyid(android.r.id.list); kpilist.setadapter(mycustomadaptor); kpilist.setonitemclicklistener(new onitemclicklistener...

asp.net - MVC Action giving IIS access denied error -

i have strange issue affecting 1 of actions in specific controller. all other actions in controller post fine, when post view of 1 particular action error: http error 403.0 - modsecurity action not have permission view directory or page. this confuses me views post in similar fashion , use same web.config files. my view: <form action="/admin/editmenus" method="post" class="form-horizontal"> ....standard form controls in here..... </form> my controller: [httppost] public actionresult editmenus(string mondayweek1regulardescription, string mondayweek1regularcost, string mondayweek1vegetariandescription, string mondayweek1vegetariancost, string mondayweek1nocarbdescription, string mondayweek1nocarbcost, string mondayweek1kiddiesdescription, string mondayweek1kiddiescost, string tuesdayweek1regulardescription, string tu...

migrate tomcat 6 to 7; JSF; java.lang.NoClassDefFoundError: com/sun/enterprise/InjectionException -

Image
i need migrate tomcat 6 project (java 6) tomcat 7 server (java 7). right receive following error(s) server: console: information: tld skipped. uri: http://java.sun.com/jsp/jstl/xml defined jul 09, 2015 9:47:38 com.sun.faces.config.configurelistener contextinitialized information: mojarra 2.2.11 ( 20150505-0732 https://svn.java.net/svn/mojarra~svn/tags/2.2.11@14688) für kontext '/cm-tool' wird initialisiert. jul 09, 2015 9:47:39 com.sun.faces.config.configurelistener contextinitialized schwerwiegend: critical error during deployment: java.lang.noclassdeffounderror: com/sun/enterprise/injectionexception @ java.lang.class.forname0(native method) @ java.lang.class.forname(class.java:274) @ com.sun.faces.util.util.loadclass(util.java:364) @ com.sun.faces.spi.injectionproviderfactory.getproviderfromentry(injectionproviderfactory.java:317) @ com.sun.faces.spi.injectionproviderfactory.findproviderclass(injectionproviderfactory.java:285) @ com.sun.faces....

sonarqube5.1 - Sonarqube Analyse source code located in a folder named ".utils" -

i trying analyse .net solution can't analyse files (cs files) located in folder named ".utils". sonar runner seems skip folders name begins "." sample : - solution - project1 - context - class1.cs - .utils - class2.cs currently, able analyse class1.cs, not class2.cs. possible force analyse of kind of folder ?. it better if rename "utils", have lot of projects in case... configuration: sonarqube 5.1 sonar runner 2.4 visual studio bootstrapper 1.2 c# plugin 4.0 thank you

javascript - Make google auth request gapi.auth without a popup -

need make auth request in js browser not support popups. there way redirect new url or show request in in html5 page of application by using code check if user authorized app gapi.auth.authorize({client_id: clientid, scope: scopes, immediate: true}, callbackauthresult); note: immediate:true if set immediate true wont show popup. you see? don't open popup, , manage stuff in callback. callback used post-processes. here use authenticating. in callbackauthresult : callbackauthresult = function (authresult) { var authorizebutton = document.getelementbyid('authorize-button'); if (authresult && !authresult.error) { authorizebutton.style.display = 'none'; // processing here } else { authorizebutton.style.display = 'block'; authorizebutton.onclick = callbackauthclick; } } callbackauthclick = function (event) { gapi.auth.authorize({ client_id: clientid, scope: scopes, immediate: false }...

javascript - NotFoundError: DOM Exception 8 on insertBefore in event listener -

i have following code: html: <div id="tree"> <ul class="root"> <li class="add">+</li> </ul> </div> javascript: window.onload = () => { let root = document.getelementsbyclassname("root")[0]; root.addeventlistener("click", (e) => { if (e.target.classlist.contains("add")) addnode(e); return false; }, false); function addnode(e) { let item = document.createelement("li"); item.innerhtml = "new"; e.target.parentnode.insertbefore(e.target, item); } }; when click li error notfounderror: dom exception 8: attempt made reference node in context not exist. on line insertbefore. i've checked devtools , seems normal node, have no idea why doesn't work. the order of arguments incorrect. new node has passed first: e.target.parentnode.insertbefore(item, e.target); see mdn documentation .

ios - Unwrapping a Int to String cast in Swift -

i gathering nsnumber plist , want print in string : let tijd = string(self.sortedhighscores[indexpath.row]["tijd"]!) cell.detailtextlabel?.text = "\(tijd) seconden" but in simulator i'm seeing printed: optional(120) seconden example. how solve this? i've tried unwrapping tijd , result in errors in compiler telling me delete ! . try this: var highscore : nsnumber = self.sortedhighscores[indexpath.row]["tijd"] as! nsnumber var : string = string(format:"%d",highscore.integervalue) cell.detailtextlabel.text =

c# - How can I close a login form and show the main form without my application closing? -

i have 2 forms in project (login , main). what i'm trying accoomplish is, if login successful, must show main form , close login form. i have method in login form closes login form when login successful. main form doesn't show. public void showmain() { if(auth()) // method returns true when user exists. { var main = new main(); main.show(); this.close(); } else { messagebox.show("invalid login details."); } } i tried hiding login form if login process successful. bothers me because know while program running login form still there too, should closed right? what should right approach this? thanks... the reason main form isn't showing because once close login form, application's message pump shut down, causes entire application exit. windows message loop tied login form because that's 1 have set startup form in project properties. in "program.cs" f...

c++ - Shared Preferences implementation -

my aim implement class can accessible anywhere, providing key value pairs; class sharedresources { public: static qmap <qstring,qvariant> *preferences; }; //initialization sharedresources.preferences = new qmap<qstring,qvariant>(); //store data sharedresources.preferences->insert("some_data",some_data); //access data some_data = sharedresources.preferences->value("some_data"); but code not compile. first error (got similar @ every usage): /file:line: error: expected unqualified-id before '.' token sharedresources.preferences = new qmap<qstring,qvariant>(); ^ i broke c++ rules, are? update: using :: error is: /file:line: error: undefined reference `sharedresources::preferences' it's better in such case use statically rather dynamically allocated memory (i.e. without new ). your problem have declare , define static field well. in header file declare it, should defined somewhe...

php - Paypal IPN - Getting + then losing data? -

i using following library: https://github.com/paypal/adaptiveaccounts-sdk-php/tree/master/samples/ipn and paypal ipn seems working fine... can checkout , of post data paypal logged server, problem - how check against when user on site? i have return url set same ipn url (look in github code) , after of valid data, user gets returned ipn page , says invalid. not quite sure, thoughts? ipn should not used return url. return url brings buyer site. page @ return url should display either generic thank page, or page indicating status of buyer's order. 1 of above choose, depends on paypal product select, integration , purchasing flow. the script url of ipn listener used automate order handling process. ipn listener gets ipn messages, processes order in own defined way. ipn listener should post specific data paypal ipn endpoint http status 200. if outputs page, makes things complicated. need differentiate between buyer visit , paypal ipn message, , need correspo...

how to install google play services programmatically in android for displaying google maps ? -

i have device in google play services not installed. application uses google maps display current location..so in order display maps getting message install google play services. i have code check whether google play services installed or not. final int rqs_googleplayservices = 1; // check status of google play services int status = googleplayservicesutil.isgoogleplayservicesavailable(this); // check google play service available try { if (status != connectionresult.success) { googleplayservicesutil.geterrordialog(status, this, rqs_googleplayservices).show(); } } catch (exception e) { log.e("error: googleplayserviceutil: ", "" + e); } but displays dialog install google play services..on click of button says no scan data received. can 1 me install play services programmatically...or should manually install them ...? if device legitimately has play store on it, dialogs should user on play store download appropriate apk. if not w...

performance - Loading images takes my direct memory up | AS3 -

i'm loading bitmaps, without adding them stage, each image takes direct memory up. large images take more memory, i'm wondering how keep direct memory low after loading bitmaps, or maybe i'm doing here wrong or missing something? var mybitmapholder:bitmap; var bitmaploader:loader = new loader(); bitmaploader.addeventlistener(event.complete, bitmaploaded); bitmaploader.load(new urlrequest("mybitmap.png"); private function bitmaploaded(e:event):void { mybitmapholder = e.currenttarget.content; } after loading bitmap, i'm storing using mybitmapholder access upon request. i'm using more 30 bitmaps, works same example above each image separately. so ... there no free resource - have load in memory, or have load unload each or few bitmaps. 'eat' other resource cpu , network traffic etc. first have remove 'bitmaploader' event.complete listener in 'bitmaploaded' function: bitmaploader.remo...

github - Git: Pulling and merging branch into Master -

so far have used git individually , first time using team. facing issue: there master repo contains 2 branches; dev1 , dev2 . have been assigned review code of dev1 , merge master . now in order view code or running want set branch on local machine. how pull of branch data first time have folders on machine , how later pull changes branch. later how merge branch dev1 master ? thanks if not have clone of remote repo: git clone <remote repo url github> cd <repo> fetch remote branches remote repo: git fetch origin checkout remote branch 'dev1': git checkout dev1 review , run code see fit. if have privileges (on github) push 'origin:master' should able merge 'master' 'dev1' , push updated 'master': git checkout master git merge dev1 git push origin master if not have privileges update remote 'origin:master' can issue pull-request (on github).

javascript - Add input fields in form when dropdown option selected -

how add fields in form dynamically so form looks : <form action="/reservation-add" method="post"> <select id="dropdownlist"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> <input></input> </form> if selected e.g 3 should append 3 new inputs (could array take of values ) know have use javascript don't know how. use way: $("#dropdownlist").change(function () { var numinputs = $(this).val(); (var = 0; < numinputs; i++) $("#inputarea").append('<input name="inputs[]" />'); }); have div , id "inputarea": <div id="inputarea"></div> snippet $("#dropdownlist").change(function ...

php - configuring httpd conf in aws -

i update httpd conf in elastic beanstalk set allowoverride all , hence allow myself execute following .htaccess code: rewriteengine on rewriterule ^/?category/([^/d]+)/?$ searchpage.php?crs_category=$1 [l,qsa] the htaccess file located in root to configure httpd conf trying follow below guide: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers.html my problems follow: my computer not allow me create folder called .ebextensions - won't accept dot in front of exbextensions i place .config file inside exbentension following code: <directory /> options none allowoverride order deny,allow deny </directory> <directory /path/to/your/htdocs/> allowoverride </directory> i not sure if following/executing things properly, , appreciate guidance. windows explorer doesn't allow create file names starting . believe reason lies in dos file names had separate fields name , extension, , ...

common lisp - Additional symbol LIST when using ,@ -

i observed macro expansion not understand: (defmacro test (cons-list) `(list ,@(mapcar #'(lambda(elem) elem) cons-list))) (defmacro test-2 () `(list ,@(list (cons "a" "b")))) (defmacro test-3 (cons-list) `(list ,@cons-list)) i'd expect both macros expand in same fashion, use mapcar in fancy way of creating same list again , use list. results observed in sbcl are: (test (list (cons "a" "b"))) expands (list list (cons "a" "b")) (test-2) expands (list ("a" . "b")) (test-3 (list (cons "a" "b"))) again expands (list list (cons "a" "b")) why don't these macro expansions behave same? test-2 evaluates form (list (cons "a" "b")) , other 2 not. remember: arguments macro forms read, unevaluated. in order same behaviour test-2 , have quote form: ,@'(list (cons "a...

qt - QGraphicsRectItem's signal itemChange not generating on drag -

i have made custom class derived qgraphicsrectitem. class cornerpoint : public qgraphicsrectitem { public: cornerpoint(qpointf centre); enum { type = usertype + 1 }; int type() const{ return type; } qvariant itemchange(graphicsitemchange change, const qvariant &value); public slots: void updateposition(qpointf); }; cpp file cornerpoint::cornerpoint(qpointf centre): qgraphicsrectitem(null) { setpos(55,22); setrect(0,0,99,99); } qvariant cornerpoint::itemchange(qgraphicsitem::graphicsitemchange change, const qvariant &value) { std::cout << "change is" << change << std::endl; if( qgraphicsitem::itempositionchange == change && scene()) { std::cout << "new values " << value.topointf().x() << value.topointf().y() << std::endl; } return qgraphicsitem::itemchange(change, value); } i have made these objects selectable , moveable. when drag them, d...

html - Use CSS to get a seperator on the last item in a menu -

i trying display | seperator within list menu each list item except last one, dynamically generated using yii component i'd need via css. i tried using snippet had no joy: #mainmenu li:last-child:after { content: "|"; }; } i want shows seperator this: home | | | contact here html code, please note using skeleton css framework 1.1 (legacy know). <nav class="action-bar row"> <div> <ul id="mainmenu" class="container menu"> <li class="home active first"><a href="/">home</a></li> <li><a href="/about">about us</a></li> <li><a href="/whatwedo">what do</a></li> <li class="last"> <a href="/contact">contact us</a> </li> </ul> </div> </nav> my css...

ios - Parse Swift: Check if update was successfully committed -

i performing update operation , know how can know if saveinbackground successful or not. code using below. if successful show alert view , if not display error. query.getobjectinbackgroundwithid(objectid!) { (userinstance: pfobject?, error: nserror?) -> void in if error != nil { println(error) } else if let userinstance = userinstance { userinstance["number1"] = number1 userinstance["number2"] = number2 userinstance.saveinbackground() //self.performseguewithidentifier("cancelchangessegue", sender: nil) var alert = uialertview() alert.title = "number updated!" alert.message = "you've updatd number" alert.addbuttonwithtitle("great!") alert.show() } } userinstance.saveinbackgroundwithblock { (success: bool, error: nserror?) -> void in if (success) { // object has been saved. ...

Django-Rest-Framework router register -

i'm having issue when try register more 2 routers using django-rest-framework. please take on example: urls.py from rest_framework import routers collaborativeapp import views router = routers.defaultrouter() router.register(r'get_vocab', views.vocabviewset) router.register(r'get_term', views.termviewset) router.register(r'get_discipline', views.disciplineviewset) urlpatterns = patterns( ... url(r'^service/', include(router.urls)) ) views.py class vocabviewset(viewsets.modelviewset): queryset = vocab.objects.all() serializer_class = vocabserializer class termviewset(viewsets.modelviewset): queryset = term.objects.all() serializer_class = termserializer class disciplineviewset(viewsets.modelviewset): queryset = vocab.objects.filter(kwdgroup=4) serializer_class = disciplineserializer the result in localhost following: http://localhost:8000/service/ http 200 ok content-type: application/json vary: accept...

android - Retrieve SQLite Data by using Date part out of DateTime Format -

i want retrieve date sqlite using date. default column in sqlite inserted datetime format. for instance,this type table _id date_value 1 2015-07-06t11:36:35 2 2015-07-06t12:10:10 3 2015-07-06t12:10:19 4 2015-07-03t17:13:59 5 2015-07-03t17:14:04 6 2015-07-03t17:14:27 i want retrieve data using date only. how want query? i tried retrieve this: select * type date_value=date('2015-07-03t17:13:59') returns 0 rows. i need rows date(2015-07-03) matched expected result: _id date_value 4 2015-07-03t17:14:27 5 2015-07-03t17:14:04 6 2015-07-03t17:14:27 how should achieve output? the date() function returns date part of parameter, result of date('2015-07-03t17:13:59') '2015-07-03' . value not match of values in date_value column. you need extract date values in date_value column: select * type date(date_value) = '2015-07-03'

database - NoSQL store re-orderable list of elements -

i have nosql setup follows: userid : contentid : orderid user1 : content1 : 0 user1 : content2 : 1 user2 : content3 : 0 user2 : content4 : 1 user2 : content5 : 2 user2 : content6 : 3 user2 : content7 : 4 i list of user2 items sorted order select * table userid = 'user2' sort orderid desc which results in userid : contentid : orderid user2 : content3 : 0 user2 : content4 : 1 user2 : content5 : 2 user2 : content6 : 3 user2 : content7 : 4 great! want swap table looks this: userid : contentid : orderid user2 : content3 : 0 user2 : content6 : 3 user2 : content4 : 1 user2 : content5 : 2 user2 : content7 : 4 so move content6 after content3 , before content4 . drawback update orderid have update every row after content3 resulting in multiple writes datastore. what better way of doing in nosql database? you can solve more sophisticated algorithm, can create big gap between keys , move item 1 place inbetween other keys...

python - Synchronizing development PostgreSQL database on local machine -

i developed django website in linux, learning django , git along way; pushed source files bitbucket. i'm in windows , wanted see if figure out how work on project windows (just practice version control). did following: installed python (3.4) installed virtualenv,virtualenvwrapper-win installed postgresql windows installer on website installed psycopg2 .whl file because pip insisting don't have c++ installed git using windows installer website cloned bitbucket repository using git create virtualenv using virtualenvwrapper, installed dependencies requirements.txt (except psycopg2 had install manually) now i'm bit confused database, need create new one? how synchronize local database created in linux? database part of version control? i know sqlite has .sqlite file, postgresql seems work bit differently. edit: recreated database , user in windows, how make sure information database synchronizes wherever i'm developing fixtures can used move da...

c++ - How to create n-dimensional test data for cluster analysis? -

i'm working on c++ implementation of k-means , therefore need n-dimensional test data. beginning 2d points sufficient, since can visualized in 2d image, i'd prefer general approach supports n dimensions. there an answer here on stackoverflow, proposed concatenating sequential vectors of random numbers different offsets , spreads, i'm not sure how create those, without including 3rd party library. below method declaration have far, contains parameters should vary. can changed, if necessary - exception of data , needs pointer type since i'm using opencl. auto populatetestdata(float** data, uint8_t dimension, uint8_t clusters, uint32_t elements) -> void; another problem came mind efficient detection/avoidance of collisions when generating random numbers. couldn't performance bottle neck, e.g. if one's generating 100k numbers in domain of 1m values, i.e. if relation between generated numbers , number space isn't small enough? question how...

java - org.springframework.beans.factory.BeanCreationException: -

i getting following exception,please resolve ? org.springframework.beans.factory.beancreationexception: error creating bean name 'usercontroller': injection of autowired dependencies failed; nested exception org.springframework.beans.factory.beancreationexception: not autowire field: private com.dao.userdao com.controller.usercontroller.userdao; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'userdaoimpl': injection of autowired dependencies failed; nested exception org.springframework.beans.factory.beancreationexception: not autowire field: private org.hibernate.sessionfactory com.dao.userdaoimpl.sessionfactory; nested exception org.springframework.beans.factory.nosuchbeandefinitionexception: no matching bean of type [org.hibernate.sessionfactory] found dependency: expected @ least 1 bean qualifies autowire candidate dependency. dependency annotations: {@org.springframework.beans.factory.annotation.autowired(req...

vb.net - UserPrincipal.Save() - vshost32.exe has stopped working - Corrupt heap -

i'm writing software import csv file active directory (to create user accounts). @ point know working importing multiple accounts. i'm not sure i've changed it's been while since last worked on it. imports 2 accounts , crashes on line below during third loop iteration (however third account still created): newuser.save() when crashes error "vshost32.exe has stopped working". enabled native code debugging , error: "0xc0000374: heap has been corrupted" , invalidcastexception (see immediate window @ end of post full error). testing i've been deleting , recreating same accounts. if don't delete first 3 accounts, principal exists exception handled , program crashes on 4th iteration, , 5th , on. never crashes on first two. (the data i'm importing identical except numbers - e.g. samaccountnames: test1, test2, test3 etc) my code private sub bwimport_dowork(sender object, e system.componentmodel.doworkeventargs) handles bwimport.dowork...

c# - Web API call works but gives exception The view 'xxx' or its master was not found or no view engine supports -

strange 1 here, code calls method, , method grabacat executed on server (i debug , step through right end). code returns client, response received 500 internal server error above message. it's saying couldn't find web api method called successfully. using (var response = await client.postasxmlasync("cats/grabacat", mycatprefs)) { if (response.issuccessstatuscode) // 500 cats/grabacat not found controller code: [route("~/api/cats/grabacat")] [httppost] public async task grabacat() { } after debugging, if change public async task<someobject> grabacat() works ok. lets me return object client. don't want return back; want equivelent calling void method. examine status code determine if successful. i have got working changing grabacat task , returning new object(); not sure why required. seems crude return empty object work. any ideas? the webapi method has route attribute this: [route("~/api/cats/grabacat")...

c# - Xaml Scrollviewer not showing the full Grid content -

i made product page scrollviewer not show in grid. have feeling has row definitions hope can me xaml: <page background="{themeresource applicationpagebackgroundthemebrush}" height="729.552"> <page.resources> </page.resources> <grid x:name="layoutroot" d:datacontext="{d:designdata /sampledata/rootobjectsampledata2.xaml}" horizontalalignment="left" verticalalignment="top"> <grid.childrentransitions> <transitioncollection> <entrancethemetransition/> </transitioncollection> </grid.childrentransitions> <!--todo: content should placed within following grid--> <grid x:name="contentpanel" horizontalalignment="left" verticalalignment="top"> <pivot x:name="producthub" horizontalalignment="left" verticalalignment="top"> <pivotitem x:...

loops - SPSS: Use index variable inside quotation marks -

i have several datasets on want run identical commands. basic idea create vector names of datasets , loop on it, using specified name in command: vector=(9) d = name1 name9. loop #i = 1 9. file = directory\d(#i).sav value labels v1 v8 'some text d(#i)' loop end. now spss doesn't recognize want use specific value of vector d. in stata i'd use local d(v1 v8) foreach d{ ....`d' ..... } you can't use vector in way i.e. using get command within vector/loop loop. however can use define/!enddefine . spss's native macro facility language, if not aware of this, you'll need lot of reading on , understand it's syntax usage. here's example: define !runjob () !do !i !in 1 !to 9 file = !concat("directory\d(",#i,").sav"). value labels v1 v8 !quote(!oncat("some text d(",#i,")", !doend !enddefine. set mprint on. !runjob. set mprint off. all code between define , !...