i have a STRING in C# with a long url such as:
http://mysite.com/testing/testingPages/area/ten/p1.aspx
how can i use system.uri class to get the http://mysite.com part only ?
I'm trying to load up xml into an XmlDocument, but it doesn't recognize the encoded 'é' and throws an error 'An error occurred while parsing Entity Name'. Now I can add a custom entity set in a DTD of my xml, so the XmlDocument loads properly. But what I'm hoping is that I can reference a url that has a common set of these ISO Latin encoded characters. Is this possible, or do I need to inject a custom list of DTD sets?
how can i construct a artificial request to login to twitter or any site for that matter that accpets post forms.
what i've been trying is to extract the headers and post request parameters from the origional request(directed at the action atribute of the form) and copy it to the outgoing url object that i am making.but it just won't work.
And i am aware of the apis and i don't wanna use them i am trying this to write a web proxy site.
Hi,
I'm trying to use the header() function to create a redirect. I would like to display an error message. Currently I'm sending the message as a parameter through the URL, however this makes it look quite ugly.
Is there a way to pass this value as a post variable instead?
Any advice appreciated.
Thanks.
What is the recommended way of setting GET query parameters on a Restlet Request object?
I think I can see how to get them out of the request using getQueryAsForm(), but how do they get set in the first place?
At the moment, I am adding them manually to the URL using a StringBuilder and java.net.URLEncoder, but it seems like there should be a better way.
I have an li navigation with dividers created using the code shown below. I'd like to have two of these | elements but different colours, is it possible to define different colours for both?
#navigation li:before {
content: "|";
color: #800836;
}
I'd like another but with #F2659A and right next to the existing.
Here is the live url to see how things look right now:
http://www.jordancharters.co.uk/nakedradish/
i m using phptube class for downloading you tube video.
from this site
In code i paste youtube url on a input box but there is errors below.
Warning: file_get_contents(http://www.youtube.com/get_video?video_id=&t=)
[function.file-get-contents]: failed to open stream: HTTP request failed!
HTTP/1.0 404 Not Found
and
Warning: file_put_contents(./flvs/3Hx9VsqMUug.flv) [function.file-put-contents]:
failed to open stream: No such file or directory in E:\xampp\htdocs\vdo\utube
\functions.php on line 19
path:./flvs/3Hx9VsqMUug.flv
please tell me where is problem???
i've tried using this code and this to make a random quote generator, but it doesn't display anything. my questions are:
what is wrong with my code?
in the above tut, the quote is generated on a button click, i'd like
a random quote to be displayed every
30 mins automatically. how do i do
this?
////////////////////////
quote.html:
<!DOCTYPE html>
<script src="ajax.js" type="text/javascript"></script>
<body>
<!–create the div for the quotes land–>
<div id="quote"><strong>this</strong></div>
<div><a style="cursor:pointer" onclick="run_query();">Next quote …</a></div>
</body>
</html>
/////////////////////
quote.php:
<?php
include 'config.php';
// 'text' is the name of your table that contains
// the information you want to pull from
$rowcount = mysql_query("select count(*) as rows from quotes");
// Gets the total number of items pulled from database.
while ($row = mysql_fetch_assoc($rowcount))
{
$max = $row["rows"];
}
// Selects an item's index at random
$rand = rand(1,$max)-1;
$result = mysql_query("select * from quotes limit $rand, 1");
$row = mysql_fetch_array($result);
$randomOutput = $row['storedText'];
echo '<p>' . $randomOutput . '</p>';
////////////
ajax.js:
var xmlHttp
function run_query() {
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) {
alert ("This browser does not support HTTP Request");
return;
} // end if
var url="quote.php";
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} //end function
function stateChanged(){
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
document.getElementById("quote").innerHTML=xmlHttp.responseText;
} //end if
} //end function
function GetXmlHttpObject() {
var xmlHttp=null;
try {
// For these browsers: Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}catch (e){
//For Internet Explorer
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
} //end function
$.ajax({
url: "/cgi-bin/stats.exe",
method: "post",
async: false,
data: { refresh: "a41" }
});
Using ajax post synchronously - "async: false".
While it blocks the browser during the active request, what is the most efficient way to change the cursor to the hourglass or display a wait .gif?
Perhaps set the cursor as it enters this function then change it back in the success or complete function?
Any advice is appreciated.
Thank You.
hello all
I want to repeat a background-image for a div vertically till the bottom of the page.
#repeat {
background: url(repeat-image.png) repeat-y;
height: 100%; /* this does not work, but height: 1024px; does */
}
This does not work. I need to do so according to the page design that I have got. Can this be done?
With regards
Vikram
How can create simple PHP Search Engine Submission tool, which allows that to submit the site URL to multiple search engines such as "http://www.google.com/addurl?q=www.yoursite.com&hl=&dqq=" and also "http://www.bing.com/webmaster/SubmitSitePage.aspx" or any other other search engines?
We are building an app that accesses the Twitter search over JSONP.
It mostly works fine, but occasionally the request returns a JSONP callback that exists of weird unparseable characters.
Here is an example: http://search.twitter.com/search.json?result_type=recent&rpp=100&geocode=51.4375857,-0.1658648,1km&page=5&callback=jsonp1272532482854
(If you change page=5 to a value less than 5 in the URL it works fine)
So
Am I doing something wrong?
Can anyone suggest a workaround?
I'm working with code igniter and for some reason, the url http://mysite.com/account/100 gives me a 404 error. Here's what my controller looks like.
class account extends Controller {
function account()
{
parent::Controller();
}
function index()
{
echo $this->uri->segment(2);
}
Any idea what's wrong?
I tried to clone beta.neighborrow.com - i copied the directory file for file but im getting this error on the new url instillbliss.neighborrow.com
Warning: require(cake/basics.php) [function.require]: failed to open stream: No such file or directory in /home/neighborrow/instillbliss.neighborrow.com/index.php on line 53
Fatal error: require() [function.require]: Failed opening required 'cake/basics.php' (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear:/home/neighborrow/instillbliss.neighborrow.com:/home/neighborrow/instillbliss.neighborrow.com/app/') in /home/neighborrow/instillbliss.neighborrow.com/index.php on line 53
I there a way to render a html page without having a vide model in django? If a page is going to display static html?
Also, can I redirect to a html page instead of a url. For example, instead of doing this
return HttpResponseRedirect('form/success/')
can I do this
return HttpResponseRedirect('success.html')
I have a link. I have checked that the link is a valid URL through regular expressions. Now, I want to check if the link is a valid http link or not. i.e. it should not be a non-existing link.
Is there a way in VC++ 6.0 (MFC) to check that?
Hello there,
As you may know, res.sendRedirect(url) on the servlet side does not work because the GWT client does not process it.
Does anybody knows how to do this?
Thanks you.
Daniel
Hi, thanks for looking.
I know you can't redirect anchor URLs to another page, but is it possible to redirect a URL to only a single anchor?
So
http://www.example.com/video/{title}
always gets sent to
http://www.example.com/video.php?title={title}#player
The only thing that changes is the title, anchor is always the same... I need to redirect to a certain slide on a coda slider
Hi ,
I am doing the small application for link exchange,
so before i approve the URL , i want to check his/her site page rank,
I know , there some site tell the Google page rank position ,
But am looking some API , for page rank checking...
Thanks
Bharanikumar
I would like to use a switch for the layout of paragraph tags on a webpage.
I use the after pseudoelement
p:after {content: url("../img/paragraph.gif");}
Now i need to remove this css code from the page. How can this be done easily (jquery is already used on the page)? (i do not want to include or remove files containing css)
Hi,
I am aware of this question already existing, but it has given me no luck.
I have an application which loads a physicial XML document via the following method:
jQuery.ajax( {
type: "GET",
url: fileName,
dataType: "xml",
success: function(data) {
etc...
I parse the XML and convert it into a string which is saved into a variable so that it can easily be stored in a database. How can I now convert the data in this variable back into an XML object so that it can be parsed as such?
I allow the user to record a video within my app, then later play it again. When a user records a video, I save the URL of the video, then play the video later from the saved URL. I save the video both in the Photos app and in my app. If I delete the video within the photos app, it still plays. After about 7 days, the video gets deleted. I think I am saving in my tmp directory, but i'm not sure. Here is what I am doing:
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType];
[self dismissViewControllerAnimated:YES completion:nil];
// Handle a movie capture
if (CFStringCompare ((__bridge_retained CFStringRef) mediaType, kUTTypeMovie, 0) == kCFCompareEqualTo) {
NSString *moviePath = [NSString stringWithFormat:@"%@",[[info objectForKey:UIImagePickerControllerMediaURL] path]];
NSURL *videoURL = [info objectForKey:UIImagePickerControllerMediaURL];
NSData *videoData = [NSData dataWithContentsOfURL:videoURL];
_justRecordedVideoURL = [NSString stringWithFormat:@"%@",videoURL];
AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
_managedObjectContext = [appDelegate managedObjectContext];
Video *video = [NSEntityDescription insertNewObjectForEntityForName:@"Video" inManagedObjectContext:_managedObjectContext];
[video setVideoData:videoData];
[video setVideoURL:[NSString stringWithFormat:@"%@",videoURL]];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.dateStyle = NSDateFormatterLongStyle;
[dateFormatter setDateStyle:NSDateFormatterLongStyle];
NSDate *date = [dateFormatter dateFromString:[dateFormatter stringFromDate:[NSDate date]]];
NSString *dateAdded = [dateFormatter stringFromDate:date];
[video setDate_recorded:dateAdded];
if(_currentAthlete != nil){
[video setWhosVideo:_currentAthlete];
}
NSError *error = nil;
if(![_managedObjectContext save:&error]){
//handle dat error
}
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *tempPath = [documentsDirectory stringByAppendingFormat:@"/vid1.mp4"];
BOOL success = [videoData writeToFile:tempPath atomically:NO];
if(success == FALSE){
NSLog(@"Video was not successfully saved.");
}
if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(moviePath)) {
UISaveVideoAtPathToSavedPhotosAlbum(moviePath, self,
@selector(video:didFinishSavingWithError:contextInfo:), nil);
}
}
}
Am I saving it incorrectly? When I go to play the video, it works fine, after a couple days the video will play without audio, then eventually it will be gone. Any ideas why?
What will be proper regular expression for git repositories?
example link:
[email protected]:someone/someproject.git
so it will be like
server can be url or ip
Project can contain some other characters than alphanumeric like '-'
I'm not sure what is the role of '/'
any suggestions?
so this is really weird to me but my code works properly for getting the geolocation if I run my code locally in the simulator, If I have the code on my server it does not work in the simulator, yet the same url and code on my server works on my actual iphone? It seems to not pick up on the geolocation javascript when its on my server in the simulator?