url

What's the best way to validate a user-entered URL in a Cocoa application?

I am trying to build a homebrew web brower to get more proficient at Cocoa. I need a good way to validate whether the user has entered a valid URL. I have tried some regular expressions but NSString has some interesting quirks and doesn't like some of the back-quoting that most regular expressions I've seen use. ...

How do you find the base url from a DLL in C#?

From within a DLL that's being called by a C#.NET web app, how do you find the base url of the web app? ...

Can I use commas in a URL?

I typically use URL rewriting to pass content IDs to my website, so this Foo.1.aspx rewrites to Foo.aspx?id=1 For a specific application I need to pass in multiple IDs to a single page, so I've rewritten things to accept this: Foo.1,2,3,4,5.aspx This works fine in Cassini (the built-in ad hoc web server for Visual Studio) but...

How to implement URL pattern interpreter as used by Django and RoR in PHP

What's the best way to implement a URL interpreter / dispatcher, such as found in Django and RoR, in PHP? It should be able to interpret a query string as follows: /users/show/4 maps to area = Users action = show Id = 4 /contents/list/20/10 maps to area = Contents action = list Start = 20 Count = 10 /toggle/projects/10/active map...

Using a backslash (%5c) in a REST WCF URL

I am building a REST service on WCF, and one of the methods I am writing is GetProfile, which will return the profile for a given username. The username will include the user's domain, and so will have the following format: "DOMAIN\username". I therefore have a service called Profiles.svc, which has the following endpoint set up: [Oper...

How to construct a relative path in Java from two absolute paths (or URLs)?

Given two absolue paths, e.g. /var/data/stuff/xyz.dat /var/data How can one create a relative path that uses the second path as its base? In the example above, the result should be: ./stuff/xyz.dat ...

Best way to handle security and avoid XSS with user entered URLs

We have a high security application and we want to allow users to enter URLs that other users will see. This introduces a high risk of XSS hacks - a user could potentially enter javascript that another user ends up executing. Since we hold sensitive data it's essential that this never happens. What are the best practices in dealing wit...

PHP validation/regex for URL

I've been looking for a simple regex for URL's, does anybody have one handy that works well? I didn't find one with the zend framework validation classes and have seen several implementations. Thanks ...

How do I get the URLs from any tab in any open browser

I am trying to detect which web in sharepoint that the user is looking at right now. One approach could be to read the URls from the browser and try to compare them to a reference URL to the sharepoint solution. I have not yet been able to locate any solution that works in both IE and Firefox. The idea is to write a small C# app that wi...

Stripes: all URLs resolved through StripesDispatcher and forwarded to pre-compiled JSPs

Is it possible to have the StripesDispatcher be the sole determiner of webserver urls by looking at the @UrlBinding annotations on action beans AND also having those action beans forward to pre-compiled JSPs / servlets WITHOUT needing to define and maintain <servlet> <servlet-mapping> pairs in web.xml? Basically, I just want to have to o...

URL rewriting - international letters

How should I format URLs with special/international characters? Currently I try to make URLs "look good", so that: www.myhost.com/this is a test, do you know how? is converted to: www.myhost.com/this_is_a_test_do_you_know_how I know some international letters could be converted (ü = ue, æ = ae, å = aa), some characters could be re...

java.net.URLEncoder.encode(String) is deprecated, what should I use instead?

I get the following warning when using java.net.URLEncoder.encode: warning: [deprecation] encode(java.lang.String) in java.net.URLEncoder has been deprecated What should I be using instead? ...

Which is better for a rails site? /{login} or /user/{login}

Which is better (for the user, for longevity, for performance, for whatever) to have: http://{site}/{login} e.g. http://wildobs.com/adam_jack or http://{site}/user/{login} Pros of former: User feels more special. URLs are shorter. Cons of former: Cannot have users w/ logins matching keywords, and keywords likely grow over time....

URL-Encoded Angle Brackets in URL?

Hi, I'm working on a legacy app and for whatever reason it's trying to stuff URL-encoded angle brackets into a URL. For example, to get a URL ending with "<sometext>": http://somesite.com/somefolder/%3csometext%3e When the above URL-encoded URL is fetched, it generates a 400 error (Bad Request) on IIS6 and I can't quite figure out why...

How can I URL encode a string in Excel VBA?

Is there a built-in way to URL encode a string in Excel VBA or do I need to hand roll this functionality? ...

A good library to do URL manipulation in Java

I need to do a few very simple URL manipulations in Java. Like get the value for a parameter in the query, or update it, ... I was expecting to find a simple utility class doing that in the commons-lang package, but no. I know it is a simple problem, but if there is something already written, why do it again ? Do you know of any ? I wou...

Using axWebBrowser control to capture page request and postdata.

I'm writing a small utility to capture all requests made to a web server from a windows application using the axWebBrowser control. So far I have the following working, as the user traverse the website clicking on links, posting forms etc I capture the webpage and the data being send to the server to request the next page. Where I ru...

Find CorelDraw Web links

Does anyone know how to get the Web links in a CorelDraw document? I am using CorelDraw 13 X3 on Windows, and it comes with a Link manager and VBA. ...

C# downloading a webpage. A better way needed, CPU usage high

I'm trying to get this piece of code working a little better. I suspect it's the loop reading one byte at a time. I couldn't find another way of doing this with gzip decompression. Implementing a StreamReader is fine, but it returns a string which I can't pass to the decompression stream. Is there a better way? byte[] bufffer = null; L...

Question about URL Validation with Regex

I have the following regex that does a great job matching urls: ((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)` However, it does not handle urls without a prefix, ie. stackoverflow.com or www.google.com do not match. Anyone know how I can modify this regex to not care if there is a prefix ...