Search Results

Search found 23968 results on 959 pages for 'tail call'.

Page 57/959 | < Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >

  • C# Path Ellipsis without Win32 API call revisited

    - by casterle
    I was searching for a way to insert an ellipsis in a C# path, and found an answer here on stackoverflow: http://tinyurl.com/y6rmdfr Using the RTM versions of VS2010 and .Net 4.0, I was unable to get the suggested method to work. I searched the 'Net and found example code that uses the same method, but it failed in the same way. You can see the string I'm trying to shorten in my code below. After calling the MeasureText method, both the input string (OriginalName) and the output string (ellipsisedName) look like this: d:\abcd\efgh\ijkl\mnop\qrst\...\test.txt\0F\GHIJ\KLMN\OPQR\STIV\WXYZ\test.txt Two problems: 1) The resulting string is narfed (the path is truncated as expected, but is followed by what looks like a C-style terminating null and a chunk of the original path). 2) My original string is changed to be identical to the output string. Am I doing something wrong? namespace WindowsFormsApplication2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); string OriginalPath = @"d:\abcd\efgh\ijkl\mnop\qrst\uvwx\yzAB\CDEF\GHIJ\KLMN\OPQR\STIV\WXYZ\test.txt"; string ellipsisedPath = OriginalPath; Size proposedSize = new Size(label1.Width, label1.Height); TextRenderer.MeasureText(ellipsisedPath, label1.Font, proposedSize, TextFormatFlags.ModifyString | TextFormatFlags.PathEllipsis); } } }

    Read the article

  • Ajax call to WCF service returns 12031 ERROR_INTERNET_CONNECTION_RESET on new endpoint

    - by cyrix86
    I have extended a WCF service with new functionality in the form of a second service contract. The service.cs now implements both contracts. I have added another endpoint to expose the new contract operations. Here is my web.config relating to the service <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding" /> </basicHttpBinding> <webHttpBinding> <binding name="XmlHttpBinding"/> </webHttpBinding> </bindings> <services> <service name="MyNamespace.MyService" behaviorConfiguration="MyServiceBehavior"> <!-- Service Endpoints --> <endpoint address="xmlHttp1" behaviorConfiguration="XmlHttpBehavior" binding="webHttpBinding" bindingConfiguration="XmlHttpBinding" contract="MyNamespace.IContract1" /> <endpoint address="xmlHttp2" binding="webHttpBinding" behaviorConfiguration="XmlHttpBehavior" bindingConfiguration="XmlHttpBinding" contract="MyNamespace.IContract2" /> <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding" contract="MyNamespace.IContract1" /> </service> </services> <behaviors> <serviceBehaviors> <behavior name="MyServiceBehavior"> <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadata httpGetEnabled="true"/> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> <serviceDebug includeExceptionDetailInFaults="false"/> </behavior> </serviceBehaviors> <endpointBehaviors> <behavior name="XmlHttpBehavior"> <webHttp/> </behavior> </endpointBehaviors> </behaviors> </system.serviceModel> From Javascript, calling 'http://server/wcfServiceApp/MyService.svc/xmlHttp1/Method1' still works fine. Calling 'http://server/wcfServiceApp/MyService.svc/xmlHttp2/Method2' returns the 12031 error. There must be something simple I'm not doing, any help is appreciated.

    Read the article

  • Ajax call file or files

    - by WAC0020
    I have a module setup that uses ajax calls, should I have one file for all my ajax calls or should all the calls have their own file? Example of what I mean: index.php ------ With the ajax calls Should I have one file such as 'ajax.php' that has functions for update, delete, and edit. Or should I have update.php, delete.php, and edit.php?

    Read the article

  • Automatically call httpservice.send

    - by Matt Robinson
    I have an application that displays the data from 3 xml files (auto generated from SQL table) using httpservices to get them. The first xml file is small and contains around 30 items, the second and thrid contain around 200-300 items each. The first dataset loads quickly and is invoked on creationComplete. The second and third are called from click events and take quite a few seconds to load. A user of the application will take at least 2-3 minutes reading the data from the first dataset so is there a way I can have the httpservice.send for the second and third xml files called automatically, straight after the first file has finished loading to be able to show the first dataset immediateley and get rid of the waiting times between dataset views. An answer doesnt need to be specific, just a point in the right direction would be great. All answers greatly appreciated Matt

    Read the article

  • Render User Controls and call their Page_Load

    - by David Murdoch
    The following code will not work because the controls (page1, page2, page3) require that their "Page_Load" event gets called. using System; using System.IO; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using iTextSharp.text; using iTextSharp.text.html.simpleparser; using iTextSharp.text.pdf; public partial class utilities_getPDF : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { // add user controls to the page AddContentControl("controls/page1"); AddContentControl("controls/page2"); AddContentControl("controls/page3"); // set up the response to download the rendered PDF... Response.ContentType = "application/pdf"; Response.ContentEncoding = System.Text.Encoding.UTF8; Response.AddHeader("Content-Disposition", "attachment;filename=FileName.pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); // get the rendered HTML of the page System.IO.StringWriter stringWrite = new StringWriter(); System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); this.Render(htmlWrite); StringReader reader = new StringReader(stringWrite.ToString()); // write the PDF to the OutputStream... Document doc = new Document(PageSize.A4); HTMLWorker parser = new HTMLWorker(doc); PdfWriter.GetInstance(doc, Response.OutputStream); doc.Open(); parser.Parse(reader); doc.Close(); } // the parts are probably irrelevant to the question... private const string contentPage = "~/includes/{0}.ascx"; private void AddContentControl(string page) { content.Controls.Add(myLoadControl(page)); } private Control myLoadControl(string page) { return TemplateControl.LoadControl(string.Format(contentPage, page)); } } So my question is: How can I get the controls HTML?

    Read the article

  • How to unset delegate on UIView setAnimationDelegate: call?

    - by morticae
    I am receiving crash reports that appear to be from a UIView animation calling a delegate that has been dealloced. Thread 0 Crashed: 0 libobjc.A.dylib 0x334776f6 objc_msgSend + 18 1 UIKit 0x31c566c4 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] 2 UIKit 0x31c565d2 -[UIViewAnimationState animationDidStop:finished:] 3 QuartzCore 0x30045a26 run_animation_callbacks I am setting the current view controller as the delegate for animations using the following pattern: [UIView beginAnimations:nil context:NULL]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationDuration:0.5]; [UIView setAnimationDelegate:self]; ... [UIView commitAnimations]; My question is, how do I set that delegate reference to nil in my dealloc method? Is there some way to retain a reference to an animation? Or fetch animations in progress?

    Read the article

  • Flex - How to call a webservice without crossdomain.xml file

    - by Stephane Grenier
    How can I consume a webservice that hasn't explicitely created a crossdomain.xml? I understand it's for security and to prevent cross-site scripting, but it does seem like a major limitation to the Flex framework. For example, if I want to consume a webservice, which is suppose to be language agnostic, then I can't with Flex. The webservice/server has to be specifically prepared for Flex/Flash. If it's not, then it cannot be consumed. That can't be right can it?

    Read the article

  • ANTLR parser hanging at proxy.handshake call

    - by Peter Boughton
    I am attempting to get a basic ECMAScript parser working, and found a complete ANTLR grammar for ECMAScript 3, which appears to compile ok and produces the appropriate Lexer/Parser/Walker Java files. (Running inside ANTLR IDE plugin for Eclipse 3.5) However, when actually trying to use it with some simple test code (following guide on ANTLR wiki), it just hangs when trying to create the parser: CharStream MyChars = new ANTLRFileStream(FileName); // FileName is valid ES3Lexer MyLexer = new ES3Lexer(MyChars); CommonTokenStream MyTokens = new CommonTokenStream(MyLexer); MyTokens.setTokenSource(MyLexer); ES3Parser MyParser = new ES3Parser( MyTokens ); // hangs here ES3Parser.program_return MyReturn = MyParser.program(); I've tracked down the problem to inside the ES3Parser constructor, where it's calling the function proxy.handshake() - before this line I can successfully do System.out.println("text") but after it I get nothing. So, how do I go about finding out why it's hanging, and stopping it - or even just bypassing this section (can/should I disable debugging?) - so long as that lets it work and allows me to get on with doing useful stuff.

    Read the article

  • convert ArrayList.toString() back to ArrayList in one call

    - by dotnetnewbie
    I have a toString() representation of an ArrayList. Copying the toString() value to clipboard, I want to copy it back into my IDE editor, and create the ArrayList instance in one line. In fact, what I'm really doing is this: my ArrayList.toString() has data I need to setup a unit test. I want to copy this ArrayList.toString() into my editor to build a test against this edge case I don't want to parse anything by hand My input looks like this: [15.82, 15.870000000000001, 15.92, 16.32, 16.32, 16.32, 16.32, 17.05, 17.05, 17.05, 17.05, 18.29, 18.29, 19.16] The following do not work: Arrays.asList() google collections Lists.newArrayList() Suggestions?

    Read the article

  • How to call postback using javascript on ASP.NET form

    - by Anton
    I have a web form with textbox and button. I want after "ENTER" key click on textbox postbak form. I am using next code: onkeypress=" if(event.keyCode==13) { alert(2); WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions('ctl00$ContentPlaceHolder1$btnSearch', '', true, '', '', false, false)); alert(2); return false;} where WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions('ctl00$ContentPlaceHolder1$btnSearch', '', true, '', '', false, false)); is javascript code for button event onclick. I get two alerts, but postback doesnot happen. Any ideas what is wrong?

    Read the article

  • iPhone generalPasteboard loses contents if application is closed by an -openURL: call

    - by Kojiro
    I have a method, that puts something on the pasteboard. This method is called one of two ways, one, as an IBAction from a button, the other from another method which afterwards closes the application by doing: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:"]]; The problem arises only when the application is not closed using the home button, but is closed using the line above. When that happens, the pasteboard contents are lost. I assume this problem has something to do with the object being cleaned up improperly when it closes this way, but have no idea why it is doing that. I have even tried to intentionally leak the object that gets put on the pasteboard, but it still gets lost on the way out. Here is the method: - (IBAction) copyLink { NSString *stringForPasteboard = @"here is the string"; [[UIPasteboard generalPasteboard] setURL:stringForPasteboard]; [stringForPasteboard release]; }

    Read the article

  • problem on ajax call

    - by praveen
    hi i am using mootools ajax request in my project. its works properly but when i make request for it aborted first time and second time request mad. consequently abortion of request increase by one at each click. my code is following function addStepConfiguration(id,mystrip,comment,error,submitid) { // alert(id+'\n'+mystrip+'\n'+comment+'\n'+error+'\n'+submitid.value); $(id).addEvent('submit', function(e) { e.stop(); this.set('send', { onRequest:function(html){ $(submitid).setStyle('display','none'); loading_Img(); }, onComplete: function(responseText) { $('loading_img').innerHTML = ''; SplittedResText = responseText.split("|"); s //alert(SplittedResText); if(SplittedResText[1]=='undefined') { $(error).innerHTML=SplittedResText[0]; $(submitid).setStyle('display','block'); } else { $(comment).innerHTML=SplittedResText[0]; $(mystrip).set('class',SplittedResText[1]); //$(image).setProperty('src',SplittedResText[2]); removeMsg.delay(20,'',error); removeMsg.delay(3000,'',comment); $(submitid).setStyle('display','block'); } } }); this.send(); }); }

    Read the article

  • NHibernate handling mutliple resultsets from a sp call

    - by Michael Baldry
    I'm using a stored procedure to handle search on my site, it includes full text searching, relevance and paging. I also wanted it to return the total number of results that would have been returned, had paging not being there. So I've now got my SP returning 2 select statements, the search and just SELECT @totalResults. Is there any way I can get NHibernate to handle this? I'm currently accessing the ISession's connection, creating a command and executing the SP myself, and mapping the results. This isn't ideal, so I'm hoping I can get NH to handle this for me. Or if anyone has any other better ways of creating complicated searches etc with NH, I'd really like to hear it.

    Read the article

  • Ajax call to parent window after form submission

    - by David
    Hi all, Pardon the complicated title. Here's my situation: I'm working on a Grails app, and using jQuery for some of the more complex UI stuff. The way the system is set up, I have an item, which can have various files (user-supplied) associated with it. On my Item/show view, there is a link to add a file. This link pops up a jQuery modal dialog, which displays my file upload form (a remote .gsp). So, the user selects the file and enters a comment, and when the form is submitted, the dialog gets closed, and the list of files on the Item/show view is refreshed. I was initially accomplishing this by adding onclick="javascript:window.parent.$('#myDialog').dialog('close');" to my submit button. This worked fine, but when submitting some larger files, I end up with a race condition where the dialog closes and the file list is refreshed before the new file is saved, and so the list of files is out of date (the file still gets saved properly). So my question is, what is the best way to ensure that the dialog is not closed until after the form submit operation completes? I've tried using the <g:formRemote tag in Grails, and closing the dialog in the "after" attribute (according to the Grails docs, the script is called after form submission), but I receive an error (taken from FireBug) stating that window.parent.$('#myDialog').dialog is not a function Is this a simple JavaScript/Grails syntax issue that I'm missing here, or am I going about this entirely wrong? Thanks so much for your time and assistance!

    Read the article

  • call by value-result in Pascal

    - by Luciano Lorenti
    How can i simulate calling by value-result in this example. Without adding variables and without change a variable name.? Program one; var x:integer; Function two():integer; begin x:=x+1; dos:=x; end; Procedure three(x:integer); begin x:=x+5; x:=two(); end; begin x:=8; trhee(x); write(x); end.

    Read the article

  • Does Marshal.ReleaseComObject call the garbage collector ?

    - by Shimrod
    Hi, I was asked this question today by a colleague, and couldn't find any clue on the Internet... Can someone tell me if calling Marshall.ReleaseComObject()directly calls the garbage collector ? As I understand it, it only removes COM references, and then the G.C. cleans memory on its next pass, but I can be mistaken... Thanks in advance for your help!

    Read the article

  • Unable to call RESTful web services methods

    - by Alessandro
    Hello, I'm trying to dive into the RESTful web services world and have started with the following template: [ServiceContract] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] public class Test { // TODO: Implement the collection resource that will contain the SampleItem instances [WebGet(UriTemplate = ""), OperationContract] public List<SampleItem> GetCollection() { // TODO: Replace the current implementation to return a collection of SampleItem instances return new List<SampleItem>() {new SampleItem() {Id = 1, StringValue = "Hello"}}; } [WebInvoke(UriTemplate = "", Method = "POST"), OperationContract] public SampleItem Create(SampleItem instance) { // TODO: Add the new instance of SampleItem to the collection throw new NotImplementedException(); } [WebGet(UriTemplate = "{id}"), OperationContract] public SampleItem Get(string id) { // TODO: Return the instance of SampleItem with the given id throw new NotImplementedException(); } [WebInvoke(UriTemplate = "{id}", Method = "PUT"), OperationContract] public SampleItem Update(string id, SampleItem instance) { return new SampleItem { Id = 99, StringValue = "Done" }; } [WebInvoke(UriTemplate = "{id}", Method = "DELETE"), OperationContract] public void Delete(string id) { // TODO: Remove the instance of SampleItem with the given id from the collection throw new NotImplementedException(); } } I am able to perform the GET operation but I am unable to perform PUT, POST or DELETE requests. Can anyone explain me how to perform these operations and how to create the correct URLs? Best regards Alessandro

    Read the article

  • Asp.Net(C#) Jquery Ajax with WebMethod In Public Method Call

    - by oraclee
    Hi All; Aspx Page: $(document).ready(function() { $("#btnn").click(function() { $.ajax({ type: "POST", url: "TestPage.aspx/emp", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { } }); }); }); CodeBehind: public void grdload() { GridView1.DataSource = GetEmployee("Select * from Employee"); GridView1.DataBind(); } [WebMethod] public static void emp() { TestPage re = new TestPage(); re.grdload(); } I Can't Gridview Data Load ? How To Make GridView Data Load? Thank You

    Read the article

  • PHP set timeout for script with system call, set_time_limit not working

    - by tehalive
    I have a command-line PHP script that runs a wget request using each member of an array with foreach. This wget request can sometimes take a long time so I want to be able to set a timeout for killing the script if it goes past 15 seconds for example. I have PHP safemode disabled and tried set_time_limit(15) early in the script, however it continues indefinitely. Update: Thanks to Dor for pointing out this is because set_time_limit() does not respect system() calls. So I was trying to find other ways to kill the script after 15 seconds of execution. However, I'm not sure if it's possible to check the time a script has been running while it's in the middle of a wget request at the same time (a do while loop did not work). Maybe fork a process with a timer and set it to kill the parent after a set amount of time? Thanks for any tips! Update: Below is my relevant code. $url is passed from the command-line and is an array of multiple URLs (sorry for not posting this initially): foreach( $url as $key => $value){ $wget = "wget -r -H -nd -l 999 $value"; system($wget); }

    Read the article

  • Pinvoke- to call a function with pointer to pointer to pointer parameter

    - by jambodev
    complete newbe in PInvoke. I have a function in C with this signature: int addPos(int init_array_size, int *cnt, int *array_size, PosT ***posArray, PosT ***hPtr, char *id, char *record_id, int num, char *code, char *type, char *name, char *method, char *cont1, char *cont2, char *cont_type, char *date1, char *date_day, char *date2, char *dsp, char *curr, char *contra_acc, char *np, char *ten, char *dsp2, char *covered, char *cont_subtype, char *Xcode, double strike, int version, double t_price, double long, double short, double scale, double exrcised_price, char *infoMsg); and here is how PosT looks like: typedef union pu { struct dpos d; struct epo e; struct bpos b; struct spos c; } PosT ; my questions are: 1- do I need to define a class in CSharp representing PosT? 2- how do I pass PosT ***posArray parameter across frm CSharp to C? 3- How do I specify marshaling for it all? I Do appreciate your help

    Read the article

  • Call Init from XUL after Page Loads (Firefox add-on)

    - by mattyboy123
    Hi all, I've been working on some code in js/html and it works great. I'm now trying to package it into an add-on for Firefox, and having some issues getting the XUL document correct. PLAIN OLD HTML/JS In my html test file between the <head></head> I have: <script type="text/javascript" src="js/MyCode.js"></script> At the end of the test file before the </body> I have: <script type="text/javascript">MyCode.Static.Init();</script> FIREFOX ADD-ON: OVERLAY.XUL In an overlay.xul file in the extension package I have : <?xml version="1.0"?> <overlay id="mycode" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/x-javascript" src="chrome://mycode/content/MyCode.js"></script> <script> window.addEventListener("load", function () { gBrowser.addEventListener("load",MyCode.Static.Init,true); }, false); </script> </overlay> This does not seem to enter the method, but then again I'm not even sure if I've got the listeners firing properly. Would this be the correct way to duplicate what I was doing in plain old html/js ?

    Read the article

  • Ajax call with jQuery in ASP.NET MVC does not pass parameters

    - by desmati
    The Route is: routes.MapRoute( "Ajax", // Route name "BizTalk/Services/{action}", // URL with parameters new { // Parameter defaults controller = "BizTalk" } ); My Controller is: public JsonResult AjaxTest(string s, int i, bool b) { return Json("S: " + s + "," + "I: " + i + "," + "B: " + b); } My jQuery Code: $(document).ready(function() { $("#btn_test").click(function() { var s = "test"; var i = 8; var b = true; $.ajax({ type: "POST", cache: false, url: "/BizTalk/Services/AjaxTest", data: { i: i, s: s, b: b }, contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { } }); }); });

    Read the article

< Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >