Search Results

Search found 2390 results on 96 pages for 'intelligent agent'.

Page 82/96 | < Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >

  • Ajax Request using jQuery in Rails

    - by Steve
    Hi... I am sending an Ajax Request using jQuery. What happens is that I am getting an "405 Method Not Allowed" Error. I am just posting a form, which would get the detail from the form and insert it into the DB. Just the usual stuff.I am using WEBrick that comes as default with the rails package. Can somebody please tell me how to fix this. This is the code that triggers the Ajax Request $.post($(this).attr("action") + ".js",$(this).serialize(),null,"script"); Response Headers Cache-Control no-cache Allow GET, PUT, DELETE Content-Type text/html; charset=utf-8 Content-Length 9502 Server WEBrick/1.3.1 (Ruby/1.9.1/2009-12-07) Date Wed, 02 Jun 2010 20:41:33 GMT Connection Keep-Alive Request Headers Host localhost:3000 User-Agent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 Accept application/json, text/javascript, */* Accept-Language en-us,en;q=0.5 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive 115 Connection keep-alive Content-Type application/x-www-form-urlencoded; charset=UTF-8 X-Requested-With XMLHttpRequest Referer http://localhost:3000/viewspot/3 Content-Length 141 Pragma no-cache Cache-Control no-cache

    Read the article

  • javascript :Object doesn't support this property or method

    - by Kaushik
    In my jsp page, I have in the tag, the following code: <script type="text/javascript" src="<%=request.getContextPath()%>/static/js/common/common.js"></script> <script type="text/javascript"> // Function for Suppressing the JS Error function silentErrorHandler() {return true;} window.onerror=silentErrorHandler; </script> If there is some javascript executing on the jsp page after this, then I guess silentErrorHandler() will have no effect. i.e. the error will still show on page. IS this correct? Because the error is showing and am not sure why. The second part of the question is this: The error is Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; AskTbFXTV5/5.9.1.14019) Timestamp: Fri, 7 Jan 2011 21:26:23 UTC Message: Object doesn't support this property or method Line: 613 Char: 1 Code: 0 URI: http://localhost:9080/Claris/static/js/common/common.js And finally, line 613 states document.captureEvents(Event.MOUSEUP); There is error on IE8. Runs fine on Mozilla and IE7. Any suggestions will be very helpful

    Read the article

  • Why this C# Regular Expression crashes my program?

    - by robert_d
    using System; using System.IO; using System.Net; using System.Text.RegularExpressions; namespace Working { class Program4 { static string errorurl = "http://www.realtor.ca/propertyDetails.aspx?propertyId=8692663"; static void Main(string[] args) { string s; s = getWebpageContent(errorurl); s = removeNewLineCharacters(s); getFields(s); Console.WriteLine("End"); } public static void getFields(string html) { Match m; string fsRE = @"ismeasurement.*?>.*?(\d+).*?sqft"; m = Regex.Match(html, fsRE, RegexOptions.IgnoreCase); } private static string removeNewLineCharacters(string str) { string[] charsToRemove = new string[] { "\n", "\r" }; foreach (string c in charsToRemove) { str = str.Replace(c, ""); } return str; } static string getWebpageContent(string url) { WebClient client = new WebClient(); client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"); Stream data = client.OpenRead(url); StreamReader reader = new StreamReader(data); string s = reader.ReadToEnd(); data.Close(); reader.Close(); return s; } } } This program hangs. It runs correctly when I remove RegexOptions.IgnoreCase option or when I remove call to removeNewLineCharacters() function. Could someone tell me what is going on, please?

    Read the article

  • protect form hijacking hack

    - by Karem
    Yes hello today I discovered a hack for my site. When you write a msg on a users wall (in my communitysite) it runs a ajax call, to insert the msg to the db and will then on success slide down and show it. Works fine with no problem. So I was rethinking alittle, I am using POST methods for this and if it was GET method you could easily do ?msg=haxmsg&usr=12345679. But what could you do to come around the POST method? I made a new html document, made a form and on action i set "site.com/insertwall.php" (the file that normally are being used in ajax), i made some input fields with names exactly like i am doing with the ajaxcall (msg, uID (userid), BuID (by userid) ) and made a submit button. I know I have a page_protect() function on which requires you to login and if you arent you will be header to index.php. So i logged in (started session on my site.com) and then I pressed on this submit button. And then wops I saw on my site that it has made a new message. I was like wow, was it so easy to hijack POST method i thought maybe it was little more secure or something. I would like to know what could I do to prevent this hijacking? As i wouldnt even want to know what real hackers could do with this "hole". The page_protect secures that the sessions are from the same http user agent and so, and this works fine (tried to run the form without logging in, and it just headers me to startpage) but yea wouldnt take long time to figure out to log in first and then run it. Any advices are appreciated alot. I would like to keep my ajax calls most secure as possible and all of them are running on the POST method. What could I do to the insertwall.php, to check that it comes from the server or something.. Thank you

    Read the article

  • Laravel - Mail class Exception

    - by Christian Giupponi
    I need to send email within my app and this is my code: if( $agent->save() ) { //Preparo la mail da inviare con i dati di login $data = [ 'nome' => $input['nome'], 'cognome' => $input['cognome'], 'email' => $input['email'], 'password' => $input['password'] ]; //ATTENZIONE //Questo è da rimuovere in produzione, finge di inviare la mail Mail::pretend(); //Recuero il template e passo alla funzione i dati Mail::send('emails.agents.registration', $data, function($message) use ($data) { $message->to( $data['email'], $data['nome'].' '.$data['cognome'] )->subject('Benvenuto!'); }); return Redirect::action('admin.agents.index')->with('positive_flash_message', 'Agente inserito correttamente.'); } As you can see I have use the Mail::pretend to avoid the email send in development, the problem is that I get this error every time I try to send an email: Undefined property: Illuminate\Mail\Message::$email (View: /var/www/progetti/app/views/emails/agents/registration.blade.php) nd this is my blade view: Email: {{ $message->email }} Password: {{ $message->password }} What's wrong with $message?

    Read the article

  • CURL C API: callback was not called

    - by Pierre
    Hi all, The code below is a test for the CURL C API . The problem is that the callback function write_callback is never called. Why ? /** compilation: g++ source.cpp -lcurl */ #include <assert.h> #include <iostream> #include <cstdlib> #include <cstring> #include <cassert> #include <curl/curl.h> using namespace std; static size_t write_callback(void *ptr, size_t size, size_t nmemb, void *userp) { std::cerr << "CALLBACK WAS CALLED" << endl; exit(-1); return size*nmemb; } static void test_curl() { int any_data=1; CURLM* multi_handle=NULL; CURL* handle_curl = ::curl_easy_init(); assert(handle_curl!=NULL); ::curl_easy_setopt(handle_curl, CURLOPT_URL, "http://en.wikipedia.org/wiki/Main_Page"); ::curl_easy_setopt(handle_curl, CURLOPT_WRITEDATA, &any_data); ::curl_easy_setopt(handle_curl, CURLOPT_VERBOSE, 1); ::curl_easy_setopt(handle_curl, CURLOPT_WRITEFUNCTION, write_callback); ::curl_easy_setopt(handle_curl, CURLOPT_USERAGENT, "libcurl-agent/1.0"); multi_handle = ::curl_multi_init(); assert(multi_handle!=NULL); ::curl_multi_add_handle(multi_handle, handle_curl); int still_running=0; /* lets start the fetch */ while(::curl_multi_perform(multi_handle, &still_running) == CURLM_CALL_MULTI_PERFORM ); std::cerr << "End of curl_multi_perform."<< endl; //cleanup should go here ::exit(EXIT_SUCCESS); } int main(int argc,char** argv) { test_curl(); return 0; } Many thanks Pierre

    Read the article

  • Resumable Upload in Ruby on Rails

    - by user253011
    Hi, I have been searching for a way for resumable file upload in RoR. In conclusion, I found out other than Java Applet no client-side-and-cross-platform agent can access the file system in such a way that to request the file from the position where the upload got terminated (due to any reason) with some exceptions like http://github.com/taf2/resume-up/tree/master (built in native Ruby, but requires google gears which is not "reliable" yet when it comes to cross platform almost same story as of ActiveX!) Since the only reliable option left is java applet, is there any good tutorial/forum/documentation for those paid java applets, such as "thin slice upload" etc. to make it work with rails application. I have found one http : // github . com / dassi / mediaclue , its a non-multi-ligual-German-Application in which they used jumploader. But in that application, I am unable to see resumable functionality. Scratching my head against their documentation, i found out http : // jumploader.com / doc_resume.html It tells that jumploader has resume functionality in Cross session resume, the one i am looking for (if the user close the browser the new session gets hold on uncompleted uploaded files from the old session against the user id). But I cant find any example on their demos page which actually pause/RESUME functionality in a continuous manner! Is it even possible to achieve that kind of resumable functionality. Please tell me about any options/example/demos preferable deployed in rails. I shall be very much obliged. ~ Thanks

    Read the article

  • Error in FireFox Loading Images

    - by Brian
    Hello, Details of the app are: ASP.NET project, local web server, hosted in IIS locally, using latest FireFox, uses forms authentication. I'm getting a logon user name/pwd box when trying to access my local web server. Using the net panel in firebug, I see the issue is with an animated GIF, showing up as 401 unauthorized. I check the details and this is what I see for this URL: http://localhost/<virtual>/Images/loading.gif I'm getting the following: Response Headers: Server Microsoft-IIS/5.1 Date Thu, 17 Jun 2010 19:02:58 GMT WWW-Authenticate Negotiate NTLM Connection close Content-Length 4046 Content-Type text/html Request headers: Host localhost User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 ( .NET CLR 3.5.30729; .NET4.0E) Accept image/png,image/*;q=0.8,*/*;q=0.5 Accept-Language en-us,en;q=0.5 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive 115 Connection keep-alive Referer <correct referer> Cookie ASP.NET_SessionId=ux4bt345qjz4p3u1wm1zgmez; .ASPXFormsAuth=33F12B444040827B8ABF154EE4EDE43B6CA532432EB846987B355097E00256DF0955C76A37BC593EAA961747BF1CC1D8949FF63C6F2CA69D77213EB15B4EDFAF57A83D9E1F88AB8D821C3A09C07EA2EE; .ASPROLES=qTFrGteJydYAE3118WGXbhJthTDdjdtuQ06t4bYVrM1BwIfcEHU1HhnEcs7TqSOaV-fIN5MH3uO57oNVWXDvrhkZ8gQuURuUk_K0TpoR-DEFXuF953Gl9aIilKAdV211jutMNQmhkt2rdPE2tEhHs3pz953fADxjAOyZl7K-AqNvMk3yqJshhKHhJIf-ALMhWIYlrrKy0WsYznUwh3WCtPfzEBD5XzmXU8HVMJ2-ArLjBISuegvSmxvK1PuXBPhoMRMi9Ynaw6xi9ypGk-R6uN0ljOMCGkB2-20WUlFuP0xWTfac_zCTDT00pbpnyjtygnM-LShOXTrZ_mhoRuXfKYEYSodNihwD6SRr19Nm-8uZ5BQ-W81svM17S2C0vc0FaxtiuAcN_vHcsN1OEJeCuVfRjeqzo9xWEViupP3Vh6aOcCm6yrftgw5x94piuCJO7tCfXjJAw5RVUWDBBWv5gmid171F0k-_XZ0CSv7Gm2Eai1BRfogAqQ_MV3tyPv7XVEyJXRXqYGlf1JpkfTW8S8On4E05v9gx9RcdnKHZebiOZwbP1_ho9nG7pMwXysbhjxtxwZ-zLx-v11_rhZw_i5m7iNcLtt4BbFU-sb_crzMpCKGywHIc452Zp1E0kx1Rfx-2eUnaiLiCfGed-QqelO88NYTpJHttGKEfhFrDgmaIXZPJRtuZ-GrS6t3Vla-8qDAVb1p6ovPwoVT4z4BhQyFsk542gDx-uQDw6D0B6zo7lXfcOjtolUxDcLbETsNlYsexZaxFpRSbw7M1ldwL_k92P9wLPlv9mw4NtyhXKJesMu7GjquZuoBN3hO00AqJEe1tKFFtfrvbE5ZH7uNu7myNdtlxRPe3WZe7qukbqHo1 Pragma no-cache Cache-Control no-cache Any ideas? Thanks.

    Read the article

  • Tell bots apart from human visitors for stats?

    - by Pekka
    I am looking to roll my own simple web stats script. The only major obstacle on the road, as far as I can see, is telling human visitors apart from bots. I would like to have a solution for that which I don't need to maintain on a regular basis (i.e. I don't want to update text files with bot-related User-agents). Is there any open service that does that, like Akismet does for spam? Or is there a PHP project that is dedicated to recognizing spiders and bots and provides frequent updates? To clarify: I'm not looking to block bots. I do not need 100% watertight results. I just want to exclude as many as I can from my stats. In know that parsing the user-Agent is an option but maintaining the patterns to parse for is a lot of work. My question is whether there is any project or service that does that already. Bounty: I thought I'd push this as a reference question on the topic. The best / most original / most technically viable contribution will receive the bounty amount.

    Read the article

  • Terminate function on System.in .. possible?

    - by Ronald
    I am currently working on a project where I have to make an agent to interact with a server. Each 50ms, the server will receive the last thing I outputted to System.out and send me a new set of lines as a 'state' through the System.in printstream to analyze and send my next message to System.out. Also, if the server receives multiple outputs from me, it only regards the most recent one. .. As for my question: My program originally constructed a tree and then analyzed each leaf node to see which would be optimal, and then waited around for the next input, but I can recursively do a deeper tree search that would make my output 'better' (and again and again to keep returning a better result). Using this and the fact that if the server receives multiple outputs, it only takes the most recent one, I could do each level, print my result and start the next level. But here comes my problem... I can't be stuck in some complex algorithm while I am supposed to receiving the next input as I will then miss it. So I was wondering if there is a way to cancel anything else I am doing when I receive something via System.in and then go back to the beginning of the function and start the search again with the new set of input (and rinse and repeat..) I hope this all makes sense, Thank ye all

    Read the article

  • Python - Problems using mechanize to log into a difficult website

    - by user1781599
    × 139886 I am trying to log in to betfair.com by using mechanize. I have tried several ways but it always fail. This is the code I have developed so far, can anyone help me to identify what is wrong with it and how I can improve it to log into my betfair account? Thanks, import cookielib import urllib import urllib2 from BeautifulSoup import BeautifulSoup import mechanize from mechanize import Browser import re bf_username_name = "username" bf_password_name = "password" bf_form_name = "loginForm" bf_username = "xxxxx" bf_password = "yyyyy" urlLogIn = "http://www.betfair.com/" accountUrl = "https://myaccount.betfair.com/account/home?rlhm=0&" # This url I will use to verify if log in has been successful br = mechanize.Browser(factory=mechanize.RobustFactory()) br.addheaders = [("User-Agent","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_5_8) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.90 Safari/537.1")] br.open(urlLogIn) br.select_form(nr=0) print br.form br.form[bf_username_name] = bf_username br.form[bf_password_name] = bf_password print br.form #just to check username and psw have been recorded correctly responseSubmit = br.submit() response = br.open(accountUrl) text_file = open("LogInResponse.html", "w") text_file.write(responseSubmit.read()) #this file should show the home page with me logged in, but it show home page as if I was not logged it text_file.close() text_file = open("Account.html", "w") text_file.write(response.read()) #this file should show my account page, but it should a pop up with an error text_file.close()

    Read the article

  • PHP Infine Loope Problem

    - by Ashwin
    function httpGet( $url, $followRedirects=true ) { global $final_url; $url_parsed = parse_url($url); if ( empty($url_parsed['scheme']) ) { $url_parsed = parse_url('http://'.$url); } $final_url = $url_parsed; $port = $url_parsed["port"]; if ( !$port ) { $port = 80; } $rtn['url']['port'] = $port; $path = $url_parsed["path"]; if ( empty($path) ) { $path="/"; } if ( !empty($url_parsed["query"]) ) { $path .= "?".$url_parsed["query"]; } $rtn['url']['path'] = $path; $host = $url_parsed["host"]; $foundBody = false; $out = "GET $path HTTP/1.0\r\n"; $out .= "Host: $host\r\n"; $out .= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0\r\n"; $out .= "Connection: Close\r\n\r\n"; if ( !$fp = @fsockopen($host, $port, $errno, $errstr, 30) ) { $rtn['errornumber'] = $errno; $rtn['errorstring'] = $errstr; } fwrite($fp, $out); while (!@feof($fp)) { $s = @fgets($fp, 128); if ( $s == "\r\n" ) { $foundBody = true; continue; } if ( $foundBody ) { $body .= $s; } else { if ( ($followRedirects) && (stristr($s, "location:") != false) ) { $redirect = preg_replace("/location:/i", "", $s); return httpGet( trim($redirect) ); } $header .= $s; } } fclose($fp); return(trim($body)); } This code sometimes go infinite loop. What's wrong here?

    Read the article

  • IIS6 throws error for jquery.

    - by user309557
    Hi, on my master page, I have referenced jquery file. I am doing simple hover function. When mouse hover, I change the css and when hover out, change the css back to originial. Nothing fancy. but my page throws jquery error when I run in IIS6 on server 2003. When I run on IIS5.1 on local xp machine, it works perfectly fine. Any idea? I access both pages from my machine so IE settings is not the problem. I opened the both js file and the error line is nothing but the end of the file ( i.e last line of the js file) Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1.4; OfficeLivePatch.1.3) Timestamp: Mon, 5 Apr 2010 21:59:18 UTC Message: Syntax error Line: 4377 Char: 2 Code: 0 URI: server-test/myapplication/Scripts/jquery-1.3.2.js (removed the link because stackoverflow does not allow me to put more than one link) Message: Syntax error Line: 6183 Char: 2 Code: 0 URI: server-test/myapplication/Scripts/jquery-1.3.2-vsdoc.js (removed the link because stackoverflow does not allow me to put more than one link) Message: Object expected Line: 189 Char: 9 Code: 0 URI: http://server-test/myapplication/

    Read the article

  • how close a connection from server side that created by ajax from client side

    - by saeid
    I have this sample php code: <?php function response($a) { @ob_end_clean(); header("Connection: close"); ob_start(); echo $a; $length = ob_get_length(); header("Content-Length: $length"); ob_end_flush(); flush(); } response("test1"); sleep(5); echo "test2"; ?> now I make a connection to server from client by ajax. now I want to server only send "test1" to me and then close the connection. but connection not closed and wait 5 seconds and send me "test1 test2" !! this is response headers from server to me : X-Powered-By: PHP/5.3.27 Connection: close Vary: Accept-Encoding,User-Agent Content-Encoding: gzip Cache-Control: private, no-cache, no-store, ------revalidate, no-transform Transfer-Encoding: chunked Content-Type: text/html in response headers I do not see Content-Length header. is problem for this ?? or if not what I must do now for solving problem ??

    Read the article

  • PHP session_write_close() keeps sending a set-cookie header

    - by Chiraag Mundhe
    In my framework, I make a number of calls to session_write_close(). Let's assume that a session has been initiated with a user agent. The following code... foreach($i = 0; $i < 3; $i++) { session_start(); session_write_close(); } ...will send the following request header to the browser: Set-Cookie PHPSESSID=bv4d0n31vj2otb8mjtr59ln322; path=/ PHPSESSID=bv4d0n31vj2otb8mjtr59ln322; path=/ There should be no Set-Cookie header because, as I stipulated, the session cookie has already been created on the user's end. But every call to session_write_close() after the first one in the script above will result in PHP instructing the browser to set the current session again. This is not breaking my app or anything, but it is annoying. Does anyone have any insight into preventing PHP from re-setting the cookie with each subsequent call to session_write_close? EDIT The problem seems to be that with every subsequent call to session_start(), PHP re-sets the session cookie to its own SID and sends a Set-Cookie response header. But why??

    Read the article

  • How do I access a value of a nested Perl hash?

    - by st
    I am new to Perl and I have a problem that's very simple but I cannot find the answer when consulting my Perl book. When printing the result of Dumper($request); I get the following result: $VAR1 = bless( { '_protocol' => 'HTTP/1.1', '_content' => '', '_uri' => bless( do{\(my $o = 'http://myawesomeserver.org:8081/counter/')}, 'URI::http' ), '_headers' => bless( { 'user-agent' => 'Mozilla/5.0 (X11; U; Linux i686; en; rv:1.9.0.4) Gecko/20080528 Epiphany/2.22 Firefox/3.0', 'connection' => 'keep-alive', 'cache-control' => 'max-age=0', 'keep-alive' => '300', 'accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'accept-language' => 'en-us,en;q=0.5', 'accept-encoding' => 'gzip,deflate', 'host' => 'localhost:8081', 'accept-charset' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7' }, 'HTTP::Headers' ), '_method' => 'GET', '_handle' => bless( \*Symbol::GEN0, 'FileHandle' ) }, 'HTTP::Server::Simple::Dispatched::Request' ); How can I access the values of '_method' ('GET') or of 'host' ('localhost:8081'). I know that's an easy question, but Perl is somewhat cryptic at the beginning.

    Read the article

  • Dynamically assign class to paragraph

    - by user1684300
    How do you assign a class dynamically to a paragraph (via javascript/CSS) IF the paragraph contains the wording "Time Recorded:"? You'll notice that I have manually assigned the with class . However, I'd like to dynamically assign this class to any tag which contain the words "Time Recorded:". Please can you help ? Thank you. PLJ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <link href="css.css" rel="stylesheet" type="text/css" /> </head> <body> <script type="text/javascript"> if (document.all || document.getElementById){ //if IE4 or NS6+ document.write('<style type="text/css">') document.write('.dyncontent{display:none;}') document.write('</style>') } </script> <div class="right"> <ul> <li class="say agent public"> <p>Description line 1</p> <p class="dyncontent">Time Recorded: 5MIN(S)</p> <p>Another description line</p> </li> </ul> </div> </body> </html>

    Read the article

  • View Source and Chrome Developer Tools showing different output

    - by patricksweeney
    I have a page located here. Viewing it in Chrome and Firefox show a really small h1 title, and also it changes color as if it is a link. The template that generates everything looks exactly how it should be. When diagnosing the issue, the relevant section of code looks like this when I go to view source: <div class="page-heading"> <h1>Title Here</h1> </div> However, when I go to view it in Chrome's Developer tools, it is throwing in extraneous malformed anchor tags, which is obviously causing the hovering behavior. This is what it looks like to the dev tools: <div class="page-heading"> <h1> <a style="font-family: arial; font-size: 9px" <="" a="">Title Here</a> </h1> </div> In addition, when viewing a local copy of the site, the output shown in the dev tools is the same as viewing the source and they both render correctly locally. Oddly enough, all version of IE render it correctly. The current version of both Chrome and Firefox both render it weirdly. Initially I thought it may be a user agent stylesheet problem, but if anything the CSS is fine, it's the HTML that is malformed.

    Read the article

  • Changing style sheets depending on useragent

    - by John Vasiliou
    <script language="Javascript"> var deviceIphone = "iPhone"; var deviceIpod = "iPod"; //Initialize our user agent string to lower case. var uagent = navigator.userAgent.toLowerCase(); //************************** // Detects if the current device is an iPhone. function DetectiPhone() { if (uagent.search(deviceIphone) > -1) {document.write('<link rel="stylesheet" type="text/css" href="ui/mobile/css/site.css">'); } etc... Above is the start of my code. I am trying to change the CSS file depending on what platform the user is using. I currently use media="screen ... " but it doesn't work with the amount of platforms I'm trying to use. I need something a lot more detailed/complex that is why I'm turning to useragents. Any ideas why the css file doesn't change on my iPhone using the above code? Better yet, any ideas on another way to change style sheets depending on the users platform/screen resolution?

    Read the article

  • Google Chrome forgetting registration cookie immediately

    - by Ryan Giglio
    I'm having trouble with cookies on my site's registration form. When a user creates an account, PHP sets one cookie with their user id, and one cookie with a hash containing their user agent and a few other things. Both of these cookies are set to expire in an hour. This is the code that sets the cookie after creating your account $registerHash = hash( "sha512", $_SERVER['HTTP_USER_AGENT'] . $_SERVER['HTTP_HOST'] . $_SERVER['DOCUMENT_ROOT'] ); setcookie("register_user_id", $newUserID, time() + 7200, "/"); setcookie("register_hash", $registerHash, time() + 7200, "/"); The next page is a confirmation page which sends an email and then optionally lets the user go on to fill out more account information. If the user goes on to fill out more, it uses the cookie to know what account to save it to. It works correctly in Firefox and IE, but in Chrome the cookie is forgotten as soon as you go to the next page. The cookie simply doesn't exist. You can see the problem here: http://crewinyourcode.com/register/paid/ If you use Chrome, you will get a registration timeout error as soon as you try to advance past the confirmation page. However on Firefox it works fine.

    Read the article

  • Application HANGS UP if 3G connection is used (WiFi is OK)

    - by SkyEagle888
    Hi, My application uses the following codes to connect to web site and download a web page for processing. HttpURLConnection c = (HttpURLConnection) url.openConnection(); c.setRequestMethod("GET"); c.setRequestProperty("User-Agent", "Mozilla/3.0 (compatible; MSIE 4.0; Windows NT)"); c.setRequestProperty("Accept-Language", "zh-hk"); c.setRequestProperty("Connection", "Keep-Alive"); c.setConnectTimeout(6000); // mTimeout is in seconds intTries = 3; do { c.connect(); if (c.getResponseCode() == 200) { break; } else { intTries --; } } while (intTries > 0); The codes are run in main thread only. If WiFi is being used, it is nice and clean. If 3G connection is being used, sometimes, it cannot get connected OR application HANGS. Is there any significant difference between handling WiFi and 3G ? Thanks.

    Read the article

  • Perl Cookie not working

    - by grosseskino
    Hi! I already spent all day looking for an answer for this: I am using Perl with LWP::UserAgent and HTTP::Cookies. My problem is that I can't get past an cookie-base age-check. In Perl I use this code: my $browser = LWP::UserAgent->new; my $resp = $browser->get( $url, 'User-Agent' => 'MySpider/1.0' ); #Cookie Setup my $cookies = HTTP::Cookies->new(); $cookies->set_cookie(1,'age_check', '1','/','.example.com/', 80, ,0,3354512128, 0); $browser->cookie_jar($cookies); The Site is setting the Cookie with JavaScript function saveSplash(domain) { var expDate = new Date(); expDate.setTime(expDate.getTime()+(1*24*3600*1000)); setCookie("age_check", 1, expDate, '/', domain); setCookie("screen_width", getScreenWidth(), expDate, '/', domain); } This is the Cookie saved by my browser: age_check 1 example.com/ 1088 3354512128 30140182 2646218624 30139981 Any idea what I am doing wrong? Thanks in advance guys!

    Read the article

  • QLearning and never-ending episodes

    - by devoured elysium
    Let's imagine we have an (x,y) plane where a robot can move. Now we define the middle of our world as the goal state, which means that we are going to give a reward of 100 to our robot once it reaches that state. Now, let's say that there are 4 states(which I will call A,B,C,D) that can lead to the goal state. The first time we are in A and go to the goal state, we will update our QValues table as following: Q(state = A, action = going to goal state) = 100 + 0 One of 2 things can happen. I can end the episode here, and start a different one where the robot has to find again the goal state, or I can continue exploring the world even after I found the goal state. If I try to do this, I see a problem though. If I am in the goal state and go back to state A, it's Qvalue will be the following: Q(state = goalState, action = going to A) = 0 + gamma * 100 Now, if I try to go again to the goal state from A: Q(state = A, action = going to goal state) = 100 + gamma * (gamma * 100) Which means that if I keep doing this, as 0 <= gamma <= 0, both qValues are going to rise forever. Is this the expected behavior of QLearning? Am I doing something wrong? If this is the expected behavior, can't this lead to problems? I know that probabilistically, all the 4 states(A,B,C and D), will grow at the same rate, but even so it kinda bugs me having them growing forever. The ideia of allowing the agent to continue exploring even after finding the goal has to do with that the nearer he is from the goal state, the more likely it is to being in states that can be updated at the moment.

    Read the article

  • Download Canvas Image Png Chome/Safari

    - by user2639176
    Works in Firefox, and won't work in Safari, or Chrome. function loadimage() { var canvas = document.getElementById("canvas"); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); xmlhttp2=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp2=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { rasterizeHTML.drawHTML(xmlhttp.responseText, canvas); var t=setTimeout(function(){copy()},3000) } } xmlhttp.open("GET","/sm/<?=$sm[0];?>",true); xmlhttp.send(); } function copy() { var canvas = document.getElementById("canvas"); var img = canvas.toDataURL("image/png"); document.getElementById('dl').href = img; document.getElementById('dl').innerHTML = "Download"; } Now I didn't write this, so I don't know too much javascript. But the script works in Firefox. In Chrome, getting: Uncaught Security Error: An attempt was made to break through the security policy of the user-agent. For toDataURL("image/png")

    Read the article

  • MySQL Table Loop using PHP

    - by JM4
    I have an online form which collects consumer data and stores in a dedicated MySQL database. In some instances, data is passed in the URL under the "RefID" variable which is also stored in the database and attached to each registration. I use the 'mysql_num_rows ($result)' to fetch all agent details on another page but this only returns ALL available details. My goal is as follows: GOAL I want to create an HTML table in which rows are automatically generated based on the list of all registrations on my site. A new row is created IF and ONLY IF a unique RefID is present on that particular record. In the event the field is NULL, it is reported on a single line. In short, the HTML table could look something like this: RefID - Number of Enrollments abc123 - 10 baseball - 11 twonk - 7 NULL - 33 Where abc123 is a particular RefID and 10 is the number of times that RefID appears in the DB. If a new registration comes in with RefID = "horses", a new row is created, showing "horses - 1". The HTML table will be viewable by account administrators needing to see the number of enrollments for a particular RefID (which they won't know ahead of time). Anybody have any suggestions?

    Read the article

< Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >