Search Results

Search found 3168 results on 127 pages for 'grand central dispatch'.

Page 100/127 | < Previous Page | 96 97 98 99 100 101 102 103 104 105 106 107  | Next Page >

  • Help me find article on Multi-threading and Event Handling in Java

    - by JDR
    I once read an article on how to properly write event handlers for multi-threading in Java, but I can't for the life of me find it anymore. It described the pitfalls and potentials for deadlocks that can occur when firing events (not Swing events mind you, but general events like model update notifications). To clarify, the situation would be as such: // let's say this is code from an MVC model somewhere public void setSomeProperty(String myProperty){ if(!this.myProperty.equals(myProperty)){ this.myProperty = myProperty; fireMyPropertyChangedEvent(...); } } The article described how passing control to arbitrary external listener code was a potential cause for deadlock. I now find myself in a situation where I need to fire such events in a multithreaded environment and I would very much like to read the article again to see what it has to say before I continue. Does anyone know the article I'm referring to? I believe it came as a (fairly short) PDF. It started off with an initial naive implementation and incrementally pointed out flaws and improved upon it. It ended with a sort of final proper-way-to-fire-multithreaded-events. I've searched endlessly in my browse history and on google, but all I could find were endless amounts topics on Swing event dispatch threads. Thank you.

    Read the article

  • operator overloading and inheritance

    - by user168715
    I was given the following code: class FibHeapNode { //... // These all have trivial implementation virtual void operator =(FibHeapNode& RHS); virtual int operator ==(FibHeapNode& RHS); virtual int operator <(FibHeapNode& RHS); }; class Event : public FibHeapNode { // These have nontrivial implementation virtual void operator=(FibHeapNode& RHS); virtual int operator==(FibHeapNode& RHS); virtual int operator<(FibHeapNode& RHS); }; class FibHeap { //... int DecreaseKey(FibHeapNode *theNode, FibHeapNode& NewKey) { FibHeapNode *theParent; // Some code if (theParent != NULL && *theNode < *theParent) { //... } //... return 1; } }; Much of FibHeap's implementation is similar: FibHeapNode pointers are dereferenced and then compared. Why does this code work? (or is it buggy?) I would think that the virtuals here would have no effect: since *theNode and *theParent aren't pointer or reference types, no dynamic dispatch occurs and FibHeapNode::operator< gets called no matter what's written in Event.

    Read the article

  • How to best manage multi-frame MovieClips with classes?

    - by Arms
    After switching to AS3, I've been having a hell of a time figuring out the best way to manage MovieClips that have UI elements spread across multiple frames with a single class. An example that I am working on now is a simple email form. I have a MovieClip with two frames: the 1st frame has the form elements (text inputs, submit button) the 2nd frame has a "thank you" message and a button to go back to the first frame (to send another email) In the library I have linked the MovieClip to a custom class (Emailer). My immediate problem is how do I assign a MouseEvent.CLICK event to the button on the 2nd frame? I should note at this point that I am trying to avoid putting code on the timeline (except for stop() calls). This is how I am 'solving' the problem now: Emailer registers an event listener for a frame change ( addEventListener("frame 2", onFrameChange) ) On the 2nd frame of the MovieClip I am calling dispatchEvent(new Event("frame 2")); (I would prefer to not have this code on the frame, but I don't know what else to do) My two complaints with this method are that, first I have calls to addEventListener spread out across different class methods (I would rather have all UI event listeners registered in one method), and second that I have to dispatch those custom "onFrameChange" events. The second complaint grows exponentially for MovieClips that have more than just 2 frames. My so called solution feels makes me feel dirty and makes my brain hurt. I am looking for any advice on what to do differently. Perhaps there's a design pattern I should be looking at? Should I swallow my pride and write timeline code even though the rest of my application is written in class files (and I abhor the Flash IDE code editor)? I absolutely LOVE the event system, and have no problem coding applications with it, but I feel like I'm stuck thinking in terms of AS2 when working with mutl-frame movieclips and code. Any and all help would be greatly appreciated.

    Read the article

  • Using View multiple times in Interface Builder

    - by user1396236
    I'm using a UITableview and have a custom Cell with some labels. I set up all the constraints in Interface Builder. Now I'm using this Cell multiple times, I just copied it in IB. Now it's the time to change some of these contraints because of some bugs (I'm converting a iPhone App to an Universal). But it can't be right that I now have to set the constraints manually for every cell? How do I do right? If I want to control the constraints in one central place, do I have to set them up in Code? I would really not like that! Thanks in advance.

    Read the article

  • Network Communication program in python

    - by lamnep
    Hi all, Basically what I'm trying to achieve is a program which allow users to connect to a each other over a network in, essentially, a chat room. What I'm currently struggling with is writing the code so that the users can connect to each other without knowing the IP-address of the computer that the other users are using or knowing the IP-address of a server. Does anyone know of a way in which I could simply have all of the users scan the IP range of my network in order to find any active 'room' and then give the user a chance to connect to it? Also, the hope is that there will be no need for a central server to run this from, rather every user will simply be connected to all other user, essentially being the server and client at the same time.

    Read the article

  • How does unbundle work

    - by Ashithraj
    Before explaining my problem let me tell you the Mercurial setup, We have the following repos, RELEASE DEVELOPMENT BUGFIX All the above repo are running on a central server using IIS and hgwebdir.cgi Now coming to the problem, I clone a local repo from DEVELOPMENT repo. I make changes to the clone and commit (Not push). I make a bundle from the clone and pass the bundle to QA who has cloned the RELEASE repo. Now I try to apply the bundle to the RELEASE repo clone using hg unbundle I get an error, abort: error: ftp error: no host given What am I doing wrong? Can you give solution to the above problem keeping a Windows setup in mind?

    Read the article

  • Get the size of a Silverlight window

    - by Aidenn
    Hey! I'm creating a Silverlight 4 Out Of Browser application. I have my MainPage that will be the "central" application. I want to be able to display another Control next to the MainPage, by using a Popup and I want it to be displayed right next to the MainPage. How can I get the coordinates of the upper right corner of the MainPage at each moment? (Beware that this MainPage can be moved all over the screen and hence I will need to dynamically get the corner coordinates, in order to display my popup right next to the main window). Any thoughts on this? Thank you!! PS: the code is in C# :-)

    Read the article

  • Ideas on limiting content to single printed page?

    - by James Skidmore
    I have 5-6 text areas that users fill out in a template (a couple of columns, basically a newsletter format). I'm needing to limit their content to one printed page, but I'm having a hard time coming up with practical solutions. The printed format (margin, font size, etc.) will be the same for all users, as it's printed from a central source. I've had a couple of ideas, but all of them seem rather unreliable and difficult to implement: Determine height of content using JavaScript and estimate the number of printed pages from that. The problem with this is that browser font sizes can vary, it's only a rough estimate (pixels to inches), etc. Limit the number of characters. This is problematic because there are various text fields, certain characters (like M) take up more space than others (like I), and line breaks obviously count for much more. What ideas do you all have? I appreciate your help!

    Read the article

  • when is a v-table created in C++?

    - by saminny
    When exactly does the compiler create a virtual function table? 1) when the class contains at least one virtual function. OR 2) when the immediate base class contains at least one virtual function. OR 3) when any parent class at any level of the hierarchy contains at least one virtual function. A related question to this: Is it possible to give up dynamic dispatch in a C++ hierarchy? e.g. consider the following example. #include <iostream> using namespace std; class A { public: virtual void f(); }; class B: public A { public: void f(); }; class C: public B { public: void f(); }; Which classes will contain a V-Table? Since B does not declare f() as virtual, does class C get dynamic polymorphism?

    Read the article

  • How do I insert XML into another XML file with XSLT?

    - by Sandra
    Hello, I looked at this thread to find out how to insert XML into XML with XSLT http://stackoverflow.com/questions/862954/insert-xml-node-at-a-specific-position-of-an-existing-document But I have a problem since I need to insert XML between two grand child nodes. For example I want to insert <s>...</s> between <r>...</r> and <t>...</t> in this file <root> <child1> <a>...</a> <r>...</r> <t>...</t> <z>...</z> </child1> </root> to create this file <root> <child1> <a>...</a> <r>...</r> <s>...</s> <t>...</t> <z>...</z> </child1> </root> Thanks for your help.

    Read the article

  • how to make a border area go around the content of a page where there is a footer fixed to the bottom of the page and an header fixed to the top

    - by user277498
    consider the following: http://jsfiddle.net/PxabT/10/ There are 3 divs hd, bd, ft. hd is fixed to the top. ft is fixed to the bottom. I want the lime colored border to go totally around the white central area without increasing the height of the ft or hd divs. How do I achieve that? Many thanks! edit: see http://jsfiddle.net/PxabT/15/ which is a step forward by changing the borders to padding.

    Read the article

  • The right approach to loading dynamic content into a UITableView in iOS

    - by OS.
    ok, I've read tons of bits and pieces on the subject of loading dynamic content (from the web) into a UITableView and the problem with calculating cell height upfront. I've tried different simple implementations but the problem persists... Assuming I need to read a JSON file from the web, parse it into 'item' objects, each with variable size image and various text labels, here is what I believe would be the right approach to avoid long hang time of the app while everything is loading: on app load read JSON file and parse into items array provide only small part of the items array to the tableview (about 10 items) - since I need to load the images associated with each item to calculate cell height - I don't want the view to go through the whole items list and load all images - this hangs the app until every image is loaded display the tableview with the available cells (assuming I load a few 'spare' ones, user can even scroll to more items) in the background using Grand Central Dispatch download images for all/some of the remaining items and then reload the tableview with the new data (repeat step 4 if item list is very long) Step 2 above is necessary since I have no way to calculate the cell height without loading the images first, and since tableview first calculates height of all cells it may take a very long time to download all images for all items. Would you say this is the right approach? am I missing something?

    Read the article

  • Distributing requests to Selenium Grid RC's?

    - by intervigil
    I've got a situation here where I have a central selenium grid hub, and several RC's running on my gogrid account. When I access it to run tests, it basically queues all the incoming test requests and executes them serially on only one of the RC's, instead of spreading them out to use available RC's. The tests come from multiple projects, so I'm not looking to parallelize the tests themselves, just to split the requests that come from multiple projects across the multiple RC's. From everything I've read, it seems like selenium grid should be doing this already, yet I only see one RC used to run every single test. Is there something I'm missing?

    Read the article

  • SQL Server concurrency and generated sequence

    - by Goyuix
    I need a sequence of numbers for an application, and I am hoping to leverage the abilities of SQL Server to do it. I have created the following table and procedure (in SQL Server 2005): CREATE TABLE sequences ( seq_name varchar(50) NOT NULL, seq_value int NOT NULL ) CREATE PROCEDURE nextval @seq_name varchar(50) AS BEGIN DECLARE @seq_value INT SET @seq_value = -1 UPDATE sequences SET @seq_value = seq_value = seq_value + 1 WHERE seq_name = @seq_name RETURN @seq_value END I am a little concerned that without locking the table/row another request could happen concurrently and end up returning the same number to another thread or client. This would be very bad obviously. Is this design safe in this regard? Is there something I can add that would add the necessary locking to make it safe? Note: I am aware of IDENTITY inserts in SQL Server - and that is not what I am looking for this in particular case. Specifically, I don't want to be inserting/deleting rows. This is basically to have a central table that manages the sequential number generator for a bunch of sequences.

    Read the article

  • Problem on style a button

    - by BTGMarco
    Hello i am new on Silverlight, i tring to make a base for a button and that button will change the central image accoring to the situation, however some parts will continue the same, for this reason i make a UserControl and i call that user Control from the code and add to the grid that i need. But this Usercontrol that i am trying to add have a style pre-defined and i don´t geted how i change de image background. Here are the code that i am using; ModelsBase teste = new ModelsBase(); Image img = new Image(); img.Source = new BitmapImage(new Uri("../../Images/person.png", UriKind.RelativeOrAbsolute)); img.Stretch = Stretch.Fill;img.ImageOpened += new EventHandler<RoutedEventArgs>(img_ImageOpened); img.Height = img.Width = 128; teste.Conteudo.HorizontalAlignment = HorizontalAlignment.Left; this.ContentModels.Children.Add(teste); The envent img_ImageOpened is called so the image is loaded, but not is displayed. Sorry for bad english If someone find out where is the problem, please aswer

    Read the article

  • Picking a front-end UI framework

    - by user457724
    Hi folks, We're working to build the front-end of our application and struggling with selecting a good UI framework since we're not experienced UI people (we're mainly back-end developers). The central issue is that we don't know what we don't know and don't know how to best weigh our different options. At the moment, we're evaluating Flex, ExtJS, and Vaadin. Is there another option we should consider? What, are the major elements we should evalutate on? Any insight would be helpful. Thanks, Alex

    Read the article

  • Should we use Nexus or Artifactory for a Maven Repo?

    - by John Stauffer
    We are using Maven for a large build process ( 100 modules). We have been storing our external dependencies in source control, and using that to update a local repo. However, we are ready to graduate to a local repo that can cache central so that we don't have to proactively download all 3rd parties (but we can still have a local repo to pull from). In addition we want to publish our internal build artifacts from a nightly build so that developers don't have to build the world. We are considering Nexus and Artifactory. What are the reasons for preferring one over the other? Are there others we should be considering?

    Read the article

  • Best way to use the same HTML on static web-pages

    - by John
    If you use dynamic pages like JSP or asp.net, you can have your page template included, and then content added. But what if you have no server-side component and all pages are just HTML/JS? You can of course create a template then copy it for each page, but then if you want to change something you risk having to modify every page, even if you put most styling in CSS properly. Are there any non-awful ways to do this? I could see that an iframe could be used to load the content into the central page but that sounds nasty. Does HTML provide any way to include a base file and add to it?

    Read the article

  • advanced css: top and bottom with flexible centre

    - by Haroldo
    is it possible with just css2 to have the following: all the content to be in the flexible div.mid section overlap the top and bottom parts not fussed about ie6 here's the photoshop with centre slice: as you can see the top and bottom parts are quite large and i need to overlap them from the middle slice... Please dont misunderstand here, i understand how to make a flexible central div, the complexity is in the overlapping of the top and bottom while the mid div remains flexible. I imagine it requires either negative margins or absolutely position top and bottoms elements with z-index..

    Read the article

  • [ADVICE] .NET Desktop Application - Client Server C#, SQL

    - by Rillanon
    Hi guys, Recently I've being given a chance to develop a PMS (Practice Management System) software for a small physiotherapy clinic. I'm a computer science student and my course is predominately told on Linux. However, my client runs all their computers on vista or Windows 7. My ideas are to develop the client front end in Visual C# and access a central postgresql server. I'm a beginner in Windows Programming so I'm after advice on best practice on implement user rights and access levels in C# (WPF or Windows FORM). I've had a look into Credential class in Visual C# and access control list but please share your thoughts. I'm probably way over my head on this but this is my first commercial project so I'm keen to test the waters. Cheers Ian

    Read the article

  • What do I need to know before working on an IM application?

    - by John
    I'm looking into building an IM-type application using Java stack (for the server at least). I'd be interested to see any information/advice on how applications like Skype/AIM/MSN work, as well as know any technologies/APIs that might be relevant. Without giving away the idea itself, it's perhaps more akin to Google Wave than Skype, but information useful for either is very welcome. Specific points I have already thought of include: Server Vs P2P... for reasons of logging my system will require all communication to go through a central server. Is this how other IM tools work... especially when audio/video comes into the equation? Cross-communication with other systems. Are there APIs for this or do all IM providers work hard to keep their protocol secret? The nature of what I'm designing means integration could probably only be limited, but it definitely seems worthwhile from a business perspective

    Read the article

  • Client to server data upload

    - by RickBowden
    I'm trying to design a system similar to the traditional server monitoring systems like MOM, Tivoli, Open View, where an agent will record data and then upload it to a central database once a day, but them also be able to send immediate alerts back to the server. I'm not sure what the best methodology might be for this. I've started looking at Microsoft sync services but I'm not sure if it will fit my needs. I'm using VS2008 and C#. Does anyone have any experience or ideas about how I should go about this task?

    Read the article

  • database encryption questions

    - by 5YrsLaterDBA
    We are using Sybase SQL Anywhere 11. We need to encrypt some of our tables in our database. I followed the instruction and did it. We selected the "strong" option with encryptionKey and AES256_FIPS algorithm. But there are something I am not clear about them. It will require encryptonKey when we create the database, remove the database and start the database server but it will NOT require encryptionKey when we stop the database server and connect to the server to create tables and add data. Why there is NO encryptionKey asked when we connect to it or try to stop the server? I am doing something wrong? don't know how to test the encryption? I still can see all plain text in the encrypted tables when I use Sybase Central tool. If somebody knows the database user name and password, he/she can connect to the database and read the content without the encryptionKey. is this right?

    Read the article

  • SqlDataAdapter.Fill suddenly taking a long time

    - by WraithNath
    I have an application with a central DataTier that can execute a query to a data table using an SQLDataAdapter. None of this code has changed but now all queries are taking at least 10x as long to execute a query returning even one record. The only difference is that I have been using the app in a VM but the issue has started mid way through using the application. eg, the speed issue has not manifested itself from the start of using the VM, rather half way through. Has anyone else had an issue with the SQL Data Adapter taking a long time to fill for no reason? executing the query in Management studio it runs in less than a second. Firewalls are disabled

    Read the article

  • Retrieving images when database is in remote location...

    - by sasidhar
    Hi everyone, I am developing an application using java, my application would be accessed by number of different users simultaneously and the database resides in a central server. The access of the database from remote server is handled by just giving the appropriate IP of the server in the hibernate configure file. My question is, i have to store a picture regarding each user of the database, i heard that storing the image in the database and retrieving it from the database is not advised and has negative impact on the performance. Is it so ? What are the other possible ways i can implement this ? What is the best way to do it..? Please help....

    Read the article

< Previous Page | 96 97 98 99 100 101 102 103 104 105 106 107  | Next Page >