Who can show me how I must use declarative_authorization (http://github.com/stffn/declarative_authorization) with restfult_authentication (http://github.com/technoweenie/restful-authentication)?
How do I add let's say something like ajax=1 to all links on my page with jquery. I will also need to check if the url has existing parameters. for example "http://mysite.com/index.php?pl=132" will have to become "http://mysite.com/index.php?pl=132&ajax=1"
Also, if the link does not have any parameters, for example "http://mysite.com/index.php", it will become "http://mysite.com/index.php?ajax=1" I want to load the jquery script on document ready so all links are changed on page load.
Thanks.
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.
I need an javascript that can be placed on header that recognizes an youtube embed or iframe player and replaces it by a tumbnail linked to the vídeo on youtube.
The script should identifies an code like this ones:
<object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/J4oJWUJpbLY?fs=1&hl=pt_BR&hd=1&color1=0x5d1719&color2=0xcd311b"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/J4oJWUJpbLY?fs=1&hl=pt_BR&hd=1&color1=0x5d1719&color2=0xcd311b" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>
<iframe title="YouTube video player" class="youtube-player" type="text/html" width="560" height="345" src="http://www.youtube.com/embed/J4oJWUJpbLY?hd=1" frameborder="0"></iframe>
And replace by it:
<a href="http://www.youtube.com/watch?v=n1VCUF2xqKk" target="_blank"><img src="http://img.youtube.com/vi/n1VCUF2xqKk/default.jpg" alt="" /></a>
Look that the variable is the video ID.
It is possible?
Hi All:
I have an issue with not getting the correct relative url.
Right now, say my home page is at (please ignore quotation)
"http://www.foo.com/user/home"
I have links on the homepage that should go to
"http://www.foo.com/user/home/page1"
but right now I'm getting
"http://www.foo.com/page1"
Everything worked locally, can this be fixed with modifying .htaccess and how? Thank you.
I'm trying to redirect one domain to the root and another to a directory. The problem I'm having is the second domain is overwriting the firsts redirection.
Here is what I have.
RewriteEngine On
RewriteCond %{HTTP_HOST} !^http://example.site.net$ [NC]
RewriteCond %{REQUEST_URI} !^/.*$
RewriteRule ^(.*)$ / [L]
RewriteEngine On
RewriteCond %{HTTP_HOST} !^http://example2.com [NC]
RewriteCond %{HTTP_HOST} !^http://www.example2.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{REQUEST_URI} !^/example2_directory/
RewriteRule ^(.*)$ /example2_directory/$1
Cross posting from http://social.msdn.microsoft.com/Forums/en-US/windowsazuretroubleshooting/thread/31b6aedc-c069-4e32-8e8f-2ff4b7c30793
I'm getting this error on changing configuration through the service management API: The request body XML was invalid or not correctly specified
The request body payload:
<?xml version="1.0" encoding="utf-8"?>
<ChangeConfiguration xmlns="http://schemas.microsoft.com/windowsazu
re">
<Configuration>PD94bWwgdmVyc2lvbj0iMS4wIj8+CjxTZXJ2aWNlQ29uZmlndX
JhdGlvbiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIi
B4bWxuczp4c2Q9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIiB4bWxucz0iaHR0cDovL3
NjaGVtYXMubWljcm9zb2Z0LmNvbS9TZXJ2aWNlSG9zdGluZy8yMDA4LzEwL1NlcnZpY2VDb25maWd1cm
F0aW9uIiBzZXJ2aWNlTmFtZT0iIiBvc0ZhbWlseT0iMSIgb3NWZXJzaW9uPSIqIj4KICA8Um9sZSBuYW
1lPSJXZWJSb2xlMSI+CiAgICA8Q29uZmlndXJhdGlvblNldHRpbmdzPgogICAgICA8U2V0dGluZyBuYW
1lPSJNaWNyb3NvZnQuV2luZG93c0F6dXJlLlBsdWdpbnMuRGlhZ25vc3RpY3MuQ29ubmVjdGlvblN0cm
luZyIgdmFsdWU9IlVzZURldmVsb3BtZW50U3RvcmFnZT10cnVlIi8+CiAgICA8L0NvbmZpZ3VyYXRpb2
5TZXR0aW5ncz4KICAgIDxJbnN0YW5jZXMgY291bnQ9IjIiLz4KICAgIDxDZXJ0aWZpY2F0ZXMvPgogID
wvUm9sZT4KPC9TZXJ2aWNlQ29uZmlndXJhdGlvbj4K</Configuration>
</ChangeConfiguration>
I'm passing it the following configuration:
$configuration = '<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" serviceName="" osFamily="1" osVersion="*">
<Role name="WebRole1">
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true"/>
</ConfigurationSettings>
<Instances count="2"/>
<Certificates/>
</Role>
</ServiceConfiguration>';
Does anyone know why this error occurs? I suspect it has something to do with encoding but not sure.
I want to add the like button on my website, but it does not work because whenever I click on Like button it says:
The page at could not be reached.
You can also check the url to see the error:
My Facebook page
Here is what I did to use the code:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#">
<head>
<meta property="og:title" content="ALEXA BEAUTY" />
<meta property="og:type" content="company" />
<meta property="og:url" content="http://alexasalon.co.uk/" />
<meta property="og:image" content="http://alexasalon.co.uk/images/logo.png" />
<meta property="og:site_name" content="ALEXA BEAUTY" />
<meta property="fb:admins" content="100002556535323" />
</head>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=220687968005095";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div>
<fb:like href="http://www.facebook.com/pages/Alexa-Beauty/205401152839187" send="true" width="450" show_faces="false" font="lucida grande"></fb:like>
</div>
Is the code wrong? Is the page URL correct?
I checked the website on Object Debugger and seems there is no error, check link please.
I really do not know what is wrong? Does anyone know?!
I'd like to run a script on release that replaces all url() declarations in a css file with the full domain path, because images are hosted on a static web server.
Example
Current: background-image: url(/images/menu.gif);
Desired: background-image: url(http://example.com/images/menu.gif);
Current: background-image: url('/images/menu.gif');
Desired: background-image: url('http://example.com/images/menu.gif');
Current: background-image: url("/images/menu.gif");
Desired: background-image: url("http://example.com/images/menu.gif");
I have concocted a bash script using sed to do just that, but it does not handle url with quotes url(''), or urls that already have a full path.
STATIC_HOST="http://example.com"
sed -i '' "s|url(\([^)]*\)|url($STATIC_HOST\1|g" main.css
I am looking fr someone to make me two website templates for my site for free.
Here is a quick design of what I want:(Took me 2 minutes in Paint)
http:/ /i50.tinypic.com/33p9aut.jpg (You have to push backspace on the first link to join up the http:/ and the other /)and http://i50.tinypic.com/2qmogoo.jpg
Email me at [email protected] or [email protected] for more information
Starting from an Html input like this:
<p>
<a href="http://www.foo.com">this if foo</a>
<a href="http://www.bar.com">this if bar</a>
</p>
using BeautifulSoup, i would like to change this Html in:
<p>
<a href="http://www.foo.com">this if foo</a><b>OK</b>
<a href="http://www.bar.com">this if bar</a><b>OK</b>
</p>
Is it possible to do this using BeautifulSoup?
So Google takes:
http://www.mysite.com/mypage/#!pageState
and converts it to:
http://www.mysite.com/mypage/?_escaped_fragment_=pageState
...So... Would be it fair game to redirect that with a 301 status to something like:
http://www.mysite.com/mypage/pagestate/
and then return an HTML snapshot?
My thought is if you have an existing html structure, and you just want to add ajax as a progressive enhancement, this would be a fair way to do it, if Google just skipped over _escaped_fragment_ and indexed the redirected URL. Then your ajax links are configured by javascript, and underneath them are the regular links that go to your regular site structure.
So then when a user comes in on a static url (ie http://www.mysite.com/mypage/pagestate/ ), the first link he clicks takes him to the ajax interface if he has javascript, then it's all ajax.
On a side note does anyone know if Yahoo/MSN onboard with this 'spec' (loosely used)? I can't seem to find anything that says for sure.
Hi I am trying to learn JAVA deeply and so I am digging into the JDK source code in the following lines:
URL url = new URL("http://www.google.com");
URLConnection tmpConn = url.openConnection();
I attached the source code and set the breakpoint at the second line and stepped into the code. I can see the code flow is: URL.openConnection() - sun.net.www.protocol.http.Handler.openConnection()
I have two questions about this
First In URL.openConnection() the code is:
public URLConnection openConnection() throws java.io.IOException {
return handler.openConnection(this);
}
handler is an object of URLStreamHandler, define as blow
transient URLStreamHandler handler;
But URLStreamHandler is a abstract class and method openConnection() is not implement in it so when handler calls this method, it should go to find a subclass who implement this method, right? But there are a lot classes who implement this methods in sun.net.www.protocol (like http.Hanlder, ftp.Handler ) How should the code know which "openConnection" method it should call? In this example, this handler.openConnection() will go into http.Handler and it is correct. (if I set the url as ftp://www.google.com, it will go into ftp.Handler) I cannot understand the mechanism.
second. I have attached the source code so I can step into the JDK and see the variables but for many classes like sun.net.www.protocol.http.Handler, there are not source code in src.zip. I googled this class and there is source code online I can get but why they did not put it (and many other classes) in the src.zip? Where can I find a comprehensive version of source code?
Thanks!
Here is html:
<a href="http://site.com/any/different/folders/picture_name.jpg">Go and win</a>
<a href="http://site.com/not/similar/links/some_other_name.png">Go and win</a>
How to add some text after last "/" in href attribute (before picture_name.jpg) of each link?
The script should give something like:
<a href="http://site.com/any/different/folders/user_picture_name.jpg">Go and win</a>
<a href="http://site.com/not/similar/links/user_some_other_name.png">Go and win</a>
Here user_ is added.
There can be any length of the link.
I'm trying to make an url that adds a / to all hrefs and srcs in a string.
It should only add a / to urls that don't have a http:// at their beginning and that don't have / yet also.
If we have this:
<a href="ABC">...
<img src="DEFG">...
<a href="/HIJ">...
<a href="http://KLMN">...
The results should be something like this:
<a href="/ABC">...
<img src="/DEFG">...
<a href="/HIJ">...
<a href="http://KLMN">...
This is what i've come up till now:
&(href|src)="?!(\/|http::\/\/)(.+)"
And the replace would be
$1="/$2"
It isn't working, though.
What am I doing wrong?
How would the working regex have to look like
This question is about javascript performance. Consider 3 examples for illustration:
function loadImgA() {
new Image().src="http://example.com/image.gif"
}
function loadImgA1() {
Image().src="http://example.com/image.gif"
}
function loadImgB() {
var testImg = new Image();
testImg.src="http://example.com/image.gif"
}
Now the point is I don't really need to manipulate the the image object after it was created, hence loadImgA(). The question is, what happens if nothing is assigned to the return value of the new Image() constructor - in that case I can actually skip the 'new' keyword as in loadImgA1()? Does the object then live outside the function or somehow affects memory usage? Other implications, differences? I reckon not, as no real instance was actually created?
To put this into perspective, I only need to get the http request for image through. No preloading or other advanced image manipulation. What would be the preferred method from the above?
Hi guys.
I have :
<a href="http://abc.com">Title</a>
And :
<a href="http://xyz.com">Title</a>
I want to replace link to text "Title", but only from http://abc.com. But I don't know how ( I tried Google ), can you explain for me. I'm not good in PHP.
Thanks in advance.
I have a form and I can't get my links to generate. The next button is supposed to light up followed by a bit of text.
How it's supposed to work: http://jsfiddle.net/zMQcn/
The one that doesn't work: http://jsfiddle.net/Yq8Qf/
document.getElementById("linkDiv").innerHTML="<input type=button value=Next onclick=\"window.location.href='http://yahoo.com/';\">other 8b white</input>";
}
Hi,
I have the following in my .htaccess file:
RewriteCond %{QUERY_STRING} ^route\=product\/category\&path\=35\&page\=([0-9]+)$
RewriteRule ^index.php$ http://%{HTTP_HOST}/product/category/35/page_$1? [R=301,L]
It's not behaving as expected though, when I enter the URL:
http://mywebsite.com/index.php?route=product/category&path=35&page=2
It gets rewritten to:
http://mywebsite.com/product/category/35/page_
Could someone tell me what I have done wrong please?
Thanks,
eb_dev