Search Results

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

Page 11/192 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • asp:TextBox write date in txt field

    - by senzacionale
    <asp:TextBox AutoPostBack="true" ID="txtDate" OnTextChanged="txtDate_TextChanged" runat="server" Value="<%= DateTime.Today.ToShortDateString() %>"></asp:TextBox> Value="<%= DateTime.Today.ToShortDateString() %" does not write date in txt field but whole string. What i am doing wrong?

    Read the article

  • Ubuntu only boots with USB plugged in

    - by Ben
    I'm new to the Linux world so please bear with me! :-) I installed Ubuntu via USB drive onto my hard drive. If I boot the PC without the usb drive I used, Ubuntu will not load. After booting I can unplug without any consequences. I looked on the hard drive and there is a boot folder. On the USB drive, this is the tree contents: /media/disk$ tree . |-- adtext.cfg |-- boot.cat |-- f10.txt |-- f1.txt |-- f2.txt |-- f3.txt |-- f4.txt |-- f5.txt |-- f6.txt |-- f7.txt |-- f8.txt |-- f9.txt |-- initrd.gz |-- isolinux.bin |-- isolinux.cfg |-- ldlinux.sys |-- linux |-- menu.c32 |-- menu.cfg |-- po4a.cfg |-- prompt.cfg |-- splash.png |-- stdmenu.cfg |-- syslinux.cfg |-- text.cfg |-- ubnfilel.txt |-- ubnpathl.txt `-- vesamenu.c32 Am I correct in my assumption that the boot aspect is associated to the USB drive? If so, how do I get it to boot without the USB? I'm guessing copying into some location and modifying grub?

    Read the article

  • Vim: Show the index of tabs in the tabline

    - by bitmask
    Lets say I opened file1.txt, file2.txt, file3a.txt and file3b.txt such that the tabline (the thing on the top) looks like this: file1.txt file2.txt 2 file3a.txt (Note how file3b.txt. is missing because it is shown in a split, in the same tab as file3a.txt) To move more quickly between tabs (with <Number>gt), I would like each tab to display its index, along the filename. Like so: 1:<file1.txt> 2:<file2.txt> 3:<2 file3a.txt> The formatting (the angle braces in particular) are optional; I just want the index to appear there (the 1:, 2: and so on). No clues on :h tab-page-commands or google whatsoever.

    Read the article

  • How much HDD space would I need to cache the web while respecting robot.txts?

    - by Koning Baard XIV
    I want to experiment with creating a web crawler. I'll start with indexing a few medium sized website like Stack Overflow or Smashing Magazine. If it works, I'd like to start crawling the entire web. I'll respect robot.txts. I save all html, pdf, word, excel, powerpoint, keynote, etc... documents (not exes, dmgs etc, just documents) in a MySQL DB. Next to that, I'll have a second table containing all restults and descriptions, and a table with words and on what page to find those words (aka an index). How much HDD space do you think I need to save all the pages? Is it as low as 1 TB or is it about 10 TB, 20? Maybe 30? 1000? Thanks

    Read the article

  • how to rewrite or redirect old or missing or invalid url to 404 page

    - by kath
    I recently upgraded a site and almost all URLs have changed. I have redirected all of them (or so I hope) but it may be possible that some of them have slipped by me. Is there a way to somehow catch all invalid URLs and send the user to a certain page I am using PHP Thanks so much! error file is already in .htaccess but seems nothing going to change you can see the error file as below AddHandler application/x-httpd-php5s .php ErrorDocument 404 /content/404.php <IfModule mod_rewrite.c> RewriteEngine on RewriteBase / here are 2 different url one the first one is old one which i edited and the secound one is edited one #1 old one (which is no longer on the server) http://adsbuz.com/vehicles-cars/toyoya/2009-toyota-land-cruiser-gxr-4686.htm #2 the editet one which is on the server http://adsbuz.com/vehicles-cars-for-sale/toyoya/2009-toyota-land-cruiser-gxr-4686.htm i need only the secound one with the vehicles-cars-for-sale because the other directory is already modified and its not on the server but as you can see after the (adsbuz) site name vehicles-cars and vehicles-cars-for-sale both are opening for same location I hope I made myself clear

    Read the article

  • Compare-Object gives false differences

    - by Andy
    I have some problem with Compare-Object. My task is to get difference between two directory snapshots made at different times. First snapshot is taken like this: ls -recurse d:\dir | export-clixml dir-20100129.xml Then, later, I get second snapshot and load both of them: $b = (import-clixml dir-20100130.xml) $a = (import-clixml dir-20100129.xml) Next, I'm trying to compare with Compare-Object, like that: diff $a $b What I get is in some places files that were added to $b since $a, but in some -- files that were in both snapshots, and some files, that were added to $b, are not given in Compare-Object output. Puzzling, but $b.count - $a.count is EXACTLY the same as (diff $a $b).count. Why is that? Ok, Compare-Object has -property param. I try to use that: diff -property fullname $a $b And I get the whole mess of differences: it shows me ALL the files. For example, say $a contains: A\1.txt A\2.txt A\3.txt And $b contains: X\2.mp3 X\3.mp3 X\4.mp3 A\1.txt A\2.txt A\3.txt diff output is something like that: X\2.mp3 => A\1.txt <= X\3.mp3 => A\2.txt <= X\4.mp3 => A\3.txt <= A\1.txt => A\2.txt => A\3.txt => Weird. I think I don't understand something crucial about Compare- Object usage, and manuals are scarce... Please, help me to get the DIFFERENCE between two directory snapshots. Thanks in advance UPDATE: I've saved data as plain strings like that: > import-clixml dir-20100129.xml | % { $_.fullname } | out-file -enc utf8 a.txt And results are the same. Here're excerpts of both snapshots (top 100-something lines, a.txt and b.txt), output of compare-object, and output of UNIX diff (unified). All files are UTF-8: http://dl.dropbox.com/u/2873752/compare-object-problem.zip

    Read the article

  • Mysterious visitor to hidden PHP page

    - by B. VB.
    On my website, I have a "hidden" page that displays a list of the most recent visitors. There exist no links at all to this single PHP page, and, theoretically, only I know of its existence. I check it many times per day to see what new hits I have. However, about once a week, I get a hit from a 208.80.194.* address on this supposedly hidden page (it records hits to itself). The strange thing is this: this mysterious person/bot does not visit any other page on my site. Not the public PHP pages, but only this hidden page that prints the visitors. It's always a single hit, and the HTTP_REFERER is blank. The other data is always some variation of Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; YPC 3.2.0; FunWebProducts; .NET CLR 1.1.4322; SpamBlockerUtility 4.8.4; yplus 5.1.04b) ... but sometimes MSIE 6.0 instead of 7, and various other plug ins. The browser is different every time, as with the lowest-order bits of the address. And it's just that. One hit per week or so, to that one page. Absolutely no other pages are touched by this mysterious vistor. Doing a whois on that IP address showed it's from the new york area, and from the "Websense" ISP. The lowest order 8 bits of their address are always different, but always from 208.80.194.*/8. From most of the computers that I access my website, doing a tracerout to my server does not contain a router anywhere along the way with the IP 208.80.*. So that rules out any kind of HTTP sniffing, I might think. I have NO idea how, why this is happening. Does anyone have any clue, or have seen something as strange as this before? It seems completely benign, but unexplainable and a little creepy. Thanks in advance!

    Read the article

  • save as .txt format

    - by user1180492
    I made a NotePad program. The problem is it doesn't save in .txt format, It save as a file with no format. But it can open .txt files. How can i fix it? Here is my work. import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.Scanner; import java.io.*; public class NotePad extends JFrame { private JTextArea noteArea; public static void main(String[] args) { NotePad p = new NotePad(); p.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); p.setSize(500,300); p.setVisible(true); } public NotePad() { super("Java Notepad"); setLayout(new BorderLayout()); noteArea = new JTextArea("",20,20); noteArea.setWrapStyleWord(true); noteArea.setLineWrap(true); Font font = new Font("sanserif", Font.BOLD,14); noteArea.setFont(font); JScrollPane scroller = new JScrollPane(noteArea); scroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); scroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); add(scroller,BorderLayout.CENTER); JMenuBar menuBar = new JMenuBar(); JMenu fileMenu = new JMenu("File"); JMenuItem openMenu = new JMenuItem("Open"); openMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { JFileChooser openFile = new JFileChooser(); openFile.showOpenDialog(new NotePad()); loadFile(openFile.getSelectedFile()); } }); JMenuItem saveMenu = new JMenuItem("Save"); saveMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { JFileChooser saveFile = new JFileChooser(); saveFile.showSaveDialog(new NotePad()); fileSaved(saveFile.getSelectedFile()); } }); JMenuItem exitMenu = new JMenuItem("Close"); exitMenu.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent ae) { System.exit(0); } }); fileMenu.add(openMenu); fileMenu.add(saveMenu); fileMenu.add(exitMenu); menuBar.add(fileMenu); this.setJMenuBar(menuBar); } public void loadFile(File file) { noteArea.setText(""); try { BufferedReader read = new BufferedReader(new FileReader(file)); String line = null; while((line =read.readLine())!=null) { noteArea.append(line +"\n"); } read.close(); } catch (Exception e) { System.out.println("Error " + e.toString()); } } public void fileSaved(File file) { try { PrintWriter writer = new PrintWriter(file); String[] lines = noteArea.getText().split("\\n"); for (String ) { writer.println(words); } writer.close(); } catch (Exception e) { System.out.println("Error " + e.toString()); } } } btw I can't post my question because of not explaning the scenario according to the site. So there. Thanks for the help

    Read the article

  • Android - Help with ANR and traces.txt

    - by Tori
    My app crashes with an ANR while scrolling in a spinner. I implemented many spinners in different apps and this is the first time i get this ANR. I would appreciate any help in deciphering the traces.txt DALVIK THREADS: "main" prio=5 tid=3 NATIVE | group="main" sCount=1 dsCount=0 s=0 obj=0x40018e70 | sysTid=896 nice=0 sched=0/0 handle=-1097417572 at android.os.BinderProxy.transact(Native Method) at android.app.ActivityManagerProxy.handleApplicationError(ActivityManagerNative.java:2103) at com.android.internal.os.RuntimeInit.crash(RuntimeInit.java:302) at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:75) at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:887) at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:884) at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • Ping script with loop and save in a txt

    - by matthias
    Hello, i try to make an Ping script with vbs. I need a Script, that ping (no ping limit, the program will run all the time) a computername in the network every 2 seconds and save the results in a txt file. For Example: 06/08/2010 - 13:53:22 | The Computer "..." is online 06/08/2010 - 13:53:24 | The Computer "..." is offline Now i try a little bit: strComputer = "TestPC" Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}")._ ExecQuery("select * from Win32_PingStatus where address = '"_ & strComputer & "'") For Each objStatus in objPing If IsNull(objStatus.StatusCode) Or objStatus.StatusCode <> 0 Then .......... Next And than i don't know how to make it. (I'm new with vbs :-)) I hope some one can help me. Greeting, matthias

    Read the article

  • English dictionary as txt or xml file with support of synonyms

    - by Simon
    Can someone point me to where I can download English dictionary as a txt or xml file. I am building a simple app for myself and looking for something what I could start using immediately without learning complex API. Support for synonyms would be great, that is it should be easier to retrieve all the synonyms for particular word. It would be absolutely fantastic if dictionary would be listing British and American spelling of the words where they are differ. Even if it would be small dictionary (few 000's words) that's ok, I only need it for small project. I even would be willing to buy one if the price is reasonable, and dictionary is easy to use - simple xml wold be great. Any directions please.

    Read the article

  • how many times a word appears into a txt file

    - by m4g4bu
    I've a problem when i tried to count how many time a word appears into a txt file. 1/ I create a textfield ( txta ) 2/ I create a button to apply the action ( btn ) 3/ I create a textarea ( area ) that is the place where the content of the file is displayed When I select the file, the content of the file is displayed on area, then I enter the word in txta to search and then I clicked the btn but the code is not working public int contarPalabras(String chain, String word) { // Recibe un string y una palabra y devuelve la cantidad de veces que encontró esa palabra en el string. // Si no encuentra la letra devuelve (-1). int cant = 0; int intIndex = chain.indexOf(word); if(intIndex == - 1){ cant = -1; }else{ cant = intIndex; } return cant; }

    Read the article

  • Exporting winform data to .txt file

    - by EvanRyan
    I have a winform with two data grids, and multiple text boxes. I want to give the user the option to export this data to a text document in a location of their choice on their drive. I also want the text document to be pre-formatted, and the values from the text boxes and datagrids to be plugged in. Is it possible to pre-format a txt document using StreamWriter? And how to I go about giving the user the option of where to save this exported file?

    Read the article

  • How to parse an uploaded txt file in Rails3

    - by gkaykck
    I have a form which have a file input; <%form_tag '/dboss/newsbsresult' , :remote=>true do %> <input type="file" id="examsendbutton" name="txtsbs"/><br/> <input type="submit" value="Gonder"> <%end%> Here i want the user to select a txt file which i try to parse and use at server, but i cannot catch the uploaded file with this code, def newsbsresult @u = params[:txtsbs] #Or params[:txtsbs].to_s p @u end What is the true way of achieving this?

    Read the article

  • Python .app doesn't read .txt file like it should

    - by Bambo
    This question relates to this one: Python app which reads and writes into its current working directory as a .app/exe i got the path to the .txt file fine however now when i try to open it and read the contents it seems that it doesn't extract the data properly. Here's my code - http://pastie.org/4876896 These are the errors i'm getting: 30/09/2012 10:28:49.103 [0x0-0x4e04e].org.pythonmac.unspecified.main: for index, item in enumerate( lines ): # iterate through lines 30/09/2012 10:28:49.103 [0x0-0x4e04e].org.pythonmac.unspecified.main: TypeError: 'NoneType' object is not iterable I kind of understand what the errors mean however i'm not sure why they are being flagged up because if i run my script with it not in a .app form it doesn't get these errors and extracts the data fine.

    Read the article

  • Using PHP's $_COOKIE to create cookie.txt for cURL

    - by boogie
    Hi, I'm running Drupal and Mediawiki on my server under the same domain. They are connected to each other with extensions/modules. Meaning if I log in to Mediawiki, it automatically logs into Drupal also. Mediawiki has some extensions that filter the information shown on the page. What I want to do is to show that filtered information from Mediawiki on my Drupal page. I'm trying to fetch the data with PHP cURL, but I'm not able to force it to use the login information. How can I convert PHP's $_COOKIE into cURL cookie.txt format? I suppose after that I'm able to fetch the data from Mediawiki with the right permissions. This is what print_r($_COOKIE) outputs: [wiki_session] = gg05lhd6pcfs5g6iokhoo0gue7 [wikiUserName] = WikiSysop [wikiLoggedOut] = 20100510110913 [wikiUserID] = 1 [wikiToken] = 52cdb19a7b4a43e5a2f86939e4f54941 Thanks for any help!

    Read the article

  • Using PHP to Seperate Results of a txt file

    - by outbreak
    I am trying to display the last 10 lines of a File and from there take those results and break them down to 10 individual lines.. Currently the code I have found from examples is: $filearray = file("test.txt"); $lastfifteenlines = array_slice($filearray,-10); echo implode($lastfifteenlines, "\n") It display's the 10 items I need however it does not break them down onto individual lines the current results are: 1.0.0.11 1.0.0.12 1.0.0.13 1.0.0.14 1.0.0.15 I need that to instead display as: 1.0.0.11 1.0.0.12 1.0.0.13 1.0.0.14 1.0.0.15 Thanks in Advance for the Asistance!

    Read the article

  • pip install -E requirements.txt failure

    - by Alexander A.Sosnovskiy
    Why does this happen? pip install -E ../../conf/requirements.txt Traceback (most recent call last): File "/home/alecs/workspace/Homepage/env/bin/pip", line 5, in <module> pkg_resources.run_script('pip==0.7.1', 'pip') File "/home/alecs/workspace/Homepage/env/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 489, in run_script File "/home/alecs/workspace/Homepage/env/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1207, in run_script File "/home/alecs/workspace/Homepage/env/lib/python2.6/site-packages/pip-0.7.1-py2.6.egg/EGG-INFO/scripts/pip", line 3, in <module> sys.exit(pip.main()) File "/home/alecs/workspace/Homepage/env/lib/python2.6/site-packages/pip-0.7.1-py2.6.egg/pip/__init__.py", line 94, in main return command.main(initial_args, args[1:], options) File "/home/alecs/workspace/Homepage/env/lib/python2.6/site-packages/pip-0.7.1-py2.6.egg/pip/basecommand.py", line 103, in main complete_args) File "/home/alecs/workspace/Homepage/env/lib/python2.6/site-packages/pip-0.7.1-py2.6.egg/pip/venv.py", line 50, in restart_in_venv [python, file] + args + [base, '___VENV_RESTART___']) File "/usr/lib/python2.6/subprocess.py", line 633, in __init__ errread, errwrite) File "/usr/lib/python2.6/subprocess.py", line 1139, in _execute_child raise child_exception OSError: [Errno 13] Permission denied Thanks.

    Read the article

  • import txt files using excel interop in C# (QueryTables.Add)

    - by kite
    Hi all, I am trying to insert text files into excel cell using Querytables.Add; no error, but the worksheet is empty. except for the single cell manipulation using Value2 property. I already using macro to record the object used. Can you help me on this(I am using vs2008, C# , excel 2003 and 2007; both shown empty cell). Below is my code; thanks for your help Application application = new ApplicationClass(); try { object misValue = Missing.Value; wbDoc = application.Workbooks.Open(flnmDoc, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue); wsRefDocBudgetOwner = (Worksheet)wbDoc.Worksheets[2]; Range lRange = wsRefDocBudgetOwner.get_Range("B2", "B25"); var temp2 = wsRefDocBudgetOwner.QueryTables; var temp = temp2.Add(@"TEXT;d:\temp\config ssas.txt", lRange, Type.Missing); //temp.RefreshStyle = XlCellInsertionMode.xlInsertDeleteCells; //temp.RefreshOnFileOpen = true; wsRefDocBudgetOwner.get_Range("B1", "B1").Value2 = "Lgfdgast adsffdafadfads"; wbDoc.Save(); //wbDoc.SaveAs(flnmDoc2, misValue, misValue, misValue, misValue, misValue, XlSaveAsAccessMode.xlExclusive, // misValue, misValue, misValue, misValue, misValue); wbDoc.Close(Missing.Value, Missing.Value, Missing.Value); } finally { application.Quit(); }

    Read the article

  • Convert Text.txt file .xml format

    - by Kasun
    Hi, I try to convert text file to xml file using following code. But i get error in line 12. Could any one correct it and give me the correct answer. private void button1_Click(object sender, EventArgs e) { string[] lines = File.ReadAllLines("ex3.txt"); char[] ca = new char[] { '~' }; using (XmlTextWriter writer = new XmlTextWriter("ex3.xml", null)) { writer.Formatting = Formatting.Indented; writer.WriteStartDocument(); writer.WriteStartElement("Root"); writer.WriteStartElement("Header"); writer.WriteStartElement("H1"); writer.WriteString(lines[0].TrimEnd().Split(ca, 2)[1]); writer.WriteEndElement(); writer.WriteStartElement("H2"); writer.WriteString(lines[1].TrimEnd().Split(ca, 2)[1]); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteStartElement("Details"); for (int i = 2; i < lines.Length - 2; i++) { writer.WriteStartElement("D" + (i - 1).ToString()); writer.WriteString(lines[i].TrimEnd().Split(ca, 2)[1]); writer.WriteEndElement(); } writer.WriteEndElement(); writer.WriteStartElement("Footer"); writer.WriteStartElement("F1"); writer.WriteString(lines[lines.Length - 2].TrimEnd().Split(ca, 2)[1]); writer.WriteEndElement(); writer.WriteStartElement("F2"); writer.WriteString(lines[lines.Length - 1].TrimEnd().Split(ca, 2)[1]); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); } } Thanks

    Read the article

  • How to download .txt file from a url?

    - by Colin Roe
    I produced a text file and is saved to a location in the project folder. How do I redirect them to the url that contains that text file, so they can download the text file. CreateCSVFile creates the csv file to a file path based on a datatable. Calling: string pth = ("C:\\Work\\PG\\AI Handheld Website\\AI Handheld Website\\Reports\\Files\\report.txt"); CreateCSVFile(data, pth); And the function: public void CreateCSVFile(DataTable dt, string strFilePath) { StreamWriter sw = new StreamWriter(strFilePath, false); int iColCount = dt.Columns.Count; for (int i = 0; i < iColCount; i++) { sw.Write(dt.Columns[i]); if (i < iColCount - 1) { sw.Write(","); } } sw.Write(sw.NewLine); // Now write all the rows. foreach (DataRow dr in dt.Rows) { for (int i = 0; i < iColCount; i++) { if (!Convert.IsDBNull(dr[i])) { sw.Write(dr[i].ToString()); } if (i < iColCount - 1) { sw.Write(","); } } sw.Write(sw.NewLine); } sw.Close(); Response.WriteFile(strFilePath); FileInfo fileInfo = new FileInfo(strFilePath); if (fileInfo.Exists) { //Response.Clear(); //Response.AddHeader("Content-Disposition", "attachment; filename=" + fileInfo.Name); //Response.AddHeader("Content-Length", fileInfo.Length.ToString()); //Response.ContentType = "application/octet-stream"; //Response.Flush(); //Response.TransmitFile(fileInfo.FullName); } }

    Read the article

  • importing a large txt file in MySQL ?

    - by Taz
    Hi I am loading a text data in MySQL using the following command 'mysql> Load Data local Infile 'C:\\Documents and Settings\\Scan\\My Documents\\D ownloads\\instance_types_en.nt\\Copy of instance_types_en.txt' into table dbpedi aentities.resources fields terminated by ' ' lines terminated by 'rn';' Data is like (actually there is a newline after '.') <a> <b> <c> . <a> <b> <c> . <a> <b> <c> . <a> <b> <c> .<a> <b> <c> . <a> <b> <c> . Table has and auto increment ID field and then text fields for all three values. File size is about 750MB The problems are 1. appears to be in first text field 2. only 2MB data is imported

    Read the article

  • inserting unique date into txt document

    - by durian
    I'm trying this script to insert only a unique date into a text file, but it isn't working properly: $log_file_name = "logfile.txt"; $log_file_path = "log_files/$id/$log_file_name"; if(file_exists($log_file_path)){ $not = "not"; $todaydate = date('d,m,Y'); $today = "$todaydate;"; $strlength = strlen($today); $file_contents = file_get_contents($log_file_path); $file_contents_arry = explode(";",$file_contents); if(!in_array($todaytodaydate,$file_contents_arry)){ $append = fopen($log_file_path, 'a'); $write = fwrite($append,$today); //writes our string to our file. $close = fclose($append); //closes our file } else { $append = fopen($log_file_path, 'a'); $write = fwrite($append,$not); //writes our string to our file. $close = fclose($append); //closes our file } } else{ mkdir("log_files/$id", 0700); $todaydate = date('d,m,Y'); $today = "$todaydate;"; $strlength = strlen($today); $create = fopen($log_file_path, "w"); $write = fwrite($create, $today, $strlength); //writes our string to our file. $close = fclose($create); //closes our file } The problem is with the if else statement where it should be written if it's already in the array.

    Read the article

  • Parsing data from txt file in J2ME

    - by CSFYPMAIL
    Basically I'm creating an indoor navigation system in J2ME. I've put the location details in a .txt file i.e. Locations names and their coordinates. Edges with respective start node and end node as well as the weight (length of the node). I put both details in the same file so users dont have to download multiple files to get their map working (it could become time consuming and seem complex). So what i did is to seperate the deferent details by typing out location Names and coordinates first, After that I seperated that section from the next section which is the edges by drawing a line with multiple underscores. Now the problem I'm having is parsing the different details into seperate arrays by setting up a command (while manually tokenizing the input stream) to check wether the the next token is an underscore. If it is, (in pseudocode terms), move to the next line in the stream, create a new array and fill it up with the next set of details. I found a some explanation/code HERE that does something similar but still parses into one array, although it manually tokenizes the input. Any ideas on what to do? Thanks Text File Explanation The text has the following format... <--1stSection--  /**   * Section one has the following format   * xCoordinate;yCoordinate;LocationName   */ 12;13;New York City 40;12;Washington D.C. ...e.t.c _________________________ <--(underscore divider) <--2ndSection--  /**   * Its actually an adjacency list but indirectly provides "edge" details.   * Its in this form   * StartNode/MainReferencePoint;Endnode1;distance2endNode1;Endnode2;distance2endNode2;...e.t.c   */ philadelphia;Washington D.C.;7;New York City;2 New York City;Florida;24;Illinois;71 ...e.t.c

    Read the article

  • Pulling name value pair from a structured adsense code block contained in a txt file

    - by Scott B
    I have a txt file which contains a google adsense code block and I'm trying to pull in the file via file_get_contents to extract the values of the google_ad_client and google_ad_slot variables. In the examples below, I want to return to my calling function: $google_ad_client = 'pub-1234567890987654'; $google_ad_slot = '1234567890' The file may contain one of either of these two formats and I wont know which the user has chosen: Newer Ad Unit Style <script type="text/javascript"><!-- google_ad_client = "pub-1234567890987654"; google_ad_slot = "1234567890"; google_ad_width = 336; google_ad_height = 280; //--> </script> <script type="text/javascript" src="path-to-google-script"></script> Classic Style <script type="text/javascript"><!-- google_ad_client = "pub-1234567890987654"; /* 336x280, created 8/6/09 */ google_ad_slot = "1234567890"; google_ad_width = 336; google_ad_height = 280; google_ad_format="336x280_as"; google_ad_type="text_image"; google_color_border="FFFFFF"; google_color_bg="FFFFFF"; google_color_link="2200CC"; google_color_url="000000"; google_color_text="777777"; //--> </script>

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >