Search Results

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

Page 139/854 | < Previous Page | 135 136 137 138 139 140 141 142 143 144 145 146  | Next Page >

  • A StringToken Parser which gives Google Search style "Did you mean:" Suggestions

    - by _ande_turner_
    Seeking a method to: Take whitespace separated tokens in a String; return a suggested Word ie: Google Search can take "fonetic wrd nterpreterr", and atop of the result page it shows "Did you mean: phonetic word interpreter" A solution in any of the C* languages or Java would be preferred. Are there any existing Open Libraries which perform such functionality? Or is there a way to Utilise a Google API to request a suggested word?

    Read the article

  • clever way to conditionally split this string?

    - by sprugman
    I've got a string that could be in one of two forms: prefix=key=value (which could have any characters, including '=') or key=value So I need to split it either on the first or second equals sign, based on a boolean that gets set elsewhere. I'm doing this: if ($split_on_second) { $parts = explode('=', $str, 3); $key = $parts[0] . '=' . $parts[1]; $val = $parts[2]; } else { $parts = explode('=', $str, 2); $key = $parts[0]; $val = $parts[1]; } Which should work, but feels inelegant. Got any better ideas in php? (I imagine there's a regex-ninja way to do it, but I'm not a regex-ninja.;-)

    Read the article

  • Is there an efficient way to figure out the headers, cookies, and get/post data being passed to a si

    - by kryptobs2000
    More specifically I'm looking for something, perhaps an add-on for firefox, once enabled it logs all of this information as it's passed to and from the server. I'm doing some web scripting and this would be really handy. If anyone is wondering specifically what I'm doing currently I'm trying to make a script to repost my craigslist ad every 2 days since I handle a few things on there. Might even go so far as to make a simple gui to manage the submissions. I do suspect this goes against the ToS, for that reason I don't plan to release the code. Besides cl is already bad enough with spam, I'm not trying to contribute further to it, figured I'd say what I'm doing for the sake of being honest though. I don't have any bad intentions with this, just some things I've been trying to sell an ad for my pc repair business. I've been reposting some things for months now and so often I just forget to do it.

    Read the article

  • What's the simplest way to extract the last section of an IP address?

    - by Jon Cage
    I have an IP address which I want to grab the last chunk of as an integer. So from "192.168.1.150" I'd get 150. This is the code I'd concocted (I'm using C++/CLI), but somehow it feels rather clunky: String^ ipString = "192.168.1.150"; int lastDot = ipString->LastIndexOf('.'); int lastSection = int::Parse(ipString->Substring(lastDot, ipString->Length-lastDot)); Is there a simpler way of doing this?

    Read the article

  • C++ stringstream reads all zero's

    - by user69514
    I have a file which contains three integers per line. When I read the line I use a stringstream to separate the values, but it only reads the first value as it is. The other two are read as zero's. ifstream inputstream(filename.c_str()); if( inputstream.is_open() ){ string line; stringstream ss; while( getline(inputstream, line) ){ //check line and extract elements int id; double income; int members; ss.clear(); ss.str(line); ss >> id >> income >> members; In the case above, id is extracted correctly, but income, and members get assigned zero instead of the actual value.

    Read the article

  • An invalid character was found in text content.'

    - by Praveen Nambiar
    An invalid character was found in text content.'. Could not find prepared statement with handle 0. sp_xml_removedocument: The value supplied for parameter number 1 is invalid. Below is the xml that i am generating. <NewDataSet> <ControlManagementItems><ControlId>74</ControlId><Value>wqeqe</Value></ControlManagementItems> <ControlManagementItems><ControlId>76</ControlId><Value>Yes</Value></ControlManagementItems> <ControlManagementItems><ControlId>78</ControlId><Value>Consumer Core $100 infinite – Nov 2010</Value></ControlManagementItems> <ControlManagementItems><ControlId>108</ControlId><Value>Samsung Galaxy S 16GB</Value></ControlManagementItems> </NewDataSet>

    Read the article

  • How to read any email account from a domain using C#?

    - by Brendan Enrick
    I guess this is sort of two questions that are tied together. Related questions have discussed how to read and parse email using pop3. I need to be able to do this, however, I want this to be able to work with any email address I need. I am trying to allow users to submit content by emailing it to a unique email address, which will automatically know to which account the content should be associated. Is there a good way to create these email addresses on the fly and check these email accounts so for content submissions? Alternatively is there a way to make a "wildcard" email account which gets all of the email sent to the domain and allows me to see what the to address was?

    Read the article

  • Mapping a URL to a service inside a class library

    - by johnk82swe
    I'm developing a small content management solution than can be used in any ASP.NET 3.5 website. The website references some dll's and then lets the aspx's inherit my page baseclass. Some configuration in web.config is also needed, but thats it. Now I'm building a standalone Silverlight editor for the CMS. My idea is that it should communicate with the server using web services. But the question is how to make this service available to the editor? I don't want the website developers having to bother with it. If I used a REST API rather than SOAP I could just create an HttpHandler in my class library and let the website developers add a handler to it in web.config with the path "editor" and then the editor could communicate with that handler on mywebsite.com/editor. Is there any way to achieve the same with a asmx or wcf service? The important thing is that the website developers never have to set up any asmx files or anything. They should only have to specify a url and map that url to a service inside my class library. Thanks in advance!

    Read the article

  • How do I parse youtube xml for a specific entry?

    - by sharataka
    I am trying to return the duration of the video but am having trouble. #YOUTUBE FEED #download the file: file = urllib2.urlopen('http://gdata.youtube.com/feeds/api/videos/2s0vk2wEMtA') #convert to string: data = file.read() #close file because we dont need it anymore: file.close() #entire feed root = etree.fromstring(data) for entry in root: for item in entry: print item When I print item, I see as the last element: Element '{http://gdata.youtube.com/schemas/2007}duration' at 0x10c4fb7d0 But I don't know how to get the value from this. Any advice?

    Read the article

  • how to get unique values set from a repeating values list

    - by Mariselvam
    I need to parse a large log file (flat file), which contains two column of values (column-A , column-B). Values in both columns are repeating. I need to find for each unique value in column-A , I need to find a set of column-B values. Is this can be done using unix shell command or need to write any perl or python script? What are the ways this can be done? Example: xxxA 2 xxxA 1 xxxB 2 XXXC 3 XXXA 3 xxxD 4 output: xxxA - 2,1,3 xxxB - 2 xxxC - 3 xxxD - 4

    Read the article

  • Rails from with better url

    - by Sam
    wow, switching to rest is a different paradigm for sure and is mainly a headache right now. view <% form_tag (businesses_path, :method => "get") do %> <%= select_tag :business_category_id, options_for_select(@business_categories.collect {|bc| [bc.name, bc.id ]}.insert(0, ["All Containers", 0]), which_business_category(@business_category) ), { :onchange => "this.form.submit();"} %> <% end %> controller def index @business_categories = BusinessCategory.find(:all) if params[:business_category_id].to_i != 0 @business_category = BusinessCategory.find(params[:business_category_id]) @businesses = @business_category.businesses else @businesses = Business.all end respond_to do |format| format.html # index.html.erb format.xml { render :xml => @businesses } end end routes map.resources What I want to to is get a better url than what this form is presenting which is the following: http://localhost:3000/businesses?business_category_id=1 Without rest I would have do something like http://localhost:3000/business/view/bbq bbq as permalink or I would have done http://localhost:300/business_categories/view/bbq and get the business that are associated with the category but I don't really know the best way of doing this. So the two questions are what is the best logic of finding a business by its categories using the latter form and number two how to get that in a pretty url all through restful routes in rails.

    Read the article

  • Operations on Java Swing

    - by gustavo
    In my project,I will get the coordinates of some points from an XML file,and create some visual components using this information ? I am planning to give these components to a Java swing frame or panel. However,The users are supposed to click on the figure(which I will construct using Graphics 2d libraries) and select two points and give a label to the points between those two points ? How can i get the clicks clicked on JFrame or JPanel(i.e events for this kind of actions) ?

    Read the article

  • How to parse out html links from a huge string with html links and other text (Java).

    - by Robert
    Hello, my question is how would i be able to go through a string and take out only the links and erase all the rest? I thought about using some type of delemiter, but wouldnt know how to go about using it in java. an example of what i am trying to do: this is my String: String myString = "The file is http: // www. .com/hello.txt and the second file is " + "http: // www. .com/hello2.dat"; I would want the output to be: "http: // www. .com/hello.txt http: // www. .com/hello2.dat" or each could be added to an array, separately. I just want some ideas, id like to write the code myself but am having trouble on how to do it. Any help would be awesome.

    Read the article

  • Tools for Automated Source Code Editing

    - by Steve
    I'm working on a research project to automatically modify code to include advanced mathematical concepts (like adding random effects into a loop or encapsulating an existing function with a new function that adds in a more advanced physical model). My question to the community is: are there are any good tools for manipulating source code directly? I want to do things like Swap out functions Add variable declarations wherever they are required Determine if a function is multiplied by anything Determine what functions are called on a line of code See what parameters are passed to a function and replace them with alternatives Introduce new function calls on certain lines of code Wherever possible just leaving the rest of the code untouched and write out the results I never want to actually compile the code I only want to understand what symbols are used, replace and add in a syntactically correct way, and be able to declare variables at the right position. I've been using a minimal flex/bison approach with some success but I do not feel the it is robust. I hate to take on writing a full language parser just to add some new info to the end of a line or the top of a function. It seems like this is almost what is going to be required but it also seems like there should be some tools out there to do these types of manipulations already. The code to be changed is in a variety of languages, but I'm particularly interested in FORTRAN. Any thoughts?

    Read the article

  • PHP preg_match image between html tags

    - by Alvins
    I've got an html template like this: <div class="cont"> <div class="..."> <p>...<p> <img alt="" class="popup" src="DESIRED IMAGE LINK" style="..." /></p><p>...</p> .... And i want to extract "DESIRED IMAGE LINK" inside the "" tag, currently i'm using this: $pattern = '<div class="cont">.*?src=["\']?([^"\']?.*?(png|jpg|jpeg|gif))["\']?/i'; if (preg_match($pattern, $content, $image)) ..... But it doesn't work, the error is: warning: preg_match() [function.preg-match]: Unknown modifier '.' How can i fix it? Thanks

    Read the article

  • Using Javascript to get URL Vars, not working when multiple values present in QueryString

    - by bateman_ap
    Hi, I am using a Javascript function to get the values of a URL to pass to jQuery using the function below: function getUrlVars() { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for(var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; } And then setting the value like this: var type = getUrlVars()["type"] This all works perfectly, however I have just come into a situation where I need to get multiple values, one of my form elements are checkboxes where multiple values can be checked, so my URL will look something like this: http://www.domain.com/test.php?type=1&cuisine[]=23&cuisine[]=43&name=test If I alert out the cuisine value using the function above I only ever get the final value: alert (getUrlVars()["cuisine[]"]); Would alert "43". What I would like it to be is a comma delimited string of all "cuisine" values. ie in the above example "23,43" Any help very welcome! In case any solution requires it I am using PHP 5.3 and Jquery 1.4

    Read the article

  • Split a binary file into chunks c++

    - by L4nce0
    I've been bashing my head against trying to first divide up a file into chunks, for the purpose of sending over sockets. I can read / write a file easily without splitting it into chunks. The code below runs, works, kinda. It will write a textfile and has a garbage character. Which if this was just for txt, no problem. Jpegs aren't working with said garbage. Been at it for a few days, so I've done my research, and it's time to get some help. I do want to stick strictly to binary readers, as this need to handle any file. I've seen a lot of slick examples out there. (none of them worked for me with jpgs) Mostly something along the lines of while(file)... I subscribe to the, if you know the size, use a for-loop, not a while-loop camp. Thank you for the help!! vector<char*> readFile(const char* fn){ vector<char*> v; ifstream::pos_type size; char * memblock; ifstream file; file.open(fn,ios::in|ios::binary|ios::ate); if (file.is_open()) { size = fileS(fn); file.seekg (0, ios::beg); int bs = size/3; // arbitrary. Actual program will use the socket send size int ws = 0; int i = 0; for(i = 0; i < size; i+=bs){ if(i+bs > size) ws = size%bs; else ws = bs; memblock = new char [ws]; file.read (memblock, ws); v.push_back(memblock); } } else{ exit(-4); } return v; } int main(int argc, char **argv) { vector<char*> v = readFile("foo.txt"); ofstream myFile ("bar.txt", ios::out | ios::binary); for(vector<char*>::iterator it = v.begin(); it!=v.end(); ++it ){ myFile.write(*it,strlen(*it)); } }

    Read the article

  • Any suggestions in a way to parse headers and links from blog pages using C#?

    - by user344841
    I'm currently self-studying C# in my free time and thought of a "little" project to get me going (and one that I or others will actually find useful). It ended up being more complicated than I thought. Or maybe I'm just thinking it is? Anyway, this project would parse the homepages of the blogs (most of them are Wordpress blogs) I frequent to, take the post headers and the links within those posts and notify me via a balloon tip in the task bar. I can handle the rest except for the way of getting C# to parse the HTML pages for the items I need. C# doesn't seem to have no built-in way to do this. Could anyone point me to the right direction? I just looked into the HTML Agility Pack but I'm still trying to figure it out. Some example code will help much too. Thanks in advance!

    Read the article

  • parse unformatted string into dictionary with python

    - by user553131
    I have following string. DATE: 12242010Key Type: Nod32 Anti-Vir (30d trial) Key: a5B2s-sH12B-hgtY3-io87N-srg98-KLMNO I need to create dictionary so it would be like { "DATE": "12242010", "Key Type": "Nod32 Anti-Vir (30d trial)", "Key": "a5B2s-sH12B-hgtY3-io87N-srg98-KLMNO" } The problem is that string is unformatted DATE: 12242010Key Type: Nod32 Anti-Vir (30d trial) there is no space after Date before Key Type also it would be nice to have some validation for Key, eg if there are 5 chars in each box of key and number of boxes I am a beginner in python and moreover in regular expressions. Thanks a lot.

    Read the article

  • How to parse results from google blog search?

    - by Jooj
    Hello! I'm trying to parse the number of results from google seach blog. Could somebody please help me! http://blogsearch.google.com/blogsearch?hl=en&ie=UTF-8&q=a&btnG=Search+Blogs returns a complete page. On the right side you can see (Results 1 - 10 of about 2,504,830,546 for a. (0.05 seconds) ). How could I get 2,504,830,546??? Thanks. Regards.

    Read the article

  • Fast and efficient way to read a space separated file of numbers into an array?

    - by John_Sheares
    I need a fast and efficient method to read a space separated file with numbers into an array. The files are formatted this way: 4 6 1 2 3 4 5 6 2 5 4 3 21111 101 3 5 6234 1 2 3 4 2 33434 4 5 6 The first row is the dimension of the array [rows columns]. The lines following contain the array data. The data may also be formatted without any newlines like this: 4 6 1 2 3 4 5 6 2 5 4 3 21111 101 3 5 6234 1 2 3 4 2 33434 4 5 6 I can read the first line and initialize an array with the row and column values. Then I need to fill the array with the data values. My first idea was to read the file line by line and use the split function. But the second format listed gives me pause, because the entire array data would be loaded into memory all at once. Some of these files are in the 100 of MBs. The second method would be to read the file in chunks and then parse them piece by piece. Maybe somebody else has a better a way of doing this?

    Read the article

  • XSLT : I need to parse the xml with same element name with sequence of order to map in to another xml with different name

    - by Karuna
    As the below source XML Value/string element value has to be replace with target element value, Could some please help me out how to create the XSL to transform from source xml into target xml .Please. Source XML: <PricingResultsV6> <subItems> <SubItem> <profiles> <ProfileValues> <values> <strings>800210</strings> <strings>THC</strings> <strings>10.0</strings> <strings>20.0</strings> <strings>30.0</strings> <strings>40.0</strings> <strings>550.0</strings> <strings>640.0</strings> </values> </ProfileValues> </rofiles> </SubItem> </subItems> </PricingResultsV6> Target XML : <CalculationOutput> <PolicyNumber> 800210 </PolicyNumber> <CommissionFactorMultiplier> THC </CommissionFactorMultiplier> <PremiumValue>10.0</PremiumValue> <SalesmanCommissionValue>20.0</SalesmanCommissionValue> <ManagerCommissionValue>30.0</ManagerCommissionValue> <GL_COR> 550.0</GL_COR> <GL_OPO>640.0</GL_OPO> </CalculationOutput>

    Read the article

< Previous Page | 135 136 137 138 139 140 141 142 143 144 145 146  | Next Page >