Search Results

Search found 3176 results on 128 pages for 'parsing'.

Page 65/128 | < Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >

  • Twitter feed appears to be both RSS 2.0 and Atom?

    - by Greg K
    I'm parsing various site feeds, and putting together a small library to help me do it. Looking at the Atom RFC and RSS 2.0 specification, feeds from Twitter seem to be a combination. Twitter specifies an Atom namespace in an RSS 2.0 structure? GitHub uses Atom, whereas Flickr (offers multiple but the default 'Latest' feed from user profiles) appears to be RSS 2.0. How can Twitter specify a Atom namespace and then use RSS? This makes parsing feeds a little ambiguous, unless I ignore any specified namespace and just examine the document structure.

    Read the article

  • Issues declaring already existing NSMutableArray in new class

    - by Graeme
    I have a class (DataImporter) which has the code to download an RSS feed. I also have a view and separate class (TableView) which displays the data in a UITableView and starts the parsing process, storing parsed information in an NSMutableArray (items) which is located in the (TableView) subclass. Now I wish to add a UIMapView which displays the items in the (items) NSMutableArray. Herein lies the issue - I need to somehow get the data from the (items) NSMutableArray into the new (mapView) subclass which I'm struggling with - and I preferably don't want to have to create a new class to download the data again for the mapView class when it already is in the applications memory. Is there a way I can transfer the information from the NSMutableArray (items) class to the (mapView) class (i.e. how do I declare the NSMutableArray in the (mapView) class)? Here's a overview of how the system works: App opened Data downloaded (using DataImporter class) when (TableView) viewDidLoad runs Data stored in NSMutableArray accessible by the (TableView) class And from here I need to access and declare the array from a new (mapView) class. Any help greatly appreciated, thanks. Code for viewDidLoad MapKit: Data *data = nil; NSString *ilocation = [data locations]; NSString *ilocation2 = @"New Zealand"; NSString *inewlString; inewlString = [ilocation stringByAppendingString:ilocation2]; NSLog(@"inewlString=%@",inewlString); if(forwardGeocoder == nil) { forwardGeocoder = [[BSForwardGeocoder alloc] initWithDelegate:self]; } // Forward geocode! [forwardGeocoder findLocation: inewlString]; Code for parsing data into original NSMutable Array: - (void)beginParsing { NSLog(@"Parsing has begun"); //self.navigationItem.rightBarButtonItem.enabled = NO; // Allocate the array for song storage, or empty the results of previous parses if (incidents == nil) { NSLog(@"Grabbing array"); self.datas = [NSMutableArray array]; } else { [datas removeAllObjects]; [self.tableView reloadData]; } // Create the parser, set its delegate, and start it. self.parser = [[DataImporter alloc] init]; parser.delegate = self; [parser start]; }

    Read the article

  • Integrating my new program with Windows

    - by Carlos
    I've written a log parser, with some generous and insightful help from the SO community: http://stackoverflow.com/questions/2906630/keeping-the-ui-responsive-while-parsing-a-very-large-logfile Now, I'd like to be able to right click one of these logs, select "MyNewLogParser" from "Open With.." and see it open in my new program. This would require me to Change something about my XP installation to show my program in the dropdown list Change the program so that it knows to open the selected file and run the parsing. What do you call these things, and how is it done? I don't know what to search for...

    Read the article

  • Delphi JavaDoc Parser

    - by Christian Sciberras
    I need to parse JavaDoc (documentation) comment syntax with Delphi 7. It is well known in the java world as "JavaDoc", but I'm actually doing this for PHP, ie, parsing JavaDoc in some PHP code. Call it PHPDoc if you want to. To see how these comments work, you can see RAD IDEs like NetBeans etc. Example of JavaDoc for addition function: /** * Adds to numbers together. * @param integer $a The first number. * @param integer $b The second number. * @return integer The resulting number. */ function add($a,$b){ return $a+$b; } Please note that the parser need not be full, ie, parsing all of the PHP code. I mean, it's perfectly fine if it accepted the comment text only as input. Cheers, Chris.

    Read the article

  • Interacting With Class Objects in Ruby

    - by michaelmichael
    How can I interact with objects I've created based on their given attributes in Ruby? To give some context, I'm parsing a text file that might have several hundred entries like the following: ASIN: B00137RNIQ -------------------------Status Info------------------------- Upload created: 2010-04-09 09:33:45 Upload state: Imported Upload state id: 3 I can parse the above with regular expressions and use the data to create new objects in a "Product" class: class Product attr_reader :asin, :creation_date, :upload_state, :upload_state_id def initialize(asin, creation_date, upload_state, upload_state_id) @asin = asin @creation_date = creation_date @upload_state = upload_state @upload_state_id = upload_state_id end end After parsing, the raw text from above will be stored in an object that look like this: [#<Product:0x00000101006ef8 @asin="B00137RNIQ", @creation_date="2010-04-09 09:33:45 ", @upload_state="Imported ", @upload_state_id="3">] How can I then interact with the newly created class objects? For example, how might I pull all the creation dates for objects with an upload_state_id of 3? I get the feeling I'm going to have to write class methods, but I'm a bit stuck on where to start.

    Read the article

  • Optimizing BeautifulSoup (Python) code

    - by user283405
    I have code that uses the BeautifulSoup library for parsing, but it is very slow. The code is written in such a way that threads cannot be used. Can anyone help me with this? I am using BeautifulSoup for parsing and than save into a DB. If I comment out the save statement, it still takes a long time, so there is no problem with the database. def parse(self,text): soup = BeautifulSoup(text) arr = soup.findAll('tbody') for i in range(0,len(arr)-1): data=Data() soup2 = BeautifulSoup(str(arr[i])) arr2 = soup2.findAll('td') c=0 for j in arr2: if str(j).find("<a href=") > 0: data.sourceURL = self.getAttributeValue(str(j),'<a href="') else: if c == 2: data.Hits=j.renderContents() #and few others... c = c+1 data.save() Any suggestions? Note: I already ask this question here but that was closed due to incomplete information.

    Read the article

  • optimize python code

    - by user283405
    i have code that uses BeautifulSoup library for parsing. But it is very slow. The code is written in such a way that threads cannot be used. Can anyone help me about this? I am using beautifulsoup library for parsing and than save in DB. if i comment the save statement, than still it takes time so there is no problem with database. def parse(self,text): soup = BeautifulSoup(text) arr = soup.findAll('tbody') for i in range(0,len(arr)-1): data=Data() soup2 = BeautifulSoup(str(arr[i])) arr2 = soup2.findAll('td') c=0 for j in arr2: if str(j).find("<a href=") > 0: data.sourceURL = self.getAttributeValue(str(j),'<a href="') else: if c == 2: data.Hits=j.renderContents() #and few others... #... c = c+1 data.save() Any suggestions? Note: I already ask this question here but that was closed due to incomplete information.

    Read the article

  • How to sort the row contents on table cell by using date

    - by MS Nathan
    Hi i am new to iphone application development.i am developing RSS feed Reader it has number of different RSS feeds. In my application (XML parsing), i want to display the content of the row on cell for particular date and with their corresponding title, description (in my application, i am using three labels for displaying title, date and description) on table view cell after parsing xml data. And i want to sort the all kinds of RSS feeds row contents(title, date, description) depends upon the date in single another UIViewController and for each RSS feed has a separate ViewController. thanks in advance.

    Read the article

  • Is there any Python library that allows me to parse an HTML document similar to what jQuery does?

    - by Sachin Tendulkar
    Is there any Python library that allows me to parse an HTML document similar to what jQuery does? i.e. I'd like to be able to use CSS selector syntax to grab an arbitrary set of nodes from the document, read their content/attributes, etc. The only Python HTML parsing lib I've used before was BeautifulSoup, and even though it's fine I keep thinking it would be faster to do my parsing if I had jQuery syntax available. :D Write an iterative program that finds the largest number of McNuggets that cannot be bought in exact quantity. Your program should print the answer in the following format (where the correct number is provided in place of n): "Largest number of McNuggets that cannot be bought in exact quantity: n"

    Read the article

  • How can a string timestamp with hours 0 to 24 be parsed

    - by user897052
    I am trying to parse a string timestamp of format "yyyyMMddHHmmss" with DateTime.ParseExact(). The catch is I must allow for an hour value of "24" (i.e. hours can be from 0 to 24; Note: I can't control the input values.) and, of course, that results in an exception. Are there any settings/properties I can set instead of manually parsing/using regex's? If not, any efficient parsing ideas? ex. DateTime.ParseExact("20120911240000", "yyyyMMddHHmmss", System.Globalization.CultureInfo.InvariantCulture); hour 24 means hour 0 of next day (so day + 1, hour = 0)

    Read the article

  • C++: Get char after space character instead or return carriage.

    - by Kzone272
    Okay this is similar to my last question but what I ended up doing was way too complex for something as simple as this. I simply need to get a single character or number (I will know which of these I am receiving) from the console after I press space, instead of pressing enter. I'm sure there must be a way to have the terminal read input after a space instead of a '\n'. I need to read inputs from the console in which the succeeding data types will vary depending on what the first input is, and I think reading the entire line, parsing it into strings, then parsing some of those into ints is a bit unnecessary. So Is this actually not possible in C++ or have I just not found it yet?

    Read the article

  • Can you make a python script behave differently when imported than when run directly?

    - by futuraprime
    I often have to write data parsing scripts, and I'd like to be able to run them in two different ways: as a module and as a standalone script. So, for example: def parseData(filename): # data parsing code here return data def HypotheticalCommandLineOnlyHappyMagicFunction(): print json.dumps(parseData(sys.argv[1]), indent=4) the idea here being that in another python script I can call import dataparser and have access to dataParser.parseData in my script, or on the command line I can just run python dataparser.py and it would run my HypotheticalCommandLineOnlyHappyMagicFunction and shunt the data as json to stdout. Is there a way to do this in python?

    Read the article

  • iPhone Saving File

    - by Kashif
    Hi, to every one, i am doing xml parsing and i am getting two text files from the server with contents i have stored the contents of the first file document directory however when parsing function call second time the contents are overwritten by second file, i don't know how to create two txt file in document directory for two different contents paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES); documentsDirectory = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"Report.txt"]; [text writeToFile:documentsDirectory atomically:NO]; [text release]; I HAVE TAKEN THE CONTENT FOR THE FIRST FILE WITH THIS METHOD.

    Read the article

  • How to notify ViewController on parse end with multiple ViewControllers using a single parser.

    - by objneodude
    Hello, I have created a RSS parser and 3 TableViews and it parses the RSS files fine but I don't know how to notify the TableViewController when parsing has ended so it can update the view. The TableViewController initiates the parser and the parsing of a feed. parser = [[RSSParser alloc] initWithURL:@"http://randomfeed.com"]; I can access the single feed items like [parser feedItems]; In parser.m i have implemented the delegate methods of NSXMLParser: - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName - (void)parserDidEndDocument:(NSXMLParser *)parser So how do i get parserDidEndDocument to notify my controllers so i can add the data to the tableview. Cheers from a obj-c beginner.

    Read the article

  • preg_match_all confusing failing

    - by James
    $string = (string) file_get_contents($_FILES['file']['tmp_name']); echo $string; preg_match_all("/[\._a-zA-Z0-9-]+@[\._a-zA-Z0-9-]+/i", $string, $matches); print_r($matches); I am parsing text/csv files and grabbing email addresses from uploaded files. When parsing a Google Contact file I exported it weirdly fails. But when I simply copy the string that is echo'd and paste that instead of the file_get_contents result, it parses and works. Any idea why it is refusing to take the file_get_contents string, but if I paste in the raw data myself, it works?

    Read the article

  • Automator / AppleScript to process incoming emails in Mac Mail

    - by mark
    Hello all, I'm designing an app that allows users to email me crash reports if my app ever crashes. I'd like to leave Mac Mail running on a computer and when an email comes through, an automator script / AppleScript runs to process the contents of the body of the email. I've got the entire parsing/processing done in a python script, except I have to manually copy the contents of the email into a file and then run my parser on that file. What's the best way to set this up so I can the contents of the email be pushed into my parsing script? Many thanks!

    Read the article

  • Iterating through facebook comments JSON object failing

    - by user1594304
    I tried the option of students.item["http://www.myurl.com"].comments.data.length. However, the item["http://www.myurl.com"] call is not working. If I take out the URL from JSON object and write the iterator with students.comments.data, it works. Here is my code, any help highly appreciated. var students = { "http://www.myurl.com":{ "comments":{ "data" : [ { "id": "123456778", "from": { "name": "XYZ", "id": "1000005" }, "message": "Hey", "can_remove": false, "created_time": "2012-09-03T03:16:01+0000", "like_count": 0, "user_likes": false } ] } } } var i=0 var arrayObject = new Array(); alert("Parsing 2: "+students.item["http://www.myurl.com"].comments.data.length); for(i=0;i<students.item["http://www.myurl.com"].comments.data.length;i++) { alert("Parsing 1: "+i); arrayObject.push(students.item["http://www.myurl.com"].comments.data[i].id); arrayObject.push(students.item["http://www.myurl.com"].comments.data[i].message); arrayObject.push(students.item["http://www.myurl.com"].comments.data[i].created_time); }

    Read the article

  • Perl scraping script not recognising certain characters

    - by user1849286
    I have a script that works fine locally but on the server fails. It displays the non-breaking space symbol &nbsp; as ? when printing to standard output. In the parsing of the page, if I try to get rid of non breaking space symbol with s/&nbsp;//g nothing happens, neither getting rid of the question mark s/?//g It seems to stick no matter what. Bizzarely, this is not an issue when running the script locally. Additionally, question marks within a diamond symbol are inserted everywhere (on both the server script and the local script) instead of apostrophes, although at least that is not causing the parsing of the page to break on the local page. Confused, pls help.

    Read the article

  • Enhanced REST Support in Oracle Service Bus 11gR1

    - by jeff.x.davies
    In a previous entry on REST and Oracle Service Bus (see http://blogs.oracle.com/jeffdavies/2009/06/restful_services_with_oracle_s_1.html) I encoded the REST query string really as part of the relative URL. For example, consider the following URI: http://localhost:7001/SimpleREST/Products/id=1234 Now, technically there is nothing wrong with this approach. However, it is generally more common to encode the search parameters into the query string. Take a look at the following URI that shows this principle http://localhost:7001/SimpleREST/Products?id=1234 At first blush this appears to be a trivial change. However, this approach is more intuitive, especially if you are passing in multiple parameters. For example: http://localhost:7001/SimpleREST/Products?cat=electronics&subcat=television&mfg=sony The above URI is obviously used to retrieve a list of televisions made by Sony. In prior versions of OSB (before 11gR1PS3), parsing the query string of a URI was more difficult than in the current release. In 11gR1PS3 it is now much easier to parse the query strings, which in turn makes developing REST services in OSB even easier. In this blog entry, we will re-implement the REST-ful Products services using query strings for passing parameter information. Lets begin with the implementation of the Products REST service. This service is implemented in the Products.proxy file of the project. Lets begin with the overall structure of the service, as shown in the following screenshot. This is a common pattern for REST services in the Oracle Service Bus. You implement different flows for each of the HTTP verbs that you want your service to support. Lets take a look at how the GET verb is implemented. This is the path that is taken of you were to point your browser to: http://localhost:7001/SimpleREST/Products/id=1234 There is an Assign action in the request pipeline that shows how to extract a query parameter. Here is the expression that is used to extract the id parameter: $inbound/ctx:transport/ctx:request/http:query-parameters/http:parameter[@name="id"]/@value The Assign action that stores the value into an OSB variable named id. Using this type of XPath statement you can query for any variables by name, without regard to their order in the parameter list. The Log statement is there simply to provided some debugging info in the OSB server console. The response pipeline contains a Replace action that constructs the response document for our rest service. Most of the response data is static, but the ID field that is returned is set based upon the query-parameter that was passed into the REST proxy. Testing the REST service with a browser is very simple. Just point it to the URL I showed you earlier. However, the browser is really only good for testing simple GET services. The OSB Test Console provides a much more robust environment for testing REST services, no matter which HTTP verb is used. Lets see how to use the Test Console to test this GET service. Open the OSB we console (http://localhost:7001/sbconsole) and log in as the administrator. Click on the Test Console icon (the little "bug") next to the Products proxy service in the SimpleREST project. This will bring up the Test Console browser window. Unlike SOAP services, we don't need to do much work in the request document because all of our request information will be encoded into the URI of the service itself. Belore the Request Document section of the Test Console is the Transport section. Expand that section and modify the query-parameters and http-method fields as shown in the next screenshot. By default, the query-parameters field will have the tags already defined. You just need to add a tag for each parameter you want to pass into the service. For out purposes with this particular call, you'd set the quer-parameters field as follows: <tp:parameter name="id" value="1234" /> </tp:query-parameters> Now you are ready to push the Execute button to see the results of the call. That covers the process for parsing query parameters using OSB. However, what if you have an OSB proxy service that needs to consume a REST-ful service? How do you tell OSB to pass the query parameters to the external service? In the sample code you will see a 2nd proxy service called CallREST. It invokes the Products proxy service in exactly the same way it would invoke any REST service. Our CallREST proxy service is defined as a SOAP service. This help to demonstrate OSBs ability to mediate between service consumers and service providers, decreasing the level of coupling between them. If you examine the message flow for the CallREST proxy service, you'll see that it uses an Operational branch to isolate processing logic for each operation that is defined by the SOAP service. We will focus on the getProductDetail branch, that calls the Products REST service using the HTTP GET verb. Expand the getProduct pipeline and the stage node that it contains. There is a single Assign statement that simply extracts the productID from the SOA request and stores it in a local OSB variable. Nothing suprising here. The real work (and the real learning) occurs in the Route node below the pipeline. The first thing to learn is that you need to use a route node when calling REST services, not a Service Callout or a Publish action. That's because only the Routing action has access to the $oubound variable, especially when invoking a business service. The Routing action contains 3 Insert actions. The first Insert action shows how to specify the HTTP verb as a GET. The second insert action simply inserts the XML node into the request. This element does not exist in the request by default, so we need to add it manually. Now that we have the element defined in our outbound request, we can fill it with the parameters that we want to send to the REST service. In the following screenshot you can see how we define the id parameter based on the productID value we extracted earlier from the SOAP request document. That expression will look for the parameter that has the name id and extract its value. That's all there is to it. You now know how to take full advantage of the query parameter parsing capability of the Oracle Service Bus 11gR1PS2. Download the sample source code here: rest2_sbconfig.jar Ubuntu and the OSB Test Console You will get an error when you try to use the Test Console with the Oracle Service Bus, using Ubuntu (or likely a number of other Linux distros also). The error (shown below) will state that the Test Console service is not running. The fix for this problem is quite simple. Open up the WebLogic Server administrator console (usually running at http://localhost:7001/console). In the Domain Structure window on the left side of the console, select the Servers entry under the Environment heading. The select the Admin Server entry in the main window of the console. By default, you should be viewing the Configuration tabe and the General sub tab in the main window. Look for the Listen Address field. By default it is blank, which means it is listening on all interfaces. For some reason Ubuntu doesn't like this. So enter a value like localhost or the specific IP address or DNS name for your server (usually its just localhost in development envirionments). Save your changes and restart the server. Your Test Console will now work correctly.

    Read the article

  • Delete directory by referencing symbolic link

    - by Adam
    To set up the question, imagine this scenario: mkdir ~/temp cd ~/ ln -s temp temporary rm -rf temporary, rm -f temporary, and rm temporary each will remove the symbolic link but leave the directory ~/temp/. I have a script where the name of the symbolic link is easily derived but the name of the linked directory is not. Is there a way to remove the directory by referencing the symbolic link, short of parsing the name of the directory from ls -od ~/temporary?

    Read the article

  • The Breakpoint Ep. 4 —The Tour De Timeline

    The Breakpoint Ep. 4 —The Tour De Timeline Ask and vote for questions at: goo.gl The DevTools' Timeline shows the heartbeat and health of your application's performance. In this episode we'll do a deep deep dive into how to uncover the cost of internal browser operations like parsing HTML, decoding images, invalidating layout geometry and painting to screen. Paul and Addy will show you how best to approach improving the performance of your CSS and JS. From: GoogleDevelopers Views: 0 0 ratings Time: 01:00:00 More in Science & Technology

    Read the article

  • How to install monitorx?

    - by blade19899
    I followed a tutorial at unixmen on how to install monitorx in ubuntu i installed the dependencies and downloaded the monitorix_2.5.0-izzy1_all.deb deb package but when i try to install it i get this error google transtaler (i have a dutch Ubuntu and so was the error message) dpkg: error processing monitorix_2.5.0-izzy1_all.deb (- install): parsing file '/ var / lib / dpkg / tmp.ci / control' near line 14 package 'monitorix': blank line in the value of field 'Description' Errors were encountered while processing: monitorix_2.5.0-izzy1_all.deb my question is how to get monitorx up and running in Ubuntu 11.10 amd64

    Read the article

< Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >