Posts

Showing posts from March, 2010

C++ Local Static Variable Allocation -

so im learning c++ memory allocation , static variable. understand local variables allocated stack , not practice static. there situations use of local static variable not work @ all? i think confusing between two. there difference between local variable , local static variable . former's life till function exits (allocated on stack) later exists till program exits (allocated in global/static area of program memory).

pdf - .net, Itextsharp, how to flatten comments (specifically stamps)? -

in short, i'm having issues "flattening" stamp comments in pdf's while using itextsharp. effect i'm looking identical when "print pdf" acrobat (the stamp can no longer moved/edited/etc. can still select text might have). using simple javascript code seems work fine (this.flattenpages). this problems seems pertain stamps, real trick of it. i've used pdfstamper class flatten other kinds of page comments , annotations (e.g. text boxes) using: stamper.formflattening = true stamper.freetextflattening = true but not work stamps i've tried (the default included in acrobat or user created). document comes out on other end same editable stamp. so... ideas? , please let me know if there's additional information can provide. thanks. update: not same other annotations. whatever it's worth, stamps (specifically) show overcontents. how 1 go changing flag or otherwise merging/flattening onto page else can't find documentation for.

C# opening a Form out of a TrayIcon -

i used snippet creating tray application 2 buttons (settings , exit): using system; using system.windows.forms; using system.drawing; using windowsformsapplication1; //***************************************************************************** abstract class notico { private static notifyicon notico; //========================================================================== public static void main(string[] astrarg) { contextmenu cm; menuitem micurr; cm = new contextmenu(); micurr = new menuitem(); micurr.index = 0; micurr.text = "&settings"; micurr.click += new system.eventhandler(settingsclick); cm.menuitems.add(micurr); micurr = new menuitem(); micurr.index = 1; micurr.text = "beenden"; micurr.click += new system.eventhandler(exitclick); cm.menuitems.add(micurr); notico = new notifyicon(); notico.icon = new icon("tanss.ico"); notico.text = "tanss busylight connector&

jsp - java.lang.IllegalStateException: Cannot forward after response has been committed in servletfilter -

