url

PHP URL 'Redirecting'

Say if you visit my site: http://nesmods.com/page/2/ there isn't actually a /page/2/ on my site, Wordpress somehow catches the URL and generates a page based on the URL. What is the name of this technique? ...

Javascript - follow link, copy URL and change original?

Hi all, I don't know if this is even possible in Javascript as am pretty new to it, but hopefully someone will be able to help! I want some Javascript (ideally jQuery) that will follow all the links with a certain word in on a page and then on the next page, there will be a link to an image. I want to copy that link and then go back a...

URL.openStream() is very slow when ran on school's unix server

I am using URL.openStream() to download many html pages for a crawler that I am writing. The method runs great locally on my mac however on my schools unix server the method is extremely slow. But only when downloading the first page. Here is the method that downloads the page: public static String download(URL url) throws IOExcept...

What's an easy way to get the url in the current window minus the domain name?

My Javascript ain't so hot, so before I get into some messy string operations, I thought I'd ask: If the current url is: "http://stackoverflow.com/questions/ask" What's a good way to to just get: "/questions/ask" ? Basically I want a string that matches the Url without the domain or the "http://" ...

Creating links to organization/community pages in Liferay 6

Lets say I have am Organization object. How do I create an url that points to that organization's public pages? There is a class NavItem that creates links to given layouts, but which one the "front page" is undocumented (among everything else). Then there is PortletURLImpl that can be used (in convoluted way) for this at least as long...

jQUery fadeIn based on url?

Hello, let say i pass url, example.php?mode=select&ID=1#age is it possible to add jquery fadeIn based on url? this url will be on another page, when user click it, a page will load and hence the age filed should be fade in. if this not possible, is there any other way? ...

How can I extract URLs from plain text in Perl?

I've seen some posts like this, but not exactly what I want to do. How can I extract and delete URL links, and then remove them from plain text. Example: "Hello!!, I love http://www.google.es". I want extract the "http://www.google.es", save it on a variable, and then, remove it from my text. Finally, the text has to be like that: ...

call remote programs by URL with python

Hi, guys, I am developing a GUI in python with wxPython framework to launch several subprocess programs. Now I could do it for the local files, e.g. if we have a compiled .out file under the path "/AAA/BBB/xxx.out", I could do with command like this: subprocess.Popen("/AAA/BBB/xxx.out", stdout=subprocess.PIPE) Now, I am thinking to ...

Why does Mercurial's ssh:// URL use two slashes before the path?

Example Mercurial URL: ssh://myhost//path/to/repo Why two slashes? The hostname is already specified. Why it does not work like http://myhost/path/to/page where only one slash is sufficient? ...

Facebook like usage of #! in url for content loaded through ajax

I am using ajax to load content for my site. When I dynamically load a page http//www.example.com/a/b/c I change my current page's url to http//www.example.com/xyz/#!/a/b/c by setting it through javascript using window.location Now what I want to do is that when somebody enters a url http//www.example.com/xyz/#!/a/b/c in the browser, he...

Is It A URL for Search Engines? If It Is, Then What Should I Do?

In order to steer visitors to the right tab, I put ?tab=1 at the end of a url. Then used JavaScript to open that tab when visitors clicked that URL. Put it in other way. One page has two "URL"(I am not sure if they are). One is www.domain.com/foo.html, the other, www.domain.com/foo.html?tab=2. Only click the last one, should the tab 2 o...

Shorten URL text on links like stackoverflow?

Hi, I need some help in PHP to create short urls just like StackOverflow creates when we comment any long URL in comments on a question. StackOverflow shortens http://www.noupe.com/how-tos/10-ways-to-automatically-manually-backup-mysql-database.html long url to short urls like this noupe.com/... I require similar kind of functional...

Java: File type of `url.openStream()`

I wrote this this method to download a webpage given a URL. It is designed to download HTML only. If I want to do error checking and allow HTML only how should I do this? public static String download(URL url) throws IOException { InputStream is = url.openStream(); BufferedReader reader = new BufferedReader(new InputStreamRe...

Java: Reasonable timeout period for URLConnection

By default the timeout for URLConnection is 0 which is unlimited. What is a reasonable value for XXXXX? URL url = ... URLConnection uCon = url.openConnection(); uCon.setConnectTimeout(XXXXXX); ...

Java: URL.openStream() - use IPv4

By default url.openStream(); uses IPv6. My schools server silently blocks IPv6. This causes url.openStream(); to hang for 3 minutes and 15 seconds. Is there a way that I can get url.openStream() to use IPv4 by default? ...

URL of WCF service in my .NET solution

I am trying to adapt some JavaScript code to call a working WCF service in my C# .NET 3.5 solution. I need to figure out the URL of the WCF. Should be pretty simple, I would hope. ...

How can I get the URL of the current page from within a C# App_Code class?

I have a logging class that, well, logs things. I would like to add the ability to automatically have the current page be logged with the messages. Is there a way to get the information I'm looking for? Thanks, ...

Ruby on Rails - Clean up url parameters

I have a Rails app set up so that when a user uploads an image, it is sent directly to Amazon's S3. I have to specify a redirect address in the form code. After the image is finished uploading, Amazon redirects the user to www.redirect_address.com/?bucket=[BUCKET]&key=[KEY]&etag=[ETAG] I need the bucket and key info to process the image...

URL concatenation javascript for selected (or not) checkboxes

Hi, I have this code for that "sends by" GET true or false concerning if a checkbox is checked or not: var isChecked = document.myform.checkbox.checked ? 1 : 0; var isChecked0 = document.myform.checkbox0.checked ? 1 : 0; var isChecked1 = document.myform.checkbox1.checked ? 1 : 0; xmlhttp.open("GET","roulette2.php?boxchecked=" + isChec...

How is it possible for uri.Host to throw a UriFormatException?

foreach (var node in root.Find("a[href]")) { var href = node.Attributes["href"].Value; Uri uri; try { uri = new Uri(item.Value.Uri, href); } catch(UriFormatException) { continue; } // *snip* try { if (_imageHosts.IsMatch(uri.Host)) // <--- problematic line pr...