Search Results

Search found 47805 results on 1913 pages for 'return address'.

Page 72/1913 | < Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >

  • Rewrite document.location without loading

    - by Miro
    I am developing a system which is 100% ajax, except of course, the first request. I am interested in changing the address in document.location, using javascript. But I don't want the browser to load the page on that "new" location. Does anyone know how I can do this? miro

    Read the article

  • Where are the function address literals in c++?

    - by academicRobot
    First of all, maybe literals is not the right term for this concept, but its the closest I could think of (not literals in the sense of functions as first class citizens). <UPDATE> After some reading with help from answer by Chris Dodd, what I'm looking for is literal function addresses as template parameters. Chris' answer indicates how to do this for standard functions, but how can the addresses of member functions be used as template parameters? Since the standard prohibits non-static member function addresses as template parameters (c++03 14.3.2.3), I suspect the work around is quite complicated. Any ideas for a workaround? Below the original form of the question is left as is for context. </UPDATE> The idea is that when you make a conventional function call, it compiles to something like this: callq <immediate address> But if you make a function call using a function pointer, it compiles to something like this: mov <memory location>,%rax callq *%rax Which is all well and good. However, what if I'm writing a template library that requires a callback of some sort with a specified argument list and the user of the library is expected to know what function they want to call at compile time? Then I would like to write my template to accept a function literal as a template parameter. So, similar to template <int int_literal> struct my_template {...};` I'd like to write template <func_literal_t func_literal> struct my_template {...}; and have calls to func_literal within my_template compile to callq <immediate address>. Is there a facility in C++ for this, or a work around to achieve the same effect? If not, why not (e.g. some cataclysmic side effects)? How about C++0x or another language? Solutions that are not portable are fine. Solutions that include the use of member function pointers would be ideal. I'm not particularly interested in being told "You are a <socially unacceptable term for a person of low IQ>, just use function pointers/functors." This is a curiosity based question, and it seems that it might be useful in some (albeit limited) applications. It seems like this should be possible since function names are just placeholders for a (relative) memory address, so why not allow more liberal use (e.g. aliasing) of this placeholder. p.s. I use function pointers and functions objects all the the time and they are great. But this post got me thinking about the don't pay for what you don't use principle in relation to function calls, and it seems like forcing the use of function pointers or similar facility when the function is known at compile time is a violation of this principle, though a small one. Edit The intent of this question is not to implement delegates, rather to identify a pattern that will embed a conventional function call, (in immediate mode) directly into third party code, possibly a template.

    Read the article

  • What is the total amount of public IPv4 addresses?

    - by Earlz
    Yes, I am needing to know what the total number possible IPs in the public IPv4 space. I'm not sure where to even get a neat list of all the IP address ranges, so could someone point me to a resource to calculate this myself or calculate the total number of IPs for me? Also, by Public IPs I mean not counting reserved or private-range IP addresses.. Only the ones that can be access through the internet.

    Read the article

  • Problems with unique links in database: www.doamin/ or domain/

    - by Thomas
    In my website everybody can send some links to other nice websites. All links in my database must by unique, but some links are with 'www.' prefix, and some without. Some ends for '/', some not. For example: |http://www.domain.com |http://domain.com |http://domain.com |http://domain.com/ and other problems can be with https or http. I know that I should change address before saving to database, but what standard I should use?

    Read the article

  • how to determin what url has opened file now? (php)

    - by Ole Jak
    so I want to be able to get informed if my php script file is opened in localhost/myfile.php or in something like 222.22.22.22/myfile.php so I needa php function to determin if url starts with localhost or any other address (I want to get it as string like '22.33.22.33') How to do such thing?

    Read the article

  • Does this e-mail-regex exclude valid addresses?

    - by neo
    I tried to create a regular expression which catches all RFC-valid addresses but it's ok if some false-positives come through (though hopefully not so many). This is waht I came up so far: /^\b\S+@\S+\.[^\s@]{2,}\b$/ Is there any RFC-valid address which doesn't match against this expression or do you have any suggestions to improve it? I don't mind the false positives but I would be glad if you show me a few, too.

    Read the article

  • If I'm running my App Engine app on localhost, will I not see a value for X-AppEngine-Country?

    - by Bartholomew
    According to the Release Notes: All user request have an X-AppEngine-Country header which contains the ISO-3166-1 alpha-2 country code for the user, based on the IP address of the client request. My app is running on localhost with the 1.5.1 Java release which contains the X-AppEngine-Country header but I don't seem to be receiving any value for this header in my requests. Do I have to deploy the app to a production instance to test this feature?

    Read the article

  • after return PartialView() Url.Actionlink("Action", "Controller"), the Controller is lost

    - by Johannes
    Well the Question is related to a problem I posted before (http://stackoverflow.com/questions/2403899/asp-net-mvc-partial-view-does-not-call-my-action). In practice I've a partial view which contains a Form, after submitting the Form the Controller returns the Partial View. Well the Problem is if I reload the page which contains the partial view the function <%= Url.Action("ChangePassword", "Account") %> returns "Account/ChangePassword", if I submit the form and the partial is returned by the controller. Using return PartialView() the function <%= Url.Action("ChangePassword", "Account") %> returns only "ChangePassword". Any Idea because? The View looks like: <form action="<%= Url.Action("ChangePassword", "Account") %>" method="post" id="jform"> <div> <fieldset> <legend>Account Information</legend> <p> <label for="currentPassword">Current password:</label> <%= Html.Password("currentPassword") %> <%= Html.ValidationMessage("currentPassword") %> </p> <p> <label for="newPassword">New password:</label> <%= Html.Password("newPassword") %> <%= Html.ValidationMessage("newPassword") %> </p> <p> <label for="confirmPassword">Confirm new password:</label> <%= Html.Password("confirmPassword") %> <%= Html.ValidationMessage("confirmPassword") %> </p> <p> <input type="submit" value="Change Password" /> </p> </fieldset> </div> </form> </div> <script> $(function() { $('#jform').submit(function() { $('#jform').ajaxSubmit({ target: '#FmChangePassword' }); return false; }); }); </script> Part of the Controller: if (!ValidateChangePassword(currentPassword, newPassword, confirmPassword)) { return PartialView(ViewData); }

    Read the article

  • Return Json causes save file dialog in asp.net mvc

    - by Eran
    Hi, I'm integrating jquery fullcalendar into my application. Here is the code i'm using: in index.aspx: <script type="text/javascript"> $(document).ready(function() { $('#calendar').fullCalendar({ events: "/Scheduler/CalendarData" }); }); </script> <div id="calendar"> </div> Here is the code for Scheduler/CalendarData: public ActionResult CalendarData() { IList<CalendarDTO> tasksList = new List<CalendarDTO>(); tasksList.Add(new CalendarDTO { id = 1, title = "Google search", start = ToUnixTimespan(DateTime.Now), end = ToUnixTimespan(DateTime.Now.AddHours(4)), url = "www.google.com" }); tasksList.Add(new CalendarDTO { id = 1, title = "Bing search", start = ToUnixTimespan(DateTime.Now.AddDays(1)), end = ToUnixTimespan(DateTime.Now.AddDays(1).AddHours(4)), url = "www.bing.com" }); return Json(tasksList,JsonRequestBehavior.AllowGet); } private long ToUnixTimespan(DateTime date) { TimeSpan tspan = date.ToUniversalTime().Subtract( new DateTime(1970, 1, 1, 0, 0, 0)); return (long)Math.Truncate(tspan.TotalSeconds); } public ActionResult Index() { return View("Index"); } I also have the following code inside head tag in site.master: <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server" /> <link href="<%= Url.Content("~/Content/jquery-ui-1.7.2.custom.css") %>" rel="stylesheet" type="text/css" /> <link href="~Perspectiva/Content/Site.css" rel="stylesheet" type="text/css" /> <link href="~Perspectiva/Content/fullcalendar.css" rel="stylesheet" type="text/css" /> <script src="~Perspectiva/Scripts/jquery-1.4.2.js" type="text/javascript"></script> <script src="~Perspectiva/Scripts/fullcalendar.js" type="text/javascript"></script> <script src="/Scripts/MicrosoftAjax.debug.js" type="text/javascript"></script> <script src="/Scripts/MicrosoftMvcAjax.debug.js" type="text/javascript"></script> Everything I did was pretty much copied from http://szahariev.blogspot.com/2009/08/jquery-fullcalendar-and-aspnet-mvc.html When navigating to /scheduler/calendardata I get a prompt for saving the json data which contents are exactly what I created in the CalendarData function. What do I need to do in order to render the page correctly? Thanks in advance, Eran

    Read the article

  • The server returned an address in response to the PASV command that is different than the address to

    - by senzacionale
    {System.Net.WebException: The server returned an address in response to the PASV command that is different than the address to which the FTP connection was made. at System.Net.FtpWebRequest.CheckError() at System.Net.FtpWebRequest.SyncRequestCallback(Object obj) at System.Net.CommandStream.Abort(Exception e) at System.Net.FtpWebRequest.FinishRequestStage(RequestStage stage) at System.Net.FtpWebRequest.GetRequestStream() at BackupDB.Program.FTPUploadFile(String serverPath, String serverFile, FileInfo LocalFile, NetworkCredential Cred) in D:\PROJEKTI\BackupDB\BackupDB\Program.cs:line 119} code: FTPMakeDir(new Uri(serverPath + "/"), Cred); FtpWebRequest request = (FtpWebRequest)WebRequest.Create(serverPath + serverFile); request.UsePassive = true; request.Method = WebRequestMethods.Ftp.UploadFile; request.Credentials = Cred; byte[] buffer = new byte[10240]; // Read/write 10kb using (FileStream sourceStream = new FileStream(LocalFile.ToString(), FileMode.Open)) { using (Stream requestStream = request.GetRequestStream()) { int bytesRead; do { bytesRead = sourceStream.Read(buffer, 0, buffer.Length); requestStream.Write(buffer, 0, bytesRead); } while (bytesRead > 0); } response = (FtpWebResponse)request.GetResponse(); response.Close(); }

    Read the article

  • SQL: Return "true" if list of records exists?

    - by User
    An alternative title might be: Check for existence of multiple rows? Using a combination of SQL and C# I want a method to return true if all products in a list exist in a table. If it can be done in all in SQL that would be preferable. I have written a method that returns whether a single productID exists using the following SQL: SELECT productID FROM Products WHERE ProductID = @productID If this returns a row, then the c# method returns true, false otherwise. Now I'm wondering if I have a list of product IDs (not a huge list mind you, normally under 20). How can I write a query that will return a row if all the product id's exist and no row if one or more product id's does not exist? (Maybe something involving "IN" like: SELECT * FROM Products WHERE ProductID IN (1, 10, 100))

    Read the article

  • vss intializefor backup fails with return code E_UNEXPECTED

    - by suresh
    #include "vss.h" #include "vswriter.h" #include <VsBackup.h> #include <stdio.h> #define CHECK_PRINT(result) printf("%s\n",result==S_OK?"S_OK":"error") int main(int argc, char* argv[]) { BSTR xml; LPTSTR errorText; IVssBackupComponents *VssHandle; HRESULT result = CreateVssBackupComponents(&VssHandle); CHECK_PRINT(result); result = VssHandle->InitializeForBackup(); printf("unexpected%x\n",result); system("pause"); return 0; } in the above program intializeforbackup fails with error code E_UNEXPECTED. The VSS service is running . In the event log it shows as "Volume Shadow Copy Service error: Unexpected error calling routine CoCreateInstance. hr = 0x800401f0.".. Any solutions for the InitializeForBackup to return S_OK?

    Read the article

  • Get website's server from IP address

    - by Steven
    I have a function that returns a website's server when you enter the url for the site: private string GetWebServer() { string server = string.Empty; //get URL string url = txtURL.Text.Trim().ToLower(); if (!url.StartsWith("http://") && !url.StartsWith("https://")) url = "http://" + url; HttpWebRequest request = null; HttpWebResponse response = null; try { request = WebRequest.Create(url) as HttpWebRequest; response = request.GetResponse() as HttpWebResponse; server = response.Headers["Server"]; } catch (WebException wex) { server = "Unknown"; } finally { if (response != null) { response.Close(); } } return server; } I'd like to also be able to get a website's server from the IP address instead of the site's url. But if I enter an IP address, I get an error saying "Invalid URI: The format of the URI could not be determined." when calling WebRequest.Create(url). Does someone know how I can modify this to accomplish what I want?

    Read the article

  • Return pointer to nested inner class from generic outer class

    - by helixed
    I'm new to C++, so bear with me. I have a generic class called A. A has a nested class called B. A contains a method called getB(), which is supposed to return a new instance of B. However, I can't get my code to compile. Here's what it looks like:#include A.h template <class E> class A { public: class B { public: int data; }; B * getB(); }; A.cpp #include "A.h" template <class E> A<E>::B * A::getB() { return new B(); } When I try to compile this, I get the following error: error: expected constructor, destructor, or type conversion before '*' token Does anybody know what I'm doing wrong? Thanks, helixed

    Read the article

  • In Javascript event handling, why "return false" or "event.preventDefault()" and "stopping the event

    - by Jian Lin
    It is said that when we handle a "click event", returning false or calling event.preventDefault() makes a difference, in which the difference is that preventDefault will only prevent the default event action to occur, i.e. a page redirect on a link click, a form submission, etc. and return false will also stop the event flow. Does that mean, if the click event is registered several times for several actions, using $('#clickme').click(function() { … }) returning false will stop the other handlers from running? I am on a Mac now and so can only use Firefox and Chrome but not IE, which has a different event model, and tested it on FF and Chrome and all 3 handlers ran without any stopping…. so what is the real difference, or, is there a situation where "stopping the event flow" is not desirable? this is related to http://stackoverflow.com/questions/3042036/using-jquerys-animate-if-the-clicked-on-element-is-a-href-a and http://stackoverflow.com/questions/2017755/whats-the-difference-between-e-preventdefault-and-return-false

    Read the article

  • Passing jQuery object and WebMethod return value to an OnSuccess function

    - by iboeno
    I am calling a WebMethod from this code: if($(this).attr("checked")) { .. MyWebMethod(variable1, variable2, onSuccessFunction); } The MyWebMethod returns an integer, and I want to set $(this).attr("id") of the jQuery object above to the returned integer. Basically, I'm trying to do the equivalent of an MVC Ajax.ActionLink...AjaxOptions {UpdateTargetID =...} However, I can't figure out how to get both a reference to $(this) as well as the returned value. For example, if I do: MyWebMethod(variable1, variable2, onSuccessFunction($(this))); I can succesfully manipulate the jQuery object, but obviously it doesn't have the return value from the MyWebMethod. Alternatively, the first code block with a method signature of onSuccessFunction(returnValue) has the correct return value from MyWebMethod, but no concept of the jQuery object I'm looking for. Am I going about this all wrong?

    Read the article

  • Linq - How to query specific columns and return a lists

    - by Billy Logan
    Hello Everyone, I am trying to write a linq query that will only return certain columns from my entity object into a list object. Below is my code which produces an error(can't implicitly convert a generic list of anonymous types to a generic list of type TBLPROMOTION): List<TBLPROMOTION> promotionInfo = null; promotionInfo = (from p in matches orderby p.PROMOTION_NM descending select new { p.EFFECTIVE_DT, p.EXPIRE_DT, p.IS_ACTIVE, p.PROMOTION_DESC, p.PROMOTION_ID, p.PROMOTION_NM }).ToList(); What would be the best way to accomplish this. I do not want to do a "select p" in this case and return all the columns associated with the query. thanks in advance, Billy

    Read the article

  • return from a linq where statement

    - by Vaccano
    I have the following link function MyLinqToSQLTable.Where(x => x.objectID == paramObjectID).ToList(); I most of the time you can change a linq call to be several lines by adding curly brackets around the method body. Like this: MyLinqToSQLTable.Where(x => { x.objectID == paramObjectID; }).ToList(); Problem is the implied return that was there when I just did a Boolean compare is now not done. Return (x.objectID == paramObjectID); is not accepted either. How do do this? can I do this? NOTE: I know that I can add another where clause if needed. But I would still like to know the answer to this.

    Read the article

  • Java: error handling with try-catch, empty-try-catch, dummy-return

    - by HH
    A searh uses recursively defined function that easily throws exceptions. I have tried 3 ways to handle exeptions: to ignore with an empty-try-catch() add-dummy-return stop err-propagation due to exeption throw a specific except. (this part I don't really understand. If I throw except, can I force it to continue elsewhere, not continuing the old except-thrown-path?) Some exceptions I do not realy care like during execution removed files -exception (NullPointer) but some I really do like unknown things. Possible exceptions: // 1. if a temp-file or some other file removed during execution -> except. // 2. if no permiss. -> except. // 3. ? --> except. The code is Very import for the whole program. I earlier added clittered-checks, try-catches, avoided-empty-try-catches but it really blurred the logic. Some stoned result here would make the code later much easier to maintain. It was annoying to track random exeptions due to some random temp-file removal! How would you handle exceptions for the critical part? Code public class Find { private Stack<File> fs=new Stack<File>(); private Stack<File> ds=new Stack<File>(); public Stack<File> getD(){ return ds;} public Stack<File> getF(){ return fs;} public Find(String path) { // setting this type of special checks due to errs // propagation makes the code clittered if(path==null) { System.out.println("NULL in Find(path)"); System.exit(9); } this.walk(path); } private void walk( String path ) { File root = new File( path ); File[] list = root.listFiles(); //TODO: dangerous with empty try-catch?! try{ for ( File f : list ) { if ( f.isDirectory() ) { walk( f.getAbsolutePath() ); ds.push(f); } else { fs.push(f); } } }catch(Exception e){e.printStackTrace();} } } Code refactored from here.

    Read the article

  • ASP .NET MVC; return HTML along with JavaScript

    - by effkay
    I have a partial view which renders a table. On page load, I am using JQuery to perform Zebra Stripping on it. Whenever ajax refreshes the table, DOM elements are updated, but since JQuery code to do the Zebra Stripping is not executed; table looks ugly. I have tried adding Javascript in my partial view if( Request.IsAjaxRequest() ) return PartialView( "AdministrationGrid", Users ); but javascript is not executed. I guess the only way to execute the Javascript as reply is to do: return JavaScript( "alert( '' )" ); Anyone with an idea how can I achieve this? I thought about JQuery Live, but it is used to bind itself to events.

    Read the article

  • "return false" is ignored in certain browsers for link added dynamically to the DOM with JavaScript

    - by AlexV
    I dynamically add an <a> (link) tag to the DOM with: var link = document.createElement('a'); link.href = 'http://www.google.com/'; link.onclick = function () { window.open(this.href); return false; }; link.appendChild(document.createTextNode('Google')); //someDomNode.appendChild(link); I want the link to open in a new window (I know it's bad, but it's required) and I don't want to use the target attribute. My code works well in IE and Firefox, but the return false don't work in Safari, Chrome and Opera. By don't work I mean the link is followed after the new window is opened.

    Read the article

  • Eclipse warning: "<methodName> has non-API return type <parameterizedType>"

    - by Tenner
    My co-worker and I have come across this warning message a couple times recently. For the below code: package com.mycompany.product.data; import com.mycompany.product.dao.GenericDAO; public abstract class EntityBean { public abstract GenericDAO<Object, Long> getDAO(); // ^^^^^^ <-- WARNING OCCURS HERE } the warning appears in the listed spot as EntityBean.getDAO() has non-API return type GenericDAO<T, ID> A Google search for "has non-API return type" only shows instances where this message appears in problem lists. I.e., there's no public explanation for it. What does this mean? We can create a usage problem filter in Eclipse to make the message go away, but we don't want to do this if our usage is a legitimate problem. Thanks!

    Read the article

  • searching for address matches using sql server 2008 full text search

    - by Sridhar
    Hi, I am not sure how to search for address matches using sql server 2008 full text search. This is what I tried but it doesn't return any records. TableA ------ Address1 Address2 City State Zip All the above columns in the table are full text indexed. Let's say if the user enters "123 Apple street FL 33647" and I have a record in the table as Address1 = "123" , Address2 = "Apple street", City = "Tampa", State = "FL" and Zip = "33647" I would like the query to return this. can you please let me know how I would do this. query tried -------------- SELECT * FROM TableA WHERE CONTAINS((Address1, Address2, City, State, zip), N'FORMSOF(THESAURUS, 123AppleStreetFL33647)'); If I put spaces in the search word, it is giving syntax error. Thanks, sridhar.

    Read the article

< Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >