Search Results

Search found 18003 results on 721 pages for 'nidhinzz own'.

Page 91/721 | < Previous Page | 87 88 89 90 91 92 93 94 95 96 97 98  | Next Page >

  • How would you implement this "WorkerChain" functionality in .NET?

    - by Dan Tao
    Sorry for the vague question title -- not sure how to encapsulate what I'm asking below succinctly. (If someone with editing privileges can think of a more descriptive title, feel free to change it.) The behavior I need is this. I am envisioning a worker class that accepts a single delegate task in its constructor (for simplicity, I would make it immutable -- no more tasks can be added after instantiation). I'll call this task T. The class should have a simple method, something like GetToWork, that will exhibit this behavior: If the worker is not currently running T, then it will start doing so right now. If the worker is currently running T, then once it is finished, it will start T again immediately. GetToWork can be called any number of times while the worker is running T; the simple rule is that, during any execution of T, if GetToWork was called at least once, T will run again upon completion (and then if GetToWork is called while T is running that time, it will repeat itself again, etc.). Now, this is pretty straightforward with a boolean switch. But this class needs to be thread-safe, by which I mean, steps 1 and 2 above need to comprise atomic operations (at least I think they do). There is an added layer of complexity. I have need of a "worker chain" class that will consist of many of these workers linked together. As soon as the first worker completes, it essentially calls GetToWork on the worker after it; meanwhile, if its own GetToWork has been called, it restarts itself as well. Logically calling GetToWork on the chain is essentially the same as calling GetToWork on the first worker in the chain (I would fully intend that the chain's workers not be publicly accessible). One way to imagine how this hypothetical "worker chain" would behave is by comparing it to a team in a relay race. Suppose there are four runners, W1 through W4, and let the chain be called C. If I call C.StartWork(), what should happen is this: If W1 is at his starting point (i.e., doing nothing), he will start running towards W2. If W1 is already running towards W2 (i.e., executing his task), then once he reaches W2, he will signal to W2 to get started, immediately return to his starting point and, since StartWork has been called, start running towards W2 again. When W1 reaches W2's starting point, he'll immediately return to his own starting point. If W2 is just sitting around, he'll start running immediately towards W3. If W2 is already off running towards W3, then W2 will simply go again once he's reached W3 and returned to his starting point. The above is probably a little convoluted and written out poorly. But hopefully you get the basic idea. Obviously, these workers will be running on their own threads. Also, I guess it's possible this functionality already exists somewhere? If that's the case, definitely let me know!

    Read the article

  • Best Website Statistics tool for Drupal

    - by Olav
    What is the best free Website statistics setup I can have for Drupal 6 on Apache? Particularities: 1. Multisite install. Might want to look over several sites. Should be able to restrict view for clients to their own site. Some hits are bypassing Drupal. Some urls are not public. Some sites have little traffic, it would be nice to be able to exclude "own" traffic. Logged in users are not so important (It seems Google Analytics is popular)

    Read the article

  • Cannot resolve view when view is in subdirectory

    - by devzero
    We have a MVC 2.0 / c# 4.0 application that we develop visual studio. We have a part of the site (admin) that we have put in it's own sub directory and with its own routing rules: routes.Add("DomainRoute", new DomainRoute( ConfigurationManager.AppSettings["adminDomain"], // Domain with parameters "{controller}/{action}/{id}", // URL with parameters new { controller = "AdminPage", action = "Admin", id = "", isAdmin = true } We have all the views for the admin site inside an admin sub folder so that you get paths like: \views\admin\auth\login.aspx In the \controllers\admin\authController.aspx file I have a function called login: public ActionResult Login() { return View(); } This works just as it should, ie if i go admin.localhost\auth\login I go to the login page. But if I do a right click in visual studio and "go to view" i get an error "unable to go to matching view". Is there anyway to solve this?

    Read the article

  • Creating a PHP call home "time bomb" to protect my interests

    - by RC
    Hi everyone, I produced a PHP web app for a client some months back that is hosted on their own server. I have still not been paid for this work, and they are giving me the runaround. It turns out that I still have remote admin access to their server, so I can make code changes. What I was thinking of doing was to move the core kernel off-site onto one of my own servers, and program in some kind of callback or include that gets the kernel (critical functions) from my server. Give it two weeks or so for their backups to catch this change, and then pull the plug and exercise leverage. If I do this, they will pay immediately, because the site is a critical one for a very large and influential client of theirs. What is the most effective and easiest way of doing this? What code do I use? Thanks for any pointers.

    Read the article

  • What is the best method for implementing mouse wheel activity in Delph1 VCL forms?

    - by Brian Frost
    As a long time user of Delphi 7, I've rolled my own mouse wheel handling in a few controls but lately I've noticed that some recent applications only need the mouse cursor to be placed over a control (e.g a list box or tree view) for the mouse wheel activity to cause that control to scroll. This feels nice (as opposed to having to click focus a control before it responds to the wheel. Now I've moved to Delphi 2010 I'm wondering what is the 'correct' behaviour? And what can I use in Delphi that avoids me having to bodge this with my own solutions now? Thanks.

    Read the article

  • Mixing Matplotlib patches with polar plot?

    - by Roger
    I'm trying to plot some data in polar coordinates, but I don't want the standard ticks, labels, axes, etc. that you get with the Matplotlib polar() function. All I want is the raw plot and nothing else, as I'm handling everything with manually drawn patches and lines. Here are the options I've considered: 1) Drawing the data with polar(), hiding the superfluous stuff (with ax.axes.get_xaxis().set_visible(False), etc.) and then drawing my own axes (with Line2D, Circle, etc.). The problem is when I call polar() and subsequently add a Circle patch, it's drawn in polar coordinates and ends up looking like an infinity symbol. Also zooming doesn't seem to work with the polar() function. 2) Skip the polar() function and somehow make my own polar plot manually using Line2D. The problem is I don't know how to make Line2D draw in polar coordinates and haven't figured out how to use a transform to do that. Any idea how I should proceed?

    Read the article

  • How to configure IIS to serve my 404 response with my custom content?

    - by Marek
    This question is related to this, hopefully better phrased. I would like to serve a custom 404 page from ASP.NET MVC. I have the route handler and all the infrastructure set up to ensure that nonexistent routes are handled by a single action: public ActionResult Handle404() { Response.StatusCode = 404; return View("NotFound"); } Problem: IIS serves back its own content (some predefined message) when I set Response.StatusCode to 404 before returning the content. On the VS development web server, this works as intended - the status code of the HTTP response is 404 while my content (the NotFound view) is served. I believe that when the IIS processing pipeline sees that the application returns 404, it simply replaces the whole response with its own. What setting in IIS affects this behavior? I do not have access to the IIS installation so I can not investigate this - however, I can ask the hosting provider to tweak the configuration for me if I know what exactly needs to be changed.

    Read the article

  • How to represent datetime of deifferent time zomes in C#

    - by Mohoch
    Hi. I have a .NET WebService (written in C#), that is supposed to serve people around the world. With each request I get the user's datetime in his own time zone with the format : "yyyy/MM/dd HH:mm ZZZZ". I have to convert the string to something representing the original date and time and specifying the time zone in GMT. I have to make some logical calculations and keep it in the database. The regular DateTime doe's not support this. it does not have a property specifying the time zone. When I try to convert my string into DateTime - it simply converts it to my local time. I do not want to keep my time in UTC, because I have some logic that has to run per user by his own time. Does anyone know a C# class that handles this? Thanks!

    Read the article

  • what kind of credentials/prerequisites do you need to be a professional penetration tester ?

    - by dfafa
    does it take more than knowing Bt4 ? are there any one that just runs a scanner and no real labor involved ? would you be expected to be able to code your own exploits without having to dl from milw0rm and discover entry into a system by yourself, in other words, do you have to think outside the box even when there's so many tools that makes the job a lot easier ? would you ever be expected to be able to write your own scanners, exploits and etc ? i am also curious how people are able to write long pages of hex address, that magically causes some type of memory overflow...how are people guessing at the hex values for game hacks for instance ? are certification important ? what about formal school education ? I am a CS major.

    Read the article

  • diff implementation in Java

    - by Frór
    Hi, I'm looking for a diff implementation in Java. I've seen that Python has its own SequenceMatcher (with difflib), which is exactly what I need... in Java. Is there any portage? Or is there any other class/library that performs the same in Java? If not, where can I find the source code of that difflib (if free as in speech) to make my own implementation of SequenceMatcher in Java ? Unfortunately, Apache Commons Lang doesn't help me much. Thanks!

    Read the article

  • Using Core Data Concurrently and Reliably

    - by John Topley
    I'm building my first iOS app, which in theory should be pretty straightforward but I'm having difficulty making it sufficiently bulletproof for me to feel confident submitting it to the App Store. Briefly, the main screen has a table view, upon selecting a row it segues to another table view that displays information relevant for the selected row in a master-detail fashion. The underlying data is retrieved as JSON data from a web service once a day and then cached in a Core Data store. The data previous to that day is deleted to stop the SQLite database file from growing indefinitely. All data persistence operations are performed using Core Data, with an NSFetchedResultsController underpinning the detail table view. The problem I am seeing is that if you switch quickly between the master and detail screens several times whilst fresh data is being retrieved, parsed and saved, the app freezes or crashes completely. There seems to be some sort of race condition, maybe due to Core Data importing data in the background whilst the main thread is trying to perform a fetch, but I'm speculating. I've had trouble capturing any meaningful crash information, usually it's a SIGSEGV deep in the Core Data stack. The table below shows the actual order of events that happen when the detail table view controller is loaded: Main Thread Background Thread viewDidLoad Get JSON data (using AFNetworking) Create child NSManagedObjectContext (MOC) Parse JSON data Insert managed objects in child MOC Save child MOC Post import completion notification Receive import completion notification Save parent MOC Perform fetch and reload table view Delete old managed objects in child MOC Save child MOC Post deletion completion notification Receive deletion completion notification Save parent MOC Once the AFNetworking completion block is triggered when the JSON data has arrived, a nested NSManagedObjectContext is created and passed to an "importer" object that parses the JSON data and saves the objects to the Core Data store. The importer executes using the new performBlock method introduced in iOS 5: NSManagedObjectContext *child = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType]; [child setParentContext:self.managedObjectContext]; [child performBlock:^{ // Create importer instance, passing it the child MOC... }]; The importer object observes its own MOC's NSManagedObjectContextDidSaveNotification and then posts its own notification which is observed by the detail table view controller. When this notification is posted the table view controller performs a save on its own (parent) MOC. I use the same basic pattern with a "deleter" object for deleting the old data after the new data for the day has been imported. This occurs asynchronously after the new data has been fetched by the fetched results controller and the detail table view has been reloaded. One thing I am not doing is observing any merge notifications or locking any of the managed object contexts or the persistent store coordinator. Is this something I should be doing? I'm a bit unsure how to architect this all correctly so would appreciate any advice.

    Read the article

  • Reading web-service information from assembly app.config file

    - by Benjamin Ortuzar
    I have a plugin architecture solution written in .NET C# 3.5, where each plug-in is an assembly loaded by the main project. Each plug-in connects to a different web-service, so I would like to have the configuration of that plugin in its own plugin.dll.config file instead of having it in the app.config of the main project. I have been looking around and I saw that i could load from each class its own config file: // Get the application configuration file. System.Configuration.Configuration config = ConfigurationManager.OpenMappedExeConfiguration(fileMap,userLevel) I see how that would help me get the basic settings from the appSettings section, but I cant see a way to read the web-service information stored in the plugin.dll.config file. Any help on how to approach this situation is very welcome.

    Read the article

  • How can I make another application's window transparent?

    - by Sil
    I know how to make my own application transparent using Layered Windows but I want to make a different application transparent (for example notepad). I wrote code like this but it doesn't work with other windows except my app main window: SetWindowLongPtr(WindowFromPoint(p), GWL_EXSTYLE, GetWindowLongPtr(hWnd, GWL_EXSTYLE) | WS_EX_LAYERED); SetLayeredWindowAttributes(WindowFromPoint(p), 0, (255 * 50) / 100, LWA_ALPHA); where p is a point on screen ( for example the window I select with my mouse ) I am also interested if there is a way to do this directly from Windows 7 (not necessarily programmatic). I figure there must be a way to do it since every application is rendered in it's own surface and DWM composites them into the final image.

    Read the article

  • What are some "mental steps" a developer must take to begin moving from SQL to NO-SQL (CouchDB, Fath

    - by Byron Sommardahl
    I have my mind firmly wrapped around relational databases and how to code efficiently against them. Most of my experience is with MySQL and SQL. I like many of the things I'm hearing about document-based databases, especially when someone in a recent podcast mentioned huge performance benefits. So, if I'm going to go down that road, what are some of the mental steps I must take to shift from SQL to NO-SQL? If it makes any difference in your answer, I'm a C# developer primarily (today, anyhow). I'm used to ORM's like EF and Linq to SQL. Before ORMs, I rolled my own objects with generics and datareaders. Maybe that matters, maybe it doesn't. Here are some more specific: How do I need to think about joins? How will I query without a SELECT statement? What happens to my existing stored objects when I add a property in my code? (feel free to add questions of your own here)

    Read the article

  • Get command object

    - by user198147
    Hi all, I am writing a spring 2.5 application and in my jsp I'm writing my own tags. It's about a list of objects...when I change the number of rows that list shows(a combobox), I am doing a submit on my form returning back to the view(obviosly with the new number of rows returned). When listing with my own tags I need to get the properties from my command object. I have access to the pageContext object but I can't figure where the command object is stored. Could someoane please help me? Thanks in advance, Luisa

    Read the article

  • Learning Objective-C 2.0 and ASP.NET 4.0 simultaneously?

    - by Sahat
    (HOBBY) I own a Macbook Pro and iPod Touch so developing iPhone/iPod/iPad apps seems like a logical thing to do in order to get some experience in the programming field. Besides I want to write a new application similar to the Capsuleer (Character skills monitor app for EVE Online MMO) but with more features. It's something I'd love to have on my own iPod Touch and I am sure other people will welcome a new EVE Online app for their iPhone or iPod Touch. (CAREER) I want to learn ASP.NET (and possibly Silverlight later on) for my potential future job. I plan to work in the .NET field, so it's a good idea for me to start learning C# and ASP.NET ASAP. Is it a good idea to learn completely unrelated technologies at the same time? Or would it be better to learn one thing at a time? Objective-C first, and ASP.NET second. Or vice versa. Thanks, Sahat

    Read the article

  • Most common software development mistakes

    - by hgulyan
    Inspired by Dealing with personal failure, I remembered my own failed software development experience. Finally I agreed to rewrite existing application. It took me less than a week to rewrite existing app and more up to 2 months to write from zero my own. That 2 months were really hard and interesting. It was my first big software development process. I researched almost everything concerning to my application. Read Code Complete. Even some articles on how to create user interface. Some psychology stuff. Typography, Colors. DAL, DB Structure, SOA, Patterns, UML, Load testing etc. I hope, that after a month or 2 I would get opportunity to continue working on my failed project, but before that, I would like to ask: What are common mistakes in software development? What you shouldn't do in any case?

    Read the article

  • Best practice when working with web services that return objects?

    - by Raj
    Hello, I'm currently working with web services that return objects such as a list of files e.g. File array. I wanted to know whether its best practice to bind this type of object directly to my front end code for example a repeater/listview or whether to first parse it into my own list of "file class" e.g. customFiles[] If the web service changes then it will break my front end code, however if I create my own CustomFile class, then i would only need to change my code in one place to fix the issue, but it just seems like a lot of extra work to create the same classes from a web service, i wanted to know what is the best practice for this type of work. thanks Raj.

    Read the article

  • CMS + Blog engines for personal website

    - by Shawn Mclean
    I want to create a personal website where I show off my work, write blog posts, etc. I dont want to create my own, but I'm seeking one flexible enough for me to write my own codes for it if needed. For eg, I'd like to create a page with jquery functionality and backend code. Features I'm looking for: Blog engine similiar to wordpress OpenId login (comments, etc) Exporting content in an event I want to switch engines. I have alot of knowledge in .net and small amount in php, so any of these frameworks can work for me.

    Read the article

< Previous Page | 87 88 89 90 91 92 93 94 95 96 97 98  | Next Page >