Search Results

Search found 66 results on 3 pages for 'reese mclean'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • VS debugging and watching a variable for changes

    - by Shawn Mclean
    I have a property inside a class that is getting changed by something. The only place I change the value of this code is a line that looks like this: pushpin.Position.Altitude = -31; During visual studio debugging, is there a way to watch .Altitude for any changes made, preferably it breaks at the assignment statement that changes the value. If this is the correct way to track down this problem, could I have a step-by-step tutorial/instruction on how to do this? Thanks.

    Read the article

  • Override asbolute position on child container (modal window)

    - by Shawn Mclean
    I have a modal window that is pulled from the server and inserted into a container that is absolute positioned. When that window is triggered to open, it does not display properly, it positions itself inside the container and most of it is hidden. Is there a specific css to be written for the container of the modal window (MyModalWindow). My code is as follows: <div style="position:relative;"> <div style="position: absolute;"> <div id="MyModalWindow"> </div> </div> </div> This is a jquery tools window.

    Read the article

  • Add child to existing parent record in entity framework.

    - by Shawn Mclean
    My relationship between the parent and child is that they are connected by an edge. It is similiar to a directed graph structure. DAL: public void SaveResource(Resource resource) { context.AddToResources(resource); //Should also add children. context.SaveChanges(); } public Resource GetResource(int resourceId) { var resource = (from r in context.Resources .Include("ToEdges").Include("FromEdges") where r.ResourceId == resourceId select r).SingleOrDefault(); return resource; } Service: public void AddChildResource(int parentResourceId, Resource childResource) { Resource parentResource = repository.GetResource(parentResourceId); ResourceEdge inEdge = new ResourceEdge(); inEdge.ToResource = childResource; parentResource.ToEdges.Add(inEdge); repository.SaveResource(parentResource); } Error: An object with the same key already exists in the ObjectStateManager. The existing object is in the Unchanged state. An object can only be added to the ObjectStateManager again if it is in the added state. Image: I have been told this is the sequence in submitting a child to an already existing parent: Get parent - Attach Child to parent - submit parent. That is the sequence I used. The code above is extracted from an ASP.NET MVC 2 application using the repository pattern.

    Read the article

  • Override absolute position on child container (modal window)

    - by Shawn Mclean
    I have a modal window that is pulled from the server and inserted into a container that is absolute positioned. When that window is triggered to open, it does not display properly, it positions itself inside the container and most of it is hidden. Is there a specific css to be written for the container of the modal window (MyModalWindow). My code is as follows: <div style="position:relative;"> <div style="position: absolute;"> <div id="MyModalWindow"> </div> </div> </div> This is a jquery tools window and attaches the following style to MyModalWindow when it shows.: element.style { display:block; left:183.5px position:absolute; top:468.4px; z-index:9999; } I basically need the div to not be a child of the parent, since as jquery calculates it to be positioned at the center of the webpage no matter where the div is.

    Read the article

  • Where to store application global variable?

    - by Shawn Mclean
    I'm using silverlight, project structure is similiar to any other .net app. I have a map control that I would like to store what mode it is in (either road or aerial) so that other controls can access this. Where do I put this enum variable, I plan to use 2 way binding on it so both are updated when either changes. Thanks.

    Read the article

  • Asp.net mvc getting partial view inside another view folder

    - by Shawn Mclean
    I have inside a controller PostLogicController.cs public ActionResult GetCreateNormalPost() { return PartialView("CreateNormalPost", null); } CreateNormalPost is inside the folder Post (which belongs to another post controller). How do I go about returning the CreateNormalPost.ascx? My folders are structured as follows: Controllers PostController.cs PostLogicController.cs Views Post Index.aspx CreateNormalPost.ascx There is no folder for PostLogicController.

    Read the article

  • Fetching Strategy example in repository pattern with pure POCO Entity framework

    - by Shawn Mclean
    I'm trying to roll out a strategy pattern with entity framework and the repository pattern using a simple example such as User and Post in which a user has many posts. From this answer here, I have the following domain: public interface IUser { public Guid UserId { get; set; } public string UserName { get; set; } public IEnumerable<Post> Posts { get; set; } } Add interfaces to support the roles in which you will use the user. public interface IAddPostsToUser : IUser { public void AddPost(Post post); } Now my repository looks like this: public interface IUserRepository { User Get<TRole>(Guid userId) where TRole : IUser; } Strategy (Where I'm stuck). What do I do with this code? Can I have an example of how to implement this, where do I put this? public interface IFetchingStrategy<TRole> { TRole Fetch(Guid id, IRepository<TRole> role) } My basic problem was what was asked in this question. I'd like to be able to get Users without posts and users with posts using the strategy pattern.

    Read the article

  • How do I create a graph from this datastructure?

    - by Shawn Mclean
    I took this data structure from this A* tutorial: public interface IHasNeighbours<N> { IEnumerable<N> Neighbours { get; } } public class Path<TNode> : IEnumerable<TNode> { public TNode LastStep { get; private set; } public Path<TNode> PreviousSteps { get; private set; } public double TotalCost { get; private set; } private Path(TNode lastStep, Path<TNode> previousSteps, double totalCost) { LastStep = lastStep; PreviousSteps = previousSteps; TotalCost = totalCost; } public Path(TNode start) : this(start, null, 0) { } public Path<TNode> AddStep(TNode step, double stepCost) { return new Path<TNode>(step, this, TotalCost + stepCost); } public IEnumerator<TNode> GetEnumerator() { for (Path<TNode> p = this; p != null; p = p.PreviousSteps) yield return p.LastStep; } IEnumerator IEnumerable.GetEnumerator() { return this.GetEnumerator(); } } I have no idea how to create a simple graph with. How do I add something like the following undirected graph using C#: Basically I'd like to know how to connect nodes. I have my own datastructures that I can already determine the neighbors and the distance. I'd now like to convert that into this posted datastructure so I can run it through the AStar algorithm. I was seeking something more like: Path<EdgeNode> startGraphNode = new Path<EdgeNode>(tempStartNode); startGraphNode.AddNeighbor(someOtherNode, distance);

    Read the article

  • Should I convert overlong UTF-8 strings to their shortest normal form?

    - by Grant McLean
    I've just been reworking my Encoding::FixLatin Perl module to handle overlong UTF-8 byte sequences and convert them to the shortest normal form. My question is quite simply "is this a bad idea"? A number of sources (including this RFC) suggest that any over-long UTF-8 should be treated as an error and rejected. They caution against "naive implementations" and leave me with the impression that these things are inherently unsafe. Since the whole purpose of my module is to clean up messy data files with mixed encodings and convert them to nice clean utf8, this seems like just one more thing I can clean up so the application layer doesn't have to deal with it. My code does not concern itself with any semantic meaning the resulting characters might have, it simply converts them into a normalised form. Am I missing something. Is there a hidden danger I haven't considered?

    Read the article

  • Quick start on visual studio 2010 with SVN

    - by Shawn Mclean
    The only source control I ever used was SourceGear Vault on my local machine. I need to put a new project on a svn server I got at beanstalkapp. I installed tortoiseSVN and AnkhSVN. I successfully connected everything, I see 3 folders: branches tags trunks I created my project and I want to attach it to the server, which of these folders do I select? What is the use of the these folders?

    Read the article

  • What is this event?

    - by Shawn Mclean
    Could someone explain what this C# code is doing? // launch the camera capture when the user touch the screen this.MouseLeftButtonUp += (s, e) => new CameraCaptureTask().Show(); // this static event is raised when a task completes its job ChooserListener.ChooserCompleted += (s, e) => { //some code here }; I know that CameraCaptureTask is a class and has a public method Show(). What kind of event is this? what is (s, e)?

    Read the article

  • Lexographical sorting problem

    - by Shawn Mclean
    I'm doing a problem that says concatenate the words to generate the lexicographically lowest possible string. from a competition. Take for example this string: jibw ji jp bw jibw The actual output turns out to be: bw jibw jibw ji jp When I do sorting on this, I get: bw ji jibw jibw jp. Does this mean that this is not sorting? If it is sorting, does lexicographic sorting take into consideration pushing the shorter strings to the back or something? I've been doing some reading on lexigographical order and I dont see any point or scenarios on which this is used, do you have any?

    Read the article

  • Applying to a international programming jobs

    - by Shawn Mclean
    If this question is not suited at stackoverflow, could you tell me in comments and suggest a site that I can ask this question and I'll close this. I'm located in Jamaica and in my final semester of a bsc computer science degree. I would like to apply to programming jobs abroad. How do I go about this? What is the sequence to follow and documents needed? Thanks.

    Read the article

  • Is git suitable for one developer without server

    - by Shawn Mclean
    I am a single developer without another computer to backup my projects on. I'm looking into source controls and I came across git but all the setup tutorials are targeted to an external server. I used to use SourceGear Vault, but seeing that git is getting alot of attention, I might as well familiarize myself with it. I do not always have internet access. Is Git suitable for me? Can I be pointed in the right direction to set it up? Visual Studio 2008. Windows 7.

    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

  • Manhattan Heuristic function for A-star (A*)

    - by Shawn Mclean
    I found this algorithm here. I have a problem, I cant seem to understand how to set up and pass my heuristic function. static public Path<TNode> AStar<TNode>(TNode start, TNode destination, Func<TNode, TNode, double> distance, Func<TNode, double> estimate) where TNode : IHasNeighbours<TNode> { var closed = new HashSet<TNode>(); var queue = new PriorityQueue<double, Path<TNode>>(); queue.Enqueue(0, new Path<TNode>(start)); while (!queue.IsEmpty) { var path = queue.Dequeue(); if (closed.Contains(path.LastStep)) continue; if (path.LastStep.Equals(destination)) return path; closed.Add(path.LastStep); foreach (TNode n in path.LastStep.Neighbours) { double d = distance(path.LastStep, n); var newPath = path.AddStep(n, d); queue.Enqueue(newPath.TotalCost + estimate(n), newPath); } } return null; } As you can see, it accepts 2 functions, a distance and a estimate function. Using the Manhattan Heuristic Distance function, I need to take 2 parameters. Do I need to modify his source and change it to accepting 2 parameters of TNode so I can pass a Manhattan estimate to it? This means the 4th param will look like this: Func<TNode, TNode, double> estimate) where TNode : IHasNeighbours<TNode> and change the estimate function to: queue.Enqueue(newPath.TotalCost + estimate(n, path.LastStep), newPath); My Manhattan function is: private float manhattanHeuristic(Vector3 newNode, Vector3 end) { return (Math.Abs(newNode.X - end.X) + Math.Abs(newNode.Y - end.Y)); }

    Read the article

  • ASP.NET MVC Response file should not download

    - by Shawn Mclean
    I am generating a .cxml file on the server and pushing it to the browser based on certain queries. If I just link to a .cxml, it does what I expected and opens it in the respective application. How can I generate a file and push it to the browser just like if it was linked to a file without it asking me to download it? The link looks something like: http://localhost/MyController/GetFile?q=TheQueryStringParam Thanks.

    Read the article

  • Stored Procedure or calculations via IQueryable?

    - by Shawn Mclean
    This is a question that is based on choosing performance over design practices. If I have a method that will be executed many times a second; public static IQueryable<IPerson> InRadius(this IQueryable<IPerson> query, Coordinate center, double radius) { return (from u in query where CallHeavyMathFormula(u, center, radius) select u); } This extension method for IQueryable generates a SQL that does some heavy maths calculation (Cosine, Sine, etc). This would mean the application sends 1-2KB of sql to the server per call. I've heard of placing all application logic, in your application. I also would like to change to a database such as azure or one of those scalable databases in the future. How do I handle something like this? Should I leave it as it is now or write stored procedures? How do applications like twitter or facebook do it?

    Read the article

  • NUnit Assert a list of objects in no order

    - by Shawn Mclean
    How do I Assert a collection of items in no particular order? I just want to make sure all the items are in the list. I'm heard of CollectionAssert but I do not see any method that would do what I want. My object looks like this: public class Vector2{ public float X {get; set;} public float Y {get; set;} } Assert - I want something like this: CollectionAssert.ContainsAll(mesh.GetPolygonVertices(0), aListOfVertices); mesh.GetPolygonVertices(int) returns a List<Vector2> and aListOfVertices contains all of what is returned, but not guaranteed that order.

    Read the article

  • Get records based on child condition

    - by Shawn Mclean
    In LINQ To Entities: How do I get the records (including both child and parent) based on a condition of the child in a one to many. My structure is set up as follows: GetResources() - returns a list of Resources. GetResources().ResourceNames - this is the child, which is an entity collection. GetResources().ResourceNames - a property of one record of this child is Name. I'd like to construct something like this: return (from p in repository.GetResources() where p.ResourceNames.Exist(r => r.Name.Contains(text, StringComparison.CurrentCultureIgnoreCase)) select p).ToList(); but of course, Exist doesn't exist. thanks.

    Read the article

< Previous Page | 1 2 3  | Next Page >