url

Restlet - Access elements of the request URL

I'm unsure what the proper way is to access parts of the requested URL. In this case, I want to get the requested path without the query variables. This is the only way I found to do it: String path = getRequest().getResourceRef().getHostIdentifier() + getRequest().getResourceRef().getPath(); The result would be the bold part ...

django username in url, instead of id

Hello, in a mini virtual community, i have a profile_view function, so that i can view the profile of any registered user. The profile view function has as a parameter the id of the user wich the profile belongs to, so that when i want to access the profile of user 2 for example, i call it like that: http://127.0.0.1:8000/accounts/profi...

What is the base open source java package to filter/match URLs?

Hi, I have an high performance application which deals with URLs. For every URL it needs to retrieve the appropriate settings from a predefined pool. Every settings object is associated with a URL pattern which indicates which URLs should use these settings. The matching rules are as follows: "google.com" match pattern should match al...

URL naming conventions

So, this may be a can of worms. But I'm curious what your practices are? For example, let's say your website consists of the following needs (very basic): A landing page An information page for an event (static) A listing of places for that event (dynamic) An information page for each place With that said, how would you design your ...

Php is stripping one letter "g" from my rtrim function but not other chars

I'm trying to trim some youtube URLs that I am reading in from a playlist. The first 3 work fine and all their URLs either end in caps or numbers but this one that ends in a lower case g is getting trimmed one character shorter than the rest. for ($z=0; $z <= 3; $z++) { $ythref2 = rtrim($tubeArray["feed"]["entry"][$z]["link"...

Django - problem with {% url facebook_xd_receiver %}

I'm using {% url facebook_xd_receiver %} in one of my HTML files. This works just fine when I run my project using the command python manage.py runserver But the same project stops running and gives me a "TemplateSyntaxError" at the line {% url facebook_xd_receiver %} Can anyone please tell me what could be the difference betwe...

working on django development server but not on apache

i am facing an issue with the apache server, we have written the code, in which if the url entered in the form field is valid it will display an error message, when i run the code through django developement server it works fine, displays the error message, but when running through apache, then does not show the error message just return...

Unable to aquire image through ImageIO.read(url) because of connection timed out.

Following code always fails URL url = new URL("http://userserve-ak.last.fm/serve/126/8636005.jpg"); Image img = ImageIO.read(url); System.out.println(img); I've manually checked the url, and it is valid, and contains a valid jpg image. The problem I get is; Exception in thread "main" javax.imageio.IIOException: Can't g...

J2EE Centralized URLrepository Sharepoint

Friends I am going through this pain of remembering all urls or adding it to my favorites every time there is a release or search for the urls in mailbox when needed it is confusing all the time. We have around 25 apps which we use regularly in our daily work and its growing. I have this idea to develop little J2EE app or a work flow wh...

How to add a local image in my firefox entension?

I am developing a firefox extension and create a table and in it add a image , and I create a image with : var _img = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "xul:image"); and then I found I couldn't set its attribute "src" with a local image just like use its Url: chrome:\...., so I ha...

Regular expression to use which matches text before .html and after /

With this string http://sfsdf.com/sdfsdf-sdfsdf/sdf-as.html I need to get sdf-as with this hellow-1/yo-sdf.html I need yo-sdf ...

Closing inputstreams

I have the below code to read from a URL object: URL url= new URL("http://datasource.com"); BufferedReader reader = new BufferedReader( new InputStreamReader(url.openStream())); After I am done getting the data, is this sufficient to close and release all the resrouces: reader.close(); I did not...

Rails / omitted from link_to?

Hi Everyone, I am using a Gem to communicate with FreeagentCentral via their API. I have the following code to display a link to the relevant freeagent project: <%= link_to "#{image_tag('/images/icons/Spinning Beach Ball.png')} Freeagent Project", "#{Freeagent::Base.site.to_s + Freeagent::Project.element_path(@kase.freeagent_id).gsub(...

Naming a file downloaded from url in iPhone

I would like to save a file downloaded from the internet in iPhone. Can I use the url as the file name? If not, what transformation should I apply to the url to obtain a valid file name? I need to find the local copy of the file later using its url. Edit: Not asking where or how to write a file to disk. The question is limited to get...

Appending empty query string param to the URL in Rails

Is there a way to append something to the query string with no value set? I would like to see this kind of URL being generated: http://local/things?magic. What I'm looking for is when the user goes to http://local/other?magic then every URL in the generated page would contain magic in the end. Following code is almost a solution but i...

What's the correct way to use Cakephp urls?

Hello all, it's my first post here :) I'm having some difficulties with dealing with urls and parameters. I've gone through the router class api documentation over and over again and found nothing useful. First of all, I'd like to know if there is any 'universal' format in CakePHP(1.3) for handling urls. I'm currently handling all my u...

Get page permalink and title outside the loop in wordpress

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 pos...

How to match the last url in a line containing multiple urls, using regular expressions?

I want to write a regex that matches a url that ends with ".mp4" given that there are multiple urls in a line. For example, for the following line: "http://www.link.org/1610.jpg","Debt","http://www.archive.org/610_.mp4","66196517" Using the following pattern matches from the first http until mp4. (http:\/\/[^"].*?\.mp4)[",].*? Ho...

.htacces to create friendly URLs. Help needed....

Hi, I'm having a hard time with .htacces. I want to create friendly URLs for a site I'm working on... Basically I want to convert this: http://website.com/index.php?ctrl=pelicula&amp;id=0221889 http://website.com/index.php?ctrl=pelicula&amp;id=0160399&amp;tab=posters Into this: http://website.com/pelicula/0221889/ http://website.com...

What causes a URL loop/forward in Glassfish v2.1?

Hi All, I have configured a centos 5.4 virtual box to run the liferay portal manager on a Glassfish v2.1 application server. Even though this is not recommended I gave glassfish root privileges and am allowing to listen on port 80.(I did this because of a nightmarish experience with mod_jk although the behavior that was frustrating there...