Search Results

Search found 4783 results on 192 pages for 'txt'.

Page 69/192 | < Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >

  • How to call/execute another ASP.net page from the parent ASP.Net page without disrupting the flow of

    - by NJTechGuy
    When a button/link is clicked, I want this URL to be called followed by the execution of the following statements. The ASP.Net page is in C# btw. Function A statement A call abc.apsx statement B abc.aspx is a silent page, doesn't display anything on the page but creates an output.txt file. So when abc.aspx is called, output.txt file is created and Statement B is executed seamlessly. Hope I made sense. I have no .Net programming knowledge. Please help me. Thank you..

    Read the article

  • Adding nil to NSMutableArray

    - by ayanonagon
    I am trying to create a NSMutableArray by reading in a .txt file and am having trouble setting the last element of the array to nil. NSString *filePath = [[NSBundle mainBundle] pathForResource:@"namelist" ofType:@"txt"]; NSString *data = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil]; NSArray *list = [data componentsSeparatedByString:@"\n"]; NSMutableArray *mutableList = [[NSMutableArray alloc] initWithArray:list]; I wanted to use NSMutableArray's function addObject, but that will not allow me to add nil. I also tried: [mutableList addObject:[NSNull null]]; but that does not seem to work either. Is there a way around this problem?

    Read the article

  • Unable upload large file size on Google Docs

    - by Preeti
    Hi, I am uploading document on Google Docs as: DocumentsService myService = new DocumentsService(""); myService.setUserCredentials("[email protected]", password ); DocumentEntry newEntry = myService.UploadDocument(@"C:\Sample.txt", "Sample.txt"); But when i try to upload a file of 3 MB it result into exception: An unhandled exception of type 'Google.GData.Client.GDataRequestException' occurred in Google.GData.Client.dll Additional information: Execution of request failed: http://docs.google.com/feeds/documents/private/full How can i upload large size file on Google Docs? I am using Google API ver 2. Thanx

    Read the article

  • Problem with unix pipe command

    - by Keyo
    I have a list of directory names in a text file. I want to use these as part of a file_name a git-svn clone command. This prints out the contents of the file line by line. cat repos_to_migrate.txt | tee $1 This however does not work: cat repos_to_migrate.txt | git svn clone file:///home/svn/$1 ... Unable to open repository 'file:///home/svn' ... Any ideas here? I'f it matters I'm running centos5.

    Read the article

  • How to extract a Sub-Matrix from a Matrix ?

    - by ZaZu
    Hello, I have a matrix in a txt file and I want to load the matrix based on my input of number of rows and columns For example, I have a 5 by 5 matrix in the file. I want to extract a 3 by 3 matrix, how can I do that ? I created a nested loop using : FILE *sample sample=fopen("randomfile.txt","r"); for(i=0;i<rows;i++){ for(j=0;j<cols;j++){ fscanf(sample,"%f",&matrix[i][j]); } fscanf(sample,"\n",&matrix[i][j]); } fclose(sample); Sadly the code does not work .. If I have this matrix : 5.00 4.00 5.00 6.00 5.00 4.00 3.00 25.00 5.00 3.00 4.00 23.00 5.00 2.00 352.00 6.00 And inputting 3 for rows and 3 for columns, I get : 5.00 4.00 5.00 6.00 5.00 4.00 3.00 25.00 5.00 Which is obviously wrong , its reading line by line rather than skipping the unmentioned column ... What am I doing wrong ? Thanks !

    Read the article

  • Running OpenMPI on Windows XP

    - by iamweird
    Hi there. I'm trying to build a simple cluster based on Windows XP. I compiled OpenMPI-1.4.2 successfully, and tools like mpicc and ompi_info work too, but I can't get my mpirun working properly. The only output I can see is Z:\orterun --hostfile z:\hosts.txt -np 2 hostname [host0:04728] Failed to initialize COM library. Error code = -2147417850 [host0:04728] [[8946,0],0] ORTE_ERROR_LOG: Error in file ..\..\openmpi-1.4.2 \orte\mca\ess\hnp\ess_hnp_module.c at line 218 -------------------------------------------------------------------------- It looks like orte_init failed for some reason; your parallel process is likely to abort. There are many reasons that a parallel process can fail during orte_init; some of which are due to configuration or environment problems. This failure appears to be an internal failure; here's some additional information (which may only be relevant to an Open MPI developer): orte_plm_init failed -- Returned value Error (-1) instead of ORTE_SUCCESS -------------------------------------------------------------------------- [host0:04728] [[8946,0],0] ORTE_ERROR_LOG: Error in file ..\..\openmpi-1.4.2 \orte\runtime\orte_init.c at line 132 -------------------------------------------------------------------------- It looks like orte_init failed for some reason; your parallel process is likely to abort. There are many reasons that a parallel process can fail during orte_init; some of which are due to configuration or environment problems. This failure appears to be an internal failure; here's some additional information (which may only be relevant to an Open MPI developer): orte_ess_set_name failed -- Returned value Error (-1) instead of ORTE_SUCCESS -------------------------------------------------------------------------- [host0:04728] [[8946,0],0] ORTE_ERROR_LOG: Error in file ..\..\..\..\openmpi -1.4.2\orte\tools\orterun\orterun.c at line 543 Where z:\hosts.txt appears as follows: host0 host1 Z: is a shared network drive available to both host0 and host1. What my problem is and how do I fix it? Upd: Ok, this problem seems to be fixed. It seems to me that WideCap driver and/or software components causes this error to appear. A "clean" machine runs local task successfully. Anyway, I still cannot run a task within at least 2 machines, I'm getting following message: Z:\mpirun --hostfile z:\hosts.txt -np 2 hostname connecting to host1 username:cluster password:******** Save Credential?(Y/N) y [host0:04728] This feature hasn't been implemented yet. [host0:04728] Could not connect to namespace cimv2 on node host1. Error code =-2147024891 -------------------------------------------------------------------------- mpirun was unable to start the specified application as it encountered an error. More information may be available above. -------------------------------------------------------------------------- I googled a little and did all the things as described here: http://www.open-mpi.org/community/lists/users/2010/03/12355.php but I'm still getting the same error. Can anyone help me? Upd2: Error code -2147024891 might be WMI error WBEM_E_INVALID_PARAMETER (0x80041008) which occures when one of the parameters passed to the WMI call is not correct. Does this mean that the problem is in OpenMPI source code itself? Or maybe it's because of wrong/outdated wincred.h and credui.lib I used while building OpenMPI from the source code?

    Read the article

  • retrive file line one by one using C#?

    - by riad
    Dear all, I have a file name abc.txt.On that file have some lines like this: jani 50,south carolina,USA karim 16,roam,Italy fara 52,sydny,Australia first line is name and second line is address.Now i need the info name on a string let say nameString and address is let say addressString.How can i do it using C#? I write a code in PHP its working smoothly.I need the same thing in C#.For yours clarification here is the php code: $file=file_get_contents('abc.txt'); $arr=explode("\n",$file); for ($i=0;$i<count($arr);$i=$i+2) { $name=$arr[$i]; $address=$arr[$i+1]; echo $name ."<br/>"; echo $address. "<br/>"; } How can i do the same thing in C#???? Another question: IS their any function in C# as like as explode in php? thanks in advance riad

    Read the article

  • Why Doesn't This Java Code Skip Lines with #?

    - by Nathan
    I'm trying to allow an external .txt file that is read by a Java script be able to have some comments in the beginning of the file so others can easily edit it and add more to it. But if the file contains # (the sign designated for a line that is a comment) it just returns the error that there is a "Format Error in file" (the IOException - so it is getting past that first "IF"...) Can someone help? Here's the portion of the code that deals with commenting lines out of the .txt file being called earlier in the script: while ((line = br.readLine()) != null) { line = line.trim(); if (line.length() < 1 || line.charAt(0) == '#') { // ignore comments continue; } final String[] parts = line.split("="); if (parts.length != 2) { throw new IOException("Format error in file " + JLanguageTool.getDataBroker().getFromRulesDirAsUrl(getFileName()) + ", line: " + line); }

    Read the article

  • IE8 + Jquery ajax call giving parsererror from dJango : for json data which seems valid in Firefox

    - by PlanetUnknown
    The ajax call works fine in FF. the data returned is in JSON here is an example from FF firebug - {"noProfiles": "No profiles have been created, lets start now !"} When I try to print the error in IE8 (& in compatibility modes as well), it says "parsererror". But the output seems to be valid JSON. Here is the ajax function call I'm making. Any pointers would be great ! $.ajax({ type: "GET", url: "/get_all_profile_details/", data: "", dataType: "json", beforeSend: function() {alert("before send called");}, success: function(jsonData) { alert("data received"); }, error: function(xhr, txt, err){ alert("xhr: " + xhr + "\n textStatus: " + txt + "\n errorThrown: " + err); } }); The alerts in the error function above give - xhr:<blank> textstatus:parsererror errorThrown: undefined Any pointers would be great ! Note : jquery : 1.3.2

    Read the article

  • limit number of characters entered in textarea

    - by Abu Hamzah
    here is the script does what i want but not exactly, my question is, how can i stop user entering text once it reached the lmit of 255 characters? var limit = 255; var txt = $('textarea[id$=txtPurpose]'); $(txt).keyup(function() { var len = $(this).val().length; if (len > limit) { //this.value = this.value.substring(0, 50); $(this).addClass('goRed'); $('#spn').text(len - limit + " characters exceeded"); return false; } else { $(this).removeClass('goRed'); $('#spn').text(limit - len + " characters left"); } }); if there is a better way please let me know.

    Read the article

  • C++ How do I properly use getline for ifstream members.

    - by John
    Ok so I have a problem with getline. I have a file that contains a couple strings. I created it by myself and I have each string on a seperate line. Ex. textfile.txt Line 1 Line 2 Line 3 Line 4 //Little snip of code ifstream inFile("textfile.txt"); getline(inFile, string1); When I debug the program and ask it to print out string1 it shows that "Line 1\r" is saved into string1. I understand that it's from me actually hitting enter when I created the file. This problem causes my program to have a segmentation fault. I know my code works because if I use ofstream to write the file first and then i read it in, it works. So for my quesiton, is their anyway to use the getline function without it picking up the escape sequence \r? If i am not clear just let me know.

    Read the article

  • Pass data from workspace to a function

    - by Tim
    I created a GUI and used uiimport to import a dataset into matlab workspace, I would like to pass this imported data to another function in matlab...How do I pass this imported dataset into another function....I tried doing diz...but it couldnt pick diz....it doesnt pick the data on the matlab workspace....any ideas?? [file_input, pathname] = uigetfile( ... {'*.txt', 'Text (*.txt)'; ... '*.xls', 'Excel (*.xls)'; ... '*.*', 'All Files (*.*)'}, ... 'Select files'); uiimport(file_input); M = dlmread(file_input); X = freed(M);

    Read the article

  • How to log the output from cmd tree command using Apache Ant exec task?

    - by S.N
    Hi, I am trying to log the output from cmd tree command using ant with the following: <exec dir="${basedir}" executable="cmd" output="output.txt"> <arg value="tree" /> </exec> However, I am seeing the following in the "output.txt": Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. When I run the command in the windows cmd: C:\tree>tree I get something like: C:\tree +---test +---test Can anyone tell me how to write a Ant script to print the tree structure in to a file?

    Read the article

  • how to merge file lines having the same first word in python?

    - by user1377135
    I have written a program to merge lines in a file containing the same first word in python. However I am unable to get the desired output. Can anyone please suggest me the mistake in my program? input "file.txt" line1: a b c line2: a b1 c1 line3: d e f line4: i j k line5: i s t line6: i m n ` output a b c a b1 c1 d e f i j k i s t i m n my code a = [line.split() for line in open('file.txt')] L=[] for i in range(0,len(a)): j=i while True: if a[j][0] == a[j+1][0]: L.append(a[j]) L.append(a[j+1]) j=j+2 else: print a[i] print L break

    Read the article

  • Accessing Password Protected Network Drives in Windows in C#?

    - by tkeE2036
    Hi Everyone, So in C# I am trying to access a file on a network, for example at "//applications/myapp/test.txt", as follows: const string fileLocation = @"//applications/myapp/test.txt"; using (StreamReader fin = new StreamReader(FileLocation)) { while(!fin.EndOfStream()){ //Do some cool stuff with file } } However I get the following error: System.IO.IOException : Logon failure: unknown user name or bad password. I figure its because I need to supply some network credentials but I'm not sure how to get those to work in this situation. Does anyone know the best way (or any way) to gain access to these files that are on a a password protected location? Thanks in advance!!

    Read the article

  • Java Array Index Out of Bounds Exception

    - by user1302023
    I need help debugging the following program: I'm getting a run time error that reads: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1 at SearchEngine.main(SearchEngine.java:126) import java.util.*; import java.io.*; public class SearchEngine { public static int getNumberOfWords (File f) throws FileNotFoundException { int numWords = 0; Scanner scan = new Scanner(f); while (scan.hasNext()) { numWords++; scan.next(); } scan.close(); return numWords; } public static void readInWords (File input, String [] x) throws FileNotFoundException { Scanner scan = new Scanner(input); int i = 0; while (scan.hasNext() && i<x.length) { x[i] = scan.next(); i++; } scan.close(); } public static int getNumOfDistinctWords (File input, String [] x) throws FileNotFoundException { Scanner scan = new Scanner(input); int count = 0; int i = 1; while (scan.hasNext() && i<x.length) { if (!x[i].equals(x[i-1])) { count++; } i++; } scan.close(); return count; } public static void readInDistinctWords (String [] x, String [] y) { int i = 1; int k = 0; while (i<x.length) { if (!x[i].equals(x[i-1])) { y[k] = x[i]; k++; } i++; } } public static int getNumberOfLines (File input) throws FileNotFoundException { int numLines = 0; Scanner scan = new Scanner(input); while (scan.hasNextLine()) { numLines++; scan.nextLine(); } scan.close(); return numLines; } public static void readInLines (File input, String [] x) throws FileNotFoundException { Scanner scan = new Scanner(input); int i = 0; while (scan.hasNextLine() && i<x.length) { x[i] = scan.nextLine(); i++; } scan.close(); } public static void main(String [] args) { try { //gets file name System.out.println("Enter the name of the text file you wish to search"); Scanner kb = new Scanner(System.in); String fileName = kb.nextLine(); String TXT = ".txt"; if (!fileName.endsWith(TXT)) { fileName = fileName.concat(TXT); } File input = new File(fileName); //First part of creating index System.out.println("Creating vocabArray"); int NUM_WORDS = getNumberOfWords(input); //System.out.println(NUM_WORDS); String [] wordArray = new String[NUM_WORDS]; readInWords(input, wordArray); Arrays.sort(wordArray); int NUM_DISTINCT_WORDS = getNumOfDistinctWords(input, wordArray); String [] vocabArray = new String[NUM_DISTINCT_WORDS]; readInDistinctWords(wordArray, vocabArray); System.out.println("Finished creating vocabArray"); System.out.println("Creating concordanceArray"); int NUM_LINES = getNumberOfLines(input); String [] concordanceArray = new String[NUM_LINES]; readInLines(input, concordanceArray); System.out.println("Finished creating concordanceArray"); System.out.println("Creating invertedIndex"); int [][] invertedIndex = new int[NUM_DISTINCT_WORDS][10]; int [] wordCountArray = new int[NUM_DISTINCT_WORDS]; int lineNum = 0; while (lineNum<concordanceArray.length) { Scanner scan = new Scanner(concordanceArray[lineNum]); while (scan.hasNext()) { int wordPos = Arrays.binarySearch(vocabArray, scan.next()); wordCountArray[wordPos]+=1; for(int i = 0; i < invertedIndex.length; i++) { for(int j = 0; j < invertedIndex[i].length; j++) { if (invertedIndex[i][j] == 0) { invertedIndex[i][j] = lineNum; break; } } } } lineNum++; } System.out.println("Finished creating invertedIndex"); } catch (FileNotFoundException exception) { System.out.println("File Not Found"); } } //main } //class

    Read the article

  • How to convert list into a string?

    - by PARIJAT
    I have extracted some data from the file and want to write it in the file 2 but the program says 'sequence item 1: expected string, list found', I want to know how I can convert buffer[] i.e. string into sequence, so that it could be saved in file 2. file = open('/ddfs/user/data/k/ktrip_01/hmm.txt','r') file2 = open('/ddfs/user/data/k/ktrip_01/hmm_write.txt','w') buffer = [] rec = file.readlines() for line in rec : field = line.split() print '>',field[0] term = field[0] buffer.append(term) print field[1], field[2], field[6], field[12] term1 = field [1] buffer.append(term1) term2 = field[2] buffer.append[term2] term3 = field[6] buffer.append[term3] term4 = field[12] buffer.append[term4] file2.write(buffer) file.close() file2.close()

    Read the article

  • URL Rewrite problem. (Many directory)

    - by marharépa
    Hello! I'd like to make a htaccess file, which can make a good structure for my websites. My .htaccess is now: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !\.(jpg|jpeg|gif|png|css|js|pl|txt)$ RewriteCond %{REQUEST_URI} !^/admin/* RewriteRule ^(.*)$ index.php?q=$1 [QSA] (based on Sombat's comment) And I want to make this, with it: for every elements but (jpg|jpeg|gif|png|css|js|pl|txt) if domain.xx/admin redirect to the domain.xx/admin directory and don't make a rewrite at all i mean: let me use domain.xx/admin/index.php?asd=1&asdd=2 else rewrite everything as rule one, to index.php. Thanks for the help.

    Read the article

  • Java: calculate linenumber from charwise position according to the number of "\n"

    - by HH
    I know charwise positions of matches like 1 3 7 8. I need to know their corresponding line number. Example: file.txt Match: X Mathes: 1 3 7 8. Want: 1 2 4 4 $ cat file.txt X2 X 4 56XX [Added: does not notice many linewise matches, there is probably easier way to do it with stacks] $ java testt 1 2 4 $ cat testt.java import java.io.*; import java.util.*; public class testt { public static String data ="X2\nX\n4\n56XX"; public static String[] ar = data.split("\n"); public static void main(String[] args){ HashSet<Integer> hs = new HashSet<Integer>(); Integer numb = 1; for(String s : ar){ if(s.contains("X")){ hs.add(numb); numb++; }else{ numb++; } } for (Integer i : hs){ System.out.println(i); } } }

    Read the article

  • Batch file writing to log then ending process

    - by Andrew Service
    I have a batch file that calls a process and in that process I have: IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL% Now I wanted to upgrade this a bit and give some meaningful message to an output log when if the process fails, also I do not want the main batch to continue processing because the next processes are dependent on data from previous calls; I wonder if this would be correct but not sure: CALL Process 1 IF %ERRORLEVEL% NEQ 0 GOTO ErrorInfirstProcess /B %ERRORLEVEL% :ErrorInfirstProcess ECHO Process 1 Failed on %Date% at %Time%. >>C:\Log.txt" CALL Process 2 IF %ERRORLEVEL% NEQ 0 GOTO ErrorInSecondProcess /B %ERRORLEVEL% :ErrorInSecondProcess ECHO Process 2 Failed on %Date% at %Time%. >>C:\Log.txt" I also want to know if I still need the /B or do I need to put an EXIT command after the echo? Thanks A

    Read the article

  • dropping user to IRB after reading from pipe

    - by aurelian
    I have this script that drops the user to an IRB session when executed. All good, but when I use *nix pipes to get the input (e.g. with cat), the IRB session ends immediately. I could reduce the script (let's call it myscript.rb) to the following: require 'irb' if $stdin.stat.size 0 @text = $stdin.read else @text= "nothing" end ARGV.clear IRB.start When executed like: ruby myscript.rb, I end up in the IRB session (as expected). But (assuming foo.txt exists in the cwd): cat foo.txt | ruby myscript.rb will just print the IRB prompt and then the IRB session is closed (I'm being dropped to $bash). Any known workarounds or ideas? BTW: it has the same behavior on ruby 1.8.7 as well as on 1.9.2.

    Read the article

  • Update a file inside zip with -u

    - by user577732
    Alright so i have a zip file called data.zip on my desktop. Inside test.zip is another folder called res and inside res is a file called info.txt I have used the zip -u command before to move a file inside the zip but only to the root of the zip i want to move a new version of info.txt from my desktop to the res folder of data.zip i need it for part of a script i'm working on. How can i do this or will the -u function only work for the root? Thank you for any help on how i can accomplish this

    Read the article

< Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >