Search Results

Search found 808 results on 33 pages for 'greg mcnulty'.

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

  • How can I receive mouse events when a wrapped control has set capture?

    - by Greg
    My WndProc isn't seeing mouse-up notifications when I click with a modifier key (shift or control) pressed. I see them without the modifier key, and I see mouse-down notifications with the modifier keys. I'm trying to track user actions in a component I didn't write, so I'm using the Windows Forms NativeWindow wrapper (wrapping the component) to get Windows messages from the WndProc() method. I've tried tracking the notifications I do get, and I the only clue I see is WM_CAPTURECHANGED. I've tried calling SetCapture when I receive the WM_LBUTTONDOWN message, but it doesn't help. Without modifier (skipping paint, timer and NCHITTEST messages): WM_PARENTNOTIFY WM_MOUSEACTIVATE WM_MOUSEACTIVATE WM_SETCURSOR WM_LBUTTONDOWN WM_SETCURSOR WM_MOUSEMOVE WM_SETCURSOR WM_LBUTTONUP With modifier (skipping paint, timer and NCHITTEST messages): WM_KEYDOWN WM_PARENTNOTIFY WM_MOUSEACTIVATE WM_MOUSEACTIVATE WM_SETCURSOR WM_LBUTTONDOWN WM_SETCURSOR (repeats) WM_KEYDOWN (repeats) WM_KEYUP If I hold the mouse button down for a long time, I can usually get a WM_LBUTTONUP notification, but it should be possible to make it more responsive.. Edit: I've tried control-clicking outside of the component of interest and moving the cursor into it before releasing the mouse button, and then I do get a WM_LBUTTONUP notification, so it looks like the component is capturing the mouse on mouse-down. Is there any way to receive that notification when another window has captured the mouse? Thanks.

    Read the article

  • What setting needs to be made to make .Net Automation responsive?

    - by Greg
    Have an app that is looking for application windows being created on the desktop using class Unresponsive { private StructureChangedEventHandler m_UIAeventHandler = new StructureChangedEventHandler(OnStructureChanged); public Unresponsive() { Automation.AddStructureChangedEventHandler(AutomationElement.RootElement, TreeScope.Children, m_UIAeventHandler); } private void OnStructureChanged(object sender, StructureChangedEventArgs e) { Debug.WriteLine("Change event"); } } You can see the same issue using UISpy.exe, selecting the desktop and configuring scope for children and just the structure changed event. The problem I'm trying to resolve is that the events are not raised in a timely manner, there seems to be some grouping/delay which makes the app appear to be non responsive. If you start a new app with 1 window and wait a second you get the event, seems alright. If you start the same app several times without delay (say clicking on quickstart), it's not until all of the instances of the app get 'initialised' by the AutomationProxies that you get the notice for the first app (and in short order the other apps/windows). I've sat watching task manager as each instance of the app starts to grow as it is initialised, waiting until the last app is done and then seeing the events all come in. Similarly any time any apps are starting windows within a timeframe there seems to be some blocking. I can't see how to configure this timeframe, or get each structure changed event to be sent on as soon as it happens. Also, this process of listening for structure changed events seems to be leaking, just by listening there is a leak in native memory. (visible in UISpy and my app)

    Read the article

  • Rails: common approach for handling exceptions in restful actions on objects that have been destroye

    - by Greg
    It is very common in Rails for an objects_controller controller to have RESTful edit and destroy actions like so: def edit @object = Object.find(params[:id]) end def destroy @object = Object.find(params[:id]) @object.destroy redirect_to :back end With an associated view that provides edit and destroy links like so: <%= link_to "Edit the Object", edit_object_path(object) %> <%= link_to "Delete", object, :confirm => 'Are you sure?', :method => :delete %> And it is easy to blow this up. If I open two browser windows, A and B, destroy an object with the "Delete" link in browser A and then press the "Edit" link in browser B, the find() in the edit action throws an exception. Obviously there are several ways to deal with this in the edit action: catch the exception and recover gracefully use @object = find(:first, "conditions... etc. and test the @object before going further But seeing as this is such a common pattern, I would love to know how other folks deal with this situation.

    Read the article

  • Why does Int32.MaxValue * Int32.MaxValue == 1 ???

    - by Greg Balajewicz
    OK, I know, Int32.MaxValue * Int32.MaxValue will yield a number larger than Int32 BUT, shouldn't this statement raise some kind of an exception? I ran across this when doing something like IF (X * Y Z) where all are Int32. in X and Y are sufficiently large enough, you get a bogus value from X*Y Why is this so and how to get around this? besides casting everything to int64

    Read the article

  • can QuickGraph support these requirements? (includes database persistence support)

    - by Greg
    Hi, Would QuickGraph be able to help me out with my requirements below? (a) want to model a graph of nodes and directional relationships between nodes - for example to model web pages/files linked under a URL, or modeling IT infrastructure and dependencies between hardware/software. The library would include methods such as * Node.GetDirectParents() //i.e. there could be more than one direct parent for a node * Node.GetRootParents() //i.e. traverse the tree to the top root parent(s) for the given node * Node.GetDirectChildren() * Node.GetAllChildren() (b) have to persist the data to a database - so it should support SQL Server and ideally SQLite as well. If it does support these requirement then I'd love to hear: any pointers to any parts of QuickGraph to dig into? what is the best concept re it's usage in terms of how to use database persistence - is it a simpler design to assume every search/method works directly on the database, or does QuickGraph support smarts to be able to work in memory and the "save" to database all changes at an appropriate point in time (e.g. like ADO.net does with DataTable etc) Thanks in advance

    Read the article

  • how can I save/keep-in-sync an in-memory graph of objects with the database?

    - by Greg
    Question - What is a good best practice approach for how can I save/keep-in-sync an jn-memory graph of objects with the database? Background: That is say I have the classes Node and Relationship, and the application is building up a graph of related objects using these classes. There might be 1000 nodes with various relationships between them. The application needs to query the structure hence an in-memory approach is good for performance no doubt (e.g. traverse the graph from Node X to find the root parents) The graph does need to be persisted however into a database with tables NODES and RELATIONSHIPS. Therefore what is a good best practice approach for how can I save/keep-in-sync an jn-memory graph of objects with the database? Ideal requirements would include: build up changes in-memory and then 'save' afterwards (mandatory) when saving, apply updates to database in correct order to avoid hitting any database constraints (mandatory) keep persistence mechanism separate from model, for ease in changing persistence layer if needed, e.g. don't just wrap an ADO.net DataRow in the Node and Relationship classes (desirable) mechanism for doing optimistic locking (desirable) Or is the overhead of all this for a smallish application just not worth it and I should just hit the database each time for everything? (assuming the response times were acceptable) [would still like to avoid if not too much extra overhead to remain somewhat scalable re performance]

    Read the article

  • How do you write a consistent UI Automation for MS? MSAA & UI Automation don't seem to overlap.

    - by Greg
    Working on a general Automation tool, considering moving from Win32 Message hooks to .net UI Automation, however the feature set of UI Automation doesn't cover all we have in Win32 and still doesn't seem to support all the GUI on Windows. One such example is Windows Live Messenger. Windows Live messenger 2009 is still using the older DirectUIHwnd to draw the gui. This means that you can't use windows messages to send to the controls, because the controls don't have their own HWND. It also seems to defeat the new .net UI Automation framework though the documentation seems to make out as if it can be joined in the UI Automation and Microsoft Active Accessibility document. Looking at MS Accessibility pointed to Active Accessibility 2.0 SDK Tools which showed that MSAA can interact with the contents. Is there some trick to getting the older MSAA technology that UI Automation seems to be trying to replace to actually work with UI Automation? I'd rather not have multiple solutions trying to automate the same windows for windows unlike Windows Live Messenger where each of these techniques is valid and will work.

    Read the article

  • Setting up a "to-many" relationship value dependency for a transient Core Data attribute

    - by Greg Combs
    I've got a relatively complicated Core Data relationship structure and I'm trying to figure out how to set up value dependencies (or observations) across various to-many relationships. Let me start out with some basic info. I've got a classroom with students, assignments, and grades (students X assignments). For simplicity's sake, we don't really have to focus much on the assignments yet. StudentObj <--->> ScoreObj <<---> AssignmentObj Each ScoreObj has a to-one relation with the StudentObj and the AssignmentObj. ScoreObj has real attributes for the numerical grade, the turnInDate, and notes. AssignmentObj.scores is the set of Score objects for that assignment (N = all students). AssignmentObj has real attributes for name, dueDate, curveFunction, gradeWeight, and maxPoints. StudentObj.scores is the set of Score objects for that student (N = all assignments). StudentObj also has real attributes like name, studentID, email, etc. StudentObj has a transient (calculated, not stored) attribute called gradeTotal. This last item, gradeTotal, is the real pickle. it calculates the student's overall semester grade using the scores (ScoreObj) from all their assignments, their associated assignment gradeWeights, curves, and maxPoints, and various other things. This gradeTotal value is displayed in a table column, along with all the students and their individual assignment grades. Determining the value of gradeTotal is a relatively expensive operation, particularly with a large class, therefore I want to run it only when necessary. For simplicity's sake, I'm not storing that gradeTotal value in the core data model. I don't mind caching it somewhere, but I'm having a bitch of a time determining where and how to best update that cache. I need to run that calculation for each student whenever any value changes that affects their gradeTotal. If this were a simple to-one relationship, I know I could use something like keyPathsForValuesAffectingGradeTotal ... but it's more like a many-to-one-to-many relationship. Does anyone know of an elegant (and KVC correct) solution? I guess I could tear through all those score and assignment objects and tell them to register their students as observers. But this seems like a blunt force approach.

    Read the article

  • How to interpret Objective-C errors?

    - by Greg Maletic
    I'm getting the following error: 2010-05-11 17:46:28.475 MyApp[54112:5e1b] bool _WebTryThreadLock(bool), 0x140faa0: Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now... Is there any way for me to figure out where [54112:5e1b] is in my code, so I can try to narrow down the error? Thanks.

    Read the article

  • Contains performs MUCH slower with variable vs constant string MS SQL Server

    - by Greg R
    For some unknown reason I'm running into a problem when passing a variable to a full text search stored procedure performs many times slower than executing the same statement with a constant value. Any idea why and how can that be avoided? This executes very fast: SELECT * FROM table WHERE CONTAINS (comments, '123') This executes very slowly and times out: DECLARE @SearchTerm nvarchar(30) SET @SearchTerm = '123' SET @SearchTerm = '"' + @SearchTerm + '"' SELECT * FROM table WHERE CONTAINS (comments, @SearchTerm) Does this make any sense???

    Read the article

  • Domain model for an optional many-many relationship

    - by Greg
    Let's say I'm modeling phone numbers. I have one entity for PhoneNumber, and one for Person. There's a link table that expresses the link (if any) between the PhoneNumber and Person. The link table also has a field for DisplayOrder. When accessing my domain model, I have several Use Cases for viewing a Person. I can look at them without any PhoneNumber information. I can look at them for a specific PhoneNumber. I can look at them and all of their current (or past) PhoneNumbers. I'm trying to model Person, not only for the standard CRUD operations, but for the (un)assignment of PhoneNumbers to a Person. I'm having trouble expressing the relationship between the two, especially with respects to the DisplayOrder property. I can think of several solutions but I'm not sure of which (if any) would be best. A PhoneNumberPerson class that has a Person and PhoneNumber property (most closely resembles database design) A PhoneCarryingPerson class that inherits from Person and has a PhoneNumber property. A PhoneNumber and/or PhoneNumbers property on Person (and vis-a-versa, a Person property on PhoneNumber) What would be a good way to model this that makes sense from a domain model perspective? How do I avoid misplaced properties (DisplayOrder on Person) or conditionally populated properties?

    Read the article

  • how would I call/use Subsonic from within a WinForms app being deployed over clickonce (with Sqlite

    - by Greg
    Hi, Background - I need a framework/approach to managed database updates for a .NET Winforms app being deployed on users PC's via clickonce deploy. The app uses a sqlite database. Q1. What mechanism does Subsonic use to run such migrations on the local PC? e.g. would it be MSBuild Q2. If it does need a tool like how can my application robustly kick off MsBuild? i.e. how can it be sure what path it is installed, what if it is not installed, should I be including the MSBuild.exe in the clickonce package so that I know it is there for sure myself? Q3. Any other suggestions on how to use Subsonic in this specific use case? Q4. Any comments on whether MigratorDotNet would be a better fit? (if someone has had experience with both) Q5. Could I use subsonic's bare migration framework and just have a set of SQL files to do the upgrade/downgrade? i.e. just use the framework to check database version and which scripts to run etc?

    Read the article

  • c# hierarchy collection library? - anyone know of one (e.g. GetDirectChildren, GetAllChildren, GetPa

    - by Greg
    Hi, Does anyone know of a solid C# library / approach to manage a hierarchy/web type collection? This would be a library that would basic consist of the concept of nodes & relationships, for example to model web pages/files linked under a URL, or modeling IT infrastructure. It would have key methods such as: Node.GetDirectParents() Node.GetRootParents() Node.GetDirectChildren() Node.GetAllChildren() So it's smarts would include the ability to "walk the tree" of nodes based on the relationships when someone does ask for "give me all the children under this node" for example. It ideally include a persistence layer, to save/retrieve such data to/from a databases (e.g. with a Nodes and Relationships table). Thanks

    Read the article

  • Manual metrics and treemap components

    - by Greg
    I have a problem with SonarQube. I use web API to inject manual metrics values for a project like this : curl -u nom:password -d "resource=<projet>&metric=<key de la metric>&val=<valeur>" http://localhost:8081/sonar/api/manual_measures One of these metrics is a percentage and this metric is declared as a Percentage value in Sonar in Settings = Manual Metrics window. I have a project with components and each project and components have this metric value. When I want to show this metric as a color metric in a "treemap of components" of widget, all the treemap is grey (as if values are not defined). But if I put mouse on the name of component in treemap, I saw the color metric value as a percentage value like this : myComponent - ncloc: 800 - myMetric: 84,0% Moreover, scale metric color does not appear in treemap title (after Size ncloc Color <my metric>).

    Read the article

  • Is Lightweight Code Generation (LCG) dead?

    - by Greg Beech
    In the .NET 2.0-3.5 frameworks, LCG (aka the DynamicMethod class) was a decent way to emit lightweight methods at runtime when no class structure was needed to support them. In .NET 4.0, expression trees now support statements and blocks, and as such appear to provide sufficient functionality to build just about any functionality you could require from such a method, and can be constructed in a much easier and safer way than directly emitting CIL op-codes. (This statement is borne from today's experimentation of converting some of our most complex LCG code to use expression tree building and compilation instead.) So is there any reason why one would use LCG in any new code? Is there anything it can do that expression trees cannot? Or is it now a 'dead' piece of functionality?

    Read the article

  • what is a performance way to 'tree-walking' through my Entity Framework data

    - by Greg
    Hi, I have a Entity Framework design with a few tables that define a "graph". So there can be a large chain of relationships between objects in the few tables via concept of parent/child relationships. What is a performance way to 'tree-walking' through my Entity Framework data? That is I assume I wouldn't want to load the full set of all NODES and RELATIONSHIPS from the database for the purpose of walking the tree, where the end result may only be identifying leaf nodes? Or would this be OK with the way lazy loading may work at the column/parameter level? Else how could I load just the skeleton of the objects and then when needing to refer to any attributes have them lazy load then?

    Read the article

  • How to get an object from a list based upon IEqualityComparer<T>

    - by Greg
    The Compare method in Linq lets you find by an IEqualityComparer, but I can't find a counterpart method that allows you retrieve an item by the same comparer. Is this really the best way to do it? MyItem myFinderItem = new MyItem(keyField1, keyField2); if (myList.Contains(myFinderItem, new MyEqualityComparer())) { MyItem myRealItem = myList.Single(item => new MyEqualityComparer().Equals(item , myFinderItem)); } (I'm sharing the usage of the IEqualityComaprer with a call to the Except Linq method and I'd like to maintain a single source for equality comparisons)

    Read the article

  • iPhone: detect "touch-and-drag" gesture from UIBarButtonItem?

    - by Greg Maletic
    I have an "add" button that's represented by a UIBarButtonItem. Hitting the "add" button adds an object into a list that represents a moment in time. By default, that time is "now"...but I'd like to be able to use dragging behavior to let the user specify earlier times for the object. Here's the behavior I want to implement: If the user touches on the UIBarButtonItem and lets go quickly, an object is added to the list that represents "now." If the user touches on the UIBarButtonItem and drags, a little UI pops up that shows the time that the distance of their drag represents. The further they drag, the further back in time their touch will represent. When they let go, the object representing an earlier time will get added to the list. (Though the description of the behavior is complicated, I'm convinced this will be pretty intuitive for users of the app.) I haven't implemented code for anything but the most simple touches in the past, and I'm at a loss as to the best way to try this. Does anyone have any suggestions, or could point me towards some sample code that implements something like this? Thanks very much.

    Read the article

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