i using filter determine whether or not requested page has valid session or not. this code. web.xml : <filter> <filter-name>sessionfilter</filter-name> <filter-class> com.imagemanagementutility.filter.sessionfilter </filter-class> <init-param> <param-name>avoid-urls</param-name> <param-value>index.jsp</param-value> </init-param> </filter> <filter-mapping> <filter-name>sessionfilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> filter class: public class sessionfilter implements filter { private arraylist<string> urllist; public void destroy() { } public void dofilter(servletrequest req, servletresponse res, filterchain chain) throws ioexception, servletexception { httpservletrequest request = (httpservletrequest) req; httpservletresponse re

Dispose JavaFX Tasks -

i have static borderpane contextmenu insight task task task = new task() { @override protected void call() throws exception { platform.runlater(new runnable() { @override public void run() { try { contextmenu = new contextmenu(); menuitem item1 = new menuitem("about"); item1.setonaction(new eventhandler<actionevent>() { @override public void handle(actionevent e) { system.out.println("about"); } }); menuitem item2 = new menuitem("preferences&

c# - sound not playing at the right moment -

i created mediaelement background music in windows phone app , plays problem when tried add sound button when pressed when debug , background music plays , when press button navigates me next page without playing sound created, , when press backbutton navigated page , plays it, why? code: private void play_click(object sender, routedeventargs e) { mediaelement click = new mediaelement(); click.source = new uri ("/assets/sounds/press.mp3",urikind.relative); click.position = timespan.zero; click.volume = 1; layoutroot.children.add(click); click.play(); navigationservice.navigate(new uri("/navpage.xaml", urikind.relative)); } private void play_click(object sender, routedeventargs e) { mediaelement click = new mediaelement(); click.source = new uri ("/assets/sounds/press.mp3",urikind.relative); click.position = timespan.zero; click.volume = 1;

c# - How to set windows path regex pattern? -

i have list of paths, , need match starting c:\program files\_folder_\_folder_\etc , having amount , type of character windows path can use. how approach, though guess allows alpanumeric characters: string pathpattern = @"c:\program files\_folder_\_folder_\etc[0-z]*"; if (system.text.regularexpressions.regex.ismatch(mylist[n], pathpattern, system.text.regularexpressions.regexoptions.ignorecase) { //some action } if c:\program files\_folder_\_folder_\etc pre-defined part. think can without regex using contains if(pathpattern.contains(@"c:\program files\_folder_\_folder_\etc")) { //some action } edit 1: can tolower() on pathpattern var ss = pathpattern.tolower().contains(@"c:\program files\_folder_\_folder_\etc".tolower());

android - Getting java.io.IoException while calling .net web service from my java code -

my code: import org.ksoap2.soapenvelope; import org.ksoap2.serialization.propertyinfo; import org.ksoap2.serialization.soapobject; import org.ksoap2.serialization.soapserializationenvelope; import org.ksoap2.transport.httptransportse; import android.util.log; import android.widget.toast; public class callsoap { public final string soap_action = "http://tempuri.org/sendmessage"; public final string operation_name = "sendmessage"; public final string wsdl_target_namespace = "http://tempuri.org/"; public final string soap_address = "http://omega-solutions.in/expertsapp.asmx"; public callsoap() { } public string call(string deviceid, string msg) { soapobject request = new soapobject(wsdl_target_namespace, operation_name); propertyinfo pi = new propertyinfo(); pi.setname("deviceid"); pi.setvalue(deviceid); pi.settype(string.class); reques

r - Removing for loop -

i trying run function have written have realised going take long. can tell me best way remove loop in following function. function aims read load of site weather data , find weather extreme has been exceeded on particular day average extreme of month. i trying use ifelse failing. extremes <- function (siteno){ (j in siteno){ # reads in weather data specipied site butterfly_data <- read.csv(paste("~/project data/site subsets/site", j, ".csv", sep = "")) precip <- read.csv(paste("//ueahome5/ressci5/zuw13bqu/data/ntprofile/desktop/eobs european data/siteweather/rr/weather.site.", j, ".csv", sep = "")) tmin <- read.csv(paste("//ueahome5/ressci5/zuw13bqu/data/ntprofile/desktop/eobs european data/siteweather/tn/weather.site.", j, ".csv", sep = "")) tmax <- read.csv(paste("//ueahome5/ressci5/zuw13bqu/data/ntprofile/desktop/eobs european data/siteweather/tx/wea

c# - Changing struct to class? -

i want change struct patient class when program don't work(free of errors) want substitute struct patient class patientn, can see button click uses struct patient , want change class , still work. visual studio 10 program: public partial class form1 : form { int itemcountinteger; public struct patient { public string patientidstring; public string firstnamestring; public string lastnamestring; } public form1() { initializecomponent(); } private void form1_load(object sender, eventargs e) { } public class patientn { private int patientid; public string firstname; private string lastname; public patientn() { patientid = 0; firstname = ""; lastname = ""; } public patientn(int idvalue, string firstnameval, string lastnameval) { patientid = idvalue; firstname = firstnameval; lastname = lastnameval; } } //array patient[] patientinfo = new patient[1

weblogic11g - What is the business benefit for Oracle Weblogic Server over OC4J? -

apart technology support , business benefits oracle web logic server. example in area of security,support etc. what new features supported weblogic ? tl;dr: support great when open ticket oracle support (weblogic strictly). great admin/read-only user implementation. authenticate windows active directory. developers read-only accounts, reduces churn them wait ops transfer logs , validate settings. dashboard useful out-of-box real-time monitoring without additional tools or installs. accessed 1 authenticated login. give our cio if wanted in 3 minutes adding him right authorized group in ad. easier clone environments. i haven't worked oc4j believe oracle's roadmap picking weblogic preferred java application server. can see base technology of other products, such oracle service bus, oracle enterprise manager (oem), , oracle line planning. i have opened 3 oracle tickets in past month. surprised @ how fast answered. severity 3 ticket (medium), have resp

css - Problems calling a SASS built-in function -

this question has answer here: sass: randomly pick background-image list 1 answer i have fragment of sass code: @font-face { $rndnum: random(1000); font-family: myfont; src:url('fonts/myfont#{$rndnum}.svg') font-weight: bold; font-style: normal; } i need put random number after name of font, know seems stupid operation, need it. problem following result: @font-face { font-family: myfont; src:url('fonts/myfontrandom(1000).svg') /* <== here */ font-weight: bold; font-style: normal; } the function not called reason... doing wrong? something more... i tried calling function percentage : @font-face { $rndnum: percentage(0.2); ... and worked in case... looks not recognizing random valid function... have tried concatenating string? src:url('fonts/myfont'+$rndnum+'.svg'); and have code $rn

button - php two actions in one form -

i have question other options... have form this... <form action="edit.php" method="post"> . . . . <button class="btn btn-success" name="submit_mult" type="submit">edit</button> </form> i have button called (delete) inside of above form in same page take action delete.php page. but delete button need action delete.php, used action="edit.php" see above codes how can solve make both works! am you can use formaction attribute on button: <button type="submit" formaction="delete.php">delete</button> this overrides action attribute of form when click on button.

ios - Take a picture with CvPhotoCamera -

i use cvphotocamera take photo iphone camera. i added button , when tap on button call method: [_photocamera takepicture]; i implemented delegate method: - (void)photocamera:(cvphotocamera*)photocamera capturedimage:(uiimage *)image but when delegate method called, image has small size: 480x320 why? possible take photo high definitions (as when use uiimagepickercontroller ) you need set defaultavcapturesessionpreset property on cvphotocamera avcapturesessionpresetphoto full resolution.

sql - Custom Postgres function for term dates and times -

lets have large table consists of 3 columns. integer id, timestamp ts, double value if wanted values given complicated date expression best way achieve ? for example if wanted values @ anytime on weekend days , between 18:00 , 8:00 on weekdays , time on school holidays year 2014. obviously of these times variable , solution should dynamic. thinking of storing series of date intervals things school holidays in table check against. however, create custom postgres function hide of complexity. does know of similar code or have suggestions ? dealing cases times above except on weekend logic ? thanks with holiday table select * t left join holiday on date_trunc('day', t.ts) = holiday.day extract(dow ts) in (0, 6) -- weekend or (extract(hour ts) >= 18 , extract(hour ts) <= 8) or holiday.day not null -- holiday

linux - Finding Volume Label of a usb mass storage device using python -

could please tell me how obtain usb mass storage device's volume label(the name displayed in explorer, not device name::/dev/sdx) using python? hal has deprecated please don't suggest option. edit: there way using pyudev or pyusb?? if don't want use hal calling subprocess . import subprocess mounts = {} line in subprocess.check_output(['mount', '-l']).split('\n'): parts = line.split(' ') if len(parts) > 2: mounts[parts[2]] = parts[0] print mounts

osx - IntelliJ on Mac Can't detect syntax errors for JAVA -

Image
i started using intellij on mac. problem met syntax error on java file can't detected , highlighted in pc. the problem errors not detected instead of errors not being highlighted, because have checked highlighting setting. any configuration can play let syntax error can detected? i.e., test = "test"; there no class declaration. i'm going guess java classes have icon when open them: what means java class file isn't in recognized source root. doesn't know source file, won't treat one. right-click on folder, , select "mark directory as" -> "sources root". after that, drag , drop java class folder. then, you'll see appear this: then intellij report of errors.

git - How to pull several items from remote repository? -

i have example 3 files in project, a, b , c. working on these files, , stage b , c , push remote repository via git source control. developer works on these files, works on a, , here's question. how pull remote, update b , c, leave file unchanged?

mongodb - Get unique keys and distinct list of values for each -

i have set of documents this: input [ { color: "red", size: "small" }, { color: "blue", size: "small" }, { color: "red", size: "medium" }, { color: "green", size: "medium" }, { color: "black", size: "large" } ]; i want create set made of each key, , distinct values each key: output [ { name: "color", values: ["red", "blue", "green", "black"] }, { name: "size", values: ["small" "medium", "large"] } ] i won't know keys of input document be. i know how solve 2 problems separately: get keys of arbitrary document following this answer use aggregation frameworks $addtoset operator distinct list of values each key. i in 1 pass. think it's possible use aggregation framework step 1, , pipe step 2, maybe not.... thanks as mentioned in comment, withou

php - Undefined property error when calling a library function -

i have 2 controllers in user folder. 1 user , othe 1 profile. , have library called category_detail in category folder. when call $this->category_detail->get_category_detail(2); in user controller works well. when same call in profile controller gives error. in both file have loaded category_detail library in constructor. error follows. severity: notice message: undefined property: profile::$category_detail filename: user/profile.php check link http://ellislab.com/codeigniter/user-guide/general/creating_libraries.html you have put library file in application/libraries folder

java - Get Inner Json String Data from Main Json String using Gson -

i using gson parse data json string. working fine. now, main json string contains inner json string , want inner json string 's data. how ? check json string : [{"question":"are inclined to:","qid":"2","options":[{"option":"argue or debate issues","optionid":"4"},{"option":"avoid arguments","optionid":"5"},{"option":"swutch topics","optionid":"6"}]}] here, want value of "options". sample code below : primarytest[] testlist = gson.fromjson(result, primarytest[].class); // result json string. list<primarytest> lsttest = arrays.aslist(testlist); primarytest objtest = lsttest.get(0); string question = objtest.getquestion(); here, getting question value don't know how options value. if using same method giving error : invalid json data . primarytest.java code : publ

ios - UIWebView opening URL after google search makes app to crash -

i don't know reason uitextfield data, "facebook", call code - (ibaction)searchforaddress:(id)sender { [self loadrequestfromaddressfield:_addressfield]; } - (void)loadrequestfromaddressfield:(id)addressfield { nsstring *urlstring = [addressfield text]; [self loadrequestfromstring:urlstring]; } - (void)loadrequestfromstring:(nsstring*)urlstring { nsstring *composedurlstring = [nsstring stringwithformat:@"http://www.google.com/search?q=%@",urlstring]; nsurl *url = [nsurl urlwithstring:composedurlstring]; nsurlrequest *urlrequest = [nsurlrequest requestwithurl:url]; [self.webview loadrequest:urlrequest]; } now uiwebview loads correctly giving me result of google search, problem when try enter link crashes giving me error terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[webviewcontroller searchurl:]: unrecognized selector sent instance 0x8f38540' what problem?? please c

Slide down menu bar using CSS3 and HTML5 -

i have html5 , css3 menu bar i've been working on , i'm trying make visible when hovering on div. on have done wrong appreciated. here code, thankyou in advance: html <!doctype html> <html> <head> <title> navigation </title> <link rel="stylesheet" type="text/css" href="navigation.css"/> </head> <body> <nav> <ul> <li><a href="#">home</a></li> <li><a href="#">menu 1</a> <ul> <li><a href="#">submenu 1</a></li> <li><a href="#">submenu 2</a></li> <li><a href="#">submenu 3</a></li> </ul> &

python - How to Clear/Invalidate NDB Cache in Tests -

i have simple ndb model instance attribute, not ndb property . want test property value gets lost when entity saved , retrieved datastore. now when entity retrieved same instance 1 has been put datastore. is there way programatically clear/invalidate memcache , ndb in-memory cache ? the example pytest test, sorry that. from google.appengine.ext import testbed, ndb class user(ndb.model): name = ndb.textproperty() foo = none class testndbmodel(object): def setup(self): self.testbed = testbed.testbed() self.testbed.activate() self.testbed.init_datastore_v3_stub() self.testbed.init_memcache_stub() def teardown(self): self.testbed.deactivate() def test_foo(self): user = user(name='andy') assert user.name == 'andy' assert user.foo none user.foo = 123 assert user.foo == 123 user_key = user.put() # here need clear cache somehow, # e

c++ - Unhandled exception OpenCV -

i working on object tracking using surf assignment. code runs on ubuntu webcam doesn't work on need make work on windows (visual studio 2010, opencv 2.4.3) demo. my code based on this: http://docs.opencv.org/doc/tutorials/features2d/feature_homography/feature_homography.html i'm guessing if solved, code start working. the error is: unhandled exception @ 0x75b92eec in sift.exe: microsoft c++ exception: std::length_error @ memory location 0x00c6e328.. any idea how solve this? think have added necessary libraries because builds successfully. thanks in advance!

How to get 2 outputs from a function in R ('list' is not working)? -

my data looks following: > dput(head(updata[,c(1,4,5,6)],10)) structure(list(vehicle = c(2l, 5l, 8l, 9l, 10l, 12l, 13l, 14l, 18l, 20l), class = c(2l, 2l, 2l, 2l, 2l, 2l, 2l, 3l, 2l, 2l), velocity = c(42.48, 39.81, 40.63, 47.11, 41.2, 38.92, 35.38, 38.62, 38.94, 43.24), lane = c(2l, 4l, 4l, 3l, 1l, 1l, 2l, 5l, 5l, 3l)), .names = c("vehicle", "class", "velocity", "lane"), row.names = c(32l, 707l, 1392l, 1772l, 2125l, 2501l, 2896l, 3262l, 3726l, 3941l), class = "data.frame") i want find cumulative distribution of 'velocity' 'class' , 'lane'. used following 2 functions , ddply : speedu <- function(x){ hi <- hist(x) speedmph=round(hi$breaks*0.68,1)} cumdistu <- function(x){ hi <- hist(x) prob=c(0, round(cumsum(hi$counts)/sum(hi$counts),digits=2))} spdistu <- ddply(updata, c('lane', 'class'), summarise,speed=speedu(velocity),cprob=cumdist(velocity))

javascript - CSS Making a tab bar -

Image
i'm making tab bar pressing appropriate tab button (like web browsers) shows appropriate elements changing visibility property of each of elements. elements not appear right under bar, appear shifted down if isn't first button. because visibility doesn't affect layout , items written 1 after another. want them appear @ top. can't remove them because have javascript properties, , cant position absolute them without them not being able fill container w/h 100%. how this html <tab-view id="tabview"> <tab-bar></tab-bar> <tab-content> <!-- first tab-content show on page load --> <tab-item data-title="meat pizzas"> <circular-view id="exampleview" data-object-class="exampleobject" data-autoloop-interval="1000 "> <circular-object data-icon="resource

c# - Is [CallerMemberName] slow compared to alternatives when implementing INotifyPropertyChanged? -

Image
there articles suggest different ways implementing inotifypropertychanged . consider following basic implementation: class basicclass : inotifypropertychanged { public event propertychangedeventhandler propertychanged; private void firepropertychanged(string propertyname) { var handler = propertychanged; if (handler != null) handler(this, new propertychangedeventargs(propertyname)); } private int sampleintfield; public int sampleintproperty { { return sampleintfield; } set { if (value != sampleintfield) { sampleintfield = value; firepropertychanged("sampleintproperty"); // ouch ! magic string here } } } } i'd replace one: using system.runtime.compilerservices; class betterclass : inotifypropertychanged { public event propertychangedeventhandler propertychanged; // check attribute in followin

javascript - toggle contents onclick button in angularjs -

here jsfiddle demo created using jquery. $(function(){ $("#describe-block-toggle-btn").click(function(){ $("#ptor-it-block").toggle(); $(this).text(function(i, text){ return text === "start" ? "stop" : "start"; }) }); $("#it-block-toggle-btn").click(function(){ $(this).text(function(i, text){ return text === "start" ? "stop" : "start"; }) }); }); i need convert code jquery angular. so far i'm able convert lot still not able achieve toggling effect can see in jsfiddle demo mentioned above. here link angularjs demo using plunker. any appreciated , if can point angularjs tutorials apart official angularjs site tuts great. way ahead learn angularjs in depth. update: luckily found bunch of links blog posts, articles, videos, etc learning angularjs, @ 1 place. visit link here , explore infinity.

java - why is tableModelListener code is not being excquted after use of a combo box actionListerner -

i have simple program displays tables database using jtable. have combobox list available tables , actionlistener sets model table each time changed. works desired. problem getting when table selected program never reaches code tablemodellistener therfore not updating database. i did debugging placing popup messages if program entered blocks of code , program never enters table model listener once combo box actionlistener activated. below bulk of code. classes.addactionlistener(new actionlistener(){ @override public void actionperformed(actionevent ev) { jcombobox cb = (jcombobox)ev.getsource(); classname =(string)cb.getselecteditem(); string genquery="select * "+classname; string query = genquery ; //adding info databae table/ resultset rs=null; try { rs = stmt.executequery(query); } catch (sqlexception e) { // todo aut

arrays - PHP - refreshing page and showing different rows in a table -

<?php //if pagenum isset figure out start(7 rows per page * page num +1 $pagenum = isset($_get['pagenum']) ? (int)$_get['pagenum'] : 0; $startrow = $pagenum == 0 ? 0 : ($pagenum * 7 + 1); $endrow = $startrow + 7; $count = 0; while (($data = fgetcsv($handle, 1000, ";")) !== false) { if($count >= $startrow) echo ' aantal vervangingen: 30'; $row = 1; if (($handle = fopen("vervangingen.csv", "r")) !== false) { echo '<table border="1">'; while (($data = fgetcsv($handle, 1000, ";")) !== false) { $num = count($data); if ($row == 1) { echo '<tr>'; }else{ echo '<tr>'; } ($c=0; $c < $num; $c++) { //echo $data[$c] . "<br />\n"; if(empty($data[$c])) { $value = "&nbsp;"; }else{ $value = $data[$c]; } if ($row == 1)

Android webview centering horizontal and vertical -

i'm new android development, , trying center text , images using web view. i've tried android:layout_centervertical="true" android:layout_gravity="center" and it's not centering vertically or horizontally. there i'm missing?

c# - Auto restart windows service -

i trying window service in c#, should running always. if there crash or shutdown, should automatically restart. considered using service controller class, problem how handle if both service controller & service go down @ same time. there watchdog functionality in windows can register , takes care of service start up? you consider using recovery options of service. can set through properties of service when running services.msc. please here , here more information.

windows store - Submit an app with In App modules -

i newbie in windows store apps development. have created app has in-app purchase modules. testing locally created windowsstoreproxy.xml file, test in app purchases, updated xml manually , added these modules in listinginformation , licenseinformation tags. if don't app throws keynotfoundexception usual. issue is, after submitting app app store how testers test these in-app purchases? serious, because may cause app rejection. please suggest. on store dashboard, you'll fill out in-app purchase details before submit. info in store database when testers app. to specific, when uploading app you'll take whatever information you've been using windowsstoreproxy.xml , paste app description page. if want see looks like, go ahead , create app package now, , upload dashboard. allow go description page can see required. make sure upload new package before complete submission. also sure change currentappsimulator currentapp (you'll fail cert if forget).

performance - Best way to store, load and use an inverted index in C++ (~500 Mo) -

i'm developing tiny search engine using tf-idf , cosine similarity. when pages added, build inverted index keep words frequency in different pages. remove stopwords , more common words, , plural/verb/etc. stemmed. my inverted index looks like: map< string, map<int, float> > index [ word_a => [ id_doc=>frequency, id_doc2=>frequency2, ... ], word_b => [ id_doc->frequency, id_doc2=>frequency2, ... ], ... ] with data structure, can idf weight word_a.size() . given query, program loops on keywords , scores documents. i don't know data structures , questions are: how store 500 mo inverted index in order load @ search time? currently, use boost serialize index: ofstream ofs_index("index.sr", ios::binary); boost::archive::bynary_oarchive oa(ofs_index); oa << index; and load @ search time: ifstream ifs_index("index.sr", ios::binary); boost::archive::bynary_iarchive ia(ifs_index); ia >> index;

ios - MKRouteStep extectedTravelTime -

i trying determine if there way tell how long each step in mkroute takes (travel time). know mkroute gives step can find distance of step, travel time of step not given. there simpler find time calling directions request again on step find time? edit: trying accomplish on whole point out coordinates @ time or distance given route. need efficient way figure out time problem.

python - Selenium clicks a link just once, calling click() another time returns error -

i'm new selenium , managed write these codes. want scrap data on tables clicking '>' link @ bottom right. first click works next 2 don't. missing? thanks. # coding: utf-8 selenium import webdriver selenium.webdriver.common.by import browser = webdriver.firefox() browser.get('http://s.cafef.vn/lich-su-giao-dich-hsg-1.chn') next_page_link = browser.find_element_by_partial_link_text('>') next_page_link.click() next_page_link = browser.find_element_by_partial_link_text('>') next_page_link.click() next_page_link = browser.find_element_by_partial_link_text('>') next_page_link.click() here exception traceback (most recent call last): file "cafef.py", line 13, in <module> next_page_link.click() file "/usr/local/lib/python2.7/dist-packages/selenium-2.40.0-py2.7.egg/selenium/webdriver/remote/webelement.py", line 59, in click self._execute(command.click_element) file "/usr/local/li

How to get list of folders in a .cmd script -

i want list of folders in directory. here's how i'm trying it: for /d %%a in (*) dir "c:\users\cowman\foldera" /a:d /o:n /b "%%a" >> get_dirs.txt this gives me list of folders in foldera. however, unfortunately lists folders multiple times. want them listed 1 time. how them listed 1 time ? dir "c:\users\cowman\foldera" /a:d /o:n /b > get_dirs.txt use > create file anew; >> append existing file. or, if want listing of directories within subdirectories of target, use dir "c:\users\cowman\foldera" /a:d /o:n /s /b > get_dirs.txt