Daily Archives

Articles indexed Friday April 30 2010

Page 17/114 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • What is the Best way to copy Folder using c#

    - by karthik
    I need to copy a Folder from one drive to a removable Hard disk. The Folder which needs to be copied will have many sub folders and files in it. The input will be Source Path and Target Path. Like.. Source Path : "C:\SourceFolder" Target Path : "E:\" After copying is done, i shud be able to see the folder "SourceFolder" in my E: drive. Thanks.

    Read the article

  • Problem with OOP Class Definitions

    - by oben
    Hi, this is Oben from Turkey. I work for my homework in C++ and i have some problems with multiply definitions. My graph class ; class Graph{ private: string name; //Graph name fstream* graphFile; //Graph's file protected: string opBuf; //Operations buffer int containsNode(string); //Query if a node is present Node* nodes; //Nodes in the graph int nofNodes; //Number of nodes in the graph public: static int nOfGraphs; //Number of graphs produced Graph(); //Constructors and destructor Graph(int); Graph(string); Graph(const Graph &); ~Graph(); string getGraphName(); //Get graph name bool addNode(string); //add a node to the graph bool deleteNode(string); //delete a node from the graph bool addEdge(string,string); //add an edge to the graph bool deleteEdge(string,string); //delete an edge from the graph void intersect(const Graph&); //intersect the graph with the <par> void unite(const Graph&); //intersect the graph with the <par> string toString(); //get string representation of the graph void acceptTraverse(BreadthFirst*); void acceptTraverse(DepthFirst *); }; and my traversal class; class Traversal { public: string *visitedNodes; virtual string traverse (const Graph & ); }; class BreadthFirst : public Traversal { public : BreadthFirst(); string traverse(); }; class DepthFirst : public Traversal { public : DepthFirst(); string traverse(); }; My problem is in traversal class , i need to declare Graph class at the same time , in graph class i need traversal class to declare. I have big problems with declerations :) Could you please help me ?

    Read the article

  • .NET OpenSource or cheap CRM

    - by Dkong
    Hi, I'm looking for a decent Open Source or cheap .NET CRM. Does anybody know of any good ones (aside from whatever there is on the front page of Google which I've checked and wasn't that impressed with)

    Read the article

  • How to get all n sets of three consecutives elements in an array or arraylist with a for statement ?

    - by newba
    Hi, I'm trying to do a convex hull approach and the little problem is that I need to get all sets of three consecutive vertices, like this: private void isConvexHull(Ponto[] points) { Arrays.sort(points); for (int i = 0; i <points.length; i++) { isClockWise(points[i],points[i+1],points[i+2]); } //... } I always do something that I don't consider clean code. Could please help me find one or more ways to this? I want it to be circular, i.e., if my fisrt point of the a set is the last element in the array, the 2nd element will be the 3rd in the list and the 3rd in that set will be the the 2nd element in the list, and so on. They must be consecutive, that's all.

    Read the article

  • python thread prob after build

    - by Apache
    hi expert, i'm having task to scan wifi at specific interval and send it to the server, i've it in python and its works fine when i run manually, then build it to package and when run there is no progress at all, i already ask this question before at http://stackoverflow.com/questions/2735410/python-scritp-problem-once-build-and-package-it, then, i re-modify my code as below, then i found that thread is not functioning once i build, #!/usr/bin/env python import subprocess,threading,... configFile = open('/opt/Jemapoh_Wifi/config.txt', 'r') url = configFile.readline().strip() intervalTime = configFile.readline().strip() status = configFile.readline().strip() print "url "+url print "intervalTime "+intervalTime print "Status "+status.strip() def getMacAddress(): proc = subprocess.Popen('ifconfig -a wlan0 | grep HWaddr | sed \'/^.*HWaddr */!d; s///;q\'', shell=True, stdout=subprocess.PIPE, ) macAddress = proc.communicate()[0].strip() return macAddress def getTimestamp(): from time import strftime timeStamp = strftime("%Y-%m-%d %H:%M:%S") return timeStamp def scanWifi(): try: print "Scanning..." proc = subprocess.Popen('iwlist scan 2>/dev/null', shell=True, stdout=subprocess.PIPE, ) stdout_str = proc.communicate()[0] stdout_list=stdout_str.split('\n') essid=[] rssi=[] preQuality=[] for line in stdout_list: line=line.strip() match=re.search('ESSID:"(\S+)"',line) if match: essid.append(match.group(1)) match=re.search('Quality=(\S+)',line) if match: preQuality.append(match.group(1)) for qualityConversion in preQuality: qualityConversion = qualityConversion.split()[0].split('/') temp = str(int(round(float(qualityConversion[0]) / float(qualityConversion[1]) * 100))).rjust(2) rssi.append(temp) dataToPost = '{"userId":"' + getMacAddress() + '","timestamp":"' + getTimestamp() + '","wifi":[' for no in range(len(essid)): dataToPost += '{"ssid":"' + essid[no] + '","rssi":"' + rssi[no] + '"}' if no+1 == len(essid): pass else: dataToPost += ',' dataToPost += ']}' query_args = {"data":dataToPost} request = urllib2.Request(url) request.add_data(urllib.urlencode(query_args)) request.add_header('Content-Type', 'application/x-www-form-urlencoded') print "Waiting for server response..." print urllib2.urlopen(request).read() print "Data Sent @ " + getTimestamp() print "------------------------------------------------------" t = threading.Timer(int(intervalTime), scanWifi).start() except Exception, e: print e t = threading.Timer(int(intervalTime), scanWifi) t.start() once build, its not reaching the thread, do can anyone help, why the thread is not working after build thanks

    Read the article

  • How to call one android application from another android application

    - by Akshata
    I want to call one android application from another application I have tried example on site http://www.anddev.org/install-run_applications_from_within_another_application-t6909.html but it is not working for me It is giving Package parse error.. Please replay as soon as possible. Consider there are two applications: Application1 and Application2 I want to call Application2 from Application1 I got some sample code to do this: Intent i = new Intent(); i.setAction(android.content.Intent.ACTION_VIEW); i.setDataAndType(Uri.fromFile(fileName),"application/vnd.android.package-archive"); startActivity(i); here fileName = "file://data/data/package_name/files/Application1.apk"; But I am getting Package Error and skipping file://data/data/package_name/files/Application1.apk

    Read the article

  • .NET 4 Shared Hosting

    - by Unknown
    Are there any companies that offer shared .NET 4 hosting? I know its still in beta, but from about hours worth of searching, I only found that ASPHostCentral.com offers it. MaximumASP.com and DiscountASP.net currently only offer sandboxing plans. I don't want to get a dedicated server or VPS since my website has low traffic.

    Read the article

  • Moseycode Install Failure

    - by scout
    I am trying to install the moseycode-0.2.1.apk on the emulator. I get the following error with both moseycode-0.2.0 and moseycode-0.2.1. 733 KB/s (410936 bytes in 0.546s) pkg: /data/local/tmp/moseycode-0.2.1.apk Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED] I tried on emulators(avd) with Google api 7, android 2.1, Google Api 6. I have the latest version of Android-sdk Please let me know whats wrong.

    Read the article

  • NServicebus DNS Entry for Machine location

    - by Paul Oakham
    Hi Guys, I am trying to use a DNS entry for my NServicebus queue endpoint but no messages are being sent. It works fine when I enter the computer name or an IPAddress. I can ping the record and it resolves correctly so i'm wondering if it is possible to use a DNS record? Here is my config: <MessageEndpointMappings> <!--These are the messages which need to be sent to the BusService --> <add Messages="BusCommon.BusHeartBeatMessage, BusCommon" Endpoint="[email protected]" /> </MessageEndpointMappings> Thanks

    Read the article

  • csv file enclosed with double quotes not stripping quotes

    - by sjw
    I am generating a csv download from my web server and to be safe, I have enclosed each field with double quotes. i.e. "Field1","Field2","Field3","Field4" "row1_field1","row1_field2","row1_field3","row1_field4" "row2_field1","row2_field2","row2_field3","row2_field4" The problem is that when the file is opened in Excel, it does not strip all quotes... Therefore, some fields are appearing as: row1_field1 whereas others are appearing as "row1_field2" What am I not doing to ensure that excel strips all surrounding quotes?

    Read the article

  • Multiple IntenseDebate Comment Counts

    - by Aristotle
    I just setup IntenseDebate on my blog this evening and am, for the most part, pleased with it. One thing I did see is that they offered me a small snippet to show the current number of comments: <script> var idcomments_acct = 'abcdefgef12345678mykey8675309acdc'; var idcomments_post_id; var idcomments_post_url; </script> <script type="text/javascript" src="http://www.intensedebate.com/js/genericLinkWrapperV2.js"></script> This is nice, but what I would like to do is have something similar on my archives page where many posts are listed - not just one. Presently the page looks like this: Some Post TitleAuthor NameShort abstract from this post... Some Post TitleAuthor NameShort abstract from this post... I would like it to look like this: Some Post TitleAuthor NameShort abstract from this post...7 Comments Some Post TitleAuthor NameShort abstract from this post...3 Comments But I'm not exactly sure how I can do this with IntenseDebate. Do they offer any sort of method to gather the total number of comments for multiple pages from a single page?

    Read the article

  • Saving associated domain classes in Grails

    - by Cesar
    I'm struggling to get association right on Grails. Let's say I have two domain classes: class Engine { String name int numberOfCylinders = 4 static constraints = { name(blank:false, nullable:false) numberOfCylinders(range:4..8) } } class Car { int year String brand Engine engine = new Engine(name:"Default Engine") static constraints = { engine(nullable:false) brand(blank:false, nullable:false) year(nullable:false) } } The idea is that users can create cars without creating an engine first, and those cars get a default engine. In the CarController I have: def save = { def car = new Car(params) if(!car.hasErrors() && car.save()){ flash.message = "Car saved" redirect(action:index) }else{ render(view:'create', model:[car:car]) } } When trying to save, I get a null value exception on the Car.engine field, so obviously the default engine is not created and saved. I tried to manually create the engine: def save = { def car = new Car(params) car.engine = new Engine(name: "Default Engine") if(!car.hasErrors() && car.save()){ flash.message = "Car saved" redirect(action:index) }else{ render(view:'create', model:[car:car]) } } Didn't work either. Is Grails not able to save associated classes? How could I implement such feature?

    Read the article

  • Stretching width correctly to 100% of an inline-block element in IE6 and IE7

    - by Simon Lieschke
    I have the following markup, where I am attempting to get the right hand side of the second table to align with the right hand side of the heading above it. This works in IE8, Firefox and Chrome, but in IE6/7 the table is incorrectly stretched to fill the width of the page. I'm using the Trip Switch hasLayout trigger to apply inline-block in IE6/7. Does anyone know how (or even if) I can get the table only to fill the natural width of the wrapper element displayed with inline-block in IE6/7? You can see the code running live at http://jsbin.com/uyuva. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Test</title> <style> .wrapper { display: inline-block; border: 1px solid green; } /* display: inline-block triggers the wrapper element to have layout for IE 6/7. The trip switch then provides the inline component of the display behaviour. See http://www.brunildo.org/test/InlineBlockLayout.html for more details. */ .wrapper { *display: inline; } table { border: 1px solid red; } </style> </head> <body> <h1>No width on table:</h1> <div class="wrapper"> <h2>The right hand side of the table doesn't stretch to the end of this heading</h2> <table><tr><td>foo</td></tr></table> </div> text <h1>Width on table:</h1> <div class="wrapper"> <h2>The right hand side of the table should stretch to the end of this heading</h2> <table style="width: 100%"><tr><td>foo</td></tr></table> </div> text </body> </html>

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >