Search Results

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

Page 85/959 | < Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >

  • Is it possible to call a non-static function inside static function in C#?

    - by djzmo
    Is it possible to call a non-static function that uses a public non-static class inside a static function in C#? public class MyProgram { private Thread thd = new Thread(myStaticFunction); public AnotherClass myAnotherClass = new AnotherClass(); public MyProgram() { thd.Start(); } public static void myStaticFunction() { myNonStaticFunction(); } private void myNonStaticFunction() { myAnotherClass.DoSomethingGood(); } } Well, the invalid code like above is what I need. Any idea?

    Read the article

  • How to reject a call without delay in ring on windows mobile?

    - by Mayur
    Hello, I am trying to write a code to reject the incoming call programatically on windows mobile 6. my requirement is to achieve this without a single ring. I tried using systemstate property but it gives deley of one ring. I even tried with OpenNETCF's tapi wrapper but still i am getting the same result. Can anybody tell me what actually can I do to achieve this? Thanks in advance.

    Read the article

  • What happens with TCP packets between 2 Socket.BeginReceive Call??

    - by Rodrigo
    Hi, i have a doubt about Socket Programming, i am developing a TCP packets Sniffer, i am using Socket.BeginAccept, Socket.BeginReceive to capture every packet, but when a packet is received i have to process something, it is a fast operation, but would take some milliseconds, and then call the BeginReceive again. My question is, what would happen if some packets are sent while i am processing, and havent called BeginReceive??...are lost?...are buffered internally?...is there a limit?... Thanks in advance.

    Read the article

  • Where To Call Custom Method? viewDidLoad, viewWillLoad...

    - by Chris
    I am loading some info from a server. I have created a separate method to do this. I am then calling [self myCustomMethod] to run the method. No matter where I call [self myCustomMethod] (initWithNibName, viewDidLoad, viewWillLoad, viewWillAppear, viewDidAppear), the custom method is getting called twice - what's the deal?

    Read the article

  • Call HttpWebRequest in another thread as UI with Task class - avoid to dispose object created in Task scope

    - by John
    I would like call HttpWebRequest on another thread as UI, because I must make 200 request or server and downloaded image. My scenation is that I make a request on server, create image and return image. This I make in another thread. I use Task class, but it call automaticaly Dispose method on all object created in task scope. So I return null object from this method. public BitmapImage CreateAvatar(Uri imageUri, int sex) { if (imageUri == null) return CreateDefaultAvatar(sex); BitmapImage image = null; new Task(() => { var request = WebRequest.Create(imageUri); var response = request.GetResponse(); using (var stream = response.GetResponseStream()) { Byte[] buffer = new Byte[response.ContentLength]; int offset = 0, actuallyRead = 0; do { actuallyRead = stream.Read(buffer, offset, buffer.Length - offset); offset += actuallyRead; } while (actuallyRead > 0); image = new BitmapImage { CreateOptions = BitmapCreateOptions.None, CacheOption = BitmapCacheOption.OnLoad }; image.BeginInit(); image.StreamSource = new MemoryStream(buffer); image.EndInit(); image.Freeze(); } }).Start(); return image; } How avoid it? Thank Mr. Jon Skeet try this: private Stream GetImageStream(Uri imageUri) { Byte[] buffer = null; //new Task(() => //{ var request = WebRequest.Create(imageUri); var response = request.GetResponse(); using (var stream = response.GetResponseStream()) { buffer= new Byte[response.ContentLength]; int offset = 0, actuallyRead = 0; do { actuallyRead = stream.Read(buffer, offset, buffer.Length - offset); offset += actuallyRead; } while (actuallyRead > 0); } //}).Start(); return new MemoryStream(buffer); } It return object which is null a than try this: private Stream GetImageStream(Uri imageUri) { Byte[] buffer = null; new Task(() => { var request = WebRequest.Create(imageUri); var response = request.GetResponse(); using (var stream = response.GetResponseStream()) { buffer= new Byte[response.ContentLength]; int offset = 0, actuallyRead = 0; do { actuallyRead = stream.Read(buffer, offset, buffer.Length - offset); offset += actuallyRead; } while (actuallyRead > 0); } }).Start(); return new MemoryStream(buffer); } Method above return null

    Read the article

  • What do you call using print statements to debug code?

    - by vgm64
    I'm just curious, but is there a name for the process using print statements to debug your code? An example in pseudocode x=3.2e39 print x y = function1(x) print y z = function2(y) print z w = function3(z) print w Executation: 3.2e39 3.2e36 NaN NaN reveals some bad math in function2. If there's no standard name, what do you call it?

    Read the article

  • How do I call a basic YUI3 function from within a normal JavaScript function?

    - by Justin Tanner
    I'd like to call a simple YUI3 function from within a JavaScript function. Here is some code that does what I want in a very verbose way: function changeContent (message) { YUI().use("node", function(Y) { Y.all('#content-div').setContent(message); }); } Is there a better way to do this? NOTE: I don't want to attach this function to any event, I just want a global changeContent() function available.

    Read the article

  • 'Attempt to call private method' error when trying to change change case of db entires in migration

    - by Senthil
    class AddTitleToPosts < ActiveRecord::Migration def self.up add_column :posts, :title, :string Post.find(:all).each do |post| post.update(:title => post.name.upcase) end end def self.down end end Like you can nothing particularly complicated, just trying to add new column title by changing case of name column already in db. But I get attempt to call private method error. I'm guessing it has something to do with 'self'? Thanks for your help.

    Read the article

  • How do I call a function defined in a C++ DLL that has a parameter of type int *, from inside C# code ?

    - by Ashutosh
    I have a native regular C++ Dll which I want to call from C# code, so i created C++/CLI class (as described here and here) which will include managed C++ code and which can be called by any C# code directly and which can make calls inturn to native unmanaged C++. One of function in native C++ dll has parameter of type int *. How do I declare in wrapper function and how can i convert it into int *?

    Read the article

< Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >