Posts

shell - In Unix, how to create a file in a absolute path name -

my variable path1 contains value /home/folder . how can create new file named foo using absolute path name? path1="/home/folder" echo "hello web" > $path1/foo but code give me error. can 1 please tell me how can create file foo in specific location, using path name? in bash should write: path1="/home/folder"; echo "hello web" > $path1/foo or: export path1="/home/folder" echo "hello web" > $path1/foo notation used works in bash script.

vb.net - VB Listbox change value -

how can change value in vb listbox? like doesn't work: listbox.selecteditem = "newvalue" thx help listbox.list(listbox.listindex) = "newvalue"

Unable to start debugging on the Web Server. Visual Studio 2008 -

i running visual studio 2008 sp1 on windows server 2008 r2 enterprise 64-bit . getting following exception when try debug against iis. "unable start debugging on web server. object identifier not represent valid object". iis , visual studio on same box. i've tried enabling windows authentication no luck (my app requires forms authentication , fyi). any thoughts? have binding on web site. iis app web site not virtual directly. thanks! p.s have posting new questions since previous question found not answered , solution provided in question not working well. previous question: unable start debugging on web server. visual studio 2008 when hit problem opened basic settings in iis , checked app pool set web site. set "default" , not (as should have been in case) ".net 2". changing setting fix.

python - Coloring an edge detected image by user input co-ordinates..??What's wrong with this code? -

i need color white part surrounded black edges! from pil import image import sys image=image.open("g:/ghgh.bmp") data=image.load() image_width,image_height=image.size sys.setrecursionlimit(10115) def f(x,y): if(x<image_width , y<image_height , x>0 , y>0): if (data[x,y]==255): image.putpixel((x,y),150) f(x+1,y) f(x-1,y) f(x,y+1) f(x,y-1) f(x+1,y+1) f(x-1,y-1) f(x+1,y-1) f(x-1,y+1) f(100,100) image.show() 255 detect white color, 150 used re-color greyish, , (100,100) starting pixel. it's giving "max recursion depth" @ n=10114 , python crashes on n=10115 (the setrecursionlimit(n) ). what's while loop? never changes coordinates, seems loop forever, doing recursive calls. quick reading sounds should plain if . also: drop parens while , if ; they're not needed in python.

memory leaks - MemoryLeaking - question -

i have function getalldata, wich returning array dictonaries. - (nsarray *)getalldata { nsmutablearray *result = [[nsmutablearray alloc] init]; nsarray *data = [skiresorts sortedarrayusingfunction:comparator context:null]; nsstring *currentletter = @"a"; nsmutablearray *array = [[nsmutablearray alloc] init] ; nsmutabledictionary *dict = [[nsmutabledictionary alloc] init] ; if ([data count] > 0) { (skiresort *resort in data) { if ([resort.name hasprefix:currentletter]) { // same letter before. // add current skiresort temporary array. [array addobject:resort]; } else { // new letter. // add previous header/row data dictionary. [dict setvalue:currentletter forkey:@"header"]; [dict setvalue:array forkey:@"row"]; // add dictio...

php - Mustache partials and code reuse -

i'm getting hang of mustache project i've started during weekend. i'm using php implementation. have, couple of inquiries i'm not used system. how handle template inheritance, or reuse? know of partials, how should use them? i'm doing this, ala include: top.mustache: <!doctype html> <html lang='es'> <head> <meta charset=utf-8" /> <link rel="stylesheet" href="/media/style.css" type="text/css" media="screen" /> </head> <body> <header><h1><a href="/">top</a></h1> </header> <section> bottom.mustache: </section> <footer><a href="http://potajecreativo.com/">potaje</a></footer> </body> </html> and view render template: {{>top}} <form action="/album/" method="post"> <p><label for...

c++ - Is it safe to push_back 'dynamically allocated object' to vector? -

whenever need add dynamically allocated object vector i've been doing following way: class foo { ... }; vector<foo*> v; v.push_back(new foo); // stuff foo in v // delete foo in v it worked , many others seem same thing. today, learned vector::push_back can throw exception. means code above not exception safe. :-( came solution: class foo { ... }; vector<foo*> v; auto_ptr<foo> p(new foo); v.push_back(p.get()); p.release(); // stuff foo in v // delete foo in v but problem new way verbose, tedious, , see nobody's doing it. (at least not around me...) should go new way? or, can stick old way? or, there better way of doing it? if care exception-safety of operation: v.reserve(v.size()+1); // reserve can throw, doesn't matter v.push_back(new foo); // new can throw, doesn't matter either. the issue of vector having responsibility freeing objects pointed contents separate thing, i'm sure you'll plenty of advice ...