url

java.awt.Desktop.browse() method issue.

When we use Desktop.browse method to open a url in Internet Explorer, then it overrides the current web page in the browser. Hence if user was doing anything critical in current page in browser, then its all lost. This does not happen in IE8 and firefox. But the problem is there in IE6. Has anybody found a fix for this problem in IE6. ...

NSString converting percentage characters

Hi, I have an NSString *str = @"T%B3%C3%83"; where %C3 represents A with an umlut (I think), %B3 an m, %83 a superscript 3... What is the best way to convert these percentages into the actual characters. Thanks. ...

decoding base64 encoded string with URL escaped characters

I am currently working on importing contacts from windows live contacts(hotmail addressbook). At one stage, the service posts back some data that i need to my page as a base64 encoded string which, as per microsoft documentation, contains url escaped sequences for '&' and '='. The string is thus not standard base64 encoded. The problem ...

What is the name of the question mark in my URL?

http://example.com/foo.aspx?foo=bar I'm refactoring and need to name the constant which will hold only the question mark character of this string. I'm not sure what best to name the variable, as I've never known what the proper name of that question mark was. What should I name the constant? Or... is there something in .NET that's th...

How can I implement vanity URL's in a Rails application?

I want users to able to have a profile page at site.com/myNameHere. Rails looks for a controller named "myNameHere." Is it possible to setup routes.rb so that if the controller is not found, "myNameHere" gets sent as a parameter to another controller? ...

How can i visit urls with .html suffix

My rails version is 2.3.5(2.3+) How can I visit urls with .html suffix? Just like localhost:3000/welcome.html (welcome is a controller). I got routing errors when I visit urls above.But it works if the url with format param like this: localhost:3000/welcome?format=html In routes.rb: ActionController::Routing::Routes.draw do |map| ...

Working with UTF-8 instead of windows-1255

In the past, I used to work with windows-1255. Now my new page is written in UTF-8. When I send a query to DB (MS-Access), I get no results. The query on the URL shows the same like I type in by myself, but in this case (typing) I get results. How can it happen that I see the same URL on my IE and get the results and the other (that come...

URL fragment identifier - simplify state handling (javascript)

I have a web application which makes extensive use of the fragment identifier for handling "state". examplesite.com/#$mode=direct$aa;map=t;time=2003;vid=4;vid=7 A number of questions: 1) What is a good way of assigning the various "location.hash name value-pairs" to variables to keep track of the state? 1a) Should I make an object t...

Regular Expression Period Issue

((https?|ftp)\:\/\/|www.)(\S+[^.*]) I would like this expression to check for . in succession to each other. If it finds two or more periods back to back, the expression should fail. On the other hand, if it succeeds, I want it to match every character and/or symbol up until the first white space encountered. In other words: www.yahoo....

How to identify the top level domain of a URL object using java ?

Hi , Given this : URL u=new URL("someURL"); How do i identify the top level domain of the URL.. ...

How can I rewrite URLs except those of a particular domain?

Hi. Can you please help me to make perl regexp to replace (http://.+) to http://www.my1.com/redir?$1 but do nothing for urls like http://www.my1.com/ or http://my1.com/ For instance I need to replace http://whole.url.site.com/foo.htm to http://www.my1.com/redir?http://whole.url.site.com/foo.htm http://www.google.com to http://www.my1.co...

How do I get a content-type of a file in Python? (with url..)

Suppose I haev a video file: http://mydomain.com/thevideofile.mp4 How do I get the header and the content-type of this file? With Python. But , I don't want to download the entire file. i want it to return: video/mp4 Edit: this is what I did. What do you think? f = urllib2.urlopen(url) params['mime'] = f.headers['content-type'...

C# question - how do I convert a PageURI & Href to an absolute URL/URI?

Hi, How do I convert a PageURI & Href to an absolute URL/URI in C#? i.e. I am scanning a web page at a given PageURI and in the HTML have link/node with a HREF, and want to translate this HREF into a valid absolute URI. Background - note the trouble I was having here ...

Spoofing the URL in a WebBrowser

Let's say I get the source code of some page (e.g. http://example.com). I now want to write this source code to a WebBrowser, using something like: myWebBrowser.Navigate("about:blank"); myWebBrowser.Document.Write(sourceCode); Now, let's pretend that on the homepage of Example.com, there's a relative URL such as: <img src="/logo.gif"...

create safe title from string

hello guys - moving a lot more of my old php functions to jquery alternatives. I'm a bit stuck on creating a decent preg_match function. Is there an easy way to make strings url safe & seo'd? php; function superClean($str){ $str = strtolower($str); $str = str_replace(" ", "-", $str); $str = preg_replace('/[^a-z0-9_]/i', '-', $str); $...

How to replace old URL in javascript pop-up with new URL

Hi, I need help of getting this piece of code to work 1) I want to automatically start a media player when a pop-up is open, by changing is URL params, that the pop-up has 2) When the user clicks on on the link I want to replace the old URL with the one the new one clicked. Try using location.replace just ends up being a constant loop...

Is the protocol name in URLs case sensitive ?

Is "hTTp://foo.com" the same as "Http://foo.COM" ? I know that Hostnames are not sensitive but path names and query parts are sensitive. ...

what is the most elegant way in ruby to remove a parameter from url?

I would like to take out a parameter from url by it's name without knowing if it is the first, middle or last parameter and reassemble url again. I guess it is not that hard to write something on my own using CGI or URI, but I imagine such functionality exists already. Any suggestions? in: http://example.com/path?param1=one&amp;param2=...

How should a REST URL schema look like for a tree hierarchy?

Let's assume that I have stores, shelves in a store, and products on a shelf. So in order to get a list of products on a shelf in a store, I'd use the following request: GET http://server/stores/123/shelves/456/products From here, how would I get an individual product? Should I use: GET http://server/products/789 Or: GET http://se...

Modify hyperlinks with PHP

I'm using a regular expression to turn URLs in blog comments into clickable hyperlinks. However, i also want to do the opposite: Since i allow certain html tags (but not <a>), if somebody types in a hyperlink, i'd like to change it from: <a href="http://www.example.com"&gt;My Link</a> into My Link: http://www.example.com where the ...