Search Results

Search found 21350 results on 854 pages for 'url parsing'.

Page 77/854 | < Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >

  • Parsing language for both binary and character files

    - by Thorsten S.
    The problem: You have some data and your program needs specified input. For example strings which are numbers. You are searching for a way to transform the original data in a format you need. And the problem is: The source can be anything. It can be XML, property lists, binary which contains the needed data deeply embedded in binary junk. And your output format may vary also: It can be number strings, float, doubles.... You don't want to program. You want routines which gives you commands capable to transform the data in a form you wish. Surely it contains regular expressions, but it is very good designed and it offers capabilities which are sometimes much more easier and more powerful. Something like a super-grep which you can access (!) as program routines, not only as tool. It allows: joining/grouping/merging of results inserting/deleting/finding/replacing write macros which allows to execute a command chain repeatedly meta-grouping (lists-tables-hypertables) Example (No, I am not looking for a solution to this, it is just an example): You want to read xml strings embedded in a binary file with variable length records. Your tool reads the record length and deletes the junk surrounding your text. Now it splits open the xml and extracts the strings. Being Indian number glyphs and containing decimal commas instead of decimal points, your tool transforms it into ASCII and replaces commas with points. Now the results must be stored into matrices of variable length....etc. etc. I am searching for a good language / language-design and if possible, an implementation. Which design do you like or even, if it does not fulfill the conditions, wouldn't you want to miss ? EDIT: The question is if a solution for the problem exists and if yes, which implementations are available. You DO NOT implement your own sorting algorithm if Quicksort, Mergesort and Heapsort is available. You DO NOT invent your own text parsing method if you have regular expressions. You DO NOT invent your own 3D language for graphics if OpenGL/Direct3D is available. There are existing solutions or at least papers describing the problem and giving suggestions. And there are people who may have worked and experienced such problems and who can give ideas and suggestions. The idea that this problem is totally new and I should work out and implement it myself without background knowledge seems for me, I must admit, totally off the mark.

    Read the article

  • Problem Fetching JSON Result with jQuery in Firefox and Chrome (IE8 Works)

    - by senfo
    I'm attempting to parse JSON using jQuery and I'm running into issues. Using the code below, the data keeps coming back null: <!DOCTYPE html> <html> <head> <title>JSON Test</title> </head> <body> <div id="msg"></div> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $.ajax({ url: 'http://datawarehouse.hrsa.gov/ReleaseTest/HGDWDataWebService/HGDWDataService.aspx?service=HC&zip=20002&radius=10&filter=8357&format=JSON', type: 'GET', dataType: 'json', success: function(data) { $('#msg').html(data[0].title); // Always null in Firefox/Chrome. Works in IE8. }, error: function(data) { alert(data); } }); </script> </body> </html> The JSON results look like the following: {"title":"HEALTHPOINT TYEE CAMPUS","link":"http://www.healthpointchc.org","id":"tag:datawarehouse.hrsa.gov,2010-04-29:/8357","org":"HEALTHPOINT TYEE CAMPUS","address":{"street-address":"4424 S. 188TH St.","locality":"Seatac","region":"Washington","postal-code":"98188-5028"},"tel":"206-444-7746","category":"Service Delivery Site","location":"47.4344818181818 -122.277672727273","update":"2010-04-28T00:00:00-05:00"} If I replace my URL with the Flickr API URL (http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?), I get back a valid JSON result that I am able to make use of. I have successfully validated my JSON at JSONLint, so I've run out of ideas as to what I might be doing wrong. Any thoughts? Update: I had the client switch the content type to application/json. Unfortunately, I'm still experiencing the exact same problem. I also updated my HTML and included the live URL I've been working with. Update 2: I just gave this a try in IE8 and it works fine. For some reason, it doesn't work in either Firefox 3.6.3 or Chrome 4.1.249.1064 (45376). I did notice a mistake with the data being returned (the developer is returning a collection of data, even for queries that will always return a single record), but it still baffles me why it doesn't work in other browsers. It might be important to note that I am working from an HTML file on my local file system. I thought it might be a XSS issue, but that doesn't explain why Flickr works.

    Read the article

  • Problem parsing XML data to Multi dimensional array

    - by Cam
    Hi there, i'm still transitioning from as2 to as3, i'm having trouble with parsing XML data to Multi dimensional array, below is the onComplete handler which is succesfully tracing 'event.target.data' but outputs 'A term is undefined and has no properties' when tracing _vein_data[0][0].xPos . I'm guessing there is a easier way to approach it than this attempt private function on_xml_completed(event:Event):void { var XMLPoints:XML = new XML(event.target.data); for ( var i:int = 0; i < XMLPoints.shape.length(); i++ ) { var shapeArray:Array = new Array(); _vein_data.push(shapeArray); for ( var j:int = 0; j < 4; i++ ) { _vein_data[i].push({'xPos':XMLPoints.shape[i].point[j].@xPos, 'yPos':XMLPoints.shape[i].point[j].@yPos}); } } trace(_vein_data[0][0].xPos) loadAsset(); } here's a portion of my XML; <items> <shape> <point xPos="60" yPos="23" /> <point xPos="65" yPos="23" /> <point xPos="93" yPos="85" /> <point xPos="88" yPos="87" /> </shape> <shape> <point xPos="88" yPos="87" /> <point xPos="92" yPos="83" /> <point xPos="145" yPos="174" /> <point xPos="138" yPos="175" /> </shape> <shape> <point xPos="138" yPos="175" /> <point xPos="143" yPos="171" /> <point xPos="147" yPos="211" /> <point xPos="141" yPos="212" /> </shape> </items> thank you in advance for any guidance on this Cam

    Read the article

  • Parsing Data in XML and Storing to DB in Python

    - by Rakesh
    Hi Guys i have problem parsing an xml file and entering the data to sqlite, the format is like i need to enter the chracters before the token like 111,AAA,BBB etc <DOCUMENT> <PAGE width="544.252" height="634.961" number="1" id="p1"> <MEDIABOX x1="0" y1="0" x2="544.252" y2="634.961"/> <BLOCK id="p1_b1"> <TEXT width="37.7" height="74.124" id="p1_t1" x="51.1" y="20.8652"> <TOKEN sid="p1_s11" id="p1_w1" font-name="Verdanae" bold="yes" italic="no">111</TOKEN> </TEXT> </BLOCK> <BLOCK id="p1_b3"> <TEXT width="151.267" height="10.725" id="p1_t6" x="24.099" y="572.096"> <TOKEN sid="p1_s35" id="p1_w22" font-name="Verdanae" bold="yes" italic="yes">AAA</TOKEN> <TOKEN sid="p1_s36" id="p1_w23" font-name="verdanae" bold="yes" italic="no">BBB</TOKEN> <TOKEN sid="p1_s37" id="p1_w24" font-name="verdanae" bold="yes" italic="no">CCC</TOKEN> </TEXT> </BLOCK> <BLOCK id="p1_b4"> <TEXT width="82.72" height="26" id="p1_t7" x="55.426" y="138.026"> <TOKEN sid="p1_s42" id="p1_w29" font-name="verdanae" bold="yes" italic="no">DDD</TOKEN> <TOKEN sid="p1_s43" id="p1_w30" font-name="verdanae" bold="yes" italic="no">EEE</TOKEN> </TEXT> <TEXT width="101.74" height="26" id="p1_t8" x="55.406" y="162.026"> <TOKEN sid="p1_s45" id="p1_w31" font-name="verdanae" bold="yes" italic="no">FFF</TOKEN> </TEXT> <TEXT width="152.96" height="26" id="p1_t9" x="55.406" y="186.026"> <TOKEN sid="p1_s47" id="p1_w32" font-name="verdanae" bold="yes" italic="no">GGG</TOKEN> <TOKEN sid="p1_s48" id="p1_w33" font-name="verdanae" bold="yes" italic="no">HHH</TOKEN> </TEXT> </BLOCK> </PAGE> </DOCUMENT> in .net it is done with 3 foreach loops 1. for "DOCUMENT/PAGE/BLOCK" 2."TEXT" 3. "TOKEN" and then it is entered into the DB i dont get how to do it in python and i am trying it with lxml module

    Read the article

  • Get page permalink and title outside the loop in wordpress

    - by Aakash Chakravarthy
    Hello, How to Get page permalink and title outside the loop in wordpress. I have a function like function get_post_info(){ $post; $permalink = get_permalink($post->ID); $title = get_the_title($post->ID); return $post_info('url' => $permalink, 'title' => $title); } when this function called within the loop, it returns the post's title and url. When it is called outside the loop. It is not returning the current page's title and url. When called in home page it should return the home page's title and url How to get like this ? instead this function returns the latest posts title and url

    Read the article

  • getjson jquery parsing an array

    - by Ozaki
    TLDR: Want to get each heading from an array and insert it into a div without knowing what is inside the div using Jquery - getJSON. I have JSON array lets say: jsonfeed({ "items": [ { "d":{"title":"034324324-22344231-10"} }, { "d"{"title":"23423404-3423422-10"} }, { "d"{"title":"0234234324-32432422-10"} }, { "d"{"title":"0234234324-223534534-10"} ] }) And I want to parse it as for each "title" to insert it into a div. Trying along the lines of $.getJSON(url, function(data){ $.each(data.items, function(i,item){ $('#testfield').html('<p>' + item.d.title + '</p>'); }); }); to no avail. I am using Getjson in other places but in cases where I know what request I am making. e.g: $('#livetime').html(data.Time); Which is all working perfectly fine but in this case I need to get the details out of the array without knowing what is inside the array I'm sure there is something simple that I'm missing here or doing wrong ^^.

    Read the article

  • [Ruby] Why do I have to URI.encode even safe characters for Net::HTTP requests?

    - by Matthias
    I was trying to send a GET request to Twitter (user ID replaced for privacy reasons) using Net::HTTP: url = URI.parse("http://api.twitter.com/1/friends/ids.json?user_id=12345") resp = Net::HTTP.get_response(url) this throws an exception in Net::HTTP: NoMethodError: undefined method empty?' for #<URI::HTTP:0x59f5c04> from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1470:ininitialize' just by coincidence, I stumbled upon a similar code snippet, which used URI.encode prior to URI.parse, so I copied that and tried again: url = URI.parse(URI.encode("http://api.twitter.com/1/friends/ids.json?user_id=12345")) resp = Net::HTTP.get_response(url) now it works fine, but why? There are no reserved characters that need escaping in the URL I mentioned, so why do I have to call URI.encode for get_response to succeed?

    Read the article

  • fetching a url using $.getJSON and parsing it correctly

    - by sofia
    This is probably really stupid but i can't find the problem with my code. It fetches a url that returns json and the function is then supposed to return a string: function getit() { var ws_url = 'example.com/test.js'; var user = false; $.getJSON(ws_url, function(data) { alert('user '+data.user);//shows john user = data.user || false; } ); return user;//should return john but returns false } test.js will have something like this: {"id":"12","username":"ses","user":"john","error":""} or like this: {"error":"123"} I also tried if(data.user){}else{} but it didn't work either.. So what am i missing? Thanks :)

    Read the article

  • NetBeans Web-Services Client Project - repeated WSDL parsing

    - by RedGrittyBrick
    I created a new project thus ... File, New Project... Java, Java Application. Right-click project icon in "Projects" tree-view panel. Choose New, Web Service Client... Specify WSDL file e.g. ( ) Project (*) Local file D:\temp\Foo\Bar.wsdl ( ) WSDL URL [Set Proxy...] client-style JAX-WS [ ] Generate Dispatch code It parsed the WSDL and generated lots of java files. I created a main class and used Netbeans to insert a WS client call Now whenever I run my code (Desktop app), it again parses the WSDL (which doesn't ever change) and regenerates about 78 java files and compiles them. How do I stop Netbeans performing this uneccessary and time-consuming action?

    Read the article

  • TomTom integration does not work anymore?

    - by viezel
    I did for 6 months back an integration for TomTom navigation with URL Scheme. This worked out great, but then TomTom updated their iPhone app to version 1.10. Since then the integration does not work. Anyone tried the same? My iOS integration looks like this: (Titanium appcelerator) var lat = dbDataArray[chosenRoute]["lat"].toFixed(6); //geo coordinate var lng = dbDataArray[chosenRoute]["lng"].toFixed(6); //geo coordinate //open navigation var url = "tomtomhome://geo:action=navigateto&lat="+lat+"&long="+lng+"&name=name"; //show map //var url = "tomtomhome://geo:action=show&lat="+lat+"&long="+lng+"&name=name"; if (Ti.Platform.canOpenURL(url)) { Ti.Platform.openURL(url); }else { alert('Please install TomTom Navigation app'); } Note: I cannot get TomTom to tell me what has changed.

    Read the article

  • Twitter oauth_callback parameter being ignored!

    - by Astrofaes
    Hi guys, I'm trying to get Twitter authentication working on my ASP.NET site. When you create the app on the Twitter website, you have to specify a callback URL, which for sake of argument, I have set to http://mydomain.com I've read the oAuth 1.0a spec, and to override this callback URL with your own custom one you have to send the oauth_callback parameter in the request_token phase (url-encoded of course). So my request URL looks like this: http://twitter.com/oauth/request_token?oauth_callback_url=http%3A%2F%2Fmydomain.com%2Ftwittercallback Supposedly, if all goes to plan, in your response data, you are supposed to receive a new parameter of oauth_callback_confirmed=true in addition to your token and token secret parameters. However, my response comes through as: oauth_token=MYTOKEN&oauth_token_secret=MYTOKENSECRET I know I haven't given you guys the greatest amount to go on, but I'm at my wits end as to why I am not receiving the oauth_callback_confirmed parameter. Without this, my application keeps defaulting back to the callback URL hard-coded on the Twitter website. Please if anyone could help me out, I will be eternally grateful! Thanks, A.

    Read the article

  • Symfony: Weird routing issue

    - by Tom
    Hi, I've got following URL in symfony (specifics not important): /frontend_dev.php/something/25/apple ... and a routing rule: /something/:id/:word The URL works fine when clicked through to on the site, but not when I type in the URL. Instead, symfony says: Unable to find a matching route to generate url for params "NULL". The weird thing is that I can navigate to this page and it works, but when hitting Enter in the browser address bar, it no longer finds it. Any thoughts on what might be the cause of something like this generally? I should also add that the URL was working fine when typed in the address bar earlier, but doesn't anymore, and I'm not sure what's there that might be interfering with it. Thanks in advance.

    Read the article

  • Android - When to use Service

    - by Chris
    This question is related to my previous question: http://stackoverflow.com/questions/2786720/android-service-ping-url So I have an Android app that on the click of a button, opens up a web page. Now, in the background I want to call another http url for gathering stats. My question is does this have to be a service? I know a service is for background tasks that run for an indefinite period of time, while the user is busy doing something else. In my case, all I really need is to get the URL in the background, not show it to the user, instead show the web page to the user. Can I just not write code to get contents of the http url and fire up the activity that displays the web page? Coz all I want is to get the url in the background and be done with it. Or does this have to be done using the Service class? I am confused. Thanks Chris

    Read the article

  • XSLT: How to escape square brackets in Urls

    - by ilariac
    I have a set of records from Solr where field[@name='url'] can have the following format: http://url/blabla/blabla.aspx?sv=[keyword%20keyword,%201] My understanding is that the square brackets denote an array syntax and I would like to use XSLT to remove the square brackets from all Urls. The reason for this is that I am using an Open URL resolver, which does not currently handle well those characters. The best option would be to strip the square brackets from all URLs before such resources are mediated by the Open URL resolver. There are cases where I have multiple occurrences of square brackets per Url. Can you please help me with this? Thanks for your help, I.

    Read the article

  • iphone's nsxmlparser parsing RSS causes encoding problems

    - by Tankista
    Hi, Im working on simle RSS reader. This reader loads data from internet via this code: NSXMLParser *rss = [[NSXMLParser alloc] initWithURL:[NSURL URLWithString:@"http://twitter.com/statuses/user_timeline/50405236.rss"]]; My problem is with encoding. RSS 2.0 file is supposed to be UTF8 encoded according to encoding attribute in XML file. <?xml version="1.0" encoding="utf-8"?> So when I download URLs content I get text truncated after first occurance of char with diacritics, example: l š c t ž ý á í é, etc. I tried to solve the problem by downloading URL as UTF8 string, I used this code: NSString *rssXmlString = [NSString stringWithContentsOfURL: [NSURL URLWithString: @"http://www.macblog.sk/rss.xml"] encoding:NSUTF8StringEncoding error: nil]; NSData *rssXmlData = [rssXmlString dataUsingEncoding: NSUTF8StringEncoding]; Did not help. Thanx for your responses.

    Read the article

  • Parsing dbpedia JSON in Python

    - by givp
    Hello, I'm trying to get my head around the dbpedia JSON schema and can't figure out an efficient way of extracting a specific node: This is what dbpedia gives me: http://dbpedia.org/data/Ceramic_art.json I've got the whole thing as a JSON object in Python but don't really understand how to get the english abstract from this data. I've gotten this far: u = "http://dbpedia.org/data/Ceramic_art.json" data = urlfetch.fetch(url=u) json_data = json.loads(data.content) for j in json_data["http://dbpedia.org/resource/Ceramic_art"]: if(j == "http://dbpedia.org/ontology/abstract"): print "it's here" Not sure how to proceed from here. As you can see there are multiple languages. I need to get the english abstract. Thanks for your help, g

    Read the article

  • 1 bug to kill... Letting PHP Generate The Canonical.

    - by Sam
    Hi folks, for building a clean canonical url, that always returns 1 base URL, im stuck in following case: <?php # every page $extensions = $_SERVER['REQUEST_URI']; # path like: /en/home.ast?ln=ja $qsIndex = strpos($extensions, '?'); # removes the ?ln=de part $pageclean = $qsIndex !== FALSE ? substr($extensions, 0, $qsIndex) : $extensions; $canonical = "http://website.com" . $pageclean; # basic canonical url ?> <html><head><link rel="canonical" href="<?=$canonical?>"></head> when URL : http://website.com/de/home.ext?ln=de canonical: http://website.com/de/home.ext BUT I want to remove the file extension aswell, whether its .php, .ext .inc or whatever two or three char extension .[xx] or .[xxx] so the base url becomes: http://website.com/en/home Aaah much nicer! but How do i achieve that in current code? Any hints are much appreciated +! (other advices for proper canonical usage in this multi-lingual environment are welcome as well)

    Read the article

  • ASP.NET MVC - how to modify requested URLs?

    - by Marek
    The baidu spider seems to be adding ¤ to end of some crawled urls (it seems that it happens with urls containing single unicode character as the last character) The baidu-requested url looks like this: site.com/abc/ä¤ while site.com/abc/ä is the valid url and as linked from many places on my site. The internal problem is that a different route is matched for this kind of url and an unhandled exception occurs. I would not like to lose baidu because of too many 500 errors on the site. I would like to change the requested URL to a different URL by removing the added character before any ASP.NET MVC processing of the request starts. Can I write a request filter/http module or something similar in ASP.NET MVC to remove the trailing '¤' from the urls? I would not like to alter my routes to counter-hack this behavior.

    Read the article

  • ruby hash to object - Parsing data from JSON object

    - by Leddo
    Hi all, I'm just starting to dabble in consuming a JSON webservice, and I am having a little trouble working out the best way to get to the actual data elements. I am receiving a response which has been converted into a ruby hash using the JSON.parse method. The hash looks like this: {"response"=>{"code"=>2002, "payload"=>{"topic"=>[{"name"=>"Topic Name", "url"=>"http://www.something.com/topic", "hero_image"=>{"image_id"=>"05rfbwV0Nggp8", "hero_image_id"=>"0d600BZ7MZgLJ", "hero_image_url"=>"http://img.something.com/imageserve/0d600BZ7MZgLJ/60x60.jpg"}, "type"=>"PERSON", "search_score"=>10.0, "topic_id"=>"0eG10W4e3Aapo"}]}, "message"=>"Success"}} What I would like to know, is what is the easiest way to get to the "topic" data so I can do something like: topic.name = json_resp.name topic.img = jsob_resp.hero_image_url etc Many thanks for any help you can offer. Regards Chris

    Read the article

  • parsed xml file: skip creation if blank?

    - by GoodGets
    This could be a HappyMapper specific question, but I don't think so. In my app, users can upload their blog subscriptions (via an OPML file), which I parse and add to their profile. The only problem is during the parsing, or more specifically the creation of each subscription, I can't figure out how to skip over entries that are just "labels". Since OPML files allow you to label your blogs, or organize them into folders, this is my problem. The actual blog subscriptions and their labels both have "outline" tags. <outline text="Rails" > <outline title="Katz Got Your Tongue?" text="Katz Got Your Tongue?" htmlUrl="http://yehudakatz.com" type="rss" xmlUrl="http://feeds.feedburner.com/KatzGotYourTongue" /> After parsing, I create each feed via a method call inside of the HappyMapper module def create_feed Feed.new( :feed_htmlUrl => self.htmlUrl, :feed_title => self.title, ... But how do I prevent it from creating new "feeds" for those outline tags that are just tags? (i.e. those that don't have an htmlUrl?)

    Read the article

  • Shift-reduce: when to stop reducing?

    - by Joey Adams
    I'm trying to learn about shift-reduce parsing. Suppose we have the following grammar, using recursive rules that enforce order of operations, inspired by the ANSI C Yacc grammar: S: A; P : NUMBER | '(' S ')' ; M : P | M '*' P | M '/' P ; A : M | A '+' M | A '-' M ; And we want to parse 1+2 using shift-reduce parsing. First, the 1 is shifted as a NUMBER. My question is, is it then reduced to P, then M, then A, then finally S? How does it know where to stop? Suppose it does reduce all the way to S, then shifts '+'. We'd now have a stack containing: S '+' If we shift '2', the reductions might be: S '+' NUMBER S '+' P S '+' M S '+' A S '+' S Now, on either side of the last line, S could be P, M, A, or NUMBER, and it would still be valid in the sense that any combination would be a correct representation of the text. How does the parser "know" to make it A '+' M So that it can reduce the whole expression to A, then S? In other words, how does it know to stop reducing before shifting the next token? Is this a key difficulty in LR parser generation?

    Read the article

  • int.Parse of "8" fails. int.Parse always requires CultureInfo.InvariantCulture?

    - by Henrik Carlsson
    We develop an established software which works fine on all known computers except one. The problem is to parse strings that begin with "8". It seems like "8" in the beginning of a string is a reserved character. Parsing: int.Parse("8") -> Exception message: Input string was not in a correct format. int.Parse("80") -> 0 int.Parse("88") -> 8 int.Parse("8100") -> 100 CurrentCulture: sv-SE CurrentUICulture: en-US The problem is solved using int.Parse("8", CultureInfo.InvariantCulture). However, it would be nice to know the source of the problem. Question: Why do we get this behaviour of "8" if we don't specify invariant culture? Additional information: I did send a small program to my client achieve the result above: private int ParseInt(string s) { int parsedInt = -1000; try { parsedInt = int.Parse(s); textBoxMessage.Text = "Success: " + parsedInt; } catch (Exception ex) { textBoxMessage.Text = string.Format("Error parsing string: '{0}'", s) + Environment.NewLine + "Exception message: " + ex.Message; } textBoxMessage.Text += Environment.NewLine + Environment.NewLine + "CurrentCulture: " + Thread.CurrentThread.CurrentCulture.Name + "\r\n" + "CurrentUICulture: " + Thread.CurrentThread.CurrentUICulture.Name + "\r\n"; return parsedInt; }

    Read the article

  • How do I efficiently parse a CSV file in Perl?

    - by Mike
    I'm working on a project that involves parsing a large csv formatted file in Perl and am looking to make things more efficient. My approach has been to split() the file by lines first, and then split() each line again by commas to get the fields. But this suboptimal since at least two passes on the data are required. (once to split by lines, then once again for each line). This is a very large file, so cutting processing in half would be a significant improvement to the entire application. My question is, what is the most time efficient means of parsing a large CSV file using only built in tools? note: Each line has a varying number of tokens, so we can't just ignore lines and split by commas only. Also we can assume fields will contain only alphanumeric ascii data (no special characters or other tricks). Also, i don't want to get into parallel processing, although it might work effectively. edit It can only involve built-in tools that ship with Perl 5.8. For bureaucratic reasons, I cannot use any third party modules (even if hosted on cpan) another edit Let's assume that our solution is only allowed to deal with the file data once it is entirely loaded into memory. yet another edit I just grasped how stupid this question is. Sorry for wasting your time. Voting to close.

    Read the article

  • How to parse a string (by a "new" markup) with R ?

    - by Tal Galili
    Hi all, I want to use R to do string parsing that (I think) is like a simplistic HTML parsing. For example, let's say we have the following two variables: Seq <- "GCCTCGATAGCTCAGTTGGGAGAGCGTACGACTGAAGATCGTAAGGtCACCAGTTCGATCCTGGTTCGGGGCA" Str <- ">>>>>>>..>>>>........<<<<.>>>>>.......<<<<<.....>>>>>.......<<<<<<<<<<<<." Say that I want to parse "Seq" According to "Str", by using the legend here Seq: GCCTCGATAGCTCAGTTGGGAGAGCGTACGACTGAAGATCGTAAGGtCACCAGTTCGATCCTGGTTCGGGGCA Str: >>>>>>>..>>>>........<<<<.>>>>>.......<<<<<.....>>>>>.......<<<<<<<<<<<<. | | | | | | | || | +-----+ +--------------+ +---------------+ +---------------++-----+ | Stem 1 Stem 2 Stem 3 | | | +----------------------------------------------------------------+ Stem 0 Assume that we always have 4 stems (0 to 3), but that the length of letters before and after each of them can very. The output should be something like the following list structure: list( "Stem 0 opening" = "GCCTCGA", "before Stem 1" = "TA", "Stem 1" = list(opening = "GCTC", inside = "AGTTGGGA", closing = "GAGC" ), "between Stem 1 and 2" = "G", "Stem 2" = list(opening = "TACGA", inside = "CTGAAGA", closing = "TCGTA" ), "between Stem 2 and 3" = "AGGtC", "Stem 3" = list(opening = "ACCAG", inside = "TTCGATC", closing = "CTGGT" ), "After Stem 3" = "", "Stem 0 closing" = "TCGGGGC" ) I don't have any experience with programming a parser, and would like advices as to what strategy to use when programming something like this (and any recommended R commands to use). What I was thinking of is to first get rid of the "Stem 0", then go through the inner string with a recursive function (let's call it "seperate.stem") that each time will split the string into: 1. before stem 2. opening stem 3. inside stem 4. closing stem 5. after stem Where the "after stem" will then be recursively entered into the same function ("seperate.stem") The thing is that I am not sure how to try and do this coding without using a loop. Any advices will be most welcomed.

    Read the article

  • IIS 7.5 URL Rewrite - missing “route to server” option

    - by Martin
    (Question moved from StackOverflow) I am running Windows 7 Ultimate, and have activated IIS (Version 7.5.7600.16385). I have installed the following modules using Microsoft Web Platform Installer 2.0: * IIS URL Rewrite Module 2 * Microsoft Application Request Routing Version 2 for IIS 7 * Microsoft Web Farm Framework Version 1 for IIS 7 * Microsoft External Cache Version 1 for IIS 7 Now I am trying to configure a URL Rewrite rule using the "Route to Server" option. However, in the Edit Inbound Rule page, there is no such option: all I have available are: * Rewrite * None * Redirect * Custom Response * Abort Request Why is there no "route to server" option ?

    Read the article

< Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >