Search Results

Search found 962 results on 39 pages for 'consumer'.

Page 26/39 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • How to stop worker threads in a multithreaded Windows service on service stop

    - by RobW
    I have a Windows service that uses the producer/consumer queue model with multiple worker threads processing tasks off a queue. These tasks can be very long running, in the order of many minutes if not hours, and do not involve loops. My question is about the best way to handle the service stop to gracefully end processing on these worker threads. I have read in another SO question that using thread.Abort() is a sign of bad design, but it seems that the service OnStop() method is only given a limited amount of time to finish before the service is terminated. I can do sufficient clean-up in the catch for ThreadAbortException (there is no danger of inconsistent state) so calling thread.Abort() on the worker threads seems OK to me. Is it? What are the alternatives?

    Read the article

  • How to get all rows but specifc columns from a DataTable?

    - by Oliver
    Currently i am having some problems with getting some data out of a DataTable by selecting all rows, but only some columns. To be a little more descriptive here is a little example: Sample Data | ID | FirstName | LastName | Age | +----+-----------+----------+-----+ | 1 | Alice | Wannabe | 22 | | 2 | Bob | Consumer | 27 | | 3 | Carol | Detector | 25 | What i have So what we got from our GUI is a IEnumerable<DataColumn> selectedColumns and there we'll find two elements (FirstName and LastName). Now i need some result which contains all rows, but only the above two columns (or any other list of selected columns). So far i already used LINQ on several one dimensional objects, but this two dimensional object gives me a little headache. // The hard-coded way Table.AsEnumerable().Select(row => new { FirstName = row[1], LastName = row[2] }); // The flexible way Table.AsEnumerable().Select(row => row ???) But how can i now say, which columns from row should be selected by using my selectedColumns?

    Read the article

  • OAuth iPhone client, problems with HTTP_AUTHORIZATION

    - by Rich
    Hi, I've been trying to implement OAuth in my iPhone app. However I have hit a problem. I have two servers, a local web server which is on my machine at home, I use this for testing. The machine is IIS 7 running PHP 5.08. Everything works fine on this server. However my live (web server) is running Apache and PHP 5.12. The problem is when I try to request a RequestToken the HTTP_AUTHORIZATION variable isn't posted to the web server, so I get an error returned from the server saying 'Invaild Consumer Key'. There is clearly a problem with the way the server is setup (as the code works on my local server). The code I am using is from this walkthrough http://code.google.com/p/oauthconsumer/wiki/UsingOAuthConsumer I have tried dumping the PHP headers and indeed HTTP_AUTHORIZATION is missing. Can anyone tell me how to fix this? (as it's driving me mad :)) Thanks Rich

    Read the article

  • Null object that is not null

    - by Guillaume
    Hello, I use 2 threads to act like a produce/consumer using double queue (http://www.codeproject.com/KB/threads/DoubleQueue.aspx). Sometimes in my 2nd thread, I get an object that is NULL but it should not be as I filled it in the first thread. I tried this: if(myObject.Data == null) { Console.WriteLine("Null Object") // <-- Breakpoint here } When I my break point hits, I can watch myObject.Data and indeed it's NULL, but when I hit F10 and then go to the next line (which is } ) myObject.Data is not NULL. I also added a lock on myObject before if .... to be sure that no one whould use this object. How is that possible and what can I do ?

    Read the article

  • how to push data from BlazeDS without recieve message from Flex client?

    - by Teerasej
    Hi, everyone I am using BlazeDS for data-push feature in my Flex application project. From the official tutorial, Getting started with BlazeDS, it shows messaging example with producer/consumer from API. but how can I implement server side which doesn't need to be invoke from Flex client, but from within server-side instead. I got some idea but I don't know how to do because I'm a Flex developer, not Java developer, so I think you can help me. In Google, there's a tutorial show about I need to extend ServiceAdapter class in Java-side, which extends Invoke method. Do I need to extend other class instead of this to do what I want? How to configure the message-config.xml to get the result like I describe above?

    Read the article

  • Python File Meta Tag reading

    - by Jeff
    Anyone know of a Python module that can pull Tag data from multiple media formats? Trying to build an app that allows for manipulation of ASF (Windows Media Player files, ie WMA, WMV, etc), ID3, including both ID3v1 and ID3v2 (MPEG files, ie MP3), MPEG Audio Bit Stream (ie ABS, MP1, MP2, MP3), MPEG Program Stream (MPEG movies, and DVD and HD DVD video discs, ie MPG, MPEG, VOB, EVO), and ISO Base Media File Format (eg QuickTime, MPEG-4 and iTunes AAC files, ie QT, MOV, MP4, M4A, M4B, M4P, M4V, etc). Don't need ALL of that but just most standard consumer formats like mov and mpeg. I can't seem to find a good module to support that or a library. Any recommendations?

    Read the article

  • JMS Topic vs Queue - Intent

    - by Sandeep Jindal
    I am trying to understand on the design requirements for using Queue, and could not find this question (with answer). My understanding: Queue means one-to-one. Thus it would be used in a special case (if not rare, very few cases) when a designer is sure that the message would be intended for only one consumer. But even in those cases, I may want to use Topic (just to be future safe). The only extra case I would have to do is to make (each) subscription durable. Or, I special situations, I would use bridging / dispatcher mechanism. Give above, I would always (or in most cases) want to publish to a topic. Subscriber can be either durable topic(s) or dispatched queue(s). Please let me know what I am missing here or I am missing the original intent?

    Read the article

  • Using Google AppEngine app as a OAuth provider

    - by Alistair
    Hi, I'm using the Google AppEngine 1.3.4 SDK which offers to allow your application to act as a OAuth service provider (http://code.google.com/appengine/docs/python/oauth/). Setting up a standard application on my localhost and using the following: Request URL /_ah/OAuthGetRequestToken Authorize URL /_ah/OAuthAuthorizeToken Access Token URL /_ah/OAuthGetAccessToken The client application just gets sent to a page requesting to grant OAuth access even though no user is logged in. Clicking 'Grant access' results in a message saying 'OAuth access granted' with no tokens or anything exchange. Can't see how this could work when it's not even prompting for a login. As this functionality is quite new I can't find much out there. I've created a OAuth provider before in Rails and know that you need a Consumer Key and Secret, something that seems to be lacking in GAE? Any ideas on how to get OAuth working in a sample GAE project are most welcome.

    Read the article

  • TIBRV: Remote vs Local RVD

    - by jsw
    When connected to a local RVD a sending application is shielded from network interruptions and the send message methods will only block for the time it takes for the message to reach the local RVD process. With remote RVD the sending application is no longer shielded from network interruptions and the send message methods will block for the time it takes to hop across the network to reach the remote RVD process. Is my understanding correct? The documentation is vague regarding remote daemons. I'm mostly concerned with how reliable and performant the send message will be from the perspective of a sending application. Introducing unnecessary blocking on the client side due to sending a message (especially a network hop) is a big no-no in this application. The speed at which the messages reach the consumer is not of the utmost importance. With this in mind is a remote RVD out of the question?

    Read the article

  • What to name a method

    - by coffeeaddict
    I'm debating what to name this method. CloseCashTransaction(Cash.Id, -1, true); or CompleteCyberCashTransaction(Cash.Id, -1, true); or neither are good? In business terms/process by sending in these 3 values I'm essentially "closing the transaction" or "completing the transaction" in our workflow. However on the developer side, I cant' infer wtf "Complete" or "Close" means. It forces me to look into the internals of the method. My struggle is that I try to name methods to infer what they are doing. Complete is just way too general and forces the consumer of the method to dive into the code every time I use words like this. When I see stuff like this all over code, I have to take so much time to figure out what they are actually doing. And if the comments suck, I end up having to look at all logic in that method because the comments nor the method name really infer what's going on.

    Read the article

  • Disposing of Objects with long living dependencies

    - by Ray Booysen
    public class ABC { public ABC(IEventableInstance dependency) { dependency.ANewEvent += MyEventHandler; } private void MyEventHandler(object sender, EventArgs e) { //Do Stuff } } Let us say that an instance of ABC is a long living object and that my dependency is an even longer running object. When an instance of ABC needs to be cleaned up, I have two options. One I could have a Cleanup() method to unsubscribe from the ANewEvent event or I could implement IDisposable and in the Dispose unwire the event. Now I have no control over whether the consumer will call the dispose method or even the Cleanup method should I go that route. Should I implement a Finaliser and unsubscribe then? It feels dirty but I do not want hanging instances of ABC around. Thoughts?

    Read the article

  • Factory Method Pattern using Generics-C#

    - by nanda
    Just I am learning Generics.When i have an Abstract Method pattern like : //Abstract Product interface IPage { string pageType(); } //Concerete Product 1 class ResumePage : IPage { public string pageType() { return "Resume Page"; } } //Concrete Product 2 class SummaryPage : IPage { public string pageType() { return "SummaryPage"; } } //Fcatory Creator class FactoryCreator { public IPage CreateOnRequirement(int i) { if (i == 1) return new ResumePage(); else { return new SummaryPage(); } } } //Client/Consumer void Main() { FactoryCreator c = new FactoryCreator(); IPage p; p = c.CreateOnRequirement(1); Console.WriteLine("Page Type is {0}", p.pageType()); p = c.CreateOnRequirement(2); Console.WriteLine("Page Type is {0}", p.pageType()); Console.ReadLine(); } how to convert the code using generics?

    Read the article

  • Dotnetopenauth oAuth Service provider explanation

    - by ria
    I am a total newbie in the oAuth area and have set up DotNetOpenAuth to set up an oAuth Service provider. The sample provided in the DotNetOpenAuth download is quite confusing for me...maybe cos i am new to this stuff. There is one default page that creates a database and populates the database. Now I browse to the login.aspx and it asks me to put an openid, actually I want to use DNN (which implements DotNetOpenAuth) and i want to use those credentials on another site which will be the oAuth consumer. Can someone explain how to test the oAuth Service provider in the samples of DotNetOpenAuth?

    Read the article

  • .Net installation issue with SqlServerPipelineHost and SqlServer.DtsMsg

    - by Melody Friedenthal
    I added a web service consumer to a vb 2005 Windows app and tried to install it on another computer, which had an earlier version already installed (ClickOnce deployment). An error came up saying I needed to install Microsoft.SqlServer.PipelineHist in the GAC. I added PipelineHost to the list of references and marked it Copy Local = true, rebuilt the solution, published it and tried to install it on that other computer. This time it said I needed to install Microsoft.SqlServer.DtsMsg, however, that component does not show up on my list of .Net components. Where do I go from here? Thank you.

    Read the article

  • how to call any method of Project from classlibrary?

    - by Pankaj Mishra
    Hello I have Class Library Where a class of multithreading Of Producer and consumer based. private void WorkDeQueue() { while (true) { string Url = null; lock (locker) { if (queueList.Count > 0) { Url = queueList.Dequeue(); /* return if a null is found in the queue */ if (Url == null) return; } } if (Url != null) { /* if a job was found then process it */ GetData(Url); //This Is a Method } else { /* if a job was not found (meaning list is empty) then * wait till something is added to it*/ wh.WaitOne(); } } } this GetData method has no body on that class. How can i call any method of my project in palace of getdata. I tried with factory Pattern and also with reflection. but both didn't worked for me. So plz tell me how can i call any method of my project from here.

    Read the article

  • Passing parameters thru Ruby's OAuth

    - by JP
    I'm using Mirven's Twitter OAuth Sinatra example and trying to figure out how I can send a 'next page' parameter with the Oauth request: ie. The user attempts to visit /edit/profile which requires a login so I redirect to /request which deals with login via twitter - I now want to be able to redirect the user to the address they were originally looking for if they log in successfully. I thought I could do this in the .get_request_token line with this code: @request_token = @consumer.get_request_token({:oauth_callback => "http://#{request.host}/auth"},{:next => params['next'] || '/'}) But params has no additional items in the /auth handler. I'm new to OAuth, how would I go about doing this?

    Read the article

  • Avoiding dispose of underlying stream

    - by danbystrom
    I'm attempting to mock some file operations. In the "real" object I have: StreamWriter createFile( string name ) { return new StreamWriter( Path.Combine( _outFolder, name ), false, Encoding.UTF8 ) ); } In the mock object I'd like to have: StreamWriter createFile( string name ) { var ms = new MemoryStream(); _files.Add( Path.Combine( _outFolder, name ), ms ); return new StreamWriter( ms, Encoding.UTF8 ) ); } where _files is a dictionary to store created files for later inspection. However, when the consumer closes the StreamWriter, it also disposes the MeamoryStream... :-( Any thoughts on how to pursue this?

    Read the article

  • Is there a limit on the number of mutex objects that can be created in a Windows process?

    - by young-phillip
    I'm writing a c# application that can create a series of request messages. Each message could have a response, that needs to be waited on by a consumer. Where the number of outstanding request messages is constrained, I have used the windows EVENT to solve this problem. However, I know there is a limit on how many EVENT objects can be created in a single process, and in this instance, its possible I might exceed that limit. Does anyone know if there is a similar limit on creation of mutex objects or semaphores? I know this can be solved by some sort of pool of shared resources, that are grabbed by consumers when they need to wait, but it would be more convenient if each request message could have its own sync object.

    Read the article

  • Nested class with hidden constructor impossible in c#?

    - by luckyluke
    I' ve been doing some programming lately and faced an issue which i found weird in c#. (at least for me) public class Foo { //whatever public class FooSpecificCollection : List<Bar> { //implementation details } public FooSpecificCollection GetFoosStuff() { //return the collection } } I want the consumer of Foo to be able to obtain a reference to FooSpecificCollection, even perform some operations on it. Maybe even set it to some other property of Foo or smth like that, but not To be able to CREATE an instance of this class. (the only class that should be able to instatiate this collection should be Foo. Is my request really that far-fetched? I know that people way smarter defined c# but shouldn't there be such an option that a parent class can create a nested class instance but nobody else can't. So far I created a solution to make an abstract class, or interface available through the property and implement a concrete private class that is not available anywhere else. Is this a correct way to handle such a situation.?

    Read the article

  • Writing my own iostream utility class: Is this a good idea?

    - by Alex
    I have an application that wants to read word by word, delimited by whitespace, from a file. I am using code along these lines: std::istream in; string word; while (in.good()) { in>>word; // Processing, etc. ... } My issue is that the processing on the words themselves is actually rather light. The major time consumer is a set of mySQL queries I run. What I was thinking is writing a buffered class that reads something like a kilobyte from the file, initializes a stringstream as a buffer, and performs extraction from that transparently to avoid a great many IO operations. Thoughts and advice?

    Read the article

  • Soundcload API, PHP, and OAuth

    - by fedeisas
    Hi guys. I'm building a site, and I need to query my last two tracks from my soundcloud account and display them on my page. I've read the Soundcloud API documentation but it seems obscure and far from my reach. I've installed the PHP library for using the API and Oauth, and set up my SoundCloud application to get my Consumer Keys, but I can't start the OAuth session. I'm using this library. I was wondering if maybe you could hand me some sample code for doing this. That would be great!!

    Read the article

  • Can't Use Generic C# Class in Using Statement

    - by Eric J.
    I'm trying to use a generic class in a using statement but the compiler can't seem to treat it as implementing IDisposable. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.Objects; namespace Sandbox { public sealed class UnitOfWorkScope<T> where T : ObjectContext, IDisposable, new() { public void Dispose() { } } public class MyObjectContext : ObjectContext, IDisposable { public MyObjectContext() : base("DummyConnectionString") { } #region IDisposable Members void IDisposable.Dispose() { throw new NotImplementedException(); } #endregion } public class Consumer { public void DoSomething() { using (new UnitOfWorkScope<MyObjectContext>()) { } } } } Compiler error is: Error 1 'Sandbox.UnitOfWorkScope<Sandbox.MyObjectContext>': type used in a using statement must be implicitly convertible to 'System.IDisposable' I implemented IDisposable on UnitOfWorkScope (and to see if that was the problem, also on MyObjectContext). What am I missing?

    Read the article

  • Strategy in storing ad-hoc numbers/constants?

    - by Jiho Han
    I have a need to store a number of ad-hoc figures and constants for calculation. These numbers change periodically but they are different type of values. One might be a balance, a money amount, another might be an interest rate, and yet another might be a ratio of some kind. These numbers are then used in a calculation that involve other more structured figures. I'm not certain what the best way to store these in a relational DB is - that's the choice of storage for the app. One way, I've done before, is to create a very generic table that stores the values as text. I might store the data type along with it but the consumer knows what type it is so, in situations I didn't even need to store the data type. This kind of works fine but I am not very fond of the solution. Should I break down each of the numbers into specific categories and create tables that way? For example, create Rates table, and Balances table, etc.?

    Read the article

  • Better product to develop for, iPad or Android based tablet in a purely business related application

    - by Caylem
    Hey guys Just wondering what you'd suggest as the best platform for developing a business application for a tablet device. The application needs to be multitouch, have access to a maps API, a database on the device. It will not be going on sale in the app store or Androids market, it is purely for specific business task and not for the general consumer. Obviously the options seem to be iPhone OS and the iPad or Android and an Android tablet device. The form factor for the end product requires something in the region of 8 inch+ screen and enough processing power to provide a good experience for the end user. Any help would be much appreciated. Thanks

    Read the article

  • Posting to tumblr in PHP

    - by Sherif
    I am trying to make a test post to my tumblr blog with a php script (that will eventually be ran as a cron job) I have been browsing google and read many answers on here and the closest I found is explained in this post: Tumblr OAuth using PHP's OAuth class I am using the code in his tutorial here: http://vigrond.com/blog/2012/02/04/oauth-extension-php-and-the-tumblr-api/ Pretty much as is, replacing the blogurl with mine and of course the consumer and secret key. When I run the .php script via my browser however, nothing happens. Any ideas? EDIT: The only error I found in cPanel's error log is this: [Wed Oct 31 00:29:25 2012] [error] [client xx.xx.xx.xx ] PHP Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /path on line 14 But I fixed this and the error does not appear anymore.

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >